summaryrefslogtreecommitdiffstats
path: root/src/glut/fbdev/cursor.c
diff options
context:
space:
mode:
authorSean D'Epagnier <[email protected]>2006-08-10 10:21:17 +0000
committerSean D'Epagnier <[email protected]>2006-08-10 10:21:17 +0000
commit7196cddb3a404292858101f9cd1a5061e422d2c1 (patch)
treeaa3f79e21b08d9f114c7b1984e6c86c114081cfe /src/glut/fbdev/cursor.c
parent54e15d65858c1d1eeea7291059766686cf2e1671 (diff)
Added initial multisampling support to glfbdev driver.
Fully implemented glutGameMode, and added vidresize stubs to make Added support for glutReshapeDisplay to change video mode but not lose current mesa context. implementation glut 5 complient. Fixed many minor bugs Updated docs
Diffstat (limited to 'src/glut/fbdev/cursor.c')
-rw-r--r--src/glut/fbdev/cursor.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/glut/fbdev/cursor.c b/src/glut/fbdev/cursor.c
index b753a5c9ff5..06ae2d6f54e 100644
--- a/src/glut/fbdev/cursor.c
+++ b/src/glut/fbdev/cursor.c
@@ -44,7 +44,7 @@ static unsigned char *MouseBuffer;
void InitializeCursor(void)
{
- if((MouseBuffer = malloc(CURSOR_WIDTH * CURSOR_HEIGHT
+ if(!MouseBuffer && (MouseBuffer = malloc(CURSOR_WIDTH * CURSOR_HEIGHT
* VarInfo.bits_per_pixel / 8)) == NULL) {
sprintf(exiterror, "malloc failure\n");
exit(0);
@@ -216,10 +216,10 @@ void SwapCursor(void)
if(miny < 0)
miny = 0;
- if(minx + sizex > VarInfo.xres)
- sizex = VarInfo.xres - minx;
- if(miny + sizey > VarInfo.yres)
- sizey = VarInfo.yres - miny;
+ if(minx + sizex > VarInfo.xres - CURSOR_WIDTH)
+ sizex = VarInfo.xres - CURSOR_WIDTH - minx;
+ if(miny + sizey > VarInfo.yres - CURSOR_HEIGHT)
+ sizey = VarInfo.yres - CURSOR_HEIGHT - miny;
off = FixedInfo.line_length * miny
+ minx * VarInfo.bits_per_pixel / 8;
stride = (sizex + CURSOR_WIDTH) * VarInfo.bits_per_pixel / 8;