mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-04 11:45:18 +02:00
Remove easy_file.cpp/h. Minor cleanups.
This commit is contained in:
+32
-50
@@ -88,6 +88,22 @@ WindowsHost::WindowsHost(HWND mainWindow, HWND displayWindow)
|
||||
SetConsolePosition();
|
||||
}
|
||||
|
||||
void WindowsHost::SetConsolePosition() {
|
||||
HWND console = GetConsoleWindow();
|
||||
if (console != NULL && g_Config.iConsoleWindowX != -1 && g_Config.iConsoleWindowY != -1)
|
||||
SetWindowPos(console, NULL, g_Config.iConsoleWindowX, g_Config.iConsoleWindowY, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
|
||||
}
|
||||
|
||||
void WindowsHost::UpdateConsolePosition() {
|
||||
RECT rc;
|
||||
HWND console = GetConsoleWindow();
|
||||
if (console != NULL && GetWindowRect(console, &rc) && !IsIconic(console))
|
||||
{
|
||||
g_Config.iConsoleWindowX = rc.left;
|
||||
g_Config.iConsoleWindowY = rc.top;
|
||||
}
|
||||
}
|
||||
|
||||
bool WindowsHost::InitGraphics(std::string *error_message) {
|
||||
switch (g_Config.iGPUBackend) {
|
||||
case GPU_BACKEND_OPENGL:
|
||||
@@ -111,8 +127,7 @@ void WindowsHost::ShutdownGraphics() {
|
||||
PostMessage(mainWindow_, WM_CLOSE, 0, 0);
|
||||
}
|
||||
|
||||
void WindowsHost::SetWindowTitle(const char *message)
|
||||
{
|
||||
void WindowsHost::SetWindowTitle(const char *message) {
|
||||
std::wstring winTitle = ConvertUTF8ToWString(std::string("PPSSPP ") + PPSSPP_GIT_VERSION);
|
||||
if (message != nullptr) {
|
||||
winTitle.append(ConvertUTF8ToWString(" - "));
|
||||
@@ -123,56 +138,47 @@ void WindowsHost::SetWindowTitle(const char *message)
|
||||
PostMessage(mainWindow_, MainWindow::WM_USER_WINDOW_TITLE_CHANGED, 0, 0);
|
||||
}
|
||||
|
||||
void WindowsHost::InitSound()
|
||||
{
|
||||
void WindowsHost::InitSound() {
|
||||
}
|
||||
|
||||
// UGLY!
|
||||
extern WindowsAudioBackend *winAudioBackend;
|
||||
|
||||
void WindowsHost::UpdateSound()
|
||||
{
|
||||
void WindowsHost::UpdateSound() {
|
||||
if (winAudioBackend)
|
||||
winAudioBackend->Update();
|
||||
}
|
||||
|
||||
void WindowsHost::ShutdownSound()
|
||||
{
|
||||
void WindowsHost::ShutdownSound() {
|
||||
}
|
||||
|
||||
void WindowsHost::UpdateUI()
|
||||
{
|
||||
void WindowsHost::UpdateUI() {
|
||||
PostMessage(mainWindow_, MainWindow::WM_USER_UPDATE_UI, 0, 0);
|
||||
}
|
||||
|
||||
void WindowsHost::UpdateScreen()
|
||||
{
|
||||
void WindowsHost::UpdateScreen() {
|
||||
PostMessage(mainWindow_, MainWindow::WM_USER_UPDATE_SCREEN, 0, 0);
|
||||
}
|
||||
|
||||
void WindowsHost::UpdateMemView()
|
||||
{
|
||||
void WindowsHost::UpdateMemView() {
|
||||
for (int i = 0; i < numCPUs; i++)
|
||||
if (memoryWindow[i])
|
||||
PostDialogMessage(memoryWindow[i], WM_DEB_UPDATE);
|
||||
}
|
||||
|
||||
void WindowsHost::UpdateDisassembly()
|
||||
{
|
||||
void WindowsHost::UpdateDisassembly() {
|
||||
for (int i = 0; i < numCPUs; i++)
|
||||
if (disasmWindow[i])
|
||||
PostDialogMessage(disasmWindow[i], WM_DEB_UPDATE);
|
||||
}
|
||||
|
||||
void WindowsHost::SetDebugMode(bool mode)
|
||||
{
|
||||
void WindowsHost::SetDebugMode(bool mode) {
|
||||
for (int i = 0; i < numCPUs; i++)
|
||||
if (disasmWindow[i])
|
||||
PostDialogMessage(disasmWindow[i], WM_DEB_SETDEBUGLPARAM, 0, (LPARAM)mode);
|
||||
}
|
||||
|
||||
void WindowsHost::PollControllers(InputState &input_state)
|
||||
{
|
||||
void WindowsHost::PollControllers(InputState &input_state) {
|
||||
bool doPad = true;
|
||||
for (auto iter = this->input.begin(); iter != this->input.end(); iter++)
|
||||
{
|
||||
@@ -202,8 +208,7 @@ void WindowsHost::PollControllers(InputState &input_state)
|
||||
//if (fabsf(my) > 0.1f) NativeAxis(axisY);
|
||||
}
|
||||
|
||||
void WindowsHost::BootDone()
|
||||
{
|
||||
void WindowsHost::BootDone() {
|
||||
symbolMap.SortSymbols();
|
||||
SendMessage(mainWindow_, WM_USER + 1, 0, 0);
|
||||
|
||||
@@ -211,16 +216,14 @@ void WindowsHost::BootDone()
|
||||
Core_EnableStepping(!g_Config.bAutoRun);
|
||||
}
|
||||
|
||||
static std::string SymbolMapFilename(const char *currentFilename, char* ext)
|
||||
{
|
||||
static std::string SymbolMapFilename(const char *currentFilename, char* ext) {
|
||||
FileInfo info;
|
||||
|
||||
std::string result = currentFilename;
|
||||
|
||||
// can't fail, definitely exists if it gets this far
|
||||
getFileInfo(currentFilename, &info);
|
||||
if (info.isDirectory)
|
||||
{
|
||||
if (info.isDirectory) {
|
||||
#ifdef _WIN32
|
||||
char* slash = "\\";
|
||||
#else
|
||||
@@ -240,8 +243,7 @@ static std::string SymbolMapFilename(const char *currentFilename, char* ext)
|
||||
}
|
||||
}
|
||||
|
||||
bool WindowsHost::AttemptLoadSymbolMap()
|
||||
{
|
||||
bool WindowsHost::AttemptLoadSymbolMap() {
|
||||
bool result1 = symbolMap.LoadSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart.c_str(),".ppmap").c_str());
|
||||
// Load the old-style map file.
|
||||
if (!result1)
|
||||
@@ -250,13 +252,11 @@ bool WindowsHost::AttemptLoadSymbolMap()
|
||||
return result1 || result2;
|
||||
}
|
||||
|
||||
void WindowsHost::SaveSymbolMap()
|
||||
{
|
||||
void WindowsHost::SaveSymbolMap() {
|
||||
symbolMap.SaveSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart.c_str(),".ppmap").c_str());
|
||||
}
|
||||
|
||||
bool WindowsHost::IsDebuggingEnabled()
|
||||
{
|
||||
bool WindowsHost::IsDebuggingEnabled() {
|
||||
#ifdef _DEBUG
|
||||
return true;
|
||||
#else
|
||||
@@ -264,24 +264,6 @@ bool WindowsHost::IsDebuggingEnabled()
|
||||
#endif
|
||||
}
|
||||
|
||||
void WindowsHost::SetConsolePosition()
|
||||
{
|
||||
HWND console = GetConsoleWindow();
|
||||
if (console != NULL && g_Config.iConsoleWindowX != -1 && g_Config.iConsoleWindowY != -1)
|
||||
SetWindowPos(console, NULL, g_Config.iConsoleWindowX, g_Config.iConsoleWindowY, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
|
||||
}
|
||||
|
||||
void WindowsHost::UpdateConsolePosition()
|
||||
{
|
||||
RECT rc;
|
||||
HWND console = GetConsoleWindow();
|
||||
if (console != NULL && GetWindowRect(console, &rc) && !IsIconic(console))
|
||||
{
|
||||
g_Config.iConsoleWindowX = rc.left;
|
||||
g_Config.iConsoleWindowY = rc.top;
|
||||
}
|
||||
}
|
||||
|
||||
// http://msdn.microsoft.com/en-us/library/aa969393.aspx
|
||||
HRESULT CreateLink(LPCWSTR lpszPathObj, LPCWSTR lpszArguments, LPCWSTR lpszPathLink, LPCWSTR lpszDesc) {
|
||||
HRESULT hres;
|
||||
|
||||
Reference in New Issue
Block a user