diff --git a/mods/main/script/main.lua b/mods/main/script/main.lua index 4428de7..af815c7 100644 --- a/mods/main/script/main.lua +++ b/mods/main/script/main.lua @@ -19,7 +19,7 @@ end lastFrame = 0 function tick() - engine_texture_render_2d(texture,math.random(0,88),math.random(0,56)) + engine_texture_render_2d(texture,math.random(-8,102),math.random(-8,72)) engine_window_present() trackFps() local curFrame = engine_time_get() diff --git a/src/engine/frontend/generic/textures.c b/src/engine/frontend/generic/textures.c index f58321b..637e421 100644 --- a/src/engine/frontend/generic/textures.c +++ b/src/engine/frontend/generic/textures.c @@ -51,7 +51,7 @@ void engine_texture_render_2d(struct ENGINE_TEXTURE * texture,int sx,int sy) { int ex = sx + texture->width; if (ex > engine_width) { ex = engine_width; } int ey = sy + texture->height; - if (ey > engine_width) { ey = engine_height; } + if (ey > engine_height) { ey = engine_height; } int x = sx; if (x < 0) { x = 0; } int y = sy;