wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src image.cpp


From: Guillaume Melquiond
Subject: [Wesnoth-cvs-commits] wesnoth/src image.cpp
Date: Sat, 30 Oct 2004 12:10:14 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <address@hidden>    04/10/30 16:04:36

Modified files:
        src            : image.cpp 

Log message:
        Switched to new logging system.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/image.cpp.diff?tr1=1.64&tr2=1.65&r1=text&r2=text

Patches:
Index: wesnoth/src/image.cpp
diff -u wesnoth/src/image.cpp:1.64 wesnoth/src/image.cpp:1.65
--- wesnoth/src/image.cpp:1.64  Tue Oct 19 20:49:09 2004
+++ wesnoth/src/image.cpp       Sat Oct 30 16:04:35 2004
@@ -4,6 +4,7 @@
 #include "image.hpp"
 #include "display.hpp"
 #include "font.hpp"
+#include "log.hpp"
 #include "sdl_utils.hpp"
 #include "team.hpp"
 #include "util.hpp"
@@ -14,6 +15,9 @@
 #include <map>
 #include <string>
 
+#define LOG_DP lg::info(lg::display)
+#define ERR_DP lg::err(lg::display)
+
 namespace {
 
 typedef std::map<gamemap::TERRAIN, surface> mini_terrain_cache_map;
@@ -197,7 +201,7 @@
        } else {
                const surface res(IMG_Load(location.c_str()));
                if(res == NULL) {
-                       std::cerr << "Error: could not open image '" << 
val_.filename_ << "'\n";
+                       ERR_DP << "could not open image '" << val_.filename_ << 
"'\n";
                }
 
                return res;
@@ -623,10 +627,9 @@
 surface getMinimap(int w, int h, const gamemap& map, 
                int lawful_bonus, const team* tm)
 {
-       std::cerr << "generating minimap\n";
        const int scale = 8;
 
-       std::cerr << "creating minimap " << int(map.x()*scale*0.75) << "," << 
int(map.y()*scale) << "\n";
+       LOG_DP << "creating minimap " << int(map.x()*scale*0.75) << "," << 
int(map.y()*scale) << "\n";
 
        const size_t map_width = map.x()*scale*3/4;
        const size_t map_height = map.y()*scale;
@@ -644,8 +647,6 @@
        if(minimap == NULL)
                return surface(NULL);
 
-       // std::cerr << "created minimap: " << int(minimap) << "," << 
int(minimap->pixels) << "\n";
-
        typedef mini_terrain_cache_map cache_map;
        cache_map& cache = mini_terrain_cache;
 
@@ -665,7 +666,7 @@
                                        surface tile(get_image("terrain/" + 
map.get_terrain_info(terrain).symbol_image() + ".png",image::UNSCALED));
 
                                        if(tile == NULL) {
-                                               std::cerr << "Could not get 
image for terrrain '"
+                                               ERR_DP << "could not get image 
for terrrain '"
                                                          << terrain << "'\n";
                                                continue;
                                        }
@@ -693,14 +694,12 @@
                }
        }
 
-       // std::cerr << "scaling minimap..." << int(minimap) << "." << 
int(minimap->pixels) << "\n";
-
        if((minimap->w != w || minimap->h != h) && w != 0) {
                const surface surf(minimap);
                minimap = surface(scale_surface(surf,w,h));
        }
 
-       std::cerr << "done generating minimap\n";
+       LOG_DP << "done generating minimap\n";
 
        return minimap;
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]