Update to constdef

This commit is contained in:
Christoffer Lerno
2026-02-19 12:16:46 +01:00
committed by Christoffer Lerno
parent 0387d7666d
commit 5a82f672b5
52 changed files with 189 additions and 182 deletions

View File

@@ -1,15 +1,13 @@
module gl;
alias BitField = int;
enum BufferBit : int (int value)
constdef BufferBit : int
{
COLOR = 0x00004000,
STENCIL = 0x00000400,
DEPTH = 0x00000100,
}
enum Primitive : int (int value)
constdef Primitive : int
{
POINTS = 0,
LINES = 1,
@@ -23,9 +21,9 @@ enum Primitive : int (int value)
POLYGON = 9,
}
extern fn void clear(BitField mask) @cname("glClear") @public;
extern fn void clear(BufferBit mask) @cname("glClear") @public;
extern fn void begin(BitField mask) @cname("glBegin") @public;
extern fn void begin(BufferBit mask) @cname("glBegin") @public;
extern fn void end() @cname("glEnd") @public;

View File

@@ -45,11 +45,11 @@ alias CameraUpdateFn = fn void(RLCamera2D* camera, Player* player, EnvItem[] env
enum CameraUpdateType : (ZString text, CameraUpdateFn func)
{
CENTER = { "Follow player center", &update_camera_center },
CENTER_INSIDE_MAP = { "Follow player center, but clamp to map edges", &update_camera_center_inside_map },
CENTER_SMOOTH_FOLLOW = { "Follow player center; smoothed", &update_camera_center_smooth_follow },
EVEN_OUT_ON_LANDING = { "Follow player center horizontally; update player center vertically after landing", &update_camera_even_out_on_landing },
PLAYER_BOUNDS_PUSH = { "Player push camera on getting too close to screen edge", &update_camera_player_bounds_push }
CENTER { "Follow player center", &update_camera_center },
CENTER_INSIDE_MAP { "Follow player center, but clamp to map edges", &update_camera_center_inside_map },
CENTER_SMOOTH_FOLLOW { "Follow player center; smoothed", &update_camera_center_smooth_follow },
EVEN_OUT_ON_LANDING { "Follow player center horizontally; update player center vertically after landing", &update_camera_even_out_on_landing },
PLAYER_BOUNDS_PUSH { "Player push camera on getting too close to screen edge", &update_camera_player_bounds_push }
}
//------------------------------------------------------------------------------------

View File

@@ -18,10 +18,10 @@ const int SCREEN_HEIGHT = 450;
enum SnakeDirection : (RLVector2 dir)
{
RIGHT = { SQUARE_SIZE, 0 },
DOWN = { 0, SQUARE_SIZE },
LEFT = { -SQUARE_SIZE, 0 },
UP = { 0, -SQUARE_SIZE }
RIGHT {{ SQUARE_SIZE, 0 }},
DOWN {{ 0, SQUARE_SIZE }},
LEFT {{ -SQUARE_SIZE, 0 }},
UP {{ 0, -SQUARE_SIZE }}
}
struct Snake
{