diff options
author | Einar Johan Trøan Sømåen | 2012-07-04 19:23:41 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-07-04 19:23:41 +0200 |
commit | 3f22d4372f2846d64b3801a892c8873e9811f5d5 (patch) | |
tree | 07915df12066bb18322938427aacb71e7ea368a1 /engines/wintermute/UI | |
parent | be4ceeb44e455882a33dd81a76dc91d3a378dbfb (diff) | |
download | scummvm-rg350-3f22d4372f2846d64b3801a892c8873e9811f5d5.tar.gz scummvm-rg350-3f22d4372f2846d64b3801a892c8873e9811f5d5.tar.bz2 scummvm-rg350-3f22d4372f2846d64b3801a892c8873e9811f5d5.zip |
WINTERMUTE: Mass rename VarName/FuncName -> varName/funcName alphabetically up until AdScene
Diffstat (limited to 'engines/wintermute/UI')
-rw-r--r-- | engines/wintermute/UI/UIButton.cpp | 106 | ||||
-rw-r--r-- | engines/wintermute/UI/UIButton.h | 4 | ||||
-rw-r--r-- | engines/wintermute/UI/UIEdit.cpp | 74 | ||||
-rw-r--r-- | engines/wintermute/UI/UIEdit.h | 4 | ||||
-rw-r--r-- | engines/wintermute/UI/UIEntity.cpp | 48 | ||||
-rw-r--r-- | engines/wintermute/UI/UIEntity.h | 2 | ||||
-rw-r--r-- | engines/wintermute/UI/UIObject.cpp | 2 | ||||
-rw-r--r-- | engines/wintermute/UI/UIObject.h | 2 | ||||
-rw-r--r-- | engines/wintermute/UI/UIText.cpp | 78 | ||||
-rw-r--r-- | engines/wintermute/UI/UIText.h | 4 | ||||
-rw-r--r-- | engines/wintermute/UI/UITiledImage.cpp | 34 | ||||
-rw-r--r-- | engines/wintermute/UI/UITiledImage.h | 4 | ||||
-rw-r--r-- | engines/wintermute/UI/UIWindow.cpp | 108 | ||||
-rw-r--r-- | engines/wintermute/UI/UIWindow.h | 4 |
14 files changed, 237 insertions, 237 deletions
diff --git a/engines/wintermute/UI/UIButton.cpp b/engines/wintermute/UI/UIButton.cpp index dffb9532da..0131f0bd02 100644 --- a/engines/wintermute/UI/UIButton.cpp +++ b/engines/wintermute/UI/UIButton.cpp @@ -96,8 +96,8 @@ CUIButton::~CUIButton() { //////////////////////////////////////////////////////////////////////////
HRESULT CUIButton::loadFile(const char *filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(filename);
- if (Buffer == NULL) {
+ byte *buffer = Game->_fileManager->readWholeFile(filename);
+ if (buffer == NULL) {
Game->LOG(0, "CUIButton::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
@@ -107,10 +107,10 @@ HRESULT CUIButton::loadFile(const char *filename) { _filename = new char [strlen(filename) + 1];
strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing BUTTON file '%s'", filename);
+ if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing BUTTON file '%s'", filename);
- delete [] Buffer;
+ delete [] buffer;
return ret;
}
@@ -155,7 +155,7 @@ TOKEN_DEF(PIXEL_PERFECT) TOKEN_DEF(EDITOR_PROPERTY)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIButton::loadBuffer(byte *Buffer, bool Complete) {
+HRESULT CUIButton::loadBuffer(byte *buffer, bool complete) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(BUTTON)
TOKEN_TABLE(TEMPLATE)
@@ -199,15 +199,15 @@ HRESULT CUIButton::loadBuffer(byte *Buffer, bool Complete) { int cmd = 2;
CBParser parser(Game);
- if (Complete) {
- if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_BUTTON) {
+ if (complete) {
+ if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_BUTTON) {
Game->LOG(0, "'BUTTON' keyword expected.");
return E_FAIL;
}
- Buffer = params;
+ buffer = params;
}
- while (cmd > 0 && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
+ while (cmd > 0 && (cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
switch (cmd) {
case TOKEN_TEMPLATE:
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
@@ -440,101 +440,101 @@ HRESULT CUIButton::loadBuffer(byte *Buffer, bool Complete) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIButton::saveAsText(CBDynBuffer *Buffer, int Indent) {
- Buffer->putTextIndent(Indent, "BUTTON\n");
- Buffer->putTextIndent(Indent, "{\n");
+HRESULT CUIButton::saveAsText(CBDynBuffer *buffer, int indent) {
+ buffer->putTextIndent(indent, "BUTTON\n");
+ buffer->putTextIndent(indent, "{\n");
- Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
- Buffer->putTextIndent(Indent + 2, "CAPTION=\"%s\"\n", getCaption());
+ buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _name);
+ buffer->putTextIndent(indent + 2, "CAPTION=\"%s\"\n", getCaption());
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
if (_back && _back->_filename)
- Buffer->putTextIndent(Indent + 2, "BACK=\"%s\"\n", _back->_filename);
+ buffer->putTextIndent(indent + 2, "BACK=\"%s\"\n", _back->_filename);
if (_backHover && _backHover->_filename)
- Buffer->putTextIndent(Indent + 2, "BACK_HOVER=\"%s\"\n", _backHover->_filename);
+ buffer->putTextIndent(indent + 2, "BACK_HOVER=\"%s\"\n", _backHover->_filename);
if (_backPress && _backPress->_filename)
- Buffer->putTextIndent(Indent + 2, "BACK_PRESS=\"%s\"\n", _backPress->_filename);
+ buffer->putTextIndent(indent + 2, "BACK_PRESS=\"%s\"\n", _backPress->_filename);
if (_backDisable && _backDisable->_filename)
- Buffer->putTextIndent(Indent + 2, "BACK_DISABLE=\"%s\"\n", _backDisable->_filename);
+ buffer->putTextIndent(indent + 2, "BACK_DISABLE=\"%s\"\n", _backDisable->_filename);
if (_backFocus && _backFocus->_filename)
- Buffer->putTextIndent(Indent + 2, "BACK_FOCUS=\"%s\"\n", _backFocus->_filename);
+ buffer->putTextIndent(indent + 2, "BACK_FOCUS=\"%s\"\n", _backFocus->_filename);
if (_image && _image->_filename)
- Buffer->putTextIndent(Indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
+ buffer->putTextIndent(indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
if (_imageHover && _imageHover->_filename)
- Buffer->putTextIndent(Indent + 2, "IMAGE_HOVER=\"%s\"\n", _imageHover->_filename);
+ buffer->putTextIndent(indent + 2, "IMAGE_HOVER=\"%s\"\n", _imageHover->_filename);
if (_imagePress && _imagePress->_filename)
- Buffer->putTextIndent(Indent + 2, "IMAGE_PRESS=\"%s\"\n", _imagePress->_filename);
+ buffer->putTextIndent(indent + 2, "IMAGE_PRESS=\"%s\"\n", _imagePress->_filename);
if (_imageDisable && _imageDisable->_filename)
- Buffer->putTextIndent(Indent + 2, "IMAGE_DISABLE=\"%s\"\n", _imageDisable->_filename);
+ buffer->putTextIndent(indent + 2, "IMAGE_DISABLE=\"%s\"\n", _imageDisable->_filename);
if (_imageFocus && _imageFocus->_filename)
- Buffer->putTextIndent(Indent + 2, "IMAGE_FOCUS=\"%s\"\n", _imageFocus->_filename);
+ buffer->putTextIndent(indent + 2, "IMAGE_FOCUS=\"%s\"\n", _imageFocus->_filename);
if (_font && _font->_filename)
- Buffer->putTextIndent(Indent + 2, "FONT=\"%s\"\n", _font->_filename);
+ buffer->putTextIndent(indent + 2, "FONT=\"%s\"\n", _font->_filename);
if (_fontHover && _fontHover->_filename)
- Buffer->putTextIndent(Indent + 2, "FONT_HOVER=\"%s\"\n", _fontHover->_filename);
+ buffer->putTextIndent(indent + 2, "FONT_HOVER=\"%s\"\n", _fontHover->_filename);
if (_fontPress && _fontPress->_filename)
- Buffer->putTextIndent(Indent + 2, "FONT_PRESS=\"%s\"\n", _fontPress->_filename);
+ buffer->putTextIndent(indent + 2, "FONT_PRESS=\"%s\"\n", _fontPress->_filename);
if (_fontDisable && _fontDisable->_filename)
- Buffer->putTextIndent(Indent + 2, "FONT_DISABLE=\"%s\"\n", _fontDisable->_filename);
+ buffer->putTextIndent(indent + 2, "FONT_DISABLE=\"%s\"\n", _fontDisable->_filename);
if (_fontFocus && _fontFocus->_filename)
- Buffer->putTextIndent(Indent + 2, "FONT_FOCUS=\"%s\"\n", _fontFocus->_filename);
+ buffer->putTextIndent(indent + 2, "FONT_FOCUS=\"%s\"\n", _fontFocus->_filename);
if (_cursor && _cursor->_filename)
- Buffer->putTextIndent(Indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
+ buffer->putTextIndent(indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
if (_text)
- Buffer->putTextIndent(Indent + 2, "TEXT=\"%s\"\n", _text);
+ buffer->putTextIndent(indent + 2, "TEXT=\"%s\"\n", _text);
switch (_align) {
case TAL_LEFT:
- Buffer->putTextIndent(Indent + 2, "TEXT_ALIGN=\"%s\"\n", "left");
+ buffer->putTextIndent(indent + 2, "TEXT_ALIGN=\"%s\"\n", "left");
break;
case TAL_RIGHT:
- Buffer->putTextIndent(Indent + 2, "TEXT_ALIGN=\"%s\"\n", "right");
+ buffer->putTextIndent(indent + 2, "TEXT_ALIGN=\"%s\"\n", "right");
break;
case TAL_CENTER:
- Buffer->putTextIndent(Indent + 2, "TEXT_ALIGN=\"%s\"\n", "center");
+ buffer->putTextIndent(indent + 2, "TEXT_ALIGN=\"%s\"\n", "center");
break;
default:
warning("CUIButton::SaveAsText - unhandled enum");
break;
}
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
- Buffer->putTextIndent(Indent + 2, "X=%d\n", _posX);
- Buffer->putTextIndent(Indent + 2, "Y=%d\n", _posY);
- Buffer->putTextIndent(Indent + 2, "WIDTH=%d\n", _width);
- Buffer->putTextIndent(Indent + 2, "HEIGHT=%d\n", _height);
+ buffer->putTextIndent(indent + 2, "X=%d\n", _posX);
+ buffer->putTextIndent(indent + 2, "Y=%d\n", _posY);
+ buffer->putTextIndent(indent + 2, "WIDTH=%d\n", _width);
+ buffer->putTextIndent(indent + 2, "HEIGHT=%d\n", _height);
- Buffer->putTextIndent(Indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "PARENT_NOTIFY=%s\n", _parentNotify ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "FOCUSABLE=%s\n", _canFocus ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "CENTER_IMAGE=%s\n", _centerImage ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "PRESSED=%s\n", _stayPressed ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "PIXEL_PERFECT=%s\n", _pixelPerfect ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "PARENT_NOTIFY=%s\n", _parentNotify ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "FOCUSABLE=%s\n", _canFocus ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "CENTER_IMAGE=%s\n", _centerImage ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "PRESSED=%s\n", _stayPressed ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "PIXEL_PERFECT=%s\n", _pixelPerfect ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
// scripts
for (int i = 0; i < _scripts.GetSize(); i++) {
- Buffer->putTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
+ buffer->putTextIndent(indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
}
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
// editor properties
- CBBase::saveAsText(Buffer, Indent + 2);
+ CBBase::saveAsText(buffer, indent + 2);
- Buffer->putTextIndent(Indent, "}\n");
+ buffer->putTextIndent(indent, "}\n");
return S_OK;
}
diff --git a/engines/wintermute/UI/UIButton.h b/engines/wintermute/UI/UIButton.h index 856afc5be0..cb14a68d5c 100644 --- a/engines/wintermute/UI/UIButton.h +++ b/engines/wintermute/UI/UIButton.h @@ -64,8 +64,8 @@ public: CUIButton(CBGame *inGame = NULL);
virtual ~CUIButton();
HRESULT loadFile(const char *filename);
- HRESULT loadBuffer(byte *Buffer, bool Complete = true);
- virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
+ HRESULT loadBuffer(byte *buffer, bool complete = true);
+ virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
// scripting interface
virtual CScValue *scGetProperty(const char *name);
diff --git a/engines/wintermute/UI/UIEdit.cpp b/engines/wintermute/UI/UIEdit.cpp index 87d70c8f88..5ad3c3fcdf 100644 --- a/engines/wintermute/UI/UIEdit.cpp +++ b/engines/wintermute/UI/UIEdit.cpp @@ -95,8 +95,8 @@ CUIEdit::~CUIEdit() { //////////////////////////////////////////////////////////////////////////
HRESULT CUIEdit::loadFile(const char *filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(filename);
- if (Buffer == NULL) {
+ byte *buffer = Game->_fileManager->readWholeFile(filename);
+ if (buffer == NULL) {
Game->LOG(0, "CUIEdit::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
@@ -106,9 +106,9 @@ HRESULT CUIEdit::loadFile(const char *filename) { _filename = new char [strlen(filename) + 1];
strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing EDIT file '%s'", filename);
+ if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing EDIT file '%s'", filename);
- delete [] Buffer;
+ delete [] buffer;
return ret;
}
@@ -139,7 +139,7 @@ TOKEN_DEF(EDIT) TOKEN_DEF(CAPTION)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIEdit::loadBuffer(byte *Buffer, bool Complete) {
+HRESULT CUIEdit::loadBuffer(byte *buffer, bool complete) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(TEMPLATE)
TOKEN_TABLE(DISABLED)
@@ -169,15 +169,15 @@ HRESULT CUIEdit::loadBuffer(byte *Buffer, bool Complete) { int cmd = 2;
CBParser parser(Game);
- if (Complete) {
- if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_EDIT) {
+ if (complete) {
+ if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_EDIT) {
Game->LOG(0, "'EDIT' keyword expected.");
return E_FAIL;
}
- Buffer = params;
+ buffer = params;
}
- while (cmd > 0 && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
+ while (cmd > 0 && (cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
switch (cmd) {
case TOKEN_TEMPLATE:
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
@@ -302,59 +302,59 @@ HRESULT CUIEdit::loadBuffer(byte *Buffer, bool Complete) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIEdit::saveAsText(CBDynBuffer *Buffer, int Indent) {
- Buffer->putTextIndent(Indent, "EDIT\n");
- Buffer->putTextIndent(Indent, "{\n");
+HRESULT CUIEdit::saveAsText(CBDynBuffer *buffer, int indent) {
+ buffer->putTextIndent(indent, "EDIT\n");
+ buffer->putTextIndent(indent, "{\n");
- Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
- Buffer->putTextIndent(Indent + 2, "CAPTION=\"%s\"\n", getCaption());
+ buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _name);
+ buffer->putTextIndent(indent + 2, "CAPTION=\"%s\"\n", getCaption());
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
if (_back && _back->_filename)
- Buffer->putTextIndent(Indent + 2, "BACK=\"%s\"\n", _back->_filename);
+ buffer->putTextIndent(indent + 2, "BACK=\"%s\"\n", _back->_filename);
if (_image && _image->_filename)
- Buffer->putTextIndent(Indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
+ buffer->putTextIndent(indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
if (_font && _font->_filename)
- Buffer->putTextIndent(Indent + 2, "FONT=\"%s\"\n", _font->_filename);
+ buffer->putTextIndent(indent + 2, "FONT=\"%s\"\n", _font->_filename);
if (_fontSelected && _fontSelected->_filename)
- Buffer->putTextIndent(Indent + 2, "FONT_SELECTED=\"%s\"\n", _fontSelected->_filename);
+ buffer->putTextIndent(indent + 2, "FONT_SELECTED=\"%s\"\n", _fontSelected->_filename);
if (_cursor && _cursor->_filename)
- Buffer->putTextIndent(Indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
+ buffer->putTextIndent(indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
if (_text)
- Buffer->putTextIndent(Indent + 2, "TEXT=\"%s\"\n", _text);
+ buffer->putTextIndent(indent + 2, "TEXT=\"%s\"\n", _text);
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
- Buffer->putTextIndent(Indent + 2, "X=%d\n", _posX);
- Buffer->putTextIndent(Indent + 2, "Y=%d\n", _posY);
- Buffer->putTextIndent(Indent + 2, "WIDTH=%d\n", _width);
- Buffer->putTextIndent(Indent + 2, "HEIGHT=%d\n", _height);
- Buffer->putTextIndent(Indent + 2, "MAX_LENGTH=%d\n", _maxLength);
- Buffer->putTextIndent(Indent + 2, "CURSOR_BLINK_RATE=%d\n", _cursorBlinkRate);
- Buffer->putTextIndent(Indent + 2, "FRAME_WIDTH=%d\n", _frameWidth);
+ buffer->putTextIndent(indent + 2, "X=%d\n", _posX);
+ buffer->putTextIndent(indent + 2, "Y=%d\n", _posY);
+ buffer->putTextIndent(indent + 2, "WIDTH=%d\n", _width);
+ buffer->putTextIndent(indent + 2, "HEIGHT=%d\n", _height);
+ buffer->putTextIndent(indent + 2, "MAX_LENGTH=%d\n", _maxLength);
+ buffer->putTextIndent(indent + 2, "CURSOR_BLINK_RATE=%d\n", _cursorBlinkRate);
+ buffer->putTextIndent(indent + 2, "FRAME_WIDTH=%d\n", _frameWidth);
- Buffer->putTextIndent(Indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "PARENT_NOTIFY=%s\n", _parentNotify ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "PARENT_NOTIFY=%s\n", _parentNotify ? "TRUE" : "FALSE");
// scripts
for (int i = 0; i < _scripts.GetSize(); i++) {
- Buffer->putTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
+ buffer->putTextIndent(indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
}
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
// editor properties
- CBBase::saveAsText(Buffer, Indent + 2);
+ CBBase::saveAsText(buffer, indent + 2);
- Buffer->putTextIndent(Indent, "}\n");
+ buffer->putTextIndent(indent, "}\n");
return S_OK;
}
diff --git a/engines/wintermute/UI/UIEdit.h b/engines/wintermute/UI/UIEdit.h index 0db087e4df..936cf0b72d 100644 --- a/engines/wintermute/UI/UIEdit.h +++ b/engines/wintermute/UI/UIEdit.h @@ -57,8 +57,8 @@ public: virtual ~CUIEdit();
HRESULT loadFile(const char *filename);
- HRESULT loadBuffer(byte *Buffer, bool Complete = true);
- virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
+ HRESULT loadBuffer(byte *buffer, bool complete = true);
+ virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
// scripting interface
virtual CScValue *scGetProperty(const char *name);
diff --git a/engines/wintermute/UI/UIEntity.cpp b/engines/wintermute/UI/UIEntity.cpp index a396ae0560..e9d3662471 100644 --- a/engines/wintermute/UI/UIEntity.cpp +++ b/engines/wintermute/UI/UIEntity.cpp @@ -56,8 +56,8 @@ CUIEntity::~CUIEntity() { //////////////////////////////////////////////////////////////////////////
HRESULT CUIEntity::loadFile(const char *filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(filename);
- if (Buffer == NULL) {
+ byte *buffer = Game->_fileManager->readWholeFile(filename);
+ if (buffer == NULL) {
Game->LOG(0, "CUIEntity::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
@@ -67,10 +67,10 @@ HRESULT CUIEntity::loadFile(const char *filename) { _filename = new char [strlen(filename) + 1];
strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ENTITY container file '%s'", filename);
+ if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing ENTITY container file '%s'", filename);
- delete [] Buffer;
+ delete [] buffer;
return ret;
}
@@ -89,7 +89,7 @@ TOKEN_DEF(SCRIPT) TOKEN_DEF(EDITOR_PROPERTY)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIEntity::loadBuffer(byte *Buffer, bool Complete) {
+HRESULT CUIEntity::loadBuffer(byte *buffer, bool complete) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(ENTITY_CONTAINER)
TOKEN_TABLE(TEMPLATE)
@@ -107,15 +107,15 @@ HRESULT CUIEntity::loadBuffer(byte *Buffer, bool Complete) { int cmd = 2;
CBParser parser(Game);
- if (Complete) {
- if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_ENTITY_CONTAINER) {
+ if (complete) {
+ if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_ENTITY_CONTAINER) {
Game->LOG(0, "'ENTITY_CONTAINER' keyword expected.");
return E_FAIL;
}
- Buffer = params;
+ buffer = params;
}
- while (cmd > 0 && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
+ while (cmd > 0 && (cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
switch (cmd) {
case TOKEN_TEMPLATE:
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
@@ -174,36 +174,36 @@ HRESULT CUIEntity::loadBuffer(byte *Buffer, bool Complete) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIEntity::saveAsText(CBDynBuffer *Buffer, int Indent) {
- Buffer->putTextIndent(Indent, "ENTITY_CONTAINER\n");
- Buffer->putTextIndent(Indent, "{\n");
+HRESULT CUIEntity::saveAsText(CBDynBuffer *buffer, int indent) {
+ buffer->putTextIndent(indent, "ENTITY_CONTAINER\n");
+ buffer->putTextIndent(indent, "{\n");
- Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
+ buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _name);
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
- Buffer->putTextIndent(Indent + 2, "X=%d\n", _posX);
- Buffer->putTextIndent(Indent + 2, "Y=%d\n", _posY);
+ buffer->putTextIndent(indent + 2, "X=%d\n", _posX);
+ buffer->putTextIndent(indent + 2, "Y=%d\n", _posY);
- Buffer->putTextIndent(Indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
if (_entity && _entity->_filename)
- Buffer->putTextIndent(Indent + 2, "ENTITY=\"%s\"\n", _entity->_filename);
+ buffer->putTextIndent(indent + 2, "ENTITY=\"%s\"\n", _entity->_filename);
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
// scripts
for (int i = 0; i < _scripts.GetSize(); i++) {
- Buffer->putTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
+ buffer->putTextIndent(indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
}
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
// editor properties
- CBBase::saveAsText(Buffer, Indent + 2);
+ CBBase::saveAsText(buffer, indent + 2);
- Buffer->putTextIndent(Indent, "}\n");
+ buffer->putTextIndent(indent, "}\n");
return S_OK;
}
diff --git a/engines/wintermute/UI/UIEntity.h b/engines/wintermute/UI/UIEntity.h index 8722ac304b..f096af390c 100644 --- a/engines/wintermute/UI/UIEntity.h +++ b/engines/wintermute/UI/UIEntity.h @@ -40,7 +40,7 @@ public: virtual ~CUIEntity();
HRESULT loadFile(const char *filename);
HRESULT loadBuffer(byte *Buffer, bool Complete);
- virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
+ virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
virtual HRESULT display(int OffsetX = 0, int OffsetY = 0);
CAdEntity *_entity;
diff --git a/engines/wintermute/UI/UIObject.cpp b/engines/wintermute/UI/UIObject.cpp index 26d903990d..aad8e23900 100644 --- a/engines/wintermute/UI/UIObject.cpp +++ b/engines/wintermute/UI/UIObject.cpp @@ -582,7 +582,7 @@ HRESULT CUIObject::persist(CBPersistMgr *persistMgr) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIObject::saveAsText(CBDynBuffer *Buffer, int Indent) {
+HRESULT CUIObject::saveAsText(CBDynBuffer *buffer, int indent) {
return E_FAIL;
}
diff --git a/engines/wintermute/UI/UIObject.h b/engines/wintermute/UI/UIObject.h index f1ebd81f8c..ad7384860e 100644 --- a/engines/wintermute/UI/UIObject.h +++ b/engines/wintermute/UI/UIObject.h @@ -69,7 +69,7 @@ public: uint32 _listenerParamDWORD;
CBScriptHolder *_listenerObject;
CUIObject *_focusedWidget;
- virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
+ virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
// scripting interface
virtual CScValue *scGetProperty(const char *name);
diff --git a/engines/wintermute/UI/UIText.cpp b/engines/wintermute/UI/UIText.cpp index afb6a6976c..dce7f48731 100644 --- a/engines/wintermute/UI/UIText.cpp +++ b/engines/wintermute/UI/UIText.cpp @@ -96,8 +96,8 @@ HRESULT CUIText::display(int OffsetX, int OffsetY) { //////////////////////////////////////////////////////////////////////////
HRESULT CUIText::loadFile(const char *filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(filename);
- if (Buffer == NULL) {
+ byte *buffer = Game->_fileManager->readWholeFile(filename);
+ if (buffer == NULL) {
Game->LOG(0, "CUIText::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
@@ -107,9 +107,9 @@ HRESULT CUIText::loadFile(const char *filename) { _filename = new char [strlen(filename) + 1];
strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing STATIC file '%s'", filename);
+ if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing STATIC file '%s'", filename);
- delete [] Buffer;
+ delete [] buffer;
return ret;
}
@@ -138,7 +138,7 @@ TOKEN_DEF(PARENT_NOTIFY) TOKEN_DEF(EDITOR_PROPERTY)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIText::loadBuffer(byte *Buffer, bool Complete) {
+HRESULT CUIText::loadBuffer(byte *buffer, bool complete) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(STATIC)
TOKEN_TABLE(TEMPLATE)
@@ -166,15 +166,15 @@ HRESULT CUIText::loadBuffer(byte *Buffer, bool Complete) { int cmd = 2;
CBParser parser(Game);
- if (Complete) {
- if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_STATIC) {
+ if (complete) {
+ if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_STATIC) {
Game->LOG(0, "'STATIC' keyword expected.");
return E_FAIL;
}
- Buffer = params;
+ buffer = params;
}
- while (cmd > 0 && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
+ while (cmd > 0 && (cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
switch (cmd) {
case TOKEN_TEMPLATE:
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
@@ -293,39 +293,39 @@ HRESULT CUIText::loadBuffer(byte *Buffer, bool Complete) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIText::saveAsText(CBDynBuffer *Buffer, int Indent) {
- Buffer->putTextIndent(Indent, "STATIC\n");
- Buffer->putTextIndent(Indent, "{\n");
+HRESULT CUIText::saveAsText(CBDynBuffer *buffer, int indent) {
+ buffer->putTextIndent(indent, "STATIC\n");
+ buffer->putTextIndent(indent, "{\n");
- Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
- Buffer->putTextIndent(Indent + 2, "CAPTION=\"%s\"\n", getCaption());
+ buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _name);
+ buffer->putTextIndent(indent + 2, "CAPTION=\"%s\"\n", getCaption());
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
if (_back && _back->_filename)
- Buffer->putTextIndent(Indent + 2, "BACK=\"%s\"\n", _back->_filename);
+ buffer->putTextIndent(indent + 2, "BACK=\"%s\"\n", _back->_filename);
if (_image && _image->_filename)
- Buffer->putTextIndent(Indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
+ buffer->putTextIndent(indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
if (_font && _font->_filename)
- Buffer->putTextIndent(Indent + 2, "FONT=\"%s\"\n", _font->_filename);
+ buffer->putTextIndent(indent + 2, "FONT=\"%s\"\n", _font->_filename);
if (_cursor && _cursor->_filename)
- Buffer->putTextIndent(Indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
+ buffer->putTextIndent(indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
if (_text)
- Buffer->putTextIndent(Indent + 2, "TEXT=\"%s\"\n", _text);
+ buffer->putTextIndent(indent + 2, "TEXT=\"%s\"\n", _text);
switch (_textAlign) {
case TAL_LEFT:
- Buffer->putTextIndent(Indent + 2, "TEXT_ALIGN=\"%s\"\n", "left");
+ buffer->putTextIndent(indent + 2, "TEXT_ALIGN=\"%s\"\n", "left");
break;
case TAL_RIGHT:
- Buffer->putTextIndent(Indent + 2, "TEXT_ALIGN=\"%s\"\n", "right");
+ buffer->putTextIndent(indent + 2, "TEXT_ALIGN=\"%s\"\n", "right");
break;
case TAL_CENTER:
- Buffer->putTextIndent(Indent + 2, "TEXT_ALIGN=\"%s\"\n", "center");
+ buffer->putTextIndent(indent + 2, "TEXT_ALIGN=\"%s\"\n", "center");
break;
default:
error("CUIText::SaveAsText - Unhandled enum");
@@ -334,42 +334,42 @@ HRESULT CUIText::saveAsText(CBDynBuffer *Buffer, int Indent) { switch (_verticalAlign) {
case VAL_TOP:
- Buffer->putTextIndent(Indent + 2, "VERTICAL_ALIGN=\"%s\"\n", "top");
+ buffer->putTextIndent(indent + 2, "VERTICAL_ALIGN=\"%s\"\n", "top");
break;
case VAL_BOTTOM:
- Buffer->putTextIndent(Indent + 2, "VERTICAL_ALIGN=\"%s\"\n", "bottom");
+ buffer->putTextIndent(indent + 2, "VERTICAL_ALIGN=\"%s\"\n", "bottom");
break;
case VAL_CENTER:
- Buffer->putTextIndent(Indent + 2, "VERTICAL_ALIGN=\"%s\"\n", "center");
+ buffer->putTextIndent(indent + 2, "VERTICAL_ALIGN=\"%s\"\n", "center");
break;
default:
error("UIText::SaveAsText - Unhandled enum value: NUM_VERTICAL_ALIGN");
}
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
- Buffer->putTextIndent(Indent + 2, "X=%d\n", _posX);
- Buffer->putTextIndent(Indent + 2, "Y=%d\n", _posY);
- Buffer->putTextIndent(Indent + 2, "WIDTH=%d\n", _width);
- Buffer->putTextIndent(Indent + 2, "HEIGHT=%d\n", _height);
+ buffer->putTextIndent(indent + 2, "X=%d\n", _posX);
+ buffer->putTextIndent(indent + 2, "Y=%d\n", _posY);
+ buffer->putTextIndent(indent + 2, "WIDTH=%d\n", _width);
+ buffer->putTextIndent(indent + 2, "HEIGHT=%d\n", _height);
- Buffer->putTextIndent(Indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "PARENT_NOTIFY=%s\n", _parentNotify ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "PARENT_NOTIFY=%s\n", _parentNotify ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
// scripts
for (int i = 0; i < _scripts.GetSize(); i++) {
- Buffer->putTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
+ buffer->putTextIndent(indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
}
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
// editor properties
- CBBase::saveAsText(Buffer, Indent + 2);
+ CBBase::saveAsText(buffer, indent + 2);
- Buffer->putTextIndent(Indent, "}\n");
+ buffer->putTextIndent(indent, "}\n");
return S_OK;
}
diff --git a/engines/wintermute/UI/UIText.h b/engines/wintermute/UI/UIText.h index 5ef3c85df9..876b6762f7 100644 --- a/engines/wintermute/UI/UIText.h +++ b/engines/wintermute/UI/UIText.h @@ -44,8 +44,8 @@ public: TTextAlign _textAlign;
TVerticalAlign _verticalAlign;
HRESULT loadFile(const char *filename);
- HRESULT loadBuffer(byte *Buffer, bool Complete = true);
- virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
+ HRESULT loadBuffer(byte *buffer, bool complete = true);
+ virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
// scripting interface
virtual CScValue *scGetProperty(const char *name);
diff --git a/engines/wintermute/UI/UITiledImage.cpp b/engines/wintermute/UI/UITiledImage.cpp index d0f9cdb0f2..a56d3af9c1 100644 --- a/engines/wintermute/UI/UITiledImage.cpp +++ b/engines/wintermute/UI/UITiledImage.cpp @@ -120,8 +120,8 @@ HRESULT CUITiledImage::display(int X, int Y, int Width, int Height) { //////////////////////////////////////////////////////////////////////////
HRESULT CUITiledImage::loadFile(const char *filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(filename);
- if (Buffer == NULL) {
+ byte *buffer = Game->_fileManager->readWholeFile(filename);
+ if (buffer == NULL) {
Game->LOG(0, "CUITiledImage::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
@@ -131,10 +131,10 @@ HRESULT CUITiledImage::loadFile(const char *filename) { _filename = new char [strlen(filename) + 1];
strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing TILED_IMAGE file '%s'", filename);
+ if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing TILED_IMAGE file '%s'", filename);
- delete [] Buffer;
+ delete [] buffer;
return ret;
}
@@ -158,7 +158,7 @@ TOKEN_DEF(HORIZONTAL_TILES) TOKEN_DEF(EDITOR_PROPERTY)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////////
-HRESULT CUITiledImage::loadBuffer(byte *Buffer, bool Complete) {
+HRESULT CUITiledImage::loadBuffer(byte *buffer, bool complete) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(TILED_IMAGE)
TOKEN_TABLE(TEMPLATE)
@@ -184,15 +184,15 @@ HRESULT CUITiledImage::loadBuffer(byte *Buffer, bool Complete) { int H1 = 0, H2 = 0, H3 = 0;
int V1 = 0, V2 = 0, V3 = 0;
- if (Complete) {
- if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_TILED_IMAGE) {
+ if (complete) {
+ if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_TILED_IMAGE) {
Game->LOG(0, "'TILED_IMAGE' keyword expected.");
return E_FAIL;
}
- Buffer = params;
+ buffer = params;
}
- while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
+ while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
switch (cmd) {
case TOKEN_TEMPLATE:
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
@@ -307,12 +307,12 @@ HRESULT CUITiledImage::loadBuffer(byte *Buffer, bool Complete) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CUITiledImage::saveAsText(CBDynBuffer *Buffer, int Indent) {
- Buffer->putTextIndent(Indent, "TILED_IMAGE\n");
- Buffer->putTextIndent(Indent, "{\n");
+HRESULT CUITiledImage::saveAsText(CBDynBuffer *buffer, int indent) {
+ buffer->putTextIndent(indent, "TILED_IMAGE\n");
+ buffer->putTextIndent(indent, "{\n");
if (_image && _image->_surfaceFilename)
- Buffer->putTextIndent(Indent + 2, "IMAGE=\"%s\"\n", _image->_surfaceFilename);
+ buffer->putTextIndent(indent + 2, "IMAGE=\"%s\"\n", _image->_surfaceFilename);
int H1, H2, H3;
int V1, V2, V3;
@@ -326,13 +326,13 @@ HRESULT CUITiledImage::saveAsText(CBDynBuffer *Buffer, int Indent) { V3 = _downLeft.bottom - _downLeft.top;
- Buffer->putTextIndent(Indent + 2, "VERTICAL_TILES { %d, %d, %d }\n", V1, V2, V3);
- Buffer->putTextIndent(Indent + 2, "HORIZONTAL_TILES { %d, %d, %d }\n", H1, H2, H3);
+ buffer->putTextIndent(indent + 2, "VERTICAL_TILES { %d, %d, %d }\n", V1, V2, V3);
+ buffer->putTextIndent(indent + 2, "HORIZONTAL_TILES { %d, %d, %d }\n", H1, H2, H3);
// editor properties
- CBBase::saveAsText(Buffer, Indent + 2);
+ CBBase::saveAsText(buffer, indent + 2);
- Buffer->putTextIndent(Indent, "}\n");
+ buffer->putTextIndent(indent, "}\n");
return S_OK;
}
diff --git a/engines/wintermute/UI/UITiledImage.h b/engines/wintermute/UI/UITiledImage.h index 16712746c5..60b95c12d9 100644 --- a/engines/wintermute/UI/UITiledImage.h +++ b/engines/wintermute/UI/UITiledImage.h @@ -39,8 +39,8 @@ public: DECLARE_PERSISTENT(CUITiledImage, CBObject)
void correctSize(int *Width, int *Height);
HRESULT loadFile(const char *filename);
- HRESULT loadBuffer(byte *Buffer, bool Complete = true);
- virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
+ HRESULT loadBuffer(byte *buffer, bool complete = true);
+ virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
HRESULT display(int X, int Y, int Width, int Height);
CUITiledImage(CBGame *inGame = NULL);
diff --git a/engines/wintermute/UI/UIWindow.cpp b/engines/wintermute/UI/UIWindow.cpp index fd36971847..c2eef79210 100644 --- a/engines/wintermute/UI/UIWindow.cpp +++ b/engines/wintermute/UI/UIWindow.cpp @@ -201,8 +201,8 @@ HRESULT CUIWindow::display(int OffsetX, int OffsetY) { //////////////////////////////////////////////////////////////////////////
HRESULT CUIWindow::loadFile(const char *filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(filename);
- if (Buffer == NULL) {
+ byte *buffer = Game->_fileManager->readWholeFile(filename);
+ if (buffer == NULL) {
Game->LOG(0, "CUIWindow::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
@@ -212,9 +212,9 @@ HRESULT CUIWindow::loadFile(const char *filename) { _filename = new char [strlen(filename) + 1];
strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing WINDOW file '%s'", filename);
+ if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing WINDOW file '%s'", filename);
- delete [] Buffer;
+ delete [] buffer;
return ret;
}
@@ -259,7 +259,7 @@ TOKEN_DEF(EDITOR_PROPERTY) TOKEN_DEF(EDIT)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIWindow::loadBuffer(byte *Buffer, bool Complete) {
+HRESULT CUIWindow::loadBuffer(byte *buffer, bool complete) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(WINDOW)
TOKEN_TABLE(ALPHA_COLOR)
@@ -306,15 +306,15 @@ HRESULT CUIWindow::loadBuffer(byte *Buffer, bool Complete) { int FadeR = 0, FadeG = 0, FadeB = 0, FadeA = 0;
int ar = 0, ag = 0, ab = 0, alpha = 0;
- if (Complete) {
- if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_WINDOW) {
+ if (complete) {
+ if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_WINDOW) {
Game->LOG(0, "'WINDOW' keyword expected.");
return E_FAIL;
}
- Buffer = params;
+ buffer = params;
}
- while (cmd >= PARSERR_TOKENNOTFOUND && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) >= PARSERR_TOKENNOTFOUND) {
+ while (cmd >= PARSERR_TOKENNOTFOUND && (cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) >= PARSERR_TOKENNOTFOUND) {
switch (cmd) {
case TOKEN_TEMPLATE:
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
@@ -538,7 +538,7 @@ HRESULT CUIWindow::loadBuffer(byte *Buffer, bool Complete) { default:
- if (FAILED(Game->windowLoadHook(this, (char **)&Buffer, (char **)params))) {
+ if (FAILED(Game->windowLoadHook(this, (char **)&buffer, (char **)params))) {
cmd = PARSERR_GENERIC;
}
}
@@ -567,105 +567,105 @@ HRESULT CUIWindow::loadBuffer(byte *Buffer, bool Complete) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIWindow::saveAsText(CBDynBuffer *Buffer, int Indent) {
- Buffer->putTextIndent(Indent, "WINDOW\n");
- Buffer->putTextIndent(Indent, "{\n");
+HRESULT CUIWindow::saveAsText(CBDynBuffer *buffer, int indent) {
+ buffer->putTextIndent(indent, "WINDOW\n");
+ buffer->putTextIndent(indent, "{\n");
- Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
- Buffer->putTextIndent(Indent + 2, "CAPTION=\"%s\"\n", getCaption());
+ buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _name);
+ buffer->putTextIndent(indent + 2, "CAPTION=\"%s\"\n", getCaption());
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
if (_back && _back->_filename)
- Buffer->putTextIndent(Indent + 2, "BACK=\"%s\"\n", _back->_filename);
+ buffer->putTextIndent(indent + 2, "BACK=\"%s\"\n", _back->_filename);
if (_backInactive && _backInactive->_filename)
- Buffer->putTextIndent(Indent + 2, "BACK_INACTIVE=\"%s\"\n", _backInactive->_filename);
+ buffer->putTextIndent(indent + 2, "BACK_INACTIVE=\"%s\"\n", _backInactive->_filename);
if (_image && _image->_filename)
- Buffer->putTextIndent(Indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
+ buffer->putTextIndent(indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
if (_imageInactive && _imageInactive->_filename)
- Buffer->putTextIndent(Indent + 2, "IMAGE_INACTIVE=\"%s\"\n", _imageInactive->_filename);
+ buffer->putTextIndent(indent + 2, "IMAGE_INACTIVE=\"%s\"\n", _imageInactive->_filename);
if (_font && _font->_filename)
- Buffer->putTextIndent(Indent + 2, "FONT=\"%s\"\n", _font->_filename);
+ buffer->putTextIndent(indent + 2, "FONT=\"%s\"\n", _font->_filename);
if (_fontInactive && _fontInactive->_filename)
- Buffer->putTextIndent(Indent + 2, "FONT_INACTIVE=\"%s\"\n", _fontInactive->_filename);
+ buffer->putTextIndent(indent + 2, "FONT_INACTIVE=\"%s\"\n", _fontInactive->_filename);
if (_cursor && _cursor->_filename)
- Buffer->putTextIndent(Indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
+ buffer->putTextIndent(indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
if (_text)
- Buffer->putTextIndent(Indent + 2, "TITLE=\"%s\"\n", _text);
+ buffer->putTextIndent(indent + 2, "TITLE=\"%s\"\n", _text);
switch (_titleAlign) {
case TAL_LEFT:
- Buffer->putTextIndent(Indent + 2, "TITLE_ALIGN=\"%s\"\n", "left");
+ buffer->putTextIndent(indent + 2, "TITLE_ALIGN=\"%s\"\n", "left");
break;
case TAL_RIGHT:
- Buffer->putTextIndent(Indent + 2, "TITLE_ALIGN=\"%s\"\n", "right");
+ buffer->putTextIndent(indent + 2, "TITLE_ALIGN=\"%s\"\n", "right");
break;
case TAL_CENTER:
- Buffer->putTextIndent(Indent + 2, "TITLE_ALIGN=\"%s\"\n", "center");
+ buffer->putTextIndent(indent + 2, "TITLE_ALIGN=\"%s\"\n", "center");
break;
default:
error("UIWindow::SaveAsText - Unhandled enum-value NUM_TEXT_ALIGN");
}
if (!CBPlatform::IsRectEmpty(&_titleRect)) {
- Buffer->putTextIndent(Indent + 2, "TITLE_RECT { %d, %d, %d, %d }\n", _titleRect.left, _titleRect.top, _titleRect.right, _titleRect.bottom);
+ buffer->putTextIndent(indent + 2, "TITLE_RECT { %d, %d, %d, %d }\n", _titleRect.left, _titleRect.top, _titleRect.right, _titleRect.bottom);
}
if (!CBPlatform::IsRectEmpty(&_dragRect)) {
- Buffer->putTextIndent(Indent + 2, "DRAG_RECT { %d, %d, %d, %d }\n", _dragRect.left, _dragRect.top, _dragRect.right, _dragRect.bottom);
+ buffer->putTextIndent(indent + 2, "DRAG_RECT { %d, %d, %d, %d }\n", _dragRect.left, _dragRect.top, _dragRect.right, _dragRect.bottom);
}
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
- Buffer->putTextIndent(Indent + 2, "X=%d\n", _posX);
- Buffer->putTextIndent(Indent + 2, "Y=%d\n", _posY);
- Buffer->putTextIndent(Indent + 2, "WIDTH=%d\n", _width);
- Buffer->putTextIndent(Indent + 2, "HEIGHT=%d\n", _height);
+ buffer->putTextIndent(indent + 2, "X=%d\n", _posX);
+ buffer->putTextIndent(indent + 2, "Y=%d\n", _posY);
+ buffer->putTextIndent(indent + 2, "WIDTH=%d\n", _width);
+ buffer->putTextIndent(indent + 2, "HEIGHT=%d\n", _height);
- Buffer->putTextIndent(Indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "PARENT_NOTIFY=%s\n", _parentNotify ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "PARENT_NOTIFY=%s\n", _parentNotify ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "TRANSPARENT=%s\n", _transparent ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "PAUSE_MUSIC=%s\n", _pauseMusic ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "MENU=%s\n", _isMenu ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "IN_GAME=%s\n", _inGame ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "CLIP_CONTENTS=%s\n", _clipContents ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "TRANSPARENT=%s\n", _transparent ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "PAUSE_MUSIC=%s\n", _pauseMusic ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "MENU=%s\n", _isMenu ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "IN_GAME=%s\n", _inGame ? "TRUE" : "FALSE");
+ buffer->putTextIndent(indent + 2, "CLIP_CONTENTS=%s\n", _clipContents ? "TRUE" : "FALSE");
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
if (_fadeBackground) {
- Buffer->putTextIndent(Indent + 2, "FADE_COLOR { %d, %d, %d }\n", D3DCOLGetR(_fadeColor), D3DCOLGetG(_fadeColor), D3DCOLGetB(_fadeColor));
- Buffer->putTextIndent(Indent + 2, "FADE_ALPHA=%d\n", D3DCOLGetA(_fadeColor));
+ buffer->putTextIndent(indent + 2, "FADE_COLOR { %d, %d, %d }\n", D3DCOLGetR(_fadeColor), D3DCOLGetG(_fadeColor), D3DCOLGetB(_fadeColor));
+ buffer->putTextIndent(indent + 2, "FADE_ALPHA=%d\n", D3DCOLGetA(_fadeColor));
}
- Buffer->putTextIndent(Indent + 2, "ALPHA_COLOR { %d, %d, %d }\n", D3DCOLGetR(_alphaColor), D3DCOLGetG(_alphaColor), D3DCOLGetB(_alphaColor));
- Buffer->putTextIndent(Indent + 2, "ALPHA=%d\n", D3DCOLGetA(_alphaColor));
+ buffer->putTextIndent(indent + 2, "ALPHA_COLOR { %d, %d, %d }\n", D3DCOLGetR(_alphaColor), D3DCOLGetG(_alphaColor), D3DCOLGetB(_alphaColor));
+ buffer->putTextIndent(indent + 2, "ALPHA=%d\n", D3DCOLGetA(_alphaColor));
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
// scripts
for (int i = 0; i < _scripts.GetSize(); i++) {
- Buffer->putTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
+ buffer->putTextIndent(indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
}
- Buffer->putTextIndent(Indent + 2, "\n");
+ buffer->putTextIndent(indent + 2, "\n");
// editor properties
- CBBase::saveAsText(Buffer, Indent + 2);
+ CBBase::saveAsText(buffer, indent + 2);
// controls
for (int i = 0; i < _widgets.GetSize(); i++)
- _widgets[i]->saveAsText(Buffer, Indent + 2);
+ _widgets[i]->saveAsText(buffer, indent + 2);
- Buffer->putTextIndent(Indent, "}\n");
+ buffer->putTextIndent(indent, "}\n");
return S_OK;
}
diff --git a/engines/wintermute/UI/UIWindow.h b/engines/wintermute/UI/UIWindow.h index c29038860d..6f639cc603 100644 --- a/engines/wintermute/UI/UIWindow.h +++ b/engines/wintermute/UI/UIWindow.h @@ -74,12 +74,12 @@ public: CBArray<CUIObject *, CUIObject *> _widgets;
TTextAlign _titleAlign;
HRESULT loadFile(const char *filename);
- HRESULT loadBuffer(byte *Buffer, bool Complete = true);
+ HRESULT loadBuffer(byte *buffer, bool complete = true);
CUITiledImage *_backInactive;
CBFont *_fontInactive;
CBSprite *_imageInactive;
virtual HRESULT listen(CBScriptHolder *param1, uint32 param2);
- virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
+ virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
// scripting interface
virtual CScValue *scGetProperty(const char *name);
|