forked from fte/fteqw
1
0
Fork 0

Trying to break bigfoot's code. Well, if he won't maintain it...

git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3553 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2010-07-13 21:08:37 +00:00
parent ca2564fe4f
commit 3a5149f1dd
1 changed files with 23 additions and 35 deletions

View File

@ -74,8 +74,6 @@ struct Screen *screen;
static void *pointermem; static void *pointermem;
static int real_width, real_height;
static void *TinyGL_GetSymbol(char *name) static void *TinyGL_GetSymbol(char *name)
{ {
void *ret = 0; void *ret = 0;
@ -362,48 +360,46 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
gammaworks = 1; gammaworks = 1;
} }
vid.width = info->width; vid.pixelwidth = info->width;
vid.height = info->height; vid.pixelheight = info->height;
vid.numpages = 3; vid.numpages = 3;
vid.colormap = host_colormap; vid.colormap = host_colormap;
if (vid.width <= 640) if (vid.pixelwidth <= 640)
{ {
vid.conwidth = vid.width; vid.width = vid.pixelwidth;
vid.conheight = vid.height; vid.height = vid.pixelheight;
} }
else else
{ {
vid.conwidth = vid.width/2; vid.width = vid.pixelwidth/2;
vid.conheight = vid.height/2; vid.height = vid.pixelheight/2;
} }
if ((i = COM_CheckParm("-conwidth")) && i + 1 < com_argc) if ((i = COM_CheckParm("-conwidth")) && i + 1 < com_argc)
{ {
vid.conwidth = Q_atoi(com_argv[i + 1]); vid.width = Q_atoi(com_argv[i + 1]);
// pick a conheight that matches with correct aspect // pick a conheight that matches with correct aspect
vid.conheight = vid.conwidth * 3 / 4; vid.height = vid.conwidth * 3 / 4;
} }
vid.conwidth &= 0xfff8; // make it a multiple of eight vid.width &= 0xfff8; // make it a multiple of eight
if ((i = COM_CheckParm("-conheight")) && i + 1 < com_argc) if ((i = COM_CheckParm("-conheight")) && i + 1 < com_argc)
vid.conheight = Q_atoi(com_argv[i + 1]); vid.height = Q_atoi(com_argv[i + 1]);
if (vid.conwidth < 320) if (vid.width < 320)
vid.conwidth = 320; vid.width = 320;
if (vid.conheight < 200) if (vid.height < 200)
vid.conheight = 200; vid.height = 200;
TinyGLBase = OpenLibrary("tinygl.library", 0); TinyGLBase = OpenLibrary("tinygl.library", 0);
if (TinyGLBase) if (TinyGLBase)
{ {
if (TinyGLBase->lib_Version > 50 || (TinyGLBase->lib_Version == 50 && TinyGLBase->lib_Revision >= 9)) if (TinyGLBase->lib_Version > 50 || (TinyGLBase->lib_Version == 50 && TinyGLBase->lib_Revision >= 9))
{ {
vid.aspect = ((float)vid.height / (float)vid.width) * (320.0 / 240.0);
if (info->fullscreen) if (info->fullscreen)
{ {
screen = OpenScreenTags(0, screen = OpenScreenTags(0,
@ -463,17 +459,11 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
#if 0 #if 0
lastwindowedmouse = 1; lastwindowedmouse = 1;
#endif #endif
real_width = vid.width;
real_height = vid.height;
if (vid.conheight > vid.height) if (vid.height > vid.pixelheight)
vid.conheight = vid.height; vid.height = vid.pixelheight;
if (vid.conwidth > vid.width) if (vid.width > vid.pixelwidth)
vid.conwidth = vid.width; vid.width = vid.pixelwidth;
vid.width = vid.conwidth;
vid.height = vid.conheight;
GL_Init(&TinyGL_GetSymbol); GL_Init(&TinyGL_GetSymbol);
@ -539,7 +529,7 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
return false; return false;
} }
void GLVID_DeInit() void GLVID_DeInit(void)
{ {
if (glctx) if (glctx)
{ {
@ -592,10 +582,8 @@ void GLVID_DeInit()
} }
} }
void GL_BeginRendering() void GL_BeginRendering(void)
{ {
vid.pixelwidth = real_width;
vid.pixelheight = real_height;
} }
void GL_EndRendering (void) void GL_EndRendering (void)
@ -658,11 +646,11 @@ void GLD_EndDirectRect (int x, int y, int width, int height)
{ {
} }
void GLVID_UnlockBuffer() void GLVID_UnlockBuffer(void)
{ {
} }
void GLVID_LockBuffer() void GLVID_LockBuffer(void)
{ {
} }