Skip to content

Commit

Permalink
general: removed support for ancient Macs, refs #50, refs #51, refs #52
Browse files Browse the repository at this point in the history
…, refs #74
  • Loading branch information
JanSimek committed Nov 16, 2012
1 parent 646aff3 commit ee04dd0
Show file tree
Hide file tree
Showing 15 changed files with 72 additions and 196 deletions.
5 changes: 1 addition & 4 deletions src/client/cl_input.c
Expand Up @@ -687,9 +687,6 @@ void CL_JoystickMove(usercmd_t *cmd)
anglespeed = 0.001 * cls.frametime;
}

#ifdef __MACOS__
cmd->rightmove = ClampChar(cmd->rightmove + cl.joystickAxis[AXIS_SIDE]);
#else
if (!kb[KB_STRAFE].active)
{
cl.viewangles[YAW] += anglespeed * cl_yawspeed->value * cl.joystickAxis[AXIS_SIDE];
Expand All @@ -698,7 +695,7 @@ void CL_JoystickMove(usercmd_t *cmd)
{
cmd->rightmove = ClampChar(cmd->rightmove + cl.joystickAxis[AXIS_SIDE]);
}
#endif

if (kb[KB_MLOOK].active)
{
cl.viewangles[PITCH] += anglespeed * cl_pitchspeed->value * cl.joystickAxis[AXIS_FORWARD];
Expand Down
26 changes: 1 addition & 25 deletions src/client/cl_main.c
Expand Up @@ -1853,7 +1853,7 @@ void CL_DownloadsComplete(void)
#endif
char *fn;

// DHM - Nerve :: Auto-update (not finished yet)
// Auto-update (not finished yet)
if (autoupdateStarted)
{

Expand All @@ -1865,9 +1865,7 @@ void CL_DownloadsComplete(void)
#else
fs_write_path = Cvar_VariableString("fs_homepath");
fn = FS_BuildOSPath(fs_write_path, FS_ShiftStr(AUTOUPDATE_DIR, AUTOUPDATE_DIR_SHIFT), autoupdateFilename);
#ifndef __MACOS__
Sys_Chmod(fn, S_IXUSR);
#endif
#endif
// will either exit with a successful process spawn, or will Com_Error ERR_DROP
// so we need to clear the disconnected download data if needed
Expand Down Expand Up @@ -3565,7 +3563,6 @@ void CL_ClientDamageCommand(void)
// do nothing
}

#if !defined(__MACOS__)
void CL_SaveTranslations_f(void)
{
CL_SaveTransTable("scripts/translation.cfg", qfalse);
Expand All @@ -3590,7 +3587,6 @@ void CL_LoadTranslations_f(void)
{
CL_ReloadTranslation();
}
#endif

//===========================================================================================

Expand Down Expand Up @@ -3789,11 +3785,9 @@ void CL_Init(void)
Cmd_AddCommand("updatehunkusage", CL_UpdateLevelHunkUsage);
Cmd_AddCommand("updatescreen", SCR_UpdateScreen);

#ifndef __MACOS__
Cmd_AddCommand("SaveTranslations", CL_SaveTranslations_f);
Cmd_AddCommand("SaveNewTranslations", CL_SaveNewTranslations_f);
Cmd_AddCommand("LoadTranslations", CL_LoadTranslations_f);
#endif

Cmd_AddCommand("setRecommended", CL_SetRecommended_f);

Expand All @@ -3818,9 +3812,7 @@ void CL_Init(void)
autoupdateChecked = qfalse;
autoupdateStarted = qfalse;

#ifndef __MACOS__
CL_InitTranslation();
#endif

Com_Printf("----- Client Initialization Complete -----\n");
}
Expand Down Expand Up @@ -4986,7 +4978,6 @@ qboolean CL_GetLimboString(int index, char *buf)
#define MAX_VA_STRING 32000
#define MAX_TRANS_STRING 4096

#ifndef __MACOS__
typedef struct trans_s
{
char original[MAX_TRANS_STRING];
Expand Down Expand Up @@ -5640,17 +5631,6 @@ void CL_InitTranslation()
}
}

#else
typedef struct trans_s
{
char original[MAX_TRANS_STRING];
struct trans_s *next;
float x_offset;
float y_offset;
} trans_t;

#endif

/*
=======================
CL_TranslateString
Expand Down Expand Up @@ -5678,7 +5658,6 @@ void CL_TranslateString(const char *string, char *dest_buffer)
return;
}

#if !defined(__MACOS__)
// ignore newlines
if (string[strlen(string) - 1] == '\n')
{
Expand Down Expand Up @@ -5765,9 +5744,6 @@ void CL_TranslateString(const char *string, char *dest_buffer)
}
}
}

#endif

}

/*
Expand Down
2 changes: 1 addition & 1 deletion src/game/g_lua.h
Expand Up @@ -49,7 +49,7 @@
#define HOSTARCH "WIN32"
#define EXTENSION "dll"

#elif defined __MACOS__
#elif defined __APPLE__

#define HOSTARCH "MACOS"
#define EXTENSION "so"
Expand Down
2 changes: 1 addition & 1 deletion src/qcommon/common.c
Expand Up @@ -2912,7 +2912,7 @@ void Com_Init(char *commandLine)
pid = GetCurrentProcessId();
#elif __linux__
pid = getpid();
#elif __MACOS__
#elif __APPLE__
pid = getpid();
#elif __OpenBSD__
pid = getpid();
Expand Down
4 changes: 0 additions & 4 deletions src/qcommon/dl_main_curl.c
Expand Up @@ -195,11 +195,7 @@ dlStatus_t DL_DownloadLoop(void)

if (msg->data.result != CURLE_OK)
{
#ifdef __MACOS__ // ���
err = "unknown curl error.";
#else
err = curl_easy_strerror(msg->data.result);
#endif
}
else
{
Expand Down
5 changes: 3 additions & 2 deletions src/qcommon/files.c
Expand Up @@ -1287,7 +1287,8 @@ int FS_FOpenFileRead(const char *filename, fileHandle_t *file, qboolean uniqueFI
&& Q_stricmp(filename + l - 4, ".dat") // for journal files
&& Q_stricmp(filename + l - 8, "bots.txt")
&& Q_stricmp(filename + l - 8, ".botents")
#ifdef __MACOS__
#ifdef __APPLE__
// FIXME: was #ifdef __MACOS__. Why is this exception only for qagame_mac?
// even when pure is on, let the server game be loaded
&& Q_stricmp(filename, "qagame_mac")
#endif
Expand Down Expand Up @@ -4354,7 +4355,7 @@ void FS_InitFilesystem(void)
tmp_fs_game = Cvar_Get("fs_game", "", 0);
tmp_fs_game->flags |= CVAR_USER_CREATED; // deal as startup var

Com_Printf("^2Info: fs_game is set to 'legacy' mod. Start ET:L with param '+set etmain' for adoring history.\n" , tmp_fs_game->string );
Com_Printf("^2Info: fs_game is set to 'legacy' mod. Start ET:L with param '+set etmain' for adoring history.\n", tmp_fs_game->string);
}

Com_StartupVariable("fs_copyfiles");
Expand Down
16 changes: 1 addition & 15 deletions src/qcommon/q_shared.h
Expand Up @@ -189,7 +189,7 @@ typedef unsigned __int8 uint8_t;

#endif

//======================= MAC OS X SERVER DEFINES =====================
//======================= MAC OS X DEFINES =====================

#if defined(MACOS_X)

Expand Down Expand Up @@ -245,20 +245,6 @@ static inline float idSqrt(float x)

#endif

//======================= MAC DEFINES =================================

#ifdef __MACOS__

#define MAC_STATIC

#define CPUSTRING "OSX-universal"

#define PATH_SEP '/'

void Sys_PumpEvents(void);

#endif

//======================= LINUX DEFINES =================================

// the mac compiler can't handle >32k of locals, so we
Expand Down
15 changes: 0 additions & 15 deletions src/qcommon/vm.c
Expand Up @@ -851,18 +851,3 @@ void VM_LogSyscalls(int *args)
fprintf(f, "%i: %p (%i) = %i %i %i %i\n", callnum, (void *)(args - (int *)currentVM->dataBase),
args[0], args[1], args[2], args[3], args[4]);
}

#if defined(__MACOS__)
#define DLL_ONLY //DAJ
#endif

#ifdef DLL_ONLY // bk010215 - for DLL_ONLY dedicated servers/builds w/o VM
int VM_CallCompiled(vm_t *vm, int *args)
{
return (0);
}

void VM_Compile(vm_t *vm, vmHeader_t *header)
{
}
#endif // DLL_ONLY
27 changes: 1 addition & 26 deletions src/renderer/tr_backend.c
Expand Up @@ -220,7 +220,7 @@ void GL_TexEnv(int env)
/*
GL_State
This routine is responsible for setting the most commonly changed state in Q3.
This routine is responsible for setting the most commonly changed state in Q3.
*/
void GL_State(unsigned long stateBits)
{
Expand Down Expand Up @@ -632,8 +632,6 @@ void RB_BeginDrawingView(void)
}
}

