Removed draw asserts for window renderer, because certain commands between frames may want to use draw commands to get the sizes of things. (#1878)

This commit is contained in:
Adam 2024-09-12 21:20:38 -04:00 committed by GitHub
parent 4b70c3e082
commit f5c63d8c8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View File

@ -329,7 +329,6 @@ static RenRect rect_to_grid(lua_Number x, lua_Number y, lua_Number w, lua_Number
static int f_set_clip_rect(lua_State *L) { static int f_set_clip_rect(lua_State *L) {
assert(active_window_renderer != NULL);
lua_Number x = luaL_checknumber(L, 1); lua_Number x = luaL_checknumber(L, 1);
lua_Number y = luaL_checknumber(L, 2); lua_Number y = luaL_checknumber(L, 2);
lua_Number w = luaL_checknumber(L, 3); lua_Number w = luaL_checknumber(L, 3);
@ -341,7 +340,6 @@ static int f_set_clip_rect(lua_State *L) {
static int f_draw_rect(lua_State *L) { static int f_draw_rect(lua_State *L) {
assert(active_window_renderer != NULL);
lua_Number x = luaL_checknumber(L, 1); lua_Number x = luaL_checknumber(L, 1);
lua_Number y = luaL_checknumber(L, 2); lua_Number y = luaL_checknumber(L, 2);
lua_Number w = luaL_checknumber(L, 3); lua_Number w = luaL_checknumber(L, 3);
@ -353,7 +351,6 @@ static int f_draw_rect(lua_State *L) {
} }
static int f_draw_text(lua_State *L) { static int f_draw_text(lua_State *L) {
assert(active_window_renderer != NULL);
RenFont* fonts[FONT_FALLBACK_MAX]; RenFont* fonts[FONT_FALLBACK_MAX];
font_retrieve(L, fonts, 1); font_retrieve(L, fonts, 1);

View File

@ -128,8 +128,9 @@ static bool expand_command_buffer(RenWindow *window_renderer) {
} }
static void* push_command(RenWindow *window_renderer, enum CommandType type, int size) { static void* push_command(RenWindow *window_renderer, enum CommandType type, int size) {
if (resize_issue) { if (!window_renderer || resize_issue) {
// Don't push new commands as we had problems resizing the command buffer. // Don't push new commands as we had problems resizing the command buffer.
// Or, we don't have an active buffer.
// Let's wait for the next frame. // Let's wait for the next frame.
return NULL; return NULL;
} }