Kodi Development 22.0
for Binary and Script based Add-Ons
 
Loading...
Searching...
No Matches
CInstanceGame

Inherits IAddonInstance.

Classes

class  CStream
 

Public Member Functions

virtual size_t AchievementStateSize ()
 How many bytes the achievement runtime's state needs right now.
 
virtual GAME_ERROR ActivateAchievement (unsigned int cheevoId, const std::string &memAddrExpression)
 Activate an achievement.
 
virtual GAME_ERROR AddImageIndex ()
 Adds a new disk image slot.
 
virtual GAME_ERROR AudioAvailable ()
 Tell the client the frontend is ready for audio.
 
virtual GAME_ERROR CheatReset ()
 Reset the cheat system.
 
 CInstanceGame ()
 Game class constructor.
 
void CloseGame (void)
 Callback to Kodi Function
Requests the frontend to stop the current game
 
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 GAME_ERROR Deserialize (const uint8_t *data, size_t size)
 Deserialize the game from the given state.
 
virtual GAME_ERROR DeserializeAchievements (const uint8_t *data, size_t size)
 Restore achievement state written by SerializeAchievements()
 
bool EnableHardwareRendering (const game_hw_rendering_properties &properties)
 Callback to Kodi Function
Enable hardware rendering functionality
 
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.
 
bool Extensions (std::vector< std::string > &extensions)
 Callback to Kodi Function
The extensions in the <extensions> property from addon.xml.
 
virtual void FreeTopology (game_input_topology *topology)
 Free the topology's resources.
 
std::string GameClientDllPath () const
 Callback to Kodi Function
The path of the game client being loaded.
 
virtual GAME_ERROR GetCheevoUrlId (const std::function< void(const std::string &achievementUrl, unsigned int cheevoId)> &callback)
 Get triggered achievement URL and ID pairs.
 
virtual bool GetEjectState ()
 Returns whether the virtual disk tray is currently ejected.
 
virtual GAME_ERROR GetGameTiming (game_system_timing &timing_info)
 Get timing information about the loaded game.
 
virtual unsigned int GetImageCount ()
 Gets the number of available disk images.
 
virtual unsigned int GetImageIndex ()
 Gets the index of the currently inserted disk image.
 
virtual std::string GetImageLabel (unsigned int imageIndex)
 Gets a user-friendly label for a disk image.
 
virtual std::string GetImagePath (unsigned int imageIndex)
 Gets the full path of a disk image.
 
virtual GAME_ERROR GetMemory (GAME_MEMORY type, uint8_t *&data, size_t &size)
 Get a region of memory.
 
double GetPlaybackSpeed ()
 Callback to Kodi Function
Get the speed the game is being played back at
 
virtual GAME_REGION GetRegion ()
 Get region of the loaded game.
 
virtual game_input_topologyGetTopology ()
 Get the input topology that specifies which controllers can be connected.
 
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_ERROR HwContextDestroy ()
 Called before the context is destroyed.
 
virtual GAME_ERROR HwContextReset ()
 Invalidates the current HW context and reinitializes GPU resources.
 
game_proc_address_t HwGetProcAddress (const char *sym)
 Callback to Kodi Function
Get a symbol from the hardware context
 
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 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.
 
std::string ProfileDirectory () const
 Callback to Kodi Function
The writable directory of the frontend.
 
bool ProxyDllPaths (std::vector< std::string > &paths)
 Callback to Kodi Function
Paths to proxy DLLs used to load the game client.
 
void RCOnAchievementProgress (const std::vector< game_rc_achievement_progress > &progress)
 Callback to Kodi Function
Publish progress towards the game's measured achievements
 
void RCOnAchievementTriggered (const game_rc_achievement_triggered &data)
 Callback to Kodi Function
Notify Kodi that the player has earned an achievement
 
void RCOnConnectionChanged (bool connected)
 Callback to Kodi Function
Report a change in connectivity to the RetroAchievements server
 
void RCOnGameCompleted (const std::string &title, bool hardcore)
 Callback to Kodi Function
Notify Kodi that every achievement of the game has been earned
 
void RCOnGameLoaded (const game_rc_game_loaded &data)
 Callback to Kodi Function
Notify Kodi that a game has been identified by the achievement runtime
 
void RCOnLoginResult (const game_rc_login_result &data)
 Callback to Kodi Function
Notify Kodi of the outcome of a login attempt
 
void RCOnRichPresenceUpdated (const std::string &evaluation)
 Callback to Kodi Function
