aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2010-11-01 20:40:33 +0000
committerMax Horn2010-11-01 20:40:33 +0000
commit3d5e2fa82093bba2492fc65e6f4ebd735907ea1e (patch)
tree8fba8327b200d760c3928f67a21f775472704b60
parent7d09121c712cdfd666f201c369ff5ba40366eec3 (diff)
downloadscummvm-rg350-3d5e2fa82093bba2492fc65e6f4ebd735907ea1e.tar.gz
scummvm-rg350-3d5e2fa82093bba2492fc65e6f4ebd735907ea1e.tar.bz2
scummvm-rg350-3d5e2fa82093bba2492fc65e6f4ebd735907ea1e.zip
HUGO: Replace Utils::Warn() by warning()
svn-id: r54021
-rw-r--r--engines/hugo/display.cpp2
-rw-r--r--engines/hugo/file.cpp2
-rw-r--r--engines/hugo/util.cpp37
-rw-r--r--engines/hugo/util.h1
4 files changed, 14 insertions, 28 deletions
diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp
index 0ac12076dc..b368ce9357 100644
--- a/engines/hugo/display.cpp
+++ b/engines/hugo/display.cpp
@@ -273,7 +273,7 @@ void Screen::displayList(dupdate_t update, ...) {
break;
case D_ADD: // Add a rectangle to list
if (addIndex >= DMAX) {
- Utils::Warn("%s", "Display list exceeded");
+ warning("Display list exceeded");
return;
}
va_start(marker, update); // Initialize variable arguments
diff --git a/engines/hugo/file.cpp b/engines/hugo/file.cpp
index 5374e09304..c3e59b19c9 100644
--- a/engines/hugo/file.cpp
+++ b/engines/hugo/file.cpp
@@ -268,7 +268,7 @@ sound_pt FileManager::getSound(int16 sound, uint16 *size) {
// Allocate memory for sound or music, if possible
sound_pt soundPtr = (byte *)malloc(s_hdr[sound].size); // Ptr to sound data
if (soundPtr == 0) {
- Utils::Warn("%s", "Low on memory");
+ warning("Low on memory");
return 0;
}
diff --git a/engines/hugo/util.cpp b/engines/hugo/util.cpp
index 73efb4cd38..a3e778e228 100644
--- a/engines/hugo/util.cpp
+++ b/engines/hugo/util.cpp
@@ -41,8 +41,8 @@
namespace Hugo {
/**
-* Returns index (0 to 7) of first 1 in supplied byte, or 8 if not found
-*/
+ * Returns index (0 to 7) of first 1 in supplied byte, or 8 if not found
+ */
int Utils::firstBit(byte data) {
if (!data)
return 8;
@@ -57,8 +57,8 @@ int Utils::firstBit(byte data) {
}
/**
-* Returns index (0 to 7) of last 1 in supplied byte, or 8 if not found
-*/
+ * Returns index (0 to 7) of last 1 in supplied byte, or 8 if not found
+ */
int Utils::lastBit(byte data) {
if (!data)
return 8;
@@ -73,8 +73,8 @@ int Utils::lastBit(byte data) {
}
/**
-* Reverse the bit order in supplied byte
-*/
+ * Reverse the bit order in supplied byte
+ */
void Utils::reverseByte(byte *data) {
byte maskIn = 0x80;
byte maskOut = 0x01;
@@ -98,7 +98,7 @@ char *Utils::Box(box_t dismiss, const char *s, ...) {
return 0;
if (strlen(s) > MAX_STRLEN - 100) { // Test length
- Warn("String too big:\n%s", s);
+ warning("String too big: '%s'", s);
return 0;
}
@@ -136,22 +136,9 @@ char *Utils::Box(box_t dismiss, const char *s, ...) {
}
/**
-* Warning handler. Print supplied message and continue
-* Arguments are same as printf
-*/
-void Utils::Warn(const char *format, ...) {
- char buffer[WARNLEN];
- va_list marker;
- va_start(marker, format);
- vsnprintf(buffer, WARNLEN, format, marker);
- va_end(marker);
- warning("Hugo warning: %s", buffer);
-}
-
-/**
-* Fatal error handler. Reset environment, print error and exit
-* Arguments are same as printf
-*/
+ * Fatal error handler. Reset environment, print error and exit
+ * Arguments are same as printf
+ */
void Utils::Error(int error_type, const char *format, ...) {
char buffer[ERRLEN + 1];
bool fatal = true; // Fatal error, else continue
@@ -194,8 +181,8 @@ void Utils::Error(int error_type, const char *format, ...) {
}
/**
-* Print options for user when dead
-*/
+ * Print options for user when dead
+ */
void Utils::gameOverMsg(void) {
//MessageBox(hwnd, gameoverstring, "Be more careful next time!", MB_OK | MB_ICONINFORMATION);
warning("STUB: Gameover_msg(): %s", HugoEngine::get()._textUtil[kGameOver]);
diff --git a/engines/hugo/util.h b/engines/hugo/util.h
index 69428fb3bb..a3e206dba9 100644
--- a/engines/hugo/util.h
+++ b/engines/hugo/util.h
@@ -55,7 +55,6 @@ int lastBit(byte data);
void gameOverMsg();
void reverseByte(byte *data);
void Error(int code, const char *format, ...) GCC_PRINTF(2, 3);
-void Warn(const char *format, ...) GCC_PRINTF(1, 2);
char *Box(box_t, const char *, ...) GCC_PRINTF(2, 3);
char *strlwr(char *buffer);