Skip to content

Commit

Permalink
backport:
Browse files Browse the repository at this point in the history
r7309, "Add error messages in case the values we have read in from the config file don't match the default values."
r7311, "Use strcasecmp() not stricmp()"
r7313, "Get rid of magic numbers, and use #define instead."
r7334, "Let's not underflow a unsigned variable.
Broken in r6969"
r7336, "* Don't abort() because a string can't be found.
* Don't abort() because we cannot find a Droid template."
r7341, "Work around for drivers that report VBO, but don't have full openGL 1.5 implementation.

This is the case for the current radeon open source drivers, and possibly others.

Patch by: suokko (Pauli Nieminen)
see: http://developer.wz2100.net/ticket/216
reference ticket:216"
r7358, "Workaround for a bug in the script files that abuses the DORDER_BUILD order for demolition.

The problem is with the player*.slo file(s), but putting off a proper fix until the LUA translation is completed."
r7381, "Fix prototype to match function's definition.
(was missing a const)"
r7382, "Change non-fatal debug messages in the sound code from LOG_ERROR to LOG_WARNING instead.
fixes ticket:427"


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/branches/netplay@7392 4a71c877-e1ca-e34f-864e-861f7616d084
  • Loading branch information
buginator committed May 11, 2009
1 parent 06d3aa2 commit 3799697
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 8 deletions.
13 changes: 13 additions & 0 deletions lib/ivis_opengl/GLee.c
Original file line number Diff line number Diff line change
Expand Up @@ -11999,6 +11999,19 @@ GLuint __GLeeLink_GL_ARB_vertex_buffer_object(void)
if ((GLeeFuncPtr_glUnmapBufferARB = (GLEEPFNGLUNMAPBUFFERARBPROC) __GLeeGetProcAddress("glUnmapBufferARB"))!=0) nLinked++;
if ((GLeeFuncPtr_glGetBufferParameterivARB = (GLEEPFNGLGETBUFFERPARAMETERIVARBPROC) __GLeeGetProcAddress("glGetBufferParameterivARB"))!=0) nLinked++;
if ((GLeeFuncPtr_glGetBufferPointervARB = (GLEEPFNGLGETBUFFERPOINTERVARBPROC) __GLeeGetProcAddress("glGetBufferPointervARB"))!=0) nLinked++;

// HACK: work around for drivers that report VBO, but don't have full openGL 1.5 implementation.
GLeeFuncPtr_glBindBuffer = GLeeFuncPtr_glBindBufferARB;
GLeeFuncPtr_glDeleteBuffers = GLeeFuncPtr_glDeleteBuffersARB;
GLeeFuncPtr_glGenBuffers = GLeeFuncPtr_glGenBuffersARB;
GLeeFuncPtr_glIsBuffer = GLeeFuncPtr_glIsBufferARB;
GLeeFuncPtr_glBufferData = GLeeFuncPtr_glBufferDataARB;
GLeeFuncPtr_glBufferSubData = GLeeFuncPtr_glBufferSubDataARB;
GLeeFuncPtr_glGetBufferSubData = GLeeFuncPtr_glGetBufferSubDataARB;
GLeeFuncPtr_glMapBuffer = GLeeFuncPtr_glMapBufferARB;
GLeeFuncPtr_glUnmapBuffer = GLeeFuncPtr_glUnmapBufferARB;
GLeeFuncPtr_glGetBufferParameteriv = GLeeFuncPtr_glGetBufferParameterivARB;
GLeeFuncPtr_glGetBufferPointerv = GLeeFuncPtr_glGetBufferPointervARB;
#endif
if (nLinked==11) return GLEE_LINK_COMPLETE;
if (nLinked==0) return GLEE_LINK_FAIL;
Expand Down
2 changes: 1 addition & 1 deletion lib/ivis_opengl/piematrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ extern Sint32 pie_RotateProject(const Vector3i *src, Vector2i *dest);
extern void pie_PerspectiveBegin(void);
extern void pie_PerspectiveEnd(void);

extern void pie_TranslateTextureBegin(Vector2f offset);
extern void pie_TranslateTextureBegin(const Vector2f offset);
extern void pie_TranslateTextureEnd(void);

//*************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion lib/sound/audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ SDWORD audio_GetTrackID( const char *fileName )

