no jumbo cursors please.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4739 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
230ce4e0a0
commit
3e2169bbc4
4 changed files with 9 additions and 4 deletions
|
@ -676,10 +676,12 @@ void SCR_DrawCursor(void)
|
||||||
oldcurs = key_customcursor[cmod].handle;
|
oldcurs = key_customcursor[cmod].handle;
|
||||||
if (rf->VID_CreateCursor)
|
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)
|
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)
|
if (scr_curcursor != key_customcursor[cmod].handle)
|
||||||
|
|
|
@ -327,7 +327,7 @@ typedef struct rendererinfo_s {
|
||||||
void (*VID_SwapBuffers) (void); //force a buffer swap, regardless of what's displayed.
|
void (*VID_SwapBuffers) (void); //force a buffer swap, regardless of what's displayed.
|
||||||
qboolean (*VID_ApplyGammaRamps) (unsigned short *ramps);
|
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
|
qboolean (*VID_SetCursor) (void *cursor); //may be null
|
||||||
void (*VID_DestroyCursor) (void *cursor); //may be null
|
void (*VID_DestroyCursor) (void *cursor); //may be null
|
||||||
|
|
||||||
|
|
|
@ -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;
|
m->scale = (prinst->callargc>2)?G_FLOAT(OFS_PARM2+2):0;
|
||||||
if (m->scale <= 0)
|
if (m->scale <= 0)
|
||||||
m->scale = 1;
|
m->scale = 1;
|
||||||
|
m->dirty = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
int width, height;
|
||||||
BITMAPV5HEADER bi;
|
BITMAPV5HEADER bi;
|
||||||
|
@ -568,6 +568,8 @@ void *WIN_CreateCursor(char *filename, int hotx, int hoty)
|
||||||
int filelen;
|
int filelen;
|
||||||
if (!filename || !*filename)
|
if (!filename || !*filename)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
if (scale != 1) //rescaling cursors is not supported at this time.
|
||||||
|
return NULL;
|
||||||
filelen = FS_LoadFile(filename, &filedata);
|
filelen = FS_LoadFile(filename, &filedata);
|
||||||
if (!filedata)
|
if (!filedata)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in a new issue