mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-10-29 23:36:02 +03:00
chore(ui): move Video Script methods into CGVideoOptions class
This commit is contained in:
parent
c03ea57e21
commit
17a3f67971
@ -4,6 +4,7 @@
|
||||
#include "client/ClientServices.hpp"
|
||||
#include "gx/Coordinate.hpp"
|
||||
#include "gx/Device.hpp"
|
||||
#include "gx/CGVideoOptions.hpp"
|
||||
#include "math/Utils.hpp"
|
||||
#include "net/Connection.hpp"
|
||||
#include "net/Login.hpp"
|
||||
@ -512,7 +513,8 @@ void CGlueMgr::Resume() {
|
||||
|
||||
// TODO
|
||||
// AccountMsg_RegisterScriptFunctions();
|
||||
// CGVideoOptions::RegisterScriptFunctions();
|
||||
|
||||
CGVideoOptions::RegisterScriptFunctions();
|
||||
|
||||
// TODO
|
||||
// FrameScript::s_scriptFunctionsLoaded = 1;
|
||||
|
||||
45
src/gx/CGVideoOptions.cpp
Normal file
45
src/gx/CGVideoOptions.cpp
Normal file
@ -0,0 +1,45 @@
|
||||
#include "gx/CGVideoOptions.hpp"
|
||||
#include "ui/FrameScript.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
||||
int32_t Script_GetCurrentResolution(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_GetScreenResolutions(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_GetRefreshRates(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_GetCurrentMultisampleFormat(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_GetMultisampleFormats(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_IsStereoVideoAvailable(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
FrameScript_Method CGVideoOptions::s_ScriptFunctions[] = {
|
||||
{ "GetCurrentResolution", &Script_GetCurrentResolution },
|
||||
{ "GetScreenResolutions", &Script_GetScreenResolutions },
|
||||
{ "GetRefreshRates", &Script_GetRefreshRates },
|
||||
{ "GetCurrentMultisampleFormat", &Script_GetCurrentMultisampleFormat },
|
||||
{ "GetMultisampleFormats", &Script_GetMultisampleFormats },
|
||||
{ "IsStereoVideoAvailable", &Script_IsStereoVideoAvailable },
|
||||
{ nullptr, nullptr }
|
||||
};
|
||||
|
||||
void CGVideoOptions::RegisterScriptFunctions() {
|
||||
FrameScript_Method* item = s_ScriptFunctions;
|
||||
while (item->name) {
|
||||
FrameScript_RegisterFunction(item->name, item->method);
|
||||
item++;
|
||||
}
|
||||
}
|
||||
16
src/gx/CGVideoOptions.hpp
Normal file
16
src/gx/CGVideoOptions.hpp
Normal file
@ -0,0 +1,16 @@
|
||||
#ifndef GX_C_GX_VIDEO_OPTIONS_HPP
|
||||
#define GX_C_GX_VIDEO_OPTIONS_HPP
|
||||
|
||||
#include "ui/Types.hpp"
|
||||
#include <cstdint>
|
||||
|
||||
class CGVideoOptions {
|
||||
public:
|
||||
// Static variables
|
||||
static FrameScript_Method s_ScriptFunctions[];
|
||||
|
||||
// Static functions
|
||||
static void RegisterScriptFunctions();
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -11,7 +11,7 @@ struct lua_State;
|
||||
#define NUM_SCRIPT_FUNCTIONS_GLUE_SCRIPT_EVENTS 113
|
||||
#define NUM_SCRIPT_FUNCTIONS_REALM_LIST 14
|
||||
#define NUM_SCRIPT_FUNCTIONS_SIMPLE_FRAME 7
|
||||
#define NUM_SCRIPT_FUNCTIONS_SYSTEM 13
|
||||
#define NUM_SCRIPT_FUNCTIONS_SYSTEM 7
|
||||
|
||||
namespace FrameScript {
|
||||
extern FrameScript_Method s_ScriptFunctions_CharCreate[NUM_SCRIPT_FUNCTIONS_CHAR_CREATE];
|
||||
@ -210,6 +210,5 @@ int32_t Script_GetTime(lua_State*);
|
||||
int32_t Script_GetGameTime(lua_State*);
|
||||
int32_t Script_ConsoleExec(lua_State*);
|
||||
int32_t Script_AccessDenied(lua_State*);
|
||||
int32_t Script_GetCurrentResolution(lua_State*);
|
||||
|
||||
#endif
|
||||
|
||||
@ -24,30 +24,6 @@ int32_t Script_AccessDenied(lua_State* L) {
|
||||
return luaL_error(L, "Access Denied");
|
||||
}
|
||||
|
||||
int32_t Script_GetCurrentResolution(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_GetScreenResolutions(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_GetRefreshRates(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_GetCurrentMultisampleFormat(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_GetMultisampleFormats(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_IsStereoVideoAvailable(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
FrameScript_Method FrameScript::s_ScriptFunctions_System[NUM_SCRIPT_FUNCTIONS_SYSTEM] = {
|
||||
{ "GetTime", &Script_GetTime },
|
||||
{ "GetGameTime", &Script_GetGameTime },
|
||||
@ -55,11 +31,5 @@ FrameScript_Method FrameScript::s_ScriptFunctions_System[NUM_SCRIPT_FUNCTIONS_SY
|
||||
{ "ReadFile", &Script_AccessDenied },
|
||||
{ "DeleteFile", &Script_AccessDenied },
|
||||
{ "AppendToFile", &Script_AccessDenied },
|
||||
{ "GetAccountExpansionLevel", &Script_GetAccountExpansionLevel },
|
||||
{ "GetCurrentResolution", &Script_GetCurrentResolution },
|
||||
{ "GetScreenResolutions", &Script_GetScreenResolutions },
|
||||
{ "GetRefreshRates", &Script_GetRefreshRates },
|
||||
{ "GetCurrentMultisampleFormat", &Script_GetCurrentMultisampleFormat },
|
||||
{ "GetMultisampleFormats", &Script_GetMultisampleFormats },
|
||||
{ "IsStereoVideoAvailable", &Script_IsStereoVideoAvailable },
|
||||
{ "GetAccountExpansionLevel", &Script_GetAccountExpansionLevel }
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user