Ticket #8647: title_translation.diff
File title_translation.diff, 1.7 KB (added by , 18 years ago) |
---|
-
base/game.h
29 29 #include "common/array.h" 30 30 #include "common/hash-str.h" 31 31 32 struct GameTitleTranslation { 33 Common::Language language; 34 const char *title; 35 }; 36 37 #define END_TRANS {Common::UNK_LANG, NULL} 38 #define NO_TRANS {END_TRANS} 39 32 40 struct PlainGameDescriptor { 33 41 const char *gameid; 34 42 const char *description; // TODO: Rename this to "title" or so 43 GameTitleTranslation translations[10]; 35 44 }; 36 45 37 46 class GameDescriptor : public Common::StringMap { … … 91 100 // TODO: Find a better place for this function. 92 101 GameDescriptor findGame(const Common::String &gameName, const Plugin **plugin = NULL); 93 102 103 const char* getGameTitle(const PlainGameDescriptor &pgd, Common::Language l); 104 94 105 } // End of namespace Base 95 106 96 107 -
base/game.cpp
77 77 return result; 78 78 } 79 79 80 const char* getGameTitle(const PlainGameDescriptor &pgd, Common::Language l) { 81 const GameTitleTranslation *trans = pgd.translations; 82 while (trans->language != Common::UNK_LANG) { 83 if (trans->language == l) 84 return trans->title; 85 trans++; 86 } 87 88 return pgd.description; 89 } 90 80 91 } // End of namespace Base -
common/advancedDetector.cpp
123 123 124 124 while (sg->gameid) { 125 125 if (!scumm_stricmp(g.gameid, sg->gameid)) 126 title = sg->description;126 title = Base::getGameTitle(*sg, g.language); 127 127 sg++; 128 128 } 129 129