Hi,
Preparing a huge update to our popular puzzle game: “T-Crisis”…
After using:
SDL_RenderSetLogicalSize(visuals->Renderer, 640, 480);
Mouse X coordinates are wrong?
Need some help with this.
Please look at below source code and propose a code solution.
SDL_PumpEvents();
SDL_GetMouseState(&MouseX, &MouseY);
float tempX, tempXtwo;
float tempY, tempYtwo;;
if (visuals->WindowWidthCurrent != 640)
{
if (visuals->ForceAspectRatio == false)
{
tempX = visuals->WindowWidthCurrent;
tempXtwo = tempX / 640;
tempX = MouseX;
MouseX = (int)(tempX / tempXtwo);
}
else if (visuals->ForceAspectRatio == true)
{
// STUCK HERE!!!
}
}
if (visuals->WindowHeightCurrent != 480)
{
tempY = visuals->WindowHeightCurrent;
tempYtwo = tempY / 480;
tempY = MouseY;
MouseY = (int)(tempY / tempYtwo);
}
You can download the full stable/clean SDL2 project at below URL link:
https://fallenangelsoftware.com/stuff/files/TC4T-SDL2/source/TC4T-LinuxWin-Retail3.zip
EDIT #1: GitHub repository updated to current stable version below:
Any help would be appreciated!
Much more work to be done before December 24th…
Jesse