ALL: synced with scummvm

This commit is contained in:
Pawel Kolodziejski 2012-04-07 17:58:15 +02:00
parent bf5c20d369
commit 78bacb47bb
19 changed files with 145 additions and 136 deletions

2
TODO
View File

@ -1,3 +1,3 @@
You may find it at the following link:
http://wiki.residualvm.org/index.php?title=TODO
http://wiki.residualvm.org/index.php/TODO

View File

@ -72,7 +72,6 @@ public:
virtual Common::List<Graphics::PixelFormat> getSupportedFormats() const;
#endif
virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format = NULL);
// ResidualVM specific method
virtual void launcherInitSize(uint w, uint h);
// ResidualVM specific method
@ -107,7 +106,6 @@ public:
virtual void warpMouse(int x, int y);
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL);
virtual void setCursorPalette(const byte *colors, uint start, uint num);
// ResidualVM specific method
virtual bool lockMouse(bool lock);

View File

@ -206,8 +206,8 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const
// Initialize any game-specific keymaps
engine->initKeymap();
// Set default values to the custom engine options
const ExtraGuiOptions engineOptions = (*plugin)->getExtraGuiOptions(ConfMan.getActiveDomainName());
// Set default values for all of the custom engine options
const ExtraGuiOptions engineOptions = (*plugin)->getExtraGuiOptions(Common::String());
for (uint i = 0; i < engineOptions.size(); i++) {
ConfMan.registerDefault(engineOptions[i].configOption, engineOptions[i].defaultState);
}

View File

