Make zero length arrays ptrs, finish Raylib prog
Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
parent
1caebf3295
commit
3b70d9786c
25
pong.cat
25
pong.cat
@ -9,6 +9,8 @@ fn SetTargetFPS(fps: i32)
|
|||||||
fn EndDrawing
|
fn EndDrawing
|
||||||
fn DrawFPS(x y: i32)
|
fn DrawFPS(x y: i32)
|
||||||
fn WindowShouldClose i32
|
fn WindowShouldClose i32
|
||||||
|
fn TextSubtext(text: []u8, start end: i32) []u8
|
||||||
|
fn IsKeyPressed(key: i32) u1
|
||||||
|
|
||||||
struct Rectangle {
|
struct Rectangle {
|
||||||
x y w h: f32,
|
x y w h: f32,
|
||||||
@ -103,12 +105,26 @@ for WindowShouldClose == 0 {
|
|||||||
state = 4
|
state = 4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if IsKeyPressed(82) { \ KEY_R
|
||||||
|
fc = 0
|
||||||
|
lc = 0
|
||||||
|
|
||||||
|
top_side_rec_width = 16
|
||||||
|
left_side_rec_height = 16
|
||||||
|
bottom_side_rec_width = 16
|
||||||
|
right_side_rec_height = 16
|
||||||
|
|
||||||
|
state = 0
|
||||||
|
alpha = 1.0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BeginDrawing
|
BeginDrawing
|
||||||
ClearBackgroundWrap WHITE
|
ClearBackgroundWrap WHITE
|
||||||
if state == 0 {
|
|
||||||
DrawFPS 20 20
|
DrawFPS 20 20
|
||||||
|
|
||||||
|
if state == 0 {
|
||||||
if (fc/15)%2 != 0 {
|
if (fc/15)%2 != 0 {
|
||||||
DrawRectangleWrap logox logoy 16 16 BLACK
|
DrawRectangleWrap logox logoy 16 16 BLACK
|
||||||
}
|
}
|
||||||
@ -134,12 +150,11 @@ for WindowShouldClose == 0 {
|
|||||||
|
|
||||||
DrawRectangleWrap GetScreenWidth/2-112 GetScreenHeight/2-112 224 224 colorw
|
DrawRectangleWrap GetScreenWidth/2-112 GetScreenHeight/2-112 224 224 colorw
|
||||||
|
|
||||||
\ DrawText(TextSubtext("raylib", 0, lettersCount), GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48, 50, Fade(BLACK, alpha));
|
DrawTextWrap (TextSubtext "raylib" 0 lc) GetScreenWidth/2-44 GetScreenHeight/2+48 50 colorb
|
||||||
\ DrawTextWrap "raylib" GetScreenWidth/2-44 GetScreenHeight/2+48 50 BLACK
|
} else {
|
||||||
|
DrawTextWrap "[R] REPLAY" 340 200 20 BLACK
|
||||||
}
|
}
|
||||||
EndDrawing
|
EndDrawing
|
||||||
}
|
}
|
||||||
CloseWindow
|
CloseWindow
|
||||||
|
|
||||||
"asf"
|
|
||||||
|
|
||||||
|
@ -145,7 +145,11 @@ generate_llvm :: proc(ctx: LLVMContextRef, mod: LLVMModuleRef, builder: LLVMBuil
|
|||||||
}
|
}
|
||||||
case .Array:
|
case .Array:
|
||||||
array_of := generate_llvm_type_from_node(ctx, mod, builder, type.array_of)
|
array_of := generate_llvm_type_from_node(ctx, mod, builder, type.array_of)
|
||||||
return LLVMArrayType2(array_of, type.array_size)
|
if type.array_size == 0 {
|
||||||
|
return LLVMPointerType(array_of, 0)
|
||||||
|
} else {
|
||||||
|
return LLVMArrayType2(array_of, type.array_size)
|
||||||
|
}
|
||||||
case .Pointer:
|
case .Pointer:
|
||||||
pointer_of := generate_llvm_type_from_node(ctx, mod, builder, type.pointer_to)
|
pointer_of := generate_llvm_type_from_node(ctx, mod, builder, type.pointer_to)
|
||||||
return LLVMPointerType(pointer_of, 0)
|
return LLVMPointerType(pointer_of, 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user