Hello everyone!

First off allow me to thank you for the work so far.  I especially
like the linux port! :-)

Attached are a few small patches.  All of them are against r450, which
is HEAD as of this writing.  In order of severity:

* charon-sound-id-segfault.diff

This one is not reproducible.  It happened to me only once; the people
I play with had some similiar out-of-the-blue segfaults, but they
weren't running the game in debug mode or GDB so we can't confirm.
For some reason I couldn't figure out, 'sound_Play3DTrack' got a
sample with an 'iTrack' of 2608, which is quite obviously wrong
(MAX_TRACKS is defined to be 600 at the top of the file).  So I simply
put in a safeguard that makes it silently ignore such a sample, and
did the same for 'sound_Play2DTrack' just to be sure.

It appears to work now, but the patch could definitely need some error
reporting and/or investigation of the actual source of the problem.
I have attached a backtrace along with the patch in case someone more
versed in the code wants to have a look at it.

* charon-tabs-segfault.diff

Patches a reproducible segfault.  Try this:
1) Start a skirmish game on any map, in at least T2 mode.
2) Build three VTOL factories.
3) Pop up the factory production menu. Note that the last factory you
   built is on a new page, by itself.
4) Select a truck and click on the VTOL factory to upgrade it _without
   closing the factory menu_.  Boom.

I'm not entirely sure the way I fixed it is the "right thing", but it
works (it skips back to the first page in the menu).

* charon-decl-fix.diff

mingw32-gcc chokes on the difference between SDWORD and DWORD.  (My
GCC 4.0.3 on Linux didn't, however.)

* charon-cl-help.diff

devurandom changed --viewport to --resolution, but forgot to change
the --help text.

* charon-console-rebindable.diff

This patch makes the "show me the console backlog" key rebindable.
With my swiss german keyboard setup this is required, as I can only
type the backtick as a dead key followed by space, which is ignored by
warzone.

Hope that helps.  I'm afraid(?) more will follow ;-)

Off topic, I would prefer to scale the UI as everything is a bit too
small on my 1400x1050 laptop screen.  I've browsed around for some
time, but haven't found a real "entry point" to the widget drawing
stuff where such an OpenGL call could be fit in.  Is there such a
place?  If not, how does the widget system work?

- Thomas

-- 
GPG key ID 'BB66CCFD' available from hkp://subkeys.pgp.net or:
http://n.ethz.ch/student/trast/public-key.asc


Index: src/clparse.c
===================================================================
--- src/clparse.c	(Revision 450)
+++ src/clparse.c	(Arbeitskopie)
@@ -6,6 +6,7 @@
  */
 #ifndef _MSC_VER
 #include <unistd.h>
+#include <string.h>
 #endif	// not for .net I should say..  --Qamly
 #include "lib/framework/frame.h"
 #include "lib/widget/widget.h"
@@ -83,7 +84,7 @@
 		"   --savegame NAME            Load a saved game NAME\n"
 		"   --window                   Play in windowed mode\n"
 		"   --version                  Output version info and exit\n"
-		"   --viewport WIDTHxHEIGHT    Set the dimensions of the viewport (screen or window)\n"
+		"   --resolution WIDTHxHEIGHT  Set the dimensions of the viewport (screen or window)\n"
 		"   --(no)shadows              Toggles the shadows\n"
 		"   --(no)sound                Toggles the sound\n"
 		   );
Index: src/keymap.c
===================================================================
--- src/keymap.c	(Revision 450)
+++ src/keymap.c	(Arbeitskopie)
@@ -377,7 +377,7 @@
 	keyAddMapping(KEYMAP_ASSIGNABLE,KEY_IGNORE,(KEY_CODE)KEY_MAXSCAN,KEYMAP_PRESSED,kf_JumpToSensorUnits,	strresGetString(psStringRes,STR_BIND_SENJ));
 	keyAddMapping(KEYMAP_ASSIGNABLE,KEY_IGNORE,(KEY_CODE)KEY_MAXSCAN,KEYMAP_PRESSED,kf_JumpToCommandUnits,	strresGetString(psStringRes,STR_BIND_COMJ));
 	keyAddMapping(KEYMAP_ASSIGNABLE,KEY_IGNORE,KEY_TAB,KEYMAP_PRESSED,kf_ToggleOverlays,			strresGetString(psStringRes,STR_BIND_OVERL));
-	keyAddMapping(KEYMAP_ALWAYS,KEY_IGNORE,KEY_BACKQUOTE,KEYMAP_PRESSED,kf_ToggleConsoleDrop,strresGetString(psStringRes,STR_BIND_CONSOLE));
+	keyAddMapping(KEYMAP_ASSIGNABLE,KEY_IGNORE,KEY_BACKQUOTE,KEYMAP_PRESSED,kf_ToggleConsoleDrop,strresGetString(psStringRes,STR_BIND_CONSOLE));
 	//                                **********************************
 	// IN GAME MAPPINGS - Single key presses - ALL __DEBUG keymappings will be removed for master
 	keyAddMapping(KEYMAP_ASSIGNABLE,KEY_IGNORE,KEY_B,KEYMAP_PRESSED,kf_CentreOnBase,			strresGetString(psStringRes,STR_BIND_CENTV));
Index: lib/framework/configfile.h
===================================================================
--- lib/framework/configfile.h	(Revision 450)
+++ lib/framework/configfile.h	(Arbeitskopie)
@@ -4,8 +4,8 @@
 
 extern BOOL openWarzoneKey(void);
 extern BOOL closeWarzoneKey(void);
-extern BOOL getWarzoneKeyNumeric(const char *pName, SDWORD *val);
-extern BOOL setWarzoneKeyNumeric(const char *pName, SDWORD val);
+extern BOOL getWarzoneKeyNumeric(const char *pName, DWORD *val);
+extern BOOL setWarzoneKeyNumeric(const char *pName, DWORD val);
 extern BOOL getWarzoneKeyString(const char *pName, char *pString);
 extern BOOL setWarzoneKeyString(const char *pName, const char *pString);
 
Index: lib/sound/track.c
===================================================================
--- lib/sound/track.c	(Revision 450)
+++ lib/sound/track.c	(Arbeitskopie)
@@ -499,6 +499,9 @@
 	TRACK	*psTrack;
 	//~~~~~~~~~~~~~
 
+	if (!sound_CheckTrack(psSample->iTrack))
+	  return FALSE;
+
 	psTrack = g_apTrack[psSample->iTrack];
 
 	if (psTrack == NULL) return FALSE;
@@ -538,6 +541,9 @@
 	TRACK	*psTrack;
 	//~~~~~~~~~~~~~
 