@ -52,7 +52,6 @@ const struct GameOpt {
{ GUIO_MIDIGM, "midiGM" },
{ GUIO_NOASPECT, "noAspect" },
{ GUIO_EGAUNDITHER, "egaUndither" },
{ GUIO_RENDERHERCGREEN, "hercGreen" },
{ GUIO_RENDERHERCAMBER, "hercAmber" },

View File

@ -44,7 +44,6 @@
#define GUIO_MIDIGM "\021"
#define GUIO_NOASPECT "\022"
#define GUIO_EGAUNDITHER "\023"
#define GUIO_RENDERHERCGREEN "\030"
#define GUIO_RENDERHERCAMBER "\031"

View File

@ -171,12 +171,21 @@ const ExtraGuiOptions AdvancedMetaEngine::getExtraGuiOptions(const Common::Strin
if (!_extraGuiOptions)
return ExtraGuiOptions();
ExtraGuiOptions options;
// If there isn't any target specified, return all available GUI options.
// Only used when an engine starts in order to set option defaults.
if (target.empty()) {
for (const ADExtraGuiOptionsMap *entry = _extraGuiOptions; entry->guioFlag; ++entry)
options.push_back(entry->option);
return options;
}
// Query the GUI options
const Common::String guiOptionsString = ConfMan.get("guioptions", target);
const Common::String guiOptions = parseGameGUIOptions(guiOptionsString);
ExtraGuiOptions options;
// Add all the applying extra GUI options.
for (const ADExtraGuiOptionsMap *entry = _extraGuiOptions; entry->guioFlag; ++entry) {
if (guiOptions.contains(entry->guioFlag))

View File

@ -295,7 +295,7 @@ Graphics::Surface *Surface::convertTo(const PixelFormat &dstFormat, const byte *
assert(palette);
for (int y = 0; y < h; y++) {
const byte *srcRow = (byte *)getBasePtr(0, y);
const byte *srcRow = (const byte *)getBasePtr(0, y);
byte *dstRow = (byte *)surface->getBasePtr(0, y);
for (int x = 0; x < w; x++) {
@ -317,7 +317,7 @@ Graphics::Surface *Surface::convertTo(const PixelFormat &dstFormat, const byte *
} else {
// Converting from high color to high color
for (int y = 0; y < h; y++) {
const byte *srcRow = (byte *)getBasePtr(0, y);
const byte *srcRow = (const byte *)getBasePtr(0, y);
byte *dstRow = (byte *)surface->getBasePtr(0, y);
for (int x = 0; x < w; x++) {

View File

@ -35,7 +35,7 @@
#include "graphics/pixelformat.h"
#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.10"
#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.11"
class OSystem;

View File

@ -367,8 +367,7 @@ void EditGameDialog::open() {
e = ConfMan.hasKey("gfx_mode", _domain) ||
ConfMan.hasKey("render_mode", _domain) ||
ConfMan.hasKey("fullscreen", _domain) ||
ConfMan.hasKey("aspect_ratio", _domain) ||
ConfMan.hasKey("disable_dithering", _domain);
ConfMan.hasKey("aspect_ratio", _domain);
_globalGraphicsOverride->setState(e);
e = ConfMan.hasKey("music_driver", _domain) ||

View File

@ -34,7 +34,9 @@
#include "common/file.h"
#include "common/savefile.h"
using namespace Common;
#ifdef __DS__
#include "backends/platform/ds/arm9/source/wordcompletion.h"
#endif
namespace GUI {
@ -372,8 +374,14 @@ void PredictiveDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 d
void PredictiveDialog::processBtnActive(ButtonId button) {
uint8 x;
const char *buttonStr[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" };
const char *buttons[] = {
static const char *const buttonStr[] = {
"1", "2", "3",
"4", "5", "6",
"7", "8", "9",
"0"
};
static const char *const buttons[] = {
"'-.&", "abc", "def",
"ghi", "jkl", "mno",
"pqrs", "tuv", "wxyz",
@ -425,13 +433,13 @@ void PredictiveDialog::processBtnActive(ButtonId button) {
if (_currentCode.size()) {
_repeatcount[_currentCode.size() - 1] = 0;
_currentCode.deleteLastChar();
if(_currentCode == Common::String(""))
if (_currentCode.empty())
_currentWord.clear();
} else {
if (_prefix.size())
_prefix.deleteLastChar();
}
} else if (_prefix.size() + _currentCode.size() < MAXWORDLEN - 1) { // don't overflow the dialog line
} else if (_prefix.size() + _currentCode.size() < kMaxWordLen - 1) { // don't overflow the dialog line
if (button == kBtn0Act) { // zero
_currentCode += buttonStr[9];
} else {
@ -461,9 +469,9 @@ void PredictiveDialog::processBtnActive(ButtonId button) {
if (_mode == kModePre) {
if (_unitedDict.dictActLine && _numMatchingWords > 1) {
_wordNumber = (_wordNumber + 1) % _numMatchingWords;
char tmp[MAXLINELEN];
strncpy(tmp, _unitedDict.dictActLine, MAXLINELEN);
tmp[MAXLINELEN - 1] = 0;
char tmp[kMaxLineLen];
strncpy(tmp, _unitedDict.dictActLine, kMaxLineLen);
tmp[kMaxLineLen - 1] = 0;
char *tok = strtok(tmp, " ");
for (uint8 i = 0; i <= _wordNumber; i++)
tok = strtok(NULL, " ");
@ -490,8 +498,6 @@ void PredictiveDialog::processBtnActive(ButtonId button) {
// bring MRU word at the top of the list when ok'ed out of the dialog
if (_mode == kModePre && _unitedDict.dictActLine && _numMatchingWords > 1 && _wordNumber != 0)
bringWordtoTop(_unitedDict.dictActLine, _wordNumber);
goto press;
} else if (button == kModeAct) { // Mode
_mode++;
_addBtn->setEnabled(false);
@ -499,8 +505,14 @@ void PredictiveDialog::processBtnActive(ButtonId button) {
_mode = kModePre;
// I18N: Pre means 'Predictive', leave '*' as is
_modebutton->setLabel("* Pre");
// I18N: 'Num' means Numbers, 'Abc' means Latin alphabet input
} else (_mode == kModeNum) ? _modebutton->setLabel("* Num") : (_modebutton->setLabel("* Abc"), _addBtn->setEnabled(true));
} else if (_mode == kModeNum) {
// I18N: 'Num' means Numbers
_modebutton->setLabel("* Num");
} else {
// I18N: 'Abc' means Latin alphabet input
_modebutton->setLabel("* Abc");
_addBtn->setEnabled(true);
}
// truncate current input at mode change
strncpy(_temp, _currentWord.c_str(), _currentCode.size());
@ -513,23 +525,26 @@ void PredictiveDialog::processBtnActive(ButtonId button) {
_lastTime = 0;
_lastPressBtn = kNoAct;
_curTime = 0;
} else {
goto press;
}
}
press:
pressEditText();
if (button == kOkAct) close();
if (button == kOkAct)
close();
}
void PredictiveDialog::handleTickle() {
if (!_lastTime)
// TODO/FIXME: This code does not seem to make any sense. It is only
// triggered when _lastTime is zero and sets _lastTime to zero again
// under some condition. This should really be a nop. Probably this
// code intends to check "_lastTime" instead of "!_lastTime".
if (!_lastTime) {
if ((_curTime - _lastTime) > kRepeatDelay) {
_lastTime = 0;
}
}
}
void PredictiveDialog::mergeDicts() {
_unitedDict.dictLineCount = _predictiveDict.dictLineCount + _userDict.dictLineCount;
@ -564,9 +579,9 @@ void PredictiveDialog::mergeDicts() {
}
}
uint8 PredictiveDialog::countWordsInString(char *str) {
uint8 PredictiveDialog::countWordsInString(const char *const str) {
// Count the number of (space separated) words in the given string.
char *ptr;
const char *ptr;
if (!str)
return 0;
@ -591,12 +606,12 @@ void PredictiveDialog::bringWordtoTop(char *str, int wordnum) {
// by moving the word at position 'wordnum' to the front (that is, right behind
// right behind the numerical code word at the start of the line).
Common::Array<Common::String> words;
char buf[MAXLINELEN];
char buf[kMaxLineLen];
if (!str)
return;
strncpy(buf, str, MAXLINELEN);
buf[MAXLINELEN - 1] = 0;
strncpy(buf, str, kMaxLineLen);
buf[kMaxLineLen - 1] = 0;
char *word = strtok(buf, " ");
if (!word) {
debug("Predictive Dialog: Invalid dictionary line");
@ -615,7 +630,7 @@ void PredictiveDialog::bringWordtoTop(char *str, int wordnum) {
memcpy(str, tmp.c_str(), strlen(str));
}
int PredictiveDialog::binarySearch(char **dictLine, const String &code, int dictLineCount) {
int PredictiveDialog::binarySearch(const char *const *const dictLine, const Common::String &code, const int dictLineCount) {
int hi = dictLineCount - 1;
int lo = 0;
int line = 0;
@ -644,7 +659,7 @@ bool PredictiveDialog::matchWord() {
return false;
// If the currently entered text is too long, it cannot match anything.
if (_currentCode.size() > MAXWORDLEN)
if (_currentCode.size() > kMaxWordLen)
return false;
// The entries in the dictionary consist of a code, a space, and then
@ -664,9 +679,9 @@ bool PredictiveDialog::matchWord() {
_currentWord.clear();
_wordNumber = 0;
if (0 == strncmp(_unitedDict.dictLine[line], _currentCode.c_str(), _currentCode.size())) {
char tmp[MAXLINELEN];
strncpy(tmp, _unitedDict.dictLine[line], MAXLINELEN);
tmp[MAXLINELEN - 1] = 0;
char tmp[kMaxLineLen];
strncpy(tmp, _unitedDict.dictLine[line], kMaxLineLen);
tmp[kMaxLineLen - 1] = 0;
char *tok = strtok(tmp, " ");
tok = strtok(NULL, " ");
_currentWord = Common::String(tok, _currentCode.size());
@ -676,11 +691,11 @@ bool PredictiveDialog::matchWord() {
}
}
bool PredictiveDialog::searchWord(char *where, const String &whatCode) {
char *ptr = where;
bool PredictiveDialog::searchWord(const char *const where, const Common::String &whatCode) {
const char *ptr = where;
ptr += whatCode.size();
char *newPtr;
const char *newPtr;
bool is = false;
while ((newPtr = strchr(ptr, ' '))) {
if (0 == strncmp(ptr, _currentWord.c_str(), newPtr - ptr)) {
@ -697,7 +712,7 @@ bool PredictiveDialog::searchWord(char *where, const String &whatCode) {
return is;
}
void PredictiveDialog::addWord(Dict &dict, const String &word, const String &code) {
void PredictiveDialog::addWord(Dict &dict, const Common::String &word, const Common::String &code) {
char *newLine;
Common::String tmpCode = code + ' ';
int line = binarySearch(dict.dictLine, tmpCode, dict.dictLineCount);
@ -817,7 +832,7 @@ void PredictiveDialog::addWord(Dict &dict, const String &word, const String &cod
}
void PredictiveDialog::addWordToDict() {
if (_numMemory < MAXWORD) {
if (_numMemory < kMaxWord) {
addWord(_unitedDict, _currentWord, _currentCode);
addWord(_userDict, _currentWord, _currentCode);
} else {
@ -890,7 +905,7 @@ void PredictiveDialog::loadAllDictionary(Dict &dict) {
ConfMan.registerDefault(dict.nameDict, dict.fnameDict);
if (dict.nameDict == "predictive_dictionary") {
Common::File *inFile = new File();
Common::File *inFile = new Common::File();
if (!inFile->open(ConfMan.get(dict.nameDict))) {
warning("Predictive Dialog: cannot read file: %s", dict.fnameDict.c_str());
return;

View File

@ -57,14 +57,12 @@ enum {
};
enum {
MAXLINELEN = 80,
MAXWORDLEN = 24,
MAXWORD = 50
kMaxLineLen = 80,
kMaxWordLen = 24,
kMaxWord = 50
};
class PredictiveDialog : public GUI::Dialog {
typedef Common::String String;
public:
PredictiveDialog();
~PredictiveDialog();
@ -73,7 +71,7 @@ public:
virtual void handleKeyDown(Common::KeyState state);
virtual void handleTickle();
char * getResult() { return _predictiveResult; }
const char *getResult() const { return _predictiveResult; }
private:
struct Dict {
char **dictLine;
@ -81,18 +79,18 @@ private:
char *dictActLine; // using only for united dict...
int32 dictLineCount;
int32 dictTextSize;
String nameDict;
String fnameDict;
Common::String nameDict;
Common::String fnameDict;
};
uint8 countWordsInString(char *str);
uint8 countWordsInString(const char *const str);
void bringWordtoTop(char *str, int wordnum);
void loadDictionary(Common::SeekableReadStream *in, Dict &dict);
void loadAllDictionary(Dict &dict);
void addWordToDict();
void addWord(Dict &dict, const String &word, const String &code);
bool searchWord(char *where, const String &whatCode);
int binarySearch(char **dictLine, const String &code, int dictLineCount);
void addWord(Dict &dict, const Common::String &word, const Common::String &code);
bool searchWord(const char *const where, const Common::String &whatCode);
int binarySearch(const char *const *const dictLine, const Common::String &code, const int dictLineCount);
bool matchWord();
void processBtnActive(ButtonId active);
void pressEditText();
@ -114,20 +112,20 @@ private:
uint8 _numMatchingWords;
char _predictiveResult[40];
String _currentCode;
String _currentWord;
String _prefix;
Common::String _currentCode;
Common::String _currentWord;
Common::String _prefix;
uint32 _curTime, _lastTime;
ButtonId _lastPressBtn;
char _temp[MAXWORDLEN + 1];
int _repeatcount[MAXWORDLEN];
char _temp[kMaxWordLen + 1];
int _repeatcount[kMaxWordLen];
char *_memoryList[MAXWORD];
char *_memoryList[kMaxWord];
int _numMemory;
String _search;
Common::String _search;
bool _navigationwithkeys;
private:

View File

@ -782,9 +782,6 @@
"<widget name='grFullscreenCheckbox' "
"type='Checkbox' "
"/> "
"<widget name='grDisableDitheringCheckbox' "
"type='Checkbox' "
"/> "
"</layout> "
"</dialog> "
"<dialog name='GlobalOptions_Audio' overlays='Dialog.GlobalOptions.TabWidget'> "
@ -1727,9 +1724,6 @@
"<widget name='grFullscreenCheckbox' "
"type='Checkbox' "
"/> "
"<widget name='grDisableDitheringCheckbox' "
"type='Checkbox' "
"/> "
"</layout> "
"</dialog> "
"<dialog name='GlobalOptions_Audio' overlays='Dialog.GlobalOptions.TabWidget'> "

Binary file not shown.

View File

@ -1 +1 @@
[SCUMMVM_STX0.8.10:ResidualVM Modern Theme:No Author]
[SCUMMVM_STX0.8.11:ResidualVM Modern Theme:No Author]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -336,9 +336,13 @@
<drawdata id = 'scrollbar_button_hover' cache = 'false' resolution = 'y<400'>
<drawstep func = 'roundedsq'
radius = '10'
fill = 'none'
fg_color = 'darkgray'
fill = 'gradient'
gradient_start = 'brightpink'
gradient_end = 'darkpink'
stroke = '1'
fg_color = 'darkred'
bevel = '1'
bevel_color = 'brightred'
/>
<drawstep func = 'triangle'
fg_color = 'shadowcolor'
@ -347,7 +351,7 @@
height = '5'
xpos = 'right'
ypos = 'center'
padding = '0,0,2,0'
padding = '0,0,1,0'
orientation = 'top'
/>
</drawdata>

View File

@ -231,9 +231,6 @@
<widget name = 'grFullscreenCheckbox'
type = 'Checkbox'
/>
<widget name = 'grDisableDitheringCheckbox'
type = 'Checkbox'
/>
</layout>
</dialog>

View File

@ -214,9 +214,6 @@
<widget name = 'grFullscreenCheckbox'
type = 'Checkbox'
/>
<widget name = 'grDisableDitheringCheckbox'
type = 'Checkbox'
/>
</layout>
</dialog>