[Moeng-cvs] BBRpg/src rpg.cpp, 1.15, 1.16 rpg.h, 1.8, 1.9 script.cpp, 1.19, 1.20
Status: Alpha
Brought to you by:
b_lindeijer
From: Bjørn L. <b_l...@us...> - 2007-02-13 01:49:25
|
Update of /cvsroot/moeng/BBRpg/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv27860/src Modified Files: rpg.cpp rpg.h script.cpp Log Message: Added support for loading current Tiled maps to this old engine version. Index: rpg.h =================================================================== RCS file: /cvsroot/moeng/BBRpg/src/rpg.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- rpg.h 7 Feb 2007 17:50:31 -0000 1.8 +++ rpg.h 13 Feb 2007 01:49:21 -0000 1.9 @@ -32,7 +32,7 @@ extern int gameClassInstance; extern TileType *selectedTile; -extern list<TiledMap*> maps; +extern std::list<TiledMap*> maps; extern bool game_end; extern bool exclusive_mode; Index: script.cpp =================================================================== RCS file: /cvsroot/moeng/BBRpg/src/script.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- script.cpp 8 Feb 2007 17:51:49 -0000 1.19 +++ script.cpp 13 Feb 2007 01:49:21 -0000 1.20 @@ -542,7 +542,7 @@ lua_newtable(L); - list<Object*>::iterator i; + std::list<Object*>::iterator i; for (i = map->objects.begin(); i != map->objects.end(); i++) { Object *obj = (*i); if (((obj->x + obj->w > x && obj->x <= x) && @@ -568,7 +568,7 @@ lua_newtable(L); - list<Object*>::iterator i; + std::list<Object*>::iterator i; for (i = map->objects.begin(); i != map->objects.end(); i++) { Object *obj = (*i); lua_getref(L, obj->tableRef); @@ -780,7 +780,7 @@ { double loudness; Object* nm; // The noise maker - list<Object*>::iterator i; + std::list<Object*>::iterator i; getLuaArguments(L, "od", &nm, &loudness); @@ -902,7 +902,7 @@ getLuaArguments(L, "iiiiddm", &x, &y, &w, &h, &tx, &ty, &map); if (map) { - list<Object*>::iterator i; + std::list<Object*>::iterator i; // Iterate through all objects, calling the preRender function for (i = map->objects.begin(); i != map->objects.end(); i++) { callMemberFunction((*i)->tableRef, "preRender"); @@ -952,8 +952,12 @@ if (map) { Tile* tile = map->mapLayers[0]->getTile(Point(x, y)); - if (tile && tile->getType()) { - char *tileTypeName = tile->getType()->getName(); + if (tile) { + TileType *type = tile->getType(); + char *tileTypeName = ""; + if (type && type->getName()) { + tileTypeName = type->getName(); + } return putLuaArguments(L, "si", tileTypeName, tile->obstacle); } else { return 0; Index: rpg.cpp =================================================================== RCS file: /cvsroot/moeng/BBRpg/src/rpg.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- rpg.cpp 9 Feb 2007 15:29:41 -0000 1.15 +++ rpg.cpp 13 Feb 2007 01:49:21 -0000 1.16 @@ -74,8 +74,25 @@ return 0; } -END_OF_MAIN(); +END_OF_MAIN() + + +void xmlNullLogger(void *ctx, const char *msg, ...) +{ + // Does nothing, that's the whole point of it +} + +// Initialize libxml2 and check for potential ABI mismatches between +// compiled version and the shared library actually used. +void initXML() +{ + console.log(CON_LOG, CON_ALWAYS, "Initializing libxml2..."); + xmlInitParser(); + LIBXML_TEST_VERSION; + // Suppress libxml2 error messages + xmlSetGenericErrorFunc(NULL, xmlNullLogger); +} void init_engine() { @@ -86,6 +103,7 @@ install_timer(); three_finger_flag = 0; set_display_switch_mode(SWITCH_BACKAMNESIA); + initXML(); set_config_file("rpg.cfg"); |