|
From: <js...@us...> - 2006-06-29 06:46:14
|
Update of /cvsroot/exult/exult In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv19195 Modified Files: cheat.cc Log Message: Show minimap with map-teleport cheat (F3) Index: cheat.cc =================================================================== RCS file: /cvsroot/exult/exult/cheat.cc,v retrieving revision 1.102 retrieving revision 1.103 diff -u -d -r1.102 -r1.103 --- cheat.cc 12 Feb 2006 22:08:30 -0000 1.102 +++ cheat.cc 29 Jun 2006 06:45:24 -0000 1.103 @@ -772,22 +772,27 @@ int x, y; // Where it's painted. int w, h; Shape_frame *map; + Vga_file *mini; // If "minimaps.vga" is found. + Cheat_map(int mapnum = 0) : map(0), mini(0) { + if (U7exists(PATCH_MINIMAPS)) { + mini = new Vga_file(PATCH_MINIMAPS); + if (!(map = mini->get_shape(0, mapnum))) + map = mini->get_shape(0, 0); + } else { + ShapeID mapid(game->get_shape("sprites/cheatmap"), + 1, SF_GAME_FLX); + map = mapid.get_shape(); + } + // Get coords. for centered view. + w = map->get_width(); + h = map->get_height(); + x = (gwin->get_width() - w)/2 + map->get_xleft(); + y = (gwin->get_height() - h)/2 + map->get_yabove(); + } + ~Cheat_map() { delete mini; } - virtual void paint() - { -#if 0 - ShapeID mapid(game->get_shape("sprites/map"), 0, SF_SPRITES_VGA); -#else - ShapeID mapid(game->get_shape("sprites/cheatmap"), 1, SF_GAME_FLX); -#endif - map = mapid.get_shape(); - - // Get coords. for centered view. - w = map->get_width(); - h = map->get_height(); - x = (gwin->get_width() - w)/2 + map->get_xleft(); - y = (gwin->get_height() - h)/2 + map->get_yabove(); - mapid.paint_shape(x, y, 1); + virtual void paint() { + sman->paint_shape(x, y, map, true); // mark current location int xx, yy; @@ -806,7 +811,7 @@ void Cheat::map_teleport (void) const { if (!enabled) return; - Cheat_map map; + Cheat_map map(gwin->get_map()->get_num()); int xx, yy; if (!Get_click(xx, yy, Mouse::greenselect, 0, false, &map)) { gwin->paint(); |