From aed02365ec81e77b3c8aa4f4ecd9a9d3893326f2 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 25 Jan 2010 01:39:44 +0000 Subject: Strip trailing spaces/tabs. svn-id: r47541 --- engines/m4/dialogs.cpp | 12 ++++++------ engines/m4/events.cpp | 4 ++-- engines/m4/font.h | 2 +- engines/m4/globals.h | 4 ++-- engines/m4/graphics.cpp | 2 +- engines/m4/m4.h | 8 ++++---- engines/m4/mads_anim.cpp | 8 ++++---- engines/m4/midi.cpp | 2 +- engines/m4/scene.cpp | 22 +++++++++++----------- engines/m4/scene.h | 4 ++-- engines/m4/viewmgr.cpp | 2 +- 11 files changed, 35 insertions(+), 35 deletions(-) (limited to 'engines/m4') diff --git a/engines/m4/dialogs.cpp b/engines/m4/dialogs.cpp index 9adf6c42e5..5e85c6a8df 100644 --- a/engines/m4/dialogs.cpp +++ b/engines/m4/dialogs.cpp @@ -65,7 +65,7 @@ void Dialog::incLine() { _lineX = 0; _widthX = 0; - _lines.push_back(*new DialogLine()); + _lines.push_back(*new DialogLine()); assert(_lines.size() <= 20); } @@ -227,7 +227,7 @@ bool Dialog::handleNounSuffix(char *destP, int nounNum, const char *srcP) { if (*srcP != '\0') ++srcP; - // + // char var_FC[40]; char tempLine[40]; strcpy(var_FC, srcP); @@ -236,7 +236,7 @@ bool Dialog::handleNounSuffix(char *destP, int nounNum, const char *srcP) { uint16 _vocabIds[2] = {1, 1}; // FIXME/TODO: Proper vocab ids getVocab(_vocabIds[nounNum], &tmpP); - + if ((*(tmpP - 1) != 'S') && (*(tmpP - 1) != 's')) { // Singular object tmpP = &var_FC[0]; @@ -452,7 +452,7 @@ void Dialog::draw() { // Ask position //int askY = (_vm->_font->getHeight() + 1) * _askPosition.y + 3; - // Set up the dialog + // Set up the dialog fillRect(Common::Rect(0, 0, width(), height()), 3); setColour(2); hLine(1, width() - 1, height() - 2); // Bottom edge @@ -471,7 +471,7 @@ void Dialog::draw() { seed += 0x181D; v = ROR16(v, 9); seed = (seed ^ v) + ROR16(v, 3); - + *destP++ = ((seed & 0x10) != 0) ? 1 : 0; } } @@ -495,7 +495,7 @@ void Dialog::draw() { if (_lines[lineCtr].underline) // Underline needed - hLine(pt.x, pt.x + _vm->_font->getWidth(_lines[lineCtr].data, DIALOG_SPACING), + hLine(pt.x, pt.x + _vm->_font->getWidth(_lines[lineCtr].data, DIALOG_SPACING), pt.y + _vm->_font->getHeight()); } } diff --git a/engines/m4/events.cpp b/engines/m4/events.cpp index 099aa6b48d..2c8dd20708 100644 --- a/engines/m4/events.cpp +++ b/engines/m4/events.cpp @@ -68,7 +68,7 @@ M4EventType Events::handleEvents() { // if it's the first key pressed after the Ctrl key is held down if ((_event.kbd.keycode == Common::KEYCODE_LCTRL) || (_event.kbd.keycode == Common::KEYCODE_RCTRL)) _ctrlFlag = true; - + else if (_event.kbd.flags == Common::KBD_CTRL) { if ((_event.kbd.keycode == Common::KEYCODE_d) && _ctrlFlag) { _console->attach(); @@ -77,7 +77,7 @@ M4EventType Events::handleEvents() { _ctrlFlag = false; } _keyCode = (int32)_event.kbd.keycode | (_event.kbd.flags << 24); - + break; case Common::EVENT_LBUTTONDOWN: diff --git a/engines/m4/font.h b/engines/m4/font.h index 121c179562..5e4f8b8644 100644 --- a/engines/m4/font.h +++ b/engines/m4/font.h @@ -65,7 +65,7 @@ public: void setColor(uint8 color); void setColors(uint8 alt1, uint8 alt2, uint8 foreground); void setColour(uint8 colour) { setColor(colour); } - void setColours(uint8 alt1, uint8 alt2, uint8 foreground) { setColors(alt1, alt2, foreground); } + void setColours(uint8 alt1, uint8 alt2, uint8 foreground) { setColors(alt1, alt2, foreground); } int32 getWidth(const char *text, int spaceWidth = -1); int32 getHeight() const { return _maxHeight; } diff --git a/engines/m4/globals.h b/engines/m4/globals.h index 324ad13182..5a1d108658 100644 --- a/engines/m4/globals.h +++ b/engines/m4/globals.h @@ -212,10 +212,10 @@ public: void loadMadsVocab(); uint32 getVocabSize() { return _madsVocab.size(); } - const char *getVocab(uint32 index) { + const char *getVocab(uint32 index) { // Vocab list is 1-based, so always subtract one from index provided assert((index > 0) && (index <= _madsVocab.size())); - return _madsVocab[index - 1]; + return _madsVocab[index - 1]; } void loadMadsQuotes(); diff --git a/engines/m4/graphics.cpp b/engines/m4/graphics.cpp index 9b6a841164..b8e0761031 100644 --- a/engines/m4/graphics.cpp +++ b/engines/m4/graphics.cpp @@ -61,7 +61,7 @@ RGBList::~RGBList() { void RGBList::setRange(int start, int count, const RGB8 *src) { assert((start + count) <= _size); - + Common::copy(&src[0], &src[count], &_data[start]); } diff --git a/engines/m4/m4.h b/engines/m4/m4.h index c7bbfcdd87..1709ffeca2 100644 --- a/engines/m4/m4.h +++ b/engines/m4/m4.h @@ -51,18 +51,18 @@ /** * This is the namespace of the M4 engine. * - * Status of this engine: + * Status of this engine: * This engine is eventually intended to compromise two evolutions of the same engine: 'MADS' for the * first generation of the engine, and 'M4' for the second generation. This engine is called M4 overall * simply because work first began on the M4 side (focusing on the game 'Orion Burger'). * - * MADS Status: The current game being focused on is 'Rex Nebular' by DreamMaster, who is implementing + * MADS Status: The current game being focused on is 'Rex Nebular' by DreamMaster, who is implementing * functionality as he disassembles the games original executables. Currently the engine has no particular - * game logic implemented, although it does have the title screen implemented, and displays the initial + * game logic implemented, although it does have the title screen implemented, and displays the initial * game screen and some game interface elements * * M4 Status: Work on this engine began with the game 'Orion Burger'. Some of the user interface - * functionality has been implemented. No further work has been done on this for some time, so progress + * functionality has been implemented. No further work has been done on this for some time, so progress * on this part of the engine can be considered frozen. * * Games this engine will support: diff --git a/engines/m4/mads_anim.cpp b/engines/m4/mads_anim.cpp index ffa3b4bc9c..6984308784 100644 --- a/engines/m4/mads_anim.cpp +++ b/engines/m4/mads_anim.cpp @@ -522,7 +522,7 @@ void AnimviewView::updateState() { scriptDone(); return; } - + readNextCommand(); // FIXME: Replace flag with proper animation end check @@ -553,7 +553,7 @@ void AnimviewView::readNextCommand() { cStart = strchr(_currentLine, '-'); } - + // If there's something left, presume it's a resource name to process if (_currentLine[0]) break; @@ -579,10 +579,10 @@ void AnimviewView::readNextCommand() { buffer[0] = 'A'; // A for AdLib resource /*Common::SeekableReadStream *stream = */_vm->_resourceManager->get(buffer); - + _vm->_resourceManager->toss(buffer); } - + char artFile[80]; sprintf(artFile, "rm%d.art", aaFile.roomNumber); diff --git a/engines/m4/midi.cpp b/engines/m4/midi.cpp index 2696bf566a..e54fc19f46 100644 --- a/engines/m4/midi.cpp +++ b/engines/m4/midi.cpp @@ -181,7 +181,7 @@ void MidiPlayer::stopMusic() { if (_parser) { _parser->unloadMusic(); } - + if (_midiData) { free(_midiData); _midiData = NULL; diff --git a/engines/m4/scene.cpp b/engines/m4/scene.cpp index f61a2e88ce..7b5080e0bc 100644 --- a/engines/m4/scene.cpp +++ b/engines/m4/scene.cpp @@ -113,7 +113,7 @@ void Scene::loadScene(int sceneNumber) { } else { // Set system palette entries _vm->_palette->blockRange(0, 7); - RGB8 sysColors[3] = { {0x1f<<2, 0x2d<<2, 0x31<<2, 0}, {0x24<<2, 0x37<<2, 0x3a<<2, 0}, + RGB8 sysColors[3] = { {0x1f<<2, 0x2d<<2, 0x31<<2, 0}, {0x24<<2, 0x37<<2, 0x3a<<2, 0}, {0x00<<2, 0x10<<2, 0x16<<2, 0}}; _vm->_palette->setPalette(&sysColors[0], 4, 3); @@ -701,7 +701,7 @@ void Scene::setAction(int action, int objectId) { // Set up the new action strcpy(statusText, _vm->_globals->getVocab(action)); statusText[0] = toupper(statusText[0]); // capitalize first letter - + if (objectId != -1) { MadsObject *obj = _vm->_globals->getObject(objectId); sprintf(statusText + strlen(statusText), " %s", _vm->_globals->getVocab(obj->descId)); @@ -735,7 +735,7 @@ MadsInterfaceView::MadsInterfaceView(M4Engine *vm): View(vm, Common::Rect(0, MAD for (int i = 0; i < 10; ++i) _screenObjects.addRect((i / 5) * 32 + 1, (i % 5) * 8 + MADS_SURFACE_HEIGHT + 2, ((i / 5) + 1) * 32 + 3, ((i % 5) + 1) * 8 + MADS_SURFACE_HEIGHT + 2); - + // Scroller elements (up arrow, scroller, down arrow) _screenObjects.addRect(73, 160, 82, 167); _screenObjects.addRect(73, 168, 82, 190); @@ -744,7 +744,7 @@ MadsInterfaceView::MadsInterfaceView(M4Engine *vm): View(vm, Common::Rect(0, MAD // Inventory object names for (int i = 0; i < 5; ++i) _screenObjects.addRect(89, 158 + i * 8, 160, 166 + i * 8); - + // Full rectangle area for all vocab actions for (int i = 0; i < 5; ++i) _screenObjects.addRect(239, 158 + i * 8, 320, 166 + i * 8); @@ -805,7 +805,7 @@ void MadsInterfaceView::setSelectedObject(int objectNumber) { _topIndex = idx; else if (idx >= (_topIndex + 5)) _topIndex = MAX(0, idx - 4); - + _selectedObject = objectNumber; sprintf(resName, "*OB%.3dI.SS", objectNumber); @@ -843,7 +843,7 @@ void MadsInterfaceView::onRefresh(RectList *rects, M4Surface *destSurface) { for (int y = 0; y < 5; ++y, ++actionIndex) { // Determine the font colour depending on whether an item is selected. Note that the first action, // 'Look', is always 'selected', even when another action is clicked on - setFontMode((_highlightedElement == actionIndex) ? ITEM_HIGHLIGHTED : + setFontMode((_highlightedElement == actionIndex) ? ITEM_HIGHLIGHTED : ((actionIndex == 0) ? ITEM_SELECTED : ITEM_NORMAL)); // Get the verb action and capitalise it @@ -864,7 +864,7 @@ void MadsInterfaceView::onRefresh(RectList *rects, M4Surface *destSurface) { destSurface->frameRect(r, 5); } - // Draw the horizontal line in the scroller representing the current top selected + // Draw the horizontal line in the scroller representing the current top selected const Common::Rect scroller(_screenObjects[SCROLL_SCROLLER]); int yP = (_inventoryList.size() < 2) ? 0 : (scroller.height() - 5) * _topIndex / (_inventoryList.size() - 1); destSurface->setColor(4); @@ -881,7 +881,7 @@ void MadsInterfaceView::onRefresh(RectList *rects, M4Surface *destSurface) { if ((buffer[0] >= 'a') && (buffer[0] <= 'z')) buffer[0] -= 'a' - 'A'; const Common::Rect r(_screenObjects[INVLIST_START + i]); - + // Set the highlighting of the inventory item if (_highlightedElement == (int)(INVLIST_START + i)) setFontMode(ITEM_HIGHLIGHTED); else if (_selectedObject == _inventoryList[_topIndex + i]) setFontMode(ITEM_SELECTED); @@ -915,7 +915,7 @@ void MadsInterfaceView::onRefresh(RectList *rects, M4Surface *destSurface) { const char *descStr = _vm->_globals->getVocab(obj->vocabList[i].vocabId); strcpy(buffer, descStr); if ((buffer[0] >= 'a') && (buffer[0] <= 'z')) buffer[0] -= 'a' - 'A'; - + // Set the highlighting and display the entry setFontMode((i == yIndex) ? ITEM_HIGHLIGHTED : ITEM_NORMAL); _vm->_font->writeString(destSurface, buffer, r.left, r.top, r.width(), 0); @@ -942,7 +942,7 @@ bool MadsInterfaceView::onEvent(M4EventType eventType, int32 param1, int x, int _highlightedElement = _screenObjects.find(Common::Point(x, y)); return true; - + case MEVENT_LEFT_CLICK: // Left mouse click // Check if an inventory object was selected @@ -1017,7 +1017,7 @@ bool MadsInterfaceView::handleCheatKey(int32 keycode) { { // Teleport to room //Scene *sceneView = (Scene *)vm->_viewManager->getView(VIEWID_SCENE); - + return true; } diff --git a/engines/m4/scene.h b/engines/m4/scene.h index 593bbddc07..8896a8f5df 100644 --- a/engines/m4/scene.h +++ b/engines/m4/scene.h @@ -137,7 +137,7 @@ class IntegerList: public Common::Array { public: int indexOf(int v) { for (uint i = 0; i < size(); ++i) - if (operator [](i) == v) + if (operator [](i) == v) return i; return -1; } @@ -151,7 +151,7 @@ private: int _topIndex; uint32 _nextScrollerTicks; int _cheatKeyCtr; - + // Object display fields int _selectedObject; SpriteAsset *_objectSprites; diff --git a/engines/m4/viewmgr.cpp b/engines/m4/viewmgr.cpp index 78ebbbad96..a259939617 100644 --- a/engines/m4/viewmgr.cpp +++ b/engines/m4/viewmgr.cpp @@ -63,7 +63,7 @@ int RectList::find(const Common::Point &pt) { if (this->operator [](idx).contains(pt.x, pt.y)) return idx; } - return -1; + return -1; } //-------------------------------------------------------------------------- -- cgit v1.2.3