From 66529d1db415dfa45b83ca564fecbec2f8c607ab Mon Sep 17 00:00:00 2001 From: jsalmon3 <> Date: Mon, 25 Oct 2004 01:08:39 +0000 Subject: [PATCH] Added GetVideoResolution and GetVideoFullScreen --- src/ui/script_ui.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/ui/script_ui.cpp b/src/ui/script_ui.cpp index d9e2d6cc2..9cacc6735 100644 --- a/src/ui/script_ui.cpp +++ b/src/ui/script_ui.cpp @@ -188,6 +188,21 @@ static int CclSetVideoResolution(lua_State* l) return 0; } +/** +** Get the video resolution. +** +** @param l Lua state. +*/ +static int CclGetVideoResolution(lua_State* l) +{ + if (lua_gettop(l) != 0) { + LuaError(l, "incorrect argument"); + } + lua_pushnumber(l, VideoWidth); + lua_pushnumber(l, VideoHeight); + return 2; +} + /** ** Set the video fullscreen mode. ** @@ -207,6 +222,20 @@ static int CclSetVideoFullScreen(lua_State* l) return 0; } +/** +** Get the video fullscreen mode. +** +** @param l Lua state. +*/ +static int CclGetVideoFullScreen(lua_State* l) +{ + if (lua_gettop(l) != 0) { + LuaError(l, "incorrect argument"); + } + lua_pushboolean(l, VideoFullScreen); + return 1; +} + /** ** Default title screens. ** @@ -4520,7 +4549,9 @@ void UserInterfaceCclRegister(void) lua_register(Lua, "SetDamageMissile", CclSetDamageMissile); lua_register(Lua, "SetVideoResolution", CclSetVideoResolution); + lua_register(Lua, "GetVideoResolution", CclGetVideoResolution); lua_register(Lua, "SetVideoFullScreen", CclSetVideoFullScreen); + lua_register(Lua, "GetVideoFullScreen", CclGetVideoFullScreen); lua_register(Lua, "SetTitleScreens", CclSetTitleScreens); lua_register(Lua, "SetMenuMusic", CclSetMenuMusic);