Author: esr
Date: Fri Jun 22 13:59:47 2007
New Revision: 18374
URL: http://svn.gna.org/viewcvs/wesnoth?rev=18374&view=rev
Log:
Lift the sceenshot() and get_zoom_facotor() functions.
Modified:
trunk/src/display.cpp
trunk/src/display.hpp
Modified: trunk/src/display.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.cpp?rev=18374&r1=18373&r2=18374&view=diff
==============================================================================
--- trunk/src/display.cpp (original)
+++ trunk/src/display.cpp Fri Jun 22 13:59:47 2007
@@ -111,6 +111,28 @@
y < area.y || y > area.y + area.h - y_thresh);
}
+void map_display::screenshot()
+{
+ std::string datadir = get_screenshot_dir();
+ static unsigned int counter = 0;
+ std::string name;
+
+ do {
+ std::stringstream filename;
+
+ filename << datadir << "/" << _("Screenshot") << "_";
+ filename.width(5);
+ filename.fill('0');
+ filename.setf(std::ios_base::right);
+ filename << counter << ".bmp";
+
+ counter++;
+ name = filename.str();
+
+ } while(file_exists(name));
+
+ SDL_SaveBMP(screen_.getSurface().get(), name.c_str());
+}
// Methods for superclass aware of units go here
@@ -563,29 +585,6 @@
set_zoom(DefaultZoom - zoom_);
}
-void display::screenshot()
-{
- std::string datadir = get_screenshot_dir();
- static unsigned int counter = 0;
- std::string name;
-
- do {
- std::stringstream filename;
-
- filename << datadir << "/" << _("Screenshot") << "_";
- filename.width(5);
- filename.fill('0');
- filename.setf(std::ios_base::right);
- filename << counter << ".bmp";
-
- counter++;
- name = filename.str();
-
- } while(file_exists(name));
-
- SDL_SaveBMP(screen_.getSurface().get(), name.c_str());
-}
-
void display::scroll_to_tile(const gamemap::location& loc, SCROLL_TYPE
scroll_type, bool check_fogged)
{
if(screen_.update_locked() || (check_fogged && fogged(loc))) {
Modified: trunk/src/display.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.hpp?rev=18374&r1=18373&r2=18374&view=diff
==============================================================================
--- trunk/src/display.hpp (original)
+++ trunk/src/display.hpp Fri Jun 22 13:59:47 2007
@@ -95,6 +95,11 @@
//(from top tip to bottom tip or left edge to right edge)
int hex_size() const { return zoom_; }
+ // Returns the current zoom factor.
+ double get_zoom_factor() { return
double(zoom_)/double(image::tile_size); }
+ //function to make a screenshot and save it in a default location
+ void screenshot();
+
protected:
CVideo& screen_;
const gamemap& map_;
@@ -131,12 +136,6 @@
// sets the zoom amount to the default.
void set_default_zoom();
-
- // Returns the current zoom factor.
- double get_zoom_factor() { return
double(zoom_)/double(image::tile_size); }
-
- //function to make a screenshot and save it in a default location
- void screenshot();
enum SCROLL_TYPE { SCROLL, WARP, ONSCREEN };
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits