Use Game Maker conventions for resource names

This commit is contained in:
Pyrex 2024-02-27 16:00:57 -08:00
parent 08f279e340
commit 407a984300
9 changed files with 14 additions and 14 deletions

View File

@ -3,6 +3,6 @@
#include "sys/sys.h" #include "sys/sys.h"
extern sys_spritesheet game_player; extern sys_spritesheet spr_game_player;
#endif // CROCPARTY_GAME_PLAYER_H #endif // CROCPARTY_GAME_PLAYER_H

View File

@ -3,6 +3,6 @@
#include "sys/sys.h" #include "sys/sys.h"
extern sys_spritesheet game_tiles; extern sys_spritesheet spr_game_tiles;
#endif // CROCPARTY_GAME_TILES_H #endif // CROCPARTY_GAME_TILES_H

View File

@ -28,9 +28,9 @@ void game_update() {
void game_draw() { void game_draw() {
sys_cls(9); sys_cls(9);
sys_map_draw(game_map, game_tiles, 0, 0, 0, 0, 32, 18); sys_map_draw(map_game_map, spr_game_tiles, 0, 0, 0, 0, 32, 18);
sys_sprite_draw_ext( sys_sprite_draw_ext(
game_player, spr_game_player,
(game_frame / 8) % 4 * 2, 144, 88, 2, 2, (game_frame / 8) % 4 * 2, 144, 88, 2, 2,
false, false false, false
); );

View File

@ -5,7 +5,7 @@
extern sys_i32 game_map_player_start_x; extern sys_i32 game_map_player_start_x;
extern sys_i32 game_map_player_start_y; extern sys_i32 game_map_player_start_y;
extern sys_map game_map; extern sys_map map_game_map;
#endif #endif

View File

@ -6,7 +6,7 @@ import shared
TEMPLATE = """ TEMPLATE = """
// generated code! be nice! // generated code! be nice!
#include "sys/sys.h" #include "sys/sys.h"
sys_glyph {{ font_name }}[{{ n_glyphs }}] = { {{- glyphs|join(", ") -}} }; sys_glyph font_{{ font_name }}[{{ n_glyphs }}] = { {{- glyphs|join(", ") -}} };
""".lstrip() """.lstrip()

View File

@ -6,9 +6,9 @@ TEMPLATE = """
// generated code! be nice // generated code! be nice
#include "sys/sys.h" #include "sys/sys.h"
sys_maptile {{map_name}}_data[{{width * height}}] = { {{ tiles|join(",") }} }; sys_maptile map_{{map_name}}_data[{{width * height}}] = { {{ tiles|join(",") }} };
sys_map {{map_name}} = { sys_map map_{{map_name}} = {
.tiles={{map_name}}_data, .tiles=map_{{map_name}}_data,
.width={{width}}, .width={{width}},
.height={{height}}, .height={{height}},
}; };

View File

@ -6,7 +6,7 @@ import shared
TEMPLATE = """ TEMPLATE = """
// generated code! be nice! // generated code! be nice!
#include "sys/sys.h" #include "sys/sys.h"
sys_sprite {{spritesheet_name}}_data[{{n_sprites}}] = { sys_sprite spr_{{spritesheet_name}}_data[{{n_sprites}}] = {
{% for sprite in sprites -%} {% for sprite in sprites -%}
{ .pixels={ { .pixels={
{% for row in sprite -%} {% for row in sprite -%}
@ -15,8 +15,8 @@ sys_sprite {{spritesheet_name}}_data[{{n_sprites}}] = {
} }{% if not loop.last %},{% endif %} } }{% if not loop.last %},{% endif %}
{%- endfor %} {%- endfor %}
}; };
sys_spritesheet {{spritesheet_name}} = { sys_spritesheet spr_{{spritesheet_name}} = {
.sprites={{spritesheet_name}}_data, .sprites=spr_{{spritesheet_name}}_data,
.width={{width}}, .width={{width}},
.height={{height}}, .height={{height}},
}; };

View File

@ -3,6 +3,6 @@
#include "sys/sys.h" #include "sys/sys.h"
extern sys_glyph sys_font_small[256]; extern sys_glyph font_sys_font_small[256];
#endif // CROCPARTY_SYS_FONT_SMALL_H #endif // CROCPARTY_SYS_FONT_SMALL_H

View File

@ -64,7 +64,7 @@ void sys_print(char* str, sys_i32 x, sys_i32 y, sys_color col) {
if (c == 0) { break; } if (c == 0) { break; }
if (c == '\n') { x = x_orig; y += 8; continue; } if (c == '\n') { x = x_orig; y += 8; continue; }
if (c == '\r') { x = x_orig; continue; } if (c == '\r') { x = x_orig; continue; }
sys_glyph_internal_draw(x, y, sys_font_small[c], col); sys_glyph_internal_draw(x, y, font_sys_font_small[c], col);
x += 8; x += 8;
} }
} }