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: Jimmy Salmon
Subject: [Stratagus-CVS] stratagus/src/video cursor.c
Date: Wed, 03 Dec 2003 14:46:51 -0500

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Jimmy Salmon <address@hidden>   03/12/03 14:46:51

Modified files:
        src/video      : cursor.c 

Log message:
        Fixed cursor rectangle

Patches:
Index: stratagus/src/video/cursor.c
diff -u stratagus/src/video/cursor.c:1.86 stratagus/src/video/cursor.c:1.87
--- stratagus/src/video/cursor.c:1.86   Wed Dec  3 12:52:41 2003
+++ stratagus/src/video/cursor.c        Wed Dec  3 14:46:50 2003
@@ -10,7 +10,8 @@
 //
 /address@hidden cursor.c       -       The cursors. */
 //
-//     (c) Copyright 1998,2000-2002 by Lutz Sammer and Nehal Mistry
+//     (c) Copyright 1998,2000-2003 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.86 2003/12/03 17:52:41 nehalmistry Exp $
+//     $Id: cursor.c,v 1.87 2003/12/03 19:46:50 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.86 2003/12/03 
17:52:41 nehalmistry Exp $\n\n");
+    CLprintf(file, ";;; MODULE: cursors $Id: cursor.c,v 1.87 2003/12/03 
19:46:50 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]