mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
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:
@@ -2,44 +2,8 @@
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
#include "sgp.h"
|
||||
#include "overhead types.h"
|
||||
#include "Sound Control.h"
|
||||
#include "Soldier Control.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"
|
||||
@@ -53,13 +17,13 @@ struct
|
||||
ComboMergeInfoStruct curAttachmentComboMerge;
|
||||
ComboMergeInfoStruct * curArray;
|
||||
UINT32 maxArraySize;
|
||||
|
||||
|
||||
UINT32 currentDepth;
|
||||
UINT32 maxReadDepth;
|
||||
}
|
||||
typedef attachmentcombomergeParseData;
|
||||
|
||||
static void XMLCALL
|
||||
static void XMLCALL
|
||||
attachmentcombomergeStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
|
||||
{
|
||||
attachmentcombomergeParseData * pData = (attachmentcombomergeParseData *)userData;
|
||||
@@ -106,11 +70,11 @@ attachmentcombomergeCharacterDataHandle(void *userData, const XML_Char *str, int
|
||||
{
|
||||
attachmentcombomergeParseData * pData = (attachmentcombomergeParseData *)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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -137,12 +101,12 @@ attachmentcombomergeEndElementHandle(void *userData, const XML_Char *name)
|
||||
else if(strcmp(name, "uiIndex") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curAttachmentComboMerge.uiIndex = (UINT32) atol(pData->szCharData);
|
||||
pData->curAttachmentComboMerge.uiIndex = (UINT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "usItem") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curAttachmentComboMerge.usItem = (UINT16) atol(pData->szCharData);
|
||||
pData->curAttachmentComboMerge.usItem = (UINT16) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "usAttachment1") == 0)
|
||||
{
|
||||
@@ -157,7 +121,7 @@ attachmentcombomergeEndElementHandle(void *userData, const XML_Char *name)
|
||||
else if(strcmp(name, "usResult") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curAttachmentComboMerge.usResult = (UINT16) atol(pData->szCharData);
|
||||
pData->curAttachmentComboMerge.usResult = (UINT16) atol(pData->szCharData);
|
||||
}
|
||||
|
||||
pData->maxReadDepth--;
|
||||
@@ -176,7 +140,7 @@ BOOLEAN ReadInAttachmentComboMergeStats(STR fileName)
|
||||
UINT32 uiFSize;
|
||||
CHAR8 * lpcBuffer;
|
||||
XML_Parser parser = XML_ParserCreate(NULL);
|
||||
|
||||
|
||||
attachmentcombomergeParseData pData;
|
||||
|
||||
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading AttachmentComboMerges.xml" );
|
||||
@@ -185,7 +149,7 @@ BOOLEAN ReadInAttachmentComboMergeStats(STR fileName)
|
||||
hFile = FileOpen( fileName, FILE_ACCESS_READ, FALSE );
|
||||
if ( !hFile )
|
||||
return( FALSE );
|
||||
|
||||
|
||||
uiFSize = FileGetSize(hFile);
|
||||
lpcBuffer = (CHAR8 *) MemAlloc(uiFSize+1);
|
||||
|
||||
@@ -193,7 +157,7 @@ BOOLEAN ReadInAttachmentComboMergeStats(STR fileName)
|
||||
if ( !FileRead( hFile, lpcBuffer, uiFSize, &uiBytesRead ) )
|
||||
{
|
||||
MemFree(lpcBuffer);
|
||||
FileClose( hFile ); /* added, Sgt. Kolja */
|
||||
FileClose( hFile ); /* added, Sgt. Kolja */
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
@@ -201,19 +165,19 @@ BOOLEAN ReadInAttachmentComboMergeStats(STR fileName)
|
||||
|
||||
FileClose( hFile );
|
||||
|
||||
|
||||
|
||||
XML_SetElementHandler(parser, attachmentcombomergeStartElementHandle, attachmentcombomergeEndElementHandle);
|
||||
XML_SetCharacterDataHandler(parser, attachmentcombomergeCharacterDataHandle);
|
||||
|
||||
|
||||
|
||||
memset(&pData,0,sizeof(pData));
|
||||
pData.curArray = AttachmentComboMerge;
|
||||
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];
|
||||
|
||||
@@ -221,7 +185,7 @@ BOOLEAN ReadInAttachmentComboMergeStats(STR fileName)
|
||||
LiveMessage(errorBuf);
|
||||
|
||||
MemFree(lpcBuffer);
|
||||
XML_ParserFree(parser); /* added, Sgt. Kolja */
|
||||
XML_ParserFree(parser); /* added, Sgt. Kolja */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -243,7 +207,7 @@ BOOLEAN WriteAttachmentComboMergeStats()
|
||||
hFile = FileOpen( "TABLEDATA\\AttachmentComboMerge out.xml", FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE );
|
||||
if ( !hFile )
|
||||
return( FALSE );
|
||||
|
||||
|
||||
{
|
||||
UINT32 cnt;
|
||||
|
||||
@@ -254,10 +218,10 @@ BOOLEAN WriteAttachmentComboMergeStats()
|
||||
FilePrintf(hFile,"\t<ATTACHMENTCOMBOMERGE>\r\n");
|
||||
|
||||
FilePrintf(hFile,"\t\t<uiIndex>%d</uiIndex>\r\n", cnt );
|
||||
FilePrintf(hFile,"\t\t<usItem>%d</usItem>\r\n", AttachmentComboMerge[cnt].usItem );
|
||||
FilePrintf(hFile,"\t\t<usAttachment1>%d</usAttachment1>\r\n", AttachmentComboMerge[cnt].usAttachment[0] );
|
||||
FilePrintf(hFile,"\t\t<usAttachment2>%d</usAttachment2>\r\n", AttachmentComboMerge[cnt].usAttachment[1] );
|
||||
FilePrintf(hFile,"\t\t<usResult>%d</usResult>\r\n", AttachmentComboMerge[cnt].usResult );
|
||||
FilePrintf(hFile,"\t\t<usItem>%d</usItem>\r\n", AttachmentComboMerge[cnt].usItem );
|
||||
FilePrintf(hFile,"\t\t<usAttachment1>%d</usAttachment1>\r\n", AttachmentComboMerge[cnt].usAttachment[0] );
|
||||
FilePrintf(hFile,"\t\t<usAttachment2>%d</usAttachment2>\r\n", AttachmentComboMerge[cnt].usAttachment[1] );
|
||||
FilePrintf(hFile,"\t\t<usResult>%d</usResult>\r\n", AttachmentComboMerge[cnt].usResult );
|
||||
|
||||
FilePrintf(hFile,"\t</ATTACHMENTCOMBOMERGE>\r\n");
|
||||
}
|
||||
@@ -266,4 +230,4 @@ BOOLEAN WriteAttachmentComboMergeStats()
|
||||
FileClose( hFile );
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user