Exemplo n.º 1
0
void CISOProperties::OnLocalIniModified(wxCommandEvent& ev)
{
    ev.Skip();
    if (WxStrToStr(ev.GetString()) != game_id)
        return;

    GameIniLocal.Load(GameIniFileLocal);
    LoadGameConfig();
}
Exemplo n.º 2
0
void InitFileSystem()
{
	guard(InitFileSystem);

	// initialize interface
CVAR_BEGIN(vars)
	CVAR_FULL(&fs_configfile, "cfgfile", CONFIGNAME, CVAR_NOSET),	//?? config system will be changed later
	// cddir <path>	-- allow game to be partially installed - read missing data from CD
	CVAR_FULL(&fs_cddir, "cddir", "", CVAR_NOSET),
	CVAR_FULL(&fs_game, "game", "", CVAR_SERVERINFO|CVAR_LATCH),
	CVAR_VAR(fs_logFile, 0, 0)
CVAR_END
	Cvar_GetVars(ARRAY_ARG(vars));

	CFileContainer *Mnt;

	FSLog = GNull;
	appInitFileSystem(FS);
	CFileSystem::RegisterFormat(CFileContainerPak::Create);
	CFileSystem::RegisterFormat(CFileContainerZip::Create);
#if !DEDICATED_ONLY
	// mount resources
	Mnt = CZResource::Mount("resources", zresource, ".");
	Mnt->locked = true;
#endif
	// mount CDROM
	if (fs_cddir->string[0])
	{
		Mnt = FS.MountDirectory(fs_cddir->string);
		Mnt->locked = true;
		appPrintf("FS: using \"%s\" as CDROM image\n", fs_cddir->string);
	}
	// mount root file container
	Mnt = FS.MountDirectory(".");
	Mnt->locked = true;
	// mount basedir
	GDefMountPoint = BASEDIRNAME;
	FS.GameDir = BASEDIRNAME;
	FS.MountGame(BASEDIRNAME);
	// change game, if needed
	FS.SetGameDir(fs_game->string);
	// load configuration
	LoadGameConfig();

	unguard;
}
Exemplo n.º 3
0
void FS_Tick()
{
	// process "fs_logFile" changes
	if (fs_logFile->modified)
	{
		fs_logFile->modified = false;

		if (FSLog != GNull && FSLog != GLog)
			delete FSLog;

		switch (fs_logFile->integer)
		{
		case 0:
			FSLog = GNull;
			break;
		case 1:
			FSLog = GLog;		//?? colorized log
			break;
		default:				// case 2
			FSLog = new COutputDeviceFile(FS_LOG);
			FSLog->Printf("\n*** File system activity, %s ***\n\n", appTimestamp());
			break;
		}
	}

	// process "game" changes
	if (fs_game->modified)
	{
		//!! WARNING: configuration will be saved even if game is not changed (bad game or "baseq2"->"")
		if (!stricmp(fs_game->string, BASEDIRNAME))
			Cvar_ForceSet("game", "");	// BASEDIRNAME->""
		CL_WriteConfiguration(fs_configfile->string);
		if (FS.SetGameDir(fs_game->string))
		{
			LoadGameConfig();
			if (!DEDICATED)
				Cbuf_AddText("vid_restart\nsnd_restart\n");
		}
		Cvar_ForceSet("game", (FS.GameDir == BASEDIRNAME) ? "" : *FS.GameDir);
		fs_game->modified = false;
	}
}
Exemplo n.º 4
0
CISOProperties::CISOProperties(const GameListItem& game_list_item, wxWindow* parent, wxWindowID id,
                               const wxString& title, const wxPoint& position, const wxSize& size,
                               long style)
    : wxDialog(parent, id, title, position, size, style), OpenGameListItem(game_list_item)
{
    Bind(DOLPHIN_EVT_CHANGE_ISO_PROPERTIES_TITLE, &CISOProperties::OnChangeTitle, this);
    // Load ISO data
    m_open_iso = DiscIO::CreateVolumeFromFilename(OpenGameListItem.GetFileName());

    game_id = m_open_iso->GetGameID();

    // Load game INIs
    GameIniFileLocal = File::GetUserPath(D_GAMESETTINGS_IDX) + game_id + ".ini";
    GameIniDefault = SConfig::LoadDefaultGameIni(game_id, m_open_iso->GetRevision());
    GameIniLocal = SConfig::LoadLocalGameIni(game_id, m_open_iso->GetRevision());

    // Setup GUI
    CreateGUIControls();
    LoadGameConfig();

    wxTheApp->Bind(DOLPHIN_EVT_LOCAL_INI_CHANGED, &CISOProperties::OnLocalIniModified, this);
}