aboutsummaryrefslogtreecommitdiff
path: root/devtools
diff options
context:
space:
mode:
Diffstat (limited to 'devtools')
-rw-r--r--devtools/convbdf.cpp35
-rw-r--r--devtools/create_kyradat/types.cpp2
-rw-r--r--devtools/create_mortdat/create_mortdat.cpp4
-rw-r--r--devtools/create_mortdat/enginetext.h6
-rw-r--r--devtools/create_titanic/create_titanic_dat.cpp6
-rw-r--r--devtools/create_titanic/winexe_pe.h2
6 files changed, 41 insertions, 14 deletions
diff --git a/devtools/convbdf.cpp b/devtools/convbdf.cpp
index 59ea5cc4e5..31fdbd0010 100644
--- a/devtools/convbdf.cpp
+++ b/devtools/convbdf.cpp
@@ -38,7 +38,10 @@ struct BdfBoundingBox {
};
struct BdfFont {
+ char *familyName;
+ char *slant;
int maxAdvance;
+ int size;
int height;
BdfBoundingBox defaultBox;
int ascent;
@@ -51,7 +54,7 @@ struct BdfFont {
unsigned char *advances;
BdfBoundingBox *boxes;
- BdfFont() : bitmaps(0), advances(0), boxes(0) {
+ BdfFont() : bitmaps(0), advances(0), boxes(0), familyName(0), slant(0) {
}
~BdfFont() {
@@ -62,6 +65,8 @@ struct BdfFont {
delete[] bitmaps;
delete[] advances;
delete[] boxes;
+ delete[] familyName;
+ delete[] slant;
}
};
@@ -137,8 +142,9 @@ int main(int argc, char *argv[]) {
if (in.fail() || in.eof())
error("Premature end of file");
- if (hasPrefix(line, "SIZE ")) {
- // Ignore
+ if (hasPrefix(line, "PIXEL_SIZE ")) {
+ if (sscanf(line.c_str(), "PIXEL_SIZE %d", &font.size) != 1)
+ error("Invalid PIXEL_SIZE");
} else if (hasPrefix(line, "FONT ")) {
fontName = line.substr(5);
} else if (hasPrefix(line, "COPYRIGHT ")) {
@@ -159,6 +165,24 @@ int main(int argc, char *argv[]) {
memset(font.bitmaps, 0, sizeof(unsigned char *) * font.numCharacters);
font.advances = new unsigned char[font.numCharacters];
font.boxes = new BdfBoundingBox[font.numCharacters];
+ } else if (hasPrefix(line, "FAMILY_NAME \"")) {
+ font.familyName = new char[line.size()]; // We will definitely fit here
+ strncpy(font.familyName, &line.c_str()[13], line.size() - 1);
+ char *p = &font.familyName[strlen(font.familyName)];
+ while (p != font.familyName && *p != '"')
+ p--;
+ if (p == font.familyName)
+ error("Invalid FAMILY_NAME");
+ *p = '\0'; // Remove last quote
+ } else if (hasPrefix(line, "SLANT \"")) {
+ font.familyName = new char[line.size()]; // We will definitely fit here
+ strncpy(font.familyName, &line.c_str()[7], line.size() - 1);
+ char *p = &font.slant[strlen(font.slant)];
+ while (p != font.slant && *p != '"')
+ p--;
+ if (p == font.slant)
+ error("Invalid SLANT");
+ *p = '\0'; // Remove last quote
} else if (hasPrefix(line, "FONT_ASCENT ")) {
if (sscanf(line.c_str(), "FONT_ASCENT %d", &font.ascent) != 1)
error("Invalid FONT_ASCENT");
@@ -481,8 +505,11 @@ int main(int argc, char *argv[]) {
printf("// Font structure\n"
"static const BdfFontData desc = {\n"
+ "\t\"%s\", // Family name\n"
+ "\t\"%s\", // Slant\n"
"\t%d, // Max advance\n"
"\t%d, // Height\n"
+ "\t%d, // Size\n"
"\t{ %d, %d, %d, %d }, // Bounding box\n"
"\t%d, // Ascent\n"
"\n"
@@ -491,7 +518,7 @@ int main(int argc, char *argv[]) {
"\t%d, // Characters\n"
"\n"
"\tbitmapTable, // Bitmaps\n",
- font.maxAdvance, font.height, font.defaultBox.width,
+ font.familyName, font.slant, font.maxAdvance, font.size, font.height, font.defaultBox.width,
font.defaultBox.height, font.defaultBox.xOffset, font.defaultBox.yOffset,
font.ascent, font.firstCharacter, font.defaultCharacter, font.numCharacters);
diff --git a/devtools/create_kyradat/types.cpp b/devtools/create_kyradat/types.cpp
index 1f8430ab7f..52cd769f2f 100644
--- a/devtools/create_kyradat/types.cpp
+++ b/devtools/create_kyradat/types.cpp
@@ -132,7 +132,7 @@ static void writeStringList(PAKFile &out, const char *filename, const StringList
// Step 2: Write data
byte *const output = new byte[size];
-
+
byte *dst = output;
WRITE_BE_UINT32(dst, provider->numEntries); dst += 4;
for (uint i = 0; i < provider->numEntries; ++i) {
diff --git a/devtools/create_mortdat/create_mortdat.cpp b/devtools/create_mortdat/create_mortdat.cpp
index 2d7c9ad3b9..4dc1a92f2f 100644
--- a/devtools/create_mortdat/create_mortdat.cpp
+++ b/devtools/create_mortdat/create_mortdat.cpp
@@ -113,7 +113,7 @@ void openOutputFile(const char *outFilename) {
}
/**
- * Write out the data for the font
+ * Write out the data for the font
*/
void writeFontBlock() {
const int knownAddr[3] = {0x30cd, 0x36b0, 0x36c0};
@@ -149,7 +149,7 @@ void writeFontBlock() {
}
void writeStaticStrings(const char **strings, DataType dataType, int languageId) {
- // Write out a section header
+ // Write out a section header
const char sStaticStrings[4] = { 'S', 'S', 'T', 'R' };
const char sGameStrings[4] = { 'G', 'S', 'T', 'R' };
diff --git a/devtools/create_mortdat/enginetext.h b/devtools/create_mortdat/enginetext.h
index a257ddd5a2..d10edf8b1e 100644
--- a/devtools/create_mortdat/enginetext.h
+++ b/devtools/create_mortdat/enginetext.h
@@ -43,7 +43,7 @@ const char *engineDataEn[] = {
"% of hints...",
"Do you want to wake up?",
"OK",
- "",
+ "",
" Save",
" Load",
@@ -96,7 +96,7 @@ const char *engineDataFr[] = {
"% des indices...",
"D\202sirez-vous vous r\202veiller?",
"OK",
- "",
+ "",
" Sauvegarde",
" Chargement",
@@ -150,7 +150,7 @@ const char *engineDataDe[] = {
"% der Hinweise| bemerken muessen...",
"Moechten Sie aufwachen?",
"OK",
- "",
+ "",
" schreiben",
" lesen",
diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index 253269262e..fc9222467f 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -527,7 +527,7 @@ static const char *const STRINGS_DE[] = {
"Sie befinden sich bereits an Ihrem gew\xFCnschten Reiseziel.",
"Passagieren Ihrer Klasse ist der Zugang zu diesem Bereich nicht gestattet.",
"Wir bedauern, aber Sie m\xFCssen mindestens Dritte Klasse sein "
- "bevor Sie um Hilfe bitten k\xF6nnen.",
+ "bevor Sie um Hilfe bitten k\xF6nnen.",
"Ihnen wurde keine Kabine zugeteilt.",
"Wir bedauern, aber dieser Aufzug geht nicht tiefer als bis in den 27. Stock.",
"Sie m\xFCssen zuerst das Spiel selektieren, das Sie laden m\xF6" "chten.",
@@ -560,7 +560,7 @@ static const char *const STRINGS_DE[] = {
"aber das k\xF6nnen Sie eben nicht.",
"Eine Schale Pistazien.",
"Keine Schale Pistazien.",
-
+
"Sommer",
"Herbst",
"Winter",
@@ -572,7 +572,7 @@ static const char *const STRINGS_DE[] = {
"Pflanzen bitte nicht ber\0xFC" "nhren.",
"!\0xBC" "ta'\0xAD" "ta! !T\0xAA" "z n\0xAA" " sappibundli t\0xAA"
"cn\0xAA" "z!",
-
+
"Stop",
"!Hanaz!",
"VorwSrts",
diff --git a/devtools/create_titanic/winexe_pe.h b/devtools/create_titanic/winexe_pe.h
index 41929e3077..3a065c9258 100644
--- a/devtools/create_titanic/winexe_pe.h
+++ b/devtools/create_titanic/winexe_pe.h
@@ -88,7 +88,7 @@ public:
/** Return a stream to the specified resource (or 0 if non-existent). */
File *getResource(const WinResourceID &type, const WinResourceID &name, const WinResourceID &lang);
-
+
/** Returns true if the resources is empty */
bool empty() const { return _sections.empty(); }
private: