From: Laszlo T. <ave...@us...> - 2004-04-26 20:52:01
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10320/Core Modified Files: Core.cpp GameScript.cpp GameScript.h Interface.cpp Log Message: Fixed a few problems with resolving folders to case insensitive Added SetGabber() action Index: GameScript.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/GameScript.cpp,v retrieving revision 1.156 retrieving revision 1.157 diff -C2 -d -r1.156 -r1.157 *** GameScript.cpp 25 Apr 2004 22:41:40 -0000 1.156 --- GameScript.cpp 26 Apr 2004 20:51:50 -0000 1.157 *************** *** 387,390 **** --- 387,391 ---- {"setdoorlocked", GameScript::Lock,AF_BLOCKING},//key shouldn't be checked! {"setfaction", GameScript::SetFaction,0}, + {"setgabber", GameScript::SetGabber,0}, {"setglobal", GameScript::SetGlobal,AF_MERGESTRINGS}, {"setglobaltimer", GameScript::SetGlobalTimer,AF_MERGESTRINGS}, *************** *** 617,621 **** int iT = core->LoadTable( "SCRIPT" ); if (tT < 0 || aT < 0 || oT < 0 || iT < 0) { ! printf( "[IEScript]: A critical scripting file is missing!\n" ); abort(); } --- 618,622 ---- int iT = core->LoadTable( "SCRIPT" ); if (tT < 0 || aT < 0 || oT < 0 || iT < 0) { ! printMessage( "IEScript]","A critical scripting file is missing!\n",LIGHT_RED ); abort(); } *************** *** 625,629 **** TableMgr* objNameTable = core->GetTable( iT ); if (!triggersTable || !actionsTable || !objectsTable || !objNameTable) { ! printf( "[IEScript]: A critical scripting file is damaged!\n" ); abort(); } --- 626,630 ---- TableMgr* objNameTable = core->GetTable( iT ); if (!triggersTable || !actionsTable || !objectsTable || !objNameTable) { ! printMessage( "IEScript","A critical scripting file is damaged!\n",LIGHT_RED ); abort(); } *************** *** 635,639 **** ObjectIDSCount = atoi( objNameTable->QueryField() ); if(ObjectIDSCount<0 || ObjectIDSCount>MAX_OBJECT_FIELDS) { ! printf("[IEScript]: The IDS Count shouldn't be more than 10!\n"); abort(); } --- 636,640 ---- ObjectIDSCount = atoi( objNameTable->QueryField() ); if(ObjectIDSCount<0 || ObjectIDSCount>MAX_OBJECT_FIELDS) { ! printMessage("IEScript","The IDS Count shouldn't be more than 10!\n",LIGHT_RED); abort(); } *************** *** 653,657 **** MaxObjectNesting = atoi( objNameTable->QueryField( 1 ) ); if(MaxObjectNesting<0 || MaxObjectNesting>MAX_NESTING) { ! printf("[IEScript]: The Object Nesting Count shouldn't be more than 5!\n"); abort(); } --- 654,658 ---- MaxObjectNesting = atoi( objNameTable->QueryField( 1 ) ); if(MaxObjectNesting<0 || MaxObjectNesting>MAX_NESTING) { ! printMessage("IEScript","The Object Nesting Count shouldn't be more than 5!\n", LIGHT_RED); abort(); } *************** *** 739,743 **** stream->ReadLine( line, 10 ); if (strncmp( line, "SC", 2 ) != 0) { ! printf( "[IEScript]: Not a Compiled Script file\n" ); delete( stream ); return NULL; --- 740,744 ---- stream->ReadLine( line, 10 ); if (strncmp( line, "SC", 2 ) != 0) { ! printMessage( "IEScript","Not a Compiled Script file\n", YELLOW ); delete( stream ); return NULL; *************** *** 1120,1124 **** //we started an Or() block if (ORcount) { ! printf( "[IEScript]: Unfinished OR block encountered!\n" ); } ORcount = result; --- 1121,1125 ---- //we started an Or() block if (ORcount) { ! printMessage( "IEScript","Unfinished OR block encountered!\n",YELLOW ); } ORcount = result; *************** *** 1138,1142 **** } if (ORcount) { ! printf( "[IEScript]: Unfinished OR block encountered!\n" ); } return 1; --- 1139,1143 ---- } if (ORcount) { ! printMessage( "IEScript","Unfinished OR block encountered!\n",YELLOW ); } return 1; *************** *** 1146,1150 **** { if (!trigger) { ! printf( "[IEScript]: Trigger evaluation fails due to NULL trigger.\n" ); return false; } --- 1147,1151 ---- { if (!trigger) { ! printMessage( "IEScript","Trigger evaluation fails due to NULL trigger.\n",YELLOW ); return false; } *************** *** 1156,1161 **** if (!func) { triggers[trigger->triggerID] = False; ! printf( "[IEScript]: Unhandled trigger code: 0x%04x %s\n", trigger->triggerID, tmpstr ); return false; } --- 1157,1165 ---- if (!func) { triggers[trigger->triggerID] = False; ! //hope this is enough, snprintf will prevent buffer overflow ! char Tmp[256]; ! snprintf(Tmp,sizeof(Tmp),"Unhandled trigger code: 0x%04x %s\n", trigger->triggerID, tmpstr ); + printMessage( "IEScript",Tmp,YELLOW); return false; } *************** *** 1255,1259 **** else { actions[aC->actionID] = NoAction; ! printf( "[IEScript]: Unhandled action code: %d %s\n", aC->actionID , actionsTable->GetValue(aC->actionID) ); Sender->CurrentAction = NULL; aC->Release(); --- 1259,1265 ---- else { actions[aC->actionID] = NoAction; ! char Tmp[256]; ! snprintf(Tmp, sizeof(Tmp), "Unhandled action code: %d %s\n", aC->actionID , actionsTable->GetValue(aC->actionID) ); ! printMessage("IEScript", Tmp, YELLOW); Sender->CurrentAction = NULL; aC->Release(); *************** *** 6600,6601 **** --- 6606,6622 ---- } + void GameScript::SetGabber(Scriptable* Sender, Action* parameters) + { + Scriptable* tar = GetActorFromObject( Sender, parameters->objects[1] ); + if (!tar || tar->Type != ST_ACTOR) { + return; + } + GameControl* gc = core->GetGameControl(); + if(gc->DialogueFlags&DF_IN_DIALOG) { + gc->speaker = (Actor *) tar; + } + else { + printMessage("IEScript","Can't set gabber",YELLOW); + } + } + Index: Interface.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Interface.cpp,v retrieving revision 1.161 retrieving revision 1.162 diff -C2 -d -r1.161 -r1.162 *** Interface.cpp 26 Apr 2004 11:14:06 -0000 1.161 --- Interface.cpp 26 Apr 2004 20:51:51 -0000 1.162 *************** *** 93,97 **** --- 93,101 ---- ConsolePopped = false; CheatFlag = false; + #ifndef WIN32 + CaseSensitive = true; //this is the default value, so CD1/CD2 will be resolved + #else CaseSensitive = false; + #endif GameOnCD = false; SkipIntroVideos = false; *************** *** 109,134 **** memcpy( GlobalMap, "WORLDMAP", 9 ); GameFeatures = 0; - printMessage( "Core", "Loading Configuration File...", WHITE ); - if (!LoadConfig()) { - printStatus( "ERROR", LIGHT_RED ); - printMessage( "Core", - "Cannot Load Config File.\nTermination in Progress...\n", WHITE ); - exit( -1 ); - } - printStatus( "OK", LIGHT_GREEN ); - printMessage( "Core", "Starting Plugin Manager...\n", WHITE ); - plugin = new PluginMgr( PluginsPath ); - printMessage( "Core", "Plugin Loading Complete...", WHITE ); - printStatus( "OK", LIGHT_GREEN ); - printMessage( "Core", "Creating Object Factory...", WHITE ); - factory = new Factory(); - printStatus( "OK", LIGHT_GREEN ); - time_t t; - t = time( NULL ); - srand( ( unsigned int ) t ); - #ifdef _DEBUG - FileStreamPtrCount = 0; - CachedFileStreamPtrCount = 0; - #endif } --- 113,116 ---- *************** *** 242,245 **** --- 224,249 ---- int Interface::Init() { + printMessage( "Core", "Loading Configuration File...", WHITE ); + if (!LoadConfig()) { + printStatus( "ERROR", LIGHT_RED ); + printMessage( "Core", + "Cannot Load Config File.\nTermination in Progress...\n", WHITE ); + exit( -1 ); + } + printStatus( "OK", LIGHT_GREEN ); + printMessage( "Core", "Starting Plugin Manager...\n", WHITE ); + plugin = new PluginMgr( PluginsPath ); + printMessage( "Core", "Plugin Loading Complete...", WHITE ); + printStatus( "OK", LIGHT_GREEN ); + printMessage( "Core", "Creating Object Factory...", WHITE ); + factory = new Factory(); + printStatus( "OK", LIGHT_GREEN ); + time_t t; + t = time( NULL ); + srand( ( unsigned int ) t ); + #ifdef _DEBUG + FileStreamPtrCount = 0; + CachedFileStreamPtrCount = 0; + #endif printMessage( "Core", "GemRB Core Initialization...\n", WHITE ); printMessage( "Core", "Searching for Video Driver...", WHITE ); *************** *** 275,280 **** return GEM_ERROR; } ! ! LoadGemRBINI(); //printStatus("OK", LIGHT_GREEN); --- 279,287 ---- return GEM_ERROR; } ! if(!LoadGemRBINI()) ! { ! printf( "Cannot Load INI\nTermination in Progress...\n" ); ! return GEM_ERROR; ! } //printStatus("OK", LIGHT_GREEN); *************** *** 744,749 **** } - - strcpy( path, UserDir ); strcat( path, name ); --- 751,754 ---- Index: Core.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Core.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Core.cpp 13 Apr 2004 19:38:22 -0000 1.14 --- Core.cpp 26 Apr 2004 20:51:50 -0000 1.15 *************** *** 173,177 **** } - TempFilePath[0] = FilePath[0]; for (pos = 1; FilePath[pos] && FilePath[pos] != '/'; pos++) --- 173,176 ---- Index: GameScript.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/GameScript.h,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** GameScript.h 25 Apr 2004 22:41:41 -0000 1.111 --- GameScript.h 26 Apr 2004 20:51:51 -0000 1.112 *************** *** 1050,1053 **** --- 1050,1054 ---- static void SetDialogue(Scriptable* Sender, Action* parameters); static void SetFaction(Scriptable* Sender, Action* parameters); + static void SetGabber(Scriptable* Sender, Action* parameters); static void SetGlobal(Scriptable* Sender, Action* parameters); static void SetGlobalTimer(Scriptable* Sender, Action* parameters); |