#define MAC_EVENT_PUMP_MSEC 5

/*
==================
RB_RenderDrawSurfList
Expand All @@ -651,15 +649,6 @@ void RB_RenderDrawSurfList(drawSurf_t *drawSurfs, int numDrawSurfs)
drawSurf_t *drawSurf;
int oldSort;
float originalTime;
#ifdef __MACOS__
int macEventTime;

Sys_PumpEvents(); // crutch up the mac's limited buffer queue size

// we don't want to pump the event loop too often and waste time, so
// we are going to check every shader change
macEventTime = ri.Milliseconds() + MAC_EVENT_PUMP_MSEC;
#endif

// save original time for entity shader offsets
originalTime = backEnd.refdef.floatTime;
Expand Down Expand Up @@ -698,16 +687,6 @@ void RB_RenderDrawSurfList(drawSurf_t *drawSurfs, int numDrawSurfs)
{
if (oldShader != NULL)
{
#ifdef __MACOS__ // crutch up the mac's limited buffer queue size
int t;

t = ri.Milliseconds();
if (t > macEventTime)
{
macEventTime = t + MAC_EVENT_PUMP_MSEC;
Sys_PumpEvents();
}
#endif
RB_EndSurface();
}
RB_BeginSurface(shader, fogNum);
Expand Down Expand Up @@ -807,10 +786,6 @@ void RB_RenderDrawSurfList(drawSurf_t *drawSurfs, int numDrawSurfs)

// add light flares on lights that aren't obscured
RB_RenderFlares();

#ifdef __MACOS__
Sys_PumpEvents(); // crutch up the mac's limited buffer queue size
#endif
}

/*
Expand Down
9 changes: 0 additions & 9 deletions src/renderer/tr_image.c
Expand Up @@ -910,15 +910,6 @@ image_t *R_CreateImage(const char *name, const byte *pic, int width, int height,
{
noCompress = qtrue;
}
#if __MACOS__
// LBO 2/8/05. Work around apparent bug in OSX. Some mipmap textures draw incorrectly when
// texture compression is enabled. Examples include brick edging on fueldump level appearing
// bluish-green from a distance.
else if (mipmap)
{
noCompress = qtrue;
}
#endif
// ydnar: don't compress textures smaller or equal to 128x128 pixels
else if ((width * height) <= (128 * 128))
{
Expand Down
35 changes: 16 additions & 19 deletions src/renderer/tr_init.c
Expand Up @@ -1045,18 +1045,18 @@ Workaround for ri.Printf's 1024 characters buffer limit.
*/
void R_PrintLongString(const char *string)
{
char buffer[1024];
const char *p;
int size = strlen(string);

p = string;
while(size > 0)
{
Q_strncpyz(buffer, p, sizeof (buffer) );
ri.Printf( PRINT_ALL, "%s", buffer );
p += 1023;
size -= 1023;
}
char buffer[1024];
const char *p;
int size = strlen(string);

p = string;
while (size > 0)
{
Q_strncpyz(buffer, p, sizeof(buffer));
ri.Printf(PRINT_ALL, "%s", buffer);
p += 1023;
size -= 1023;
}
}

