refactor: optimize snake sprite rendering using preloaded directional assets and implement HUD caching
This commit is contained in:
1 parent
db9013c9c5
commit
60740a53c2
5 files changed
+268
-152
No files matched your search
@@ -26,6 +26,7 @@ bool handle_input_frame(InputContext &ctx) {
|
||||
setBackdropColor(RGB15(0, 0, 0));
|
||||
consoleSelect(ctx.topScreen);
|
||||
consoleClear();
|
||||
invalidate_hud(*ctx.renderAssets);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,11 +116,13 @@ bool handle_input_frame(InputContext &ctx) {
|
||||
audio_play_pause(*ctx.audio);
|
||||
audio_pause_music_if_enabled(*ctx.audio);
|
||||
puts("\x1b[11;12HPaused");
|
||||
invalidate_hud(*ctx.renderAssets);
|
||||
} else {
|
||||
audio_resume_music_if_enabled(*ctx.audio);
|
||||
audio_play_unpause(*ctx.audio);
|
||||
consoleSelect(ctx.topScreen);
|
||||
consoleClear();
|
||||
invalidate_hud(*ctx.renderAssets);
|
||||
}
|
||||
} else {
|
||||
ctx.init_game();
|
||||
|
||||
Reference in new issue
Block a user