Mercurial > love-experiments
diff src/modules/graphics/opengl/Graphics.cpp @ 1418:357697c2e2a8
More internal code cleanup
| author | Alex Szpakowski <slime73@gmail.com> |
|---|---|
| date | Sun, 31 Mar 2013 19:02:27 -0300 |
| parents | 2b1dbb6e49bf |
| children | 2a5ef265e040 86757de71c7c |
line wrap: on
line diff
--- a/src/modules/graphics/opengl/Graphics.cpp Sun Mar 31 04:55:03 2013 -0300 +++ b/src/modules/graphics/opengl/Graphics.cpp Sun Mar 31 19:02:27 2013 -0300 @@ -272,33 +272,29 @@ int Graphics::getModes(lua_State *L) const { int n; - love::window::Window::WindowSize **modes = currentWindow->getFullscreenSizes(n); + love::window::Window::WindowSize *modes = currentWindow->getFullscreenSizes(n); if (modes == 0) return 0; - lua_newtable(L); + lua_createtable(L, n, 0); for (int i = 0; i < n ; i++) { lua_pushinteger(L, i+1); - lua_newtable(L); + lua_createtable(L, 0, 2); // Inner table attribs. - lua_pushstring(L, "width"); - lua_pushinteger(L, modes[i]->width); - lua_settable(L, -3); + lua_pushinteger(L, modes[i].width); + lua_setfield(L, -2, "width"); - lua_pushstring(L, "height"); - lua_pushinteger(L, modes[i]->height); - lua_settable(L, -3); + lua_pushinteger(L, modes[i].height); + lua_setfield(L, -2, "height"); // Inner table attribs end. lua_settable(L, -3); - - delete modes[i]; } delete[] modes;