Publish the current rich presence evaluation to Kodi
 
void RCOnServerError (const std::string &message, const std::string &api)
 Callback to Kodi Function
Report an error returned by the RetroAchievements server
 
virtual GAME_ERROR RemoveImageIndex (unsigned int imageIndex)
 Removes the disk image at the given index.
 
virtual GAME_ERROR ReplaceImageIndex (unsigned int imageIndex, const std::string &filePath)
 Replaces the disk image at the given index.
 
virtual bool RequiresGameLoop ()
 Return true if the client requires the frontend to provide a game loop.
 
virtual GAME_ERROR Reset ()
 Reset the current game.
 
bool ResourceDirectories (std::vector< std::string > &dirs)
 Callback to Kodi Function
The "system" directories of the frontend.
 
virtual GAME_ERROR RunFrame ()
 Run a single frame for add-ons that use a game loop.
 
virtual GAME_ERROR Serialize (uint8_t *data, size_t size)
 Serialize the state of the game.
 
virtual GAME_ERROR SerializeAchievements (uint8_t *data, size_t size)
 Write the achievement runtime's state.
 
virtual size_t SerializeSize ()
 Get the number of bytes required to serialize the game.
 
virtual GAME_ERROR SetCheat (unsigned int index, bool enabled, const std::string &code)
 Set a cheat code.
 
virtual void SetControllerLayouts (const std::vector< kodi::addon::GameControllerLayout > &controllers)
 Set the layouts for known controllers.
 
virtual GAME_ERROR SetEjectState (bool ejected)
 Opens or closes the virtual disk tray.
 
void SetGameTiming (const game_system_timing &timingInfo)
 Callback to Kodi Function
Update the video and audio timing of the running game
 
virtual GAME_ERROR SetImageIndex (unsigned int imageIndex)
 Inserts the disk image at the given index.
 
virtual GAME_ERROR SetInitialImage (unsigned int imageIndex, const std::string &filePath)
 Sets which image should be initially inserted on load.
 
virtual GAME_ERROR SetRetroAchievementsCredentials (const std::string &username, const std::string &token)
 Set the credentials of the RetroAchievements user.
 
bool SupportsVFS () const
 Callback to Kodi Function
The value of the <supports_vfs> property from addon.xml.
 
virtual GAME_ERROR UnloadGame ()
 Unload the current game.
 
 ~CInstanceGame () override=default
 Destructor.
 
- Public Member Functions inherited from IAddonInstance
bool CheckInstanceSettingBoolean (const std::string &settingName, bool &settingValue)
 
template<typename enumType >
bool CheckInstanceSettingEnum (const std::string &settingName, enumType &settingValue)
 
bool CheckInstanceSettingFloat (const std::string &settingName, float &settingValue)
 
bool CheckInstanceSettingInt (const std::string &settingName, int &settingValue)
 
bool CheckInstanceSettingString (const std::string &settingName, std::string &settingValue)
 
virtual ADDON_STATUS CreateInstance (const kodi::addon::IInstanceInfo &instance, KODI_ADDON_INSTANCE_HDL &hdl)
 
std::string GetInstanceAPIVersion () const
 
bool GetInstanceSettingBoolean (const std::string &settingName, bool defaultValue=false)
 
template<typename enumType >
enumType GetInstanceSettingEnum (const std::string &settingName, enumType defaultValue=static_cast< enumType >(0))
 
float GetInstanceSettingFloat (const std::string &settingName, float defaultValue=0.0f)
 
int GetInstanceSettingInt (const std::string &settingName, int defaultValue=0)
 
std::string GetInstanceSettingString (const std::string &settingName, const std::string &defaultValue="")
 
std::string GetInstanceUserPath (const std::string &append="")
 
 IAddonInstance (const kodi::addon::IInstanceInfo &instance)
 
bool IsInstanceSettingUsingDefault (const std::string &settingName)
 
virtual ADDON_STATUS SetInstanceSetting (const std::string &settingName, const kodi::addon::CSettingValue &settingValue)
 
void SetInstanceSettingBoolean (const std::string &settingName, bool settingValue)
 
template<typename enumType >
void SetInstanceSettingEnum (const std::string &settingName, enumType settingValue)
 
void SetInstanceSettingFloat (const std::string &settingName, float settingValue)
 
void SetInstanceSettingInt (const std::string &settingName, int settingValue)
 
void SetInstanceSettingString (const std::string &settingName, const std::string &settingValue)
 

The documentation for this class was generated from the following file: