Commit 7a50f72c authored by gerstrong@gmail.com's avatar [email protected]

Added define where mouse/touch cursor pos and state are shown. Useful for debugging

parent 54f4e4c3
......@@ -18,6 +18,13 @@ if(USE_VIRTUALPAD)
endif(USE_VIRTUALPAD)
OPTION(DUMP_MTCS "Show Mouse Touch Cursor Position" No)
IF (DUMP_MTCS)
ADD_DEFINITIONS(-DDUMP_MTCS)
endif(DUMP_MTCS)
# Add GsKit
add_subdirectory("GsKit")
......
......@@ -28,7 +28,6 @@ IF (USE_SDL_TTF)
ENDIF(USE_SDL_TTF)
set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/CMake")
set(CMAKE_CXX_STANDARD 14)
......
......@@ -335,7 +335,6 @@ std::string CInput::getEventShortName(int command, unsigned char input)
}
void CInput::render()
{
#ifdef VIRTUALPAD
......@@ -357,6 +356,7 @@ void CInput::render()
GsWeakSurface blit(gVideoDriver.getBlitSurface());
mpVirtPad->render(blit);
#endif
}
......
......@@ -217,7 +217,7 @@ void GsApp::render()
if(mpCurEngine)
{
mpCurEngine->render();
}
}
gMenuController.render();
......
......@@ -9,6 +9,7 @@
#include <base/GsLogging.h>
#include <base/video/CVideoDriver.h>
#include <base/CInput.h>
#include <base/PointDevice.h>
#include <base/InputEvents.h>
#include <base/GsApp.h>
#include <widgets/GsTextSelectionList.h>
......@@ -842,6 +843,7 @@ void CGameLauncher::ponderPatchDialog()
}
////
// Process Routine
////
......@@ -930,9 +932,36 @@ void CGameLauncher::ponder(const float deltaT)
{
// User chose "exit". So make CG quit...
gEventManager.add( new GMQuit() );
}
}
}
void CGameLauncher::renderMouseTouchState()
{
GsWeakSurface blit(gVideoDriver.getBlitSurface());
// Show mouse/touch cursor Pos and actions
if(!mMouseTouchCurSfc)
{
const SDL_Rect sdlRect = gVideoDriver.getBlitSurface()->clip_rect;
mMouseTouchCurSfc.create(0, sdlRect.w, sdlRect.h, RES_BPP, 0, 0, 0, 0);
}
mMouseTouchCurSfc.fillRGB(0, 0, 0);
auto &Font = gGraphics.getFontLegacy(0);
const auto &pos = gPointDevice.mPointingState.mPos;
const auto &act = gPointDevice.mPointingState.mActionButton;
std::string tempbuf = "MTC: " + ftoa(pos.x) + "," +
ftoa(pos.y) + "->" + itoa(act);
mMouseTouchCurSfc.fillRGB(0, 0, 0);
Font.drawFont(mMouseTouchCurSfc.getSDLSurface(),
tempbuf,
0, 0, true);
// In there is garbage of other drawn stuff clean it up.
mMouseTouchCurSfc.blitTo(blit);
}
void CGameLauncher::render()
{
......@@ -940,6 +969,10 @@ void CGameLauncher::render()
blit.fillRGB(0, 0, 0);
#ifdef DUMP_MTCS
renderMouseTouchState();
#endif
if(mpMsgDialog)
{
mpMsgDialog->processRendering();
......
......@@ -85,6 +85,9 @@ public:
void ponderPatchDialog();
void ponder(const float deltaT) override;
void renderMouseTouchState();
void render() override;
int getChosengame()
......@@ -128,6 +131,8 @@ private:
std::unique_ptr<CGUIDialog> mpPatchDialog;
GsSurface mMouseTouchCurSfc;
//// Download Dialog Section. TODO: Make it external
int mLastStoreSelection = -1;
std::unique_ptr<CGUIDialog> mpGameStoreDialog;
......
......@@ -80,7 +80,7 @@ void GameEngine::renderFPSDisplay()
mFPSSurface.createRGBSurface(rect);
}
std::string tempbuf = "FPS: " + ftoa(gTimer.LastFPS());
std::string tempbuf = "FPS: " + ftoa(gTimer.LastFPS());
mFPSSurface.fillRGBA(0x88, 0x88, 0x88, 0x88);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment