mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
- enabled town names in cities.xml
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@597 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -172,7 +172,7 @@ extern UINT32 guiNumWorldItems;
|
||||
// preprocess sector for mercs in it
|
||||
extern BOOLEAN fSectorsWithSoldiers[ MAP_WORLD_X * MAP_WORLD_X ][ 4 ];
|
||||
|
||||
extern STR16 pTownNames[];
|
||||
extern CHAR16 pTownNames[NUM_TOWNS][MAX_TOWN_NAME_LENGHT];
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,11 +8,12 @@
|
||||
#define MAP_WORLD_X 18
|
||||
#define MAP_WORLD_Y 18
|
||||
|
||||
#define MAX_TOWN_NAME_LENGHT 32
|
||||
|
||||
// Sector name identifiers
|
||||
enum Towns
|
||||
{
|
||||
BLANK_SECTOR=0,
|
||||
BLANK_SECTOR=0,
|
||||
OMERTA,
|
||||
DRASSEN,
|
||||
ALMA,
|
||||
@@ -24,7 +25,8 @@ enum Towns
|
||||
ORTA,
|
||||
BALIME,
|
||||
MEDUNA,
|
||||
CHITZENA,
|
||||
CHITZENA,
|
||||
|
||||
NUM_TOWNS
|
||||
} ;
|
||||
|
||||
|
||||
@@ -358,6 +358,7 @@ typedef enum
|
||||
CITYTABLE_ELEMENT_CITYLIST,
|
||||
CITYTABLE_ELEMENT_CITY,
|
||||
CITYTABLE_ELEMENT_INDEX,
|
||||
CITYTABLE_ELEMENT_NAME,
|
||||
CITYTABLE_ELEMENT_BASESECTOR,
|
||||
CITYTABLE_ELEMENT_BASESECTOR_X,
|
||||
CITYTABLE_ELEMENT_BASESECTOR_Y,
|
||||
@@ -372,6 +373,7 @@ typedef struct
|
||||
UINT8 ubBaseX;
|
||||
UINT8 ubBaseY;
|
||||
POINT townPoint;
|
||||
CHAR8 cityName[MAX_TOWN_NAME_LENGHT];
|
||||
} cityInfo;
|
||||
|
||||
typedef struct
|
||||
@@ -436,6 +438,11 @@ citytableStartElementHandle(void *userData, const char *name, const char **atts)
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
else if(strcmp(name, "cityName") == 0 && pData->curElement == CITYTABLE_ELEMENT_CITY)
|
||||
{
|
||||
pData->curElement = CITYTABLE_ELEMENT_NAME;
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
else if(strcmp(name, "uiIndex") == 0 && pData->curElement == CITYTABLE_ELEMENT_CITY)
|
||||
{
|
||||
pData->curElement = CITYTABLE_ELEMENT_INDEX;
|
||||
@@ -540,6 +547,13 @@ citytableEndElementHandle(void *userData, const char *name)
|
||||
|
||||
pData->curCityInfo.uiIndex = atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "cityName") == 0 && pData->curElement == CITYTABLE_ELEMENT_NAME)
|
||||
{
|
||||
// Copy this string into the pTownNames array
|
||||
mbstowcs(pTownNames[pData->curCityInfo.uiIndex], (const char *) pData->szCharData, MAX_TOWN_NAME_LENGHT);
|
||||
pTownNames[pData->curCityInfo.uiIndex][MAX_TOWN_NAME_LENGHT - 1] = 0;
|
||||
pData->curElement = CITYTABLE_ELEMENT_CITY;
|
||||
}
|
||||
else if(strcmp(name, "baseSector") == 0 && pData->curElement == CITYTABLE_ELEMENT_BASESECTOR)
|
||||
{
|
||||
pData->curElement = CITYTABLE_ELEMENT_CITY;
|
||||
|
||||
Reference in New Issue
Block a user