WX:
- put the WX libraries into the project settings. (I had to do it with Notepad++ to be compatible with x64. Hoping I didn't fuck up anything but everything should be ok). Start getting rid of those #pragma comment's. - first attempt at implementing touchscreen. Doesn't work, probably due to crossplatformness issues. >_<
This commit is contained in:
parent
a562c7f966
commit
90086cf357
|
@ -79,7 +79,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Rpcrt4.lib directx-win32-ddraw-dinput8-dsound-dxerr8-dxguid.lib lua-vc8-Win32-debug.lib glib-vc8-Win32.lib 7z-vc8-Win32.lib zlib-vc8-Win32.lib agg-2.5.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib comctl32.lib"
|
||||
AdditionalDependencies="Rpcrt4.lib directx-win32-ddraw-dinput8-dsound-dxerr8-dxguid.lib lua-vc8-Win32-debug.lib glib-vc8-Win32.lib 7z-vc8-Win32.lib zlib-vc8-Win32.lib agg-2.5.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib comctl32.lib wxbase28d.lib wxmsw28d_core.lib"
|
||||
OutputFile="$(OutDir)\$(ProjectName)_debug.exe"
|
||||
AdditionalLibraryDirectories="..\windows\zlib123;..\windows\agg;.libs"
|
||||
DelayLoadDLLs=""
|
||||
|
@ -170,7 +170,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Rpcrt4.lib directx-x64-ddraw-dinput8-dsound-dxerr8-dxguid.lib lua-vc8-x64.lib glib-vc8-x64.lib 7z-vc8-x64.lib zlib-vc8-x64.lib agg-2.5-x64.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib comctl32.lib"
|
||||
AdditionalDependencies="Rpcrt4.lib directx-x64-ddraw-dinput8-dsound-dxerr8-dxguid.lib lua-vc8-x64.lib glib-vc8-x64.lib 7z-vc8-x64.lib zlib-vc8-x64.lib agg-2.5-x64.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib comctl32.lib wxbase28d-x64.lib wxmsw28d_core-x64.lib"
|
||||
OutputFile="$(OutDir)\$(ProjectName)_x64_debug.exe"
|
||||
AdditionalLibraryDirectories="..\windows\zlib123;..\windows\agg;.libs"
|
||||
GenerateDebugInformation="true"
|
||||
|
@ -263,7 +263,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Rpcrt4.lib directx-win32-ddraw-dinput8-dsound-dxerr8-dxguid.lib lua-vc8-Win32.lib glib-vc8-Win32.lib 7z-vc8-Win32.lib zlib-vc8-Win32.lib agg-2.5.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib comctl32.lib"
|
||||
AdditionalDependencies="Rpcrt4.lib directx-win32-ddraw-dinput8-dsound-dxerr8-dxguid.lib lua-vc8-Win32.lib glib-vc8-Win32.lib 7z-vc8-Win32.lib zlib-vc8-Win32.lib agg-2.5.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib comctl32.lib wxbase28.lib wxmsw28_core.lib"
|
||||
OutputFile="$(OutDir)\$(ProjectName)_release.exe"
|
||||
AdditionalLibraryDirectories="..\windows\zlib123;..\windows\agg;.libs"
|
||||
DelayLoadDLLs=""
|
||||
|
@ -358,7 +358,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="directx-x64-ddraw-dinput8-dsound-dxerr8-dxguid.lib lua-vc8-x64.lib glib-vc8-x64.lib 7z-vc8-x64.lib zlib-vc8-x64.lib agg-2.5-x64.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib"
|
||||
AdditionalDependencies="directx-x64-ddraw-dinput8-dsound-dxerr8-dxguid.lib lua-vc8-x64.lib glib-vc8-x64.lib 7z-vc8-x64.lib zlib-vc8-x64.lib agg-2.5-x64.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib wxbase28-x64.lib wxmsw28_core-x64.lib"
|
||||
OutputFile="$(OutDir)\$(ProjectName)_x64_release.exe"
|
||||
AdditionalLibraryDirectories="..\windows\zlib123;..\windows\agg;.libs"
|
||||
GenerateDebugInformation="true"
|
||||
|
@ -452,7 +452,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Rpcrt4.lib directx-win32-ddraw-dinput8-dsound-dxerr8-dxguid.lib lua-vc8-Win32.lib glib-vc8-Win32.lib 7z-vc8-Win32.lib zlib-vc8-Win32.lib agg-2.5.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib comctl32.lib"
|
||||
AdditionalDependencies="Rpcrt4.lib directx-win32-ddraw-dinput8-dsound-dxerr8-dxguid.lib lua-vc8-Win32.lib glib-vc8-Win32.lib 7z-vc8-Win32.lib zlib-vc8-Win32.lib agg-2.5.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib comctl32.lib wxbase28.lib wxmsw28_core.lib"
|
||||
OutputFile="$(OutDir)\$(ProjectName)_dev+.exe"
|
||||
AdditionalLibraryDirectories="..\windows\zlib123;..\windows\agg;.libs"
|
||||
DelayLoadDLLs=""
|
||||
|
@ -548,7 +548,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="directx-x64-ddraw-dinput8-dsound-dxerr8-dxguid.lib lua-vc8-x64.lib glib-vc8-x64.lib 7z-vc8-x64.lib zlib-vc8-x64.lib agg-2.5-x64.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib"
|
||||
AdditionalDependencies="directx-x64-ddraw-dinput8-dsound-dxerr8-dxguid.lib lua-vc8-x64.lib glib-vc8-x64.lib 7z-vc8-x64.lib zlib-vc8-x64.lib agg-2.5-x64.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib wxbase28-x64.lib wxmsw28_core-x64.lib"
|
||||
OutputFile="$(OutDir)\$(ProjectName)_x64_dev+.exe"
|
||||
AdditionalLibraryDirectories="..\windows\zlib123;..\windows\agg;.libs"
|
||||
GenerateDebugInformation="true"
|
||||
|
|
|
@ -12,25 +12,7 @@
|
|||
#include "OGLRender.h"
|
||||
#include "firmware.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _M_X64
|
||||
#ifndef NDEBUG
|
||||
#pragma comment(lib,"wxmsw28d_core-x64.lib")
|
||||
#pragma comment(lib,"wxbase28d-x64.lib")
|
||||
#else
|
||||
#pragma comment(lib,"wxmsw28_core-x64.lib")
|
||||
#pragma comment(lib,"wxbase28-x64.lib")
|
||||
#endif
|
||||
#else
|
||||
#ifndef NDEBUG
|
||||
#pragma comment(lib,"wxmsw28d_core.lib")
|
||||
#pragma comment(lib,"wxbase28d.lib")
|
||||
#else
|
||||
#pragma comment(lib,"wxmsw28_core.lib")
|
||||
#pragma comment(lib,"wxbase28.lib")
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#ifndef WIN32
|
||||
#define lstrlen(a) strlen((a))
|
||||
#endif
|
||||
|
||||
|
@ -59,6 +41,7 @@
|
|||
#define GAP_MAX 90
|
||||
static int nds_gap_size;
|
||||
static int nds_screen_rotation_angle;
|
||||
static bool Touch = false;
|
||||
|
||||
SoundInterface_struct *SNDCoreList[] = {
|
||||
&SNDDummy,
|
||||
|
@ -185,6 +168,68 @@ public:
|
|||
NDS_LoadROM(dialog.GetPath().mb_str(), dialog.GetPath().mb_str());
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Touchscreen
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
// De-transform coordinates.
|
||||
// Returns true if the coordinates are within the touchscreen.
|
||||
bool DetransformTouchCoords(int& X, int& Y)
|
||||
{
|
||||
int dtX, dtY;
|
||||
|
||||
// TODO: descaling (when scaling is supported)
|
||||
|
||||
// De-rotate coordinates
|
||||
switch (nds_screen_rotation_angle)
|
||||
{
|
||||
case 0: dtX = X; dtY = Y - 191 - nds_gap_size; break;
|
||||
case 90: dtX = Y; dtY = 191 - X; break;
|
||||
case 180: dtX = 255 - X; dtY = 191 - Y; break;
|
||||
case 270: dtX = 255 - Y; dtY = X - 191 - nds_gap_size; break;
|
||||
}
|
||||
|
||||
// Atleast one of the coordinates is out of range
|
||||
if ((dtX < 0) || (dtX > 255) || (dtY < 0) || (dtY > 191))
|
||||
{
|
||||
X = wxClip(dtX, 0, 255);
|
||||
Y = wxClip(dtY, 0, 191);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
X = dtX;
|
||||
Y = dtY;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void OnTouchEvent(wxMouseEvent& evt)
|
||||
{
|
||||
wxPoint pt = evt.GetPosition();
|
||||
bool inside = DetransformTouchCoords(pt.x, pt.y);
|
||||
|
||||
if (evt.LeftDown() && inside)
|
||||
{
|
||||
Touch = true;
|
||||
NDS_setTouchPos((u16)pt.x, (u16)pt.y);
|
||||
}
|
||||
else if(evt.LeftUp() && Touch)
|
||||
{
|
||||
Touch = false;
|
||||
NDS_releaseTouch();
|
||||
}
|
||||
else if (Touch)
|
||||
{
|
||||
NDS_setTouchPos((u16)pt.x, (u16)pt.y);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Video
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
void gpu_screen_to_rgb(u8 *rgb1, u8 *rgb2)
|
||||
{
|
||||
u16 gpu_pixel;
|
||||
|
@ -536,10 +581,16 @@ void DesmumeFrame::onResize(wxSizeEvent &event) {
|
|||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(DesmumeFrame, wxFrame)
|
||||
|
||||
EVT_PAINT(DesmumeFrame::onPaint)
|
||||
EVT_IDLE(DesmumeFrame::onIdle)
|
||||
EVT_SIZE(DesmumeFrame::onResize)
|
||||
EVT_LEFT_DOWN(DesmumeFrame::OnTouchEvent)
|
||||
EVT_LEFT_UP(DesmumeFrame::OnTouchEvent)
|
||||
EVT_LEFT_DCLICK(DesmumeFrame::OnTouchEvent)
|
||||
EVT_MOTION(DesmumeFrame::OnTouchEvent)
|
||||
EVT_CLOSE(DesmumeFrame::OnClose)
|
||||
|
||||
EVT_MENU(wxID_EXIT, DesmumeFrame::OnQuit)
|
||||
EVT_MENU(wxID_OPEN, DesmumeFrame::LoadRom)
|
||||
EVT_MENU(wxID_ABOUT,DesmumeFrame::OnAbout)
|
||||
|
|
Loading…
Reference in New Issue