couple of compile fixes.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4130 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2012-10-14 11:20:14 +00:00
parent e31ebac4cb
commit e9de58cf6a
7 changed files with 35 additions and 125 deletions

View file

@ -908,7 +908,7 @@ ifneq ($(shell echo $(FTE_TARGET)|grep macosx),)
endif endif
GL_LDFLAGS=-framework AGL -framework OpenGL -framework Cocoa -framework AudioUnit -lz -lpng -ljpeg GL_LDFLAGS=-framework AGL -framework OpenGL -framework Cocoa -framework AudioUnit -lz -lpng -ljpeg
GLCL_OBJS=$(GL_OBJS) $(D3DGL_OBJS) $(GLQUAKE_OBJS) gl_vidcocoa.mo gl_vidmacos.o sys_linux.o in_macos.o cd_null.o snd_macos.o GLCL_OBJS=$(GL_OBJS) $(D3DGL_OBJS) $(GLQUAKE_OBJS) gl_vidcocoa.mo gl_vidmacos.o sys_linux.o cd_null.o snd_macos.o
GL_EXE_NAME=../macosx_fteqw.gl$(EXTENSION)$(BITS) GL_EXE_NAME=../macosx_fteqw.gl$(EXTENSION)$(BITS)
GLCL_EXE_NAME=../macosx_fteqwcl.gl$(EXTENSION)$(BITS) GLCL_EXE_NAME=../macosx_fteqwcl.gl$(EXTENSION)$(BITS)

View file

@ -1,104 +0,0 @@
/*
Copyright (C) 2001-2002 A Nourai
Copyright (C) 2006 Jacek Piszczek (Mac OSX port)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the included (GNU.txt) GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "quakedef.h"
float mouse_x,mouse_y;
float old_mouse_x,old_mouse_y;
cvar_t m_filter = SCVARF("m_filter", "1", CVAR_ARCHIVE);
void IN_Init (void)
{
Cvar_Register (&m_filter, "input values");
}
void IN_ReInit(void)
{
}
void IN_Shutdown (void)
{
}
void IN_Commands (void)
{
}
// oportunity for devices to stick commands on the script buffer
void IN_ModeChanged (void)
{
}
// called whenever screen dimensions change
void IN_Move (float *movements, int pnum)
{
float tx, ty, filterfrac;
#ifdef PEXT_CSQC
if (CSQC_MouseMove(mouse_x, mouse_y, 0))
{
mouse_x = 0;
mouse_y = 0;
}
#endif
tx = mouse_x;
ty = mouse_y;
if (m_filter.value)
{
filterfrac = bound(0, m_filter.value, 1) / 2.0;
mouse_x = (tx * (1 - filterfrac) + old_mouse_x * filterfrac);
mouse_y = (ty * (1 - filterfrac) + old_mouse_y * filterfrac);
}
old_mouse_x = tx;
old_mouse_y = ty;
mouse_x *= sensitivity.value;
mouse_y *= sensitivity.value;
if ((in_strafe.state[pnum] & 1) || (lookstrafe.value && in_mlook.state[pnum]))
{
movements[1] += m_side.value * mouse_x;
}
else
{
cl.playerview[pnum].viewanglechange[YAW] -= m_yaw.value * mouse_x;
}
if (in_mlook.state[pnum])
V_StopPitchDrift(pnum);
if (in_mlook.state[pnum] && !(in_strafe.state[pnum] & 1))
{
cl.playerview[pnum].viewanglechange[PITCH] += m_pitch.value * mouse_y;
}
else
{
movements[0] -= m_forward.value * mouse_y;
}
mouse_x = mouse_y = 0.0;
}
// add additional movement on top of the keyboard move cmd

View file

@ -128,6 +128,10 @@ void INS_Init(void)
//IN_KeyEvent is threadsafe (for one other thread, anyway) //IN_KeyEvent is threadsafe (for one other thread, anyway)
void INS_ProcessInputMessage(struct InputEvent *msg, qboolean consumemotion) void INS_ProcessInputMessage(struct InputEvent *msg, qboolean consumemotion)
{ {
int key;
qboolean down;
int code;
if ((window->Flags & WFLG_WINDOWACTIVE)) if ((window->Flags & WFLG_WINDOWACTIVE))
{ {
if (msg->ie_Class == IECLASS_NEWMOUSE) if (msg->ie_Class == IECLASS_NEWMOUSE)
@ -158,13 +162,11 @@ void INS_ProcessInputMessage(struct InputEvent *msg, qboolean consumemotion)
else if (msg->ie_Class == IECLASS_RAWKEY) else if (msg->ie_Class == IECLASS_RAWKEY)
{ {
down = !(msg->ie_Code&IECODE_UP_PREFIX); down = !(msg->ie_Code&IECODE_UP_PREFIX);
msg->ie_Code&=~IECODE_UP_PREFIX; code = msg->ie_Code & ~IECODE_UP_PREFIX;
memcpy(&ie, msg, sizeof(ie));
key = 0; key = 0;
if (msg->ie_Code <= 255) if (code <= 255)
key = keyconv[msg->ie_Code]; key = keyconv[code];
if (key) if (key)
IN_KeyEvent(0, down, key, key); IN_KeyEvent(0, down, key, key);
@ -197,10 +199,10 @@ void INS_ProcessInputMessage(struct InputEvent *msg, qboolean consumemotion)
IN_MouseMove(0, 0, msg->ie_position.ie_xy.ie_x, msg->ie_position.ie_xy.ie_y, 0, 0); IN_MouseMove(0, 0, msg->ie_position.ie_xy.ie_x, msg->ie_position.ie_xy.ie_y, 0, 0);
#if 0 #if 0
coin->ie_Class = IECLASS_NULL; msg->ie_Class = IECLASS_NULL;
#else #else
coin->ie_position.ie_xy.ie_x = 0; msg->ie_position.ie_xy.ie_x = 0;
coin->ie_position.ie_xy.ie_y = 0; msg->ie_position.ie_xy.ie_y = 0;
#endif #endif
} }
} }

View file

@ -31,9 +31,6 @@ void IN_Commands (void);
void IN_Move (float *movements, int pnum); void IN_Move (float *movements, int pnum);
// add additional movement on top of the keyboard move cmd // add additional movement on top of the keyboard move cmd
void IN_ModeChanged (void);
// called whenever screen dimensions change
extern cvar_t in_xflip; extern cvar_t in_xflip;
#ifdef _SDL #ifdef _SDL

View file

@ -216,7 +216,7 @@ static qboolean D3D9AppActivate(BOOL fActive, BOOL minimize)
sound_active = true; sound_active = true;
} }
IN_UpdateGrabs(modestate != MS_WINDOWED, ActiveApp); INS_UpdateGrabs(modestate != MS_WINDOWED, ActiveApp);
if (fActive) if (fActive)
{ {
@ -317,7 +317,7 @@ static LRESULT WINAPI D3D9_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
temp |= 512; temp |= 512;
if (!vid_initializing) if (!vid_initializing)
IN_MouseEvent (temp); INS_MouseEvent (temp);
break; break;
@ -343,7 +343,7 @@ static LRESULT WINAPI D3D9_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
case WM_INPUT: case WM_INPUT:
// raw input handling // raw input handling
if (!vid_initializing) if (!vid_initializing)
IN_RawInput_Read((HANDLE)lParam); INS_RawInput_Read((HANDLE)lParam);
break; break;
case WM_GETMINMAXINFO: case WM_GETMINMAXINFO:
@ -1102,7 +1102,7 @@ static void (D3D9_SCR_UpdateScreen) (void)
window_center_y = (window_rect.top + window_rect.bottom)/2; window_center_y = (window_rect.top + window_rect.bottom)/2;
IN_UpdateGrabs(modestate != MS_WINDOWED, ActiveApp); INS_UpdateGrabs(modestate != MS_WINDOWED, ActiveApp);
VID_ShiftPalette (NULL); VID_ShiftPalette (NULL);
} }

View file

@ -223,7 +223,7 @@ static qboolean D3D11AppActivate(BOOL fActive, BOOL minimize)
sound_active = true; sound_active = true;
} }
IN_UpdateGrabs(modestate != MS_WINDOWED, ActiveApp); INS_UpdateGrabs(modestate != MS_WINDOWED, ActiveApp);
if (fActive) if (fActive)
{ {
@ -325,7 +325,7 @@ static LRESULT WINAPI D3D11_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
temp |= 512; temp |= 512;
if (!vid_initializing) if (!vid_initializing)
IN_MouseEvent (temp); INS_MouseEvent (temp);
break; break;
@ -351,7 +351,7 @@ static LRESULT WINAPI D3D11_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
case WM_INPUT: case WM_INPUT:
// raw input handling // raw input handling
if (!vid_initializing) if (!vid_initializing)
IN_RawInput_Read((HANDLE)lParam); INS_RawInput_Read((HANDLE)lParam);
break; break;
case WM_GETMINMAXINFO: case WM_GETMINMAXINFO:
@ -1090,7 +1090,7 @@ static void (D3D11_SCR_UpdateScreen) (void)
window_center_y = (window_rect.top + window_rect.bottom)/2; window_center_y = (window_rect.top + window_rect.bottom)/2;
IN_UpdateGrabs(modestate != MS_WINDOWED, ActiveApp); INS_UpdateGrabs(modestate != MS_WINDOWED, ActiveApp);
VID_ShiftPalette (NULL); VID_ShiftPalette (NULL);
} }

View file

@ -202,4 +202,19 @@ void GLVID_ShiftPalette(unsigned char *p)
GLVID_SetDeviceGammaRamp(ramps); GLVID_SetDeviceGammaRamp(ramps);
} }
//I'm too lazy to put these stubs elsewhere.
void INS_Init (void)
{
}
void INS_ReInit(void)
{
}
void INS_Shutdown (void)
{
}
void INS_Commands (void)
{
}
void INS_Move (float *movements, int pnum)
{
}