WiiFlow_Lite/source/plugin/plugin.hpp
Fledge68 53a06c0f8d - fixed cacheing scummvm covers
- fixed setting scummvm cover's color via plugin
- now scummvm list is cached like all the other lists. but still does not use custom titles or titles from the plugins data xml.
- fixed the random bug where covers sometimes were not cached.
- fixed minor memory leaks via gametdb.cpp
- fixed an issue with using custom backgrounds via source menu.
- added the ability to move to next and previous game while on game info menu by using the controllers '+' and '-' buttons
- added the ability to launch a game directly from the game info menu by pressing 'A' on the controller.
- added the abilty to launch super smash bros melee via nintendont slippi. manually edit wiiflow_lite.ini by adding use_slippi=yes under [GAMECUBE]. google nintendont slippi and slippi project to learn about it.
- upped to version 5.4.1
2020-02-02 14:25:05 -06:00

102 lines
3.0 KiB
C++

/****************************************************************************
* Copyright (C) 2012 FIX94
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#ifndef _PLUGIN_HPP_
#define _PLUGIN_HPP_
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include "config/config.hpp"
#include "loader/disc.h"
using namespace std;
#define TAG_GAME_ID "{gameid}"
#define TAG_LOC "{loc}"
#define TAG_CONSOLE "{console}"
#define PLUGIN "PLUGIN"
#define PLUGIN_ENABLED "PLUGINS_ENABLED"
#define PLUGIN_DEV "{device}"
#define PLUGIN_PATH "{path}"
#define PLUGIN_NAME "{name}"
#define PLUGIN_NOEXT "{name_no_ext}"
#define PLUGIN_LDR "{loader}"
struct PluginOptions
{
u32 magic;
u32 caseColor;
int romPartition;
string romDir;
string fileTypes;
string DolName;
string coverFolder;
string consoleCoverID;
string BannerSound;
u32 BannerSoundSize;
vector<string> Args;
wstringEx DisplayName;
s8 boxMode;
};
class Plugin
{
public:
u8 *GetBannerSound(u32 magic);
u32 GetBannerSoundSize();
u32 GetCaseColor(u8 pos);
const char *GetDolName(u32 magic);
const char *GetCoverFolderName(u32 magic);
const char *GetRomDir(u8 pos);
string GetRomName(const char *FullPath);
string GetRomId(char *romPath, u32 Magic, Config &m_crc, const char *datadir, const char *platform, const char *name);
int GetRomPartition(u8 pos);
const string& GetFileTypes(u8 pos);
wstringEx GetPluginName(u8 pos);
u32 getPluginMagic(u8 pos);
s8 GetPluginPosition(u32 magic);
s8 GetBoxMode(u8 pos);
void init(const string& m_pluginsDir);
bool AddPlugin(Config &plugin);
void Cleanup();
void EndAdd();
bool GetEnableStatus(Config &cfg, u32 magic);
void SetEnablePlugin(Config &cfg, u8 pos, u8 ForceMode = 0);
const vector<bool> &GetEnabledPlugins(Config &cfg, u8 *num);
bool PluginExist(u8 pos);
vector<string> CreateArgs(const char *device, const char *path,
const char *title, const char *loader, u32 title_len_no_ext, u32 magic);
string GenerateCoverLink(dir_discHdr gameHeader, const string& constURL, Config &Checksums);
char PluginMagicWord[9];
private:
vector<PluginOptions> Plugins;
vector<bool> enabledPlugins;
s8 Plugin_Pos;
string pluginsDir;
bool adding;
};
extern Plugin m_plugin;
#endif