diff options
author | Matthew Hoops | 2007-09-02 13:44:23 +0000 |
---|---|---|
committer | Matthew Hoops | 2007-09-02 13:44:23 +0000 |
commit | f3ae0182e09f3d15f4d0a6a896f5d39ba8ac8dfc (patch) | |
tree | 66d60e38b95095bc93c3b4b75016e24dbab40a43 /engines | |
parent | b4d77e60cfc4c8b0f49b4b06a79e85e64af10602 (diff) | |
download | scummvm-rg350-f3ae0182e09f3d15f4d0a6a896f5d39ba8ac8dfc.tar.gz scummvm-rg350-f3ae0182e09f3d15f4d0a6a896f5d39ba8ac8dfc.tar.bz2 scummvm-rg350-f3ae0182e09f3d15f4d0a6a896f5d39ba8ac8dfc.zip |
fix a warning and some code formatting
svn-id: r28820
Diffstat (limited to 'engines')
-rw-r--r-- | engines/agi/agi.h | 2 | ||||
-rw-r--r-- | engines/agi/preagi.cpp | 23 |
2 files changed, 9 insertions, 16 deletions
diff --git a/engines/agi/agi.h b/engines/agi/agi.h index d5a296dd4c..ad88b7b24c 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -1006,7 +1006,7 @@ public: void drawStr(int row, int col, int attr, char *buffer); void drawStrMiddle(int row, int attr, char *buffer); void clearTextArea(); - void drawChar(int x, int y, int attr, int code, char *fontdata); + void drawChar(int x, int y, int attr, int code, const char *fontdata); }; } // End of namespace Agi diff --git a/engines/agi/preagi.cpp b/engines/agi/preagi.cpp index bfe79fad68..8585af6a2d 100644 --- a/engines/agi/preagi.cpp +++ b/engines/agi/preagi.cpp @@ -282,16 +282,13 @@ int PreAgiEngine::preAgiUnloadResource(int r, int n) { // String functions // TODO: These need to be moved elsewhere -void PreAgiEngine::drawStr(int row, int col, int attr, char *buffer) -{ +void PreAgiEngine::drawStr(int row, int col, int attr, char *buffer) { int code; - for (int iChar = 0; iChar < (int)strlen(buffer); iChar++) - { + for (int iChar = 0; iChar < (int)strlen(buffer); iChar++) { code = buffer[iChar]; - switch (code) - { + switch (code) { case '\n': case 0x8D: if (++row == 200 / 8) return; @@ -303,10 +300,9 @@ void PreAgiEngine::drawStr(int row, int col, int attr, char *buffer) break; default: - drawChar(col * 8, row * 8, attr, code, (char*)mickey_fontdata); + drawChar(col * 8, row * 8, attr, code, (const char*)mickey_fontdata); - if (++col == 320 / 8) - { + if (++col == 320 / 8) { col = 0; if (++row == 200 / 8) return; } @@ -326,15 +322,12 @@ void PreAgiEngine::clearTextArea() { } } -void PreAgiEngine::drawChar(int x, int y, int attr, int code, char *fontdata) -{ +void PreAgiEngine::drawChar(int x, int y, int attr, int code, const char *fontdata) { int cx, cy; uint8 color; - for (cy = 0; cy < 8; cy++) - { - for (cx = 0; cx < 8; cx++) - { + for (cy = 0; cy < 8; cy++) { + for (cx = 0; cx < 8; cx++) { if (fontdata[(code * 8) + cy] & (1 << (7 - cx))) color = attr & 0x0f; // foreground color else |