Fix Headless build error introduced by #3063.

This commit is contained in:
The Dax 2013-08-06 19:28:43 -04:00
parent f08dd3eba6
commit 40b1c6298a
4 changed files with 20 additions and 11 deletions

View File

@ -27,19 +27,15 @@
#include "Common/ChunkFile.h"
#include "GPU/GPUState.h"
#ifdef _WIN32
#include "Core/Host.h"
#endif
#ifndef _WIN32
#include <ctype.h>
#include <math.h>
#endif
#ifdef _WIN32
#include "../Windows/InputBox.h"
namespace MainWindow {
extern HWND hwndMain;
HINSTANCE GetHinstance();
};
#endif
const int numKeyCols[OSK_KEYBOARD_COUNT] = {12, 12, 13, 13, 12, 12, 12};
const int numKeyRows[OSK_KEYBOARD_COUNT] = {4, 4, 5, 5, 5, 4, 4};
@ -783,10 +779,10 @@ int PSPOskDialog::NativeKeyboard()
size_t maxInputLength = FieldMaxLength();
if(!InputBox_GetString(0, MainWindow::hwndMain, windowTitle, defaultText, input, maxInputLength)) {
if(host->InputBoxGetString(windowTitle, defaultText, input, maxInputLength)) {
strncat(input, "", strlen(""));
}
// TODO: Insert your platform's native keyboard stuff here...
// TODO: Insert your platform's native keyboard stuff here...
status = SCE_UTILITY_STATUS_FINISHED;
}

View File

@ -65,9 +65,15 @@ public:
virtual void SetGPUStep(bool value, int flag = 0, int data = 0) {}
virtual void NextGPUStep() {}
#ifdef _WIN32
// Used instead of InputBox_GetString in PSPOskDialog.cpp to bypass the onscreen keyboard.
virtual bool InputBoxGetString(char *title, char *defaultValue, char *outValue, size_t outlength) { return false; }
#endif
// Used for headless.
virtual void SendDebugOutput(const std::string &output) {}
virtual void SendDebugScreenshot(const u8 *pixbuf, u32 w, u32 h) {}
};
extern Host *host;

View File

@ -28,6 +28,7 @@
#include "Windows/Debugger/DebuggerShared.h"
#include "Windows/Debugger/Debugger_Disasm.h"
#include "Windows/Debugger/Debugger_MemoryDlg.h"
#include "Windows/InputBox.h"
#include "Windows/DinputDevice.h"
#include "Windows/XinputDevice.h"
@ -39,7 +40,6 @@
#include "file/file_util.h"
#include "main.h"
static PMixer *curMixer;
int MyMix(short *buffer, int numSamples, int bits, int rate, int channels)
@ -255,3 +255,8 @@ void WindowsHost::UpdateConsolePosition()
g_Config.iConsoleWindowY = rc.top;
}
}
bool WindowsHost::InputBoxGetString(char *title, char *defaultValue, char *outValue, size_t outLength)
{
return InputBox_GetString(MainWindow::GetHInstance(), MainWindow::GetHWND(), title, defaultValue, outValue, outLength);
}

View File

@ -52,6 +52,8 @@ public:
void SaveSymbolMap();
void SetWindowTitle(const char *message);
bool InputBoxGetString(char *title, char *defaultValue, char *outValue, size_t outlength);
std::shared_ptr<KeyboardDevice> keyboard;
private: