Author: silene
Date: Sat Feb 13 11:43:57 2010
New Revision: 41180
URL: http://svn.gna.org/viewcvs/wesnoth?rev=41180&view=rev
Log:
Removed useless class pixel_data.
Modified:
trunk/src/sdl_utils.cpp
trunk/src/sdl_utils.hpp
Modified: trunk/src/sdl_utils.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/sdl_utils.cpp?rev=41180&r1=41179&r2=41180&view=diff
==============================================================================
--- trunk/src/sdl_utils.cpp (original)
+++ trunk/src/sdl_utils.cpp Sat Feb 13 11:43:57 2010
@@ -19,9 +19,10 @@
#include "global.hpp"
-#include "config.hpp"
#include "video.hpp"
+#include <algorithm>
+#include <cassert>
#include <cstring>
#include <iostream>
@@ -1726,27 +1727,6 @@
return inverse;
}
-void pixel_data::read(const config& cfg) {
- const std::string& red = cfg["red"];
- const std::string& green = cfg["green"];
- const std::string& blue = cfg["blue"];
-
- if (red.empty())
- r = 0;
- else
- r = atoi(red.c_str());
-
- if (green.empty())
- g = 0;
- else
- g = atoi(green.c_str());
-
- if (blue.empty())
- b = 0;
- else
- b = atoi(blue.c_str());
-}
-
surface_restorer::surface_restorer() : target_(NULL), rect_(empty_rect),
surface_(NULL)
{
}
Modified: trunk/src/sdl_utils.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/sdl_utils.hpp?rev=41180&r1=41179&r2=41180&view=diff
==============================================================================
--- trunk/src/sdl_utils.hpp (original)
+++ trunk/src/sdl_utils.hpp Sat Feb 13 11:43:57 2010
@@ -305,39 +305,6 @@
SDL_Color inverse(const SDL_Color& colour);
SDL_Color int_to_color(const Uint32 rgb);
-class config; // no need to include config.hpp
-
-struct pixel_data
-{
- pixel_data() : r(0), g(0), b(0)
- {}
-
- pixel_data(int red, int green, int blue) : r(red), g(green), b(blue)
- {}
-
- pixel_data(int pixel, SDL_PixelFormat* fmt) : r(0), g(0), b(0) {
- unformat(pixel, fmt);
- }
-
- pixel_data(config& cfg) : r(0), g(0), b(0) {
- read(cfg);
- }
-
- int format(SDL_PixelFormat* fmt) const {
- return SDL_MapRGB(fmt,r,g,b);
- }
-
- void unformat(int pixel, SDL_PixelFormat* fmt) {
- r = ((pixel&fmt->Rmask) >> fmt->Rshift);
- g = ((pixel&fmt->Gmask) >> fmt->Gshift);
- b = ((pixel&fmt->Bmask) >> fmt->Bshift);
- }
-
- void read(const config& cfg);
-
- int r, g, b;
-};
-
struct surface_lock
{
surface_lock(const surface &surf) : surface_(surf), locked_(false)
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits