Commit 0cfd223e authored by Rinnegatamante's avatar Rinnegatamante
Browse files

Added lower resolutions support.

parent 5294a6b7
......@@ -81,12 +81,45 @@ float *gVertexBuffer;
float *gColorBuffer;
float *gTexCoordBuffer;
uint8_t inited = 0;
typedef struct vidmode_s
{
const char *description;
int width, height;
float pixelAspect; // pixel width / height
} vidmode_t;
extern vidmode_t r_vidModes[];
uint32_t cur_width;
void GLimp_Init( qboolean coreContext)
{
if (r_mode->integer < 0) r_mode->integer = 3;
glConfig.vidWidth = r_vidModes[r_mode->integer].width;
glConfig.vidHeight = r_vidModes[r_mode->integer].height;
glConfig.colorBits = 32;
glConfig.depthBits = 32;
glConfig.stencilBits = 8;
glConfig.displayFrequency = 60;
glConfig.stereoEnabled = qfalse;
glConfig.driverType = GLDRV_ICD;
glConfig.hardwareType = GLHW_GENERIC;
glConfig.deviceSupportsGamma = qfalse;
glConfig.textureCompression = TC_NONE;
glConfig.textureEnvAddAvailable = qfalse;
glConfig.windowAspect = ((float)r_vidModes[r_mode->integer].width) / ((float)r_vidModes[r_mode->integer].height);
glConfig.isFullscreen = qtrue;
if (!inited){
vglInit(0x800000);
vglInitExtended(0x800000, glConfig.vidWidth, glConfig.vidHeight);
vglUseVram(GL_TRUE);
inited = 1;
cur_width = glConfig.vidWidth;
}else if (glConfig.vidWidth != cur_width){ // Changed resolution in game, restarting the game
sceAppMgrLoadExec("app0:/eboot.bin", NULL, NULL);
}
vglStartRendering();
int i;
......@@ -100,22 +133,6 @@ void GLimp_Init( qboolean coreContext)
gColorBuffer = (float*)malloc(sizeof(float)*VERTEXARRAYSIZE);
gTexCoordBuffer = (float*)malloc(sizeof(float)*VERTEXARRAYSIZE);
glConfig.vidWidth = 960;
glConfig.vidHeight = 544;
glConfig.colorBits = 32;
glConfig.depthBits = 32;
glConfig.stencilBits = 8;
glConfig.displayFrequency = 60;
glConfig.stereoEnabled = qfalse;
glConfig.driverType = GLDRV_ICD;
glConfig.hardwareType = GLHW_GENERIC;
glConfig.deviceSupportsGamma = qfalse;
glConfig.textureCompression = TC_NONE;
glConfig.textureEnvAddAvailable = qfalse;
glConfig.windowAspect = 960.0f / 544.0f;
glConfig.isFullscreen = qtrue;
strncpy(glConfig.vendor_string, glGetString(GL_VENDOR), sizeof(glConfig.vendor_string));
strncpy(glConfig.renderer_string, glGetString(GL_RENDERER), sizeof(glConfig.renderer_string));
strncpy(glConfig.version_string, glGetString(GL_VERSION), sizeof(glConfig.version_string));
......
......@@ -194,10 +194,6 @@ void Sys_Init(void) {
Cmd_AddCommand("in_restart", Sys_In_Restart_f);
Cvar_Set("arch", OS_STRING " " ARCH_STRING);
Cvar_Set("username", Sys_GetCurrentUser());
Cvar_Set("r_mode", "3");
Cvar_Set("r_customheight", "544");
Cvar_Set("r_customwidth", "960");
}
/*
......
......@@ -271,18 +271,18 @@ typedef struct vidmode_s
vidmode_t r_vidModes[] =
{
{ "Mode 0: 320x240", 320, 240, 1 },
{ "Mode 1: 400x300", 400, 300, 1 },
{ "Mode 2: 512x384", 512, 384, 1 },
{ "Mode 0: 480x272", 480, 272, 1 },
{ "Mode 1: 640x368", 640, 368, 1 },
{ "Mode 2: 720x408", 720, 408, 1 },
{ "Mode 3: 960x544", 960, 544, 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 4: 960x544", 960, 544, 1 },
{ "Mode 5: 960x544", 960, 544, 1 },
{ "Mode 6: 960x544", 960, 544, 1 },
{ "Mode 7: 960x544", 960, 544, 1 },
{ "Mode 8: 960x544", 960, 544, 1 },
{ "Mode 9: 960x544", 960, 544, 1 },
{ "Mode 10: 960x544", 960, 544, 1 },
{ "Mode 11: 960x544", 960, 544, 1 }
};
static int s_numVidModes = ARRAY_LEN( r_vidModes );
......
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