More fixing compilation and linker errors

This commit is contained in:
Simon 2022-09-20 23:15:52 +01:00
parent 11f00b4fd4
commit cf2aa201ee
23 changed files with 198 additions and 354 deletions

View File

@ -19,7 +19,7 @@ SPDir := $(OPENJK_PATH)/code
APP_ALLOW_MISSING_DEPS=true
APP_MODULES := gl4es rd-gles_arm jagamearm uiarm openjk_sp
APP_MODULES := gl4es rd-gles_arm jagamearm openjk_sp
APP_STL := c++_shared

View File

@ -859,158 +859,6 @@ void JKVR_Vibrate( int duration, int channel, float intensity )
vibration_channel_intensity[channel] = intensity;
}
void JKVR_Haptic( int duration, int channel, float intensity, char *description, float yaw, float height )
{
if(strstr(description,"camera_shake") == NULL && strstr(description,"ignore") == NULL && strstr(description,"dead_") == NULL)
Com_Printf("GBJK: Vibrate Description: %s (Yaw: %f Pitch: %f)", description, yaw, height);
if(strcmp(description,"player_dead") == 0) {
JKVR_HapticEvent("player_dead", 0, 0, 100.0f * intensity, yaw, height);
}
else if(strcmp(description,"door_kick") == 0) {
JKVR_HapticEvent("kick_door", 0, 0, 100.0f * intensity, yaw, height);
}
else if(strcmp(description,"weapon_reload") == 0) {
JKVR_HapticEvent("weapon_reload", channel == 1 ? 2 : 1, 0, 100.0f * intensity, 0, 0);
}
else if(strcmp(description,"door_open") == 0) {
JKVR_HapticEvent("open_door", 0, 0, 100.0f * intensity, yaw, height);
}
else if(strcmp(description,"alarm_on") == 0) {
JKVR_HapticEvent("heartbeat", 0, 0, 100.0f * intensity, yaw, height);
}
else if(strcmp(description,"end_alarm") == 0) {
JKVR_HapticStopEvent("heartbeat");
}
else if(strcmp(description,"switch_weapon") == 0 || strcmp(description,"pickup_item") == 0) {
JKVR_HapticEvent(description, channel == 1 ? 2 : 1, 0, 100.0f * intensity, 0, 0);
}
else if(strcmp(description,"give_armor") == 0 || strcmp(description,"give_food") == 0 ||
strcmp(description,"give_drink") == 0 || strcmp(description,"give_health") == 0 || strcmp(description,"pickup_treasure") == 0) {
JKVR_HapticEvent(description, 0, 0, 100.0f * intensity, yaw, height);
}
else if(strstr(description,"damage_") != NULL) {
JKVR_HapticEvent(description, 0, 0, 100.0f * intensity, yaw, height);
}
else if(strstr(description,"stop_firing_") != NULL) {
/*
if(strcmp(description,"stop_firing_9") == 0 || strcmp(description,"stop_firing_flames") == 0) {
JKVR_HapticStopEvent("fire_flamethrower");
}*/
}
else if(strstr(description,"fire_") != NULL) {
if(strcmp(description,"fire_11") == 0 || strcmp(description,"fire_2") == 0) {
JKVR_HapticEvent("fire_pistol", channel == 1 ? 2 : 1, 0, 100.0f * intensity, 0, 0);
}
else if(strcmp(description,"fire_3") == 0) {
JKVR_HapticEvent("fire_mp40", channel == 1 ? 2 : 1, 0, 100.0f * intensity, 0, 0);
}
else if(strcmp(description,"fire_4") == 0) {
JKVR_HapticEvent("fire_mauser", channel == 1 ? 2 : 1, 0, 100.0f * intensity, 0, 0);
}
else if(strcmp(description,"fire_5") == 0 || strcmp(description,"fire_17") == 0) {
JKVR_HapticEvent("fire_fg42", channel == 1 ? 2 : 1, 0, 100.0f * intensity, 0, 0);
}
else if(strcmp(description,"fire_6") == 0) {
JKVR_HapticEvent("fire_grenadelauncher", channel == 1 ? 2 : 1, 0, 100.0f * intensity, 0, 0);
}
else if(strcmp(description,"fire_7") == 0 || strcmp(description,"fire_rocket") == 0) {
JKVR_HapticEvent("fire_panzerfaust", channel == 1 ? 2 : 1, 0, 100.0f * intensity, 0, 0);
}
else if(strcmp(description,"fire_8") == 0) {
JKVR_HapticEvent("fire_venom", channel == 1 ? 2 : 1, 0, 100.0f * intensity, 0, 0);
}
else if(strcmp(description,"fire_9") == 0 || strcmp(description,"fire_flames") == 0) {
JKVR_HapticEvent("fire_flamethrower", channel == 1 ? 2 : 1, 0, 100.0f * intensity, 0, 0);
}
else if(strcmp(description,"fire_10") == 0 || strcmp(description,"fire_tesla") == 0) {
JKVR_HapticEvent("fire_tesla", channel == 1 ? 2 : 1, 0, 100.0f * intensity, 0, 0);
}
else if(strcmp(description,"fire_12") == 0) {
JKVR_HapticEvent("fire_thompson", channel == 1 ? 2 : 1, 0, 100.0f * intensity, 0, 0);
}
else if(strcmp(description,"fire_13") == 0) {
JKVR_HapticEvent("fire_garand", channel == 1 ? 2 : 1, 0, 100.0f * intensity, 0, 0);
}
else if(strcmp(description,"fire_14") == 0) {
JKVR_HapticEvent("fire_grenade", channel == 1 ? 2 : 1, 0, 100.0f * intensity, 0, 0);
}
else if(strcmp(description,"fire_15") == 0) {
JKVR_HapticEvent("fire_sniper", channel == 1 ? 2 : 1, 0, 100.0f * intensity, 0, 0);
}
else if(strcmp(description,"fire_16") == 0) {
JKVR_HapticEvent("fire_snooperscope", channel == 1 ? 2 : 1, 0, 100.0f * intensity, 0, 0);
}
else if(strcmp(description,"fire_18") == 0) {
JKVR_HapticEvent("fire_sten", channel == 1 ? 2 : 1, 0, 100.0f * intensity, 0, 0);
}
else if(strcmp(description,"fire_19") == 0) {
JKVR_HapticEvent("fire_silencer", channel == 1 ? 2 : 1, 0, 100.0f * intensity, 0, 0);
}
else if(strcmp(description,"fire_20") == 0) {
//Plays on 0 position (Vest) (not left or right)
JKVR_HapticEvent("fire_akimbo", 0, 0, 100.0f * intensity, 0, 0);
}
}
else if(strcmp(description,"knife_hit") == 0) {
JKVR_HapticEvent("knife_hit", channel == 1 ? 2 : 1, 0, 100.0f * intensity, 0, 0);
}
else if(strcmp(description,"camera_shake_left") == 0) {
JKVR_HapticEvent("rumble_front", 0, 0, 100.0f * intensity, yaw, height);
}
else if(strcmp(description,"camera_shake_right") == 0) {
JKVR_HapticEvent("rumble_back", 0, 0, 100.0f * intensity, yaw, height);
}
else {
if(strstr(description,"ignore") == NULL &&
strstr(description,"dead") == NULL)
Com_Printf("Missing Haptic: %s", description);
}
}
void jni_haptic_event(const char* event, int position, int flags, int intensity, float angle, float yHeight);
void jni_haptic_updateevent(const char* event, int intensity, float angle);
void jni_haptic_stopevent(const char* event);
void jni_haptic_endframe();
void jni_haptic_enable();
void jni_haptic_disable();
void JKVR_HapticEvent(const char* event, int position, int flags, int intensity, float angle, float yHeight )
{
//Com_Printf( "GBJK: Vibrate Event Fired: %s", event );
jni_haptic_event(event, position, flags, intensity, angle, yHeight);
}
void JKVR_HapticUpdateEvent(const char* event, int intensity, float angle )
{
jni_haptic_updateevent(event, intensity, angle);
}
void JKVR_HapticEndFrame()
{
jni_haptic_endframe();
}
void JKVR_HapticStopEvent(const char* event)
{
jni_haptic_stopevent(event);
}
void JKVR_HapticEnable()
{
static bool firstTime = true;
if (firstTime) {
jni_haptic_enable();
firstTime = false;
jni_haptic_event("fire_pistol", 0, 0, 100, 0, 0);
}
}
void JKVR_HapticDisable()
{
jni_haptic_disable();
}
void JKVR_GetMove(float *forward, float *side, float *pos_forward, float *pos_side, float *up,
float *yaw, float *pitch, float *roll)
{

View File

@ -25,25 +25,20 @@
#define ALOGV(...)
#endif
bool jk2_initialised;
long long global_time;
float playerHeight;
float playerYaw;
bool showingScreenLayer;
ovrTracking2 tracking;
extern bool jk2_initialised;
extern long long global_time;
extern float playerHeight;
extern float playerYaw;
extern bool showingScreenLayer;
extern ovrTracking2 tracking;
extern int ducked;
extern int resyncClientYawWithGameYaw;
extern vr_client_info_t vr;
#define DUCK_NOTDUCKED 0
#define DUCK_BUTTON 1
#define DUCK_CROUCHED 2
int ducked;
int resyncClientYawWithGameYaw;
vr_client_info_t vr;
float radians(float deg);

View File

@ -1,15 +1,15 @@
cvar_t *vr_turn_mode;
cvar_t *vr_turn_angle;
cvar_t *vr_reloadtimeoutms;
cvar_t *vr_positional_factor;
cvar_t *vr_walkdirection;
cvar_t *vr_movement_multiplier;
cvar_t *vr_weapon_pitchadjust;
cvar_t *vr_lasersight;
cvar_t *vr_control_scheme;
cvar_t *vr_teleport;
cvar_t *vr_virtual_stock;
cvar_t *vr_switch_sticks;
cvar_t *vr_cinematic_stereo;
cvar_t *vr_screen_dist;
extern cvar_t *vr_turn_mode;
extern cvar_t *vr_turn_angle;
extern cvar_t *vr_reloadtimeoutms;
extern cvar_t *vr_positional_factor;
extern cvar_t *vr_walkdirection;
extern cvar_t *vr_movement_multiplier;
extern cvar_t *vr_weapon_pitchadjust;
extern cvar_t *vr_lasersight;
extern cvar_t *vr_control_scheme;
extern cvar_t *vr_teleport;
extern cvar_t *vr_virtual_stock;
extern cvar_t *vr_switch_sticks;
extern cvar_t *vr_cinematic_stereo;
extern cvar_t *vr_screen_dist;

View File

@ -10,30 +10,27 @@
#define BINOCULAR_ENGAGE_DISTANCE 0.25
#define VELOCITY_TRIGGER 1.6
ovrInputStateTrackedRemote leftTrackedRemoteState_old;
ovrInputStateTrackedRemote leftTrackedRemoteState_new;
ovrTracking leftRemoteTracking_new;
extern ovrInputStateTrackedRemote leftTrackedRemoteState_old;
extern ovrInputStateTrackedRemote leftTrackedRemoteState_new;
extern ovrTracking leftRemoteTracking_new;
extern ovrInputStateTrackedRemote rightTrackedRemoteState_old;
extern ovrInputStateTrackedRemote rightTrackedRemoteState_new;
extern ovrTracking rightRemoteTracking_new;
extern ovrInputStateGamepad footTrackedRemoteState_old;
extern ovrInputStateGamepad footTrackedRemoteState_new;
extern ovrDeviceID controllerIDs[2];
ovrInputStateTrackedRemote rightTrackedRemoteState_old;
ovrInputStateTrackedRemote rightTrackedRemoteState_new;
ovrTracking rightRemoteTracking_new;
ovrInputStateGamepad footTrackedRemoteState_old;
ovrInputStateGamepad footTrackedRemoteState_new;
ovrDeviceID controllerIDs[2];
float remote_movementSideways;
float remote_movementForward;
float remote_movementUp;
float positional_movementSideways;
float positional_movementForward;
float snapTurn;
extern float remote_movementSideways;
extern float remote_movementForward;
extern float remote_movementUp;
extern float positional_movementSideways;
extern float positional_movementForward;
extern float snapTurn;
void sendButtonAction(const char* action, long buttonDown);
void sendButtonActionSimple(const char* action);
void acquireTrackedRemotesData(const ovrMobile *Ovr, double displayTime);
void acquireTrackedRemotesData(ovrMobile *Ovr, double displayTime);
void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateGamepad *pFootTrackingOld,
ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, ovrInputStateTrackedRemote *pDominantTrackedRemoteOld, ovrTracking* pDominantTracking,

View File

@ -18,6 +18,47 @@ Authors : Simon Brown
#include <qcommon/qcommon.h>
#include <qcommon/q_platform.h>
cvar_t *vr_turn_mode;
cvar_t *vr_turn_angle;
cvar_t *vr_reloadtimeoutms;
cvar_t *vr_positional_factor;
cvar_t *vr_walkdirection;
cvar_t *vr_movement_multiplier;
cvar_t *vr_weapon_pitchadjust;
cvar_t *vr_lasersight;
cvar_t *vr_control_scheme;
cvar_t *vr_teleport;
cvar_t *vr_virtual_stock;
cvar_t *vr_switch_sticks;
cvar_t *vr_cinematic_stereo;
cvar_t *vr_screen_dist;
ovrInputStateTrackedRemote leftTrackedRemoteState_old;
ovrInputStateTrackedRemote leftTrackedRemoteState_new;
ovrTracking leftRemoteTracking_new;
ovrInputStateTrackedRemote rightTrackedRemoteState_old;
ovrInputStateTrackedRemote rightTrackedRemoteState_new;
ovrTracking rightRemoteTracking_new;
ovrInputStateGamepad footTrackedRemoteState_old;
ovrInputStateGamepad footTrackedRemoteState_new;
ovrDeviceID controllerIDs[2];
float remote_movementSideways;
float remote_movementForward;
float remote_movementUp;
float positional_movementSideways;
float positional_movementForward;
float snapTurn;
bool jk2_initialised;
long long global_time;
float playerHeight;
float playerYaw;
bool showingScreenLayer;
ovrTracking2 tracking;
int ducked;
int resyncClientYawWithGameYaw;
vr_client_info_t vr;
//keys.h
void Sys_QueEvent( int time, sysEventType_t type, int value, int value2, int ptrLength, void *ptr );
void handleTrackedControllerButton(ovrInputStateTrackedRemote * trackedRemoteState, ovrInputStateTrackedRemote * prevTrackedRemoteState, uint32_t button, int key)

View File

@ -11,12 +11,10 @@ JK3_BASE_CFLAGS += -mfloat-abi=softfp
JK3_BASE_LDLIBS += -Wl
JK3_BASE_C_INCLUDES := $(OPENJK_PATH)/lib $(SPDir)/client $(SPDir)/qclib $(SPDir)/botlib $(SPDir)/d3d $(SPDir)/server $(SPDir)/sw $(SPDir)/libs/freetype2/include $(SPDir)/common $(SPDir)/gl
JK3_BASE_C_INCLUDES += $(SPDir)/ $(OPENJK_PATH)/code/ $(OPENJK_PATH)/shared/ $(SPDir)/game $(OPENJK_PATH)/lib/gsl-lite/include
JK3_BASE_C_INCLUDES += $(SPDir)/ $(OPENJK_PATH)/code/ $(OPENJK_PATH)/shared/ $(SPDir)/game $(SPDir)/ui $(OPENJK_PATH)/lib/gsl-lite/include
include $(OPENJK_PATH)/Android_client.mk
include $(OPENJK_PATH)/Android_game.mk
# include $(OPENJK_PATH)/Android_cgame.mk
include $(OPENJK_PATH)/Android_ui.mk
include $(OPENJK_PATH)/Android_gles.mk

View File

@ -9,12 +9,12 @@ LOCAL_MODULE := openjk_sp
LOCAL_CFLAGS := $(JK3_BASE_CFLAGS)
LOCAL_CPPFLAGS := $(JK3_BASE_CPPFLAGS) -DBOTLIB -D_JK2EXE
LOCAL_CPPFLAGS := $(JK3_BASE_CPPFLAGS) -DBOTLIB -D_JK2EXE -DSP_GAME -DUSE_OPENAL
LOCAL_LDLIBS := $(JK3_BASE_LDLIBS)
LOCAL_LDLIBS += -lGLESv3 -lEGL -llog -lz
LOCAL_LDLIBS += -lGLESv3 -landroid -lEGL -llog -lz
#Needed so lib can be loaded (_exit error)
LOCAL_LDLIBS += -fuse-ld=bfd

View File

@ -8,8 +8,8 @@ include $(CLEAR_VARS)
LOCAL_MODULE := jagamearm
LOCAL_CFLAGS := $(JK3_BASE_CFLAGS) -D_GAME
LOCAL_CPPFLAGS := $(JK3_BASE_CPPFLAGS)
LOCAL_CFLAGS := $(JK3_BASE_CFLAGS) -DSP_GAME
LOCAL_CPPFLAGS := $(JK3_BASE_CPPFLAGS) -DSP_GAME
LOCAL_LDLIBS := $(JK3_BASE_LDLIBS)

View File

@ -8,14 +8,14 @@ include $(CLEAR_VARS)
LOCAL_MODULE := rd-gles_arm
LOCAL_CFLAGS := $(JK3_BASE_CFLAGS) -DHAVE_GLES -DRENDERER -D_JK2EXE -Wno-narrowing
LOCAL_CFLAGS := $(JK3_BASE_CFLAGS) -DHAVE_GLES -DRENDERER -D_JK2EXE -DSP_GAME -Wno-narrowing
LOCAL_CPPFLAGS := $(JK3_BASE_CPPFLAGS)
LOCAL_LDLIBS := $(JK3_BASE_LDLIBS)
LOCAL_LDLIBS += -lGLESv3 -landroid -lEGL -ldl -llog
LOCAL_STATIC_LIBRARIES := libpng libjpeg
LOCAL_STATIC_LIBRARIES := libpng libjpeg gl4es
#LOCAL_SHARED_LIBRARIES :=
LOCAL_C_INCLUDES := $(JK3_BASE_C_INCLUDES) $(SUPPORT_LIBS)/libpng $(TOP_DIR) $(SPDir)/rd-vanilla $(SPDir)/rd-common
@ -66,7 +66,7 @@ JK3_SRC = \
${OPENJK_PATH}/shared/qcommon/q_math.c \
${OPENJK_PATH}/shared/qcommon/q_color.c \
${OPENJK_PATH}/shared/qcommon/q_string.c \
LOCAL_SRC_FILES += $(JK3_SRC)

View File

@ -1,51 +0,0 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := uiarm
LOCAL_CFLAGS := $(JK3_BASE_CFLAGS) -D_UI
LOCAL_CPPFLAGS := $(JK3_BASE_CPPFLAGS)
LOCAL_LDLIBS := $(JK3_BASE_LDLIBS)
LOCAL_LDLIBS += -lGLESv3 -landroid -lEGL -ldl -llog
#LOCAL_STATIC_LIBRARIES := s-setup lz
LOCAL_SHARED_LIBRARIES :=
LOCAL_C_INCLUDES := $(JK3_BASE_C_INCLUDES) $(SPDir)/rd-vanilla $(SPDir)/rd-common
JK3_SRC = \
${SPDir}/game/bg_misc.cpp \
${SPDir}/game/bg_vehicleLoad.cpp \
${SPDir}/ui/gameinfo.cpp \
${SPDir}/ui/ui_atoms.cpp \
${SPDir}/ui/ui_connect.cpp \
${SPDir}/ui/ui_main.cpp \
${SPDir}/ui/ui_saber.cpp \
${SPDir}/ui/ui_shared.cpp \
${SPDir}/ui/ui_syscalls.cpp \
${SPDir}/qcommon/q_shared.cpp \
${OPENJK_PATH}/shared/qcommon/q_math.c \
${OPENJK_PATH}/shared/qcommon/q_color.c \
${OPENJK_PATH}/shared/qcommon/q_string.c \
LOCAL_SRC_FILES += $(JK3_SRC)
include $(BUILD_SHARED_LIBRARY)

View File

@ -247,7 +247,7 @@ static qboolean GLW_StartDriverAndSetMode( const char *drivername,
}
void VR_GetScreenRes(int *width, int *height);
void JKVR_GetScreenRes(int *width, int *height);
/*
** GLW_InitExtensions
@ -478,7 +478,7 @@ void GLimp_Init( void ) {
int android_screen_width;
int android_screen_height;
VR_GetScreenRes(&android_screen_width, &android_screen_height);
JKVR_GetScreenRes(&android_screen_width, &android_screen_height);
glConfig.vidWidth = android_screen_width;
glConfig.vidHeight = android_screen_height;
glConfig.colorBits = 32;

View File

@ -274,7 +274,7 @@ void Sys_In_Restart_f( void )
IN_Shutdown();
IN_Init();
#else
IN_Restart( );
//IN_Restart( );
#endif
}
@ -318,7 +318,7 @@ void Sys_Error( const char *error, ... )
}
void Sys_Quit (void) {
IN_Shutdown();
//IN_Shutdown();
Com_ShutdownZoneMemory();
Com_ShutdownHunkMemory();
@ -565,6 +565,65 @@ void *Sys_LoadLegacyGameDll( const char *name, intptr_t (QDECL **vmMain)(int, ..
return libHandle;
}
/*
=================
Sys_LoadDll
First try to load library name from system library path,
from executable path, then fs_basepath.
=================
*/
void *Sys_LoadDll( const char *name, qboolean useSystemLib )
{
void *dllhandle = NULL;
// Don't load any DLLs that end with the pk3 extension
if ( COM_CompareExtension( name, ".pk3" ) )
{
Com_Printf( S_COLOR_YELLOW "WARNING: Rejecting DLL named \"%s\"", name );
return NULL;
}
if ( useSystemLib )
{
Com_Printf( "Trying to load \"%s\"...\n", name );
dllhandle = Sys_LoadLibrary( name );
if ( dllhandle )
return dllhandle;
Com_Printf( "%s(%s) failed: \"%s\"\n", __FUNCTION__, name, Sys_LibraryError() );
}
const char *binarypath = Sys_BinaryPath();
const char *basepath = Cvar_VariableString( "fs_basepath" );
if ( !*binarypath )
binarypath = ".";
const char *searchPaths[] = {
binarypath,
basepath,
};
const size_t numPaths = ARRAY_LEN( searchPaths );
for ( size_t i = 0; i < numPaths; i++ )
{
const char *libDir = searchPaths[i];
if ( !libDir[0] )
continue;
Com_Printf( "Trying to load \"%s\" from \"%s\"...\n", name, libDir );
char *fn = va( "%s%c%s", libDir, PATH_SEP, name );
dllhandle = Sys_LoadLibrary( fn );
if ( dllhandle )
return dllhandle;
Com_Printf( "%s(%s) failed: \"%s\"\n", __FUNCTION__, fn, Sys_LibraryError() );
}
return NULL;
}
void *Sys_LoadGameDll( const char *name, void *(QDECL **moduleAPI)(int, ...) )
{
void *libHandle = NULL;

View File

@ -226,12 +226,12 @@ void PortableMouse(float dx,float dy)
}
int absx=0,absy=0;
void VR_GetScreenRes(int *width, int *height);
void JKVR_GetScreenRes(int *width, int *height);
void PortableMouseAbs(float x,float y)
{
int width;
int height;
VR_GetScreenRes(&width, &height);
JKVR_GetScreenRes(&width, &height);
absx = x * width;
absy = y * height;
}
@ -318,16 +318,12 @@ void PortableInit(int argc,const char ** argv){
//Copied form sys_main.c
int len, i;
char *cmdline;
void Sys_SetDefaultCDPath( const char *path );
// go back to real user for config loads
//Sys_ParseArgs( argc, argv ); // bk010104 - added this for support
// TTimo: no CD path
Sys_SetDefaultCDPath( "" );
// merge the command line, this is kinda silly
for ( len = 1, i = 1; i < argc; i++ )
len += strlen( argv[i] ) + 1;

View File

@ -487,7 +487,7 @@ void Field_CharEvent( field_t *edit, int ch );
void Field_Paste( field_t *edit ) {
char *cbd, *c;
c = cbd = Sys_GetClipboardData();
/* c = cbd = Sys_GetClipboardData();
if ( !cbd ) {
return;
@ -501,6 +501,7 @@ void Field_Paste( field_t *edit ) {
}
Z_Free( cbd );
*/
}
/*

View File

@ -73,7 +73,7 @@ GetClipboardData
static void GetClipboardData( char *buf, int buflen ) {
char *cbd, *c;
c = cbd = Sys_GetClipboardData();
/* c = cbd = Sys_GetClipboardData();
if ( !cbd ) {
*buf = 0;
return;
@ -85,7 +85,7 @@ static void GetClipboardData( char *buf, int buflen ) {
buf[i] = ConvertUTF32ToExpectedCharset( utf32 );
}
Z_Free( cbd );
Z_Free( cbd );*/
}
/*

View File

@ -37,8 +37,8 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
// Open AL Specific
#ifdef USE_OPENAL
#include "OpenAL/al.h"
#include "OpenAL/alc.h"
#include "AL/al.h"
#include "AL/alc.h"
#include "eax/eax.h"
#include "eax/EaxMan.h"
/*#elif defined MACOS_X

View File

@ -362,6 +362,8 @@ extern PFNGLGETPROGRAMIVARBPROC qglGetProgramivARB;
extern PFNGLGETPROGRAMSTRINGARBPROC qglGetProgramStringARB;
extern PFNGLISPROGRAMARBPROC qglIsProgramARB;
extern void ( APIENTRY * qglActiveTextureARB )( GLenum texture );
#ifndef HAVE_GLES
/*
** extension constants
@ -376,7 +378,6 @@ extern PFNGLISPROGRAMARBPROC qglIsProgramARB;
// extensions will be function pointers on all platforms
extern void ( APIENTRY * qglMultiTexCoord2fARB )( GLenum texture, GLfloat s, GLfloat t );
extern void ( APIENTRY * qglActiveTextureARB )( GLenum texture );
extern void ( APIENTRY * qglClientActiveTextureARB )( GLenum texture );
extern void ( APIENTRY * qglLockArraysEXT) (GLint, GLint);

View File

@ -443,7 +443,6 @@ static int PowerOf2(int iArg)
return iArg;
}
#ifndef HAVE_GLES
Dissolve_t Dissolve={0};
#define fDISSOLVE_SECONDS 0.75f
@ -467,6 +466,7 @@ static void RE_Blit(float fX0, float fY0, float fX1, float fY1, float fX2, float
qglColor3f( 1.0f, 1.0f, 1.0f );
#ifndef HAVE_GLES
qglBegin (GL_QUADS);
{
// TL...
@ -494,10 +494,12 @@ static void RE_Blit(float fX0, float fY0, float fX1, float fY1, float fX2, float
qglVertex2f( fX3, fY3);
}
qglEnd ();
#endif
}
static void RE_KillDissolve(void)
{
#ifndef HAVE_GLES
Dissolve.iStartTime = 0;
if (Dissolve.pImage)
@ -505,6 +507,7 @@ static void RE_KillDissolve(void)
R_Images_DeleteImage( Dissolve.pImage );
Dissolve.pImage = NULL;
}
#endif
}
// Draw the dissolve pic to the screen, over the top of what's already been rendered.
//
@ -513,6 +516,7 @@ static void RE_KillDissolve(void)
#define iSAFETY_SPRITE_OVERLAP 2 // #pixels to overlap blit region by, in case some drivers leave onscreen seams
qboolean RE_ProcessDissolve(void)
{
#ifndef HAVE_GLES
if (Dissolve.iStartTime)
{
if (Dissolve.bTouchNeeded)
@ -790,7 +794,7 @@ qboolean RE_ProcessDissolve(void)
RE_KillDissolve();
}
}
#endif
return qfalse;
}
@ -803,6 +807,7 @@ qboolean RE_InitDissolve(qboolean bForceCircularExtroWipe)
// ri.Printf( PRINT_ALL, "RE_InitDissolve()\n");
qboolean bReturn = qfalse;
#ifndef HAVE_GLES
if (//Dissolve.iStartTime == 0 // no point in interruping an existing one
//&&
tr.registered == qtrue // ... stops it crashing during first cinematic before the menus... :-)
@ -1059,6 +1064,8 @@ qboolean RE_InitDissolve(qboolean bForceCircularExtroWipe)
}
}
#endif
return bReturn;
}
#endif

View File

@ -52,7 +52,7 @@ int gl_filter_max = GL_LINEAR;
// helper function for GLES format conversions
byte * gles_convertRGB(byte * data, int width, int height)
{
byte * temp = (byte *) Z_Malloc (width*height*3, TAG_TEMP_WORKSPACE, qfalse);
byte * temp = (byte *) R_Malloc (width*height*3, TAG_TEMP_WORKSPACE, qfalse);
byte *src = data;
byte *dst = temp;
@ -66,7 +66,7 @@ byte * gles_convertRGB(byte * data, int width, int height)
}
byte * gles_convertRGBA4(byte * data, int width, int height)
{
byte * temp = (byte *) Z_Malloc (width*height*2, TAG_TEMP_WORKSPACE, qfalse);
byte * temp = (byte *) R_Malloc (width*height*2, TAG_TEMP_WORKSPACE, qfalse);
unsigned int * input = ( unsigned int *)(data);
unsigned short* output = (unsigned short*)(temp);
@ -86,7 +86,7 @@ byte * gles_convertRGBA4(byte * data, int width, int height)
byte * gles_convertRGB5(byte * data, int width, int height)
{
byte * temp = (byte *) Z_Malloc (width*height*2, TAG_TEMP_WORKSPACE, qfalse);
byte * temp = (byte *) R_Malloc (width*height*2, TAG_TEMP_WORKSPACE, qfalse);
byte *src = data;
byte *dst = temp;
byte r,g,b;
@ -107,7 +107,7 @@ byte * gles_convertRGB5(byte * data, int width, int height)
}
byte * gles_convertLuminance(byte * data, int width, int height)
{
byte * temp = (byte *) Z_Malloc (width*height, TAG_TEMP_WORKSPACE, qfalse);
byte * temp = (byte *) R_Malloc (width*height, TAG_TEMP_WORKSPACE, qfalse);
byte *src = data;
byte *dst = temp;
byte r,g,b;
@ -125,7 +125,7 @@ byte * gles_convertLuminance(byte * data, int width, int height)
}
byte * gles_convertLuminanceAlpha(byte * data, int width, int height)
{
byte * temp = (byte *) Z_Malloc (width*height*2, TAG_TEMP_WORKSPACE, qfalse);
byte * temp = (byte *) R_Malloc (width*height*2, TAG_TEMP_WORKSPACE, qfalse);
byte *src = data;
byte *dst = temp;
byte r,g,b;
@ -869,28 +869,28 @@ static void Upload32( unsigned *data,
case GL_RGB5:
temp = gles_convertRGB5((byte*)data, width, height);
qglTexImage2D (GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, temp);
Z_Free(temp);
R_Free(temp);
break;
case GL_RGBA4:
temp = gles_convertRGBA4((byte*)data, width, height);
qglTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, temp);
Z_Free(temp);
R_Free(temp);
break;
case 3:
case GL_RGB:
temp = gles_convertRGB((byte*)data, width, height);
qglTexImage2D (GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, temp);
Z_Free(temp);
R_Free(temp);
break;
case 1:
temp = gles_convertLuminance((byte*)data, width, height);
qglTexImage2D (GL_TEXTURE_2D, 0, GL_LUMINANCE, width, height, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, temp);
Z_Free(temp);
R_Free(temp);
break;
case 2:
temp = gles_convertLuminanceAlpha((byte*)data, width, height);
qglTexImage2D (GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, width, height, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, temp);
Z_Free(temp);
R_Free(temp);
break;
default:
*pformat = GL_RGBA;

View File

@ -185,6 +185,13 @@ cvar_t *com_buildScript;
cvar_t *r_environmentMapping;
cvar_t *r_screenshotJpegQuality;
void ( APIENTRY * qglMultiTexCoord2fARB )( GLenum texture, GLfloat s, GLfloat t );
void ( APIENTRY * qglActiveTextureARB )( GLenum texture );
void ( APIENTRY * qglClientActiveTextureARB )( GLenum texture );
void ( APIENTRY * qglLockArraysEXT )( GLint, GLint );
void ( APIENTRY * qglUnlockArraysEXT )( void );
#ifndef HAVE_GLES
#if !defined(__APPLE__)
PFNGLSTENCILOPSEPARATEPROC qglStencilOpSeparate;

View File

@ -155,7 +155,7 @@ void Sys_Init( void ) {
static void NORETURN Sys_Exit( int ex ) {
IN_Shutdown();
#ifndef DEDICATED
SDL_Quit();
//SDL_Quit();
#endif
NET_Shutdown();
@ -192,10 +192,10 @@ static void Sys_ErrorDialog( const char *error )
fclose( fp );
const char *errorMessage = va( "%s\n\nThe crash log was written to %s", error, crashLogPath );
if ( SDL_ShowSimpleMessageBox( SDL_MESSAGEBOX_ERROR, "Error", errorMessage, NULL ) < 0 )
/* if ( SDL_ShowSimpleMessageBox( SDL_MESSAGEBOX_ERROR, "Error", errorMessage, NULL ) < 0 )
{
fprintf( stderr, "%s", errorMessage );
}
}*/
}
else
{
@ -205,11 +205,11 @@ static void Sys_ErrorDialog( const char *error )
const char *errorMessage = va( "%s\nCould not write the crash log file, but we printed it to stderr.\n"
"Try running the game using a command line interface.", error );
if ( SDL_ShowSimpleMessageBox( SDL_MESSAGEBOX_ERROR, "Error", errorMessage, NULL ) < 0 )
/* if ( SDL_ShowSimpleMessageBox( SDL_MESSAGEBOX_ERROR, "Error", errorMessage, NULL ) < 0 )
{
// We really have hit rock bottom here :(
fprintf( stderr, "%s", errorMessage );
}
}*/
}
}
#endif
@ -272,64 +272,7 @@ void Sys_UnloadDll( void *dllHandle )
Sys_UnloadLibrary(dllHandle);
}
/*
=================
Sys_LoadDll
First try to load library name from system library path,
from executable path, then fs_basepath.
=================
*/
void *Sys_LoadDll( const char *name, qboolean useSystemLib )
{
void *dllhandle = NULL;
// Don't load any DLLs that end with the pk3 extension
if ( COM_CompareExtension( name, ".pk3" ) )
{
Com_Printf( S_COLOR_YELLOW "WARNING: Rejecting DLL named \"%s\"", name );
return NULL;
}
if ( useSystemLib )
{
Com_Printf( "Trying to load \"%s\"...\n", name );
dllhandle = Sys_LoadLibrary( name );
if ( dllhandle )
return dllhandle;
Com_Printf( "%s(%s) failed: \"%s\"\n", __FUNCTION__, name, Sys_LibraryError() );
}
const char *binarypath = Sys_BinaryPath();
const char *basepath = Cvar_VariableString( "fs_basepath" );
if ( !*binarypath )
binarypath = ".";
const char *searchPaths[] = {
binarypath,
basepath,
};
const size_t numPaths = ARRAY_LEN( searchPaths );
for ( size_t i = 0; i < numPaths; i++ )
{
const char *libDir = searchPaths[i];
if ( !libDir[0] )
continue;
Com_Printf( "Trying to load \"%s\" from \"%s\"...\n", name, libDir );
char *fn = va( "%s%c%s", libDir, PATH_SEP, name );
dllhandle = Sys_LoadLibrary( fn );
if ( dllhandle )
return dllhandle;
Com_Printf( "%s(%s) failed: \"%s\"\n", __FUNCTION__, fn, Sys_LibraryError() );
}
return NULL;
}
#if defined(MACOS_X) && !defined(_JK2EXE)
void *Sys_LoadMachOBundle( const char *name )
@ -757,6 +700,7 @@ int main ( int argc, char* argv[] )
Com_Init (commandLine);
#ifndef DEDICATED
/*
SDL_version compiled;
SDL_version linked;
@ -765,6 +709,7 @@ int main ( int argc, char* argv[] )
Com_Printf( "SDL Version Compiled: %d.%d.%d\n", compiled.major, compiled.minor, compiled.patch );
Com_Printf( "SDL Version Linked: %d.%d.%d\n", linked.major, linked.minor, linked.patch );
*/
#endif
NET_Init();

View File

@ -407,7 +407,7 @@ qboolean Sys_Mkdir( const char *path )
return qtrue;
}
/*
char *Sys_Cwd( void )
{
static char cwd[MAX_OSPATH];
@ -418,7 +418,7 @@ char *Sys_Cwd( void )
cwd[MAX_OSPATH-1] = '\0';
return cwd;
}
}*/
/* Resolves path names and determines if they are the same */
/* For use with full OS paths not quake paths */