I know OpenGL mode is unsupported but...

Status
Not open for further replies.

epat

Member
I'm running linux and using my own copiled copy of srb2 (which strangely enough won't work if not compiled in debug mode but never mind that). I just thought that it'd be fun to fiddle with the source code and fix any opengl bugs to sort of get used to C coding (I mainly do python stuff only at the moment) but there's a problem... I can run in opengl mode and at first it appears to be pretty stable actually except that after 30 seconds (round about then but always exactly the same period of time) whether I play the game or just twiddle settings or even if I just watch the intro text - srb2 crashes - always differently but usually a segfault accompanied by memory corruption which has the effect of totally obliterating any output to the terminal I ran it from and if repeated a few times, crashes X and also corrupts the nvidia (yes, I'm running on a geforce 7 chipset!) kernel module load count. This could just be a graphics driver issue but in the absence of similar crashes when running other programs it would appear to be some faulty code in srb2. I was just wondering, since this looks like a pretty horrific problem to solve, whether anybody else has already succeeded in solving it or if the source of the problem is known about already since I would really like to be able to run in opengl mode which gives a performance increase of about 50x on my system or maybe even more. So, if anybody has any information, could you pass it my way? (pretty please...)

Thanks!
-epat. :)
 
Akuma TH said:
My brain hurts.Can not compute!Can not compute.DaADSQQW!11-*blows up*

Well, Akuma I'm going to tell you myself...
I was speaking with a moderator and asked if that post would be spam and he said yes.
I can't give you a "warning" so consider this "Friendly Advice". Posts like that are spam, which is against the rules.
Rules said:
3. No spam. Create topics about the ruler of pie and your website somewhere else. Do not post useless lines, such as "ok", "lol", etc., as they clutter up the forum and don't add anything to the discussion. Placing links to your website in your signature IS acceptable, however.

As for the topic, I think you may want to contact Alam.
He may have what you're looking for.
 
Code:
svn co svn://lawarias.game-server.cc ~/srb2mods
Code:
cd ~/srb2mods/SRB2109/src
Code:
make LINUX=1 GCC41=1 DEBUGMODE=1 ERRORMODE=1
GCC41=1 for GCC version 4.1 compiler
DEBUGMODE=1 for debug info
ERRORMODE=1 yell an error for every warning

svn://lawarias.game-server.cc is a Subversion URL to Public SRB2MODS, a pubic repository of the SRB2 code and mods based on SRB2

http://lawarias.game-server.cc:81/trac/ TRAC URL of Public SRB2MODS

opps, well, I am the interface guy, making sure DOS/Allegro3, Linux/SDL, Win32/SDL and Win32/DirectX interface code works... aaahh... I have to go...
 
Thanks!! Tried what you said - Works perfectly now! :D Well - except for a few graphics glitches - but it doesn't crash! - Just out of interest, what was the original problem actually caused by??

Oh and btw - I rewrote the quicksort function in hw_main.c for fun while I was trying to find a fix myself:
Code:
static void HWR_QuickSortPlane(int start, int finish)
{
	int left = start;
	int right = finish;
	int starterval = (int)((right+left)/2); //pick a starter
	
	planeinfo_t temp;
	
	//'sort of sort' the two halves of the data list about starterval
	while (right > left);
	{
		while (DIST_PLANE(left) < DIST_PLANE(starterval)) left++; //attempt to find a bigger value on the left
		while (DIST_PLANE(right) > DIST_PLANE(starterval)) right--; //attempt to find a smaller value on the right
		
		if (left < right) //if we haven't gone too far
		{
			//switch them
			memcpy(&temp, &planeinfo[left], sizeof (planeinfo_t));
			memcpy(&planeinfo[left], &planeinfo[right], sizeof (planeinfo_t));
			memcpy(&planeinfo[right], &temp, sizeof (planeinfo_t));
			//move the bounds
			left++;
			right--;
		}
	}
	
	if (start < right) HWR_QuickSortPlane(start, right);
	if (left < finish) HWR_QuickSortPlane(left, finish);
}

Put it at line 4000 and invoke it with:
Code:
HWR_QuickSortPlane(0, numplanes);

Dunno whether that's useful in any way since it's not exactly rocket science but to save anybody else having to recode it later... ;)

-epat. :D
 
I was just wondering...

What exactly does GCC41=1 do? I noticed it compiles without that definition in it in my copy of GCC 4.1

And thanks for the OpenGL tips. It looks better than the software rendering. :)
 
WhiteRose said:
What exactly does GCC41=1 do? I noticed it compiles without that definition in it in my copy of GCC 4.1

v2.9.5 GCC295=1
v2.9.7 GCC29=1
v3.x.x
v4.0.x GCC40=1
v4.1.x GCC41=1

in makefile.cfg, there alot of warnings flags
note that GCC295 also define GCC29
now in makefile
Code:
ifndef NONX86
ifndef GCC29
	M5=-march=pentium
	M4=-march=i486
else
	M5=-mpentium
	M4=-m486
endif
endif
before GCC 3.0, we use "-march=" but in GCC 3.0+ it was changed to -m
M4 for DOS, M5 for other x86 system interfaces

WARNINGMODE=1 the extra warning flags set was done by me so I can make sure the code acts fine
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top