mirror of https://github.com/PCSX2/pcsx2.git
* Fixed fullscreen default-to-on behavior; the bug was caused by wxWidgets being a bit ficle and expecting the window to be Shown prior to being made fullscreen (even though the docs say ShowFullscreen() will show the window itself).
* Much header file cleanup and used forward declarations to remove a lot of excess includes; might help improve build times a wee bit. * Preliminary hash-table implementation for the Game database. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3264 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
856968812a
commit
0941434749
|
@ -204,6 +204,11 @@ public:
|
||||||
return Hash( (const char *)src.data(), src.length() * sizeof( wchar_t ) );
|
return Hash( (const char *)src.data(), src.length() * sizeof( wchar_t ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hash_key_t operator()( const wxString& src ) const
|
||||||
|
{
|
||||||
|
return Hash( (const char *)src.data(), src.length() * sizeof( wchar_t ) );
|
||||||
|
}
|
||||||
|
|
||||||
// Returns a hashcode for a character.
|
// Returns a hashcode for a character.
|
||||||
// This has function has been optimized to return an even distribution
|
// This has function has been optimized to return an even distribution
|
||||||
// across the range of an int value. In theory that should be more rewarding
|
// across the range of an int value. In theory that should be more rewarding
|
||||||
|
@ -322,6 +327,8 @@ public:
|
||||||
hash_key_t key = (hash_key_t) addr;
|
hash_key_t key = (hash_key_t) addr;
|
||||||
return (hash_key_t)((key >> 3) * 2654435761ul);
|
return (hash_key_t)((key >> 3) * 2654435761ul);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -528,7 +535,7 @@ public:
|
||||||
|
|
||||||
const T& GetValue( Key key ) const
|
const T& GetValue( Key key ) const
|
||||||
{
|
{
|
||||||
return (this->find( key ))->second;
|
return (find( key ))->second;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -549,6 +556,8 @@ public:
|
||||||
template< class Key, class T >
|
template< class Key, class T >
|
||||||
class HashMap : public google::dense_hash_map<Key, T, CommonHashClass>
|
class HashMap : public google::dense_hash_map<Key, T, CommonHashClass>
|
||||||
{
|
{
|
||||||
|
DeclareNoncopyableObject( HashMap );
|
||||||
|
|
||||||
typedef typename google::dense_hash_map<Key, T, CommonHashClass> _parent;
|
typedef typename google::dense_hash_map<Key, T, CommonHashClass> _parent;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -589,7 +598,12 @@ public:
|
||||||
|
|
||||||
const T& GetValue( Key key ) const
|
const T& GetValue( Key key ) const
|
||||||
{
|
{
|
||||||
return (this->find( key ))->second;
|
return (find( key ))->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Find( Key key ) const
|
||||||
|
{
|
||||||
|
return find(key) != end();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -607,12 +621,10 @@ class Dictionary : public HashMap<std::string, T>
|
||||||
public:
|
public:
|
||||||
virtual ~Dictionary() {}
|
virtual ~Dictionary() {}
|
||||||
|
|
||||||
Dictionary( int initialCapacity=33, const std::string& emptyKey = "@@-EMPTY-@@", const std::string& deletedKey = "@@-DELETED-@@" ) :
|
Dictionary( int initialCapacity=33, const std::string& emptyKey = "@@-EMPTY-@@", const std::string& deletedKey = "@@-DELETED-@@" )
|
||||||
HashMap<std::string, T>( emptyKey, deletedKey, initialCapacity)
|
: HashMap<std::string, T>( emptyKey, deletedKey, initialCapacity)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
private:
|
|
||||||
Dictionary( const Dictionary& src ) {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -631,13 +643,22 @@ class UnicodeDictionary : public HashMap<std::wstring, T>
|
||||||
public:
|
public:
|
||||||
virtual ~UnicodeDictionary() {}
|
virtual ~UnicodeDictionary() {}
|
||||||
|
|
||||||
UnicodeDictionary( int initialCapacity=33, const std::wstring& emptyKey = L"@@-EMPTY-@@", const std::wstring& deletedKey = L"@@-DELETED-@@" ) :
|
UnicodeDictionary( int initialCapacity=33, const std::wstring& emptyKey = L"@@-EMPTY-@@", const std::wstring& deletedKey = L"@@-DELETED-@@" )
|
||||||
HashMap<std::wstring, T>( emptyKey, deletedKey, initialCapacity)
|
: HashMap<std::wstring, T>( emptyKey, deletedKey, initialCapacity)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
UnicodeDictionary( const UnicodeDictionary& src ) {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template< class T >
|
||||||
|
class pxDictionary : public HashTools::HashMap<wxString, T>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~pxDictionary() {}
|
||||||
|
|
||||||
|
pxDictionary( int initialCapacity=33, const wxString& emptyKey = L"@@-EMPTY-@@", const wxString& deletedKey = L"@@-DELETED-@@" )
|
||||||
|
: HashMap<wxString, T>( emptyKey, deletedKey, initialCapacity)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "PrecompiledHeader.h"
|
#include "PrecompiledHeader.h"
|
||||||
#include "HashMap.h"
|
|
||||||
#include "wxGuiTools.h"
|
#include "wxGuiTools.h"
|
||||||
#include "pxStaticText.h"
|
#include "pxStaticText.h"
|
||||||
#include "Threading.h"
|
#include "Threading.h"
|
||||||
|
|
|
@ -356,13 +356,23 @@ static __forceinline void _reloadElfInfo(wxString elfpath)
|
||||||
// Set the Game DataBase to the correct game based on Game Serial Code...
|
// Set the Game DataBase to the correct game based on Game Serial Code...
|
||||||
if (IGameDatabase* GameDB = AppHost_GetGameDatabase()) {
|
if (IGameDatabase* GameDB = AppHost_GetGameDatabase()) {
|
||||||
wxString gameSerial = DiscID;
|
wxString gameSerial = DiscID;
|
||||||
if (DiscID.IsEmpty()) { // Search for crc if no Serial Code
|
if (gameSerial.IsEmpty()) { // Search for crc if no Serial Code
|
||||||
gameSerial = wxString(wxsFormat( L"%8.8x", ElfCRC ));
|
gameSerial = wxsFormat( L"%8.8x", ElfCRC );
|
||||||
}
|
}
|
||||||
if (GameDB->setGame(gameSerial)) { // Game Found
|
|
||||||
Console.WriteLn ("Game = %s (%s)", GameDB->getString("Name").c_str(), GameDB->getString("Region").c_str());
|
wxString serialMsg;
|
||||||
|
if(!DiscID.IsEmpty())
|
||||||
|
serialMsg = L"serial=" + DiscID + L" ";
|
||||||
|
|
||||||
|
//Game_Data CurrentGame;
|
||||||
|
//if (GameDB->getGame(CurrentGame, gameSerial))
|
||||||
|
if (GameDB->setGame(gameSerial))
|
||||||
|
{
|
||||||
|
Console.WriteLn(L"(GameDB) Found Game! %s [CRC=%8.8x]", serialMsg.c_str(), ElfCRC );
|
||||||
|
// [TODO] Display lots of other info from the database here!
|
||||||
}
|
}
|
||||||
else Console.Warning(L"Game not found in database [%s]", gameSerial.c_str());
|
else
|
||||||
|
Console.Warning(L"(GameDB) Game not found! %s [CRC=%8.8x]", serialMsg.c_str(), ElfCRC );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -199,7 +199,6 @@ set(pcsx2Headers
|
||||||
Gif.h
|
Gif.h
|
||||||
GS.h
|
GS.h
|
||||||
Hardware.h
|
Hardware.h
|
||||||
HostGui.h
|
|
||||||
Hw.h
|
Hw.h
|
||||||
IopBios.h
|
IopBios.h
|
||||||
IopCommon.h
|
IopCommon.h
|
||||||
|
|
|
@ -19,19 +19,19 @@
|
||||||
// Sets the current game to the one matching the serial id given
|
// Sets the current game to the one matching the serial id given
|
||||||
// Returns true if game found, false if not found...
|
// Returns true if game found, false if not found...
|
||||||
bool BaseGameDatabaseVector::setGame(const wxString& id) {
|
bool BaseGameDatabaseVector::setGame(const wxString& id) {
|
||||||
GameDataArray::iterator it( gList.begin() );
|
|
||||||
for ( ; it != gList.end(); ++it) {
|
GameDataHash::const_iterator iter( gHash.find(id) );
|
||||||
if (it[0].CompareId(id)) {
|
if( iter == gHash.end() ) {
|
||||||
curGame = &it[0];
|
curGame = NULL;
|
||||||
return true;
|
return false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
curGame = NULL;
|
curGame = &gList[iter->second];
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Game_Data* BaseGameDatabaseVector::createNewGame(const wxString& id) {
|
Game_Data* BaseGameDatabaseVector::createNewGame(const wxString& id) {
|
||||||
gList.push_back(Game_Data(id));
|
gList.push_back(Game_Data(id));
|
||||||
|
gHash[id] = gList.size()-1;
|
||||||
curGame = &(gList.end()-1)[0];
|
curGame = &(gList.end()-1)[0];
|
||||||
return curGame;
|
return curGame;
|
||||||
}
|
}
|
||||||
|
@ -94,8 +94,7 @@ void BaseGameDatabaseVector::writeString(const wxString& key, const wxString& va
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( !value.IsEmpty() ) {
|
if( !value.IsEmpty() ) {
|
||||||
key_pair tKey(key, value);
|
curGame->kList.push_back(key_pair(key, value));
|
||||||
curGame->kList.push_back(tKey);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else Console.Error("(GameDB) Game not set!");
|
else Console.Error("(GameDB) Game not set!");
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "AppConfig.h"
|
#include "AppConfig.h"
|
||||||
|
#include "Utilities/HashMap.h"
|
||||||
|
|
||||||
#include <wx/wfstream.h>
|
#include <wx/wfstream.h>
|
||||||
|
|
||||||
struct key_pair;
|
struct key_pair;
|
||||||
|
@ -161,7 +163,8 @@ public:
|
||||||
virtual void writeBool(const wxString& key, bool value)=0;
|
virtual void writeBool(const wxString& key, bool value)=0;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::vector<Game_Data> GameDataArray;
|
typedef std::vector<Game_Data> GameDataArray;
|
||||||
|
typedef pxDictionary<int> GameDataHash;
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------
|
||||||
// BaseGameDatabaseVector
|
// BaseGameDatabaseVector
|
||||||
|
@ -172,6 +175,7 @@ class BaseGameDatabaseVector : public IGameDatabase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GameDataArray gList; // List of all game data
|
GameDataArray gList; // List of all game data
|
||||||
|
GameDataHash gHash; // hash table of game serials matched to their gList indexes!
|
||||||
Game_Data* curGame; // Current game data (index into gList)
|
Game_Data* curGame; // Current game data (index into gList)
|
||||||
wxString m_baseKey;
|
wxString m_baseKey;
|
||||||
|
|
||||||
|
|
|
@ -1,66 +0,0 @@
|
||||||
/* PCSX2 - PS2 Emulator for PCs
|
|
||||||
* Copyright (C) 2002-2010 PCSX2 Dev Team
|
|
||||||
*
|
|
||||||
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
|
|
||||||
* of the GNU Lesser General Public License as published by the Free Software Found-
|
|
||||||
* ation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* PCSX2 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 PCSX2.
|
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
#include "CDVD/CDVD.h"
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Startup Parameters.
|
|
||||||
|
|
||||||
enum StartupModeType
|
|
||||||
{
|
|
||||||
Startup_FromCDVD = 0,
|
|
||||||
Startup_FromELF = 1, // not compatible with bios flag, probably
|
|
||||||
};
|
|
||||||
|
|
||||||
enum CDVD_SourceType;
|
|
||||||
|
|
||||||
class StartupParams
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
// Name of the CDVD image to load.
|
|
||||||
// if NULL, the CDVD plugin configured settings are used.
|
|
||||||
const char* ImageName;
|
|
||||||
|
|
||||||
// Name of the ELF file to load. If null, the CDVD is booted instead.
|
|
||||||
const char* ElfFile;
|
|
||||||
|
|
||||||
bool NoGui;
|
|
||||||
bool Enabled;
|
|
||||||
StartupModeType StartupMode;
|
|
||||||
CDVD_SourceType CdvdSource;
|
|
||||||
|
|
||||||
// Ignored when booting ELFs.
|
|
||||||
bool SkipBios;
|
|
||||||
|
|
||||||
// Plugin overrides
|
|
||||||
const char* gsdll, *cdvddll, *spudll;
|
|
||||||
const char* pad1dll, *pad2dll, *dev9dll;
|
|
||||||
|
|
||||||
StartupParams() { memzero(*this); }
|
|
||||||
};
|
|
||||||
|
|
||||||
extern StartupParams g_Startup;
|
|
||||||
|
|
||||||
extern bool States_isSlotUsed(int num);
|
|
||||||
|
|
||||||
extern void States_FreezeCurrentSlot();
|
|
||||||
extern void States_DefrostCurrentSlot();
|
|
||||||
extern void States_FreezeCurrentSlot();
|
|
||||||
extern void States_CycleSlotForward();
|
|
||||||
extern void States_CycleSlotBackward();
|
|
||||||
|
|
||||||
extern void States_SetCurrentSlot( int slot );
|
|
||||||
extern int States_GetCurrentSlot( int slot );
|
|
|
@ -231,7 +231,6 @@
|
||||||
<Unit filename="../Gif.cpp" />
|
<Unit filename="../Gif.cpp" />
|
||||||
<Unit filename="../Gif.h" />
|
<Unit filename="../Gif.h" />
|
||||||
<Unit filename="../Hardware.h" />
|
<Unit filename="../Hardware.h" />
|
||||||
<Unit filename="../HostGui.h" />
|
|
||||||
<Unit filename="../Hw.cpp" />
|
<Unit filename="../Hw.cpp" />
|
||||||
<Unit filename="../Hw.h" />
|
<Unit filename="../Hw.h" />
|
||||||
<Unit filename="../HwRead.cpp" />
|
<Unit filename="../HwRead.cpp" />
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#include <wx/file.h>
|
#include <wx/file.h>
|
||||||
|
|
||||||
#include "GS.h"
|
#include "GS.h"
|
||||||
#include "HostGui.h"
|
|
||||||
#include "CDVD/CDVDisoReader.h"
|
#include "CDVD/CDVDisoReader.h"
|
||||||
|
|
||||||
#include "Utilities/ScopedPtr.h"
|
#include "Utilities/ScopedPtr.h"
|
||||||
|
|
120
pcsx2/gui/App.h
120
pcsx2/gui/App.h
|
@ -18,7 +18,6 @@
|
||||||
#include "Utilities/wxAppWithHelpers.h"
|
#include "Utilities/wxAppWithHelpers.h"
|
||||||
|
|
||||||
#include <wx/fileconf.h>
|
#include <wx/fileconf.h>
|
||||||
#include <wx/imaglist.h>
|
|
||||||
#include <wx/apptrait.h>
|
#include <wx/apptrait.h>
|
||||||
|
|
||||||
#include "pxEventThread.h"
|
#include "pxEventThread.h"
|
||||||
|
@ -26,15 +25,10 @@
|
||||||
#include "AppCommon.h"
|
#include "AppCommon.h"
|
||||||
#include "AppCoreThread.h"
|
#include "AppCoreThread.h"
|
||||||
#include "RecentIsoList.h"
|
#include "RecentIsoList.h"
|
||||||
#include "AppGameDatabase.h"
|
|
||||||
|
|
||||||
#include "System.h"
|
#include "System.h"
|
||||||
#include "System/SysThreads.h"
|
#include "System/SysThreads.h"
|
||||||
|
|
||||||
#include "Utilities/HashMap.h"
|
|
||||||
|
|
||||||
class Pcsx2App;
|
|
||||||
|
|
||||||
typedef void FnType_OnThreadComplete(const wxCommandEvent& evt);
|
typedef void FnType_OnThreadComplete(const wxCommandEvent& evt);
|
||||||
typedef void (Pcsx2App::*FnPtr_Pcsx2App)();
|
typedef void (Pcsx2App::*FnPtr_Pcsx2App)();
|
||||||
|
|
||||||
|
@ -174,93 +168,6 @@ namespace Exception
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------
|
|
||||||
// KeyAcceleratorCode
|
|
||||||
// A custom keyboard accelerator that I like better than wx's wxAcceleratorEntry.
|
|
||||||
// --------------------------------------------------------------------------------------
|
|
||||||
struct KeyAcceleratorCode
|
|
||||||
{
|
|
||||||
union
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
u16 keycode;
|
|
||||||
u16 win:1, // win32 only.
|
|
||||||
cmd:1, // ctrl in win32, Command in Mac
|
|
||||||
alt:1,
|
|
||||||
shift:1;
|
|
||||||
};
|
|
||||||
u32 val32;
|
|
||||||
};
|
|
||||||
|
|
||||||
KeyAcceleratorCode() : val32( 0 ) {}
|
|
||||||
KeyAcceleratorCode( const wxKeyEvent& evt );
|
|
||||||
|
|
||||||
KeyAcceleratorCode( wxKeyCode code )
|
|
||||||
{
|
|
||||||
val32 = 0;
|
|
||||||
keycode = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
KeyAcceleratorCode& Shift()
|
|
||||||
{
|
|
||||||
shift = true;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
KeyAcceleratorCode& Alt()
|
|
||||||
{
|
|
||||||
alt = true;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
KeyAcceleratorCode& Win()
|
|
||||||
{
|
|
||||||
win = true;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
KeyAcceleratorCode& Cmd()
|
|
||||||
{
|
|
||||||
cmd = true;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxString ToString() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------
|
|
||||||
// GlobalCommandDescriptor
|
|
||||||
// Describes a global command which can be invoked from the main GUI or GUI plugins.
|
|
||||||
// --------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
struct GlobalCommandDescriptor
|
|
||||||
{
|
|
||||||
const char* Id; // Identifier string
|
|
||||||
void (*Invoke)(); // Do it!! Do it NOW!!!
|
|
||||||
|
|
||||||
const char* Fullname; // Name displayed in pulldown menus
|
|
||||||
const char* Tooltip; // text displayed in toolbar tooltips and menu status bars.
|
|
||||||
|
|
||||||
int ToolbarIconId; // not implemented yet, leave 0 for now.
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef HashTools::Dictionary<const GlobalCommandDescriptor*> CommandDictionary;
|
|
||||||
|
|
||||||
class AcceleratorDictionary : public HashTools::HashMap<int, const GlobalCommandDescriptor*>
|
|
||||||
{
|
|
||||||
typedef HashTools::HashMap<int, const GlobalCommandDescriptor*> _parent;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
public:
|
|
||||||
using _parent::operator[];
|
|
||||||
|
|
||||||
AcceleratorDictionary();
|
|
||||||
void Map( const KeyAcceleratorCode& acode, const char *searchfor );
|
|
||||||
};
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------
|
||||||
// AppImageIds - Config and Toolbar Images and Icons
|
// AppImageIds - Config and Toolbar Images and Icons
|
||||||
// --------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------
|
||||||
|
@ -310,8 +217,9 @@ struct AppImageIds
|
||||||
// Container class for resources that should (or must) be unloaded prior to the ~wxApp() destructor.
|
// Container class for resources that should (or must) be unloaded prior to the ~wxApp() destructor.
|
||||||
// (typically this object is deleted at OnExit() or just prior to OnExit()).
|
// (typically this object is deleted at OnExit() or just prior to OnExit()).
|
||||||
//
|
//
|
||||||
struct pxAppResources
|
class pxAppResources
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
AppImageIds ImageId;
|
AppImageIds ImageId;
|
||||||
|
|
||||||
ScopedPtr<wxImageList> ConfigImages;
|
ScopedPtr<wxImageList> ConfigImages;
|
||||||
|
@ -321,19 +229,7 @@ struct pxAppResources
|
||||||
ScopedPtr<AppGameDatabase> GameDB;
|
ScopedPtr<AppGameDatabase> GameDB;
|
||||||
|
|
||||||
pxAppResources();
|
pxAppResources();
|
||||||
virtual ~pxAppResources() throw() { }
|
virtual ~pxAppResources() throw();
|
||||||
};
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------
|
|
||||||
// RecentIsoList
|
|
||||||
// --------------------------------------------------------------------------------------
|
|
||||||
struct RecentIsoList
|
|
||||||
{
|
|
||||||
ScopedPtr<RecentIsoManager> Manager;
|
|
||||||
ScopedPtr<wxMenu> Menu;
|
|
||||||
|
|
||||||
RecentIsoList();
|
|
||||||
virtual ~RecentIsoList() throw() { }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------
|
||||||
|
@ -550,8 +446,8 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FramerateManager FpsManager;
|
FramerateManager FpsManager;
|
||||||
CommandDictionary GlobalCommands;
|
ScopedPtr<CommandDictionary> GlobalCommands;
|
||||||
AcceleratorDictionary GlobalAccels;
|
ScopedPtr<AcceleratorDictionary> GlobalAccels;
|
||||||
|
|
||||||
StartupOptions Startup;
|
StartupOptions Startup;
|
||||||
CommandlineOverrides Overrides;
|
CommandlineOverrides Overrides;
|
||||||
|
@ -640,11 +536,7 @@ public:
|
||||||
wxImageList& GetImgList_Config();
|
wxImageList& GetImgList_Config();
|
||||||
wxImageList& GetImgList_Toolbars();
|
wxImageList& GetImgList_Toolbars();
|
||||||
|
|
||||||
const AppImageIds& GetImgId() const
|
const AppImageIds& GetImgId() const;
|
||||||
{
|
|
||||||
return m_Resources->ImageId;
|
|
||||||
}
|
|
||||||
|
|
||||||
AppGameDatabase* GetGameDatabase();
|
AppGameDatabase* GetGameDatabase();
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
|
@ -0,0 +1,123 @@
|
||||||
|
/* PCSX2 - PS2 Emulator for PCs
|
||||||
|
* Copyright (C) 2002-2010 PCSX2 Dev Team
|
||||||
|
*
|
||||||
|
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
|
||||||
|
* of the GNU Lesser General Public License as published by the Free Software Found-
|
||||||
|
* ation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* PCSX2 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 PCSX2.
|
||||||
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "AppCommon.h"
|
||||||
|
#include "Utilities/HashMap.h"
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------
|
||||||
|
// KeyAcceleratorCode
|
||||||
|
// A custom keyboard accelerator that I like better than wx's wxAcceleratorEntry.
|
||||||
|
// --------------------------------------------------------------------------------------
|
||||||
|
struct KeyAcceleratorCode
|
||||||
|
{
|
||||||
|
union
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
u16 keycode;
|
||||||
|
u16 win:1, // win32 only.
|
||||||
|
cmd:1, // ctrl in win32, Command in Mac
|
||||||
|
alt:1,
|
||||||
|
shift:1;
|
||||||
|
};
|
||||||
|
u32 val32;
|
||||||
|
};
|
||||||
|
|
||||||
|
KeyAcceleratorCode() : val32( 0 ) {}
|
||||||
|
KeyAcceleratorCode( const wxKeyEvent& evt );
|
||||||
|
|
||||||
|
KeyAcceleratorCode( wxKeyCode code )
|
||||||
|
{
|
||||||
|
val32 = 0;
|
||||||
|
keycode = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
KeyAcceleratorCode& Shift()
|
||||||
|
{
|
||||||
|
shift = true;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
KeyAcceleratorCode& Alt()
|
||||||
|
{
|
||||||
|
alt = true;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
KeyAcceleratorCode& Win()
|
||||||
|
{
|
||||||
|
win = true;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
KeyAcceleratorCode& Cmd()
|
||||||
|
{
|
||||||
|
cmd = true;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString ToString() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------
|
||||||
|
// GlobalCommandDescriptor
|
||||||
|
// Describes a global command which can be invoked from the main GUI or GUI plugins.
|
||||||
|
// --------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
struct GlobalCommandDescriptor
|
||||||
|
{
|
||||||
|
const char* Id; // Identifier string
|
||||||
|
void (*Invoke)(); // Do it!! Do it NOW!!!
|
||||||
|
|
||||||
|
const char* Fullname; // Name displayed in pulldown menus
|
||||||
|
const char* Tooltip; // text displayed in toolbar tooltips and menu status bars.
|
||||||
|
|
||||||
|
int ToolbarIconId; // not implemented yet, leave 0 for now.
|
||||||
|
};
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// --------------------------------------------------------------------------------------
|
||||||
|
class CommandDictionary : public HashTools::Dictionary<const GlobalCommandDescriptor*>
|
||||||
|
{
|
||||||
|
typedef HashTools::Dictionary<const GlobalCommandDescriptor*> _parent;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
public:
|
||||||
|
using _parent::operator[];
|
||||||
|
CommandDictionary();
|
||||||
|
virtual ~CommandDictionary() throw();
|
||||||
|
};
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// --------------------------------------------------------------------------------------
|
||||||
|
class AcceleratorDictionary : public HashTools::HashMap<int, const GlobalCommandDescriptor*>
|
||||||
|
{
|
||||||
|
typedef HashTools::HashMap<int, const GlobalCommandDescriptor*> _parent;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
public:
|
||||||
|
using _parent::operator[];
|
||||||
|
|
||||||
|
AcceleratorDictionary();
|
||||||
|
virtual ~AcceleratorDictionary() throw();
|
||||||
|
void Map( const KeyAcceleratorCode& acode, const char *searchfor );
|
||||||
|
};
|
|
@ -23,7 +23,6 @@
|
||||||
|
|
||||||
#include "Plugins.h"
|
#include "Plugins.h"
|
||||||
#include "GS.h"
|
#include "GS.h"
|
||||||
#include "HostGui.h"
|
|
||||||
#include "AppConfig.h"
|
#include "AppConfig.h"
|
||||||
|
|
||||||
using namespace Threading;
|
using namespace Threading;
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "PrecompiledHeader.h"
|
#include "PrecompiledHeader.h"
|
||||||
#include "App.h"
|
#include "App.h"
|
||||||
#include "AppSaveStates.h"
|
#include "AppSaveStates.h"
|
||||||
|
#include "AppGameDatabase.h"
|
||||||
|
|
||||||
#include "Utilities/TlsVariable.inl"
|
#include "Utilities/TlsVariable.inl"
|
||||||
|
|
||||||
|
|
|
@ -25,12 +25,22 @@
|
||||||
// inter-dependence.
|
// inter-dependence.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
class Pcsx2App;
|
||||||
class MainEmuFrame;
|
class MainEmuFrame;
|
||||||
class GSFrame;
|
class GSFrame;
|
||||||
class ConsoleLogFrame;
|
class ConsoleLogFrame;
|
||||||
class PipeRedirectionBase;
|
class PipeRedirectionBase;
|
||||||
class AppCoreThread;
|
class AppCoreThread;
|
||||||
class Pcsx2AppMethodEvent;
|
class Pcsx2AppMethodEvent;
|
||||||
|
class pxAppResources;
|
||||||
|
class AppGameDatabase;
|
||||||
|
class IScopedCoreThread;
|
||||||
|
|
||||||
|
struct KeyAcceleratorCode;
|
||||||
|
struct GlobalCommandDescriptor;
|
||||||
|
class CommandDictionary;
|
||||||
|
class AcceleratorDictionary;
|
||||||
|
|
||||||
class IniInterface;
|
class IniInterface;
|
||||||
|
|
||||||
// wxWidgets forward declarations
|
// wxWidgets forward declarations
|
||||||
|
@ -48,3 +58,5 @@ class wxSpinCtrl;
|
||||||
class wxBookCtrlBase;
|
class wxBookCtrlBase;
|
||||||
|
|
||||||
class wxListEvent;
|
class wxListEvent;
|
||||||
|
class wxImageList;
|
||||||
|
class wxBitmap;
|
||||||
|
|
|
@ -144,7 +144,7 @@ AppGameDatabase& AppGameDatabase::LoadFromFile(const wxString& file, const wxStr
|
||||||
{
|
{
|
||||||
if (!wxFileExists(file))
|
if (!wxFileExists(file))
|
||||||
{
|
{
|
||||||
Console.Error(L"GameDatabase: DataBase Not Found! [%s]", file.c_str());
|
Console.Error(L"(GameDB) Database Not Found! [%s]", file.c_str());
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ AppGameDatabase& AppGameDatabase::LoadFromFile(const wxString& file, const wxStr
|
||||||
if (!reader.IsOk())
|
if (!reader.IsOk())
|
||||||
{
|
{
|
||||||
//throw Exception::FileNotFound( file );
|
//throw Exception::FileNotFound( file );
|
||||||
Console.Error(L"GameDatabase: Could not access file (permission denied?) [%s]", file.c_str());
|
Console.Error(L"(GameDB) Could not access file (permission denied?) [%s]", file.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
DBLoaderHelper loader( reader, *this );
|
DBLoaderHelper loader( reader, *this );
|
||||||
|
@ -161,10 +161,6 @@ AppGameDatabase& AppGameDatabase::LoadFromFile(const wxString& file, const wxStr
|
||||||
header = loader.ReadHeader();
|
header = loader.ReadHeader();
|
||||||
loader.ReadGames();
|
loader.ReadGames();
|
||||||
|
|
||||||
//if (setGame(value)) Console.WriteLn(L"GameDatabase: Found Game! [%s]", value.c_str());
|
|
||||||
//else Console.Warning(L"GameDatabase: Game Not Found! [%s]", value.c_str());
|
|
||||||
|
|
||||||
// Clear the current key after loading.
|
|
||||||
curGame = NULL;
|
curGame = NULL;
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
@ -15,10 +15,12 @@
|
||||||
|
|
||||||
#include "PrecompiledHeader.h"
|
#include "PrecompiledHeader.h"
|
||||||
#include "MainFrame.h"
|
#include "MainFrame.h"
|
||||||
|
#include "AppAccelerators.h"
|
||||||
#include "ConsoleLogger.h"
|
#include "ConsoleLogger.h"
|
||||||
#include "MSWstuff.h"
|
#include "MSWstuff.h"
|
||||||
|
|
||||||
#include "Utilities/IniInterface.h"
|
#include "Utilities/IniInterface.h"
|
||||||
|
#include "Utilities/HashMap.h"
|
||||||
#include "DebugTools/Debug.h"
|
#include "DebugTools/Debug.h"
|
||||||
#include "Dialogs/ModalPopups.h"
|
#include "Dialogs/ModalPopups.h"
|
||||||
|
|
||||||
|
@ -796,6 +798,6 @@ struct CrtDebugBreak
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//CrtDebugBreak breakAt( 2014 );
|
//CrtDebugBreak breakAt( 737 );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -16,9 +16,11 @@
|
||||||
#include "PrecompiledHeader.h"
|
#include "PrecompiledHeader.h"
|
||||||
#include "MainFrame.h"
|
#include "MainFrame.h"
|
||||||
#include "GSFrame.h"
|
#include "GSFrame.h"
|
||||||
|
#include "AppSaveStates.h"
|
||||||
|
#include "AppGameDatabase.h"
|
||||||
|
#include "AppAccelerators.h"
|
||||||
|
|
||||||
#include "Plugins.h"
|
#include "Plugins.h"
|
||||||
#include "AppSaveStates.h"
|
|
||||||
#include "ps2/BiosTools.h"
|
#include "ps2/BiosTools.h"
|
||||||
|
|
||||||
#include "Dialogs/ModalPopups.h"
|
#include "Dialogs/ModalPopups.h"
|
||||||
|
@ -26,7 +28,6 @@
|
||||||
#include "Dialogs/LogOptionsDialog.h"
|
#include "Dialogs/LogOptionsDialog.h"
|
||||||
|
|
||||||
#include "Utilities/IniInterface.h"
|
#include "Utilities/IniInterface.h"
|
||||||
#include "Utilities/HashMap.h"
|
|
||||||
|
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
# include <wx/msw/wrapwin.h> // needed to implement the app!
|
# include <wx/msw/wrapwin.h> // needed to implement the app!
|
||||||
|
@ -405,24 +406,19 @@ void Pcsx2App::LogicalVsync()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HashTools::HashMap<int, const GlobalCommandDescriptor*> GlobalAccels( 0, 0xffffffff );
|
|
||||||
|
|
||||||
void Pcsx2App::OnEmuKeyDown( wxKeyEvent& evt )
|
void Pcsx2App::OnEmuKeyDown( wxKeyEvent& evt )
|
||||||
{
|
{
|
||||||
const GlobalCommandDescriptor* cmd = NULL;
|
const GlobalCommandDescriptor* cmd = NULL;
|
||||||
GlobalAccels.TryGetValue( KeyAcceleratorCode( evt ).val32, cmd );
|
if( GlobalAccels ) GlobalAccels->TryGetValue( KeyAcceleratorCode( evt ).val32, cmd );
|
||||||
|
|
||||||
if( cmd == NULL )
|
if( cmd == NULL )
|
||||||
{
|
{
|
||||||
evt.Skip();
|
evt.Skip();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( cmd != NULL )
|
DbgCon.WriteLn( "(app) Invoking command: %s", cmd->Id );
|
||||||
{
|
cmd->Invoke();
|
||||||
DbgCon.WriteLn( "(app) Invoking command: %s", cmd->Id );
|
|
||||||
cmd->Invoke();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns a string message telling the user to consult guides for obtaining a legal BIOS.
|
// Returns a string message telling the user to consult guides for obtaining a legal BIOS.
|
||||||
|
@ -833,8 +829,8 @@ void Pcsx2App::OpenGsPanel()
|
||||||
GSFrame* gsFrame = GetGsFramePtr();
|
GSFrame* gsFrame = GetGsFramePtr();
|
||||||
if( gsFrame == NULL )
|
if( gsFrame == NULL )
|
||||||
{
|
{
|
||||||
gsFrame = new GSFrame( GetMainFramePtr(), L"PCSX2" );
|
gsFrame = new GSFrame( GetMainFramePtr(), GetAppName() );
|
||||||
gsFrame->SetFocus();
|
//gsFrame->SetFocus();
|
||||||
m_id_GsFrame = gsFrame->GetId();
|
m_id_GsFrame = gsFrame->GetId();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -861,7 +857,22 @@ void Pcsx2App::OpenGsPanel()
|
||||||
|
|
||||||
pxAssumeDev( !GetCorePlugins().IsOpen( PluginId_GS ), "GS Plugin must be closed prior to opening a new Gs Panel!" );
|
pxAssumeDev( !GetCorePlugins().IsOpen( PluginId_GS ), "GS Plugin must be closed prior to opening a new Gs Panel!" );
|
||||||
|
|
||||||
gsFrame->Show();
|
switch( wxGetApp().Overrides.GsWindowMode )
|
||||||
|
{
|
||||||
|
case GsWinMode_Windowed:
|
||||||
|
g_Conf->GSWindow.IsFullscreen = false;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GsWinMode_Fullscreen:
|
||||||
|
g_Conf->GSWindow.IsFullscreen = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GsWinMode_Unspecified:
|
||||||
|
g_Conf->GSWindow.IsFullscreen = g_Conf->GSWindow.DefaultToFullscreen;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
gsFrame->ShowFullScreen( g_Conf->GSWindow.IsFullscreen );
|
||||||
pDsp = (uptr)gsFrame->GetViewport()->GetHandle();
|
pDsp = (uptr)gsFrame->GetViewport()->GetHandle();
|
||||||
|
|
||||||
// The "in the main window" quickie hack...
|
// The "in the main window" quickie hack...
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
#include "PrecompiledHeader.h"
|
#include "PrecompiledHeader.h"
|
||||||
#include "MainFrame.h"
|
#include "MainFrame.h"
|
||||||
|
#include "AppGameDatabase.h"
|
||||||
|
|
||||||
#include <wx/zipstrm.h>
|
#include <wx/zipstrm.h>
|
||||||
#include <wx/wfstream.h>
|
#include <wx/wfstream.h>
|
||||||
|
@ -34,7 +35,6 @@
|
||||||
#include "Resources/AppIcon32.h"
|
#include "Resources/AppIcon32.h"
|
||||||
#include "Resources/AppIcon64.h"
|
#include "Resources/AppIcon64.h"
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
|
||||||
const wxImage& LoadImageAny(
|
const wxImage& LoadImageAny(
|
||||||
wxImage& dest, bool useTheme, wxFileName& base, const wxChar* filename, IEmbeddedImage& onFail )
|
wxImage& dest, bool useTheme, wxFileName& base, const wxChar* filename, IEmbeddedImage& onFail )
|
||||||
{
|
{
|
||||||
|
@ -75,6 +75,8 @@ pxAppResources::pxAppResources()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pxAppResources::~pxAppResources() throw() {}
|
||||||
|
|
||||||
wxMenu& Pcsx2App::GetRecentIsoMenu()
|
wxMenu& Pcsx2App::GetRecentIsoMenu()
|
||||||
{
|
{
|
||||||
pxAssert( !!m_RecentIsoList->Menu );
|
pxAssert( !!m_RecentIsoList->Menu );
|
||||||
|
@ -110,7 +112,6 @@ const wxIconBundle& Pcsx2App::GetIconBundle()
|
||||||
return *bundle;
|
return *bundle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
|
||||||
const wxBitmap& Pcsx2App::GetLogoBitmap()
|
const wxBitmap& Pcsx2App::GetLogoBitmap()
|
||||||
{
|
{
|
||||||
ScopedPtr<wxBitmap>& logo( GetResourceCache().Bitmap_Logo );
|
ScopedPtr<wxBitmap>& logo( GetResourceCache().Bitmap_Logo );
|
||||||
|
@ -146,7 +147,6 @@ const wxBitmap& Pcsx2App::GetLogoBitmap()
|
||||||
return *logo;
|
return *logo;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
|
||||||
wxImageList& Pcsx2App::GetImgList_Config()
|
wxImageList& Pcsx2App::GetImgList_Config()
|
||||||
{
|
{
|
||||||
ScopedPtr<wxImageList>& images( GetResourceCache().ConfigImages );
|
ScopedPtr<wxImageList>& images( GetResourceCache().ConfigImages );
|
||||||
|
@ -216,3 +216,7 @@ wxImageList& Pcsx2App::GetImgList_Toolbars()
|
||||||
return *images;
|
return *images;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const AppImageIds& Pcsx2App::GetImgId() const
|
||||||
|
{
|
||||||
|
return m_Resources->ImageId;
|
||||||
|
}
|
||||||
|
|
|
@ -60,3 +60,12 @@ extern void StateCopy_SaveToFile( const wxString& file );
|
||||||
extern void StateCopy_LoadFromFile( const wxString& file );
|
extern void StateCopy_LoadFromFile( const wxString& file );
|
||||||
extern void StateCopy_SaveToSlot( uint num );
|
extern void StateCopy_SaveToSlot( uint num );
|
||||||
extern void StateCopy_LoadFromSlot( uint slot );
|
extern void StateCopy_LoadFromSlot( uint slot );
|
||||||
|
|
||||||
|
extern bool States_isSlotUsed(int num);
|
||||||
|
extern void States_DefrostCurrentSlot();
|
||||||
|
extern void States_FreezeCurrentSlot();
|
||||||
|
extern void States_CycleSlotForward();
|
||||||
|
extern void States_CycleSlotBackward();
|
||||||
|
|
||||||
|
extern void States_SetCurrentSlot( int slot );
|
||||||
|
extern int States_GetCurrentSlot( int slot );
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <wx/wx.h>
|
#include <wx/wx.h>
|
||||||
#include <wx/image.h>
|
|
||||||
#include <wx/propdlg.h>
|
#include <wx/propdlg.h>
|
||||||
|
|
||||||
#include "AppCommon.h"
|
#include "AppCommon.h"
|
||||||
|
|
|
@ -20,9 +20,6 @@
|
||||||
|
|
||||||
#include "Utilities/wxGuiTools.h"
|
#include "Utilities/wxGuiTools.h"
|
||||||
#include "Utilities/CheckedStaticBox.h"
|
#include "Utilities/CheckedStaticBox.h"
|
||||||
#include "Utilities/HashMap.h"
|
|
||||||
|
|
||||||
using namespace HashTools;
|
|
||||||
|
|
||||||
namespace Dialogs {
|
namespace Dialogs {
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
#include "ConfigurationDialog.h"
|
#include "ConfigurationDialog.h"
|
||||||
#include "Panels/ConfigurationPanels.h"
|
#include "Panels/ConfigurationPanels.h"
|
||||||
|
|
||||||
#include <wx/image.h>
|
|
||||||
#include <wx/wizard.h>
|
#include <wx/wizard.h>
|
||||||
|
|
||||||
static const wxWindowID pxID_CUSTOM = wxID_LOWEST - 1;
|
static const wxWindowID pxID_CUSTOM = wxID_LOWEST - 1;
|
||||||
|
|
|
@ -14,8 +14,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "PrecompiledHeader.h"
|
#include "PrecompiledHeader.h"
|
||||||
#include "MainFrame.h"
|
#include "App.h"
|
||||||
#include "GSFrame.h"
|
#include "GSFrame.h"
|
||||||
|
#include "AppAccelerators.h"
|
||||||
|
|
||||||
#include "GS.h"
|
#include "GS.h"
|
||||||
#include "MSWstuff.h"
|
#include "MSWstuff.h"
|
||||||
|
@ -29,24 +30,24 @@ void GSPanel::InitDefaultAccelerators()
|
||||||
|
|
||||||
typedef KeyAcceleratorCode AAC;
|
typedef KeyAcceleratorCode AAC;
|
||||||
|
|
||||||
m_Accels.Map( AAC( WXK_F1 ), "States_FreezeCurrentSlot" );
|
m_Accels->Map( AAC( WXK_F1 ), "States_FreezeCurrentSlot" );
|
||||||
m_Accels.Map( AAC( WXK_F3 ), "States_DefrostCurrentSlot");
|
m_Accels->Map( AAC( WXK_F3 ), "States_DefrostCurrentSlot");
|
||||||
m_Accels.Map( AAC( WXK_F2 ), "States_CycleSlotForward" );
|
m_Accels->Map( AAC( WXK_F2 ), "States_CycleSlotForward" );
|
||||||
m_Accels.Map( AAC( WXK_F2 ).Shift(), "States_CycleSlotBackward" );
|
m_Accels->Map( AAC( WXK_F2 ).Shift(), "States_CycleSlotBackward" );
|
||||||
|
|
||||||
m_Accels.Map( AAC( WXK_F4 ), "Frameskip_Toggle" );
|
m_Accels->Map( AAC( WXK_F4 ), "Frameskip_Toggle" );
|
||||||
m_Accels.Map( AAC( WXK_TAB ), "Framelimiter_TurboToggle" );
|
m_Accels->Map( AAC( WXK_TAB ), "Framelimiter_TurboToggle" );
|
||||||
m_Accels.Map( AAC( WXK_TAB ).Shift(), "Framelimiter_MasterToggle" );
|
m_Accels->Map( AAC( WXK_TAB ).Shift(), "Framelimiter_MasterToggle" );
|
||||||
|
|
||||||
m_Accels.Map( AAC( WXK_ESCAPE ), "Sys_Suspend" );
|
m_Accels->Map( AAC( WXK_ESCAPE ), "Sys_Suspend" );
|
||||||
m_Accels.Map( AAC( WXK_F8 ), "Sys_TakeSnapshot" );
|
m_Accels->Map( AAC( WXK_F8 ), "Sys_TakeSnapshot" );
|
||||||
m_Accels.Map( AAC( WXK_F9 ), "Sys_RenderswitchToggle" );
|
m_Accels->Map( AAC( WXK_F9 ), "Sys_RenderswitchToggle" );
|
||||||
|
|
||||||
//m_Accels.Map( AAC( WXK_F10 ), "Sys_LoggingToggle" );
|
//m_Accels->Map( AAC( WXK_F10 ), "Sys_LoggingToggle" );
|
||||||
m_Accels.Map( AAC( WXK_F11 ), "Sys_FreezeGS" );
|
m_Accels->Map( AAC( WXK_F11 ), "Sys_FreezeGS" );
|
||||||
m_Accels.Map( AAC( WXK_F12 ), "Sys_RecordingToggle" );
|
m_Accels->Map( AAC( WXK_F12 ), "Sys_RecordingToggle" );
|
||||||
|
|
||||||
m_Accels.Map( AAC( WXK_RETURN ).Alt(), "FullscreenToggle" );
|
m_Accels->Map( AAC( WXK_RETURN ).Alt(), "FullscreenToggle" );
|
||||||
}
|
}
|
||||||
|
|
||||||
GSPanel::GSPanel( wxWindow* parent )
|
GSPanel::GSPanel( wxWindow* parent )
|
||||||
|
@ -184,7 +185,7 @@ void GSPanel::OnKeyDown( wxKeyEvent& evt )
|
||||||
if( (PADopen != NULL) && CoreThread.IsOpen() ) return;
|
if( (PADopen != NULL) && CoreThread.IsOpen() ) return;
|
||||||
|
|
||||||
const GlobalCommandDescriptor* cmd = NULL;
|
const GlobalCommandDescriptor* cmd = NULL;
|
||||||
m_Accels.TryGetValue( KeyAcceleratorCode( evt ).val32, cmd );
|
m_Accels->TryGetValue( KeyAcceleratorCode( evt ).val32, cmd );
|
||||||
if( cmd == NULL )
|
if( cmd == NULL )
|
||||||
{
|
{
|
||||||
evt.Skip(); // Let the global APP handle it if it wants
|
evt.Skip(); // Let the global APP handle it if it wants
|
||||||
|
@ -285,16 +286,21 @@ bool GSFrame::ShowFullScreen(bool show, long style)
|
||||||
if( show != IsFullScreen() )
|
if( show != IsFullScreen() )
|
||||||
Console.WriteLn( Color_StrongMagenta, "(gsFrame) Switching to %s mode...", show ? "Fullscreen" : "Windowed" );
|
Console.WriteLn( Color_StrongMagenta, "(gsFrame) Switching to %s mode...", show ? "Fullscreen" : "Windowed" );
|
||||||
|
|
||||||
_parent::ShowFullScreen( show );
|
|
||||||
|
|
||||||
if( g_Conf->GSWindow.IsFullscreen != show )
|
if( g_Conf->GSWindow.IsFullscreen != show )
|
||||||
{
|
{
|
||||||
g_Conf->GSWindow.IsFullscreen = show;
|
g_Conf->GSWindow.IsFullscreen = show;
|
||||||
AppSaveSettings();
|
wxGetApp().PostIdleMethod( AppSaveSettings );
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
// IMPORTANT! On MSW platforms you must ALWAYS show the window prior to calling
|
||||||
|
// ShowFullscreen(), otherwise the window will be oddly unstable (lacking input and unable
|
||||||
|
// to properly flip back into fullscreen mode after alt-enter). I don't know if that
|
||||||
|
// also happens on Linux.
|
||||||
|
|
||||||
|
if( !IsShown() ) Show();
|
||||||
|
bool retval = _parent::ShowFullScreen( show );
|
||||||
|
|
||||||
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxStaticText* GSFrame::GetLabel_OutputDisabled() const
|
wxStaticText* GSFrame::GetLabel_OutputDisabled() const
|
||||||
|
@ -336,23 +342,8 @@ bool GSFrame::Show( bool shown )
|
||||||
if( wxStaticText* label = GetLabel_OutputDisabled() )
|
if( wxStaticText* label = GetLabel_OutputDisabled() )
|
||||||
label->Show( EmuConfig.GS.DisableOutput );
|
label->Show( EmuConfig.GS.DisableOutput );
|
||||||
|
|
||||||
switch( wxGetApp().Overrides.GsWindowMode )
|
if( !m_timer_UpdateTitle.IsRunning() )
|
||||||
{
|
m_timer_UpdateTitle.Start( TitleBarUpdateMs );
|
||||||
case GsWinMode_Windowed:
|
|
||||||
g_Conf->GSWindow.IsFullscreen = false;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GsWinMode_Fullscreen:
|
|
||||||
g_Conf->GSWindow.IsFullscreen = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GsWinMode_Unspecified:
|
|
||||||
g_Conf->GSWindow.IsFullscreen = g_Conf->GSWindow.DefaultToFullscreen;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
ShowFullScreen( g_Conf->GSWindow.IsFullscreen );
|
|
||||||
m_timer_UpdateTitle.Start( TitleBarUpdateMs );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "App.h"
|
#include "AppCommon.h"
|
||||||
#include "CpuUsageProvider.h"
|
#include "CpuUsageProvider.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,10 +38,11 @@ class GSPanel : public wxWindow
|
||||||
typedef wxWindow _parent;
|
typedef wxWindow _parent;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
AcceleratorDictionary m_Accels;
|
ScopedPtr<AcceleratorDictionary> m_Accels;
|
||||||
wxTimer m_HideMouseTimer;
|
|
||||||
bool m_CursorShown;
|
wxTimer m_HideMouseTimer;
|
||||||
bool m_HasFocus;
|
bool m_CursorShown;
|
||||||
|
bool m_HasFocus;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GSPanel( wxWindow* parent );
|
GSPanel( wxWindow* parent );
|
||||||
|
|
|
@ -17,12 +17,16 @@
|
||||||
#include "MainFrame.h"
|
#include "MainFrame.h"
|
||||||
#include "GSFrame.h"
|
#include "GSFrame.h"
|
||||||
|
|
||||||
#include "HostGui.h"
|
#include "AppAccelerators.h"
|
||||||
#include "AppSaveStates.h"
|
#include "AppSaveStates.h"
|
||||||
#include "GS.h"
|
|
||||||
|
|
||||||
|
#include "Utilities/HashMap.h"
|
||||||
|
|
||||||
|
// Various includes needed for dumping...
|
||||||
|
#include "GS.h"
|
||||||
#include "Dump.h"
|
#include "Dump.h"
|
||||||
#include "DebugTools/Debug.h"
|
#include "DebugTools/Debug.h"
|
||||||
|
#include "R3000A.h"
|
||||||
|
|
||||||
using namespace HashTools;
|
using namespace HashTools;
|
||||||
|
|
||||||
|
@ -325,11 +329,18 @@ static const GlobalCommandDescriptor CommandDeclarations[] =
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
AcceleratorDictionary::AcceleratorDictionary() :
|
CommandDictionary::CommandDictionary() {}
|
||||||
_parent( 0, 0xffffffff )
|
|
||||||
|
CommandDictionary::~CommandDictionary() throw() {}
|
||||||
|
|
||||||
|
|
||||||
|
AcceleratorDictionary::AcceleratorDictionary()
|
||||||
|
: _parent( 0, 0xffffffff )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AcceleratorDictionary::~AcceleratorDictionary() throw() {}
|
||||||
|
|
||||||
void AcceleratorDictionary::Map( const KeyAcceleratorCode& acode, const char *searchfor )
|
void AcceleratorDictionary::Map( const KeyAcceleratorCode& acode, const char *searchfor )
|
||||||
{
|
{
|
||||||
const GlobalCommandDescriptor* result = NULL;
|
const GlobalCommandDescriptor* result = NULL;
|
||||||
|
@ -344,7 +355,7 @@ void AcceleratorDictionary::Map( const KeyAcceleratorCode& acode, const char *se
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxGetApp().GlobalCommands.TryGetValue( searchfor, result );
|
wxGetApp().GlobalCommands->TryGetValue( searchfor, result );
|
||||||
|
|
||||||
if( result == NULL )
|
if( result == NULL )
|
||||||
{
|
{
|
||||||
|
@ -360,42 +371,45 @@ void AcceleratorDictionary::Map( const KeyAcceleratorCode& acode, const char *se
|
||||||
|
|
||||||
void Pcsx2App::BuildCommandHash()
|
void Pcsx2App::BuildCommandHash()
|
||||||
{
|
{
|
||||||
|
if( !GlobalCommands ) GlobalCommands = new CommandDictionary;
|
||||||
|
|
||||||
const GlobalCommandDescriptor* curcmd = CommandDeclarations;
|
const GlobalCommandDescriptor* curcmd = CommandDeclarations;
|
||||||
while( curcmd->Invoke != NULL )
|
while( curcmd->Invoke != NULL )
|
||||||
{
|
{
|
||||||
GlobalCommands[curcmd->Id] = curcmd;
|
(*GlobalCommands)[curcmd->Id] = curcmd;
|
||||||
curcmd++;
|
curcmd++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pcsx2App::InitDefaultGlobalAccelerators()
|
void Pcsx2App::InitDefaultGlobalAccelerators()
|
||||||
{
|
{
|
||||||
typedef KeyAcceleratorCode AAC;
|
typedef KeyAcceleratorCode AAC;
|
||||||
|
|
||||||
GlobalAccels.Map( AAC( WXK_F1 ), "States_FreezeCurrentSlot" );
|
if( !GlobalAccels ) GlobalAccels = new AcceleratorDictionary;
|
||||||
GlobalAccels.Map( AAC( WXK_F3 ), "States_DefrostCurrentSlot" );
|
|
||||||
GlobalAccels.Map( AAC( WXK_F2 ), "States_CycleSlotForward" );
|
|
||||||
GlobalAccels.Map( AAC( WXK_F2 ).Shift(), "States_CycleSlotBackward" );
|
|
||||||
|
|
||||||
GlobalAccels.Map( AAC( WXK_F4 ), "Framelimiter_MasterToggle");
|
GlobalAccels->Map( AAC( WXK_F1 ), "States_FreezeCurrentSlot" );
|
||||||
GlobalAccels.Map( AAC( WXK_F4 ).Shift(), "Frameskip_Toggle");
|
GlobalAccels->Map( AAC( WXK_F3 ), "States_DefrostCurrentSlot" );
|
||||||
GlobalAccels.Map( AAC( WXK_TAB ), "Framelimiter_TurboToggle" );
|
GlobalAccels->Map( AAC( WXK_F2 ), "States_CycleSlotForward" );
|
||||||
GlobalAccels.Map( AAC( WXK_TAB ).Shift(), "Framelimiter_SlomoToggle" );
|
GlobalAccels->Map( AAC( WXK_F2 ).Shift(), "States_CycleSlotBackward" );
|
||||||
|
|
||||||
|
GlobalAccels->Map( AAC( WXK_F4 ), "Framelimiter_MasterToggle");
|
||||||
|
GlobalAccels->Map( AAC( WXK_F4 ).Shift(), "Frameskip_Toggle");
|
||||||
|
GlobalAccels->Map( AAC( WXK_TAB ), "Framelimiter_TurboToggle" );
|
||||||
|
GlobalAccels->Map( AAC( WXK_TAB ).Shift(), "Framelimiter_SlomoToggle" );
|
||||||
|
|
||||||
// Hack! The following bindings are temporary hacks which are needed because of issues
|
// Hack! The following bindings are temporary hacks which are needed because of issues
|
||||||
// with PAD plugin interfacing (the local window-based accelerators in GSPanel are
|
// with PAD plugin interfacing (the local window-based accelerators in GSPanel are
|
||||||
// currently ignored).
|
// currently ignored).
|
||||||
|
|
||||||
GlobalAccels.Map( AAC( WXK_ESCAPE ), "Sys_Suspend");
|
GlobalAccels->Map( AAC( WXK_ESCAPE ), "Sys_Suspend");
|
||||||
GlobalAccels.Map( AAC( WXK_F8 ), "Sys_TakeSnapshot");
|
GlobalAccels->Map( AAC( WXK_F8 ), "Sys_TakeSnapshot");
|
||||||
GlobalAccels.Map( AAC( WXK_F8 ).Shift(), "Sys_TakeSnapshot");
|
GlobalAccels->Map( AAC( WXK_F8 ).Shift(), "Sys_TakeSnapshot");
|
||||||
GlobalAccels.Map( AAC( WXK_F8 ).Shift().Cmd(),"Sys_TakeSnapshot");
|
GlobalAccels->Map( AAC( WXK_F8 ).Shift().Cmd(),"Sys_TakeSnapshot");
|
||||||
GlobalAccels.Map( AAC( WXK_F9 ), "Sys_RenderswitchToggle");
|
GlobalAccels->Map( AAC( WXK_F9 ), "Sys_RenderswitchToggle");
|
||||||
|
|
||||||
GlobalAccels.Map( AAC( WXK_F10 ), "Sys_LoggingToggle");
|
GlobalAccels->Map( AAC( WXK_F10 ), "Sys_LoggingToggle");
|
||||||
GlobalAccels.Map( AAC( WXK_F11 ), "Sys_FreezeGS");
|
GlobalAccels->Map( AAC( WXK_F11 ), "Sys_FreezeGS");
|
||||||
GlobalAccels.Map( AAC( WXK_F12 ), "Sys_RecordingToggle");
|
GlobalAccels->Map( AAC( WXK_F12 ), "Sys_RecordingToggle");
|
||||||
|
|
||||||
GlobalAccels.Map( AAC( WXK_RETURN ).Alt(), "FullscreenToggle" );
|
GlobalAccels->Map( AAC( WXK_RETURN ).Alt(), "FullscreenToggle" );
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "PrecompiledHeader.h"
|
#include "PrecompiledHeader.h"
|
||||||
#include "App.h"
|
|
||||||
#include "MainFrame.h"
|
|
||||||
#include "IsoDropTarget.h"
|
#include "IsoDropTarget.h"
|
||||||
|
|
||||||
#include "Dialogs/ModalPopups.h"
|
#include "Dialogs/ModalPopups.h"
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "AppCommon.h"
|
||||||
#include <wx/dnd.h>
|
#include <wx/dnd.h>
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "PrecompiledHeader.h"
|
#include "PrecompiledHeader.h"
|
||||||
#include "HostGui.h"
|
|
||||||
|
|
||||||
#include "CDVD/CDVD.h"
|
#include "CDVD/CDVD.h"
|
||||||
#include "GS.h"
|
#include "GS.h"
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <wx/image.h>
|
|
||||||
#include <wx/statline.h>
|
#include <wx/statline.h>
|
||||||
#include <wx/dnd.h>
|
#include <wx/dnd.h>
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
#include "PrecompiledHeader.h"
|
#include "PrecompiledHeader.h"
|
||||||
#include "App.h"
|
#include "App.h"
|
||||||
|
#include "AppGameDatabase.h"
|
||||||
#include "ConfigurationPanels.h"
|
#include "ConfigurationPanels.h"
|
||||||
|
|
||||||
extern wxString DiscID;
|
extern wxString DiscID;
|
||||||
|
|
|
@ -14,7 +14,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "PrecompiledHeader.h"
|
#include "PrecompiledHeader.h"
|
||||||
#include "MainFrame.h"
|
#include "AppCoreThread.h"
|
||||||
|
#include "RecentIsoList.h"
|
||||||
#include "IsoDropTarget.h"
|
#include "IsoDropTarget.h"
|
||||||
#include "Utilities/IniInterface.h"
|
#include "Utilities/IniInterface.h"
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "AppCommon.h"
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------
|
||||||
// RecentIsoManager
|
// RecentIsoManager
|
||||||
// --------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------
|
||||||
|
@ -61,3 +63,16 @@ protected:
|
||||||
void AppStatusEvent_OnSettingsApplied();
|
void AppStatusEvent_OnSettingsApplied();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------
|
||||||
|
// RecentIsoList
|
||||||
|
// --------------------------------------------------------------------------------------
|
||||||
|
struct RecentIsoList
|
||||||
|
{
|
||||||
|
ScopedPtr<RecentIsoManager> Manager;
|
||||||
|
ScopedPtr<wxMenu> Menu;
|
||||||
|
|
||||||
|
RecentIsoList();
|
||||||
|
virtual ~RecentIsoList() throw() { }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
|
@ -18,13 +18,10 @@
|
||||||
#include "AppSaveStates.h"
|
#include "AppSaveStates.h"
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "HostGui.h"
|
|
||||||
|
|
||||||
#include "GS.h"
|
#include "GS.h"
|
||||||
#include "Elfheader.h"
|
#include "Elfheader.h"
|
||||||
|
|
||||||
StartupParams g_Startup;
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------
|
||||||
// Saveslot Section
|
// Saveslot Section
|
||||||
// --------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -2625,6 +2625,10 @@
|
||||||
RelativePath="..\..\gui\App.h"
|
RelativePath="..\..\gui\App.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\gui\AppAccelerators.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\gui\AppCommon.h"
|
RelativePath="..\..\gui\AppCommon.h"
|
||||||
>
|
>
|
||||||
|
@ -2677,10 +2681,6 @@
|
||||||
RelativePath="..\..\gui\GSFrame.h"
|
RelativePath="..\..\gui\GSFrame.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\..\HostGui.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\gui\IsoDropTarget.h"
|
RelativePath="..\..\gui\IsoDropTarget.h"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue