mirror of
https://github.com/Rosalie241/RMG.git
synced 2026-07-11 01:24:01 +02:00
RMG-Core: add CoreSetInitialVideoSize()
This commit is contained in:
@@ -511,6 +511,17 @@ CORE_EXPORT bool CorePluginsOpenROMConfig(CorePluginType type, void* parent, std
|
||||
return open_plugin_config(type, parent, true, file);
|
||||
}
|
||||
|
||||
CORE_EXPORT void CoreSetInitialVideoSize(int width, int height)
|
||||
{
|
||||
m64p::PluginApi& plugin = get_plugin(CorePluginType::Gfx);
|
||||
if (!plugin.IsHooked() || plugin.SetInitialVideoSize == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
plugin.SetInitialVideoSize(width, height);
|
||||
}
|
||||
|
||||
CORE_EXPORT bool CoreAttachPlugins(void)
|
||||
{
|
||||
std::string error;
|
||||
|
||||
@@ -62,6 +62,9 @@ bool CorePluginsHasROMConfig(CorePluginType type);
|
||||
// used plugin of given type
|
||||
bool CorePluginsOpenROMConfig(CorePluginType type, void* parent = nullptr, std::filesystem::path file = "");
|
||||
|
||||
// sets initial video size for the video plugin
|
||||
void CoreSetInitialVideoSize(int width, int height);
|
||||
|
||||
// attaches all used plugins
|
||||
bool CoreAttachPlugins(void);
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ bool PluginApi::Hook(m64p_dynlib_handle handle)
|
||||
HOOK_FUNC(handle, Plugin, Shutdown);
|
||||
HOOK_FUNC_OPT(handle, Plugin, Config);
|
||||
HOOK_FUNC_OPT(handle, Plugin, ConfigWithRomConfig);
|
||||
HOOK_FUNC_OPT(handle, , SetInitialVideoSize);
|
||||
HOOK_FUNC(handle, Plugin, GetVersion);
|
||||
|
||||
this->handle = handle;
|
||||
@@ -42,6 +43,7 @@ bool PluginApi::Unhook(void)
|
||||
UNHOOK_FUNC(Plugin, Shutdown);
|
||||
UNHOOK_FUNC(Plugin, Config);
|
||||
UNHOOK_FUNC(Plugin, ConfigWithRomConfig);
|
||||
UNHOOK_FUNC(Plugin, SetInitialVideoSize);
|
||||
UNHOOK_FUNC(Plugin, GetVersion);
|
||||
|
||||
this->handle = nullptr;
|
||||
|
||||
@@ -37,6 +37,7 @@ class PluginApi
|
||||
ptr_PluginShutdown Shutdown;
|
||||
ptr_PluginConfig Config;
|
||||
ptr_PluginConfigWithRomConfig ConfigWithRomConfig;
|
||||
ptr_SetInitialVideoSize SetInitialVideoSize;
|
||||
ptr_PluginGetVersion GetVersion;
|
||||
|
||||
private:
|
||||
|
||||
@@ -39,6 +39,17 @@ typedef m64p_error (*ptr_PluginConfigWithRomConfig)(void*, int, CoreRomHeader*,
|
||||
EXPORT m64p_error CALL PluginConfigWithRomConfig(void*, int, CoreRomHeader*, CoreRomSettings*);
|
||||
#endif
|
||||
|
||||
/* SetInitialVideoSize(int width, int height)
|
||||
*
|
||||
* This optional function allows a front-end to set the initial video
|
||||
* size for a video plugin.
|
||||
*
|
||||
*/
|
||||
typedef void (*ptr_SetInitialVideoSize)(int width, int height);
|
||||
#if defined(M64P_PLUGIN_PROTOTYPES) || defined(M64P_CORE_PROTOTYPES)
|
||||
EXPORT void CALL SetInitialVideoSize(int width, int height);
|
||||
#endif
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user