Forum

Compiling Glquake on windows7

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Postby leileilol » Tue Mar 30, 2010 11:00 pm

Is it the old 'bragabouthowhardcoreourcardisbyspammingthestringsfullofsupportedglextensions' bug?
i should not be here
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby Charlieguitar » Tue Mar 30, 2010 11:11 pm

yep that one doesnt work either.

MSVC points to this line in dbghook.c ??

_debugger_hook_dummy = 0;

Not sure whats going on as thats obviously not part of the engine.
Charlieguitar
 
Posts: 20
Joined: Mon Mar 29, 2010 8:45 pm

Postby mh » Tue Mar 30, 2010 11:45 pm

leileilol wrote:Is it the old 'bragabouthowhardcoreourcardisbyspammingthestringsfullofsupportedglextensions' bug?

:idea: :idea: :idea:

Open gl_vidnt.c, look for this line in GL_Init (line number 609 or thereabouts):
Code: Select all
   Con_Printf ("GL_EXTENSIONS: %s\n", gl_extensions);

And comment it out. :D
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby Charlieguitar » Tue Mar 30, 2010 11:51 pm

haha wow, thankyou mh and leileilol that lets it run now!!!
Awesome!

im having some weird graphical glitches(all textures are white) but atleast the engine runs now so i can move on to the next problem haha
Thanks guys
Charlieguitar
 
Posts: 20
Joined: Mon Mar 29, 2010 8:45 pm

Postby Charlieguitar » Tue Mar 30, 2010 11:53 pm

and ive now fixed that with the -no8bit command
yay :D
time to get to the fun parts!
Charlieguitar
 
Posts: 20
Joined: Mon Mar 29, 2010 8:45 pm

Postby mh » Wed Mar 31, 2010 11:42 am

Good news. :D

A few suggestions for what to do next. There are some serious bugs in GLQuake that need fixing before you start having fun. Two major ones are in GL_LoadTexture (in gl_draw.c) and in Sbar_DrawFace (in sbar.c).

For the GL_LoadTexture bug, look for this block:
Code: Select all
   else {
      glt = &gltextures[numgltextures];
      numgltextures++;
   }
And change it to this (i.e. remove the else condition):
Code: Select all
   glt = &gltextures[numgltextures];
   numgltextures++;

For the Sbar_DrawFace bug, look for this:
Code: Select all
   if (cl.stats[STAT_HEALTH] >= 100)
      f = 4;
   else
      f = cl.stats[STAT_HEALTH] / 20;
And change it to this:
Code: Select all
   if (cl.stats[STAT_HEALTH] >= 100)
      f = 4;
   else if (cl.stats[STAT_HEALTH] <= 0)
      f = 0;
   else
      f = cl.stats[STAT_HEALTH] / 20;

Here we're just adding a < 0 condition so that the engine won't crash if health goes less than -19.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby Charlieguitar » Wed Mar 31, 2010 4:41 pm

oh awesome, added those little snippets! Thanks for all the information and help, really apreciate it guys :D

I'll no doubt be back for more help in the future :)
Charlieguitar
 
Posts: 20
Joined: Mon Mar 29, 2010 8:45 pm

Postby Tomaz » Sun Apr 04, 2010 4:11 pm

mh wrote:
leileilol wrote:Is it the old 'bragabouthowhardcoreourcardisbyspammingthestringsfullofsupportedglextensions' bug?

:idea: :idea: :idea:

Open gl_vidnt.c, look for this line in GL_Init (line number 609 or thereabouts):
Code: Select all
   Con_Printf ("GL_EXTENSIONS: %s\n", gl_extensions);

And comment it out. :D


Another way to fix it is to go to Con_Printf ( console.c around line 370ish )

change:

#define MAXPRINTMSG 4096

to:

#define MAXPRINTMSG 1024 * 16

and also change the call to:

vsprintf (msg,fmt,argptr);

to say:

vsnprintf (msg,sizeof(msg),fmt,argptr);

The new vsnprintf fixes the crash itself ( I have replaced all calls to vsprintf and sprintf in my entire code to use vsnprintf and snprintf )

The reason it fixes it is because it limits the amount of text that can be put in the string. The change on the define is so it will actually be able to display all the extensions and not just cut off halfway through.

Just my $0.02

mh wrote:
For the Sbar_DrawFace bug, look for this:
Code: Select all
   if (cl.stats[STAT_HEALTH] >= 100)
      f = 4;
   else
      f = cl.stats[STAT_HEALTH] / 20;
And change it to this:
Code: Select all
   if (cl.stats[STAT_HEALTH] >= 100)
      f = 4;
   else if (cl.stats[STAT_HEALTH] <= 0)
      f = 0;
   else
      f = cl.stats[STAT_HEALTH] / 20;

Here we're just adding a < 0 condition so that the engine won't crash if health goes less than -19.


