mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +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
|
// preprocess sector for mercs in it
|
||||||
extern BOOLEAN fSectorsWithSoldiers[ MAP_WORLD_X * MAP_WORLD_X ][ 4 ];
|
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_X 18
|
||||||
#define MAP_WORLD_Y 18
|
#define MAP_WORLD_Y 18
|
||||||
|
|
||||||
|
#define MAX_TOWN_NAME_LENGHT 32
|
||||||
|
|
||||||
// Sector name identifiers
|
// Sector name identifiers
|
||||||
enum Towns
|
enum Towns
|
||||||
{
|
{
|
||||||
BLANK_SECTOR=0,
|
BLANK_SECTOR=0,
|
||||||
OMERTA,
|
OMERTA,
|
||||||
DRASSEN,
|
DRASSEN,
|
||||||
ALMA,
|
ALMA,
|
||||||
@@ -24,7 +25,8 @@ enum Towns
|
|||||||
ORTA,
|
ORTA,
|
||||||
BALIME,
|
BALIME,
|
||||||
MEDUNA,
|
MEDUNA,
|
||||||
CHITZENA,
|
CHITZENA,
|
||||||
|
|
||||||
NUM_TOWNS
|
NUM_TOWNS
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -358,6 +358,7 @@ typedef enum
|
|||||||
CITYTABLE_ELEMENT_CITYLIST,
|
CITYTABLE_ELEMENT_CITYLIST,
|
||||||
CITYTABLE_ELEMENT_CITY,
|
CITYTABLE_ELEMENT_CITY,
|
||||||
CITYTABLE_ELEMENT_INDEX,
|
CITYTABLE_ELEMENT_INDEX,
|
||||||
|
CITYTABLE_ELEMENT_NAME,
|
||||||
CITYTABLE_ELEMENT_BASESECTOR,
|
CITYTABLE_ELEMENT_BASESECTOR,
|
||||||
CITYTABLE_ELEMENT_BASESECTOR_X,
|
CITYTABLE_ELEMENT_BASESECTOR_X,
|
||||||
CITYTABLE_ELEMENT_BASESECTOR_Y,
|
CITYTABLE_ELEMENT_BASESECTOR_Y,
|
||||||
@@ -372,6 +373,7 @@ typedef struct
|
|||||||
UINT8 ubBaseX;
|
UINT8 ubBaseX;
|
||||||
UINT8 ubBaseY;
|
UINT8 ubBaseY;
|
||||||
POINT townPoint;
|
POINT townPoint;
|
||||||
|
CHAR8 cityName[MAX_TOWN_NAME_LENGHT];
|
||||||
} cityInfo;
|
} cityInfo;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
@@ -436,6 +438,11 @@ citytableStartElementHandle(void *userData, const char *name, const char **atts)
|
|||||||
|
|
||||||
pData->maxReadDepth++; //we are not skipping this element
|
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)
|
else if(strcmp(name, "uiIndex") == 0 && pData->curElement == CITYTABLE_ELEMENT_CITY)
|
||||||
{
|
{
|
||||||
pData->curElement = CITYTABLE_ELEMENT_INDEX;
|
pData->curElement = CITYTABLE_ELEMENT_INDEX;
|
||||||
@@ -540,6 +547,13 @@ citytableEndElementHandle(void *userData, const char *name)
|
|||||||
|
|
||||||
pData->curCityInfo.uiIndex = atol(pData->szCharData);
|
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)
|
else if(strcmp(name, "baseSector") == 0 && pData->curElement == CITYTABLE_ELEMENT_BASESECTOR)
|
||||||
{
|
{
|
||||||
pData->curElement = CITYTABLE_ELEMENT_CITY;
|
pData->curElement = CITYTABLE_ELEMENT_CITY;
|
||||||
|
|||||||
+2
-1
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "items.h"
|
#include "items.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
#include "mapscreen.h"
|
||||||
|
|
||||||
#define STRING_LENGTH 255
|
#define STRING_LENGTH 255
|
||||||
|
|
||||||
@@ -26,7 +27,7 @@ extern STR16 pLongAttributeStrings[];
|
|||||||
extern STR16 pContractStrings[];
|
extern STR16 pContractStrings[];
|
||||||
extern STR16 pAssignmentStrings[];
|
extern STR16 pAssignmentStrings[];
|
||||||
extern STR16 pConditionStrings[];
|
extern STR16 pConditionStrings[];
|
||||||
extern STR16 pTownNames[];
|
extern CHAR16 pTownNames[NUM_TOWNS][MAX_TOWN_NAME_LENGHT]; // Lesh: look mapscreen.h for definitions
|
||||||
extern STR16 pPersonnelScreenStrings[];
|
extern STR16 pPersonnelScreenStrings[];
|
||||||
extern STR16 pPersonnelTitle[];
|
extern STR16 pPersonnelTitle[];
|
||||||
extern STR16 pUpperLeftMapScreenStrings[];
|
extern STR16 pUpperLeftMapScreenStrings[];
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ UINT16 Message[][STRING_LENGTH] =
|
|||||||
|
|
||||||
// the names of the towns in the game
|
// the names of the towns in the game
|
||||||
|
|
||||||
STR16 pTownNames[] =
|
CHAR16 pTownNames[NUM_TOWNS][MAX_TOWN_NAME_LENGHT] =
|
||||||
{
|
{
|
||||||
L"",
|
L"",
|
||||||
L"Omerta",
|
L"Omerta",
|
||||||
|
|||||||
@@ -305,7 +305,7 @@ UINT16 Message[][STRING_LENGTH] =
|
|||||||
|
|
||||||
// the names of the towns in the game
|
// the names of the towns in the game
|
||||||
|
|
||||||
STR16 pTownNames[] =
|
CHAR16 pTownNames[NUM_TOWNS][MAX_TOWN_NAME_LENGHT] =
|
||||||
{
|
{
|
||||||
L"",
|
L"",
|
||||||
L"Omerta",
|
L"Omerta",
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ UINT16 Message[][STRING_LENGTH] =
|
|||||||
|
|
||||||
// the names of the towns in the game
|
// the names of the towns in the game
|
||||||
|
|
||||||
STR16 pTownNames[] =
|
CHAR16 pTownNames[NUM_TOWNS][MAX_TOWN_NAME_LENGHT] =
|
||||||
{
|
{
|
||||||
L"",
|
L"",
|
||||||
L"Omerta",
|
L"Omerta",
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ UINT16 Message[][STRING_LENGTH] =
|
|||||||
L"kein Einzelschuss",
|
L"kein Einzelschuss",
|
||||||
};
|
};
|
||||||
|
|
||||||
STR16 pTownNames[] =
|
CHAR16 pTownNames[NUM_TOWNS][MAX_TOWN_NAME_LENGHT] =
|
||||||
{
|
{
|
||||||
L"",
|
L"",
|
||||||
L"Omerta",
|
L"Omerta",
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ UINT16 Message[][STRING_LENGTH] =
|
|||||||
|
|
||||||
// the names of the towns in the game
|
// the names of the towns in the game
|
||||||
|
|
||||||
STR16 pTownNames[] =
|
CHAR16 pTownNames[NUM_TOWNS][MAX_TOWN_NAME_LENGHT] =
|
||||||
{
|
{
|
||||||
L"",
|
L"",
|
||||||
L"Omerta",
|
L"Omerta",
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ UINT16 Message[][STRING_LENGTH] =
|
|||||||
|
|
||||||
// the names of the towns in the game
|
// the names of the towns in the game
|
||||||
|
|
||||||
STR16 pTownNames[] =
|
CHAR16 pTownNames[NUM_TOWNS][MAX_TOWN_NAME_LENGHT] =
|
||||||
{
|
{
|
||||||
L"",
|
L"",
|
||||||
L"Omerta",
|
L"Omerta",
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ UINT16 Message[][STRING_LENGTH] =
|
|||||||
|
|
||||||
// the names of the towns in the game
|
// the names of the towns in the game
|
||||||
|
|
||||||
STR16 pTownNames[] =
|
CHAR16 pTownNames[NUM_TOWNS][MAX_TOWN_NAME_LENGHT] =
|
||||||
{
|
{
|
||||||
L"",
|
L"",
|
||||||
L"Îìåðòà",
|
L"Îìåðòà",
|
||||||
|
|||||||
Reference in New Issue
Block a user