Update of /cvsroot/exult/exult In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28425 Modified Files: Makefile.am actors.cc cheat.h gamedat.cc gamemap.cc gamemap.h gamewin.cc gamewin.h schedule.cc schedule.h Removed Files: vec.h Log Message: Removed use of vec.h Index: Makefile.am =================================================================== RCS file: /cvsroot/exult/exult/Makefile.am,v retrieving revision 1.149 retrieving revision 1.150 diff -u -d -r1.149 -r1.150 --- Makefile.am 17 Dec 2005 07:48:49 -0000 1.149 +++ Makefile.am 18 Dec 2005 01:29:44 -0000 1.150 @@ -104,7 +104,6 @@ tqueue.h \ txtscroll.cc \ txtscroll.h \ - vec.h \ version.cc \ version.h \ xdrag.cc \ Index: actors.cc =================================================================== RCS file: /cvsroot/exult/exult/actors.cc,v retrieving revision 1.622 retrieving revision 1.623 diff -u -d -r1.622 -r1.623 --- actors.cc 26 Oct 2005 06:17:44 -0000 1.622 +++ actors.cc 18 Dec 2005 01:29:44 -0000 1.623 @@ -270,7 +270,8 @@ Game_object *aobj = get_readied(Actor::ammo); if (aobj && In_ammo_family(aobj->get_shapenum(), ammo)) return aobj; // Already readied. - Game_object_vector vec(50); // Get list of all possessions. + Game_object_vector vec; // Get list of all possessions. + vec.reserve(50); get_objects(vec, c_any_shapenum, c_any_qual, c_any_framenum); for (Game_object_vector::const_iterator it = vec.begin(); it != vec.end(); ++it) @@ -349,7 +350,8 @@ // What about spell book???? if (Actor::get_weapon(points) != 0 && ready_ammo()) return true; // Already have one. - Game_object_vector vec(50); // Get list of all possessions. + Game_object_vector vec; // Get list of all possessions. + vec.reserve(50); get_objects(vec, c_any_shapenum, c_any_qual, c_any_framenum); Game_object *best = 0, *best_ammo = 0; int best_damage = -20; Index: cheat.h =================================================================== RCS file: /cvsroot/exult/exult/cheat.h,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- cheat.h 17 Dec 2005 22:07:52 -0000 1.40 +++ cheat.h 18 Dec 2005 01:29:45 -0000 1.41 @@ -19,7 +19,7 @@ #ifndef CHEAT_H #define CHEAT_H -#include "vec.h" +#include <vector> #include "singles.h" class Game_window; @@ -32,6 +32,8 @@ class Effects_manager; class Map_chunk; +using std::vector; + class Cheat : public Game_singletons { public: @@ -60,8 +62,8 @@ int edit_lift; int edit_shape, edit_frame; // What to 'paint' with. int edit_chunknum; // For painting with chunks. - Game_object_vector selected; // Selected objects (map-editing). - Game_object_vector clipboard; // Cut/copy/paste objects. + vector<Game_object*> selected; // Selected objects (map-editing). + vector<Game_object*> clipboard; // Cut/copy/paste objects. bool infravision; bool pickpocket; bool grab_actor; @@ -135,14 +137,14 @@ void delete_selected(); void move_selected_objs(int dx, int dy, int dz); void move_selected(int dx, int dy, int dz); - const Game_object_vector& get_selected() const + const vector<Game_object*>& get_selected() const { return selected; } bool is_selected(Game_object *o); void cut(bool copy = false); void paste(int mx, int my); void paste(); - const Game_object_vector& get_clipboard() const + const vector<Game_object*>& get_clipboard() const { return clipboard; } void map_teleport (void) const; Index: gamedat.cc =================================================================== RCS file: /cvsroot/exult/exult/gamedat.cc,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- gamedat.cc 9 Jan 2005 09:23:03 -0000 1.93 +++ gamedat.cc 18 Dec 2005 01:29:45 -0000 1.94 @@ -332,7 +332,7 @@ ofstream out; U7open(out, fname); - Exult_vector<Game_map*>::iterator it; + vector<Game_map*>::iterator it; int count = numsavefiles; // Count up #files to write. for (it = maps.begin(); it != maps.end(); ++it) if (*it) @@ -1147,7 +1147,7 @@ bgnumsavefiles : sinumsavefiles; const char **savefiles = (Game::get_game_type() == BLACK_GATE) ? bgsavefiles : sisavefiles; - Exult_vector<Game_map*>::iterator it; + vector<Game_map*>::iterator it; // Name { Index: gamemap.cc =================================================================== RCS file: /cvsroot/exult/exult/gamemap.cc,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- gamemap.cc 17 Dec 2005 23:41:38 -0000 1.69 +++ gamemap.cc 18 Dec 2005 01:29:45 -0000 1.70 @@ -79,7 +79,7 @@ using std::pair; #endif -Exult_vector<Chunk_terrain *> *Game_map::chunk_terrains = 0; +vector<Chunk_terrain *> *Game_map::chunk_terrains = 0; std::ifstream *Game_map::chunks = 0; bool Game_map::v2_chunks = false; bool Game_map::read_all_terrain = false; @@ -204,7 +204,7 @@ // 2 bytes/tile. num_chunk_terrains = ((int)chunks->tellg() - hdrsize)/chunksz; if (!chunk_terrains) - chunk_terrains = new Exult_vector<Chunk_terrain*>(); + chunk_terrains = new vector<Chunk_terrain*>(); // Resize list to hold all. chunk_terrains->resize(num_chunk_terrains); read_all_terrain = false; @@ -1415,8 +1415,8 @@ chunk_terrains_modified = true; // Update terrain maps. Game_window *gwin = Game_window::get_instance(); - const Exult_vector<Game_map*>& maps = gwin->get_maps(); - for (Exult_vector<Game_map*>::const_iterator it = maps.begin(); + const vector<Game_map*>& maps = gwin->get_maps(); + for (vector<Game_map*>::const_iterator it = maps.begin(); it != maps.end(); ++it) { Game_map *map = *it; @@ -1494,8 +1494,8 @@ return true; // Inserted at end of list. // Update terrain map. Game_window *gwin = Game_window::get_instance(); - const Exult_vector<Game_map*>& maps = gwin->get_maps(); - for (Exult_vector<Game_map*>::const_iterator it = maps.begin(); + const vector<Game_map*>& maps = gwin->get_maps(); + for (vector<Game_map*>::const_iterator it = maps.begin(); it != maps.end(); ++it) { Game_map *map = *it; @@ -1536,8 +1536,8 @@ chunk_terrains_modified = true; // Update terrain map. Game_window *gwin = Game_window::get_instance(); - const Exult_vector<Game_map*>& maps = gwin->get_maps(); - for (Exult_vector<Game_map*>::const_iterator it = maps.begin(); + const vector<Game_map*>& maps = gwin->get_maps(); + for (vector<Game_map*>::const_iterator it = maps.begin(); it != maps.end(); ++it) { Game_map *map = *it; @@ -1572,8 +1572,8 @@ ters[i] = 1; // Update terrain map. Game_window *gwin = Game_window::get_instance(); - const Exult_vector<Game_map*>& maps = gwin->get_maps(); - for (Exult_vector<Game_map*>::const_iterator it = maps.begin(); + const vector<Game_map*>& maps = gwin->get_maps(); + for (vector<Game_map*>::const_iterator it = maps.begin(); it != maps.end(); ++it) { Game_map *map = *it; Index: gamemap.h =================================================================== RCS file: /cvsroot/exult/exult/gamemap.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- gamemap.h 15 Aug 2005 04:51:25 -0000 1.22 +++ gamemap.h 18 Dec 2005 01:29:45 -0000 1.23 @@ -23,7 +23,6 @@ #define GAMEMAP_H #include "exult_constants.h" -#include "vec.h" #include "flags.h" #ifndef ALPHA_LINUX_CXX # include <cassert> @@ -31,10 +30,12 @@ #include <string> // STL string #include <iostream> #include <fstream> +#include <vector> class Map_chunk; class Chunk_terrain; class Map_patch_collection; +class Game_object; class Ireg_game_object; class Ifix_game_object; class Egg_object; @@ -42,6 +43,8 @@ class Shapes_vga_file; class DataSource; +using std::vector; + #define IREG_EXTENDED 254 // For shape #'s > 1023. /* @@ -51,7 +54,7 @@ { int num; // Map #. Index in gwin->maps. // Flat chunk areas: - static Exult_vector<Chunk_terrain *> *chunk_terrains; + static vector<Chunk_terrain *> *chunk_terrains; static std::ifstream *chunks; // "u7chunks" file. static bool v2_chunks; // True if 3 bytes/entry. static bool read_all_terrain; // True if we've read them all. Index: gamewin.cc =================================================================== RCS file: /cvsroot/exult/exult/gamewin.cc,v retrieving revision 1.715 retrieving revision 1.716 diff -u -d -r1.715 -r1.716 --- gamewin.cc 17 Dec 2005 23:41:38 -0000 1.715 +++ gamewin.cc 18 Dec 2005 01:29:45 -0000 1.716 @@ -427,7 +427,7 @@ delete win; delete dragging; delete pal; - for (Exult_vector<Game_map*>::iterator it = maps.begin(); + for (vector<Game_map*>::iterator it = maps.begin(); it != maps.end(); ++it) delete *it; delete usecode; @@ -832,7 +832,7 @@ clear_dirty(); removed->flush(); // Delete. Usecode_script::clear(); // Clear out all scheduled usecode. - for (Exult_vector<Game_map*>::iterator it = maps.begin(); + for (vector<Game_map*>::iterator it = maps.begin(); it != maps.end(); ++it) (*it)->clear(); set_map(0); // Back to main map. @@ -1276,7 +1276,7 @@ shape_man->paint_text(0, "Saving Game", centre_x-text_width/2, centre_y-text_height); show(true); - for (Exult_vector<Game_map*>::iterator it = maps.begin(); + for (vector<Game_map*>::iterator it = maps.begin(); it != maps.end(); ++it) (*it)->write_ireg(); // Write ireg files. write_npcs(); // Write out npc.dat. @@ -1411,7 +1411,7 @@ { if (Game_map::was_chunk_terrain_modified()) return true; - for (Exult_vector<Game_map*>::iterator it = maps.begin(); + for (vector<Game_map*>::iterator it = maps.begin(); it != maps.end(); ++it) { Game_map *map = *it; @@ -1434,7 +1434,7 @@ ( ) { - for (Exult_vector<Game_map*>::iterator it = maps.begin(); + for (vector<Game_map*>::iterator it = maps.begin(); it != maps.end(); ++it) { Game_map *map = *it; @@ -2675,7 +2675,7 @@ bool map_editing ) { - for (Exult_vector<Game_map*>::iterator it = maps.begin(); + for (vector<Game_map*>::iterator it = maps.begin(); it != maps.end(); ++it) (*it)->init(); // Init. current 'tick'. Index: gamewin.h =================================================================== RCS file: /cvsroot/exult/exult/gamewin.h,v retrieving revision 1.347 retrieving revision 1.348 diff -u -d -r1.347 -r1.348 --- gamewin.h 17 Dec 2005 20:12:09 -0000 1.347 +++ gamewin.h 18 Dec 2005 01:29:45 -0000 1.348 @@ -30,7 +30,7 @@ #include "vgafile.h" #include <string> // STL string -#include "vec.h" +#include <vector> #define RED_PLASMA 1 @@ -74,6 +74,8 @@ class Game_render; class Effects_manager; +using std::vector; + /* * The main game window: */ @@ -84,7 +86,7 @@ Dragging_info *dragging; // Dragging info: Effects_manager *effects; // Manages special effects. Game_clock *clock; // Keeps track of time. - Exult_vector<Game_map*> maps; // Hold all terrain. + vector<Game_map*> maps; // Hold all terrain. Game_map *map; // The current map. Game_render *render; // Helps with rendering. Gump_manager *gump_man; // Open containers on screen. @@ -114,8 +116,8 @@ Barge_object *moving_barge; // ->cart/ship that's moving, or 0. Main_actor *main_actor; // Main sprite to move around. Actor *camera_actor; // What to center view around. - Actor_vector npcs; // Array of NPC's + the Avatar. - Exult_vector<Dead_body*> bodies;// Corresponding Dead_body's. + vector<Actor*> npcs; // Array of NPC's + the Avatar. + vector<Dead_body*> bodies;// Corresponding Dead_body's. Deleted_objects *removed; // List of 'removed' objects. // Rendering info: int scrolltx, scrollty; // Top-left tile of screen. @@ -219,7 +221,7 @@ */ inline Game_map *get_map() const { return map; } - inline const Exult_vector<Game_map*>& get_maps() const + inline const vector<Game_map*>& get_maps() const { return maps; } inline Usecode_machine *get_usecode() const { return usecode; } Index: schedule.cc =================================================================== RCS file: /cvsroot/exult/exult/schedule.cc,v retrieving revision 1.178 retrieving revision 1.179 diff -u -d -r1.178 -r1.179 --- schedule.cc 17 Dec 2005 23:41:38 -0000 1.178 +++ schedule.cc 18 Dec 2005 01:29:45 -0000 1.179 @@ -1777,7 +1777,7 @@ case use_potion: { state = start; - Exult_vector<Game_object *> potions; + vector<Game_object *> potions; Game_object::find_nearby(potions, spot_on_table, 340, 0, 0); if (potions.size()) // Found a potion. Remove it. { Index: schedule.h =================================================================== RCS file: /cvsroot/exult/exult/schedule.h,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- schedule.h 15 Oct 2005 04:48:48 -0000 1.67 +++ schedule.h 18 Dec 2005 01:29:45 -0000 1.68 @@ -22,9 +22,9 @@ #define SCHEDULE_H 1 #include "tiles.h" -#include "vec.h" #include "lists.h" #include "singles.h" +#include <vector> #ifdef WIN32 #include <windows.h> @@ -36,6 +36,8 @@ class Rectangle; class Actor_action; +using std::vector; + /* * A Schedule controls the NPC it is assigned to. */ @@ -194,7 +196,7 @@ */ class Patrol_schedule : public Schedule { - Game_object_vector paths; // Each 'path' object. + vector<Game_object*> paths; // Each 'path' object. int pathnum; // # of next we're heading towards. int dir; // 1 or -1; int failures; // # of failures to find marker. @@ -355,7 +357,7 @@ */ class Lab_schedule : public Schedule { - Game_object_vector tables; + vector<Game_object*> tables; Game_object *chair; // Chair to sit in. Game_object *book; // Book to read. Game_object *cauldron; @@ -398,8 +400,8 @@ Tile_coord startpos; // Starting position. Actor *customer; // Current customer. Actor_queue customers; // List of customers. - Game_object_vector prep_tables; // Prep. tables. - Game_object_vector eating_tables; // Tables with chairs around them. + vector<Game_object*> prep_tables; // Prep. tables. + vector<Game_object*> eating_tables; // Tables with chairs around them. void get_customer(); void find_tables(int shapenum); Game_object *find_serving_spot(Tile_coord& spot); --- vec.h DELETED --- |