![]() |
Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <Game.h>
Classes | |
class | CStream |
Public Member Functions | |
CInstanceGame () | |
Game class constructor. | |
~CInstanceGame () override=default | |
Destructor. | |
std::string | GameClientDllPath () const |
Callback to Kodi Function The path of the game client being loaded. | |
bool | ProxyDllPaths (std::vector< std::string > &paths) |
Callback to Kodi Function Paths to proxy DLLs used to load the game client. | |
bool | ResourceDirectories (std::vector< std::string > &dirs) |
Callback to Kodi Function The "system" directories of the frontend. | |
std::string | ProfileDirectory () const |
Callback to Kodi Function The writable directory of the frontend. | |
bool | SupportsVFS () const |
Callback to Kodi Function The value of the <supports_vfs> property from addon.xml. | |
bool | Extensions (std::vector< std::string > &extensions) |
Callback to Kodi Function The extensions in the <extensions> property from addon.xml. | |
virtual GAME_ERROR | LoadGame (const std::string &url) |
Load a game. | |
virtual GAME_ERROR | LoadGameSpecial (SPECIAL_GAME_TYPE type, const std::vector< std::string > &urls) |
Load a game that requires multiple files. | |
virtual GAME_ERROR | LoadStandalone () |
Begin playing without a game file. | |
virtual GAME_ERROR | UnloadGame () |
Unload the current game. | |
virtual GAME_ERROR | GetGameTiming (game_system_timing &timing_info) |
Get timing information about the loaded game. | |
virtual GAME_REGION | GetRegion () |
Get region of the loaded game. | |
virtual bool | RequiresGameLoop () |
Return true if the client requires the frontend to provide a game loop. | |
virtual GAME_ERROR | RunFrame () |
Run a single frame for add-ons that use a game loop. | |
virtual GAME_ERROR | Reset () |
Reset the current game. | |
void | CloseGame (void) |
Callback to Kodi Function Requests the frontend to stop the current game | |
virtual GAME_ERROR | HwContextReset () |
Invalidates the current HW context and reinitializes GPU resources. | |
virtual GAME_ERROR | HwContextDestroy () |
Called before the context is destroyed. | |
game_proc_address_t | HwGetProcAddress (const char *sym) |
Callback to Kodi Function Get a symbol from the hardware context | |
virtual bool | HasFeature (const std::string &controller_id, const std::string &feature_name) |
Check if input is accepted for a feature on the controller. | |
virtual game_input_topology * | GetTopology () |
Get the input topology that specifies which controllers can be connected. | |
virtual void | FreeTopology (game_input_topology *topology) |
Free the topology's resources. | |
virtual void | SetControllerLayouts (const std::vector< kodi::addon::GameControllerLayout > &controllers) |
Set the layouts for known controllers. | |
virtual bool | EnableKeyboard (bool enable, const std::string &controller_id) |
Enable/disable keyboard input using the specified controller. | |
virtual bool | EnableMouse (bool enable, const std::string &controller_id) |
Enable/disable mouse input using the specified controller. | |
virtual bool | ConnectController (bool connect, const std::string &port_address, const std::string &controller_id) |
Connect/disconnect a controller to a port on the virtual game console. | |
virtual bool | InputEvent (const game_input_event &event) |
Notify the add-on of an input event. | |
bool | KodiInputEvent (const game_input_event &event) |
Callback to Kodi Function Notify the port of an input event | |
virtual size_t | SerializeSize () |
Get the number of bytes required to serialize the game. | |
virtual GAME_ERROR | Serialize (uint8_t *data, size_t size) |
Serialize the state of the game. | |
virtual GAME_ERROR | Deserialize (const uint8_t *data, size_t size) |
Deserialize the game from the given state. | |
virtual GAME_ERROR | CheatReset () |
Reset the cheat system. | |
virtual GAME_ERROR | GetMemory (GAME_MEMORY type, uint8_t *&data, size_t &size) |
Get a region of memory. | |
virtual GAME_ERROR | SetCheat (unsigned int index, bool enabled, const std::string &code) |
Set a cheat code. | |
virtual GAME_ERROR | RCGenerateHashFromFile (std::string &hash, unsigned int consoleID, const std::string &filePath) |
Generates a RetroAchievements hash for a given game that can be used to identify the game by RetroAchievements. | |
virtual GAME_ERROR | RCGetGameIDUrl (std::string &url, const std::string &hash) |
Gets a URL to the endpoint that returns the game ID. | |
virtual GAME_ERROR | RCGetPatchFileUrl (std::string &url, const std::string &username, const std::string &token, unsigned int gameID) |
Gets a URL to the endpoint that returns the patch file. | |
virtual GAME_ERROR | RCPostRichPresenceUrl (std::string &url, std::string &postData, const std::string &username, const std::string &token, unsigned int gameID, const std::string &richPresence) |
Gets a URL to the endpoint that updates the rich presence in the user's RetroAchievements profile. | |
virtual GAME_ERROR | RCEnableRichPresence (const std::string &script) |
Enables rich presence. | |
virtual GAME_ERROR | RCGetRichPresenceEvaluation (std::string &evaluation, unsigned int consoleID) |
Gets the rich presence evaluation for the current frame. Rich presence must be enabled first or this will fail. | |
virtual GAME_ERROR | RCResetRuntime () |
Resets the runtime. Must be called each time a new rom is starting and when the savestate is changed. | |
![]() | |
IAddonInstance (const kodi::addon::IInstanceInfo &instance) | |
virtual | ~IAddonInstance ()=default |
virtual ADDON_STATUS | CreateInstance (const kodi::addon::IInstanceInfo &instance, KODI_ADDON_INSTANCE_HDL &hdl) |
std::string | GetInstanceAPIVersion () const |
virtual ADDON_STATUS | SetInstanceSetting (const std::string &settingName, const kodi::addon::CSettingValue &settingValue) |
bool | IsInstanceSettingUsingDefault (const std::string &settingName) |
std::string | GetInstanceUserPath (const std::string &append="") |
bool | CheckInstanceSettingString (const std::string &settingName, std::string &settingValue) |
std::string | GetInstanceSettingString (const std::string &settingName, const std::string &defaultValue="") |
void | SetInstanceSettingString (const std::string &settingName, const std::string &settingValue) |
bool | CheckInstanceSettingInt (const std::string &settingName, int &settingValue) |
int | GetInstanceSettingInt (const std::string &settingName, int defaultValue=0) |
void | SetInstanceSettingInt (const std::string &settingName, int settingValue) |
bool | CheckInstanceSettingBoolean (const std::string &settingName, bool &settingValue) |
bool | GetInstanceSettingBoolean (const std::string &settingName, bool defaultValue=false) |
void | SetInstanceSettingBoolean (const std::string &settingName, bool settingValue) |
bool | CheckInstanceSettingFloat (const std::string &settingName, float &settingValue) |
float | GetInstanceSettingFloat (const std::string &settingName, float defaultValue=0.0f) |
void | SetInstanceSettingFloat (const std::string &settingName, float settingValue) |
template<typename enumType > | |
bool | CheckInstanceSettingEnum (const std::string &settingName, enumType &settingValue) |
template<typename enumType > | |
enumType | GetInstanceSettingEnum (const std::string &settingName, enumType defaultValue=static_cast< enumType >(0)) |
template<typename enumType > | |
void | SetInstanceSettingEnum (const std::string &settingName, enumType settingValue) |