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) int CLGHL_keyevent(int key, int down)
{ {
if (key >= 241 && key <= 241+5) if (key >= 241 && key <= 241+5)
Key_Event(K_MOUSE1+key-241, down); Key_Event(K_MOUSE1+key-241, 0, down);
else else
Con_Printf("CLGHL_keyevent: Unrecognised HL key code\n"); Con_Printf("CLGHL_keyevent: Unrecognised HL key code\n");
return true; //fixme: check the return type 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) 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)) 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) if (key)
{ {
Key_Event(key, 1); Key_Event(key, 0, 1);
Key_Event(key, 0); Key_Event(key, 0, 0);
} }
} }
@ -194,7 +194,7 @@ void IN_Commands(void)
key = keyconv[imsgs[i].ie_Code]; key = keyconv[imsgs[i].ie_Code];
if (key) if (key)
Key_Event(key, down); Key_Event(key, key, down);
else else
{ {
if (developer.value) if (developer.value)
@ -205,17 +205,17 @@ void IN_Commands(void)
else if (imsgs[i].ie_Class == IECLASS_RAWMOUSE) else if (imsgs[i].ie_Class == IECLASS_RAWMOUSE)
{ {
if (imsgs[i].ie_Code == IECODE_LBUTTON) 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)) 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) 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)) 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) 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)) 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_x+= imsgs[i].ie_position.ie_xy.ie_x;
mouse_y+= imsgs[i].ie_position.ie_xy.ie_y; 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_KEYUP:
case SDL_KEYDOWN: 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; break;
case SDL_MOUSEMOTION: case SDL_MOUSEMOTION:
@ -266,7 +266,7 @@ void Sys_SendKeyEvents(void)
//Hmm. SDL allows for 255 buttons... //Hmm. SDL allows for 255 buttons...
if (event.button.button > 10) if (event.button.button > 10)
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; break;
case SDL_QUIT: case SDL_QUIT:
@ -288,6 +288,8 @@ void IN_Shutdown (void)
void IN_ReInit (void) void IN_ReInit (void)
{ {
IN_ActivateMouse(); IN_ActivateMouse();
SDL_EnableUNICODE(SDL_ENABLE);
} }
void IN_Init (void) void IN_Init (void)

View file

@ -41,6 +41,11 @@ typedef struct {
#if defined(SERVERONLY) #if defined(SERVERONLY)
#define qrenderer QR_NONE #define qrenderer QR_NONE
#define FNC(n) (n) //FNC is defined as 'pointer if client build, direct if dedicated server' #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 #else
#define FNC(n) (*n) #define FNC(n) (*n)
extern r_qrenderer_t qrenderer; extern r_qrenderer_t qrenderer;

View file

@ -2817,7 +2817,7 @@ int Mod_TagNumForName(model_t *model, char *name)
return 0; return 0;
} }
#ifndef SERVERONLY
int Mod_FrameNumForName(model_t *model, char *name) int Mod_FrameNumForName(model_t *model, char *name)
{ {
galiasgroup_t *group; galiasgroup_t *group;
@ -2844,6 +2844,7 @@ int Mod_FrameNumForName(model_t *model, char *name)
return -1; return -1;
} }
#ifndef SERVERONLY
int Mod_SkinNumForName(model_t *model, char *name) int Mod_SkinNumForName(model_t *model, char *name)
{ {
int i; int i;
@ -2863,6 +2864,7 @@ int Mod_SkinNumForName(model_t *model, char *name)
return -1; return -1;
} }
#endif
float Mod_FrameDuration(model_t *model, int frameno) float Mod_FrameDuration(model_t *model, int frameno)
{ {
@ -2880,7 +2882,6 @@ float Mod_FrameDuration(model_t *model, int frameno)
group += frameno; group += frameno;
return group->numposes/group->rate; return group->numposes/group->rate;
} }
#endif
#ifdef MD3MODELS #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 // send an up event for each key, to make sure the server clears them all
for (i=0 ; i<256 ; i++) for (i=0 ; i<256 ; i++)
{ {
Key_Event (i, false); Key_Event (i, 0, false);
} }
Key_ClearStates (); Key_ClearStates ();
@ -399,7 +399,8 @@ static void GetEvent(void)
break; break;
case KeyPress: case KeyPress:
case KeyRelease: case KeyRelease:
Key_Event(XLateKey(&event.xkey), event.type == KeyPress); int b = XLateKey(&event.xkey);
Key_Event(b, b, event.type == KeyPress);
break; break;
case MotionNotify: case MotionNotify:
@ -458,7 +459,7 @@ static void GetEvent(void)
b = x11violations?K_MOUSE10:-1; b = x11violations?K_MOUSE10:-1;
if (b>=0) if (b>=0)
Key_Event(b, true); Key_Event(b, 0, true);
#ifdef WITH_VMODE #ifdef WITH_VMODE
if (vidmode_ext && vidmode_usemode>=0) if (vidmode_ext && vidmode_usemode>=0)
if (!ActiveApp) if (!ActiveApp)
@ -501,7 +502,7 @@ static void GetEvent(void)
b = x11violations?K_MOUSE10:-1; b = x11violations?K_MOUSE10:-1;
if (b>=0) if (b>=0)
Key_Event(b, false); Key_Event(b, 0, false);
break; break;
case FocusIn: 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) static void PF_skinforname (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
#ifndef SERVERONLY
unsigned int modelindex = G_FLOAT(OFS_PARM0); unsigned int modelindex = G_FLOAT(OFS_PARM0);
char *str = PF_VarString(prinst, 1, pr_globals); char *str = PF_VarString(prinst, 1, pr_globals);
model_t *mod = (modelindex>= MAX_MODELS)?NULL:sv.models[modelindex]; 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) if (mod && Mod_SkinForName)
G_FLOAT(OFS_RETURN) = Mod_SkinForName(mod, str); G_FLOAT(OFS_RETURN) = Mod_SkinForName(mod, str);
else else
#endif
G_FLOAT(OFS_RETURN) = -1; G_FLOAT(OFS_RETURN) = -1;
} }