aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/preagi.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2007-09-02 13:44:23 +0000
committerMatthew Hoops2007-09-02 13:44:23 +0000
commitf3ae0182e09f3d15f4d0a6a896f5d39ba8ac8dfc (patch)
tree66d60e38b95095bc93c3b4b75016e24dbab40a43 /engines/agi/preagi.cpp
parentb4d77e60cfc4c8b0f49b4b06a79e85e64af10602 (diff)
downloadscummvm-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/agi/preagi.cpp')
-rw-r--r--engines/agi/preagi.cpp23
1 files changed, 8 insertions, 15 deletions
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