Merged New Inventory Project into main branch

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1871 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
lalien
2008-03-08 15:15:25 +00:00
parent e16d166277
commit 43ca24dda8
649 changed files with 93359 additions and 82507 deletions
+73 -108
View File
@@ -2,49 +2,14 @@
#include "Tactical All.h"
#else
#include "sgp.h"
#include "overhead types.h"
#include "Sound Control.h"
#include "Soldier Control.h"
#include "weapons.h"
#include "overhead.h"
#include "Event Pump.h"
#include "weapons.h"
#include "Animation Control.h"
#include "sys globals.h"
#include "Handle UI.h"
#include "Isometric Utils.h"
#include "worldman.h"
#include "math.h"
#include "points.h"
#include "ai.h"
#include "los.h"
#include "renderworld.h"
#include "opplist.h"
#include "interface.h"
#include "message.h"
#include "campaign.h"
#include "items.h"
#include "weapons.h"
#include "text.h"
#include "Soldier Profile.h"
#include "tile animation.h"
#include "Dialogue Control.h"
#include "SkillCheck.h"
#include "explosion control.h"
#include "Quests.h"
#include "Physics.h"
#include "Random.h"
#include "Vehicles.h"
#include "bullets.h"
#include "morale.h"
#include "meanwhile.h"
#include "SkillCheck.h"
#include "gamesettings.h"
#include "SaveLoadMap.h"
#include "Debug Control.h"
#include "expat.h"
#include "XML.h"
#endif
struct
{
PARSE_STAGE curElement;
@@ -53,13 +18,13 @@ struct
AMMOTYPE curAmmoType;
AMMOTYPE * curArray;
UINT32 maxArraySize;
UINT32 currentDepth;
UINT32 maxReadDepth;
}
typedef ammotypeParseData;
static void XMLCALL
static void XMLCALL
ammotypeStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
{
ammotypeParseData * pData = (ammotypeParseData *)userData;
@@ -130,11 +95,11 @@ ammotypeCharacterDataHandle(void *userData, const XML_Char *str, int len)
{
ammotypeParseData * pData = (ammotypeParseData *)userData;
if( (pData->currentDepth <= pData->maxReadDepth) &&
if( (pData->currentDepth <= pData->maxReadDepth) &&
(strlen(pData->szCharData) < MAX_CHAR_DATA_LENGTH)
){
){
strncat(pData->szCharData,str,__min((unsigned int)len,MAX_CHAR_DATA_LENGTH-strlen(pData->szCharData)));
}
}
}
@@ -161,147 +126,147 @@ ammotypeEndElementHandle(void *userData, const XML_Char *name)
else if(strcmp(name, "uiIndex") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.uiIndex = (UINT32) atol(pData->szCharData);
pData->curAmmoType.uiIndex = (UINT32) atol(pData->szCharData);
}
else if(strcmp(name, "fontColour") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.fontColour = (UINT8) atol(pData->szCharData);
pData->curAmmoType.fontColour = (UINT8) atol(pData->szCharData);
}
else if(strcmp(name, "grayed") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.grayed = (INT32) atol(pData->szCharData);
pData->curAmmoType.grayed = (INT32) atol(pData->szCharData);
}
else if(strcmp(name, "offNormal") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.offNormal = (INT32) atol(pData->szCharData);
pData->curAmmoType.offNormal = (INT32) atol(pData->szCharData);
}
else if(strcmp(name, "onNormal") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.onNormal = (INT32) atol(pData->szCharData);
pData->curAmmoType.onNormal = (INT32) atol(pData->szCharData);
}
else if(strcmp(name, "structureImpactReductionMultiplier") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.structureImpactReductionMultiplier = (INT32) atol(pData->szCharData);
pData->curAmmoType.structureImpactReductionMultiplier = (INT32) atol(pData->szCharData);
}
else if(strcmp(name, "armourImpactReductionMultiplier") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.armourImpactReductionMultiplier = (INT32) atol(pData->szCharData);
pData->curAmmoType.armourImpactReductionMultiplier = (INT32) atol(pData->szCharData);
}
else if(strcmp(name, "afterArmourDamageMultiplier") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.afterArmourDamageMultiplier = (INT32) atol(pData->szCharData);
pData->curAmmoType.afterArmourDamageMultiplier = (INT32) atol(pData->szCharData);
}
else if(strcmp(name, "beforeArmourDamageMultiplier") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.beforeArmourDamageMultiplier = (INT32) atol(pData->szCharData);
pData->curAmmoType.beforeArmourDamageMultiplier = (INT32) atol(pData->szCharData);
}
else if(strcmp(name, "multipleBulletDamageMultiplier") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.multipleBulletDamageMultiplier = (INT32) atol(pData->szCharData);
pData->curAmmoType.multipleBulletDamageMultiplier = (INT32) atol(pData->szCharData);
}
else if(strcmp(name, "structureImpactReductionDivisor") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.structureImpactReductionDivisor = (INT32) atol(pData->szCharData);
pData->curAmmoType.structureImpactReductionDivisor = (INT32) atol(pData->szCharData);
}
else if(strcmp(name, "armourImpactReductionDivisor") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.armourImpactReductionDivisor = (INT32) atol(pData->szCharData);
pData->curAmmoType.armourImpactReductionDivisor = (INT32) atol(pData->szCharData);
}
else if(strcmp(name, "afterArmourDamageDivisor") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.afterArmourDamageDivisor = (INT32) atol(pData->szCharData);
pData->curAmmoType.afterArmourDamageDivisor = (INT32) atol(pData->szCharData);
}
else if(strcmp(name, "beforeArmourDamageDivisor") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.beforeArmourDamageDivisor = (INT32) atol(pData->szCharData);
pData->curAmmoType.beforeArmourDamageDivisor = (INT32) atol(pData->szCharData);
}
else if(strcmp(name, "multipleBulletDamageDivisor") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.multipleBulletDamageDivisor = (INT32) atol(pData->szCharData);
pData->curAmmoType.multipleBulletDamageDivisor = (INT32) atol(pData->szCharData);
}
else if(strcmp(name, "lockBustingPower") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.lockBustingPower = (INT16) atol(pData->szCharData);
pData->curAmmoType.lockBustingPower = (INT16) atol(pData->szCharData);
}
else if(strcmp(name, "zeroMinimumDamage") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.zeroMinimumDamage = (BOOLEAN) atol(pData->szCharData);
pData->curAmmoType.zeroMinimumDamage = (BOOLEAN) atol(pData->szCharData);
}
else if(strcmp(name, "canGoThrough") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.canGoThrough = (BOOLEAN) atol(pData->szCharData);
pData->curAmmoType.canGoThrough = (BOOLEAN) atol(pData->szCharData);
}
else if(strcmp(name, "standardIssue") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.standardIssue = (BOOLEAN) atol(pData->szCharData);
pData->curAmmoType.standardIssue = (BOOLEAN) atol(pData->szCharData);
}
else if(strcmp(name, "numberOfBullets") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.numberOfBullets = (UINT8) atol(pData->szCharData);
pData->curAmmoType.numberOfBullets = (UINT8) atol(pData->szCharData);
}
else if(strcmp(name, "highExplosive") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.highExplosive = (BOOLEAN) atol(pData->szCharData);
pData->curAmmoType.highExplosive = (BOOLEAN) atol(pData->szCharData);
}
else if(strcmp(name, "explosionSize") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.explosionSize = (UINT8) atol(pData->szCharData);
pData->curAmmoType.explosionSize = (UINT8) atol(pData->szCharData);
}
else if(strcmp(name, "antiTank") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.antiTank = (BOOLEAN) atol(pData->szCharData);
pData->curAmmoType.antiTank = (BOOLEAN) atol(pData->szCharData);
}
else if(strcmp(name, "dart") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.dart = (BOOLEAN) atol(pData->szCharData);
pData->curAmmoType.dart = (BOOLEAN) atol(pData->szCharData);
}
else if(strcmp(name, "knife") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.knife = (BOOLEAN) atol(pData->szCharData);
pData->curAmmoType.knife = (BOOLEAN) atol(pData->szCharData);
}
else if(strcmp(name, "monsterSpit") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.monsterSpit = (BOOLEAN) atol(pData->szCharData);
pData->curAmmoType.monsterSpit = (BOOLEAN) atol(pData->szCharData);
}
else if(strcmp(name, "ignoreArmour") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.ignoreArmour = (BOOLEAN) atol(pData->szCharData);
pData->curAmmoType.ignoreArmour = (BOOLEAN) atol(pData->szCharData);
}
else if(strcmp(name, "acidic") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.acidic = (BOOLEAN) atol(pData->szCharData);
pData->curAmmoType.acidic = (BOOLEAN) atol(pData->szCharData);
}
else if(strcmp(name, "tracerEffect") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.tracerEffect = (BOOLEAN) atol(pData->szCharData);
pData->curAmmoType.tracerEffect = (BOOLEAN) atol(pData->szCharData);
}
pData->maxReadDepth--;
@@ -320,7 +285,7 @@ BOOLEAN ReadInAmmoTypeStats(STR fileName)
UINT32 uiFSize;
CHAR8 * lpcBuffer;
XML_Parser parser = XML_ParserCreate(NULL);
ammotypeParseData pData;
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading AmmoTypes.xml" );
@@ -329,7 +294,7 @@ BOOLEAN ReadInAmmoTypeStats(STR fileName)
hFile = FileOpen( fileName, FILE_ACCESS_READ, FALSE );
if ( !hFile )
return( FALSE );
uiFSize = FileGetSize(hFile);
lpcBuffer = (CHAR8 *) MemAlloc(uiFSize+1);
@@ -344,19 +309,19 @@ BOOLEAN ReadInAmmoTypeStats(STR fileName)
FileClose( hFile );
XML_SetElementHandler(parser, ammotypeStartElementHandle, ammotypeEndElementHandle);
XML_SetCharacterDataHandler(parser, ammotypeCharacterDataHandle);
memset(&pData,0,sizeof(pData));
pData.curArray = AmmoTypes;
pData.maxArraySize = MAXITEMS;
pData.maxArraySize = MAXITEMS;
XML_SetUserData(parser, &pData);
if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))
if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))
{
CHAR8 errorBuf[511];
@@ -385,7 +350,7 @@ BOOLEAN WriteAmmoTypeStats()
hFile = FileOpen( "TABLEDATA\\AmmoType out.xml", FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE );
if ( !hFile )
return( FALSE );
{
UINT32 cnt;
@@ -396,34 +361,34 @@ BOOLEAN WriteAmmoTypeStats()
FilePrintf(hFile,"\t<AMMOTYPE>\r\n");
FilePrintf(hFile,"\t\t<uiIndex>%d</uiIndex>\r\n", cnt );
FilePrintf(hFile,"\t\t<fontColour>%d</fontColour>\r\n", AmmoTypes[cnt].fontColour );
FilePrintf(hFile,"\t\t<grayed>%d</grayed>\r\n", AmmoTypes[cnt].grayed );
FilePrintf(hFile,"\t\t<offNormal>%d</offNormal>\r\n", AmmoTypes[cnt].offNormal );
FilePrintf(hFile,"\t\t<onNormal>%d</onNormal>\r\n", AmmoTypes[cnt].onNormal );
FilePrintf(hFile,"\t\t<structureImpactReductionMultiplier>%d</structureImpactReductionMultiplier>\r\n", AmmoTypes[cnt].structureImpactReductionMultiplier );
FilePrintf(hFile,"\t\t<structureImpactReductionDivisor>%d</structureImpactReductionDivisor>\r\n", AmmoTypes[cnt].structureImpactReductionDivisor );
FilePrintf(hFile,"\t\t<armourImpactReductionMultiplier>%d</armourImpactReductionMultiplier>\r\n", AmmoTypes[cnt].armourImpactReductionMultiplier );
FilePrintf(hFile,"\t\t<armourImpactReductionDivisor>%d</armourImpactReductionDivisor>\r\n", AmmoTypes[cnt].armourImpactReductionDivisor );
FilePrintf(hFile,"\t\t<beforeArmourDamageMultiplier>%d</beforeArmourDamageMultiplier>\r\n", AmmoTypes[cnt].beforeArmourDamageMultiplier );
FilePrintf(hFile,"\t\t<beforeArmourDamageDivisor>%d</beforeArmourDamageDivisor>\r\n", AmmoTypes[cnt].beforeArmourDamageDivisor );
FilePrintf(hFile,"\t\t<afterArmourDamageMultiplier>%d</afterArmourDamageMultiplier>\r\n", AmmoTypes[cnt].afterArmourDamageMultiplier );
FilePrintf(hFile,"\t\t<afterArmourDamageDivisor>%d</afterArmourDamageDivisor>\r\n", AmmoTypes[cnt].afterArmourDamageDivisor );
FilePrintf(hFile,"\t\t<zeroMinimumDamage>%d</zeroMinimumDamage>\r\n", AmmoTypes[cnt].zeroMinimumDamage );
FilePrintf(hFile,"\t\t<canGoThrough>%d</canGoThrough>\r\n", AmmoTypes[cnt].canGoThrough );
FilePrintf(hFile,"\t\t<standardIssue>%d</standardIssue>\r\n", AmmoTypes[cnt].standardIssue );
FilePrintf(hFile,"\t\t<numberOfBullets>%d</numberOfBullets>\r\n", AmmoTypes[cnt].numberOfBullets );
FilePrintf(hFile,"\t\t<multipleBulletDamageMultiplier>%d</multipleBulletDamageMultiplier>\r\n", AmmoTypes[cnt].multipleBulletDamageMultiplier );
FilePrintf(hFile,"\t\t<multipleBulletDamageDivisor>%d</multipleBulletDamageDivisor>\r\n", AmmoTypes[cnt].multipleBulletDamageDivisor );
FilePrintf(hFile,"\t\t<highExplosive>%d</highExplosive>\r\n", AmmoTypes[cnt].highExplosive );
FilePrintf(hFile,"\t\t<explosionSize>%d</explosionSize>\r\n", AmmoTypes[cnt].explosionSize );
FilePrintf(hFile,"\t\t<antiTank>%d</antiTank>\r\n", AmmoTypes[cnt].antiTank );
FilePrintf(hFile,"\t\t<dart>%d</dart>\r\n", AmmoTypes[cnt].dart );
FilePrintf(hFile,"\t\t<knife>%d</knife>\r\n", AmmoTypes[cnt].knife );
FilePrintf(hFile,"\t\t<monsterSpit>%d</monsterSpit>\r\n", AmmoTypes[cnt].monsterSpit );
FilePrintf(hFile,"\t\t<acidic>%d</acidic>\r\n", AmmoTypes[cnt].acidic );
FilePrintf(hFile,"\t\t<ignoreArmour>%d</ignoreArmour>\r\n", AmmoTypes[cnt].ignoreArmour );
FilePrintf(hFile,"\t\t<lockBustingPower>%d</lockBustingPower>\r\n", AmmoTypes[cnt].lockBustingPower );
FilePrintf(hFile,"\t\t<tracerEffect>%d</tracerEffect>\r\n", AmmoTypes[cnt].tracerEffect );
FilePrintf(hFile,"\t\t<fontColour>%d</fontColour>\r\n", AmmoTypes[cnt].fontColour );
FilePrintf(hFile,"\t\t<grayed>%d</grayed>\r\n", AmmoTypes[cnt].grayed );
FilePrintf(hFile,"\t\t<offNormal>%d</offNormal>\r\n", AmmoTypes[cnt].offNormal );
FilePrintf(hFile,"\t\t<onNormal>%d</onNormal>\r\n", AmmoTypes[cnt].onNormal );
FilePrintf(hFile,"\t\t<structureImpactReductionMultiplier>%d</structureImpactReductionMultiplier>\r\n", AmmoTypes[cnt].structureImpactReductionMultiplier );
FilePrintf(hFile,"\t\t<structureImpactReductionDivisor>%d</structureImpactReductionDivisor>\r\n", AmmoTypes[cnt].structureImpactReductionDivisor );
FilePrintf(hFile,"\t\t<armourImpactReductionMultiplier>%d</armourImpactReductionMultiplier>\r\n", AmmoTypes[cnt].armourImpactReductionMultiplier );
FilePrintf(hFile,"\t\t<armourImpactReductionDivisor>%d</armourImpactReductionDivisor>\r\n", AmmoTypes[cnt].armourImpactReductionDivisor );
FilePrintf(hFile,"\t\t<beforeArmourDamageMultiplier>%d</beforeArmourDamageMultiplier>\r\n", AmmoTypes[cnt].beforeArmourDamageMultiplier );
FilePrintf(hFile,"\t\t<beforeArmourDamageDivisor>%d</beforeArmourDamageDivisor>\r\n", AmmoTypes[cnt].beforeArmourDamageDivisor );
FilePrintf(hFile,"\t\t<afterArmourDamageMultiplier>%d</afterArmourDamageMultiplier>\r\n", AmmoTypes[cnt].afterArmourDamageMultiplier );
FilePrintf(hFile,"\t\t<afterArmourDamageDivisor>%d</afterArmourDamageDivisor>\r\n", AmmoTypes[cnt].afterArmourDamageDivisor );
FilePrintf(hFile,"\t\t<zeroMinimumDamage>%d</zeroMinimumDamage>\r\n", AmmoTypes[cnt].zeroMinimumDamage );
FilePrintf(hFile,"\t\t<canGoThrough>%d</canGoThrough>\r\n", AmmoTypes[cnt].canGoThrough );
FilePrintf(hFile,"\t\t<standardIssue>%d</standardIssue>\r\n", AmmoTypes[cnt].standardIssue );
FilePrintf(hFile,"\t\t<numberOfBullets>%d</numberOfBullets>\r\n", AmmoTypes[cnt].numberOfBullets );
FilePrintf(hFile,"\t\t<multipleBulletDamageMultiplier>%d</multipleBulletDamageMultiplier>\r\n", AmmoTypes[cnt].multipleBulletDamageMultiplier );
FilePrintf(hFile,"\t\t<multipleBulletDamageDivisor>%d</multipleBulletDamageDivisor>\r\n", AmmoTypes[cnt].multipleBulletDamageDivisor );
FilePrintf(hFile,"\t\t<highExplosive>%d</highExplosive>\r\n", AmmoTypes[cnt].highExplosive );
FilePrintf(hFile,"\t\t<explosionSize>%d</explosionSize>\r\n", AmmoTypes[cnt].explosionSize );
FilePrintf(hFile,"\t\t<antiTank>%d</antiTank>\r\n", AmmoTypes[cnt].antiTank );
FilePrintf(hFile,"\t\t<dart>%d</dart>\r\n", AmmoTypes[cnt].dart );
FilePrintf(hFile,"\t\t<knife>%d</knife>\r\n", AmmoTypes[cnt].knife );
FilePrintf(hFile,"\t\t<monsterSpit>%d</monsterSpit>\r\n", AmmoTypes[cnt].monsterSpit );
FilePrintf(hFile,"\t\t<acidic>%d</acidic>\r\n", AmmoTypes[cnt].acidic );
FilePrintf(hFile,"\t\t<ignoreArmour>%d</ignoreArmour>\r\n", AmmoTypes[cnt].ignoreArmour );
FilePrintf(hFile,"\t\t<lockBustingPower>%d</lockBustingPower>\r\n", AmmoTypes[cnt].lockBustingPower );
FilePrintf(hFile,"\t\t<tracerEffect>%d</tracerEffect>\r\n", AmmoTypes[cnt].tracerEffect );
FilePrintf(hFile,"\t</AMMOTYPE>\r\n");
@@ -433,4 +398,4 @@ BOOLEAN WriteAmmoTypeStats()
FileClose( hFile );
return( TRUE );
}
}