Sweet! I had not caught that one, adding it to CleanQuakeCpp !
Tomaz
 
Posts: 67
Joined: Fri Nov 05, 2004 8:21 pm

Postby mh » Sun Apr 04, 2010 5:10 pm

Tomaz wrote:Another way to fix it is to go to Con_Printf ( console.c around line 370ish )

change:

#define MAXPRINTMSG 4096

to:

#define MAXPRINTMSG 1024 * 16

and also change the call to:

vsprintf (msg,fmt,argptr);

to say:

vsnprintf (msg,sizeof(msg),fmt,argptr);

Yup, that's probably a better way of doing it. :D
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby revelator » Mon Apr 05, 2010 6:06 am

chugging in with some extra info

if using msvc 8 on windows 7 you might get errors while linking

took me a bit of digging to find out you need this -> Microsoft Windows SDK v7.0

when installed you need to register this sdk with msvc theres a shortcut for this function in the shortcut folder.
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Postby Charlieguitar » Wed Apr 07, 2010 4:14 pm

Thanks reckless, i for sure have been having some linker errors. 50% of the time linker.exe actually crashes and i have to hit compile a second time to make it work. very strange, hopefully the SDK will sort that out :))
cheers!
And thanks again to all, the help ive gotten here has really fired me up :D

Are there many other tutorial sites for quake1 engine programming? I've tried out a few of the old ones such as phoenix's interpolation and a few others, sadly due to my inexperience i have some trouble even making theses tutorials work in my code. Any helpfull links and things would be great!
Charlieguitar
 
Posts: 20
Joined: Mon Mar 29, 2010 8:45 pm

Postby mh » Wed Apr 07, 2010 6:00 pm

The old QuakeSrc.org tutorials are here: http://www.quake-1.com/docs/quakesrc.org/

Some of them are slightly ropey (watch out for the ones I wrote!), but a lot of people started out here. The Hexen II ones should also be mostly usable, and even some of the Quake II ones, although you may have to massage the code a little to get things working right (but that's half the fun!)

It's also worthwhile to download the Hexen II and Quake II code as a lot of it is actually usable in Quake.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby revelator » Thu Apr 08, 2010 6:34 am

aye for some reason the old manifest tool with windows sdk 6 and 6.1
crashes the linker on win7 exact same error i was getting sdk 7.0 fixes it mostly allthough i had a few occasions where it still does it but far less frequent (seems to be permission related).

atleast there next version will have side by side configuration removed and about time that function alone has caused me more headaches than anything :lol:
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Postby Charlieguitar » Sat Apr 10, 2010 6:41 pm

fairly consistent problem im having right now is that the weapon models are randomly dissapearing in game. I've not edited any of that code so im not sure whats going on. Is this a known bug? Any suggestions where i start looking to correct it? this machine has a nvidia 8800. I've recompiled quake with the latest dxsdk etc.. Also this problem doesnt happen with fquake or dark places.
Charlieguitar
 
Posts: 20
Joined: Mon Mar 29, 2010 8:45 pm

Postby revelator » Sat Apr 10, 2010 10:02 pm

might be the ol ztrick hack some newer cards REALLY dont like this one.

[code
void R_Clear (void)
{
if (r_mirroralpha->value != 1.0)
{
if (gl_clear->value)
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
else
glClear (GL_DEPTH_BUFFER_BIT);
gldepthmin = 0;
gldepthmax = 0.5;
glDepthFunc (GL_LEQUAL);
}
else if (gl_ztrick->value) // ztrick hack
{
static int trickframe;

if (gl_clear->value)
glClear (GL_COLOR_BUFFER_BIT);

trickframe++;
if (trickframe & 1)
{
gldepthmin = 0;
gldepthmax = 0.49999;
glDepthFunc (GL_LEQUAL);
}
else
{
gldepthmin = 1;
gldepthmax = 0.5;
glDepthFunc (GL_GEQUAL);
}
}
else
{
if (gl_clear->value)
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
else
glClear (GL_DEPTH_BUFFER_BIT);
gldepthmin = 0;
gldepthmax = 1;
glDepthFunc (GL_LEQUAL);
}

glDepthRange (gldepthmin, gldepthmax);
}
[/code]

try setting gl_ztrick to 0 in game and reload the lvl if this fixes it remove this part

[code
else if (gl_ztrick->value) // ztrick hack
{
static int trickframe;

if (gl_clear->value)
glClear (GL_COLOR_BUFFER_BIT);

trickframe++;
if (trickframe & 1)
{
gldepthmin = 0;
gldepthmax = 0.49999;
glDepthFunc (GL_LEQUAL);
}
else
{
gldepthmin = 1;
gldepthmax = 0.5;
glDepthFunc (GL_GEQUAL);
}
}
[/code]
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

PreviousNext

Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest