diff options
author | anotherguest | 2013-11-26 12:14:38 +0100 |
---|---|---|
committer | anotherguest | 2013-11-26 12:14:38 +0100 |
commit | 44947f5bdb45095793f1e994385f051d534d53ee (patch) | |
tree | 7bfc07044c7a1d585fa5145ef91bfb6f9fb6e242 /engines | |
parent | ed357a6dfacd2fd41366d2baf61bd344fec9a0a0 (diff) | |
parent | 0e017f007a8a3db8c8d8320f76cbfd423e662e07 (diff) | |
download | scummvm-rg350-44947f5bdb45095793f1e994385f051d534d53ee.tar.gz scummvm-rg350-44947f5bdb45095793f1e994385f051d534d53ee.tar.bz2 scummvm-rg350-44947f5bdb45095793f1e994385f051d534d53ee.zip |
Merge branch 'master' of github.com:scummvm/scummvm
Diffstat (limited to 'engines')
54 files changed, 240 insertions, 660 deletions
diff --git a/engines/agi/configure.engine b/engines/agi/configure.engine new file mode 100644 index 0000000000..fad659f86d --- /dev/null +++ b/engines/agi/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine agi "AGI" yes diff --git a/engines/agos/configure.engine b/engines/agos/configure.engine new file mode 100644 index 0000000000..3ae1fb16f2 --- /dev/null +++ b/engines/agos/configure.engine @@ -0,0 +1,4 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine agos "AGOS" yes "agos2" "AGOS 1 games" +add_engine agos2 "AGOS 2 games" yes diff --git a/engines/avalanche/configure.engine b/engines/avalanche/configure.engine new file mode 100644 index 0000000000..28d6a558db --- /dev/null +++ b/engines/avalanche/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine avalanche "Lord Avalot d'Argent" no diff --git a/engines/cge/configure.engine b/engines/cge/configure.engine new file mode 100644 index 0000000000..72af1197be --- /dev/null +++ b/engines/cge/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine cge "CGE" yes diff --git a/engines/cine/configure.engine b/engines/cine/configure.engine new file mode 100644 index 0000000000..2b7e2085fa --- /dev/null +++ b/engines/cine/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine cine "Cinematique evo 1" yes diff --git a/engines/composer/configure.engine b/engines/composer/configure.engine new file mode 100644 index 0000000000..71a79acb5d --- /dev/null +++ b/engines/composer/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine composer "Magic Composer" yes diff --git a/engines/configure.engines b/engines/configure.engines deleted file mode 100644 index ec7d4667ca..0000000000 --- a/engines/configure.engines +++ /dev/null @@ -1,57 +0,0 @@ -# This file is included from the main "configure" script -# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] -add_engine scumm "SCUMM" yes "scumm_7_8 he" "v0-v6 games" -add_engine scumm_7_8 "v7 & v8 games" yes -add_engine he "HE71+ games" yes -add_engine agi "AGI" yes -add_engine agos "AGOS" yes "agos2" "AGOS 1 games" -add_engine agos2 "AGOS 2 games" yes -add_engine avalanche "Lord Avalot d'Argent" no -add_engine cge "CGE" yes -add_engine cine "Cinematique evo 1" yes -add_engine composer "Magic Composer" yes -add_engine cruise "Cinematique evo 2" yes -add_engine draci "Dragon History" yes -add_engine drascula "Drascula: The Vampire Strikes Back" yes -add_engine dreamweb "Dreamweb" yes -add_engine fullpipe "Full Pipe" no -add_engine gob "Gobli*ns" yes -add_engine groovie "Groovie" yes "groovie2" "7th Guest" -add_engine groovie2 "Groovie 2 games" no "" "" "jpeg" -add_engine hopkins "Hopkins FBI" yes "" "" "16bit" -add_engine hugo "Hugo Trilogy" yes -add_engine kyra "Kyra" yes "lol eob" "Legend of Kyrandia 1-3" -add_engine lol "Lands of Lore" yes -add_engine eob "Eye of the Beholder" yes -add_engine lastexpress "The Last Express" no "" "" "16bit" -add_engine lure "Lure of the Temptress" yes -add_engine made "MADE" yes -add_engine mohawk "Mohawk" yes "cstime myst riven" "Living Books" -add_engine mortevielle "Mortevielle" no -add_engine cstime "Where in Time is Carmen Sandiego?" no -add_engine riven "Riven: The Sequel to Myst" no "" "" "16bit" -add_engine myst "Myst" no "" "" "16bit" -add_engine neverhood "Neverhood" no -add_engine parallaction "Parallaction" yes -add_engine pegasus "The Journeyman Project: Pegasus Prime" yes "" "" "16bit" -add_engine queen "Flight of the Amazon Queen" yes -add_engine saga "SAGA" yes "ihnm saga2" "ITE" -add_engine ihnm "IHNM" yes -add_engine saga2 "SAGA 2 games" no -add_engine sci "SCI" yes "sci32" "SCI 0-1.1 games" -add_engine sci32 "SCI32 games" no -add_engine sky "Beneath a Steel Sky" yes -add_engine sword1 "Broken Sword" yes -add_engine sword2 "Broken Sword II" yes -add_engine sword25 "Broken Sword 2.5" no "" "" "png zlib 16bit" -add_engine teenagent "Teen Agent" yes -add_engine testbed "TestBed: the Testing framework" no -add_engine tinsel "Tinsel" yes -add_engine toltecs "3 Skulls of the Toltecs" yes -add_engine toon "Toonstruck" yes -add_engine touche "Touche: The Adventures of the Fifth Musketeer" yes -add_engine tony "Tony Tough and the Night of Roasted Moths" yes "" "" "16bit" -add_engine tsage "TsAGE" yes -add_engine tucker "Bud Tucker in Double Trouble" yes -add_engine wintermute "Wintermute" no "" "" "jpeg png zlib vorbis 16bit" -add_engine zvision "ZVision" no "" "" "freetype2 16bit" diff --git a/engines/cruise/configure.engine b/engines/cruise/configure.engine new file mode 100644 index 0000000000..925da25370 --- /dev/null +++ b/engines/cruise/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine cruise "Cinematique evo 2" yes diff --git a/engines/draci/configure.engine b/engines/draci/configure.engine new file mode 100644 index 0000000000..09022b06f5 --- /dev/null +++ b/engines/draci/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine draci "Dragon History" yes diff --git a/engines/drascula/configure.engine b/engines/drascula/configure.engine new file mode 100644 index 0000000000..b9b76638fd --- /dev/null +++ b/engines/drascula/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine drascula "Drascula: The Vampire Strikes Back" yes diff --git a/engines/dreamweb/configure.engine b/engines/dreamweb/configure.engine new file mode 100644 index 0000000000..27506e650f --- /dev/null +++ b/engines/dreamweb/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine dreamweb "Dreamweb" yes diff --git a/engines/engines.mk b/engines/engines.mk deleted file mode 100644 index cfde77321d..0000000000 --- a/engines/engines.mk +++ /dev/null @@ -1,263 +0,0 @@ -ifdef ENABLE_SCUMM -DEFINES += -DENABLE_SCUMM=$(ENABLE_SCUMM) -MODULES += engines/scumm - -ifdef ENABLE_SCUMM_7_8 -DEFINES += -DENABLE_SCUMM_7_8 -endif - -ifdef ENABLE_HE -DEFINES += -DENABLE_HE -endif - -endif - -ifdef ENABLE_AGI -DEFINES += -DENABLE_AGI=$(ENABLE_AGI) -MODULES += engines/agi -endif - -ifdef ENABLE_AGOS -DEFINES += -DENABLE_AGOS=$(ENABLE_AGOS) -MODULES += engines/agos - -ifdef ENABLE_AGOS2 -DEFINES += -DENABLE_AGOS2 -endif -endif - -ifdef ENABLE_AVALANCHE -DEFINES += -DENABLE_AVALANCHE=$(ENABLE_AVALANCHE) -MODULES += engines/avalanche -endif - -ifdef ENABLE_CGE -DEFINES += -DENABLE_CGE=$(ENABLE_CGE) -MODULES += engines/cge -endif - -ifdef ENABLE_CINE -DEFINES += -DENABLE_CINE=$(ENABLE_CINE) -MODULES += engines/cine -endif - -ifdef ENABLE_COMPOSER -DEFINES += -DENABLE_COMPOSER=$(ENABLE_COMPOSER) -MODULES += engines/composer -endif - -ifdef ENABLE_CRUISE -DEFINES += -DENABLE_CRUISE=$(ENABLE_CRUISE) -MODULES += engines/cruise -endif - -ifdef ENABLE_DRACI -DEFINES += -DENABLE_DRACI=$(ENABLE_DRACI) -MODULES += engines/draci -endif - -ifdef ENABLE_DRASCULA -DEFINES += -DENABLE_DRASCULA=$(ENABLE_DRASCULA) -MODULES += engines/drascula -endif - -ifdef ENABLE_DREAMWEB -DEFINES += -DENABLE_DREAMWEB=$(ENABLE_DREAMWEB) -MODULES += engines/dreamweb -endif - -ifdef ENABLE_FULLPIPE -DEFINES += -DENABLE_FULLPIPE=$(ENABLE_FULLPIPE) -MODULES += engines/fullpipe -endif - -ifdef ENABLE_GOB -DEFINES += -DENABLE_GOB=$(ENABLE_GOB) -MODULES += engines/gob -endif - -ifdef ENABLE_GROOVIE -DEFINES += -DENABLE_GROOVIE=$(ENABLE_GROOVIE) -MODULES += engines/groovie - -ifdef ENABLE_GROOVIE2 -DEFINES += -DENABLE_GROOVIE2 -endif -endif - -ifdef ENABLE_HOPKINS -DEFINES += -DENABLE_HOPKINS=$(ENABLE_HOPKINS) -MODULES += engines/hopkins -endif - -ifdef ENABLE_HUGO -DEFINES += -DENABLE_HUGO=$(ENABLE_HUGO) -MODULES += engines/hugo -endif - -ifdef ENABLE_KYRA -DEFINES += -DENABLE_KYRA=$(ENABLE_KYRA) -MODULES += engines/kyra - -ifdef ENABLE_LOL -DEFINES += -DENABLE_LOL -endif - -ifdef ENABLE_EOB -DEFINES += -DENABLE_EOB -endif -endif - -ifdef ENABLE_LASTEXPRESS -DEFINES += -DENABLE_LASTEXPRESS=$(ENABLE_LASTEXPRESS) -MODULES += engines/lastexpress -endif - -ifdef ENABLE_LURE -DEFINES += -DENABLE_LURE=$(ENABLE_LURE) -MODULES += engines/lure -endif - -ifdef ENABLE_MADE -DEFINES += -DENABLE_MADE=$(ENABLE_MADE) -MODULES += engines/made -endif - -ifdef ENABLE_MOHAWK -DEFINES += -DENABLE_MOHAWK=$(ENABLE_MOHAWK) -MODULES += engines/mohawk - -ifdef ENABLE_CSTIME -DEFINES += -DENABLE_CSTIME -endif - -ifdef ENABLE_MYST -DEFINES += -DENABLE_MYST -endif - -ifdef ENABLE_RIVEN -DEFINES += -DENABLE_RIVEN -endif -endif - -ifdef ENABLE_MORTEVIELLE -DEFINES += -DENABLE_MORTEVIELLE=$(ENABLE_MORTEVIELLE) -MODULES += engines/mortevielle -endif - -ifdef ENABLE_NEVERHOOD -DEFINES += -DENABLE_NEVERHOOD=$(ENABLE_NEVERHOOD) -MODULES += engines/neverhood -endif - -ifdef ENABLE_PARALLACTION -DEFINES += -DENABLE_PARALLACTION=$(ENABLE_PARALLACTION) -MODULES += engines/parallaction -endif - -ifdef ENABLE_PEGASUS -DEFINES += -DENABLE_PEGASUS=$(ENABLE_PEGASUS) -MODULES += engines/pegasus -endif - -ifdef ENABLE_QUEEN -DEFINES += -DENABLE_QUEEN=$(ENABLE_QUEEN) -MODULES += engines/queen -endif - -ifdef ENABLE_SAGA -DEFINES += -DENABLE_SAGA=$(ENABLE_SAGA) -MODULES += engines/saga - -ifdef ENABLE_IHNM -DEFINES += -DENABLE_IHNM -endif - -ifdef ENABLE_SAGA2 -DEFINES += -DENABLE_SAGA2 -endif -endif - -ifdef ENABLE_SCI -DEFINES += -DENABLE_SCI=$(ENABLE_SCI) -MODULES += engines/sci - -ifdef ENABLE_SCI32 -DEFINES += -DENABLE_SCI32 -endif -endif - -ifdef ENABLE_SKY -DEFINES += -DENABLE_SKY=$(ENABLE_SKY) -MODULES += engines/sky -endif - -ifdef ENABLE_SWORD1 -DEFINES += -DENABLE_SWORD1=$(ENABLE_SWORD1) -MODULES += engines/sword1 -endif - -ifdef ENABLE_SWORD2 -DEFINES += -DENABLE_SWORD2=$(ENABLE_SWORD2) -MODULES += engines/sword2 -endif - -ifdef ENABLE_SWORD25 -DEFINES += -DENABLE_SWORD25=$(ENABLE_SWORD25) -MODULES += engines/sword25 -endif - -ifdef ENABLE_TESTBED -DEFINES += -DENABLE_TESTBED=$(ENABLE_TESTBED) -MODULES += engines/testbed -endif - -ifdef ENABLE_TEENAGENT -DEFINES += -DENABLE_TEENAGENT=$(ENABLE_TEENAGENT) -MODULES += engines/teenagent -endif - -ifdef ENABLE_TINSEL -DEFINES += -DENABLE_TINSEL=$(ENABLE_TINSEL) -MODULES += engines/tinsel -endif - -ifdef ENABLE_TOLTECS -DEFINES += -DENABLE_TOLTECS=$(ENABLE_TOLTECS) -MODULES += engines/toltecs -endif - -ifdef ENABLE_TONY -DEFINES += -DENABLE_TONY=$(ENABLE_TONY) -MODULES += engines/tony -endif - -ifdef ENABLE_TOON -DEFINES += -DENABLE_TOON=$(ENABLE_TOON) -MODULES += engines/toon -endif - -ifdef ENABLE_TOUCHE -DEFINES += -DENABLE_TOUCHE=$(ENABLE_TOUCHE) -MODULES += engines/touche -endif - -ifdef ENABLE_TSAGE -DEFINES += -DENABLE_TSAGE=$(ENABLE_TSAGE) -MODULES += engines/tsage -endif - -ifdef ENABLE_TUCKER -DEFINES += -DENABLE_TUCKER=$(ENABLE_TUCKER) -MODULES += engines/tucker -endif - -ifdef ENABLE_WINTERMUTE -DEFINES += -DENABLE_WINTERMUTE=$(ENABLE_WINTERMUTE) -MODULES += engines/wintermute -endif - -ifdef ENABLE_ZVISION -DEFINES += -DENABLE_ZVISION=$(ENABLE_ZVISION) -MODULES += engines/zvision -endif diff --git a/engines/fullpipe/configure.engine b/engines/fullpipe/configure.engine new file mode 100644 index 0000000000..fce5951e26 --- /dev/null +++ b/engines/fullpipe/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine fullpipe "Full Pipe" no diff --git a/engines/gob/configure.engine b/engines/gob/configure.engine new file mode 100644 index 0000000000..8e012f5815 --- /dev/null +++ b/engines/gob/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine gob "Gobli*ns" yes diff --git a/engines/groovie/configure.engine b/engines/groovie/configure.engine new file mode 100644 index 0000000000..84e95a70df --- /dev/null +++ b/engines/groovie/configure.engine @@ -0,0 +1,4 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine groovie "Groovie" yes "groovie2" "7th Guest" +add_engine groovie2 "Groovie 2 games" no "" "" "jpeg" diff --git a/engines/groovie/font.cpp b/engines/groovie/font.cpp index d29c22dd02..a55d8fad95 100644 --- a/engines/groovie/font.cpp +++ b/engines/groovie/font.cpp @@ -112,7 +112,7 @@ bool T7GFont::load(Common::SeekableReadStream &stream) { return true; } -void T7GFont::drawChar(Graphics::Surface *dst, byte chr, int x, int y, uint32 color) const { +void T7GFont::drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const { // We ignore the color, as the font is already colored const Glyph *glyph = getGlyph(chr); const byte *src = glyph->pixels; @@ -125,7 +125,7 @@ void T7GFont::drawChar(Graphics::Surface *dst, byte chr, int x, int y, uint32 co } } -const T7GFont::Glyph *T7GFont::getGlyph(byte chr) const { +const T7GFont::Glyph *T7GFont::getGlyph(uint32 chr) const { assert (chr < 128); byte numGlyph = _mapChar2Glyph[chr]; diff --git a/engines/groovie/font.h b/engines/groovie/font.h index 20aaa4cf23..49cf4b7b06 100644 --- a/engines/groovie/font.h +++ b/engines/groovie/font.h @@ -37,8 +37,8 @@ public: int getFontHeight() const { return _maxHeight; } int getMaxCharWidth() const { return _maxWidth; } - int getCharWidth(byte chr) const { return getGlyph(chr)->width; } - void drawChar(Graphics::Surface *dst, byte chr, int x, int y, uint32 color) const; + int getCharWidth(uint32 chr) const { return getGlyph(chr)->width; } + void drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const; private: int _maxHeight, _maxWidth; @@ -55,7 +55,7 @@ private: byte _mapChar2Glyph[128]; Glyph *_glyphs; - const Glyph *getGlyph(byte chr) const; + const Glyph *getGlyph(uint32 chr) const; }; } // End of Groovie namespace diff --git a/engines/hopkins/configure.engine b/engines/hopkins/configure.engine new file mode 100644 index 0000000000..c38ecd4cd2 --- /dev/null +++ b/engines/hopkins/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine hopkins "Hopkins FBI" yes "" "" "16bit" diff --git a/engines/hugo/configure.engine b/engines/hugo/configure.engine new file mode 100644 index 0000000000..9ab5c54e1e --- /dev/null +++ b/engines/hugo/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine hugo "Hugo Trilogy" yes diff --git a/engines/kyra/configure.engine b/engines/kyra/configure.engine new file mode 100644 index 0000000000..b7d6334fcc --- /dev/null +++ b/engines/kyra/configure.engine @@ -0,0 +1,5 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine kyra "Kyra" yes "lol eob" "Legend of Kyrandia 1-3" +add_engine lol "Lands of Lore" yes +add_engine eob "Eye of the Beholder" yes diff --git a/engines/lastexpress/configure.engine b/engines/lastexpress/configure.engine new file mode 100644 index 0000000000..807b1a088b --- /dev/null +++ b/engines/lastexpress/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine lastexpress "The Last Express" no "" "" "16bit" diff --git a/engines/lure/configure.engine b/engines/lure/configure.engine new file mode 100644 index 0000000000..e9f92893e3 --- /dev/null +++ b/engines/lure/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine lure "Lure of the Temptress" yes diff --git a/engines/made/configure.engine b/engines/made/configure.engine new file mode 100644 index 0000000000..2266712338 --- /dev/null +++ b/engines/made/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine made "MADE" yes diff --git a/engines/mohawk/configure.engine b/engines/mohawk/configure.engine new file mode 100644 index 0000000000..fa9d15cffc --- /dev/null +++ b/engines/mohawk/configure.engine @@ -0,0 +1,6 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine mohawk "Mohawk" yes "cstime myst riven" "Living Books" +add_engine cstime "Where in Time is Carmen Sandiego?" no +add_engine riven "Riven: The Sequel to Myst" no "" "" "16bit" +add_engine myst "Myst" no "" "" "16bit" diff --git a/engines/mortevielle/configure.engine b/engines/mortevielle/configure.engine new file mode 100644 index 0000000000..14d6479e7a --- /dev/null +++ b/engines/mortevielle/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine mortevielle "Mortevielle" no diff --git a/engines/neverhood/configure.engine b/engines/neverhood/configure.engine new file mode 100644 index 0000000000..0767a631f9 --- /dev/null +++ b/engines/neverhood/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine neverhood "Neverhood" no diff --git a/engines/parallaction/configure.engine b/engines/parallaction/configure.engine new file mode 100644 index 0000000000..babca4579f --- /dev/null +++ b/engines/parallaction/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine parallaction "Parallaction" yes diff --git a/engines/pegasus/configure.engine b/engines/pegasus/configure.engine new file mode 100644 index 0000000000..ed7e295287 --- /dev/null +++ b/engines/pegasus/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine pegasus "The Journeyman Project: Pegasus Prime" yes "" "" "16bit" diff --git a/engines/plugins_table.h b/engines/plugins_table.h deleted file mode 100644 index 38cd43ac74..0000000000 --- a/engines/plugins_table.h +++ /dev/null @@ -1,130 +0,0 @@ -// This file is being included by "base/plugins.cpp" -#if PLUGIN_ENABLED_STATIC(SCUMM) -LINK_PLUGIN(SCUMM) -#endif -#if PLUGIN_ENABLED_STATIC(AGI) -LINK_PLUGIN(AGI) -#endif -#if PLUGIN_ENABLED_STATIC(AGOS) -LINK_PLUGIN(AGOS) -#endif -#if PLUGIN_ENABLED_STATIC(AVALANCHE) -LINK_PLUGIN(AVALANCHE) -#endif -#if PLUGIN_ENABLED_STATIC(CGE) -LINK_PLUGIN(CGE) -#endif -#if PLUGIN_ENABLED_STATIC(CINE) -LINK_PLUGIN(CINE) -#endif -#if PLUGIN_ENABLED_STATIC(COMPOSER) -LINK_PLUGIN(COMPOSER) -#endif -#if PLUGIN_ENABLED_STATIC(CRUISE) -LINK_PLUGIN(CRUISE) -#endif -#if PLUGIN_ENABLED_STATIC(DRACI) -LINK_PLUGIN(DRACI) -#endif -#if PLUGIN_ENABLED_STATIC(DRASCULA) -LINK_PLUGIN(DRASCULA) -#endif -#if PLUGIN_ENABLED_STATIC(DREAMWEB) -LINK_PLUGIN(DREAMWEB) -#endif -#if PLUGIN_ENABLED_STATIC(FULLPIPE) -LINK_PLUGIN(FULLPIPE) -#endif -#if PLUGIN_ENABLED_STATIC(GOB) -LINK_PLUGIN(GOB) -#endif -#if PLUGIN_ENABLED_STATIC(GROOVIE) -LINK_PLUGIN(GROOVIE) -#endif -#if PLUGIN_ENABLED_STATIC(HOPKINS) -LINK_PLUGIN(HOPKINS) -#endif -#if PLUGIN_ENABLED_STATIC(HUGO) -LINK_PLUGIN(HUGO) -#endif -#if PLUGIN_ENABLED_STATIC(KYRA) -LINK_PLUGIN(KYRA) -#endif -#if PLUGIN_ENABLED_STATIC(MORTEVIELLE) -LINK_PLUGIN(MORTEVIELLE) -#endif -#if PLUGIN_ENABLED_STATIC(LASTEXPRESS) -LINK_PLUGIN(LASTEXPRESS) -#endif -#if PLUGIN_ENABLED_STATIC(LURE) -LINK_PLUGIN(LURE) -#endif -#if PLUGIN_ENABLED_STATIC(MADE) -LINK_PLUGIN(MADE) -#endif -#if PLUGIN_ENABLED_STATIC(MOHAWK) -LINK_PLUGIN(MOHAWK) -#endif -#if PLUGIN_ENABLED_STATIC(NEVERHOOD) -LINK_PLUGIN(NEVERHOOD) -#endif -#if PLUGIN_ENABLED_STATIC(PARALLACTION) -LINK_PLUGIN(PARALLACTION) -#endif -#if PLUGIN_ENABLED_STATIC(PEGASUS) -LINK_PLUGIN(PEGASUS) -#endif -#if PLUGIN_ENABLED_STATIC(QUEEN) -LINK_PLUGIN(QUEEN) -#endif -#if PLUGIN_ENABLED_STATIC(SAGA) -LINK_PLUGIN(SAGA) -#endif -#if PLUGIN_ENABLED_STATIC(SCI) -LINK_PLUGIN(SCI) -#endif -#if PLUGIN_ENABLED_STATIC(SKY) -LINK_PLUGIN(SKY) -#endif -#if PLUGIN_ENABLED_STATIC(SWORD1) -LINK_PLUGIN(SWORD1) -#endif -#if PLUGIN_ENABLED_STATIC(SWORD2) -LINK_PLUGIN(SWORD2) -#endif -#if PLUGIN_ENABLED_STATIC(SWORD25) -LINK_PLUGIN(SWORD25) -#endif -#if PLUGIN_ENABLED_STATIC(TEENAGENT) -LINK_PLUGIN(TEENAGENT) -#endif -#if PLUGIN_ENABLED_STATIC(TESTBED) -LINK_PLUGIN(TESTBED) -#endif -#if PLUGIN_ENABLED_STATIC(TINSEL) -LINK_PLUGIN(TINSEL) -#endif -#if PLUGIN_ENABLED_STATIC(TOLTECS) -LINK_PLUGIN(TOLTECS) -#endif -#if PLUGIN_ENABLED_STATIC(TONY) -LINK_PLUGIN(TONY) -#endif -#if PLUGIN_ENABLED_STATIC(TOON) -LINK_PLUGIN(TOON) -#endif -#if PLUGIN_ENABLED_STATIC(TSAGE) -LINK_PLUGIN(TSAGE) -#endif -#if PLUGIN_ENABLED_STATIC(TOUCHE) -LINK_PLUGIN(TOUCHE) -#endif -#if PLUGIN_ENABLED_STATIC(TUCKER) -LINK_PLUGIN(TUCKER) -#endif -#if PLUGIN_ENABLED_STATIC(WINTERMUTE) -LINK_PLUGIN(WINTERMUTE) -#endif -#if PLUGIN_ENABLED_STATIC(ZVISION) -LINK_PLUGIN(ZVISION) -#endif diff --git a/engines/queen/configure.engine b/engines/queen/configure.engine new file mode 100644 index 0000000000..c8766743f9 --- /dev/null +++ b/engines/queen/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine queen "Flight of the Amazon Queen" yes diff --git a/engines/saga/configure.engine b/engines/saga/configure.engine new file mode 100644 index 0000000000..99e2ab367b --- /dev/null +++ b/engines/saga/configure.engine @@ -0,0 +1,5 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine saga "SAGA" yes "ihnm saga2" "ITE" +add_engine ihnm "IHNM" yes +add_engine saga2 "SAGA 2 games" no diff --git a/engines/sci/configure.engine b/engines/sci/configure.engine new file mode 100644 index 0000000000..d1c45a4654 --- /dev/null +++ b/engines/sci/configure.engine @@ -0,0 +1,4 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine sci "SCI" yes "sci32" "SCI 0-1.1 games" +add_engine sci32 "SCI32 games" no diff --git a/engines/scumm/configure.engine b/engines/scumm/configure.engine new file mode 100644 index 0000000000..e1de788061 --- /dev/null +++ b/engines/scumm/configure.engine @@ -0,0 +1,5 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine scumm "SCUMM" yes "scumm_7_8 he" "v0-v6 games" +add_engine scumm_7_8 "v7 & v8 games" yes +add_engine he "HE71+ games" yes diff --git a/engines/sky/configure.engine b/engines/sky/configure.engine new file mode 100644 index 0000000000..32b84849cb --- /dev/null +++ b/engines/sky/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine sky "Beneath a Steel Sky" yes diff --git a/engines/sword1/configure.engine b/engines/sword1/configure.engine new file mode 100644 index 0000000000..0578d176a9 --- /dev/null +++ b/engines/sword1/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine sword1 "Broken Sword" yes diff --git a/engines/sword2/configure.engine b/engines/sword2/configure.engine new file mode 100644 index 0000000000..7153605433 --- /dev/null +++ b/engines/sword2/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine sword2 "Broken Sword II" yes diff --git a/engines/sword25/configure.engine b/engines/sword25/configure.engine new file mode 100644 index 0000000000..1729bbeb33 --- /dev/null +++ b/engines/sword25/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine sword25 "Broken Sword 2.5" no "" "" "png zlib 16bit" diff --git a/engines/teenagent/configure.engine b/engines/teenagent/configure.engine new file mode 100644 index 0000000000..223a0e884c --- /dev/null +++ b/engines/teenagent/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine teenagent "Teen Agent" yes diff --git a/engines/testbed/configure.engine b/engines/testbed/configure.engine new file mode 100644 index 0000000000..c0a68c8eb8 --- /dev/null +++ b/engines/testbed/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine testbed "TestBed: the Testing framework" no diff --git a/engines/tinsel/configure.engine b/engines/tinsel/configure.engine new file mode 100644 index 0000000000..c0f3e0a18d --- /dev/null +++ b/engines/tinsel/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine tinsel "Tinsel" yes diff --git a/engines/toltecs/configure.engine b/engines/toltecs/configure.engine new file mode 100644 index 0000000000..be5533efa2 --- /dev/null +++ b/engines/toltecs/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine toltecs "3 Skulls of the Toltecs" yes diff --git a/engines/tony/configure.engine b/engines/tony/configure.engine new file mode 100644 index 0000000000..f85f45d158 --- /dev/null +++ b/engines/tony/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine tony "Tony Tough and the Night of Roasted Moths" yes "" "" "16bit" diff --git a/engines/toon/configure.engine b/engines/toon/configure.engine new file mode 100644 index 0000000000..00c98f7d8a --- /dev/null +++ b/engines/toon/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine toon "Toonstruck" yes diff --git a/engines/touche/configure.engine b/engines/touche/configure.engine new file mode 100644 index 0000000000..777578e623 --- /dev/null +++ b/engines/touche/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine touche "Touche: The Adventures of the Fifth Musketeer" yes diff --git a/engines/tsage/configure.engine b/engines/tsage/configure.engine new file mode 100644 index 0000000000..2b8edf8266 --- /dev/null +++ b/engines/tsage/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine tsage "TsAGE" yes diff --git a/engines/tucker/configure.engine b/engines/tucker/configure.engine new file mode 100644 index 0000000000..06676cf0a4 --- /dev/null +++ b/engines/tucker/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine tucker "Bud Tucker in Double Trouble" yes diff --git a/engines/wintermute/base/font/base_font_truetype.cpp b/engines/wintermute/base/font/base_font_truetype.cpp index d6f09141c9..b879e789e3 100644 --- a/engines/wintermute/base/font/base_font_truetype.cpp +++ b/engines/wintermute/base/font/base_font_truetype.cpp @@ -121,7 +121,7 @@ int BaseFontTT::getTextWidth(const byte *text, int maxLength) { } if (maxLength >= 0 && textStr.size() > (uint32)maxLength) { - textStr = Common::String(textStr.c_str(), (uint32)maxLength); + textStr = WideString(textStr.c_str(), (uint32)maxLength); } //text = text.substr(0, MaxLength); // TODO: Remove @@ -155,19 +155,19 @@ void BaseFontTT::drawText(const byte *text, int x, int y, int width, TTextAlign return; } - WideString textStr = (const char *)text; + WideString textStr; // TODO: Why do we still insist on Widestrings everywhere? - /* if (_gameRef->_textEncoding == TEXT_UTF8) text = StringUtil::Utf8ToWide((char *)Text); - else text = StringUtil::AnsiToWide((char *)Text);*/ // HACK: J.U.L.I.A. uses CP1252, we need to fix that, // And we still don't have any UTF8-support. - if (_gameRef->_textEncoding != TEXT_UTF8) { + if (_gameRef->_textEncoding == TEXT_UTF8) { + textStr = StringUtil::utf8ToWide((const char *)text); + } else { textStr = StringUtil::ansiToWide((const char *)text); } if (maxLength >= 0 && textStr.size() > (uint32)maxLength) { - textStr = Common::String(textStr.c_str(), (uint32)maxLength); + textStr = WideString(textStr.c_str(), (uint32)maxLength); } //text = text.substr(0, MaxLength); // TODO: Remove @@ -248,7 +248,7 @@ BaseSurface *BaseFontTT::renderTextToTexture(const WideString &text, int width, //TextLineList lines; // TODO: Use WideString-conversion here. //WrapText(text, width, maxHeight, lines); - Common::Array<Common::String> lines; + Common::Array<WideString> lines; _font->wordWrapText(text, width, lines); while (maxHeight > 0 && lines.size() * _lineHeight > maxHeight) { @@ -267,7 +267,8 @@ BaseSurface *BaseFontTT::renderTextToTexture(const WideString &text, int width, alignment = Graphics::kTextAlignRight; } - debugC(kWintermuteDebugFont, "%s %d %d %d %d", text.c_str(), RGBCOLGetR(_layers[0]->_color), RGBCOLGetG(_layers[0]->_color), RGBCOLGetB(_layers[0]->_color), RGBCOLGetA(_layers[0]->_color)); + // TODO: This debug call does not work with WideString because text.c_str() returns an uint32 array. + //debugC(kWintermuteDebugFont, "%s %d %d %d %d", text.c_str(), RGBCOLGetR(_layers[0]->_color), RGBCOLGetG(_layers[0]->_color), RGBCOLGetB(_layers[0]->_color), RGBCOLGetA(_layers[0]->_color)); // void drawString(Surface *dst, const Common::String &str, int x, int y, int w, uint32 color, TextAlign align = kTextAlignLeft, int deltax = 0, bool useEllipsis = true) const; Graphics::Surface *surface = new Graphics::Surface(); if (_deletableFont) { // We actually have a TTF @@ -276,7 +277,7 @@ BaseSurface *BaseFontTT::renderTextToTexture(const WideString &text, int width, surface->create((uint16)width, (uint16)(_lineHeight * lines.size()), Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0)); } uint32 useColor = 0xffffffff; - Common::Array<Common::String>::iterator it; + Common::Array<WideString>::iterator it; int heightOffset = 0; for (it = lines.begin(); it != lines.end(); ++it) { _font->drawString(surface, *it, 0, heightOffset, width, useColor, alignment); @@ -647,9 +648,9 @@ void BaseFontTT::measureText(const WideString &text, int maxWidth, int maxHeight //TextLineList lines; if (maxWidth >= 0) { - Common::Array<Common::String> lines; + Common::Array<WideString> lines; _font->wordWrapText(text, maxWidth, lines); - Common::Array<Common::String>::iterator it; + Common::Array<WideString>::iterator it; textWidth = 0; for (it = lines.begin(); it != lines.end(); ++it) { textWidth = MAX(textWidth, _font->getStringWidth(*it)); diff --git a/engines/wintermute/base/font/base_font_truetype.h b/engines/wintermute/base/font/base_font_truetype.h index 7a96cdf1b7..edb41a155f 100644 --- a/engines/wintermute/base/font/base_font_truetype.h +++ b/engines/wintermute/base/font/base_font_truetype.h @@ -56,9 +56,8 @@ private: bool _marked; uint32 _lastUsed; - BaseCachedTTFontText() { + BaseCachedTTFontText() : _text() { //_text = L""; - _text = ""; _width = _maxHeight = _maxLength = -1; _align = TAL_LEFT; _surface = nullptr; diff --git a/engines/wintermute/base/scriptables/script_ext_string.cpp b/engines/wintermute/base/scriptables/script_ext_string.cpp index b6d284442d..65bec03bc1 100644 --- a/engines/wintermute/base/scriptables/script_ext_string.cpp +++ b/engines/wintermute/base/scriptables/script_ext_string.cpp @@ -298,21 +298,13 @@ bool SXString::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack uint32 start = 0; for(uint32 i = 0; i < str.size() + 1; i++) { - char ch = str.c_str()[i]; - if(ch=='\0' || delims.contains(ch)) - { - char *part = new char[i - start + 1]; - if(i != start) { - Common::strlcpy(part, str.c_str() + start, i - start + 1); - part[i - start] = '\0'; + uint32 ch = str[i]; + if (ch =='\0' || delims.contains(ch)) { + if (i != start) { + parts.push_back(WideString(str.c_str() + start, i - start + 1)); } else { - part[0] = '\0'; + parts.push_back(WideString()); } - val = new ScValue(_gameRef, part); - array->push(val); - delete[] part; - delete val; - val = nullptr; start = i + 1; } } diff --git a/engines/wintermute/configure.engine b/engines/wintermute/configure.engine new file mode 100644 index 0000000000..673549b46b --- /dev/null +++ b/engines/wintermute/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine wintermute "Wintermute" no "" "" "jpeg png zlib vorbis 16bit" diff --git a/engines/wintermute/dctypes.h b/engines/wintermute/dctypes.h index b40322147f..4371ee4889 100644 --- a/engines/wintermute/dctypes.h +++ b/engines/wintermute/dctypes.h @@ -31,6 +31,7 @@ #include "common/str.h" +#include "common/ustr.h" #include "common/list.h" #include "common/array.h" @@ -41,7 +42,7 @@ namespace Wintermute { //typedef std::wstring WideString; typedef Common::String AnsiString; typedef Common::String Utf8String; -typedef Common::String WideString; // NB: Not actually true I presume. +typedef Common::U32String WideString; typedef Common::List<WideString> WideStringList; typedef Common::List<AnsiString> AnsiStringList; diff --git a/engines/wintermute/utils/string_util.cpp b/engines/wintermute/utils/string_util.cpp index d5d6c7f702..702dd04c27 100644 --- a/engines/wintermute/utils/string_util.cpp +++ b/engines/wintermute/utils/string_util.cpp @@ -48,201 +48,96 @@ bool StringUtil::compareNoCase(const AnsiString &str1, const AnsiString &str2) { return (str1lc == str2lc); }*/ -Common::String StringUtil::substituteUtf8Characters(Common::String &str) { - uint strSize = str.size(); - Common::String punctuation("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"); - - if (isAscii(str)) - return str; - - for (uint32 i = 0; i < strSize; i++) { - if (!Common::isAlnum(str[i]) && str[i] != ' ' && !punctuation.contains(str[i])) { - // Replace some UTF-8 characters with (almost) equivalent ANSII ones - if ((byte)str[i] == 0xc2 && i + 1 < str.size() && (byte)str[i + 1] == 0xa9) { - // UTF-8 copyright character, substitute with 'c' - str.deleteChar(i); - str.setChar('c', i); - strSize--; - } - } - } - - return str; -} - -bool StringUtil::isAscii(const Common::String &str) { - Common::String punctuation("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"); - - for (uint32 i = 0; i < str.size(); i++) { - if (!Common::isAlnum(str[i]) && str[i] != ' ' && !punctuation.contains(str[i])) - return false; - } - - return true; -} - ////////////////////////////////////////////////////////////////////////// WideString StringUtil::utf8ToWide(const Utf8String &Utf8Str) { - // WORKAROUND: Since wide strings aren't supported yet, we make this function - // work at least with ASCII strings. This should cover all English versions. - Common::String asciiString = Utf8Str; - asciiString = substituteUtf8Characters(asciiString); - if (isAscii(asciiString)) { - // No special (UTF-8) characters found, just return the string - return asciiString; - } else { - warning("String contains special (UTF-8) characters: '%s'", Utf8Str.c_str()); - } - - error("StringUtil::Utf8ToWide - WideString not supported yet for UTF-8 characters"); - - /* size_t WideSize = Utf8Str.size(); - - if (sizeof(wchar_t) == 2) { - wchar_t *WideStringNative = new wchar_t[WideSize + 1]; - - const UTF8 *SourceStart = reinterpret_cast<const UTF8 *>(Utf8Str.c_str()); - const UTF8 *SourceEnd = SourceStart + WideSize; + size_t wideSize = Utf8Str.size(); - UTF16 *TargetStart = reinterpret_cast<UTF16 *>(WideStringNative); - UTF16 *TargetEnd = TargetStart + WideSize + 1; + uint32 *wideStringNative = new uint32[wideSize + 1]; - ConversionResult res = ConvertUTF8toUTF16(&SourceStart, SourceEnd, &TargetStart, TargetEnd, strictConversion); - if (res != conversionOK) { - delete[] WideStringNative; - return L""; - } - *TargetStart = 0; - WideString ResultString(WideStringNative); - delete[] WideStringNative; + const UTF8 *sourceStart = reinterpret_cast<const UTF8 *>(Utf8Str.c_str()); + const UTF8 *sourceEnd = sourceStart + wideSize; - return ResultString; - } else if (sizeof(wchar_t) == 4) { - wchar_t *WideStringNative = new wchar_t[WideSize + 1]; + UTF32 *targetStart = reinterpret_cast<UTF32 *>(wideStringNative); + UTF32 *targetEnd = targetStart + wideSize; - const UTF8 *SourceStart = reinterpret_cast<const UTF8 *>(Utf8Str.c_str()); - const UTF8 *SourceEnd = SourceStart + WideSize; - - UTF32 *TargetStart = reinterpret_cast<UTF32 *>(WideStringNative); - UTF32 *TargetEnd = TargetStart + WideSize; - - ConversionResult res = ConvertUTF8toUTF32(&SourceStart, SourceEnd, &TargetStart, TargetEnd, strictConversion); - if (res != conversionOK) { - delete[] WideStringNative; - return L""; - } - *TargetStart = 0; - WideString ResultString(WideStringNative); - delete[] WideStringNative; - - return ResultString; - } else { - return L""; - }*/ - return ""; + ConversionResult res = ConvertUTF8toUTF32(&sourceStart, sourceEnd, &targetStart, targetEnd, strictConversion); + if (res != conversionOK) { + delete[] wideStringNative; + return WideString(); + } + *targetStart = 0; + WideString resultString(wideStringNative); + delete[] wideStringNative; + return resultString; } ////////////////////////////////////////////////////////////////////////// Utf8String StringUtil::wideToUtf8(const WideString &WideStr) { - // WORKAROUND: Since UTF-8 strings aren't supported yet, we make this function - // work at least with ASCII strings. This should cover all English versions. - Common::String asciiString = WideStr; - asciiString = substituteUtf8Characters(asciiString); - if (isAscii(asciiString)) { - // No special (UTF-8) characters found, just return the string - return asciiString; - } else { - warning("String contains special (UTF-8) characters: '%s'", WideStr.c_str()); - } + size_t wideSize = WideStr.size(); - error("StringUtil::wideToUtf8 - WideString not supported yet for UTF-8 characters"); - - /* size_t WideSize = WideStr.length(); + size_t utf8Size = 4 * wideSize + 1; + char *utf8StringNative = new char[utf8Size]; - if (sizeof(wchar_t) == 2) { - size_t utf8Size = 3 * WideSize + 1; - char *utf8StringNative = new char[Utf8Size]; + const UTF32 *sourceStart = reinterpret_cast<const UTF32 *>(WideStr.c_str()); + const UTF32 *sourceEnd = sourceStart + wideSize; - const UTF16 *SourceStart = reinterpret_cast<const UTF16 *>(WideStr.c_str()); - const UTF16 *SourceEnd = SourceStart + WideSize; + UTF8 *targetStart = reinterpret_cast<UTF8 *>(utf8StringNative); + UTF8 *targetEnd = targetStart + utf8Size; - UTF8 *TargetStart = reinterpret_cast<UTF8 *>(Utf8StringNative); - UTF8 *TargetEnd = TargetStart + Utf8Size; - - ConversionResult res = ConvertUTF16toUTF8(&SourceStart, SourceEnd, &TargetStart, TargetEnd, strictConversion); - if (res != conversionOK) { - delete[] Utf8StringNative; - return (Utf8String)""; - } - *TargetStart = 0; - Utf8String ResultString(Utf8StringNative); - delete[] Utf8StringNative; - return ResultString; - } else if (sizeof(wchar_t) == 4) { - size_t utf8Size = 4 * WideSize + 1; - char *utf8StringNative = new char[Utf8Size]; - - const UTF32 *SourceStart = reinterpret_cast<const UTF32 *>(WideStr.c_str()); - const UTF32 *SourceEnd = SourceStart + WideSize; - - UTF8 *TargetStart = reinterpret_cast<UTF8 *>(Utf8StringNative); - UTF8 *TargetEnd = TargetStart + Utf8Size; - - ConversionResult res = ConvertUTF32toUTF8(&SourceStart, SourceEnd, &TargetStart, TargetEnd, strictConversion); - if (res != conversionOK) { - delete[] Utf8StringNative; - return (Utf8String)""; - } - *TargetStart = 0; - Utf8String ResultString(Utf8StringNative); - delete[] Utf8StringNative; - return ResultString; - } else { - return (Utf8String)""; - }*/ - return ""; + ConversionResult res = ConvertUTF32toUTF8(&sourceStart, sourceEnd, &targetStart, targetEnd, strictConversion); + if (res != conversionOK) { + delete[] utf8StringNative; + return Utf8String(); + } + *targetStart = 0; + Utf8String resultString(utf8StringNative); + delete[] utf8StringNative; + return resultString; } ////////////////////////////////////////////////////////////////////////// WideString StringUtil::ansiToWide(const AnsiString &str) { - // TODO: This function gets called a lot, so warnings like these drown out the usefull information - Common::String converted = ""; - uint32 index = 0; - while (index != str.size()) { - byte c = str[index]; - if (c == 146) { - converted += (char)39; // Replace right-quote with apostrophe - } else if (c == 133) { - converted += Common::String("..."); // Replace ...-symbol with ... + WideString result; + for (AnsiString::const_iterator i = str.begin(), end = str.end(); i != end; ++i) { + const byte c = *i; + if (c < 0x80 || c >= 0xA0) { + result += c; } else { - converted += c; + uint32 utf32 = _ansiToUTF32[c - 0x80]; + if (utf32) { + result += utf32; + } else { + // It's an invalid CP1252 character... + } } - index++; } - // using default os locale! - - /* setlocale(LC_CTYPE, ""); - size_t wideSize = mbstowcs(NULL, str.c_str(), 0) + 1; - wchar_t *wstr = new wchar_t[WideSize]; - mbstowcs(wstr, str.c_str(), WideSize); - WideString ResultString(wstr); - delete[] wstr; - return ResultString;*/ - return WideString(converted); + return result; } ////////////////////////////////////////////////////////////////////////// AnsiString StringUtil::wideToAnsi(const WideString &wstr) { - // using default os locale! - // TODO: This function gets called a lot, so warnings like these drown out the usefull information - /* setlocale(LC_CTYPE, ""); - size_t wideSize = wcstombs(NULL, wstr.c_str(), 0) + 1; - char *str = new char[WideSize]; - wcstombs(str, wstr.c_str(), WideSize); - AnsiString ResultString(str); - delete[] str; - return ResultString;*/ - return AnsiString(wstr); + AnsiString result; + for (WideString::const_iterator i = wstr.begin(), end = wstr.end(); i != end; ++i) { + const uint32 c = *i; + if (c < 0x80 || (c >= 0xA0 && c <= 0xFF)) { + result += c; + } else { + uint32 ansi = 0xFFFFFFFF; + for (uint j = 0; j < ARRAYSIZE(_ansiToUTF32); ++j) { + if (_ansiToUTF32[j] == c) { + ansi = j + 0x80; + break; + } + } + + if (ansi != 0xFFFFFFFF) { + result += ansi; + } else { + // There's no valid CP1252 code for this character... + } + } + } + return result; } ////////////////////////////////////////////////////////////////////////// @@ -256,12 +151,7 @@ bool StringUtil::isUtf8BOM(const byte *buffer, uint32 bufferSize) { ////////////////////////////////////////////////////////////////////////// int StringUtil::indexOf(const WideString &str, const WideString &toFind, size_t startFrom) { - const char *index = strstr(str.c_str(), toFind.c_str()); - if (index == nullptr) { - return -1; - } else { - return index - str.c_str(); - } + return str.find(toFind, startFrom); } Common::String StringUtil::encodeSetting(const Common::String &str) { @@ -282,5 +172,10 @@ AnsiString StringUtil::toString(int val) { return Common::String::format("%d", val); } +// Mapping of CP1252 characters 0x80...0x9F into UTF-32 +uint32 StringUtil::_ansiToUTF32[32] = { + 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x017D, 0x0000, + 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x017E, 0x0178 +}; } // End of namespace Wintermute diff --git a/engines/wintermute/utils/string_util.h b/engines/wintermute/utils/string_util.h index 05931beb79..14c40fcb2b 100644 --- a/engines/wintermute/utils/string_util.h +++ b/engines/wintermute/utils/string_util.h @@ -37,8 +37,6 @@ class StringUtil { public: static bool compareNoCase(const AnsiString &str1, const AnsiString &str2); //static bool compareNoCase(const WideString &str1, const WideString &str2); - static bool isAscii(const Common::String &str); - static Common::String substituteUtf8Characters(Common::String &str); static WideString utf8ToWide(const Utf8String &Utf8Str); static Utf8String wideToUtf8(const WideString &WideStr); static WideString ansiToWide(const AnsiString &str); @@ -51,6 +49,9 @@ public: static Common::String decodeSetting(const Common::String &str); static AnsiString toString(int val); + +private: + static uint32 _ansiToUTF32[32]; }; } // End of namespace Wintermute diff --git a/engines/zvision/configure.engine b/engines/zvision/configure.engine new file mode 100644 index 0000000000..02e31943af --- /dev/null +++ b/engines/zvision/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine zvision "ZVision" no "" "" "freetype2 16bit" |