+	if (!sound_CheckTrack(psSample->iTrack))
+	  return FALSE;
+
 	psTrack = g_apTrack[psSample->iTrack];
 /*	if ( psTrack->bCompressed )
 	{
Index: lib/widget/form.c
===================================================================
--- lib/widget/form.c	(Revision 450)
+++ lib/widget/form.c	(Arbeitskopie)
@@ -677,8 +677,9 @@
 	if (major >= psForm->numMajor ||
 		minor >= psForm->asMajor[major].numMinor)
 	{
-		ASSERT( FALSE, "widgSetTabs: invalid major or minor id" );
-		return;
+       	        // ASSERT( FALSE, "widgSetTabs: invalid major or minor id" );
+                major = 0;
+		minor = 0;
 	}
 
 	psForm->majorT = major;
#0  0xffffe410 in __kernel_vsyscall ()
No symbol table info available.
#1  0xb7b1e9a1 in raise () from /lib/tls/i686/cmov/libc.so.6
No symbol table info available.
#2  0xb7b202b9 in abort () from /lib/tls/i686/cmov/libc.so.6
No symbol table info available.
#3  0xb7b17f51 in __assert_fail () from /lib/tls/i686/cmov/libc.so.6
No symbol table info available.
#4  0x08184fde in heapAlloc (psHeap=0xafe94b20, ppObject=0xbfcffeac)
    at heap.c:326
        psNew = (HEAP_EXTENSION *) 0xaa1e644c
        i = 3218079316
        psCurr = (FREE_OBJECT *) 0x0
        pBase = (UBYTE *) 0xafeb242c "[EMAIL PROTECTED]@001"
        psCurrBlk = (BLOCK_HEAP *) 0x56
        psHdr = (HEAP_OBJHDR *) 0xb2
        psFree = (FREE_OBJECT *) 0xa9d461f8
        clean = 169099280
        pStart = (UBYTE *) 0x0
        pEnd = (UBYTE *) 0x1 <Address 0x1 out of bounds>
        __FUNCTION__ = "heapAlloc"
        __PRETTY_FUNCTION__ = "heapAlloc"
#5  0x080e22c2 in createDroid (player=0, ppsNew=0xbfcffeac) at objmem.c:470
        __FUNCTION__ = "createDroid"
        __PRETTY_FUNCTION__ = "createDroid"
#6  0x0807ba07 in buildDroid (pTemplate=0xafef0244, x=11008, y=22784,
    player=0, onMission=0) at droid.c:4181
        psDroid = (DROID *) 0xafeb213c
        psGrp = (DROID_GROUP *) 0xbfcffef8
        inc = 5726712
        numKills = 5636272
        i = 11468888
        experienceLoc = 5636274
        __FUNCTION__ = "buildDroid"
        __PRETTY_FUNCTION__ = "buildDroid"
#7  0x08175425 in structPlaceDroid (psStructure=0xa9d461f8,
    psTempl=0xafef0244, ppsDroid=0xbfcfffac) at structure.c:3511
        x = 86
        y = 178
---Type <return> to continue, or q <return> to quit---
        placed = 1
        psNewDroid = (DROID *) 0x8175b08
        psFact = (FACTORY *) 0xa9d461f8
        apx = 1560
        apy = 1374389535
        psFlag = (FLAG_POSITION *) 0x258
        iVecEffect = {x = 0, y = 34, z = 300}
        factoryType = 170 ''
        assignCommander = 0
#8  0x081768fe in aiUpdateStructure (psStructure=0xa9d461f8)
    at structure.c:4457
        pSubject = (BASE_STATS *) 0xafef0244
        pointsToAdd = 40
        pPlayerRes = (PLAYER_RESEARCH *) 0xafe84778
        structureMode = 1
        psDroid = (DROID *) 0x0
        psChosenObj = (BASE_OBJECT *) 0x0
        Quantity = 0 '\0'
        iDt = 156
        psFactory = (FACTORY *) 0xa9d39b3c
        psRepairFac = (REPAIR_FACILITY *) 0x0
        psResFacility = (RESEARCH_FACILITY *) 0x1
        psReArmPad = (REARM_PAD *) 0xa9d56fa4
        iVecEffect = {x = 135775660, y = -1445556480, z = 1}
        bFinishAction = -1076887544
        psWStats = (WEAPON_STATS *) 0x817c4e1
        psTarget = (BASE_OBJECT *) 0x9c
        xdiff = -1445556480
        ydiff = 1
        mindist = 252
        currdist = 1374389535
        psNextTemplate = (DROID_TEMPLATE *) 0xa9d461b8
        __FUNCTION__ = "aiUpdateStructure"
        __PRETTY_FUNCTION__ = "aiUpdateStructure"
#9  0x081774b2 in structureUpdate (psBuilding=0xa9d461f8) at structure.c:4958
        widthScatter = 27
        breadthScatter = 0
        percentDamage = 0
        emissionInterval = 135692454
        iPointsToAdd = 2951638556
        iPointsRequired = 500
        dv = {x = 0, y = 7, z = 20}
        __FUNCTION__ = "structureUpdate"
        __PRETTY_FUNCTION__ = "structureUpdate"
#10 0x080bd76c in gameLoop () at loop.c:404
        psCurr = (DROID *) 0x0
        psNext = (DROID *) 0x0
        psCBuilding = (STRUCTURE *) 0xa9d461f8
        psNBuilding = (STRUCTURE *) 0xa9d675f8
        psCFeat = (FEATURE *) 0x3c7aa5
        psNFeat = (FEATURE *) 0x10006
        i = 0
        widgval = 0
        quitting = 0
        intRetVal = INT_INTERCEPT
        clearMode = CLEAR_FOG
        __FUNCTION__ = "gameLoop"
        __PRETTY_FUNCTION__ = "gameLoop"
#11 0x080bf77b in main (argc=1, argv=0xbfd00204) at main.c:695
        frameRet = FRAME_OK
        quit = 0
        Restart = 0
        paused = 0
        introVideoControl = 3
        dispBitDepth = 0
        loopStatus = 0
        psPaletteBuffer = (iColour *) 0x0
        pSize = 768

Attachment: pgpWut4pBHPvU.pgp
Description: PGP signature

_______________________________________________
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev

Reply via email to