Skip to content

Commit

Permalink
Clear screen in render if we failed to load a render function
Browse files Browse the repository at this point in the history
Better than flickering uninitialised data
  • Loading branch information
Daft-Freak committed Nov 9, 2023
1 parent 9eb2bc7 commit 6ed2b0d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ void init() {
}

void render(uint32_t time) {
if(!has_render) return;
if(!has_render) {
blit::screen.pen = {0, 0, 0};
blit::screen.clear();
return;
}

uint32_t ms_start = now();
lua_getglobal(L, "render");
lua_pushnumber(L, time);
Expand Down

0 comments on commit 6ed2b0d

Please sign in to comment.