Skip to content
Snippets Groups Projects
Commit 9f697c84 authored by DarkGod's avatar DarkGod
Browse files

fix whoops

parent 3a223e49
No related branches found
No related tags found
No related merge requests found
......@@ -2216,7 +2216,12 @@ static int gl_scissor(lua_State *L)
{
if (lua_toboolean(L, 1)) {
glEnable(GL_SCISSOR_TEST);
glScissor(luaL_checknumber(L, 2), screen->h - luaL_checknumber(L, 3) - luaL_checknumber(L, 5), luaL_checknumber(L, 4), luaL_checknumber(L, 5));
float x = luaL_checknumber(L, 2);
float y = luaL_checknumber(L, 3);
float w = luaL_checknumber(L, 4);
float h = luaL_checknumber(L, 5);
y = screen->h / screen_zoom - y - h;
glScissor(x, y, w, h);
} else glDisable(GL_SCISSOR_TEST);
return 0;
}
......
......@@ -459,8 +459,8 @@ bool on_event(SDL_Event *event)
}
return TRUE;
case SDL_MOUSEMOTION:
mousex = event->motion.x;
mousey = event->motion.y;
mousex = event->motion.x / screen_zoom;
mousey = event->motion.y / screen_zoom;
if (current_mousehandler != LUA_NOREF)
{
......
......@@ -46,13 +46,13 @@ static int draw_last_frame(lua_State *L)
{
if (!bkg_t) return 0;
int w, h;
SDL_GetWindowSize(window, &w, &h);
float w = screen->w / screen_zoom;
float h = screen->h / screen_zoom;
GLfloat btexcoords[2*4] = {
0, (float)h/(float)bkg_realh,
(float)w/(float)bkg_realw, (float)h/(float)bkg_realh,
(float)w/(float)bkg_realw, 0,
0, (float)screen->h/(float)bkg_realh,
(float)screen->w/(float)bkg_realw, (float)screen->h/(float)bkg_realh,
(float)screen->w/(float)bkg_realw, 0,
0, 0
};
GLfloat bcolors[4*4] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
......@@ -119,8 +119,8 @@ static int enable(lua_State *L)
SDL_GL_SwapWindow(window);
int w, h;
SDL_GetWindowSize(window, &w, &h);
float w = screen->w;
float h = screen->h;
bkg_w = w;
bkg_h = h;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment