Core: Fix casting binding
This commit is contained in:
@@ -23,11 +23,12 @@ IntegerToString :: (value: int, result: *U8, base: int): *U8
|
|||||||
ptr1 := result
|
ptr1 := result
|
||||||
tmp_char: U8
|
tmp_char: U8
|
||||||
tmp_value: int
|
tmp_value: int
|
||||||
|
str := "zyxwvutsrqponmlkjihgfedcba9876543210123456789abcdefghijklmnopqrstuvwxyz"
|
||||||
|
|
||||||
for value != 0
|
for value != 0
|
||||||
tmp_value = value
|
tmp_value = value
|
||||||
value /= base
|
value /= base
|
||||||
*ptr++ = "zyxwvutsrqponmlkjihgfedcba9876543210123456789abcdefghijklmnopqrstuvwxyz"[35 + (tmp_value - value * base)]
|
*ptr++ = str[35 + (tmp_value - value * base)]
|
||||||
|
|
||||||
// Apply negative sign
|
// Apply negative sign
|
||||||
if tmp_value < 0
|
if tmp_value < 0
|
||||||
|
|||||||
@@ -45,9 +45,6 @@ GetIndex :: (a: *Array($T), item: *T): int
|
|||||||
Assert(a.len > 0)
|
Assert(a.len > 0)
|
||||||
Assert(item >= a.data && item < a.data + a.len)
|
Assert(item >= a.data && item < a.data + a.len)
|
||||||
|
|
||||||
// @reproduction: compiler hangs
|
|
||||||
// index := (item - a.data)->*void->size_t
|
|
||||||
|
|
||||||
index := (item - a.data)->int
|
index := (item - a.data)->int
|
||||||
Assert(index >= 0 && index < a.len)
|
Assert(index >= 0 && index < a.len)
|
||||||
return index
|
return index
|
||||||
|
|||||||
@@ -45,6 +45,13 @@ guys: Array(Guy)
|
|||||||
Add(&guys, {100, 100})
|
Add(&guys, {100, 100})
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* @language_todo: Namespacing
|
||||||
|
|
||||||
|
this requires parent_decl in scopes, we use first namespace(main module has precedence) declaration to
|
||||||
|
prefix all functions, globals etc. in a given file / module.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
#import "raylib.core"
|
#import "raylib.core"
|
||||||
#load "array.core"
|
#load "array.core"
|
||||||
MAP :: #load "map.core"
|
MAP :: #load "map.core"
|
||||||
@@ -110,6 +117,7 @@ main :: (): int
|
|||||||
MouseP = GetMousePosition()
|
MouseP = GetMousePosition()
|
||||||
Dt = GetFrameTime()
|
Dt = GetFrameTime()
|
||||||
map := &MAP.CurrentMap
|
map := &MAP.CurrentMap
|
||||||
|
ai := GetIndex(&map.actors, map.actors.data)
|
||||||
|
|
||||||
MouseSelecting = false
|
MouseSelecting = false
|
||||||
if IsMouseButtonDown(MOUSE_BUTTON_LEFT)
|
if IsMouseButtonDown(MOUSE_BUTTON_LEFT)
|
||||||
|
|||||||
@@ -594,7 +594,7 @@ Infix:
|
|||||||
case TK_Dot:
|
case TK_Dot:
|
||||||
return {31, 30};
|
return {31, 30};
|
||||||
case TK_Arrow:
|
case TK_Arrow:
|
||||||
return {20, 19};
|
return {20, 21};
|
||||||
default: return {};
|
default: return {};
|
||||||
}
|
}
|
||||||
Postfix:
|
Postfix:
|
||||||
|
|||||||
Reference in New Issue
Block a user