From: Laszlo T. <ave...@us...> - 2010-07-26 21:51:07
|
gemrb: Infinity Engine emulator The branch master has been updated via 249cabd67f418ee0382e412523e9971aedc8a716 (commit) Summary of changes: gemrb/override/bg2/gender.2da | 23 +++++++++++++ gemrb/override/how/gender.2da | 22 +++++++++++++ gemrb/override/iwd/gender.2da | 22 +++++++++++++ gemrb/override/iwd2/gender.2da | 22 +++++++++++++ gemrb/plugins/TLKImporter/TLKImporter.cpp | 50 ++++++++++++++++++++++++++++- 5 files changed, 138 insertions(+), 1 deletions(-) create mode 100644 gemrb/override/bg2/gender.2da create mode 100644 gemrb/override/how/gender.2da create mode 100644 gemrb/override/iwd/gender.2da create mode 100644 gemrb/override/iwd2/gender.2da from 935bf13189875ace69c6270a5a6fc62afefe0394 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=249cabd67f418ee0382e412523e9971aedc8a716 commit 249cabd67f418ee0382e412523e9971aedc8a716 Author: Avenger <ave...@so...> Date: Mon Jul 26 23:50:20 2010 +0200 externalized gender based tokens diff --git a/gemrb/override/bg2/gender.2da b/gemrb/override/bg2/gender.2da new file mode 100644 index 0000000..73db5dc --- /dev/null +++ b/gemrb/override/bg2/gender.2da @@ -0,0 +1,23 @@ +2DA V1.0 +* + TYPE MALE FEMALE +SIRMAAM -1 27473 27475 +GIRLBOY -1 27477 27476 +BROTHERSISTER -1 27478 27479 +LADYLORD -1 27481 27480 +MALEFEMALE -1 27482 27483 +HESHE -1 27484 27485 +HISHER -1 27486 27487 +HIMHER -1 27488 27487 +MANWOMAN -1 27489 27490 +SONDAUGHTER -1 70567 70568 +PRO_SIRMAAM 0 27473 27475 +PRO_GIRLBOY 0 27477 27476 +PRO_BROTHERSISTER 0 27478 27479 +PRO_LADYLORD 0 27481 27480 +PRO_MALEFEMALE 0 27482 27483 +PRO_HESHE 0 27484 27485 +PRO_HISHER 0 27486 27487 +PRO_HIMHER 0 27488 27487 +PRO_MANWOMAN 0 27489 27490 +PRO_SONDAUGHTER 0 70567 70568 diff --git a/gemrb/override/how/gender.2da b/gemrb/override/how/gender.2da new file mode 100644 index 0000000..609cf68 --- /dev/null +++ b/gemrb/override/how/gender.2da @@ -0,0 +1,22 @@ +2DA V1.0 +* + TYPE MALE FEMALE +SIRMAAM -1 27473 27475 +GIRLBOY -1 27477 27476 +BROTHERSISTER -1 27478 27479 +LADYLORD -1 27481 27480 +MALEFEMALE -1 27482 27483 +HESHE -1 27484 27485 +HISHER -1 27486 27487 +HIMHER -1 27488 27487 +MANWOMAN -1 27489 27490 +SONDAUGHTER -1 70567 70568 +PROTAGONIST_SIRMAAM 0 27473 27475 +PROTAGONIST_GIRLBOY 0 27477 27476 +PROTAGONIST_BROTHERSISTER 0 27478 27479 +PROTAGONIST_LADYLORD 0 27481 27480 +PROTAGONIST_MALEFEMALE 0 27482 27483 +PROTAGONIST_HESHE 0 27484 27485 +PROTAGONIST_HISHER 0 27486 27487 +PROTAGONIST_HIMHER 0 27488 27487 +PROTAGONIST_MANWOMAN 0 27489 27490 diff --git a/gemrb/override/iwd/gender.2da b/gemrb/override/iwd/gender.2da new file mode 100644 index 0000000..609cf68 --- /dev/null +++ b/gemrb/override/iwd/gender.2da @@ -0,0 +1,22 @@ +2DA V1.0 +* + TYPE MALE FEMALE +SIRMAAM -1 27473 27475 +GIRLBOY -1 27477 27476 +BROTHERSISTER -1 27478 27479 +LADYLORD -1 27481 27480 +MALEFEMALE -1 27482 27483 +HESHE -1 27484 27485 +HISHER -1 27486 27487 +HIMHER -1 27488 27487 +MANWOMAN -1 27489 27490 +SONDAUGHTER -1 70567 70568 +PROTAGONIST_SIRMAAM 0 27473 27475 +PROTAGONIST_GIRLBOY 0 27477 27476 +PROTAGONIST_BROTHERSISTER 0 27478 27479 +PROTAGONIST_LADYLORD 0 27481 27480 +PROTAGONIST_MALEFEMALE 0 27482 27483 +PROTAGONIST_HESHE 0 27484 27485 +PROTAGONIST_HISHER 0 27486 27487 +PROTAGONIST_HIMHER 0 27488 27487 +PROTAGONIST_MANWOMAN 0 27489 27490 diff --git a/gemrb/override/iwd2/gender.2da b/gemrb/override/iwd2/gender.2da new file mode 100644 index 0000000..609cf68 --- /dev/null +++ b/gemrb/override/iwd2/gender.2da @@ -0,0 +1,22 @@ +2DA V1.0 +* + TYPE MALE FEMALE +SIRMAAM -1 27473 27475 +GIRLBOY -1 27477 27476 +BROTHERSISTER -1 27478 27479 +LADYLORD -1 27481 27480 +MALEFEMALE -1 27482 27483 +HESHE -1 27484 27485 +HISHER -1 27486 27487 +HIMHER -1 27488 27487 +MANWOMAN -1 27489 27490 +SONDAUGHTER -1 70567 70568 +PROTAGONIST_SIRMAAM 0 27473 27475 +PROTAGONIST_GIRLBOY 0 27477 27476 +PROTAGONIST_BROTHERSISTER 0 27478 27479 +PROTAGONIST_LADYLORD 0 27481 27480 +PROTAGONIST_MALEFEMALE 0 27482 27483 +PROTAGONIST_HESHE 0 27484 27485 +PROTAGONIST_HISHER 0 27486 27487 +PROTAGONIST_HIMHER 0 27488 27487 +PROTAGONIST_MANWOMAN 0 27489 27490 diff --git a/gemrb/plugins/TLKImporter/TLKImporter.cpp b/gemrb/plugins/TLKImporter/TLKImporter.cpp index e20254a..09a3df8 100644 --- a/gemrb/plugins/TLKImporter/TLKImporter.cpp +++ b/gemrb/plugins/TLKImporter/TLKImporter.cpp @@ -30,9 +30,21 @@ //set this to -1 if charname is gabber (iwd2) static int charname=0; +typedef struct gt_type +{ + int type; + ieStrRef male; + ieStrRef female; +}; +static Variables gtmap; TLKImporter::TLKImporter(void) { + int gtcount; + + gtmap.RemoveAll(NULL); + gtmap.SetType(GEM_VARIABLES_POINTER); + if (core->HasFeature(GF_CHARNAMEISGABBER)) { charname=-1; } else { @@ -41,6 +53,28 @@ TLKImporter::TLKImporter(void) str = NULL; override = NULL; autoFree = false; + + AutoTable tm("gender"); + if (tm) { + gtcount = tm->GetRowCount(); + } else { + gtcount = 0; + } + for(int i=0;i<gtcount;i++) { + ieVariable key; + + strnuprcpy(key, tm->GetRowName(i), sizeof(ieVariable) ); + gt_type *entry = (gt_type *) malloc(sizeof(gt_type) ); + entry->type = atoi(tm->QueryField(i,0)); + entry->male = atoi(tm->QueryField(i,1)); + entry->female = atoi(tm->QueryField(i,2)); + gtmap.SetAt(key, (void *) entry); + } +} + +void ReleaseGtEntry(void *poi) +{ + delete (gt_type *) poi; } TLKImporter::~TLKImporter(void) @@ -48,6 +82,10 @@ TLKImporter::~TLKImporter(void) if (str && autoFree) { delete( str ); } + + + gtmap.RemoveAll(ReleaseGtEntry); + CloseAux(); } @@ -184,6 +222,13 @@ int TLKImporter::BuiltinToken(char* Token, char* dest) { char* Decoded = NULL; int TokenLength; //decoded token length + gt_type *entry; + + //these are gender specific tokens, they are customisable by gender.2da + if (gtmap.Lookup(Token, (void *&) entry) ) { + Decoded = GetString( GenderStrRef(entry->type, entry->male, entry->female) ); + goto exit_function; + } //these are hardcoded, all engines are the same or don't use them if (!strcmp( Token, "DAYANDMONTH")) { @@ -203,6 +248,7 @@ int TLKImporter::BuiltinToken(char* Token, char* dest) Decoded = GetString( RaceStrRef(-1), 0); goto exit_function; } +/* if (!strcmp( Token, "SIRMAAM" )) { Decoded = GetString( GenderStrRef(-1,27473,27475), 0); goto exit_function; @@ -239,6 +285,7 @@ int TLKImporter::BuiltinToken(char* Token, char* dest) Decoded = GetString( GenderStrRef(-1,27489,27490), 0); goto exit_function; } +*/ if (!strncmp( Token, "PLAYER",6 )) { Decoded = CharName(Token[6]-'1'); goto exit_function; @@ -256,6 +303,7 @@ int TLKImporter::BuiltinToken(char* Token, char* dest) Decoded = GetString( RaceStrRef(0), 0); goto exit_function; } +/* if (!strcmp( Token, "PRO_SIRMAAM" )) { Decoded = GetString( GenderStrRef(0,27473,27475), 0); goto exit_function; @@ -292,7 +340,7 @@ int TLKImporter::BuiltinToken(char* Token, char* dest) Decoded = GetString( GenderStrRef(0,27489,27490), 0); goto exit_function; } - +*/ if (!strcmp( Token, "MAGESCHOOL" )) { ieDword row = 0; //default value is 0 (generalist) //this is subject to change, the row number in magesch.2da ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |