Move Display_ScaleX/Y to Window.h and ignore build results for other consoles too

This commit is contained in:
UnknownShadow200 2024-01-19 22:03:20 +11:00
parent cdbe0d77f1
commit 81b56f76ce
13 changed files with 11 additions and 37 deletions

11
.gitignore vendored
View File

@ -20,12 +20,19 @@ android/app/.externalNativeBuild/
android/local.properties
*.iml
# 3DS build results
# Console build results
build-360/
build-3ds/
build-dc/
build-gc/
build-n64/
build-ps2/
build-ps3/
build-vita/
build-wii/
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/

View File

@ -64,9 +64,9 @@ CC_VAR extern struct _DisplayData {
} DisplayInfo;
/* Scales the given X coordinate from 96 dpi to current display dpi. */
int Display_ScaleX(int x);
static CC_INLINE int Display_ScaleX(int x) { return (int)(x * DisplayInfo.ScaleX); }
/* Scales the given Y coordinate from 96 dpi to current display dpi. */
int Display_ScaleY(int y);
static CC_INLINE int Display_ScaleY(int y) { return (int)(y * DisplayInfo.ScaleY); }
/* Data for the game/launcher window. */
CC_VAR extern struct _WinData {

View File

@ -18,9 +18,6 @@ static Result irrst_result;
struct _DisplayData DisplayInfo;
struct _WinData WindowInfo;
// Render everything at half size due to the small resolution
int Display_ScaleX(int x) { return x / 2; }
int Display_ScaleY(int y) { return y / 2; }
// Note from https://github.com/devkitPro/libctru/blob/master/libctru/include/3ds/gfx.h

View File

@ -15,9 +15,6 @@ static cc_bool launcherMode;
struct _DisplayData DisplayInfo;
struct _WinData WindowInfo;
// no DPI scaling on 3DS
int Display_ScaleX(int x) { return x; }
int Display_ScaleY(int y) { return y; }
void Window_Init(void) {
DisplayInfo.Width = vid_mode->width;

View File

@ -23,9 +23,6 @@ static GXRModeObj* rmode;
void* Window_XFB;
struct _DisplayData DisplayInfo;
struct _WinData WindowInfo;
// no DPI scaling on Wii/GameCube
int Display_ScaleX(int x) { return x; }
int Display_ScaleY(int y) { return y; }
static void OnPowerOff(void) {

View File

@ -16,9 +16,6 @@ static cc_bool launcherMode;
struct _DisplayData DisplayInfo;
struct _WinData WindowInfo;
// no DPI scaling on Wii/GameCube
int Display_ScaleX(int x) { return x; }
int Display_ScaleY(int y) { return y; }
void Window_Init(void) {
display_init(RESOLUTION_320x240, DEPTH_32_BPP, 2, GAMMA_NONE, FILTERS_DISABLED);

View File

@ -26,9 +26,6 @@ static char padBuf[256] __attribute__((aligned(64)));
struct _DisplayData DisplayInfo;
struct _WinData WindowInfo;
// no DPI scaling on PS Vita
int Display_ScaleX(int x) { return x; }
int Display_ScaleY(int y) { return y; }
void Window_Init(void) {
DisplayInfo.Width = 640;

View File

@ -25,9 +25,6 @@ static KbConfig kb_config;
struct _DisplayData DisplayInfo;
struct _WinData WindowInfo;
// no DPI scaling on PS Vita
int Display_ScaleX(int x) { return x; }
int Display_ScaleY(int y) { return y; }
static void sysutil_callback(u64 status, u64 param, void* usrdata) {
switch (status) {

View File

@ -21,9 +21,6 @@ static cc_bool launcherMode;
struct _DisplayData DisplayInfo;
struct _WinData WindowInfo;
// no DPI scaling on Wii/GameCube
int Display_ScaleX(int x) { return x; }
int Display_ScaleY(int y) { return y; }
void Window_Init(void) {
DisplayInfo.Width = SCREEN_WIDTH;

View File

@ -18,9 +18,6 @@ static SceTouchPanelInfo frontPanel;
struct _DisplayData DisplayInfo;
struct _WinData WindowInfo;
// no DPI scaling on PS Vita
int Display_ScaleX(int x) { return x; }
int Display_ScaleY(int y) { return y; }
#define DISPLAY_WIDTH 960
#define DISPLAY_HEIGHT 544

View File

@ -20,9 +20,6 @@ static xid_gamepad_in gp_state;
struct _DisplayData DisplayInfo;
struct _WinData WindowInfo;
// no DPI scaling on Xbox
int Display_ScaleX(int x) { return x; }
int Display_ScaleY(int y) { return y; }
// TODO No idea if this even works
static void OnDataReceived(UTR_T* utr) {

View File

@ -18,9 +18,6 @@ static cc_bool launcherMode;
struct _DisplayData DisplayInfo;
struct _WinData WindowInfo;
// no DPI scaling on Xbox
int Display_ScaleX(int x) { return x; }
int Display_ScaleY(int y) { return y; }
// https://github.com/Free60Project/libxenon/blob/71a411cddfc26c9ccade08d054d87180c359797a/libxenon/drivers/console/console.c#L47
struct ati_info {

View File

@ -10,9 +10,6 @@ struct _WinData WindowInfo;
#define Display_CentreX(width) (DisplayInfo.x + (DisplayInfo.Width - width) / 2)
#define Display_CentreY(height) (DisplayInfo.y + (DisplayInfo.Height - height) / 2)
int Display_ScaleX(int x) { return (int)(x * DisplayInfo.ScaleX); }
int Display_ScaleY(int y) { return (int)(y * DisplayInfo.ScaleY); }
static int cursorPrevX, cursorPrevY;
static cc_bool cursorVisible = true;
/* Gets the position of the cursor in screen or window coordinates */