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

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

[Wesnoth-cvs-commits] wesnoth src/editor/editor_palettes.cpp data/ter...


From: David White
Subject: [Wesnoth-cvs-commits] wesnoth src/editor/editor_palettes.cpp data/ter...
Date: Sun, 03 Oct 2004 09:40:41 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     David White <address@hidden>    04/10/03 13:33:46

Modified files:
        src/editor     : editor_palettes.cpp 
        data           : terrain.cfg 

Log message:
        fixed crash in the editor

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/editor/editor_palettes.cpp.diff?tr1=1.16&tr2=1.17&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/data/terrain.cfg.diff?tr1=1.44&tr2=1.45&r1=text&r2=text

Patches:
Index: wesnoth/data/terrain.cfg
diff -u wesnoth/data/terrain.cfg:1.44 wesnoth/data/terrain.cfg:1.45
--- wesnoth/data/terrain.cfg:1.44       Sat Sep 11 17:17:20 2004
+++ wesnoth/data/terrain.cfg    Sun Oct  3 13:33:46 2004
@@ -263,12 +263,13 @@
 recruit_onto=true
 [/terrain]
 
-[terrain]
-char=O
-name=orccastle
-aliasof=C
-image=orccastle
-[/terrain]
+#this is commented-out until someone actually makes it work
+#[terrain]
+#char=O
+#name=orccastle
+#aliasof=C
+#image=orccastle
+#[/terrain]
 
 [terrain]
 image=canyon-n-s
Index: wesnoth/src/editor/editor_palettes.cpp
diff -u wesnoth/src/editor/editor_palettes.cpp:1.16 
wesnoth/src/editor/editor_palettes.cpp:1.17
--- wesnoth/src/editor/editor_palettes.cpp:1.16 Thu Sep  2 11:34:28 2004
+++ wesnoth/src/editor/editor_palettes.cpp      Sun Oct  3 13:33:46 2004
@@ -256,15 +256,16 @@
                const std::string filename = "terrain/" +
                        map_.get_terrain_info(terrain).default_image() + ".png";
                surface image(image::get_image(filename, image::UNSCALED));
+               if(image == NULL) {
+                       std::cerr << "image for terrain " << counter << ": '" 
<< filename << "' not found\n";
+                       return;
+               }
+
                if((unsigned)image->w != size_specs_.terrain_size
                   || (unsigned)image->h != size_specs_.terrain_size) {
                        image.assign(scale_surface(image, 
size_specs_.terrain_size,
                                                                           
size_specs_.terrain_size));
                }
-               if(image == NULL) {
-                       std::cerr << "image for terrain '" << counter << "' not 
found\n";
-                       return;
-               }
                const int counter_from_zero = counter - starting;
                SDL_Rect dstrect;
                dstrect.x = loc.x + (counter_from_zero % 2 != 0 ? 
size_specs_.terrain_space : 0);




reply via email to

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