[iortcw] 13/95: All: Add more resolutions to modelist and modify system menu to allow selection
Simon McVittie
smcv at debian.org
Fri Sep 8 10:41:46 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to tag 1.51
in repository iortcw.
commit 7a7103158fe271d40d8697e2dd601dbe4b78e8e3
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date: Mon Jan 16 08:41:50 2017 -0500
All: Add more resolutions to modelist and modify system menu to allow selection
---
MP/code/rend2/tr_init.c | 43 ++++++++++++++++++-------
MP/code/renderer/tr_init.c | 43 ++++++++++++++++++-------
MP/code/ui/ui_shared.c | 80 ++++++++++++++++++++++++++++++++++++++++------
SP/code/rend2/tr_init.c | 44 +++++++++++++++++--------
SP/code/renderer/tr_init.c | 44 +++++++++++++++++--------
SP/code/ui/ui_shared.c | 63 +++++++++++++++++++++++++++++++++++-
6 files changed, 257 insertions(+), 60 deletions(-)
diff --git a/MP/code/rend2/tr_init.c b/MP/code/rend2/tr_init.c
index 3f2c4de..6d8e14e 100644
--- a/MP/code/rend2/tr_init.c
+++ b/MP/code/rend2/tr_init.c
@@ -414,20 +414,39 @@ typedef struct vidmode_s
float pixelAspect; // pixel width / height
} vidmode_t;
+// Note: Also add these modes to ui/ui_shared.c
vidmode_t r_vidModes[] =
{
- { "Mode 0: 320x240", 320, 240, 1 },
- { "Mode 1: 400x300", 400, 300, 1 },
- { "Mode 2: 512x384", 512, 384, 1 },
- { "Mode 3: 640x480", 640, 480, 1 },
- { "Mode 4: 800x600", 800, 600, 1 },
- { "Mode 5: 960x720", 960, 720, 1 },
- { "Mode 6: 1024x768", 1024, 768, 1 },
- { "Mode 7: 1152x864", 1152, 864, 1 },
- { "Mode 8: 1280x1024", 1280, 1024, 1 },
- { "Mode 9: 1600x1200", 1600, 1200, 1 },
- { "Mode 10: 2048x1536", 2048, 1536, 1 },
- { "Mode 11: 856x480 (wide)",856, 480, 1 }
+ { "Mode 0: 320x240 (4:3)", 320, 240, 1 },
+ { "Mode 1: 400x300 (4:3)", 400, 300, 1 },
+ { "Mode 2: 512x384 (4:3)", 512, 384, 1 },
+ { "Mode 3: 640x480 (4:3)", 640, 480, 1 },
+ { "Mode 4: 800x600 (4:3)", 800, 600, 1 },
+ { "Mode 5: 960x720 (4:3)", 960, 720, 1 },
+ { "Mode 6: 1024x768 (4:3)", 1024, 768, 1 },
+ { "Mode 7: 1152x864 (4:3)", 1152, 864, 1 },
+ { "Mode 8: 1280x1024 (5:4)", 1280, 1024, 1 },
+ { "Mode 9: 1600x1200 (4:3)", 1600, 1200, 1 },
+ { "Mode 10: 2048x1536 (4:3)", 2048, 1536, 1 },
+ { "Mode 11: 856x480 (16:9)", 856, 480, 1 },
+ { "Mode 12: 640x360 (16:9)", 640, 360, 1 },
+ { "Mode 13: 640x400 (16:10)", 640, 400, 1 },
+ { "Mode 14: 800x450 (16:9)", 800, 450, 1 },
+ { "Mode 15: 800x500 (16:10)", 800, 500, 1 },
+ { "Mode 16: 1024x640 (16:10)", 1024, 640, 1 },
+ { "Mode 17: 1024x576 (16:9)", 1024, 576, 1 },
+ { "Mode 18: 1280x720 (16:9)", 1280, 720, 1 },
+ { "Mode 19: 1280x768 (16:10)", 1280, 768, 1 },
+ { "Mode 20: 1280x800 (16:10)", 1280, 800, 1 },
+ { "Mode 21: 1280x960 (4:3)", 1280, 960, 1 },
+ { "Mode 22: 1440x900 (16:10)", 1440, 900, 1 },
+ { "Mode 23: 1600x900 (16:9)", 1600, 900, 1 },
+ { "Mode 24: 1600x1000 (16:10)", 1600, 1000, 1 },
+ { "Mode 25: 1680x1050 (16:10)", 1680, 1050, 1 },
+ { "Mode 26: 1920x1080 (16:9)", 1920, 1080, 1 },
+ { "Mode 27: 1920x1200 (16:10)", 1920, 1200, 1 },
+ { "Mode 28: 1920x1440 (4:3)", 1920, 1440, 1 },
+ { "Mode 29: 2560x1600 (16:10)", 2560, 1600, 1 }
};
static int s_numVidModes = ARRAY_LEN( r_vidModes );
diff --git a/MP/code/renderer/tr_init.c b/MP/code/renderer/tr_init.c
index 537e305..06026fa 100644
--- a/MP/code/renderer/tr_init.c
+++ b/MP/code/renderer/tr_init.c
@@ -348,20 +348,39 @@ typedef struct vidmode_s
float pixelAspect; // pixel width / height
} vidmode_t;
+// Note: Also add these modes to ui/ui_shared.c
vidmode_t r_vidModes[] =
{
- { "Mode 0: 320x240", 320, 240, 1 },
- { "Mode 1: 400x300", 400, 300, 1 },
- { "Mode 2: 512x384", 512, 384, 1 },
- { "Mode 3: 640x480", 640, 480, 1 },
- { "Mode 4: 800x600", 800, 600, 1 },
- { "Mode 5: 960x720", 960, 720, 1 },
- { "Mode 6: 1024x768", 1024, 768, 1 },
- { "Mode 7: 1152x864", 1152, 864, 1 },
- { "Mode 8: 1280x1024", 1280, 1024, 1 },
- { "Mode 9: 1600x1200", 1600, 1200, 1 },
- { "Mode 10: 2048x1536", 2048, 1536, 1 },
- { "Mode 11: 856x480 (wide)",856, 480, 1 }
+ { "Mode 0: 320x240 (4:3)", 320, 240, 1 },
+ { "Mode 1: 400x300 (4:3)", 400, 300, 1 },
+ { "Mode 2: 512x384 (4:3)", 512, 384, 1 },
+ { "Mode 3: 640x480 (4:3)", 640, 480, 1 },
+ { "Mode 4: 800x600 (4:3)", 800, 600, 1 },
+ { "Mode 5: 960x720 (4:3)", 960, 720, 1 },
+ { "Mode 6: 1024x768 (4:3)", 1024, 768, 1 },
+ { "Mode 7: 1152x864 (4:3)", 1152, 864, 1 },
+ { "Mode 8: 1280x1024 (5:4)", 1280, 1024, 1 },
+ { "Mode 9: 1600x1200 (4:3)", 1600, 1200, 1 },
+ { "Mode 10: 2048x1536 (4:3)", 2048, 1536, 1 },
+ { "Mode 11: 856x480 (16:9)", 856, 480, 1 },
+ { "Mode 12: 640x360 (16:9)", 640, 360, 1 },
+ { "Mode 13: 640x400 (16:10)", 640, 400, 1 },
+ { "Mode 14: 800x450 (16:9)", 800, 450, 1 },
+ { "Mode 15: 800x500 (16:10)", 800, 500, 1 },
+ { "Mode 16: 1024x640 (16:10)", 1024, 640, 1 },
+ { "Mode 17: 1024x576 (16:9)", 1024, 576, 1 },
+ { "Mode 18: 1280x720 (16:9)", 1280, 720, 1 },
+ { "Mode 19: 1280x768 (16:10)", 1280, 768, 1 },
+ { "Mode 20: 1280x800 (16:10)", 1280, 800, 1 },
+ { "Mode 21: 1280x960 (4:3)", 1280, 960, 1 },
+ { "Mode 22: 1440x900 (16:10)", 1440, 900, 1 },
+ { "Mode 23: 1600x900 (16:9)", 1600, 900, 1 },
+ { "Mode 24: 1600x1000 (16:10)", 1600, 1000, 1 },
+ { "Mode 25: 1680x1050 (16:10)", 1680, 1050, 1 },
+ { "Mode 26: 1920x1080 (16:9)", 1920, 1080, 1 },
+ { "Mode 27: 1920x1200 (16:10)", 1920, 1200, 1 },
+ { "Mode 28: 1920x1440 (4:3)", 1920, 1440, 1 },
+ { "Mode 29: 2560x1600 (16:10)", 2560, 1600, 1 }
};
static int s_numVidModes = ARRAY_LEN( r_vidModes );
diff --git a/MP/code/ui/ui_shared.c b/MP/code/ui/ui_shared.c
index a7f4f31..4454893 100644
--- a/MP/code/ui/ui_shared.c
+++ b/MP/code/ui/ui_shared.c
@@ -5890,6 +5890,49 @@ void Item_SetupKeywordHash( void ) {
}
}
+typedef struct vidmode_s
+{
+ const char *description;
+ int mode;
+} vidmode_t;
+
+vidmode_t r_vidModes[] =
+{
+ { "320x240 (4:3)", 0 },
+ { "400x300 (4:3)", 1 },
+ { "512x384 (4:3)", 2 },
+ { "640x480 (4:3)", 3 },
+ { "800x600 (4:3)", 4 },
+ { "960x720 (4:3)", 5 },
+ { "1024x768 (4:3)", 6 },
+ { "1152x864 (4:3)", 7 },
+ { "1280x1024 (5:4)", 8 },
+ { "1600x1200 (4:3)", 9 },
+ { "2048x1536 (4:3)", 10 },
+ { "856x480 (16:9)", 11 },
+ { "640x360 (16:9)", 12 },
+ { "640x400 (16:10)", 13 },
+ { "800x450 (16:9)", 14 },
+ { "800x500 (16:10)", 15 },
+ { "1024x640 (16:10)", 16 },
+ { "1024x576 (16:9)", 17 },
+ { "1280x720 (16:9)", 18 },
+ { "1280x768 (16:10)", 19 },
+ { "1280x800 (16:10)", 20 },
+ { "1280x960 (4:3)", 21 },
+ { "1440x900 (16:10)", 22 },
+ { "1600x900 (16:9)", 23 },
+ { "1600x1000 (16:10)", 24 },
+ { "1680x1050 (16:10)", 25 },
+ { "1920x1080 (16:9)", 26 },
+ { "1920x1200 (16:10)", 27 },
+ { "1920x1440 (4:3)", 28 },
+ { "2560x1600 (16:10)", 29 },
+ { "Automatic (Native)", -2 },
+ { "Custom", -1 }
+};
+static int s_numVidModes = ARRAY_LEN( r_vidModes );
+
/*
===============
UI_ApplyItemHacks
@@ -5899,16 +5942,35 @@ Hacks to fix issues with menu scripts
*/
static void Item_ApplyHacks( itemDef_t *item ) {
- // Fix length of favorite address in createfavorite.menu
- if ( item->type == ITEM_TYPE_EDITFIELD && item->cvar && !Q_stricmp( item->cvar, "ui_favoriteAddress" ) ) {
- editFieldDef_t *editField = (editFieldDef_t *)item->typeData;
+ // Fix length of favorite address in createfavorite.menu
+ if ( item->type == ITEM_TYPE_EDITFIELD && item->cvar && !Q_stricmp( item->cvar, "ui_favoriteAddress" ) ) {
+ editFieldDef_t *editField = (editFieldDef_t *)item->typeData;
+
+ // enough to hold an IPv6 address plus null
+ if ( editField->maxChars < 48 ) {
+ Com_Printf( "Extended create favorite address edit field length to hold an IPv6 address\n" );
+ editField->maxChars = 48;
+ }
+ }
+
+ // Add video modes to system menu
+ if ( item->type == ITEM_TYPE_MULTI && item->cvar && !Q_stricmp( item->cvar, "r_mode" ) ) {
+ int i;
+ multiDef_t *multiPtr = (multiDef_t*)item->typeData;;
+
+ Com_Printf( "Found modelist with %d modes, extending list to %d modes\n", multiPtr->count, s_numVidModes );
- // enough to hold an IPv6 address plus null
- if ( editField->maxChars < 48 ) {
- Com_Printf( "Extended create favorite address edit field length to hold an IPv6 address\n" );
- editField->maxChars = 48;
- }
- }
+ multiPtr->count = 0;
+ for ( i = 0; i < s_numVidModes; i++ ) {
+ multiPtr->cvarList[multiPtr->count] = String_Alloc( r_vidModes[i].description );
+ multiPtr->cvarValue[multiPtr->count] = r_vidModes[i].mode;
+ multiPtr->count++;
+
+ if ( multiPtr->count >= MAX_MULTI_CVARS ) {
+ break;
+ }
+ }
+ }
}
/*
diff --git a/SP/code/rend2/tr_init.c b/SP/code/rend2/tr_init.c
index cd7e5bd..8ccbb09 100644
--- a/SP/code/rend2/tr_init.c
+++ b/SP/code/rend2/tr_init.c
@@ -420,21 +420,39 @@ typedef struct vidmode_s
float pixelAspect; // pixel width / height
} vidmode_t;
+// Note: Also add these modes to ui/ui_shared.c
vidmode_t r_vidModes[] =
{
- { "Mode 0: 320x240", 320, 240, 1 },
- { "Mode 1: 400x300", 400, 300, 1 },
- { "Mode 2: 512x384", 512, 384, 1 },
- { "Mode 3: 640x480", 640, 480, 1 },
- { "Mode 4: 800x600", 800, 600, 1 },
- { "Mode 5: 960x720", 960, 720, 1 },
- { "Mode 6: 1024x768", 1024, 768, 1 },
- { "Mode 7: 1152x864", 1152, 864, 1 },
- { "Mode 8: 1280x1024", 1280, 1024, 1 },
- { "Mode 9: 1600x1200", 1600, 1200, 1 },
- { "Mode 10: 2048x1536", 2048, 1536, 1 },
- { "Mode 11: 856x480 (wide)",856, 480, 1 },
- { "Mode 12: 1920x1200 (wide)",1920, 1200, 1 } //----(SA) added
+ { "Mode 0: 320x240 (4:3)", 320, 240, 1 },
+ { "Mode 1: 400x300 (4:3)", 400, 300, 1 },
+ { "Mode 2: 512x384 (4:3)", 512, 384, 1 },
+ { "Mode 3: 640x480 (4:3)", 640, 480, 1 },
+ { "Mode 4: 800x600 (4:3)", 800, 600, 1 },
+ { "Mode 5: 960x720 (4:3)", 960, 720, 1 },
+ { "Mode 6: 1024x768 (4:3)", 1024, 768, 1 },
+ { "Mode 7: 1152x864 (4:3)", 1152, 864, 1 },
+ { "Mode 8: 1280x1024 (5:4)", 1280, 1024, 1 },
+ { "Mode 9: 1600x1200 (4:3)", 1600, 1200, 1 },
+ { "Mode 10: 2048x1536 (4:3)", 2048, 1536, 1 },
+ { "Mode 11: 856x480 (16:9)", 856, 480, 1 },
+ { "Mode 12: 640x360 (16:9)", 640, 360, 1 },
+ { "Mode 13: 640x400 (16:10)", 640, 400, 1 },
+ { "Mode 14: 800x450 (16:9)", 800, 450, 1 },
+ { "Mode 15: 800x500 (16:10)", 800, 500, 1 },
+ { "Mode 16: 1024x640 (16:10)", 1024, 640, 1 },
+ { "Mode 17: 1024x576 (16:9)", 1024, 576, 1 },
+ { "Mode 18: 1280x720 (16:9)", 1280, 720, 1 },
+ { "Mode 19: 1280x768 (16:10)", 1280, 768, 1 },
+ { "Mode 20: 1280x800 (16:10)", 1280, 800, 1 },
+ { "Mode 21: 1280x960 (4:3)", 1280, 960, 1 },
+ { "Mode 22: 1440x900 (16:10)", 1440, 900, 1 },
+ { "Mode 23: 1600x900 (16:9)", 1600, 900, 1 },
+ { "Mode 24: 1600x1000 (16:10)", 1600, 1000, 1 },
+ { "Mode 25: 1680x1050 (16:10)", 1680, 1050, 1 },
+ { "Mode 26: 1920x1080 (16:9)", 1920, 1080, 1 },
+ { "Mode 27: 1920x1200 (16:10)", 1920, 1200, 1 },
+ { "Mode 28: 1920x1440 (4:3)", 1920, 1440, 1 },
+ { "Mode 29: 2560x1600 (16:10)", 2560, 1600, 1 }
};
static int s_numVidModes = ARRAY_LEN( r_vidModes );
diff --git a/SP/code/renderer/tr_init.c b/SP/code/renderer/tr_init.c
index 0ced0db..f95c259 100644
--- a/SP/code/renderer/tr_init.c
+++ b/SP/code/renderer/tr_init.c
@@ -354,21 +354,39 @@ typedef struct vidmode_s
float pixelAspect; // pixel width / height
} vidmode_t;
+// Note: Also add these modes to ui/ui_shared.c
vidmode_t r_vidModes[] =
{
- { "Mode 0: 320x240", 320, 240, 1 },
- { "Mode 1: 400x300", 400, 300, 1 },
- { "Mode 2: 512x384", 512, 384, 1 },
- { "Mode 3: 640x480", 640, 480, 1 },
- { "Mode 4: 800x600", 800, 600, 1 },
- { "Mode 5: 960x720", 960, 720, 1 },
- { "Mode 6: 1024x768", 1024, 768, 1 },
- { "Mode 7: 1152x864", 1152, 864, 1 },
- { "Mode 8: 1280x1024", 1280, 1024, 1 },
- { "Mode 9: 1600x1200", 1600, 1200, 1 },
- { "Mode 10: 2048x1536", 2048, 1536, 1 },
- { "Mode 11: 856x480 (wide)",856, 480, 1 },
- { "Mode 12: 1920x1200 (wide)",1920, 1200, 1 } //----(SA) added
+ { "Mode 0: 320x240 (4:3)", 320, 240, 1 },
+ { "Mode 1: 400x300 (4:3)", 400, 300, 1 },
+ { "Mode 2: 512x384 (4:3)", 512, 384, 1 },
+ { "Mode 3: 640x480 (4:3)", 640, 480, 1 },
+ { "Mode 4: 800x600 (4:3)", 800, 600, 1 },
+ { "Mode 5: 960x720 (4:3)", 960, 720, 1 },
+ { "Mode 6: 1024x768 (4:3)", 1024, 768, 1 },
+ { "Mode 7: 1152x864 (4:3)", 1152, 864, 1 },
+ { "Mode 8: 1280x1024 (5:4)", 1280, 1024, 1 },
+ { "Mode 9: 1600x1200 (4:3)", 1600, 1200, 1 },
+ { "Mode 10: 2048x1536 (4:3)", 2048, 1536, 1 },
+ { "Mode 11: 856x480 (16:9)", 856, 480, 1 },
+ { "Mode 12: 640x360 (16:9)", 640, 360, 1 },
+ { "Mode 13: 640x400 (16:10)", 640, 400, 1 },
+ { "Mode 14: 800x450 (16:9)", 800, 450, 1 },
+ { "Mode 15: 800x500 (16:10)", 800, 500, 1 },
+ { "Mode 16: 1024x640 (16:10)", 1024, 640, 1 },
+ { "Mode 17: 1024x576 (16:9)", 1024, 576, 1 },
+ { "Mode 18: 1280x720 (16:9)", 1280, 720, 1 },
+ { "Mode 19: 1280x768 (16:10)", 1280, 768, 1 },
+ { "Mode 20: 1280x800 (16:10)", 1280, 800, 1 },
+ { "Mode 21: 1280x960 (4:3)", 1280, 960, 1 },
+ { "Mode 22: 1440x900 (16:10)", 1440, 900, 1 },
+ { "Mode 23: 1600x900 (16:9)", 1600, 900, 1 },
+ { "Mode 24: 1600x1000 (16:10)", 1600, 1000, 1 },
+ { "Mode 25: 1680x1050 (16:10)", 1680, 1050, 1 },
+ { "Mode 26: 1920x1080 (16:9)", 1920, 1080, 1 },
+ { "Mode 27: 1920x1200 (16:10)", 1920, 1200, 1 },
+ { "Mode 28: 1920x1440 (4:3)", 1920, 1440, 1 },
+ { "Mode 29: 2560x1600 (16:10)", 2560, 1600, 1 }
};
static int s_numVidModes = ARRAY_LEN( r_vidModes );
diff --git a/SP/code/ui/ui_shared.c b/SP/code/ui/ui_shared.c
index fe4a73a..afd5278 100644
--- a/SP/code/ui/ui_shared.c
+++ b/SP/code/ui/ui_shared.c
@@ -5815,6 +5815,49 @@ void Item_SetupKeywordHash( void ) {
}
}
+typedef struct vidmode_s
+{
+ const char *description;
+ int mode;
+} vidmode_t;
+
+vidmode_t r_vidModes[] =
+{
+ { "320x240 (4:3)", 0 },
+ { "400x300 (4:3)", 1 },
+ { "512x384 (4:3)", 2 },
+ { "640x480 (4:3)", 3 },
+ { "800x600 (4:3)", 4 },
+ { "960x720 (4:3)", 5 },
+ { "1024x768 (4:3)", 6 },
+ { "1152x864 (4:3)", 7 },
+ { "1280x1024 (5:4)", 8 },
+ { "1600x1200 (4:3)", 9 },
+ { "2048x1536 (4:3)", 10 },
+ { "856x480 (16:9)", 11 },
+ { "640x360 (16:9)", 12 },
+ { "640x400 (16:10)", 13 },
+ { "800x450 (16:9)", 14 },
+ { "800x500 (16:10)", 15 },
+ { "1024x640 (16:10)", 16 },
+ { "1024x576 (16:9)", 17 },
+ { "1280x720 (16:9)", 18 },
+ { "1280x768 (16:10)", 19 },
+ { "1280x800 (16:10)", 20 },
+ { "1280x960 (4:3)", 21 },
+ { "1440x900 (16:10)", 22 },
+ { "1600x900 (16:9)", 23 },
+ { "1600x1000 (16:10)", 24 },
+ { "1680x1050 (16:10)", 25 },
+ { "1920x1080 (16:9)", 26 },
+ { "1920x1200 (16:10)", 27 },
+ { "1920x1440 (4:3)", 28 },
+ { "2560x1600 (16:10)", 29 },
+ { "Automatic (Native)", -2 },
+ { "Custom", -1 }
+};
+static int s_numVidModes = ARRAY_LEN( r_vidModes );
+
/*
===============
UI_ApplyItemHacks
@@ -5823,7 +5866,25 @@ Hacks to fix issues with menu scripts
===============
*/
static void Item_ApplyHacks( itemDef_t *item ) {
- // Stub - Not used in SP
+
+ // Add video modes to system menu
+ if ( item->type == ITEM_TYPE_MULTI && item->cvar && !Q_stricmp( item->cvar, "r_mode" ) ) {
+ int i;
+ multiDef_t *multiPtr = (multiDef_t*)item->typeData;;
+
+ Com_Printf( "Found modelist with %d modes, extending list to %d modes\n", multiPtr->count, s_numVidModes );
+
+ multiPtr->count = 0;
+ for ( i = 0; i < s_numVidModes; i++ ) {
+ multiPtr->cvarList[multiPtr->count] = String_Alloc( r_vidModes[i].description );
+ multiPtr->cvarValue[multiPtr->count] = r_vidModes[i].mode;
+ multiPtr->count++;
+
+ if ( multiPtr->count >= MAX_MULTI_CVARS ) {
+ break;
+ }
+ }
+ }
}
/*
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git
More information about the Pkg-games-commits
mailing list