From: Tom <rtp...@us...> - 2011-04-15 23:16:38
|
gemrb: Infinity Engine emulator The branch master has been updated via 95c07cff7ec5c678b5ac946ea449d10aa3bff44c (commit) via daba0d9c25903b9d886691c41bf710b252187218 (commit) via 60180d8a45770443cfd005cd847e18a66fe6db3e (commit) via e87c4a62bac73d5945d42bd95872581664cef8e3 (commit) via 06358bcd6ed35277b211dfbb8dcea8757242b714 (commit) via 86acd42ff214b5a96c28b963da8f17c8893c749b (commit) via f4df64e846b5dcb587276676548731d3016e7350 (commit) via bbee89ee8f6ce2422ad56c7899d1b0ccdf1710ec (commit) Summary of changes: gemrb/GemRB.cpp | 4 +- gemrb/core/Animation.cpp | 8 +- gemrb/core/CMakeLists.txt | 1 + gemrb/core/CharAnimations.cpp | 32 +- gemrb/core/DialogHandler.cpp | 2 +- gemrb/core/EffectQueue.cpp | 26 +- gemrb/core/FileCache.cpp | 8 +- gemrb/core/GUI/Control.cpp | 12 +- gemrb/core/GUI/GameControl.cpp | 16 +- gemrb/core/GUI/Label.cpp | 2 +- gemrb/core/GUI/MapControl.cpp | 6 +- gemrb/core/GUI/TextArea.cpp | 28 +- gemrb/core/GUI/WorldMapControl.cpp | 4 +- gemrb/core/Game.cpp | 18 +- gemrb/core/GameData.cpp | 18 +- gemrb/core/GameScript/Actions.cpp | 42 +- gemrb/core/GameScript/GSUtils.cpp | 78 ++-- gemrb/core/GameScript/GameScript.cpp | 74 ++-- gemrb/core/GameScript/GameScript.h | 46 +- gemrb/core/GameScript/Matching.cpp | 4 +- gemrb/core/GameScript/Triggers.cpp | 12 +- gemrb/core/ImageMgr.cpp | 4 +- gemrb/core/IniSpawn.cpp | 2 +- gemrb/core/Interface.cpp | 88 ++-- gemrb/core/Inventory.cpp | 18 +- gemrb/core/Item.cpp | 2 +- gemrb/core/Makefile.am | 1 + gemrb/core/Map.cpp | 44 +- gemrb/core/PluginMgr.cpp | 22 +- gemrb/core/ResourceManager.cpp | 16 +- gemrb/core/SaveGameIterator.cpp | 10 +- gemrb/core/Scriptable/Actor.cpp | 138 +++--- gemrb/core/Scriptable/Container.cpp | 14 +- gemrb/core/Scriptable/Door.cpp | 18 +- gemrb/core/Scriptable/InfoPoint.cpp | 24 +- gemrb/core/Scriptable/Scriptable.cpp | 10 +- gemrb/core/ScriptedAnimation.cpp | 2 +- gemrb/core/Spell.cpp | 4 +- gemrb/core/Spellbook.cpp | 10 +- gemrb/core/System/FileStream.cpp | 2 +- gemrb/core/System/Logging.cpp | 154 +++++++ gemrb/core/System/Logging.h | 76 ++++ gemrb/core/System/SlicedStream.cpp | 2 +- gemrb/core/System/android_log_printf.cpp | 35 -- gemrb/core/System/android_log_printf.h | 24 -- gemrb/core/TileMap.cpp | 2 +- gemrb/core/Variables.cpp | 2 +- gemrb/core/WorldMap.cpp | 24 +- gemrb/includes/logging.h | 119 ------ gemrb/includes/win32def.h | 3 +- gemrb/plugins/AREImporter/AREImporter.cpp | 54 ++-- gemrb/plugins/BAMImporter/BAMImporter.cpp | 2 +- gemrb/plugins/BIFImporter/BIFImporter.cpp | 24 +- gemrb/plugins/BIKPlayer/BIKPlayer.cpp | 4 +- gemrb/plugins/BIKPlayer/GetBitContext.cpp | 2 +- gemrb/plugins/BMPImporter/BMPImporter.cpp | 6 +- gemrb/plugins/CREImporter/CREImporter.cpp | 16 +- gemrb/plugins/DLGImporter/DLGImporter.cpp | 4 +- gemrb/plugins/FXOpcodes/FXOpcodes.cpp | 618 ++++++++++++++-------------- gemrb/plugins/GAMImporter/GAMImporter.cpp | 2 +- gemrb/plugins/GUIScript/GUIScript.cpp | 60 ++-- gemrb/plugins/INIImporter/INIImporter.cpp | 2 +- gemrb/plugins/ITMImporter/ITMImporter.cpp | 4 +- gemrb/plugins/IWDOpcodes/IWDOpcodes.cpp | 210 +++++----- gemrb/plugins/KEYImporter/KEYImporter.cpp | 18 +- gemrb/plugins/MUSImporter/MUSImporter.cpp | 4 +- gemrb/plugins/MVEPlayer/MVEPlayer.cpp | 2 +- gemrb/plugins/MVEPlayer/gstmvedemux.h | 4 +- gemrb/plugins/MVEPlayer/mve_player.cpp | 14 +- gemrb/plugins/OpenALAudio/AmbientMgrAL.cpp | 2 +- gemrb/plugins/OpenALAudio/OpenALAudio.cpp | 10 +- gemrb/plugins/PLTImporter/PLTImporter.cpp | 2 +- gemrb/plugins/PROImporter/PROImporter.cpp | 2 +- gemrb/plugins/PSTOpcodes/PSTOpcodes.cpp | 44 +- gemrb/plugins/SDLAudio/SDLAudio.cpp | 14 +- gemrb/plugins/SDLVideo/SDLVideo.cpp | 12 +- gemrb/plugins/SPLImporter/SPLImporter.cpp | 4 +- gemrb/plugins/STOImporter/STOImporter.cpp | 2 +- gemrb/plugins/TISImporter/TISImporter.cpp | 12 +- gemrb/plugins/WEDImporter/WEDImporter.cpp | 6 +- gemrb/plugins/WMPImporter/WMPImporter.cpp | 4 +- 81 files changed, 1264 insertions(+), 1211 deletions(-) create mode 100644 gemrb/core/System/Logging.cpp create mode 100644 gemrb/core/System/Logging.h delete mode 100644 gemrb/core/System/android_log_printf.cpp delete mode 100644 gemrb/core/System/android_log_printf.h delete mode 100644 gemrb/includes/logging.h from 7f004525f9fe21e65073796b10ad0d09c7522f94 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=95c07cff7ec5c678b5ac946ea449d10aa3bff44c commit 95c07cff7ec5c678b5ac946ea449d10aa3bff44c Merge: daba0d9 7f00452 Author: Tom Prince <tom...@ua...> Date: Fri Apr 15 19:07:35 2011 -0400 Merge remote-tracking branch 'sf' into HEAD Conflicts: gemrb/core/Scriptable/Actor.cpp diff --cc gemrb/core/GameScript/Actions.cpp index a8aef93,40ea942..3f8a3e1 --- a/gemrb/core/GameScript/Actions.cpp +++ b/gemrb/core/GameScript/Actions.cpp @@@ -6224,12 -6224,13 +6224,13 @@@ void GameScript::SetNoOneOnTrigger(Scri ip = Sender->GetCurrentArea()->TMap->GetInfoPoint(parameters->objects[1]->objectName); } if (!ip || (ip->Type!=ST_TRIGGER && ip->Type!=ST_TRAVEL && ip->Type!=ST_PROXIMITY)) { - printf("Script error: No Trigger Named \"%s\"\n", parameters->objects[1]->objectName); + print("Script error: No Trigger Named \"%s\"\n", parameters->objects[1]->objectName); return; } - ip->LastEntered = 0; + // FIXME: what does this do? clear triggers? + /*ip->LastEntered = 0; ip->LastTrigger = 0; - ip->LastTriggerObject = 0; + ip->LastTriggerObject = 0;*/ } void GameScript::UseDoor(Scriptable* Sender, Action* parameters) diff --cc gemrb/core/Scriptable/Actor.cpp index d9ebd32,47b75b6..b3762de --- a/gemrb/core/Scriptable/Actor.cpp +++ b/gemrb/core/Scriptable/Actor.cpp @@@ -2997,12 -2988,12 +2988,12 @@@ void Actor::DebugDump( } else { for(i=0;i<7;i++) { - printf(" %d", Modified[IE_COLORS+i]); + print(" %d", Modified[IE_COLORS+i]); } } - printf( "\nWaitCounter: %d\n", (int) GetWait()); - printf( "LastTarget: %d %s\n", LastTarget, GetActorNameByID(LastTarget)); - printf( "LastTalked: %d %s\n", LastTalker, GetActorNameByID(LastTalker)); + print( "\nWaitCounter: %d\n", (int) GetWait()); + print( "LastTarget: %d %s\n", LastTarget, GetActorNameByID(LastTarget)); - print( "LastTalked: %d %s\n", LastTalkedTo, GetActorNameByID(LastTalkedTo)); ++ print( "LastTalked: %d %s\n", LastTalker, GetActorNameByID(LastTalker)); inventory.dump(); spellbook.dump(); fxqueue.dump(); http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=daba0d9c25903b9d886691c41bf710b252187218 commit daba0d9c25903b9d886691c41bf710b252187218 Author: Tom Prince <tom...@ua...> Date: Fri Apr 15 11:49:39 2011 -0400 logging: Android supports vprint, so leave only msvc with bogus codepath. (msvc6 doesn't support vcprintf) diff --git a/gemrb/core/System/Logging.cpp b/gemrb/core/System/Logging.cpp index 17e427f..14263d0 100644 --- a/gemrb/core/System/Logging.cpp +++ b/gemrb/core/System/Logging.cpp @@ -34,6 +34,15 @@ void print(const char *message, ...) { va_list ap; +#if (!defined(WIN32) || defined(__MINGW32__)) + va_start(ap, message); +# ifdef ANDROID + __android_log_vprint(ANDROID_LOG_INFO, "printf:", message, ap); +# else + vprintf(message, ap); +# endif + va_end(ap); +#else va_start(ap, message); int size = vsnprintf(NULL, 0, message, ap); va_end(ap); @@ -46,16 +55,11 @@ void print(const char *message, ...) vsprintf(buff, message, ap); va_end(ap); -#if (!defined(WIN32) || defined(__MINGW32__)) && !defined(ANDROID) - // NOTE: We could do this without the allocation, but this path gets tested more. - printf("%s", buff); -#elif defined(ANDROID) - __android_log_print(ANDROID_LOG_INFO, "print:", "%s", message); -#else cprintf("%s", message); -#endif + free(buff); va_end(ap); +#endif } #ifdef WIN32 http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=60180d8a45770443cfd005cd847e18a66fe6db3e commit 60180d8a45770443cfd005cd847e18a66fe6db3e Author: Tom Prince <tom...@ua...> Date: Fri Apr 15 11:04:29 2011 -0400 logging: Header file cleanup diff --git a/gemrb/core/System/Logging.cpp b/gemrb/core/System/Logging.cpp index 9288374..17e427f 100644 --- a/gemrb/core/System/Logging.cpp +++ b/gemrb/core/System/Logging.cpp @@ -25,6 +25,11 @@ #include <android/log.h> #endif +#ifdef WIN32 +# define ADV_TEXT +# include <conio.h> +#endif + void print(const char *message, ...) { va_list ap; diff --git a/gemrb/core/System/Logging.h b/gemrb/core/System/Logging.h index 5f8f334..c31a135 100644 --- a/gemrb/core/System/Logging.h +++ b/gemrb/core/System/Logging.h @@ -29,21 +29,18 @@ #include "exports.h" #include "win32def.h" -#ifdef ANDROID -# include <android/log.h> -#endif - -#ifdef WIN32 -# define ADV_TEXT -# include <conio.h> +#if defined(ANDROID) +# include <android/log.h> +// FIXME: Are these include necesary? +# include <cstdio> +# include <cstdlib> +#elif defined(WIN32) extern GEM_EXPORT HANDLE hConsole; #else //WIN32 -# ifndef ANDROID -# include <config.h> -# endif -# include <cstdio> -# include <cstdlib> -#endif //WIN32 +# include <config.h> +# include <cstdio> +# include <cstdlib> +#endif enum log_color { DEFAULT, http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=e87c4a62bac73d5945d42bd95872581664cef8e3 commit e87c4a62bac73d5945d42bd95872581664cef8e3 Author: Tom Prince <tom...@ua...> Date: Fri Apr 15 11:00:26 2011 -0400 logging: make print* functions instead of macros. diff --git a/gemrb/core/System/Logging.cpp b/gemrb/core/System/Logging.cpp index 2d8f09f..9288374 100644 --- a/gemrb/core/System/Logging.cpp +++ b/gemrb/core/System/Logging.cpp @@ -104,3 +104,42 @@ void textcolor(log_color c) #endif #endif } + +#ifndef ANDROID +void printBracket(const char* status, log_color color) +{ + textcolor(WHITE); + print("["); + textcolor(color); + print("%s", status); + textcolor(WHITE); + print("]"); +} + +void printStatus(const char* status, log_color color) +{ + printBracket(status, color); + print("\n"); +} + +void printMessage(const char* owner, const char* message, log_color color) +{ + printBracket(owner, LIGHT_WHITE); + print(": "); + textcolor(color); + print("%s", message); +} +#else /* !ANDROID */ +void printBracket(const char* status, log_color color) +{ +} + +void printStatus(const char* status, log_color color) +{ + __android_log_print(ANDROID_LOG_INFO, "GemRB", "[%s]", status) +} + +void printMessage(const char* owner, const char* message, log_color color) + __android_log_print(ANDROID_LOG_INFO, "GemRB", "%s: %s", owner, message) +} +#endif diff --git a/gemrb/core/System/Logging.h b/gemrb/core/System/Logging.h index 07fd3a5..5f8f334 100644 --- a/gemrb/core/System/Logging.h +++ b/gemrb/core/System/Logging.h @@ -64,18 +64,12 @@ enum log_color { LIGHT_WHITE }; -#ifndef ANDROID -# define printBracket(status, color) textcolor(WHITE); print("["); textcolor(color); print("%s", status); textcolor(WHITE); print("]") -# define printStatus(status, color) printBracket(status, color); print("\n") -# define printMessage(owner, message, color) printBracket(owner, LIGHT_WHITE); print(": "); textcolor(color); print("%s", message) -#else -# define printBracket(status, color) -# define printStatus(status, color) __android_log_print(ANDROID_LOG_INFO, "GemRB", "[%s]", status) -# define printMessage(owner, message, color) __android_log_print(ANDROID_LOG_INFO, "GemRB", "%s: %s", owner, message) -#endif GEM_EXPORT void print(const char* message, ...); GEM_EXPORT void textcolor(log_color); +GEM_EXPORT void printBracket(const char *status, log_color color); +GEM_EXPORT void printStatus(const char* status, log_color color); +GEM_EXPORT void printMessage(const char* owner, const char* message, log_color color); #if (__GNUC__ > 4) // poison printf http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=06358bcd6ed35277b211dfbb8dcea8757242b714 commit 06358bcd6ed35277b211dfbb8dcea8757242b714 Author: Tom Prince <tom...@ua...> Date: Fri Apr 15 10:53:10 2011 -0400 logging: Move color knowledge out of header. diff --git a/gemrb/core/System/Logging.cpp b/gemrb/core/System/Logging.cpp index 8445317..2d8f09f 100644 --- a/gemrb/core/System/Logging.cpp +++ b/gemrb/core/System/Logging.cpp @@ -52,3 +52,55 @@ void print(const char *message, ...) free(buff); va_end(ap); } + +#ifdef WIN32 +static int colors[] = { + 0, + FOREGROUND_RED, + FOREGROUND_GREEN, + FOREGROUND_GREEN | FOREGROUND_RED, + FOREGROUND_BLUE, + FOREGROUND_RED | FOREGROUND_BLUE, + FOREGROUND_BLUE | FOREGROUND_GREEN, + FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED, + (RED | FOREGROUND_INTENSITY), + (GREEN | FOREGROUND_INTENSITY), + (GREEN | RED | FOREGROUND_INTENSITY), + (BLUE | FOREGROUND_INTENSITY), + (MAGENTA | FOREGROUND_INTENSITY), + (CYAN | FOREGROUND_INTENSITY), + (WHITE | FOREGROUND_INTENSITY), + WHITE +}; +#else +static const char* colors[] = { + "\033[0m", + "\033[0m\033[30;40m", + "\033[0m\033[31;40m", + "\033[0m\033[32;40m", + "\033[0m\033[33;40m", + "\033[0m\033[34;40m", + "\033[0m\033[35;40m", + "\033[0m\033[36;40m", + "\033[0m\033[37;40m", + "\033[1m\033[31;40m", + "\033[1m\033[32;40m", + "\033[1m\033[33;40m", + "\033[1m\033[34;40m", + "\033[1m\033[35;40m", + "\033[1m\033[36;40m", + "\033[1m\033[37;40m" +}; +#endif + + +void textcolor(log_color c) +{ +#ifndef NOCOLOR +#ifdef WIN32 + SetConsoleTextAttribute(hConsole, colors[c]); +#else + printf("%s", colors[c]); +#endif +#endif +} diff --git a/gemrb/core/System/Logging.h b/gemrb/core/System/Logging.h index abb5364..07fd3a5 100644 --- a/gemrb/core/System/Logging.h +++ b/gemrb/core/System/Logging.h @@ -37,70 +37,32 @@ # define ADV_TEXT # include <conio.h> extern GEM_EXPORT HANDLE hConsole; -# define textcolor(i) SetConsoleTextAttribute(hConsole, i) #else //WIN32 # ifndef ANDROID # include <config.h> # endif # include <cstdio> # include <cstdlib> -# define textcolor(i) i #endif //WIN32 -#ifdef NOCOLOR -# define DEFAULT print("%s",""); -# define BLACK print("%s",""); -# define RED print("%s",""); -# define GREEN print("%s",""); -# define BROWN print("%s",""); -# define BLUE print("%s",""); -# define MAGENTA print("%s",""); -# define CYAN print("%s",""); -# define WHITE print("%s",""); -# define LIGHT_RED print("%s",""); -# define LIGHT_GREEN print("%s",""); -# define YELLOW print("%s",""); -# define LIGHT_BLUE print("%s",""); -# define LIGHT_MAGENTA print("%s",""); -# define LIGHT_CYAN print("%s",""); -# define LIGHT_WHITE print("%s",""); -#else -# ifdef WIN32 -# define BLACK 0 -# define RED FOREGROUND_RED -# define GREEN FOREGROUND_GREEN -# define BROWN FOREGROUND_GREEN | FOREGROUND_RED -# define BLUE FOREGROUND_BLUE -# define MAGENTA FOREGROUND_RED | FOREGROUND_BLUE -# define CYAN FOREGROUND_BLUE | FOREGROUND_GREEN -# define WHITE FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED -# define LIGHT_RED (RED | FOREGROUND_INTENSITY) -# define LIGHT_GREEN (GREEN | FOREGROUND_INTENSITY) -# define YELLOW (GREEN | RED | FOREGROUND_INTENSITY) -# define LIGHT_BLUE (BLUE | FOREGROUND_INTENSITY) -# define LIGHT_MAGENTA (MAGENTA | FOREGROUND_INTENSITY) -# define LIGHT_CYAN (CYAN | FOREGROUND_INTENSITY) -# define LIGHT_WHITE (WHITE | FOREGROUND_INTENSITY) -# define DEFAULT WHITE -# else //WIN32 -# define DEFAULT print("\033[0m"); -# define BLACK print("\033[0m\033[30;40m"); -# define RED print("\033[0m\033[31;40m"); -# define GREEN print("\033[0m\033[32;40m"); -# define BROWN print("\033[0m\033[33;40m"); -# define BLUE print("\033[0m\033[34;40m"); -# define MAGENTA print("\033[0m\033[35;40m"); -# define CYAN print("\033[0m\033[36;40m"); -# define WHITE print("\033[0m\033[37;40m"); -# define LIGHT_RED print("\033[1m\033[31;40m"); -# define LIGHT_GREEN print("\033[1m\033[32;40m"); -# define YELLOW print("\033[1m\033[33;40m"); -# define LIGHT_BLUE print("\033[1m\033[34;40m"); -# define LIGHT_MAGENTA print("\033[1m\033[35;40m"); -# define LIGHT_CYAN print("\033[1m\033[36;40m"); -# define LIGHT_WHITE print("\033[1m\033[37;40m"); -# endif //WIN32 -#endif +enum log_color { + DEFAULT, + BLACK, + RED, + GREEN, + BROWN, + BLUE, + MAGENTA, + CYAN, + WHITE, + LIGHT_RED, + LIGHT_GREEN, + YELLOW, + LIGHT_BLUE, + LIGHT_MAGENTA, + LIGHT_CYAN, + LIGHT_WHITE +}; #ifndef ANDROID # define printBracket(status, color) textcolor(WHITE); print("["); textcolor(color); print("%s", status); textcolor(WHITE); print("]") @@ -113,6 +75,7 @@ extern GEM_EXPORT HANDLE hConsole; #endif GEM_EXPORT void print(const char* message, ...); +GEM_EXPORT void textcolor(log_color); #if (__GNUC__ > 4) // poison printf http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=86acd42ff214b5a96c28b963da8f17c8893c749b commit 86acd42ff214b5a96c28b963da8f17c8893c749b Author: Tom Prince <tom...@ua...> Date: Fri Apr 15 09:28:15 2011 -0400 logging: Poison printf, so it doesn't get re-introduced. This is only with recent gcc, but that is enough to keep it out. Signed-off-by: Tom Prince <tom...@ua...> diff --git a/gemrb/core/System/Logging.h b/gemrb/core/System/Logging.h index 2eedbf3..abb5364 100644 --- a/gemrb/core/System/Logging.h +++ b/gemrb/core/System/Logging.h @@ -114,4 +114,9 @@ extern GEM_EXPORT HANDLE hConsole; GEM_EXPORT void print(const char* message, ...); +#if (__GNUC__ > 4) +// poison printf +extern "C" int printf(const char* message, ...) __attribute__ ((deprecated)) +#endif + #endif http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=f4df64e846b5dcb587276676548731d3016e7350 commit f4df64e846b5dcb587276676548731d3016e7350 Author: Tom Prince <tom...@ua...> Date: Fri Apr 15 09:25:19 2011 -0400 logging: Change printing to use print instead of printf. Signed-off-by: Tom Prince <tom...@ua...> diff --git a/gemrb/GemRB.cpp b/gemrb/GemRB.cpp index 9f8b08b..2ec6fd7 100644 --- a/gemrb/GemRB.cpp +++ b/gemrb/GemRB.cpp @@ -22,8 +22,6 @@ #include "win32def.h" // logging -#include <cstdio> - #include "Interface.h" @@ -56,7 +54,7 @@ int main(int argc, char* argv[]) core = new Interface( argc, argv ); if (core->Init() == GEM_ERROR) { delete( core ); - printf("Press enter to continue..."); + print("Press enter to continue..."); textcolor(DEFAULT); getc(stdin); return -1; diff --git a/gemrb/core/Animation.cpp b/gemrb/core/Animation.cpp index 6ec1caa..bcf1ba2 100644 --- a/gemrb/core/Animation.cpp +++ b/gemrb/core/Animation.cpp @@ -71,7 +71,7 @@ void Animation::SetPos(unsigned int index) void Animation::AddFrame(Sprite2D* frame, unsigned int index) { if (index>=indicesCount) { - printf("You tried to write past a buffer in animation, BAD!\n"); + print("You tried to write past a buffer in animation, BAD!\n"); abort(); } core->GetVideoDriver()->FreeSprite(frames[index]); @@ -107,7 +107,7 @@ unsigned int Animation::GetCurrentFrame() const Sprite2D* Animation::LastFrame(void) { if (!Flags&A_ANI_ACTIVE) { - printf("Frame fetched while animation is inactive!\n"); + print("Frame fetched while animation is inactive!\n"); return NULL; } if (gameAnimation) { @@ -126,7 +126,7 @@ Sprite2D* Animation::LastFrame(void) Sprite2D* Animation::NextFrame(void) { if (!Flags&A_ANI_ACTIVE) { - printf("Frame fetched while animation is inactive!\n"); + print("Frame fetched while animation is inactive!\n"); return NULL; } if (starttime == 0) { @@ -180,7 +180,7 @@ Sprite2D* Animation::NextFrame(void) Sprite2D* Animation::GetSyncedNextFrame(Animation* master) { if (!Flags&A_ANI_ACTIVE) { - printf("Frame fetched while animation is inactive!\n"); + print("Frame fetched while animation is inactive!\n"); return NULL; } Sprite2D* ret; diff --git a/gemrb/core/CharAnimations.cpp b/gemrb/core/CharAnimations.cpp index 66dc4b1..8bd6279 100644 --- a/gemrb/core/CharAnimations.cpp +++ b/gemrb/core/CharAnimations.cpp @@ -512,7 +512,7 @@ void CharAnimations::InitAvatarsTable() valid_number(blood->QueryField(i,2), (long &)rmax); if (value>255 || rmin>0xffff || rmax>0xffff) { printMessage("CharAnimations", "bloodclr entry:", LIGHT_RED); - printf("%02x %04x-%04x ", (unsigned int) value, (unsigned int) rmin, (unsigned int) rmax); + print("%02x %04x-%04x ", (unsigned int) value, (unsigned int) rmin, (unsigned int) rmax); printStatus("Invalid value!", LIGHT_RED); continue; } @@ -610,7 +610,7 @@ CharAnimations::CharAnimations(unsigned int AnimID, ieDword ArmourLevel) } ResRef[0]=0; printMessage("CharAnimations", " ", LIGHT_RED); - printf("Invalid or nonexistent avatar entry:%04X\n", AnimID); + print("Invalid or nonexistent avatar entry:%04X\n", AnimID); } //we have to drop them when armourlevel changes @@ -782,7 +782,7 @@ WSW 003 | 013 ESE Animation** CharAnimations::GetAnimation(unsigned char Stance, unsigned char Orient) { if (StanceID>=MAX_ANIMS) { - printf("Illegal stance ID\n"); + print("Illegal stance ID\n"); abort(); } @@ -864,7 +864,7 @@ Animation** CharAnimations::GetAnimation(unsigned char Stance, unsigned char Ori autoSwitchOnEnd = true; break; default: - printf ("Invalid Stance: %d\n", StanceID); + print ("Invalid Stance: %d\n", StanceID); break; } Animation** anims = Anims[StanceID][Orient]; @@ -1380,7 +1380,7 @@ void CharAnimations::AddVHR2Suffix(char* ResRef, unsigned char StanceID, strcat( ResRef, "g11" ); break; default: - printf("VHR2 Animation: unhandled stance: %s %d\n", ResRef, StanceID); + print("VHR2 Animation: unhandled stance: %s %d\n", ResRef, StanceID); abort(); break; } @@ -1459,7 +1459,7 @@ void CharAnimations::AddVHR3Suffix(char* ResRef, unsigned char StanceID, strcat( ResRef, "g11" ); break; default: - printf("VHR3 Animation: unhandled stance: %s %d\n", ResRef, StanceID); + print("VHR3 Animation: unhandled stance: %s %d\n", ResRef, StanceID); abort(); break; } @@ -1521,7 +1521,7 @@ void CharAnimations::AddFFSuffix(char* ResRef, unsigned char StanceID, break; default: - printf("Four frames Animation: unhandled stance: %s %d\n", ResRef, StanceID); + print("Four frames Animation: unhandled stance: %s %d\n", ResRef, StanceID); abort(); break; @@ -1663,7 +1663,7 @@ void CharAnimations::AddVHRSuffix(char* ResRef, unsigned char StanceID, break; default: - printf("VHR Animation: unhandled stance: %s %d\n", ResRef, StanceID); + print("VHR Animation: unhandled stance: %s %d\n", ResRef, StanceID); abort(); break; } @@ -1737,7 +1737,7 @@ void CharAnimations::AddSixSuffix(char* ResRef, unsigned char StanceID, break; default: - printf("Six Animation: unhandled stance: %s %d\n", ResRef, StanceID); + print("Six Animation: unhandled stance: %s %d\n", ResRef, StanceID); abort(); break; @@ -1787,7 +1787,7 @@ void CharAnimations::AddLR2Suffix(char* ResRef, unsigned char StanceID, Cycle = 32 + Orient; break; default: - printf("LR2 Animation: unhandled stance: %s %d\n", ResRef, StanceID); + print("LR2 Animation: unhandled stance: %s %d\n", ResRef, StanceID); abort(); break; } @@ -1910,7 +1910,7 @@ void CharAnimations::AddMHRSuffix(char* ResRef, unsigned char StanceID, Cycle = Orient; break; default: - printf("MHR Animation: unhandled stance: %s %d\n", ResRef, StanceID); + print("MHR Animation: unhandled stance: %s %d\n", ResRef, StanceID); abort(); break; } @@ -2024,7 +2024,7 @@ void CharAnimations::AddLRSuffix2( char* ResRef, unsigned char StanceID, Cycle = 40 + Orient / 2; break; default: - printf("LRSuffix2 Animation: unhandled stance: %s %d\n", ResRef, StanceID); + print("LRSuffix2 Animation: unhandled stance: %s %d\n", ResRef, StanceID); abort(); break; } @@ -2101,7 +2101,7 @@ void CharAnimations::AddLRSuffix( char* ResRef, unsigned char StanceID, Cycle = 40 + Orient / 2; break; default: - printf("LR Animation: unhandled stance: %s %d\n", ResRef, StanceID); + print("LR Animation: unhandled stance: %s %d\n", ResRef, StanceID); abort(); break; } @@ -2175,7 +2175,7 @@ void CharAnimations::AddLR3Suffix( char* ResRef, unsigned char StanceID, Cycle = 24 + Orient / 2; break; default: - printf("LR3 Animation: unhandled stance: %s %d\n", ResRef, StanceID); + print("LR3 Animation: unhandled stance: %s %d\n", ResRef, StanceID); abort(); break; } @@ -2250,7 +2250,7 @@ void CharAnimations::AddMMR2Suffix(char* ResRef, unsigned char StanceID, Cycle = ( Orient / 2 ); break; default: - printf("MMR Animation: unhandled stance: %s %d\n", ResRef, StanceID); + print("MMR Animation: unhandled stance: %s %d\n", ResRef, StanceID); abort(); break; } @@ -2337,7 +2337,7 @@ void CharAnimations::AddMMRSuffix(char* ResRef, unsigned char StanceID, Cycle = ( Orient / 2 ); break; default: - printf("MMR Animation: unhandled stance: %s %d\n", ResRef, StanceID); + print("MMR Animation: unhandled stance: %s %d\n", ResRef, StanceID); abort(); break; } diff --git a/gemrb/core/DialogHandler.cpp b/gemrb/core/DialogHandler.cpp index 0be1070..f1d86c5 100644 --- a/gemrb/core/DialogHandler.cpp +++ b/gemrb/core/DialogHandler.cpp @@ -69,7 +69,7 @@ int DialogHandler::InitDialog(Scriptable* spk, Scriptable* tgt, const char* dlgr if (!dlg) { printMessage("GameControl", " ", LIGHT_RED); - printf( "Cannot start dialog: %s\n", dlgref ); + print( "Cannot start dialog: %s\n", dlgref ); return -1; } diff --git a/gemrb/core/EffectQueue.cpp b/gemrb/core/EffectQueue.cpp index ca980d6..eff4356 100644 --- a/gemrb/core/EffectQueue.cpp +++ b/gemrb/core/EffectQueue.cpp @@ -181,7 +181,7 @@ static EffectDesc* FindEffect(const char* effectname) void *tmp = bsearch(effectname, effectnames, effectnames_count, sizeof(EffectDesc), find_effect); if( !tmp) { printMessage( "EffectQueue", "", YELLOW); - printf("Couldn't assign effect: %s\n", effectname ); + print("Couldn't assign effect: %s\n", effectname ); } return (EffectDesc *) tmp; } @@ -250,12 +250,12 @@ bool Init_EffectQueue() //reverse linking opcode number //using this unused field if( (poi->opcode!=-1) && effectname[0]!='*') { - printf("Clashing Opcodes FN: %d vs. %d, %s\n", i, poi->opcode, effectname); + print("Clashing Opcodes FN: %d vs. %d, %s\n", i, poi->opcode, effectname); abort(); } poi->opcode = i; } - //printf("-------- FN: %d, %s\n", i, effectname); + //print("-------- FN: %d, %s\n", i, effectname); } core->DelSymbol( eT ); @@ -634,7 +634,7 @@ all_party: case FX_TARGET_UNKNOWN: default: - printf( "Unknown FX target type: %d\n", fx->Target); + print( "Unknown FX target type: %d\n", fx->Target); flg = FX_ABORT; break; } @@ -950,11 +950,11 @@ static bool check_resistance(Actor* actor, Effect* fx) //opcode immunity if( actor->fxqueue.HasEffectWithParam(fx_opcode_immunity_ref, fx->Opcode) ) { - printf ("immune to effect: %s\n", (char*) Opcodes[fx->Opcode].Name); + print ("immune to effect: %s\n", (char*) Opcodes[fx->Opcode].Name); return true; } if( actor->fxqueue.HasEffectWithParam(fx_opcode_immunity2_ref, fx->Opcode) ) { - printf ("immune2 to effect: %s\n", (char*) Opcodes[fx->Opcode].Name); + print ("immune2 to effect: %s\n", (char*) Opcodes[fx->Opcode].Name); return true; } @@ -987,7 +987,7 @@ static bool check_resistance(Actor* actor, Effect* fx) if( fx->random_value < val) { // when using biased magic resistance non-hostile spells aren't resisted if ((selective_mr && (fx->SourceFlags&SF_HOSTILE)) || !selective_mr) { - printf ("effect resisted: %s\n", (char*) Opcodes[fx->Opcode].Name); + print ("effect resisted: %s\n", (char*) Opcodes[fx->Opcode].Name); return true; } } @@ -1006,7 +1006,7 @@ static bool check_resistance(Actor* actor, Effect* fx) if( fx->IsSaveForHalfDamage) { fx->Parameter1/=2; } else { - printf ("%s saved against effect: %s\n", actor->GetName(1), (char*) Opcodes[fx->Opcode].Name); + print ("%s saved against effect: %s\n", actor->GetName(1), (char*) Opcodes[fx->Opcode].Name); return true; } } @@ -1025,7 +1025,7 @@ static bool check_resistance(Actor* actor, Effect* fx) int EffectQueue::ApplyEffect(Actor* target, Effect* fx, ieDword first_apply, ieDword resistance) const { - //printf( "FX 0x%02x: %s(%d, %d)\n", fx->Opcode, effectnames[fx->Opcode].Name, fx->Parameter1, fx->Parameter2 ); + //print( "FX 0x%02x: %s(%d, %d)\n", fx->Opcode, effectnames[fx->Opcode].Name, fx->Parameter1, fx->Parameter2 ); if( fx->Opcode >= MAX_EFFECTS) { fx->TimingMode = FX_DURATION_JUST_EXPIRED; return FX_NOT_APPLIED; @@ -1110,7 +1110,7 @@ int EffectQueue::ApplyEffect(Actor* target, Effect* fx, ieDword first_apply, ieD break; //this shouldn't happen default: - printf("Unknown delay type: %d (from %d)\n", DelayType(fx->TimingMode&0xff), fx->TimingMode); + print("Unknown delay type: %d (from %d)\n", DelayType(fx->TimingMode&0xff), fx->TimingMode); abort(); } @@ -1118,7 +1118,7 @@ int EffectQueue::ApplyEffect(Actor* target, Effect* fx, ieDword first_apply, ieD if( fx->Opcode<MAX_EFFECTS) { fn = Opcodes[fx->Opcode].Function; if (!(target || (Opcodes[fx->Opcode].Flags & EFFECT_NO_ACTOR))) { - printf("targetless opcode without EFFECT_NO_ACTOR: %d, skipping\n", fx->Opcode); + print("targetless opcode without EFFECT_NO_ACTOR: %d, skipping\n", fx->Opcode); return FX_NOT_APPLIED; } } @@ -1727,7 +1727,7 @@ bool EffectQueue::HasAnyDispellableEffect() const void EffectQueue::dump() const { - printf( "EFFECT QUEUE:\n" ); + print( "EFFECT QUEUE:\n" ); int i = 0; std::list< Effect* >::const_iterator f; for ( f = effects.begin(); f != effects.end(); f++ ) { @@ -1737,7 +1737,7 @@ void EffectQueue::dump() const if( fx->Opcode < MAX_EFFECTS) Name = (char*) Opcodes[fx->Opcode].Name; - printf( " %2d: 0x%02x: %s (%d, %d) S:%s\n", i++, fx->Opcode, Name, fx->Parameter1, fx->Parameter2, fx->Source ); + print( " %2d: 0x%02x: %s (%d, %d) S:%s\n", i++, fx->Opcode, Name, fx->Parameter1, fx->Parameter2, fx->Source ); } } } diff --git a/gemrb/core/FileCache.cpp b/gemrb/core/FileCache.cpp index 0be598d..c2cd7a0 100644 --- a/gemrb/core/FileCache.cpp +++ b/gemrb/core/FileCache.cpp @@ -26,7 +26,7 @@ DataStream* CacheCompressedStream(DataStream *stream, const char* filename, int length, bool overwrite) { if (!core->IsAvailable(PLUGIN_COMPRESSION_ZLIB)) { - printf( "No Compression Manager Available.\nCannot Load Compressed File.\n" ); + print( "No Compression Manager Available.\nCannot Load Compressed File.\n" ); return NULL; } @@ -39,7 +39,7 @@ DataStream* CacheCompressedStream(DataStream *stream, const char* filename, int FileStream out; if (!out.Create(path)) { printMessage("FileCache", " ", RED); - printf( "Cannot write %s.\n", path ); + print( "Cannot write %s.\n", path ); return NULL; } @@ -66,7 +66,7 @@ DataStream* CacheFile(const char* path) FileStream* src = FileStream::OpenFile(path); FileStream* dest = FileStream::OpenFile(cachedfile); if (!src || !dest) { - printf("CachdFile failed to write to cached file '%s' (from '%s')\n", cachedfile, path); + print("CachdFile failed to write to cached file '%s' (from '%s')\n", cachedfile, path); abort(); } @@ -78,7 +78,7 @@ DataStream* CacheFile(const char* path) size_t len = src->Read(buff, blockSize); size_t c = dest->Write(buff, len); if (c != len) { - printf("CacheFile failed to write to cached file '%s' (from '%s')\n", cachedfile, path); + print("CacheFile failed to write to cached file '%s' (from '%s')\n", cachedfile, path); abort(); } } while (src->Remains()); diff --git a/gemrb/core/GUI/Control.cpp b/gemrb/core/GUI/Control.cpp index fc02eb9..ca12165 100644 --- a/gemrb/core/GUI/Control.cpp +++ b/gemrb/core/GUI/Control.cpp @@ -123,7 +123,7 @@ int Control::RunEventHandler(EventHandler handler) /** Key Press Event */ void Control::OnKeyPress(unsigned char Key, unsigned short /*Mod*/) { - //printf("OnKeyPress: CtrlID = 0x%08X, Key = %c (0x%02hX)\n", (unsigned int) ControlID, Key, Key); + //print("OnKeyPress: CtrlID = 0x%08X, Key = %c (0x%02hX)\n", (unsigned int) ControlID, Key, Key); #ifdef ANDROID // mapping volume control to volume control keys on device, these keys must be set up in AndroidAppSettings.cfg switch(Key) { case 'o': // volume down @@ -163,25 +163,25 @@ void Control::OnKeyPress(unsigned char Key, unsigned short /*Mod*/) /** Key Release Event */ void Control::OnKeyRelease(unsigned char /*Key*/, unsigned short /*Mod*/) { - //printf( "OnKeyRelease: CtrlID = 0x%08X, Key = %c (0x%02hX)\n", (unsigned int) ControlID, Key, Key ); + //print( "OnKeyRelease: CtrlID = 0x%08X, Key = %c (0x%02hX)\n", (unsigned int) ControlID, Key, Key ); } /** Mouse Enter Event */ void Control::OnMouseEnter(unsigned short /*x*/, unsigned short /*y*/) { -// printf("OnMouseEnter: CtrlID = 0x%08X, x = %hd, y = %hd\n", (unsigned int) ControlID, x, y); +// print("OnMouseEnter: CtrlID = 0x%08X, x = %hd, y = %hd\n", (unsigned int) ControlID, x, y); } /** Mouse Leave Event */ void Control::OnMouseLeave(unsigned short /*x*/, unsigned short /*y*/) { -// printf("OnMouseLeave: CtrlID = 0x%08X, x = %hd, y = %hd\n", (unsigned int) ControlID, x, y); +// print("OnMouseLeave: CtrlID = 0x%08X, x = %hd, y = %hd\n", (unsigned int) ControlID, x, y); } /** Mouse Over Event */ void Control::OnMouseOver(unsigned short /*x*/, unsigned short /*y*/) { - //printf("OnMouseOver: CtrlID = 0x%08X, x = %hd, y = %hd\n", (unsigned int) ControlID, x, y); + //print("OnMouseOver: CtrlID = 0x%08X, x = %hd, y = %hd\n", (unsigned int) ControlID, x, y); } /** Mouse Button Down */ @@ -200,7 +200,7 @@ void Control::OnMouseDown(unsigned short x, unsigned short y, void Control::OnMouseUp(unsigned short /*x*/, unsigned short /*y*/, unsigned short /*Button*/, unsigned short /*Mod*/) { - //printf("OnMouseUp: CtrlID = 0x%08X, x = %hd, y = %hd, Button = %d, Mos = %hd\n", (unsigned int) ControlID, x, y, Button, Mod); + //print("OnMouseUp: CtrlID = 0x%08X, x = %hd, y = %hd, Button = %d, Mos = %hd\n", (unsigned int) ControlID, x, y, Button, Mod); } /** Special Key Press */ diff --git a/gemrb/core/GUI/GameControl.cpp b/gemrb/core/GUI/GameControl.cpp index e4c2352..435fff2 100644 --- a/gemrb/core/GUI/GameControl.cpp +++ b/gemrb/core/GUI/GameControl.cpp @@ -881,7 +881,7 @@ void GameControl::OnKeyRelease(unsigned char Key, unsigned short Mod) area->MoveVisibleGroundPiles(p); break; case 'x': // shows coordinates on the map - printf( "%s [%d.%d]\n", area->GetScriptName(), p.x, p.y ); + print( "%s [%d.%d]\n", area->GetScriptName(), p.x, p.y ); break; case 'g'://shows loaded areas and other game information game->DebugDump(); @@ -997,22 +997,22 @@ void GameControl::OnKeyRelease(unsigned char Key, unsigned short Mod) break; case '4': //show all traps and infopoints DebugFlags ^= DEBUG_SHOW_INFOPOINTS; - printf("Show traps and infopoints %s\n", DebugFlags & DEBUG_SHOW_INFOPOINTS ? "ON" : "OFF"); + print("Show traps and infopoints %s\n", DebugFlags & DEBUG_SHOW_INFOPOINTS ? "ON" : "OFF"); break; case '6': //show the lightmap DebugFlags ^= DEBUG_SHOW_LIGHTMAP; - printf("Show lightmap %s\n", DebugFlags & DEBUG_SHOW_LIGHTMAP ? "ON" : "OFF"); + print("Show lightmap %s\n", DebugFlags & DEBUG_SHOW_LIGHTMAP ? "ON" : "OFF"); break; case '7': //toggles fog of war core->FogOfWar ^= FOG_DRAWFOG; - printf("Show Fog-Of-War: %s\n", core->FogOfWar & FOG_DRAWFOG ? "ON" : "OFF"); + print("Show Fog-Of-War: %s\n", core->FogOfWar & FOG_DRAWFOG ? "ON" : "OFF"); break; case '8': //show searchmap over area core->FogOfWar ^= FOG_DRAWSEARCHMAP; - printf("Show searchmap %s\n", core->FogOfWar & FOG_DRAWSEARCHMAP ? "ON" : "OFF"); + print("Show searchmap %s\n", core->FogOfWar & FOG_DRAWSEARCHMAP ? "ON" : "OFF"); break; default: - printf( "KeyRelease:%d - %d\n", Key, Mod ); + print( "KeyRelease:%d - %d\n", Key, Mod ); break; } return; //return from cheatkeys @@ -2394,7 +2394,7 @@ void GameControl::HandleWindowHide(const char *WindowName, const char *WindowPos return; } printMessage("GameControl", "Invalid Window Index: ", LIGHT_RED); - printf("%s:%u\n",WindowName, index); + print("%s:%u\n",WindowName, index); } } } @@ -2447,7 +2447,7 @@ void GameControl::HandleWindowReveal(const char *WindowName, const char *WindowP return; } printMessage("GameControl", "Invalid Window Index ", LIGHT_RED); - printf("%s:%u\n",WindowName, index); + print("%s:%u\n",WindowName, index); } } } diff --git a/gemrb/core/GUI/Label.cpp b/gemrb/core/GUI/Label.cpp index 4d67af4..e36dceb 100644 --- a/gemrb/core/GUI/Label.cpp +++ b/gemrb/core/GUI/Label.cpp @@ -119,7 +119,7 @@ void Label::SetAlignment(unsigned char Alignment) void Label::OnMouseUp(unsigned short x, unsigned short y, unsigned short /*Button*/, unsigned short /*Mod*/) { - //printf( "Label::OnMouseUp\n" ); + //print( "Label::OnMouseUp\n" ); if (( x <= Width ) && ( y <= Height )) { if (VarName[0] != 0) { core->GetDictionary()->SetAt( VarName, Value ); diff --git a/gemrb/core/GUI/MapControl.cpp b/gemrb/core/GUI/MapControl.cpp index 9c2e263..08649a4 100644 --- a/gemrb/core/GUI/MapControl.cpp +++ b/gemrb/core/GUI/MapControl.cpp @@ -294,7 +294,7 @@ void MapControl::OnKeyRelease(unsigned char Key, unsigned short Mod) switch (Key) { case '\t': //not GEM_TAB - printf( "TAB released\n" ); + print( "TAB released\n" ); return; case 'f': if (Mod & GEM_MOD_CTRL) @@ -504,10 +504,10 @@ void MapControl::OnSpecialKeyPress(unsigned char Key) ScrollY += 64; break; case GEM_ALT: - printf( "ALT pressed\n" ); + print( "ALT pressed\n" ); break; case GEM_TAB: - printf( "TAB pressed\n" ); + print( "TAB pressed\n" ); break; default: break; diff --git a/gemrb/core/GUI/TextArea.cpp b/gemrb/core/GUI/TextArea.cpp index b19ad57..6b199e2 100644 --- a/gemrb/core/GUI/TextArea.cpp +++ b/gemrb/core/GUI/TextArea.cpp @@ -479,7 +479,7 @@ void TextArea::OnKeyPress(unsigned char Key, unsigned short /*Mod*/) Owner->Invalidate(); Changed = true; int len = GetRowLength(CurLine); - //printf("len: %d Before: %s\n",len, lines[CurLine]); + //print("len: %d Before: %s\n",len, lines[CurLine]); lines[CurLine] = (char *) realloc( lines[CurLine], len + 2 ); for (int i = len; i > CurPos; i--) { lines[CurLine][i] = lines[CurLine][i - 1]; @@ -487,7 +487,7 @@ void TextArea::OnKeyPress(unsigned char Key, unsigned short /*Mod*/) lines[CurLine][CurPos] = Key; lines[CurLine][len + 1] = 0; CurPos++; - //printf("pos: %d After: %s\n",CurPos, lines[CurLine]); + //print("pos: %d After: %s\n",CurPos, lines[CurLine]); CalcRowCount(); RunEventHandler( TextAreaOnChange ); } @@ -577,7 +577,7 @@ void TextArea::OnSpecialKeyPress(unsigned char Key) break; case GEM_DELETE: len = GetRowLength(CurLine); - //printf("len: %d Before: %s\n",len, lines[CurLine]); + //print("len: %d Before: %s\n",len, lines[CurLine]); if (CurPos>=len) { //TODO: merge next line break; @@ -586,12 +586,12 @@ void TextArea::OnSpecialKeyPress(unsigned char Key) for (i = CurPos; i < len; i++) { lines[CurLine][i] = lines[CurLine][i + 1]; } - //printf("pos: %d After: %s\n",CurPos, lines[CurLine]); + //print("pos: %d After: %s\n",CurPos, lines[CurLine]); break; case GEM_BACKSP: len = GetRowLength(CurLine); if (CurPos != 0) { - //printf("len: %d Before: %s\n",len, lines[CurLine]); + //print("len: %d Before: %s\n",len, lines[CurLine]); if (len<1) { break; } @@ -601,15 +601,15 @@ void TextArea::OnSpecialKeyPress(unsigned char Key) } lines[CurLine][len - 1] = 0; CurPos--; - //printf("pos: %d After: %s\n",CurPos, lines[CurLine]); + //print("pos: %d After: %s\n",CurPos, lines[CurLine]); } else { if (CurLine) { //TODO: merge lines int oldline = CurLine; CurLine--; int old = GetRowLength(CurLine); - //printf("len: %d Before: %s\n",old, lines[CurLine]); - //printf("len: %d Before: %s\n",len, lines[oldline]); + //print("len: %d Before: %s\n",old, lines[CurLine]); + //print("len: %d Before: %s\n",len, lines[oldline]); lines[CurLine] = (char *) realloc (lines[CurLine], len+old); memcpy(lines[CurLine]+old, lines[oldline],len); free(lines[oldline]); @@ -617,13 +617,13 @@ void TextArea::OnSpecialKeyPress(unsigned char Key) lines.erase(lines.begin()+oldline); lrows.erase(lrows.begin()+oldline); CurPos = old; - //printf("pos: %d len: %d After: %s\n",CurPos, GetRowLength(CurLine), lines[CurLine]); + //print("pos: %d len: %d After: %s\n",CurPos, GetRowLength(CurLine), lines[CurLine]); } } break; case GEM_RETURN: //add an empty line after CurLine - //printf("pos: %d Before: %s\n",CurPos, lines[CurLine]); + //print("pos: %d Before: %s\n",CurPos, lines[CurLine]); lrows.insert(lrows.begin()+CurLine, 0); len = GetRowLength(CurLine); //copy the text after the cursor into the new line @@ -637,8 +637,8 @@ void TextArea::OnSpecialKeyPress(unsigned char Key) //move cursor to next line beginning CurLine++; CurPos=0; - //printf("len: %d After: %s\n",GetRowLength(CurLine-1), lines[CurLine-1]); - //printf("len: %d After: %s\n",GetRowLength(CurLine), lines[CurLine]); + //print("len: %d After: %s\n",GetRowLength(CurLine-1), lines[CurLine-1]); + //print("len: %d After: %s\n",GetRowLength(CurLine), lines[CurLine]); break; } CalcRowCount(); @@ -780,7 +780,7 @@ void TextArea::OnMouseOver(unsigned short /*x*/, unsigned short y) if (seltext != (int) i) core->RedrawAll(); seltext = ( int ) i; - //printf("CtrlId = 0x%08lx, seltext = %d, rows = %d, row = %d, r = %d\n", ControlID, i, rows, row, r); + //print("CtrlId = 0x%08lx, seltext = %d, rows = %d, row = %d, r = %d\n", ControlID, i, rows, row, r); return; } } @@ -788,7 +788,7 @@ void TextArea::OnMouseOver(unsigned short /*x*/, unsigned short y) core->RedrawAll(); } seltext = -1; - //printf("CtrlId = 0x%08lx, seltext = %d, rows %d, row %d, r = %d\n", ControlID, seltext, rows, row, r); + //print("CtrlId = 0x%08lx, seltext = %d, rows %d, row %d, r = %d\n", ControlID, seltext, rows, row, r); } /** Mouse Button Up */ diff --git a/gemrb/core/GUI/WorldMapControl.cpp b/gemrb/core/GUI/WorldMapControl.cpp index cca132f..28529c5 100644 --- a/gemrb/core/GUI/WorldMapControl.cpp +++ b/gemrb/core/GUI/WorldMapControl.cpp @@ -341,10 +341,10 @@ void WorldMapControl::OnSpecialKeyPress(unsigned char Key) ScrollY += 64; break; case GEM_ALT: - printf( "ALT pressed\n" ); + print( "ALT pressed\n" ); break; case GEM_TAB: - printf( "TAB pressed\n" ); + print( "TAB pressed\n" ); break; } diff --git a/gemrb/core/Game.cpp b/gemrb/core/Game.cpp index e6c9e6e..6fdaf4e 100644 --- a/gemrb/core/Game.cpp +++ b/gemrb/core/Game.cpp @@ -1021,7 +1021,7 @@ int Game::GetXPFromCR(int cr) if (cr>=MAX_CRLEVEL) { cr=MAX_CRLEVEL-1; } - printf("Challenge Rating: %d, party level: %d ", cr, level); + print("Challenge Rating: %d, party level: %d ", cr, level); return crtable[level][cr]; } printMessage("Game","Cannot find moncrate.2da!\n", LIGHT_RED); @@ -1097,7 +1097,7 @@ bool Game::EveryoneNearPoint(Map *area, const Point &p, int flags) const return false; } if (Distance(p,PCs[i])>MAX_TRAVELING_DISTANCE) { -printf("Actor %s is not near!\n", PCs[i]->LongName); +print("Actor %s is not near!\n", PCs[i]->LongName); return false; } } @@ -1729,21 +1729,21 @@ void Game::DebugDump() { size_t idx; - printf("Currently loaded areas:\n"); + print("Currently loaded areas:\n"); for(idx=0;idx<Maps.size();idx++) { Map *map = Maps[idx]; - printf("%s\n",map->GetScriptName()); + print("%s\n",map->GetScriptName()); } - printf("Current area: %s Previous area: %s\n", CurrentArea, PreviousArea); - printf("Global script: %s\n", Scripts[0]->GetName()); - printf("CombatCounter: %d\n", (int) CombatCounter); + print("Current area: %s Previous area: %s\n", CurrentArea, PreviousArea); + print("Global script: %s\n", Scripts[0]->GetName()); + print("CombatCounter: %d\n", (int) CombatCounter); - printf("Party size: %d\n", (int) PCs.size()); + print("Party size: %d\n", (int) PCs.size()); for(idx=0;idx<PCs.size();idx++) { Actor *actor = PCs[idx]; - printf("Name: %s Order %d %s\n",actor->ShortName, actor->InParty, actor->Selected?"x":"-"); + print("Name: %s Order %d %s\n",actor->ShortName, actor->InParty, actor->Selected?"x":"-"); } } diff --git a/gemrb/core/GameData.cpp b/gemrb/core/GameData.cpp index 0ea72d4..cf775bb 100644 --- a/gemrb/core/GameData.cpp +++ b/gemrb/core/GameData.cpp @@ -149,7 +149,7 @@ int GameData::LoadTable(const ieResRef ResRef) tables[ind].refcount++; return ind; } - //printf("(%s) Table not found... Loading from file\n", ResRef); + //print("(%s) Table not found... Loading from file\n", ResRef); DataStream* str = GetResource( ResRef, IE_2DA_CLASS_ID ); if (!str) { return -1; @@ -255,7 +255,7 @@ void GameData::FreePalette(Palette *&pal, const ieResRef name) } if (!name || !name[0]) { if(pal->named) { - printf("Palette is supposed to be named, but got no name!\n"); + print("Palette is supposed to be named, but got no name!\n"); abort(); } else { pal->Release(); @@ -264,13 +264,13 @@ void GameData::FreePalette(Palette *&pal, const ieResRef name) return; } if (!pal->named) { - printf("Unnamed palette, it should be %s!\n", name); + print("Unnamed palette, it should be %s!\n", name); abort(); } res=PaletteCache.DecRef((void *) pal, name, true); if (res<0) { printMessage( "Core", "Corrupted Palette cache encountered (reference count went below zero), ", LIGHT_RED ); - printf( "Palette name is: %.8s\n", name); + print( "Palette name is: %.8s\n", name); abort(); } if (!res) { @@ -315,7 +315,7 @@ void GameData::FreeItem(Item const *itm, const ieResRef name, bool free) res=ItemCache.DecRef((void *) itm, name, free); if (res<0) { printMessage( "Core", "Corrupted Item cache encountered (reference count went below zero), ", LIGHT_RED ); - printf( "Item name is: %.8s\n", name); + print( "Item name is: %.8s\n", name); abort(); } if (res) return; @@ -357,7 +357,7 @@ void GameData::FreeSpell(Spell *spl, const ieResRef name, bool free) res=SpellCache.DecRef((void *) spl, name, free); if (res<0) { printMessage( "Core", "Corrupted Spell cache encountered (reference count went below zero), ", LIGHT_RED ); - printf( "Spell name is: %.8s or %.8s\n", name, spl->Name); + print( "Spell name is: %.8s or %.8s\n", name, spl->Name); abort(); } if (res) return; @@ -396,7 +396,7 @@ void GameData::FreeEffect(Effect *eff, const ieResRef name, bool free) res=EffectCache.DecRef((void *) eff, name, free); if (res<0) { printMessage( "Core", "Corrupted Effect cache encountered (reference count went below zero), ", LIGHT_RED ); - printf( "Effect name is: %.8s\n", name); + print( "Effect name is: %.8s\n", name); abort(); } if (res) return; @@ -480,9 +480,9 @@ void* GameData::GetFactoryResource(const char* resname, SClass_ID type, return NULL; } default: - printf( "\n" ); + print( "\n" ); printMessage( "KEYImporter", " ", WHITE ); - printf( "%s files are not supported.\n", core->TypeExt( type ) ); + print( "%s files are not supported.\n", core->TypeExt( type ) ); return NULL; } } diff --git a/gemrb/core/GameScript/Actions.cpp b/gemrb/core/GameScript/Actions.cpp index f2057f3..a8aef93 100644 --- a/gemrb/core/GameScript/Actions.cpp +++ b/gemrb/core/GameScript/Actions.cpp @@ -457,7 +457,7 @@ void GameScript::TriggerActivation(Scriptable* Sender, Action* parameters) ip = Sender->GetCurrentArea()->TMap->GetInfoPoint(parameters->objects[1]->objectName); } if (!ip || (ip->Type!=ST_TRIGGER && ip->Type!=ST_TRAVEL && ip->Type!=ST_PROXIMITY)) { - printf("Script error: No Trigger Named \"%s\"\n", parameters->objects[1]->objectName); + print("Script error: No Trigger Named \"%s\"\n", parameters->objects[1]->objectName); return; } InfoPoint *trigger = (InfoPoint *) ip; @@ -578,7 +578,7 @@ void GameScript::ExitPocketPlane(Scriptable* /*Sender*/, Action* /*parameters*/) if (act) { if (game->GetPlaneLocationCount() <= (unsigned int)i) { // what are we meant to do here? - printf("argh, couldn't restore party member %d!", i + 1); + print("argh, couldn't restore party member %d!", i + 1); continue; } GAMLocationEntry *gle = game->GetPlaneLocationEntry(i); @@ -1308,7 +1308,7 @@ void GameScript::RestorePartyLocation(Scriptable* /*Sender*/, Action* /*paramete if (act) { if (game->GetSavedLocationCount() <= (unsigned int)i) { // what are we meant to do here? - printf("argh, couldn't restore party member %d!", i + 1); + print("argh, couldn't restore party member %d!", i + 1); continue; } GAMLocationEntry *gle = game->GetSavedLocationEntry(i); @@ -1523,7 +1523,7 @@ void GameScript::DisplayStringHead(Scriptable* Sender, Action* parameters) Scriptable* target = GetActorFromObject( Sender, parameters->objects[1] ); if (!target) { target=Sender; - printf("DisplayStringHead/FloatMessage got no target, assuming Sender!\n"); + print("DisplayStringHead/FloatMessage got no target, assuming Sender!\n"); } DisplayStringCore(target, parameters->int0Parameter, DS_CONSOLE|DS_HEAD|DS_SPEECH ); @@ -1556,7 +1556,7 @@ void GameScript::FloatMessageFixed(Scriptable* Sender, Action* parameters) Scriptable* target = GetActorFromObject( Sender, parameters->objects[1] ); if (!target) { target=Sender; - printf("DisplayStringHead/FloatMessage got no target, assuming Sender!\n"); + print("DisplayStringHead/FloatMessage got no target, assuming Sender!\n"); } DisplayStringCore(target, parameters->int0Parameter, DS_CONSOLE|DS_HEAD); @@ -1567,7 +1567,7 @@ void GameScript::FloatMessageFixedRnd(Scriptable* Sender, Action* parameters) Scriptable* target = GetActorFromObject( Sender, parameters->objects[1] ); if (!target) { target=Sender; - printf("DisplayStringHead/FloatMessage got no target, assuming Sender!\n"); + print("DisplayStringHead/FloatMessage got no target, assuming Sender!\n"); } SrcVector *rndstr=LoadSrc(parameters->string0Parameter); @@ -1584,7 +1584,7 @@ void GameScript::FloatMessageRnd(Scriptable* Sender, Action* parameters) Scriptable* target = GetActorFromObject( Sender, parameters->objects[1] ); if (!target) { target=Sender; - printf("DisplayStringHead/FloatMessage got no target, assuming Sender!\n"); + print("DisplayStringHead/FloatMessage got no target, assuming Sender!\n"); } SrcVector *rndstr=LoadSrc(parameters->string0Parameter); @@ -1770,20 +1770,20 @@ void GameScript::SetMusic(Scriptable* Sender, Action* parameters) //optional integer parameter (isSpeech) void GameScript::PlaySound(Scriptable* Sender, Action* parameters) { - printf( "PlaySound(%s)\n", parameters->string0Parameter ); + print( "PlaySound(%s)\n", parameters->string0Parameter ); core->GetAudioDrv()->Play( parameters->string0Parameter, Sender->Pos.x, Sender->Pos.y, parameters->int0Parameter ? GEM_SND_SPEECH : 0 ); } void GameScript::PlaySoundPoint(Scriptable* /*Sender*/, Action* parameters) { - printf( "PlaySound(%s)\n", parameters->string0Parameter ); + print( "PlaySound(%s)\n", parameters->string0Parameter ); core->GetAudioDrv()->Play( parameters->string0Parameter, parameters->pointParameter.x, parameters->pointParameter.y ); } void GameScript::PlaySoundNotRanged(Scriptable* /*Sender*/, Action* parameters) { - printf( "PlaySound(%s)\n", parameters->string0Parameter ); + print( "PlaySound(%s)\n", parameters->string0Parameter ); core->GetAudioDrv()->Play( parameters->string0Parameter, 0, 0); } @@ -1903,7 +1903,7 @@ void GameScript::AmbientActivate(Scriptable* Sender, Action* parameters) anim = Sender->GetCurrentArea( )->GetAnimation( parameters->objects[1]->objectName ); } if (!anim) { - printf( "Script error: No Animation Named \"%s\" or \"%s\"\n", + print( "Script error: No Animation Named \"%s\" or \"%s\"\n", parameters->string0Parameter,parameters->objects[1]->objectName ); return; } @@ -1934,7 +1934,7 @@ void GameScript::StaticStart(Scriptable* Sender, Action* parameters) { AreaAnimation *anim = Sender->GetCurrentArea()->GetAnimation(parameters->objects[1]->objectName); if (!anim) { - printf( "Script error: No Animation Named \"%s\"\n", + print( "Script error: No Animation Named \"%s\"\n", parameters->objects[1]->objectName ); return; } @@ -1945,7 +1945,7 @@ void GameScript::StaticStop(Scriptable* Sender, Action* parameters) { AreaAnimation *anim = Sender->GetCurrentArea()->GetAnimation(parameters->objects[1]->objectName); if (!anim) { - printf( "Script error: No Animation Named \"%s\"\n", + print( "Script error: No Animation Named \"%s\"\n", parameters->objects[1]->objectName ); return; } @@ -1956,7 +1956,7 @@ void GameScript::StaticPalette(Scriptable* Sender, Action* parameters) { AreaAnimation *anim = Sender->GetCurrentArea()->GetAnimation(parameters->objects[1]->objectName); if (!anim) { - printf( "Script error: No Animation Named \"%s\"\n", + print( "Script error: No Animation Named \"%s\"\n", parameters->objects[1]->objectName ); return; } @@ -2146,7 +2146,7 @@ void GameScript::NIDSpecial2(Scriptable* Sender, Action* /*parameters*/) } //travel direction passed to guiscript int direction = Sender->GetCurrentArea()->WhichEdge(actor->Pos); - printf("Travel direction returned: %d\n", direction); + print("Travel direction returned: %d\n", direction); if (direction==-1) { Sender->ReleaseCurrentAction(); return; @@ -4886,7 +4886,7 @@ void GameScript::RevealAreaOnMap(Scriptable* /*Sender*/, Action* parameters) { WorldMap *worldmap = core->GetWorldMap(); if (!worldmap) { - printf("Can't find worldmap!\n"); + print("Can't find worldmap!\n"); abort(); } // WMP_ENTRY_ADJACENT because otherwise revealed bg2 areas are unreachable from city gates @@ -4898,7 +4898,7 @@ void GameScript::HideAreaOnMap( Scriptable* /*Sender*/, Action* parameters) { WorldMap *worldmap = core->GetWorldMap(); if (!worldmap) { - printf("Can't find worldmap!\n"); + print("Can't find worldmap!\n"); abort(); } // WMP_ENTRY_ADJACENT because otherwise revealed bg2 areas are unreachable from city gates @@ -5865,7 +5865,7 @@ void GameScript::SaveGame(Scriptable* /*Sender*/, Action* parameters) void GameScript::EscapeArea(Scriptable* Sender, Action* parameters) { if (InDebug&ID_ACTIONS) { - printf("EscapeArea/EscapeAreaMove\n"); + print("EscapeArea/EscapeAreaMove\n"); } if (Sender->Type!=ST_ACTOR) { Sender->ReleaseCurrentAction(); @@ -5893,7 +5893,7 @@ void GameScript::EscapeArea(Scriptable* Sender, Action* parameters) void GameScript::EscapeAreaNoSee(Scriptable* Sender, Action* parameters) { if (InDebug&ID_ACTIONS) { - printf("EscapeAreaNoSee\n"); + print("EscapeAreaNoSee\n"); } if (Sender->Type!=ST_ACTOR) { Sender->ReleaseCurrentAction(); @@ -6224,7 +6224,7 @@ void GameScript::SetNoOneOnTrigger(Scriptable* Sender, Action* parameters) ip = Sender->GetCurrentArea()->TMap->GetInfoPoint(parameters->objects[1]->objectName); } if (!ip || (ip->Type!=ST_TRIGGER && ip->Type!=ST_TRAVEL && ip->Type!=ST_PROXIMITY)) { - printf("Script error: No Trigger Named \"%s\"\n", parameters->objects[1]->objectName); + print("Script error: No Trigger Named \"%s\"\n", parameters->objects[1]->objectName); return; } ip->LastEntered = 0; @@ -7148,7 +7148,7 @@ void GameScript::SetToken2DA(Scriptable* /*Sender*/, Action* parameters) AutoTable tm(parameters->string0Parameter); if (!tm) { printStatus( "ERROR", LIGHT_RED ); - printf( "Cannot find %s.2da.\n", parameters->string0Parameter); + print( "Cannot find %s.2da.\n", parameters->string0Parameter); return; } diff --git a/gemrb/core/GameScript/GSUtils.cpp b/gemrb/core/GameScript/GSUtils.cpp index 9fe3c6c..f7454a9 100644 --- a/gemrb/core/GameScript/GSUtils.cpp +++ b/gemrb/core/GameScript/GSUtils.cpp @@ -368,7 +368,7 @@ void DisplayStringCore(Scriptable* Sender, int Strref, int flags) memset(&sb,0,sizeof(sb)); Sound[0]=0; - printf( "Displaying string on: %s\n", Sender->GetScriptName() ); + print( "Displaying string on: %s\n", Sender->GetScriptName() ); if (flags & DS_CONST) { if (Sender->Type!=ST_ACTOR) { printMessage("GameScript","Verbal constant not supported for non actors!\n", LIGHT_RED); @@ -600,7 +600,7 @@ void CreateCreatureCore(Scriptable* Sender, Action* parameters, int flags) if (!ab) { printMessage("GameScript","Failed to create creature! ",LIGHT_RED); - printf("(missing creature file %s?)\n", parameters->string0Parameter); + print("(missing creature file %s?)\n", parameters->string0Parameter); // maybe this should abort()? return; } @@ -725,7 +725,7 @@ void EscapeAreaCore(Scriptable* Sender, const Point &p, const char* area, const //MoveNearerTo will return 0, if the actor is in move //it will return 1 (the fourth parameter) if the target is unreachable if (!MoveNearerTo(Sender, p, MAX_OPERATING_DISTANCE,1) ) { - if (!Sender->InMove()) printf("At least it said so...\n"); + if (!Sender->InMove()) print("At least it said so...\n"); return; } } @@ -738,12 +738,12 @@ void EscapeAreaCore(Scriptable* Sender, const Point &p, const char* area, const sprintf( Tmp, "MoveBetweenAreas(\"%s\",[%hd.%hd],%d)", area, enter.x, enter.y, 0 ); } printMessage("GSUtils"," ", WHITE); - printf("Executing %s in EscapeAreaCore\n", Tmp); + print("Executing %s in EscapeAreaCore\n", Tmp); //drop this action, but add another (destroyself or movebetweenareas) //between the arrival and the final escape, there should be a wait time //that wait time could be handled here if (wait) { - printf("But wait a bit... (%d)\n", wait); + print("But wait a bit... (%d)\n", wait); Sender->SetWait(wait); } Sender->ReleaseCurrentAction(); @@ -825,7 +825,7 @@ void BeginDialog(Scriptable* Sender, Action* parameters, int Flags) int seeflag = GA_NO_DEAD; if (InDebug&ID_VARIABLES) { - printf("BeginDialog core\n"); + print("BeginDialog core\n"); } if (Flags & BD_OWN) { tar = GetStoredActorFromObject( Sender, parameters->objects[1], seeflag); @@ -836,22 +836,22 @@ void BeginDialog(Scriptable* Sender, Action* parameters, int Flags) } if (!scr) { printMessage("GameScript"," ",LIGHT_RED); - printf("Speaker for dialog couldn't be found (Sender: %s, Type: %d) Flags:%d.\n", Sender->GetScriptName(), Sender->Type, Flags); + print("Speaker for dialog couldn't be found (Sender: %s, Type: %d) Flags:%d.\n", Sender->GetScriptName(), Sender->Type, Flags); Sender->ReleaseCurrentAction(); return; } if (!tar || tar->Type!=ST_ACTOR) { ... [truncated message content] |