diff --git a/engine/Makefile b/engine/Makefile index cbe441b2c..1e7e3a182 100644 --- a/engine/Makefile +++ b/engine/Makefile @@ -682,8 +682,17 @@ ifeq ($(COMPILE_SYS),Darwin) endif endif -PROFILE_CFLAGS=-pg +# Statically link everything but SDL/AL for the SDL target, +# this assumes makelibs; but we don't really care. These are portable builds +# that can only make one assumption: SDL/AL are installed. +# Dependencies like libjpeg9 don't exist everywhere. +ifeq ($(FTE_TARGET),SDL2) + IMAGELDFLAGS:= libs-$(ARCH)/libpng.a libs-$(ARCH)/libjpeg.a + OGGVORBISLDFLAGS:= libs-$(ARCH)/libvorbisfile.a libs-$(ARCH)/libvorbis.a libs-$(ARCH)/libogg.a + BASE_CFLAGS+=-DLIBJPEG_STATIC -DLIBJPEG_STATIC -DLIBPNG_STATIC -DOPUS_STATIC -DSPEEX_STATIC -DFREETYPE_STATIC -DLIBVORBISFILE_STATIC +endif +PROFILE_CFLAGS=-pg DX7SDK=-I./libs/dxsdk7/include/ GLCFLAGS?=-DGLQUAKE diff --git a/engine/client/cl_cg.c b/engine/client/cl_cg.c index 9511bcf92..ab10554f1 100644 --- a/engine/client/cl_cg.c +++ b/engine/client/cl_cg.c @@ -1397,6 +1397,52 @@ qboolean CG_KeyPress(int key, int unicode, int down) int catcher = Q3_GetKeyCatcher(); if (!cgvm || !(catcher&8)) return false; + + /* if you change this here, it'll have to be changed in cl_cg.c too */ + switch (key) + { + /* all these get interpreted as enter in Q3's UI... */ + case K_JOY1: + case K_JOY2: + case K_JOY3: + case K_JOY4: + case K_AUX1: + case K_AUX2: + case K_AUX3: + case K_AUX4: + case K_AUX5: + case K_AUX6: + case K_AUX7: + case K_AUX8: + case K_AUX9: + case K_AUX10: + case K_AUX11: + case K_AUX14: + case K_AUX15: + case K_AUX16: + return true; + break; + /* Q3 doesn't know about these keys, remap them */ + case K_GP_START: + key = K_ESCAPE; + break; + case K_GP_DPAD_UP: + key = K_UPARROW; + break; + case K_GP_DPAD_DOWN: + key = K_DOWNARROW; + break; + case K_GP_DPAD_LEFT: + key = K_LEFTARROW; + break; + case K_GP_DPAD_RIGHT: + key = K_RIGHTARROW; + break; + case K_GP_A: + key = K_ENTER; + break; + } + return VM_Call(cgvm, CG_KEY_EVENT, key, down); } diff --git a/engine/client/cl_ui.c b/engine/client/cl_ui.c index ee9f7b2e4..d823bb32c 100644 --- a/engine/client/cl_ui.c +++ b/engine/client/cl_ui.c @@ -1775,6 +1775,51 @@ qboolean UI_KeyPress(struct menu_s *m, qboolean isdown, unsigned int devid, int return false; } + /* if you change this here, it'll have to be changed in cl_cg.c too */ + switch (key) + { + /* all these get interpreted as enter in Q3's UI... */ + case K_JOY1: + case K_JOY2: + case K_JOY3: + case K_JOY4: + case K_AUX1: + case K_AUX2: + case K_AUX3: + case K_AUX4: + case K_AUX5: + case K_AUX6: + case K_AUX7: + case K_AUX8: + case K_AUX9: + case K_AUX10: + case K_AUX11: + case K_AUX14: + case K_AUX15: + case K_AUX16: + return true; + break; + /* Q3 doesn't know about these keys, remap them */ + case K_GP_START: + key = K_ESCAPE; + break; + case K_GP_DPAD_UP: + key = K_UPARROW; + break; + case K_GP_DPAD_DOWN: + key = K_DOWNARROW; + break; + case K_GP_DPAD_LEFT: + key = K_LEFTARROW; + break; + case K_GP_DPAD_RIGHT: + key = K_RIGHTARROW; + break; + case K_GP_A: + key = K_ENTER; + break; + } + if (key && key < 1024) /*result = */VM_Call(uivm, UI_KEY_EVENT, key, isdown); if (unicode && unicode < 1024)