/*
Expand All @@ -1082,7 +1082,7 @@ void GfxInfo_f(void)
ri.Printf(PRINT_ALL, "GL_VERSION: %s\n", glConfig.version_string);

ri.Printf(PRINT_ALL, "GL_EXTENSIONS: %s");
R_PrintLongString( glConfig.extensions_string );
R_PrintLongString(glConfig.extensions_string);

ri.Printf(PRINT_ALL, "\nGL_MAX_TEXTURE_SIZE: %d\n", glConfig.maxTextureSize);
ri.Printf(PRINT_ALL, "GL_MAX_ACTIVE_TEXTURES_ARB: %d\n", glConfig.maxActiveTextures);
Expand Down Expand Up @@ -1256,11 +1256,8 @@ void R_Register(void)
r_finish = ri.Cvar_Get("r_finish", "0", CVAR_ARCHIVE);
r_textureMode = ri.Cvar_Get("r_textureMode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE);
r_swapInterval = ri.Cvar_Get("r_swapInterval", "0", CVAR_ARCHIVE);
#ifdef __MACOS__
r_gamma = ri.Cvar_Get("r_gamma", "1.2", CVAR_ARCHIVE);
#else
r_gamma = ri.Cvar_Get("r_gamma", "1.3", CVAR_ARCHIVE);
#endif
r_gamma = ri.Cvar_Get("r_gamma", "1.3", CVAR_ARCHIVE);

r_facePlaneCull = ri.Cvar_Get("r_facePlaneCull", "1", CVAR_ARCHIVE);

r_railWidth = ri.Cvar_Get("r_railWidth", "16", CVAR_ARCHIVE);
Expand Down Expand Up @@ -1611,7 +1608,7 @@ refexport_t *GetRefAPI(int apiVersion, refimport_t *rimp)
re.ClearScene = RE_ClearScene;
re.AddRefEntityToScene = RE_AddRefEntityToScene;

re.AddPolyToScene = RE_AddPolyToScene;
re.AddPolyToScene = RE_AddPolyToScene;
re.AddPolysToScene = RE_AddPolysToScene;
re.AddLightToScene = RE_AddLightToScene;

Expand Down
6 changes: 1 addition & 5 deletions src/renderer/tr_surface.c
Expand Up @@ -521,12 +521,8 @@ void RB_SurfaceFoliage(srfFoliage_t *srf)
}

// set color
a = alpha > 1.0f ? 255 : alpha * 255;
#if __MACOS__ // LBO 3/15/05. Byte-swap fix for Mac - alpha is in the LSB.
srcColor = (*((int *) instance->color) & 0xFFFFFF00) | (a & 0xff);
#else
a = alpha > 1.0f ? 255 : alpha * 255;
srcColor = (*((int *) instance->color) & 0xFFFFFF) | (a << 24);
#endif
}
else
{
Expand Down

0 comments on commit ee04dd0

Please sign in to comment.