Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: Warzone2100/warzone2100
base: 64c2fde0dd
...
head fork: Warzone2100/warzone2100
compare: fe03012040
Checking mergeability… Don't worry, you can still create the pull request.
  • 7 commits
  • 15 files changed
  • 0 commit comments
  • 1 contributor
View
52 data/mp/addon.lev
@@ -19,15 +19,9 @@
/* ************************ */
/* GAMETYPES */
/* */
-/* CAMPAIGN 12 */
-/* CAMPAIGN RESEARCH 2 15 */
-/* */
-/* SKIRMISH 14 */
-/* SKIRMISH RESEARCH 2 18 */
-/* */
-/* reserved (dont use) */
-/* TEAMPLAY 13 */
-/* DMATCH 11 */
+/* SKIRMISH T1 14 */
+/* SKIRMISH T2 18 */
+/* SKIRMISH T3 19 */
/* ************************ */
/********************************************************/
@@ -201,46 +195,6 @@ type 14
dataset MULTI_CAM_3
game "multiplay/maps/8c-thepit.gam"
-/********************************************************/
-/********************************************************/
-/* MultiPlayer technology enablers */
-/* alex lee april 99 */
-
-/* ************************ */
-/* CAMPAIGN SETS */
-/* tech level 1 */
-/* cam 1 MULTI_CAM_1 */
-/* cam 2 MULTI_CAM_2 */
-/* cam 3 MULTI_CAM_3 */
-/* ************************ */
-/* tech level 2 */
-/* cam 1 MULTI_T2_C1 */
-/* cam 2 MULTI_T2_C2 */
-/* cam 3 MULTI_T2_C3 */
-/* ************************ */
-/* tech level 3 */
-/* cam 1 MULTI_T3_C1 */
-/* cam 2 MULTI_T3_C2 */
-/* cam 3 MULTI_T3_C3 */
-/* ************************ */
-
-/* ************************ */
-/* GAMETYPES */
-/* */
-/* CAMPAIGN 12 */
-/* CAMPAIGN RESEARCH 2 15 */
-/* CAMPAIGN RESEARCH 3 16 */
-/* */
-/* SKIRMISH 14 */
-/* SKIRMISH RESEARCH 2 18 */
-/* SKIRMISH RESEARCH 3 19 */
-
-/* */
-/* reserved (dont use) */
-/* TEAMPLAY 13 */
-/* DMATCH 11 */
-/* ************************ */
-
/* ************************ */
/* tech level 3 */
campaign MULTI_T3_C1
View
4 lib/framework/i18n.h
@@ -49,8 +49,8 @@
// Make xgettext recognize the context
#define NP_(Context, String) gettext_noop(String)
-extern WZ_DECL_CONST const char* getLanguage(void);
-extern WZ_DECL_CONST const char* getLanguageName(void);
+extern WZ_DECL_PURE const char* getLanguage(void);
+extern WZ_DECL_PURE const char* getLanguageName(void);
extern bool setLanguage(const char *name);
extern void setNextLanguage(void);
extern void initI18n(void);
View
32 lib/framework/stdio_ext.cpp
@@ -24,38 +24,6 @@
#include <string.h>
#include <assert.h>
-
-int vslcatprintf(char* str, size_t size, const char* format, va_list ap)
-{
- size_t str_len;
-
- if (str == NULL
- || size == 0)
- {
- return vsnprintf(NULL, 0, format, ap);
- }
-
- str_len = strlen(str);
-
- assert(str_len < size);
-
- return vsnprintf(&str[str_len], size - str_len, format, ap);
-}
-
-
-int slcatprintf(char* str, size_t size, const char* format, ...)
-{
- va_list ap;
- int count;
-
- va_start(ap, format);
- count = vslcatprintf(str, size, format, ap);
- va_end(ap);
-
- return count;
-}
-
-
#if defined(WZ_OS_WIN)
int vasprintf(char** strp, const char* format, va_list ap)
{
View
19 lib/framework/stdio_ext.h
@@ -25,25 +25,6 @@
#include <stdio.h>
#include <stdarg.h>
-/** A variant on snprintf which appends its output string to the given string
- * buffer, rather than to replace it.
- * \param str the string to append to
- * \param size the size of the buffer \c str expressed in bytes
- * \param format the formatting string
- * \param ap a variable arguments list of variables to use in the formatting
- * string
- * \return the amount of characters appended to the string
- */
-extern int vslcatprintf(char* str, size_t size, const char* format, va_list ap);
-
-
-/** A variant on snprintf which appends its output string to the given string
- * The function's interface is similar to vslcatprintf(), so look at that
- * function's description.
- */
-extern int slcatprintf(char* str, size_t size, const char* format, ...) WZ_DECL_FORMAT(printf, 3, 4);
-
-
#if defined(WZ_OS_WIN) || defined(DOXYGEN)
// These functions are GNU extensions; so make sure they are available on Windows also
View
10 lib/framework/string_ext.h
@@ -68,7 +68,7 @@ static inline char *strdup2(const char *s, char *fileName, int line)
* \note This is the same as strnlen(string, maxlen - 1) + 1 when using the
* GNU C library.
*/
-static inline size_t strnlen1(const char* string, size_t maxlen)
+WZ_DECL_PURE static inline size_t strnlen1(const char* string, size_t maxlen)
{
// Find the first NUL char
const char* end = (const char*)memchr(string, '\0', maxlen); // Cast required for C++
@@ -98,10 +98,12 @@ static inline size_t strnlen1(const char* string, size_t maxlen)
* \param size the buffer size (in bytes) of buffer \c dest
* \return Length to string src, if >= size truncation occured
*/
-static inline size_t strlcpy(char *dest, const char *src, size_t size)
+static inline size_t strlcpy(char * WZ_DECL_RESTRICT dest, const char * WZ_DECL_RESTRICT src, size_t size)
{
+#ifdef DEBUG
ASSERT_OR_RETURN(0, src != NULL, "strlcpy was passed an invalid src parameter.");
ASSERT_OR_RETURN(0, dest != NULL, "strlcpy was passed an invalid dest parameter.");
+#endif
if (size > 0)
{
@@ -133,12 +135,14 @@ static inline size_t strlcpy(char *dest, const char *src, size_t size)
* \param size the buffer size (in bytes) of buffer \c dest
* \return Length to string src + dest, if >= size truncation occured.
*/
-static inline size_t strlcat(char *dest, const char *src, size_t size)
+static inline size_t strlcat(char * WZ_DECL_RESTRICT dest, const char * WZ_DECL_RESTRICT src, size_t size)
{
size_t len;
+#ifdef DEBUG
ASSERT_OR_RETURN(0, src != NULL, "strlcat was passed an invalid src parameter.");
ASSERT_OR_RETURN(0, dest != NULL, "strlcat was passed an invalid dest parameter.");
+#endif
len = strlen(src);
View
4 lib/ivis_opengl/piematrix.h
@@ -39,8 +39,8 @@
* \param p1,p2,p3 Points for forming 2 vector for cross product
* \return Normal vector
*/
-static inline WZ_DECL_CONST WZ_DECL_WARN_UNUSED_RESULT
- Vector3f pie_SurfaceNormal3fv(const Vector3f p1, const Vector3f p2, const Vector3f p3)
+static inline WZ_DECL_CONST
+Vector3f pie_SurfaceNormal3fv(const Vector3f p1, const Vector3f p2, const Vector3f p3)
{
return normalise(crossProduct(p3 - p1, p2 - p1));
}
View
6 lib/ivis_opengl/piepalette.h
@@ -126,7 +126,7 @@ extern void pal_Init(void);
extern void pal_ShutDown(void);
extern PIELIGHT pal_GetTeamColour(int team);
-static inline PIELIGHT pal_Colour(UBYTE r, UBYTE g, UBYTE b)
+WZ_DECL_CONST static inline PIELIGHT pal_Colour(UBYTE r, UBYTE g, UBYTE b)
{
PIELIGHT c;
@@ -138,7 +138,7 @@ static inline PIELIGHT pal_Colour(UBYTE r, UBYTE g, UBYTE b)
return c;
}
-static inline PIELIGHT pal_SetBrightness(UBYTE brightness)
+WZ_DECL_CONST static inline PIELIGHT pal_SetBrightness(UBYTE brightness)
{
PIELIGHT c;
@@ -150,7 +150,7 @@ static inline PIELIGHT pal_SetBrightness(UBYTE brightness)
return c;
}
-static inline PIELIGHT pal_RGBA(UBYTE r, UBYTE g, UBYTE b, UBYTE a)
+WZ_DECL_CONST static inline PIELIGHT pal_RGBA(UBYTE r, UBYTE g, UBYTE b, UBYTE a)
{
PIELIGHT c;
View
3  src/action.cpp
@@ -1661,8 +1661,7 @@ void actionUpdateDroid(DROID *psDroid)
// align the turret
actionTargetTurret(psDroid, psDroid->psActionTarget[0], &psDroid->asWeaps[0]);
- // WSS shouldn't get a free pass to hit anything on map
- if (order->type != DORDER_HOLD && !cbSensorDroid(psDroid) && !asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type != SUPER_SENSOR)
+ if (order->type != DORDER_HOLD && !cbSensorDroid(psDroid))
{
// make sure the target is within sensor range
const int xdiff = (SDWORD)psDroid->pos.x - (SDWORD)psDroid->psActionTarget[0]->pos.x;
View
21 src/droid.cpp
@@ -3282,12 +3282,8 @@ bool cbSensorDroid(DROID *psDroid)
{
return false;
}
-
- /*Super Sensor works as any type*/
- if (asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type ==
- VTOL_CB_SENSOR ||
- asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type ==
- INDIRECT_CB_SENSOR)
+ if (asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type == VTOL_CB_SENSOR
+ || asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type == INDIRECT_CB_SENSOR)
{
return true;
}
@@ -3302,18 +3298,13 @@ bool standardSensorDroid(DROID *psDroid)
{
return false;
}
-
- /*Super Sensor works as any type*/
- if (asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type ==
- VTOL_INTERCEPT_SENSOR ||
- asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type ==
- STANDARD_SENSOR ||
- asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type ==
- SUPER_SENSOR)
+ if (asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type == VTOL_INTERCEPT_SENSOR
+ || asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type == STANDARD_SENSOR
+ || asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type == SUPER_SENSOR)
{
return true;
}
-
+
return false;
}
View
2  src/game.cpp
@@ -1140,7 +1140,7 @@ static bool serializeSaveGameV33Data(PHYSFS_file* fileHandle, const SAVE_GAME_V3
|| !serializeMultiplayerGame(fileHandle, &serializeGame->sGame)
|| !serializeNetPlay(fileHandle, &serializeGame->sNetPlay)
|| !PHYSFS_writeUBE32(fileHandle, serializeGame->savePlayer)
- || !PHYSFS_write(fileHandle, serializeGame->sPName, 1, 32) == 32
+ || PHYSFS_write(fileHandle, serializeGame->sPName, 1, 32) != 32
|| !PHYSFS_writeSBE32(fileHandle, serializeGame->multiPlayer))
return false;
View
5 src/levels.h
@@ -47,6 +47,11 @@ enum LEVEL_TYPE
LDS_NONE, //flags when not got a mission to go back to or when
//already on one - ****LEAVE AS LAST ONE****
LDS_MULTI_TYPE_START, ///< Start number for custom type numbers (as used by a `type` instruction)
+
+ CAMPAIGN = 12,
+ SKIRMISH = 14,
+ MULTI_SKIRMISH2 = 18,
+ MULTI_SKIRMISH3 = 19
};
struct LEVEL_DATASET
View
34 src/multimenu.cpp
@@ -198,13 +198,13 @@ static LEVEL_DATASET *enumerateMultiMaps(bool first, unsigned camToUse, unsigned
}
while(lev)
{
- if(game.type == SKIRMISH)
+ if (game.type == SKIRMISH)
{
- if(lev->type == MULTI_SKIRMISH2)
+ if (lev->type == MULTI_SKIRMISH2)
{
cam = 2;
}
- else if(lev->type == MULTI_SKIRMISH3)
+ else if (lev->type == MULTI_SKIRMISH3)
{
cam = 3;
}
@@ -212,7 +212,6 @@ static LEVEL_DATASET *enumerateMultiMaps(bool first, unsigned camToUse, unsigned
{
cam = 1;
}
-
if((lev->type == SKIRMISH || lev->type == MULTI_SKIRMISH2 || lev->type == MULTI_SKIRMISH3)
&& (numPlayers == 0 || numPlayers == lev->players)
&& cam == camToUse )
@@ -223,33 +222,6 @@ static LEVEL_DATASET *enumerateMultiMaps(bool first, unsigned camToUse, unsigned
return found;
}
}
- else // campaign
- {
-// 'service pack 1'
- if(lev->type == MULTI_CAMPAIGN2)
- {
- cam = 2;
- }
- else if(lev->type == MULTI_CAMPAIGN3)
- {
- cam = 3;
- }
- else
- {
- cam = 1;
- }
-// end of service pack
-
- if ((lev->type == CAMPAIGN || lev->type == MULTI_CAMPAIGN2 || lev->type == MULTI_CAMPAIGN3)
- && (numPlayers == 0 || numPlayers == lev->players)
- && cam == camToUse )
- {
- LEVEL_DATASET *found = lev;
-
- lev = lev->psNext;
- return found;
- }
- }
lev = lev->psNext;
}
View
8 src/multiplay.h
@@ -105,14 +105,6 @@ extern UBYTE bDisplayMultiJoiningStatus; // draw load progress?
#define ANYPLAYER 99
-#define CAMPAIGN 12
-#define SKIRMISH 14
-#define MULTI_SKIRMISH2 18
-#define MULTI_SKIRMISH3 19
-
-#define MULTI_CAMPAIGN2 15
-#define MULTI_CAMPAIGN3 16
-
#define CAMP_CLEAN 0 // campaign subtypes
#define CAMP_BASE 1
#define CAMP_WALLS 2
View
6 src/qtscript.cpp
@@ -192,6 +192,9 @@ static QScriptValue js_setTimer(QScriptContext *context, QScriptEngine *engine)
QScriptValue ms = context->argument(1);
int player = engine->globalObject().property("me").toInt32();
timerNode node(engine, funcName, player, ms.toInt32());
+ QScriptValue value = engine->globalObject().property(funcName); // check existence
+ SCRIPT_ASSERT(context, value.isValid() && value.isFunction(), "No such function: %s",
+ funcName.toUtf8().constData());
if (context->argumentCount() == 3)
{
QScriptValue obj = context->argument(2);
@@ -251,6 +254,9 @@ static QScriptValue js_queue(QScriptContext *context, QScriptEngine *engine)
{
SCRIPT_ASSERT(context, context->argument(0).isString(), "Queued functions must be quoted");
QString funcName = context->argument(0).toString();
+ QScriptValue value = engine->globalObject().property(funcName); // check existence
+ SCRIPT_ASSERT(context, value.isValid() && value.isFunction(), "No such function: %s",
+ funcName.toUtf8().constData());
int ms = 0;
if (context->argumentCount() > 1)
{
View
3  src/visibility.cpp
@@ -526,8 +526,7 @@ static void processVisibilitySelf(BASE_OBJECT *psObj)
setSeenByInstantly(psStruct->psTarget[0], psObj->player, UBYTE_MAX);
}
DROID *psDroid = castDroid(psObj);
- // WSS shouldn't get a free pass to hit anything on map
- if (psDroid != NULL && psDroid->action == DACTION_OBSERVE && cbSensorDroid(psDroid) && asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type != SUPER_SENSOR)
+ if (psDroid != NULL && psDroid->action == DACTION_OBSERVE && cbSensorDroid(psDroid))
{
// Anyone commenting this out will get a knee capping from John.
// You have been warned!!

No commit comments for this range

Something went wrong with that request. Please try again.