mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-17 22:55:38 +00:00
implement debug rects for images similar to text components
This commit is contained in:
parent
96a0fa3a14
commit
b41118fe92
|
@ -13,6 +13,7 @@ std::vector<const char*> settings_dont_save {
|
||||||
{ "Debug" },
|
{ "Debug" },
|
||||||
{ "DebugGrid" },
|
{ "DebugGrid" },
|
||||||
{ "DebugText" },
|
{ "DebugText" },
|
||||||
|
{ "DebugImage" },
|
||||||
{ "ForceKid" },
|
{ "ForceKid" },
|
||||||
{ "ForceKiosk" },
|
{ "ForceKiosk" },
|
||||||
{ "IgnoreGamelist" },
|
{ "IgnoreGamelist" },
|
||||||
|
|
|
@ -168,6 +168,11 @@ void Window::input(InputConfig* config, Input input)
|
||||||
// toggle TextComponent debug view with Ctrl-T
|
// toggle TextComponent debug view with Ctrl-T
|
||||||
Settings::getInstance()->setBool("DebugText", !Settings::getInstance()->getBool("DebugText"));
|
Settings::getInstance()->setBool("DebugText", !Settings::getInstance()->getBool("DebugText"));
|
||||||
}
|
}
|
||||||
|
else if(config->getDeviceId() == DEVICE_KEYBOARD && input.value && input.id == SDLK_i && SDL_GetModState() & KMOD_LCTRL && Settings::getInstance()->getBool("Debug"))
|
||||||
|
{
|
||||||
|
// toggle TextComponent debug view with Ctrl-I
|
||||||
|
Settings::getInstance()->setBool("DebugImage", !Settings::getInstance()->getBool("DebugImage"));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (peekGui())
|
if (peekGui())
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "resources/TextureResource.h"
|
#include "resources/TextureResource.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "Renderer.h"
|
#include "Renderer.h"
|
||||||
|
#include "Settings.h"
|
||||||
#include "ThemeData.h"
|
#include "ThemeData.h"
|
||||||
|
|
||||||
Vector2i ImageComponent::getTextureSize() const
|
Vector2i ImageComponent::getTextureSize() const
|
||||||
|
@ -229,6 +230,11 @@ void ImageComponent::render(const Transform4x4f& parentTrans)
|
||||||
|
|
||||||
if(mTexture && mOpacity > 0)
|
if(mTexture && mOpacity > 0)
|
||||||
{
|
{
|
||||||
|
if(Settings::getInstance()->getBool("DebugImage")) {
|
||||||
|
Vector2f targetSizePos = (mTargetSize - mSize) * mOrigin * -1;
|
||||||
|
Renderer::drawRect(targetSizePos.x(), targetSizePos.y(), mTargetSize.x(), mTargetSize.y(), 0xFF000033);
|
||||||
|
Renderer::drawRect(0.0f, 0.0f, mSize.x(), mSize.y(), 0x00000033);
|
||||||
|
}
|
||||||
if(mTexture->isInitialized())
|
if(mTexture->isInitialized())
|
||||||
{
|
{
|
||||||
// actually draw the image
|
// actually draw the image
|
||||||
|
|
Loading…
Reference in a new issue