Attempting to fix recent breakages.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3239 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2009-07-06 07:45:46 +00:00
parent 4767b7215d
commit e1ab049608
8 changed files with 667 additions and 654 deletions

View file

@ -743,7 +743,7 @@ int CLGHL_checkparm(char *str, const char **next)
int CLGHL_keyevent(int key, int down)
{
if (key >= 241 && key <= 241+5)
Key_Event(K_MOUSE1+key-241, down);
Key_Event(K_MOUSE1+key-241, 0, down);
else
Con_Printf("CLGHL_keyevent: Unrecognised HL key code\n");
return true; //fixme: check the return type

View file

@ -168,17 +168,17 @@ void IN_Commands(void)
if (imsgs[i].ie_Code == NM_BUTTON_FOURTH)
{
Key_Event(K_MOUSE4, true);
Key_Event(K_MOUSE4, 0, true);
}
else if (imsgs[i].ie_Code == (NM_BUTTON_FOURTH|IECODE_UP_PREFIX))
{
Key_Event(K_MOUSE4, false);
Key_Event(K_MOUSE4, 0, false);
}
if (key)
{
Key_Event(key, 1);
Key_Event(key, 0);
Key_Event(key, 0, 1);
Key_Event(key, 0, 0);
}
}
@ -194,7 +194,7 @@ void IN_Commands(void)
key = keyconv[imsgs[i].ie_Code];
if (key)
Key_Event(key, down);
Key_Event(key, key, down);
else
{
if (developer.value)
@ -205,17 +205,17 @@ void IN_Commands(void)
else if (imsgs[i].ie_Class == IECLASS_RAWMOUSE)
{
if (imsgs[i].ie_Code == IECODE_LBUTTON)
Key_Event(K_MOUSE1, true);
Key_Event(K_MOUSE1, 0, true);
else if (imsgs[i].ie_Code == (IECODE_LBUTTON|IECODE_UP_PREFIX))
Key_Event(K_MOUSE1, false);
Key_Event(K_MOUSE1, 0, false);
else if (imsgs[i].ie_Code == IECODE_RBUTTON)
Key_Event(K_MOUSE2, true);
Key_Event(K_MOUSE2, 0, true);
else if (imsgs[i].ie_Code == (IECODE_RBUTTON|IECODE_UP_PREFIX))
Key_Event(K_MOUSE2, false);
Key_Event(K_MOUSE2, 0, false);
else if (imsgs[i].ie_Code == IECODE_MBUTTON)
Key_Event(K_MOUSE3, true);
Key_Event(K_MOUSE3, 0, true);
else if (imsgs[i].ie_Code == (IECODE_MBUTTON|IECODE_UP_PREFIX))
Key_Event(K_MOUSE3, false);
Key_Event(K_MOUSE3, 0, false);
mouse_x+= imsgs[i].ie_position.ie_xy.ie_x;
mouse_y+= imsgs[i].ie_position.ie_xy.ie_y;

View file

@ -253,7 +253,7 @@ void Sys_SendKeyEvents(void)
case SDL_KEYUP:
case SDL_KEYDOWN:
Key_Event(tbl_sdltoquake[event.key.keysym.sym], event.key.state);
Key_Event(tbl_sdltoquake[event.key.keysym.sym], event.key.keysym.unicode, event.key.state);
break;
case SDL_MOUSEMOTION:
@ -266,7 +266,7 @@ void Sys_SendKeyEvents(void)
//Hmm. SDL allows for 255 buttons...
if (event.button.button > 10)
event.button.button = 10;
Key_Event(K_MOUSE1+event.button.button-1, event.button.state);
Key_Event(K_MOUSE1+event.button.button-1, 0, event.button.state);
break;
case SDL_QUIT:
@ -288,6 +288,8 @@ void IN_Shutdown (void)
void IN_ReInit (void)
{
IN_ActivateMouse();
SDL_EnableUNICODE(SDL_ENABLE);
}
void IN_Init (void)

View file

@ -41,6 +41,11 @@ typedef struct {
#if defined(SERVERONLY)
#define qrenderer QR_NONE
#define FNC(n) (n) //FNC is defined as 'pointer if client build, direct if dedicated server'
#define Mod_SkinForName Mod_SkinNumForName
#define Mod_FrameForName Mod_FrameNumForName
#define Mod_GetFrameDuration Mod_FrameDuration
#else
#define FNC(n) (*n)
extern r_qrenderer_t qrenderer;

View file

@ -2817,7 +2817,7 @@ int Mod_TagNumForName(model_t *model, char *name)
return 0;
}
#ifndef SERVERONLY
int Mod_FrameNumForName(model_t *model, char *name)
{
galiasgroup_t *group;
@ -2844,6 +2844,7 @@ int Mod_FrameNumForName(model_t *model, char *name)
return -1;
}
#ifndef SERVERONLY
int Mod_SkinNumForName(model_t *model, char *name)
{
int i;
@ -2863,6 +2864,7 @@ int Mod_SkinNumForName(model_t *model, char *name)
return -1;
}
#endif
float Mod_FrameDuration(model_t *model, int frameno)
{
@ -2880,7 +2882,6 @@ float Mod_FrameDuration(model_t *model, int frameno)
group += frameno;
return group->numposes/group->rate;
}
#endif
#ifdef MD3MODELS

File diff suppressed because it is too large Load diff

View file

@ -369,7 +369,7 @@ void ClearAllStates (void)
// send an up event for each key, to make sure the server clears them all
for (i=0 ; i<256 ; i++)
{
Key_Event (i, false);
Key_Event (i, 0, false);
}
Key_ClearStates ();
@ -399,7 +399,8 @@ static void GetEvent(void)
break;
case KeyPress:
case KeyRelease:
Key_Event(XLateKey(&event.xkey), event.type == KeyPress);
int b = XLateKey(&event.xkey);
Key_Event(b, b, event.type == KeyPress);
break;
case MotionNotify:
@ -458,7 +459,7 @@ static void GetEvent(void)
b = x11violations?K_MOUSE10:-1;
if (b>=0)
Key_Event(b, true);
Key_Event(b, 0, true);
#ifdef WITH_VMODE
if (vidmode_ext && vidmode_usemode>=0)
if (!ActiveApp)
@ -501,7 +502,7 @@ static void GetEvent(void)
b = x11violations?K_MOUSE10:-1;
if (b>=0)
Key_Event(b, false);
Key_Event(b, 0, false);
break;
case FocusIn:

View file

@ -2023,6 +2023,7 @@ static void PF_frameduration (progfuncs_t *prinst, struct globalvars_s *pr_globa
}
static void PF_skinforname (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
#ifndef SERVERONLY
unsigned int modelindex = G_FLOAT(OFS_PARM0);
char *str = PF_VarString(prinst, 1, pr_globals);
model_t *mod = (modelindex>= MAX_MODELS)?NULL:sv.models[modelindex];
@ -2031,6 +2032,7 @@ static void PF_skinforname (progfuncs_t *prinst, struct globalvars_s *pr_globals
if (mod && Mod_SkinForName)
G_FLOAT(OFS_RETURN) = Mod_SkinForName(mod, str);
else
#endif
G_FLOAT(OFS_RETURN) = -1;
}