[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src/video cursor.c
From: |
Nehal Mistry |
Subject: |
[Stratagus-CVS] stratagus/src/video cursor.c |
Date: |
Mon, 17 Nov 2003 17:07:42 -0500 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Nehal Mistry <address@hidden> 03/11/17 17:07:42
Modified files:
src/video : cursor.c
Log message:
fix pink trails
Patches:
Index: stratagus/src/video/cursor.c
diff -u stratagus/src/video/cursor.c:1.79 stratagus/src/video/cursor.c:1.80
--- stratagus/src/video/cursor.c:1.79 Mon Nov 17 16:52:57 2003
+++ stratagus/src/video/cursor.c Mon Nov 17 17:07:36 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: cursor.c,v 1.79 2003/11/17 21:52:57 nehalmistry Exp $
+// $Id: cursor.c,v 1.80 2003/11/17 22:07:36 nehalmistry Exp $
//@{
@@ -300,10 +300,14 @@
{
// FIXME: todo
int i;
+ int bpp;
+ return;
+
+ bpp = TheScreen->format->BytesPerPixel;
SDL_LockSurface(TheScreen);
for (i = 0; i < h; ++i) {
- memcpy(&((char*)TheScreen->pixels)[x + (y + i) * VideoWidth], buffer,
w);
+ memcpy(&((char*)TheScreen->pixels)[x * bpp + (y + i) *
TheScreen->pitch], buffer, w * bpp);
}
SDL_UnlockSurface(TheScreen);
}
@@ -311,10 +315,14 @@
global void SaveCursorRectangle(void* buffer, int x, int y, int w, int h)
{
int i;
+ int bpp;
+
+ return;
+ bpp = TheScreen->format->BytesPerPixel;
SDL_LockSurface(TheScreen);
for (i = 0; i < h; ++i) {
- memcpy(buffer, &((char*)TheScreen->pixels)[x + (y + i) * VideoWidth],
w);
+ memcpy(buffer, &((char*)TheScreen->pixels)[x * bpp + (y + i) *
TheScreen->pitch], w * bpp);
}
SDL_UnlockSurface(TheScreen);
// FIXME: todo
@@ -525,23 +533,18 @@
drect.y = y;
SDL_BlitSurface(OldCursorImage, &srect, TheScreen, &drect);
- InvalidateArea(x, y, w, h);
}
local void SaveCursorBackground(int x, int y, int w, int h)
{
SDL_Rect srect;
- SDL_Rect drect;
srect.x = x;
srect.y = y;
srect.w = w;
srect.h = h;
- drect.x = 0;
- drect.y = 0;
-
- SDL_BlitSurface(TheScreen, &srect, OldCursorImage, &drect);
+ SDL_BlitSurface(TheScreen, &srect, OldCursorImage, NULL);
}
#else
/**
@@ -769,7 +772,7 @@
#ifdef USE_SDL_SURFACE
size = w * h;
if (OldCursorSize < size) {
- OldCursorImage = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 32, RMASK,
GMASK, BMASK, AMASK);
+ OldCursorImage = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 32, BMASK,
GMASK, RMASK, AMASK);
OldCursorSize = size;
}
#else
@@ -1243,7 +1246,7 @@
int i;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: cursors $Id: cursor.c,v 1.79 2003/11/17
21:52:57 nehalmistry Exp $\n\n");
+ CLprintf(file, ";;; MODULE: cursors $Id: cursor.c,v 1.80 2003/11/17
22:07:36 nehalmistry Exp $\n\n");
for (i = 0; Cursors[i].OType; ++i) {
CLprintf(file, "(define-cursor '%s '%s\n",