stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus/src/video cursor.c


From: address@hidden
Subject: [Stratagus-CVS] stratagus/src/video cursor.c
Date: 2 Jan 2004 08:40:43 +1100

CVSROOT:        /home/strat
Module name:    stratagus
Changes by:      <address@hidden>       04/01/02 08:40:43

Modified files:
        src/video      : cursor.c 

Log message:
        Fixed rectangle cursor again

Patches:
Index: stratagus/src/video/cursor.c
diff -u stratagus/src/video/cursor.c:1.87 stratagus/src/video/cursor.c:1.88
--- stratagus/src/video/cursor.c:1.87   Sat Dec 20 16:33:47 2003
+++ stratagus/src/video/cursor.c        Fri Jan  2 08:40:42 2004
@@ -4,13 +4,14 @@
 //      /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ |
 //     /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
 //             \/                  \/          \//_____/            \/
-//  ______________________                          ______________________
-//                       T H E   W A R   B E G I N S
-//        Stratagus - A free fantasy real time strategy game engine
+//  ______________________                           ______________________
+//                        T H E   W A R   B E G I N S
+//         Stratagus - A free fantasy real time strategy game engine
 //
-/address@hidden cursor.c       -       The cursors. */
+/address@hidden cursor.c - The cursors. */
 //
-//     (c) Copyright 1998,2000-2002 by Lutz Sammer and Nehal Mistry
+//      (c) Copyright 1998,2000-2004 by Lutz Sammer, Nehal Mistry,
+//                                      and Jimmy Salmon
 //
 //      This program is free software; you can redistribute it and/or modify
 //      it under the terms of the GNU General Public License as published by
@@ -26,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: cursor.c,v 1.87 2003/12/20 05:33:47 jsalmon3 Exp $
+//     $Id: cursor.c,v 1.88 2004/01/01 21:40:42 jsalmon3 Exp $
 
 //@{
 
@@ -309,17 +310,19 @@
        sp = buffer;
        memcpy(&((unsigned char*)TheScreen->pixels)
                [x * bpp + y * TheScreen->pitch], sp, w * bpp);
-       sp += w * bpp;
-       memcpy(&((unsigned char*)TheScreen->pixels)
-               [x * bpp + (y + h) * TheScreen->pitch], sp, w * bpp);
-       sp += w * bpp;
-       for (i = 1; i < h; ++i) {
-               memcpy(&((unsigned char*)TheScreen->pixels)
-                       [x * bpp + (y + i) * TheScreen->pitch], sp, bpp);
+       if (--h) {
+               sp += w * bpp;
                memcpy(&((unsigned char*)TheScreen->pixels)
-                       [(x + w - 1) * bpp + (y + i) * TheScreen->pitch],
-                               sp + bpp, bpp);
-               sp += bpp * 2;
+                       [x * bpp + (y + h) * TheScreen->pitch], sp, w * bpp);
+               sp += w * bpp;
+               for (i = 1; i < h; ++i) {
+                       memcpy(&((unsigned char*)TheScreen->pixels)
+                               [x * bpp + (y + i) * TheScreen->pitch], sp, 
bpp);
+                       memcpy(&((unsigned char*)TheScreen->pixels)
+                               [(x + w - 1) * bpp + (y + i) * 
TheScreen->pitch],
+                                       sp + bpp, bpp);
+                       sp += bpp * 2;
+               }
        }
 
        VideoUnlockScreen();
@@ -338,16 +341,18 @@
        dp = buffer;
        memcpy(dp, &((unsigned char*)TheScreen->pixels)
                [x * bpp + y * TheScreen->pitch], w * bpp);
-       dp += w * bpp;
-       memcpy(dp, &((unsigned char*)TheScreen->pixels)
-               [x * bpp + (y + h) * TheScreen->pitch], w * bpp);
-       dp += w * bpp;
-       for (i = 1; i < h; ++i) {
+       if (--h) {
+               dp += w * bpp;
                memcpy(dp, &((unsigned char*)TheScreen->pixels)
-                       [x * bpp + (y + i) * TheScreen->pitch], bpp);
-               memcpy(dp + bpp, &((unsigned char*)TheScreen->pixels)
-                       [(x + w - 1) * bpp + (y + i) * TheScreen->pitch], bpp);
-               dp += bpp * 2;
+                       [x * bpp + (y + h) * TheScreen->pitch], w * bpp);
+               dp += w * bpp;
+               for (i = 1; i < h; ++i) {
+                       memcpy(dp, &((unsigned char*)TheScreen->pixels)
+                               [x * bpp + (y + i) * TheScreen->pitch], bpp);
+                       memcpy(dp + bpp, &((unsigned char*)TheScreen->pixels)
+                               [(x + w - 1) * bpp + (y + i) * 
TheScreen->pitch], bpp);
+                       dp += bpp * 2;
+               }
        }
 
        VideoUnlockScreen();
@@ -1281,7 +1286,7 @@
        int i;
 
        CLprintf(file, "\n;;; -----------------------------------------\n");
-       CLprintf(file, ";;; MODULE: cursors $Id: cursor.c,v 1.87 2003/12/20 
05:33:47 jsalmon3 Exp $\n\n");
+       CLprintf(file, ";;; MODULE: cursors $Id: cursor.c,v 1.88 2004/01/01 
21:40:42 jsalmon3 Exp $\n\n");
 
        for (i = 0; Cursors[i].OType; ++i) {
                CLprintf(file, "(define-cursor '%s '%s\n",




reply via email to

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