diff --git a/engine/client/cl_screen.c b/engine/client/cl_screen.c index af22d0f2b..40ece19f8 100644 --- a/engine/client/cl_screen.c +++ b/engine/client/cl_screen.c @@ -676,10 +676,12 @@ void SCR_DrawCursor(void) oldcurs = key_customcursor[cmod].handle; if (rf->VID_CreateCursor) { - key_customcursor[cmod].handle = rf->VID_CreateCursor(key_customcursor[cmod].name, key_customcursor[cmod].hotspot[0], key_customcursor[cmod].hotspot[1]); + key_customcursor[cmod].handle = rf->VID_CreateCursor(key_customcursor[cmod].name, key_customcursor[cmod].hotspot[0], key_customcursor[cmod].hotspot[1], key_customcursor[cmod].scale); if (!key_customcursor[cmod].handle) - key_customcursor[cmod].handle = rf->VID_CreateCursor("gfx/cursor.lmp", key_customcursor[cmod].hotspot[0], key_customcursor[cmod].hotspot[1]); //try the fallback + key_customcursor[cmod].handle = rf->VID_CreateCursor("gfx/cursor.lmp", key_customcursor[cmod].hotspot[0], key_customcursor[cmod].hotspot[1], key_customcursor[cmod].scale); //try the fallback } + else + key_customcursor[cmod].handle = NULL; } if (scr_curcursor != key_customcursor[cmod].handle) diff --git a/engine/client/merged.h b/engine/client/merged.h index 4478e291f..be987111a 100644 --- a/engine/client/merged.h +++ b/engine/client/merged.h @@ -327,7 +327,7 @@ typedef struct rendererinfo_s { void (*VID_SwapBuffers) (void); //force a buffer swap, regardless of what's displayed. qboolean (*VID_ApplyGammaRamps) (unsigned short *ramps); - void *(*VID_CreateCursor) (char *filename, int hotx, int hoty); //may be null, stub returns null + void *(*VID_CreateCursor) (char *filename, float hotx, float hoty, float scale); //may be null, stub returns null qboolean (*VID_SetCursor) (void *cursor); //may be null void (*VID_DestroyCursor) (void *cursor); //may be null diff --git a/engine/client/pr_csqc.c b/engine/client/pr_csqc.c index 043c57f41..4849300e3 100644 --- a/engine/client/pr_csqc.c +++ b/engine/client/pr_csqc.c @@ -2439,6 +2439,7 @@ static void QCBUILTIN PF_cl_setcursormode (pubprogfuncs_t *prinst, struct global m->scale = (prinst->callargc>2)?G_FLOAT(OFS_PARM2+2):0; if (m->scale <= 0) m->scale = 1; + m->dirty = true; } } diff --git a/engine/gl/gl_vidnt.c b/engine/gl/gl_vidnt.c index 64fe3dfa4..db832bd49 100644 --- a/engine/gl/gl_vidnt.c +++ b/engine/gl/gl_vidnt.c @@ -554,7 +554,7 @@ RECT centerrect(unsigned int parentleft, unsigned int parenttop, unsigned int pa } -void *WIN_CreateCursor(char *filename, int hotx, int hoty) +void *WIN_CreateCursor(char *filename, float hotx, float hoty, float scale) { int width, height; BITMAPV5HEADER bi; @@ -568,6 +568,8 @@ void *WIN_CreateCursor(char *filename, int hotx, int hoty) int filelen; if (!filename || !*filename) return NULL; + if (scale != 1) //rescaling cursors is not supported at this time. + return NULL; filelen = FS_LoadFile(filename, &filedata); if (!filedata) return NULL;