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

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

[Wesnoth-cvs-commits] wesnoth/src/tools exploder_utils.cpp


From: Guillaume Melquiond
Subject: [Wesnoth-cvs-commits] wesnoth/src/tools exploder_utils.cpp
Date: Thu, 10 Mar 2005 08:55:25 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <address@hidden>    05/03/10 13:55:24

Modified files:
        src/tools      : exploder_utils.cpp 

Log message:
        Remove unused variables and fix unsigned comparisons to 0.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/tools/exploder_utils.cpp.diff?tr1=1.5&tr2=1.6&r1=text&r2=text

Patches:
Index: wesnoth/src/tools/exploder_utils.cpp
diff -u wesnoth/src/tools/exploder_utils.cpp:1.5 
wesnoth/src/tools/exploder_utils.cpp:1.6
--- wesnoth/src/tools/exploder_utils.cpp:1.5    Thu Mar 10 13:46:22 2005
+++ wesnoth/src/tools/exploder_utils.cpp        Thu Mar 10 13:55:24 2005
@@ -1,4 +1,4 @@
-/* $Id: exploder_utils.cpp,v 1.5 2005/03/10 13:46:22 silene Exp $ */
+/* $Id: exploder_utils.cpp,v 1.6 2005/03/10 13:55:24 silene Exp $ */
 /*
    Copyright (C) 2004 by Philippe Plantier <address@hidden>
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -62,13 +62,8 @@
        surface_lock mask_lock(mask);
 
        Uint32* dest_beg = dest_lock.pixels();
-       Uint32* dest_end = dest_beg + dest->w*dest->h;
-
        Uint32* src_beg = src_lock.pixels();
-       Uint32* src_end = src_beg + src->w*src->h;
-
        Uint32* mask_beg = mask_lock.pixels();
-       Uint32* mask_end = mask_beg + mask->w*mask->h;
 
        size_t small_shift_before;
        size_t small_shift_after;
@@ -77,16 +72,15 @@
        size_t src_height = src->h;
 
        if(x < 0) {
-               src_width += x;
                small_shift_before = -x;
+               if (src_width < small_shift_before)
+                       return;
+               src_width -= small_shift_before;
                x = 0;
        } else {
                small_shift_before = 0;
        }
 
-       if(src_width < 0)
-               return;
-       
        if(x + src_width <= dest->w) {
                small_shift_after = 0;
        } else {
@@ -94,22 +88,18 @@
                src_width = dest->w - x;
        }
 
-       if(src_width < 0)
-               return;
-
        if(y >= 0) {
                dest_beg += dest->w * y + x;
        } else {
                src_beg += (-y) * src->w;
                mask_beg += (-y) * mask->w;
                dest_beg += x;
+               if (src_height < (size_t)-y)
+                       return;
                src_height += y;
                y = 0;
        }
 
-       if(src_height < 0)
-               return;
-
        if(y + src_height > dest->h) {
                src_height = dest->h - y;
        }




reply via email to

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