if (fileName == NULL || strlen(fileName) == 0)
{
debug(LOG_ERROR, "audio_GetTrackID: fileName is %s", (fileName == NULL) ? "a NULL pointer" : "empty");
debug(LOG_WARNING, "fileName is %s", (fileName == NULL) ? "a NULL pointer" : "empty");
return SAMPLE_NOT_FOUND;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/sound/track.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ unsigned int sound_SetTrackVals(const char* fileName, BOOL loop, unsigned int vo

if (fileName == NULL || strlen(fileName) == 0) // check for empty filename. This is a non fatal error.
{
debug(LOG_ERROR, "sound_SetTrackVals: fileName is %s", (fileName == NULL) ? "a NULL pointer" : "empty");
debug(LOG_WARNING, "fileName is %s", (fileName == NULL) ? "a NULL pointer" : "empty");
return 0;
}

psTrack = resGetData( "WAV", fileName );
if (psTrack == NULL)
{
debug(LOG_ERROR, "sound_SetTrackVals: track %s resource not found", fileName);
debug(LOG_WARNING, "track %s resource not found", fileName);
return 0;
}

Expand Down
19 changes: 17 additions & 2 deletions src/configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
#define DEFAULTCDVOL 60
#define DEFAULTSCROLL 1000

#define MASTERSERVERPORT 9990
#define GAMESERVERPORT 2100

void setSinglePlayerFrameLimit (SDWORD limit);
SDWORD getSinglePlayerFrameLimit (void);
void setDefaultFrameRateLimit (void);
Expand Down Expand Up @@ -265,6 +268,10 @@ BOOL loadConfig(void)
if (getWarzoneKeyString("masterserver_name", sBuf))
{
NETsetMasterserverName(sBuf);
if (strcasecmp(sBuf, "lobby.wz2100.net") != 0)
{
debug(LOG_ERROR, "We are not using lobby.wz2100.net, for the master server name, we are using %s instead?", sBuf);
}
}
else
{
Expand Down Expand Up @@ -315,20 +322,28 @@ BOOL loadConfig(void)
if (getWarzoneKeyNumeric("masterserver_port", &val))
{
NETsetMasterserverPort(val);
if (val != MASTERSERVERPORT)
{
debug(LOG_ERROR, "We are not using port %d (which is the default Master server port), we are using %d?", MASTERSERVERPORT, val);
}
}
else
{
NETsetMasterserverPort(9990);
NETsetMasterserverPort(MASTERSERVERPORT);
setWarzoneKeyNumeric("masterserver_port", 9990);
}

if (getWarzoneKeyNumeric("gameserver_port", &val))
{
NETsetGameserverPort(val);
if (val != GAMESERVERPORT)
{
debug(LOG_ERROR, "We are not using port %d (which is the default Game server port), we are using %d?", GAMESERVERPORT, val);
}
}
else
{
NETsetGameserverPort(2100);
NETsetGameserverPort(GAMESERVERPORT);
setWarzoneKeyNumeric("gameserver_port", 2100);
}

Expand Down
1 change: 0 additions & 1 deletion src/game.c
Original file line number Diff line number Diff line change
Expand Up @@ -5089,7 +5089,6 @@ DROID_TEMPLATE *FindDroidTemplate(const char * const name)
if (!nameStr)
{
debug( LOG_ERROR, "Cannot find resource for template - %s", name );
abort();
return NULL;
}

Expand Down
9 changes: 9 additions & 0 deletions src/scriptai.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,15 @@ BOOL scrOrderDroidStatsLoc(void)
// limit has been reached.
if (!IsPlayerStructureLimitReached(psDroid->player))
{
// HACK: FIXME: Looks like a script error in the player*.slo files
// buildOnExactLocation() which references previously destroyed buildings from
// _stat = rebuildStructStat[_count] causes this.
if (strcmp(psStats->pName, "A0ADemolishStructure") == 0)
{
// I don't feel like spamming a ASSERT here, we *know* it is a issue.
return true;
}

orderDroidStatsLoc(psDroid, order, psStats, (UDWORD)x,(UDWORD)y);
}

Expand Down
1 change: 0 additions & 1 deletion src/stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -2623,7 +2623,6 @@ const char* getName(const char *pNameID)
if (!name)
{
debug( LOG_ERROR, "Unable to find string resource for %s", pNameID );
abort();
return "Name Unknown";
}

Expand Down

0 comments on commit 3799697

Please sign in to comment.