Remove MacOS (Classic) code and all references (1/3)

The MACINTOSH define refers to MacOS Classic (not OS X) which we do not
plan to support. Rather than carry the cruft forever, let's delete it.

NOTE: legacy/ is unused but we're keeping it around, so MACINTOSH uses
there are left alone.

Process used for this commit:
```
git rm -r mac
find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" \) \
  -exec unifdef -UMACINTOSH -o {} {} \;
git restore legacy
git add .
```

Test Plan:
On Mac, build both Debug and Release
```
cmake --build --preset mac --config Debug
cmake --build --preset mac --config Release
```
This commit is contained in:
Chris Sarbora 2024-04-26 15:22:03 -07:00
parent 9ec7714ebc
commit e6ba1906c9
No known key found for this signature in database
GPG Key ID: C20505F0B2F2B4C2
299 changed files with 172 additions and 3869 deletions

View File

@ -141,4 +141,4 @@ float GoalDetermineTrackDist(object *obj);
// Returns a pointer to the highest priority non-blended goal
goal *GoalGetCurrentGoal(object *obj);
#endif
#endif

View File

@ -195,4 +195,4 @@ int AIFindRandomRoom(object *obj, ai_frame *ai_info, goal *goal_ptr, int avoid_r
bool f_check_path, bool f_cur_room_ok, int *depth);
int AIMakeNextRoomList(int roomnum, int *next_rooms, int max_rooms);
#endif
#endif

View File

@ -630,16 +630,8 @@ void compute_mine_info() {
void add_terrain_cell(int cell, int t_region, char *checked) {
int depth = 0;
int i;
#ifdef MACINTOSH // JCA: Mac compiler cannot allocate more than 32k on stack as local variables
unsigned short *stack;
char *on_stack;
stack = (unsigned short *)mem_malloc(TERRAIN_WIDTH * TERRAIN_DEPTH * sizeof(unsigned short));
on_stack = (char *)mem_malloc(TERRAIN_WIDTH * TERRAIN_DEPTH * sizeof(char));
#else
unsigned short stack[TERRAIN_WIDTH * TERRAIN_DEPTH];
char on_stack[TERRAIN_WIDTH * TERRAIN_DEPTH];
#endif
for (i = 0; i < TERRAIN_WIDTH * TERRAIN_DEPTH; i++)
on_stack[i] = false;
@ -684,23 +676,13 @@ void add_terrain_cell(int cell, int t_region, char *checked) {
cur_node += next_y_delta;
}
}
#ifdef MACINTOSH
mem_free(stack);
mem_free(on_stack);
#endif
}
void compute_terrain_region_info() {
int i;
bool done = false;
bool f_warning = false;
#ifdef MACINTOSH // JCA: Mac compiler cannot allocate more than 32k on stack as local variables
char *checked;
checked = (char *)mem_malloc(TERRAIN_WIDTH * TERRAIN_DEPTH * sizeof(char));
#else
char checked[TERRAIN_WIDTH * TERRAIN_DEPTH];
#endif
for (i = 0; i < TERRAIN_WIDTH * TERRAIN_DEPTH; i++) {
Terrain_seg[i].flags &= (~TFM_REGION_MASK);
@ -803,9 +785,6 @@ void compute_terrain_region_info() {
"you really cannot fly outside\nignore this message.\n\nSee Chris for specific instructions!");
}
#endif
#ifdef MACINTOSH
mem_free(checked);
#endif
}
#define MAX_SOUND_PROP_DIST 400.0f
@ -1268,17 +1247,9 @@ int BOAGetRoomChecksum(int i) {
face *fp = &rp->faces[t];
for (k = 0; k < fp->num_verts; k++) {
#ifdef MACINTOSH
float x, y, z;
x = floor(rp->verts[fp->face_verts[k]].x);
y = floor(rp->verts[fp->face_verts[k]].y);
z = floor(rp->verts[fp->face_verts[k]].z);
total += x + y + z;
#else
total += rp->verts[fp->face_verts[k]].x;
total += rp->verts[fp->face_verts[k]].y;
total += rp->verts[fp->face_verts[k]].z;
#endif
}
total += fp->num_verts << 4;

View File

@ -267,4 +267,4 @@ bool BOA_LockedDoor(object *obj, int roomnum);
void BOA_ComputePathPoints(char *message = NULL, int len = 0);
int BOAGetMineChecksum();
#endif
#endif

View File

@ -69,4 +69,4 @@
bool ParseBriefing(char *filename, tTelComInfo *tcs);
#endif
#endif

View File

@ -123,4 +123,4 @@ private:
bool parse_error;
};
#endif
#endif

View File

@ -435,9 +435,6 @@
#include <stdlib.h>
#include <memory.h>
#ifdef MACINTOSH
#include "insprocket.h"
#endif
float Key_ramp_speed = 0.5f;
@ -487,82 +484,6 @@ void DoCommands();
void ToggleHeadlightControlState();
// LIST OF NEEDS
#ifdef MACINTOSH
ct_function Controller_needs[NUM_CONTROLLER_FUNCTIONS] = {
{ctfFORWARD_THRUSTAXIS, ctAnalog, ctAxis, ctAxis, CT_Z_AXIS, CT_Z_AXIS, 0, 0}, // DAJ added missing CT_Z_AXIS
{ctfFORWARD_THRUSTKEY, ctTime, ctKey, ctKey, KEY_W, 0, 0, 0},
{ctfREVERSE_THRUSTKEY, ctTime, ctKey, ctKey, KEY_S, 0, 0, 0},
{ctfFORWARD_BUTTON, ctTime, ctButton, ctButton, 0, 0, 0, 0},
{ctfREVERSE_BUTTON, ctTime, ctButton, ctButton, 0, 0, 0, 0},
{ctfUP_THRUSTAXIS, ctAnalog, ctAxis, ctAxis, CT_V_AXIS, CT_V_AXIS, 0, 0}, // DAJ
{ctfUP_BUTTON, ctDigital, ctPOV, ctButton, JOYPOV_UP, 0, 0, 0},
{ctfUP_THRUSTKEY, ctTime, ctKey, ctKey, KEY_R, 0, 0, 0},
{ctfDOWN_BUTTON, ctDigital, ctPOV, ctButton, JOYPOV_DOWN, 0, 0, 0},
{ctfDOWN_THRUSTKEY, ctTime, ctKey, ctKey, KEY_F, 0, 0, 0},
{ctfRIGHT_THRUSTAXIS, ctAnalog, ctAxis, ctAxis, CT_U_AXIS, CT_U_AXIS, 0, 0}, // DAJ
{ctfRIGHT_BUTTON, ctDigital, ctPOV, ctButton, JOYPOV_RIGHT, 0, 0, 0},
{ctfRIGHT_THRUSTKEY, ctTime, ctKey, ctKey, KEY_D, 0, 0, 0},
{ctfLEFT_BUTTON, ctDigital, ctPOV, ctButton, JOYPOV_LEFT, 0, 0, 0},
{ctfLEFT_THRUSTKEY, ctTime, ctKey, ctKey, KEY_A, 0, 0, 0},
{ctfPITCH_DOWNAXIS, ctAnalog, ctAxis, ctMouseAxis, CT_Y_AXIS, CT_Y_AXIS, 0, 0},
{ctfPITCH_DOWNKEY, ctTime, ctKey, ctKey, KEY_UP, KEY_PAD8, 0, 0},
{ctfPITCH_DOWNBUTTON, ctDigital, ctButton, ctButton, 0, 0, 0, 0},
{ctfPITCH_UPKEY, ctTime, ctKey, ctKey, KEY_DOWN, KEY_PAD2, 0, 0},
{ctfPITCH_UPBUTTON, ctDigital, ctButton, ctButton, 0, 0, 0, 0},
{ctfBANK_RIGHTAXIS, ctAnalog, ctAxis, ctAxis, CT_R_AXIS, CT_R_AXIS, 0, 0}, // DAJ
{ctfBANK_RIGHTKEY, ctTime, ctKey, ctKey, KEY_E, KEY_PAD9, 0, 0},
{ctfBANK_RIGHTBUTTON, ctDigital, ctButton, ctButton, 0, 0, 0, 0},
{ctfBANK_LEFTKEY, ctTime, ctKey, ctKey, KEY_Q, KEY_PAD7, 0, 0},
{ctfBANK_LEFTBUTTON, ctDigital, ctButton, ctButton, 0, 0, 0, 0},
{ctfHEADING_RIGHTAXIS, ctAnalog, ctAxis, ctMouseAxis, CT_X_AXIS, CT_X_AXIS, 0, 0},
{ctfHEADING_RIGHTKEY, ctTime, ctKey, ctKey, KEY_RIGHT, KEY_PAD6, 0, 0},
{ctfHEADING_RIGHTBUTTON, ctDigital, ctButton, ctButton, 0, 0, 0, 0},
{ctfHEADING_LEFTKEY, ctTime, ctKey, ctKey, KEY_LEFT, KEY_PAD4, 0, 0},
{ctfHEADING_LEFTBUTTON, ctDigital, ctButton, ctButton, 0, 0, 0, 0},
{ctfFIREPRIMARY_BUTTON, ctTime, ctButton, ctMouseButton, 1, 1, 0, 0},
{ctfFIREPRIMARY_KEY, ctTime, ctKey, ctKey, KEY_SPACEBAR, KEY_RCTRL, 0, 0},
{ctfFIREPRIMARY_KEY2, ctTime, ctKey, ctKey, 0, 0, 0, 0},
{ctfFIRESECONDARY_BUTTON, ctTime, ctButton, ctMouseButton, 2, 2, 0, 0},
{ctfFIRESECONDARY_KEY, ctTime, ctKey, ctKey, KEY_V, 0, 0, 0},
{ctfTOGGLE_SLIDEBUTTON, ctTime, ctButton, ctButton, 0, 0, 0, 0},
{ctfTOGGLE_SLIDEKEY, ctTime, ctKey, ctKey, KEY_LALT, 0, 0, 0},
{ctfTOGGLE_BANKBUTTON, ctTime, ctButton, ctButton, 0, 0, 0, 0},
{ctfTOGGLE_BANKKEY, ctTime, ctKey, ctKey, 0, 0, 0, 0},
{ctfFIREFLARE_BUTTON, ctTime, ctButton, ctMouseButton, 3, 3, 0, 0},
{ctfFIREFLARE_KEY, ctDownCount, ctKey, ctKey, KEY_G, 0, 0, 0},
{ctfAFTERBURN_BUTTON, ctTime, ctButton, ctButton, 0, 0, 0, 0},
{ctfAFTERBURN_KEY, ctTime, ctKey, ctKey, KEY_C, 0, 0, 0},
{ctfAUTOMAP_KEY, ctDownCount, ctKey, ctKey, KEY_TAB, 0, 0, 0},
{ctfPREV_INVKEY, ctDownCount, ctKey, ctKey, KEY_LBRACKET, 0, 0, 0},
{ctfNEXT_INVKEY, ctDownCount, ctKey, ctKey, KEY_RBRACKET, 0, 0, 0},
{ctfINV_USEKEY, ctDownCount, ctKey, ctKey, KEY_BACKSLASH, 0, 0, 0},
{ctfPREV_CNTMSKEY, ctDownCount, ctKey, ctKey, KEY_SEMICOL, 0, 0, 0},
{ctfNEXT_CNTMSKEY, ctDownCount, ctKey, ctKey, KEY_RAPOSTRO, 0, 0, 0},
{ctfCNTMS_USEKEY, ctDownCount, ctKey, ctKey, KEY_ENTER, 0, 0, 0},
{ctfHEADLIGHT_KEY, ctDownCount, ctKey, ctKey, KEY_H, 0, 0, 0},
{ctfHEADLIGHT_BUTTON, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfAUTOMAP_BUTTON, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfPREV_INVBTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfNEXT_INVBTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfINV_USEBTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfPREV_CNTMSBTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfNEXT_CNTMSBTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfCNTMS_USEBTN, ctDownCount, ctButton, ctMouseButton, 4, 4, 0, 0},
{ctfWPNSEL_PCYCLEKEY, ctDownCount, ctKey, ctKey, KEY_COMMA, 0, 0, 0},
{ctfWPNSEL_PCYCLEBTN, ctDownCount, ctButton, ctMouseButton, 0, 5, 0, 0},
{ctfWPNSEL_SCYCLEKEY, ctDownCount, ctKey, ctKey, KEY_PERIOD, 0, 0, 0},
{ctfWPNSEL_SCYCLEBTN, ctDownCount, ctButton, ctMouseButton, 0, 6, 0, 0},
{ctfREARVIEW_KEY, ctDownCount, ctKey, ctKey, KEY_B, 0, 0, 0},
{ctfREARVIEW_BTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfAUDIOTAUNT1_KEY, ctDownCount, ctKey, ctKey, 0, 0, 0, 0},
{ctfAUDIOTAUNT1_BTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfAUDIOTAUNT2_KEY, ctDownCount, ctKey, ctKey, 0, 0, 0, 0},
{ctfAUDIOTAUNT2_BTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfAUDIOTAUNT3_KEY, ctDownCount, ctKey, ctKey, 0, 0, 0, 0},
{ctfAUDIOTAUNT3_BTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfAUDIOTAUNT4_KEY, ctDownCount, ctKey, ctKey, 0, 0, 0, 0},
{ctfAUDIOTAUNT4_BTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0}};
#else
ct_function Controller_needs[NUM_CONTROLLER_FUNCTIONS] = {
{ctfFORWARD_THRUSTAXIS, ctAnalog, ctAxis, ctAxis, 0, 0, 0, 0},
{ctfFORWARD_THRUSTKEY, ctTime, ctKey, ctKey, KEY_A, 0, 0, 0},
@ -637,7 +558,6 @@ ct_function Controller_needs[NUM_CONTROLLER_FUNCTIONS] = {
{ctfAUDIOTAUNT3_BTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfAUDIOTAUNT4_KEY, ctDownCount, ctKey, ctKey, 0, 0, 0, 0},
{ctfAUDIOTAUNT4_BTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0}};
#endif
// ramping macros
inline float ramp_control_value(float val, float limit, float &ramp_state, float &old_ramp_delta) {
@ -679,7 +599,6 @@ void InitControls() {
Controller->set_axis_sensitivity(ctAxis, CT_U_AXIS, Current_pilot.joy_sensitivity[4]);
Controller->set_axis_sensitivity(ctAxis, CT_V_AXIS, Current_pilot.joy_sensitivity[5]);
#ifndef MACINTOSH
int i;
i = FindArg("-deadzone0");
if (i > 0) {
@ -689,7 +608,6 @@ void InitControls() {
if (i > 0) {
Controller->set_controller_deadzone(1, atof(GameArgs[i + 1]));
}
#endif
Key_ramp_speed = Current_pilot.key_ramping; // DAJ added to restore ramping
@ -705,9 +623,6 @@ void InitControls() {
Key_ramp.oz = Key_ramp.z = 0.0f;
// Initialize preemptive controller system for non-positonal data.
#ifdef MACINTOSH
inSprocket_Init();
#endif
mprintf((0, "Initialized control system.\n"));
}
@ -717,9 +632,6 @@ void CloseControls() {
ResumeControls();
DestroyController(Controller);
Controller = NULL;
#ifdef MACINTOSH
inSprocket_Exit();
#endif
mprintf((0, "Closing control system.\n"));
Control_system_init = false;
}
@ -744,9 +656,6 @@ void RestoreDefaultControls() {
Controller->set_axis_sensitivity(ctAxis, CT_R_AXIS, Current_pilot.joy_sensitivity[3]);
Controller->set_axis_sensitivity(ctAxis, CT_U_AXIS, Current_pilot.joy_sensitivity[4]);
Controller->set_axis_sensitivity(ctAxis, CT_V_AXIS, Current_pilot.joy_sensitivity[5]);
#ifdef MACINTOSH
Controller->set_controller_deadzone(2, Current_pilot.mouse_sensitivity[0]);
#endif
}
void SuspendControls() {
@ -781,9 +690,6 @@ void ResumeControls() {
Controller->set_axis_sensitivity(ctAxis, CT_U_AXIS, Current_pilot.joy_sensitivity[4]);
Controller->set_axis_sensitivity(ctAxis, CT_V_AXIS, Current_pilot.joy_sensitivity[5]);
#ifdef MACINTOSH
Controller->set_controller_deadzone(2, Current_pilot.mouse_sensitivity[0]);
#else
int i;
i = FindArg("-deadzone0");
if (i > 0) {
@ -793,7 +699,6 @@ void ResumeControls() {
if (i > 0) {
Controller->set_controller_deadzone(1, atof(GameArgs[i + 1]));
}
#endif
}
// INTERFACE FUNCTIONS
@ -875,7 +780,6 @@ void DoMovement(game_controls *controls) {
// controller
DoControllerMovement(controls);
#ifndef MACINTOSH
// clip controller values
if (controls->pitch_thrust > LIMIT_PITCH)
controls->pitch_thrust = LIMIT_PITCH;
@ -889,7 +793,6 @@ void DoMovement(game_controls *controls) {
controls->bank_thrust = LIMIT_BANK;
if (controls->bank_thrust < -LIMIT_BANK)
controls->bank_thrust = -LIMIT_BANK;
#endif
if (controls->sideways_thrust > LIMIT_HORIZ)
controls->sideways_thrust = LIMIT_HORIZ;
if (controls->sideways_thrust < -LIMIT_HORIZ)
@ -1055,41 +958,6 @@ void DoControllerMovement(game_controls *controls) {
controls->afterburn_thrust = ((ctl_afterburn.value) / Frametime);
}
#ifdef MACINTOSH
// do sidways thrust based off of button values.
controls->sideways_thrust += ctl_povr.value;
controls->sideways_thrust -= ctl_povl.value;
// do vertical thrust based off of button values.
controls->vertical_thrust += ctl_povu.value;
controls->vertical_thrust -= ctl_povd.value;
// do forward thrust based off of button values.
controls->forward_thrust += ctl_fb.value;
controls->forward_thrust -= ctl_rb.value;
// do button banking
if (controls->toggle_bank) {
controls->bank_thrust += ctl_hlb.value;
controls->bank_thrust -= ctl_hrb.value;
} else {
controls->bank_thrust += ctl_blb.value;
controls->bank_thrust -= ctl_brb.value;
}
// do slide if toggled
if (controls->toggle_slide) {
controls->sideways_thrust += ctl_hrb.value;
controls->sideways_thrust -= ctl_hlb.value;
controls->vertical_thrust += ctl_pub.value;
controls->vertical_thrust -= ctl_pdb.value;
}
// do standard pitch and heading.
if (!controls->toggle_slide && !controls->toggle_bank) {
controls->heading_thrust -= ctl_hlb.value;
controls->heading_thrust += ctl_hrb.value;
controls->pitch_thrust -= ctl_pub.value;
controls->pitch_thrust += ctl_pdb.value;
}
#else
// do button heading
if (ctl_hlb.value)
controls->heading_thrust += (-1.0f);
@ -1126,7 +994,6 @@ void DoControllerMovement(game_controls *controls) {
if (ctl_povl.value) {
controls->sideways_thrust -= (1.0f);
}
#endif
}
// ---------------------------------------------------------------------------
@ -1223,11 +1090,7 @@ void DoControllerWeapons(game_controls *controls) {
controls->fire_primary_down_time = fire_primary_time.value;
}
if (fire_secondary_count.value > 0 || fire_secondary_time.value) {
#ifndef MACINTOSH
controls->fire_secondary_down_count = (int)fire_secondary_count.value;
#else
controls->fire_secondary_down_count = 1; // DAJ this makes the guided second fire go back to the ship view
#endif
controls->fire_secondary_down_time = fire_secondary_time.value;
}
@ -1510,13 +1373,9 @@ void LoadControlConfig(pilot *plt) {
Controller->set_controller_function(id, type, ccfgdata, flags);
}
#ifdef MACINTOSH
Controller->set_controller_deadzone(1, plt->mouse_sensitivity[0]);
#else
for (j = 0; j < N_MOUSE_AXIS; j++) {
Controller->set_axis_sensitivity(ctMouseAxis, j + 1, plt->mouse_sensitivity[j]);
}
#endif
for (j = 0; j < N_JOY_AXIS; j++) {
Controller->set_axis_sensitivity(ctAxis, j + 1, plt->joy_sensitivity[j]);
}
@ -1545,14 +1404,10 @@ void SaveControlConfig(pilot *plt) {
plt->controls[i].flags[1] = flags[1];
}
#ifdef MACINTOSH
plt->mouse_sensitivity[0] = Controller->get_controller_deadzone(2);
#else
for (j = 0; j < N_MOUSE_AXIS; j++) {
float sens = Controller->get_axis_sensitivity(ctMouseAxis, j + 1);
plt->mouse_sensitivity[j] = sens;
}
#endif
for (j = 0; j < N_JOY_AXIS; j++) {
float sens = Controller->get_axis_sensitivity(ctAxis, j + 1);
plt->joy_sensitivity[j] = sens;

View File

@ -157,11 +157,7 @@ char Ctltext_KeyBindings[][16] = {"",
"[",
"]",
"enter\0\0\0\0\0",
#ifdef MACINTOSH
"ctrl\0\0\0\0\0",
#else
"lctrl\0\0\0\0\0",
#endif
"a",
"s",
"d",
@ -174,11 +170,7 @@ char Ctltext_KeyBindings[][16] = {"",
";",
"'",
"`",
#ifdef MACINTOSH
"shift\0\0\0\0\0",
#else
"lshft\0\0\0\0\0",
#endif
"\\",
"z",
"x",
@ -192,11 +184,7 @@ char Ctltext_KeyBindings[][16] = {"",
"/",
"rshft\0\0\0\0\0",
"pad*\0\0\0\0\0",
#ifdef MACINTOSH
"opt\0\0\0\0\0",
#else
"lalt\0\0\0\0\0",
#endif
"spc\0\0\0\0\0",
"caps\0\0\0\0\0",
"",
@ -297,11 +285,7 @@ char Ctltext_KeyBindings[][16] = {"",
"",
"",
"pad<EFBFBD>\0\0\0\0\0\0",
#ifdef MACINTOSH
"ctrl\0\0\0\0\0",
#else
"rctrl\0\0\0\0\0",
#endif
"",
"",
"",
@ -328,11 +312,7 @@ char Ctltext_KeyBindings[][16] = {"",
"pad/\0\0\0\0\0\0",
"",
"",
#ifdef MACINTOSH
"opt\0\0\0\0\0\0",
#else
"ralt\0\0\0\0\0\0",
#endif
"",
"",
"",
@ -372,11 +352,7 @@ char Ctltext_KeyBindings[][16] = {"",
"",
"",
"",
#ifdef MACINTOSH
"cmd\0\0\0\0\0\0",
#else
"",
#endif
"",
"",
"",
@ -414,9 +390,6 @@ static short key_binding_indices[] = {
KEY_PAD4, KEY_PAD5, KEY_PAD6, KEY_PADPLUS, KEY_PAD1, KEY_PAD2, KEY_PAD3, KEY_PAD0,
KEY_PADPERIOD, KEY_PADENTER, KEY_RCTRL, KEY_PADDIVIDE, KEY_RALT, KEY_HOME, KEY_UP, KEY_PAGEUP,
KEY_LEFT, KEY_RIGHT, KEY_END, KEY_DOWN, KEY_PAGEDOWN, KEY_INSERT, KEY_DELETE,
#ifdef MACINTOSH
KEY_CMD, KEY_LBRACKET, KEY_RBRACKET, KEY_BACKSLASH, KEY_PERIOD, KEY_SLASH, // DAJ for mac international
#endif
0xff};
#define NUM_KEYBINDSTRINGS (sizeof(Ctltext_KeyBindings) / sizeof(char *))

View File

@ -165,4 +165,4 @@ inline ct_config_data unify_config_data(tCfgDataParts *parts) {
CONTROLLER_CTL_VALUE(parts->bind_0, parts->bind_1));
}
#endif
#endif

View File

@ -198,4 +198,4 @@ void DoForceForShake(float magnitude);
extern bool D3Use_force_feedback;
#endif
#endif

View File

@ -61,4 +61,4 @@
// Include the actual flags
#include "deathinfo_external.h"
#endif
#endif

View File

@ -586,8 +586,6 @@ bool InitGameModule(char *name, module *mod) {
// Make the dll filename
#if defined(WIN32)
snprintf(dll_name, sizeof(dll_name), "%s.dll", name);
#elif defined(MACINTOSH)
sprintf(dll_name, "%s.msl", name);
#else
snprintf(dll_name, sizeof(dll_name), "%s.so", name);
#endif

View File

@ -1252,9 +1252,6 @@ void ProcessNormalKey(int key) {
switch (key) {
// ingnore the modifier keys
#ifdef MACINTOSH
case KEY_CMD:
#endif
case KEY_LALT:
case KEY_RALT:
case KEY_LSHIFT:
@ -1268,9 +1265,6 @@ void ProcessNormalKey(int key) {
return;
case KEY_PAUSE:
#ifdef MACINTOSH
case KEY_PAGEDOWN:
#endif
Game_interface_mode = GAME_PAUSE_INTERFACE;
return;
@ -1365,10 +1359,6 @@ void ProcessNormalKey(int key) {
case KEY_PRINT_SCREEN:
case KEY_SHIFTED + KEY_PRINT_SCREEN:
#ifdef MACINTOSH
case KEY_INSERT:
case KEY_SHIFTED + KEY_INSERT:
#endif
mprintf((0, "Doing screenshot!\n"));
DoScreenshot();
return;
@ -2002,21 +1992,6 @@ void ProcessTestKeys(int key) {
}
} break;
#ifdef MACINTOSH
extern int debug_level;
case KEY_SHIFTED + KEY_MINUS:
case KEY_MINUS:
debug_level--;
if (debug_level < 0)
debug_level = 0;
break;
case KEY_SHIFTED + KEY_EQUAL:
case KEY_EQUAL:
debug_level++;
if (debug_level > 2)
debug_level = 2;
break;
#endif
/*
**************************************************
Keypad Keys

View File

@ -921,11 +921,7 @@ bool LoadMission(const char *mssn) {
// Correct for mission split hack
if (strcmpi(mssn, "d3_2.mn3") == 0) {
#ifdef MACINTOSH
strcpy(mission, "d3.mn3");
#else
strcpy(mission, "d3_2.mn3");
#endif
strcpy(pathname, "d3_2.mn3");
} else if (strcmpi(mssn, "d3.mn3") == 0) {
@ -933,13 +929,6 @@ bool LoadMission(const char *mssn) {
strcpy(pathname, "d3.mn3");
}
#ifdef MACINTOSH
else if (strcmpi(mssn, "training.mn3") == 0) {
strcpy(mission, "training.mn3");
strcpy(pathname, "training.mn3");
}
#endif
else if (IS_MN3_FILE(mssn)) {
strcpy(mission, mssn);
ddio_MakePath(pathname, D3MissionsDir, mission, NULL);
@ -1712,8 +1701,6 @@ void InitLevelScript() {
ddio_SplitPath(Current_level->filename, NULL, filename, ext);
#if defined(WIN32)
strcat(filename, ".dll");
#elif defined(MACINTOSH)
strcat(filename, ".msl");
#else
#if defined(MACOSX)
strcat(filename, ".dylib");

View File

@ -336,4 +336,4 @@ void QuickEndMission();
#endif
#endif
#endif

View File

@ -63,4 +63,4 @@ void NewPyroEnergyAnalogGauge(tGauge *gauge, tGaugePos *pos);
void NewPyroPrimaryWeaponGauge(tGauge *gauge, tGaugePos *pos);
void NewPyroSecondaryWeaponGauge(tGauge *gauge, tGaugePos *pos);
#endif
#endif

View File

@ -814,12 +814,7 @@ int ObjInitGeneric(object *objp, bool reinit) {
poly_model *pm = &Poly_models[objp->rtype.pobj_info.model_num];
int num_wbs = pm->num_wbs;
#ifndef MACINTOSH
if ((objp->dynamic_wb != NULL) && ((unsigned int)num_wbs != mem_size(objp->dynamic_wb) / sizeof(dynamic_wb_info)))
#else
// FIXME _msize is not available on the MAC so
if ((objp->dynamic_wb != NULL) && ((unsigned int)num_wbs != MAX_WBS_PER_OBJ))
#endif
{
mem_free(objp->dynamic_wb);
objp->dynamic_wb = NULL;

View File

@ -132,4 +132,4 @@ void FreeTriggerScript(trigger *tp, bool level_end = false);
//@@// tp is the trogger where the script will be assigned. the script should already be freed and ready
//@@void ReinitTriggerScripts(trigger *tp, script_info *script, int mem_size, vector *mem);
#endif
#endif

View File

@ -424,9 +424,6 @@
#define OSIRISDEBUG
#endif
#ifdef MACINTOSH
#pragma opt_dead_code off
#endif
bool Show_osiris_debug = false;
@ -3152,8 +3149,6 @@ int Osiris_ExtractScriptsFromHog(int library_handle, bool is_mission_hog) {
#else
script_extension = "*.so";
#endif
#elif defined(MACINTOSH)
script_extension = "*.msl";
#else
script_extension = "*.dll";
#endif
@ -4042,6 +4037,3 @@ void Osiris_CreateModuleInitStruct(tOSIRISModuleInit *mi) {
}
}
#ifdef MACINTOSH
#pragma opt_dead_code on
#endif

View File

@ -132,13 +132,8 @@ bool PPic_InitDatabase(void) {
// attempt to open the hog database
// --------------------------------
#if defined(MACINTOSH) && !(defined(_DEBUG) || defined(DEMO))
char *fullpath;
fullpath = GetMultiCDPath(PILOTPIC_DATABASE_HOG);
#else
char fullpath[_MAX_PATH];
ddio_MakePath(fullpath, LocalD3Dir, PILOTPIC_DATABASE_HOG, NULL);
#endif
PilotPic_database_hog_handle = cf_OpenLibrary(fullpath);
if (PilotPic_database_hog_handle == 0) {

View File

@ -103,4 +103,4 @@ bool PPic_GetPilot(ushort pilot_id, char *pilot_name, int buffersize);
// ----------------------------------------------------------
int PPic_GetBitmapHandle(ushort pilot_id);
#endif
#endif

View File

@ -1133,9 +1133,6 @@
#include "rocknride.h"
#include "vibeinterface.h"
#ifdef MACINTOSH
#include "Macros.h"
#endif
#include <algorithm>

View File

@ -2095,13 +2095,8 @@ void TelcomRenderMouse(void) {
if (TC_cursor > -1) {
int mx, my;
#ifdef MACINTOSH
// JEFF: Why is this like this? Why doesn't this use Telcom_mouse_* ?
ddio_MouseGetState(&mx, &my, NULL, NULL);
#else
mx = Telcom_mouse_x;
my = Telcom_mouse_y;
#endif
float u0 = 0.0f, v0 = 0.0f, u1 = 1.0f, v1 = 1.0f;
int cur_w = bm_w(TC_cursor, 0);

View File

@ -333,4 +333,4 @@ void TelcomStopSound(int sid);
extern bool Telcom_called_from_game;
#endif
#endif

View File

@ -57,4 +57,4 @@ void AutomapClearVisMap();
extern ubyte AutomapVisMap[];
#endif
#endif

View File

@ -47,4 +47,4 @@
// return false if you should exit out of TelCom completly
bool TelComCargo(tTelComInfo *tcs);
#endif
#endif

View File

@ -364,4 +364,4 @@ void UploadChunk(chunked_bitmap *bmp);
char *format(char *format, ...);
#endif
#endif

View File

@ -302,4 +302,4 @@ typedef struct {
#define OBF_CHANGEFOCUSISCLICK 0x04
#define OBF_MOUSEOVERFOCUS 0x08
#endif
#endif

View File

@ -43,4 +43,4 @@
// return false if you should exit out of TelCom completly
bool TelComGoalStatus(tTelComInfo *tcs);
#endif
#endif

View File

@ -231,9 +231,6 @@
#include "config.h"
#include "dedicated_server.h"
#ifdef MACINTOSH
#include <string.h>
#endif
int EvaluateBlock(int x, int z, int lod);

View File

@ -3022,11 +3022,7 @@ void FireWeaponFromPlayer(object *objp, int weapon_type, int down_count, bool do
}
// Update the firing time
#ifdef MACINTOSH
pw->firing_time = down_time;
#else
pw->firing_time += down_time;
#endif
if (Demo_flags == DF_RECORDING) {
DemoWriteObjWeapFireFlagChanged(OBJNUM(objp));
}

View File

@ -68,4 +68,4 @@ public:
extern ambient_life a_life;
#endif
#endif

View File

@ -40,4 +40,4 @@ extern int AIPath_test_end_room;
extern vector AIPath_test_end_pos;
#endif
#endif
#endif

View File

@ -51,4 +51,4 @@ typedef struct ground_information {
bool ait_GetGroundInfo(ground_information *ground_info, vector *p0, vector *p1, float rad = 0.0f, angle fov = 0);
void ait_Init(void);
#endif
#endif

View File

@ -91,4 +91,4 @@ void ReadAmbientData();
// Writes data from the ambient sound data file
void WriteAmbientData();
#endif
#endif

View File

@ -32,4 +32,4 @@ bool UnattachFromParent(object *child);
bool UnattachChild(object *parent, char parent_ap);
bool UnattachChildren(object *parent);
#endif
#endif

View File

@ -97,9 +97,6 @@
* $NoKeywords: $
*/
#ifdef MACINTOSH
#include <string.h>
#endif
#include "memory.h"
#include "bnode.h"

View File

@ -118,4 +118,4 @@ extern bool BNode_FindPath(int start_room, int i, int j, float rad);
extern int BNode_FindDirLocalVisibleBNode(int roomnum, vector *pos, vector *fvec, float rad);
extern int BNode_FindClosestLocalVisibleBNode(int roomnum, vector *pos, float rad);
#endif
#endif

View File

@ -21,4 +21,4 @@
void BuddyDisplay(void);
#endif
#endif

View File

@ -199,9 +199,6 @@
#include "hlsoundlib.h"
#include "soundload.h"
#include "sounds.h"
#if defined(MACINTOSH)
#include "Macros.h"
#endif
#include <string.h>

View File

@ -323,29 +323,9 @@
#define STAT_SCORE STAT_TIMER
#ifdef MACINTOSH
#include "macdisplays.h"
tVideoResolution Video_res_list[N_SUPPORTED_VIDRES] = {
#ifdef USE_OPENGL
{640, 480},
{800, 600},
{1024, 768},
// {1152,870},
// {1280,960}
#else
// {512,384},
{640, 480},
{800, 600},
{960, 720},
// {1024,768}
#endif
};
#else
tVideoResolution Video_res_list[N_SUPPORTED_VIDRES] = {
{512, 384}, {640, 480}, {800, 600}, {960, 720}, {1024, 768}, {1280, 960}, {1600, 1200}, {640, 480} // custom
};
#endif
int Game_video_resolution = 1;
@ -381,11 +361,7 @@ tGameToggles Game_toggles = { // toggles specified in general settings.
// these are the default settings for each detail level
#define DL_LOW_TERRAIN_DISTANCE (MINIMUM_RENDER_DIST * TERRAIN_SIZE)
#ifndef MACINTOSH
#define DL_LOW_PIXEL_ERROR 25.0
#else
#define DL_LOW_PIXEL_ERROR MAXIMUM_TERRAIN_DETAIL
#endif
#define DL_LOW_SPECULAR_LIGHT false
#define DL_LOW_DYNAMIC_LIGHTING false
#define DL_LOW_FAST_HEADLIGHT true
@ -399,20 +375,11 @@ tGameToggles Game_toggles = { // toggles specified in general settings.
#define DL_LOW_SPEC_MAPPING_TYPE 1
#define DL_LOW_OBJECT_COMPLEXITY 0
#ifndef MACINTOSH
#define DL_MED_TERRAIN_DISTANCE (90 * TERRAIN_SIZE)
#else
#define DL_MED_TERRAIN_DISTANCE \
(((MAXIMUM_RENDER_DIST - MINIMUM_RENDER_DIST) * 0.2 + MINIMUM_RENDER_DIST) * TERRAIN_SIZE)
#endif
#define DL_MED_PIXEL_ERROR 18.0
#define DL_MED_SPECULAR_LIGHT false
#define DL_MED_DYNAMIC_LIGHTING false
#ifndef MACINTOSH
#define DL_MED_FAST_HEADLIGHT true
#else
#define DL_MED_FAST_HEADLIGHT false
#endif
#define DL_MED_MIRRORED_SURFACES false
#define DL_MED_FOG_ENABLED true
#define DL_MED_CORONAS_ENABLES true
@ -423,20 +390,11 @@ tGameToggles Game_toggles = { // toggles specified in general settings.
#define DL_MED_SPEC_MAPPING_TYPE 1
#define DL_MED_OBJECT_COMPLEXITY 1
#ifndef MACINTOSH
#define DL_HIGH_TERRAIN_DISTANCE (100 * TERRAIN_SIZE)
#else
#define DL_HIGH_TERRAIN_DISTANCE \
(((MAXIMUM_RENDER_DIST - MINIMUM_RENDER_DIST) * 0.4 + MINIMUM_RENDER_DIST) * TERRAIN_SIZE)
#endif
#define DL_HIGH_PIXEL_ERROR 12.0
#define DL_HIGH_SPECULAR_LIGHT false
#define DL_HIGH_DYNAMIC_LIGHTING true
#ifndef MACINTOSH
#define DL_HIGH_FAST_HEADLIGHT true
#else
#define DL_HIGH_FAST_HEADLIGHT false
#endif
#define DL_HIGH_MIRRORED_SURFACES true
#define DL_HIGH_FOG_ENABLED true
#define DL_HIGH_CORONAS_ENABLES true
@ -447,20 +405,11 @@ tGameToggles Game_toggles = { // toggles specified in general settings.
#define DL_HIGH_SPEC_MAPPING_TYPE 1
#define DL_HIGH_OBJECT_COMPLEXITY 2
#ifndef MACINTOSH
#define DL_VHI_TERRAIN_DISTANCE (120.0 * TERRAIN_SIZE)
#define DL_VHI_PIXEL_ERROR 10.0
#else
#define DL_VHI_TERRAIN_DISTANCE (MAXIMUM_RENDER_DIST * TERRAIN_SIZE)
#define DL_VHI_PIXEL_ERROR MINIMUM_TERRAIN_DETAIL
#endif
#define DL_VHI_SPECULAR_LIGHT true
#define DL_VHI_DYNAMIC_LIGHTING true
#ifndef MACINTOSH
#define DL_VHI_FAST_HEADLIGHT true
#else
#define DL_VHI_FAST_HEADLIGHT false
#endif
#define DL_VHI_MIRRORED_SURFACES true
#define DL_VHI_FOG_ENABLED true
#define DL_VHI_CORONAS_ENABLES true
@ -473,13 +422,8 @@ tGameToggles Game_toggles = { // toggles specified in general settings.
#define MINIMUM_TERRAIN_DETAIL 4
#define MAXIMUM_TERRAIN_DETAIL 28
#ifdef MACINTOSH
#define MINIMUM_RENDER_DIST 40
#define MAXIMUM_RENDER_DIST 200
#else
#define MINIMUM_RENDER_DIST 80
#define MAXIMUM_RENDER_DIST 200
#endif
tDetailSettings DetailPresetLow = {DL_LOW_TERRAIN_DISTANCE, DL_LOW_PIXEL_ERROR, DL_LOW_SPECULAR_LIGHT,
DL_LOW_DYNAMIC_LIGHTING, DL_LOW_FAST_HEADLIGHT, DL_LOW_MIRRORED_SURFACES,
@ -538,7 +482,6 @@ void ConfigSetDetailLevel(int level) {
#define IDV_GAMMAAPPLY 5
#define IDV_AUTOGAMMA 6
#if !(defined(MACINTOSH) && defined(USE_OPENGL))
void gamma_callback(newuiTiledWindow *wnd, void *data) {
int bm_handle = *((int *)data);
@ -704,11 +647,7 @@ void config_gamma() {
bm_FreeBitmap(gamma_bitmap);
}
}
#endif
#ifdef MACINTOSH
#pragma mark video --
#endif
//////////////////////////////////////////////////////////////////
// VIDEO MENU
@ -731,29 +670,6 @@ struct video_menu {
// video resolution
iTemp = Game_video_resolution;
sheet->NewGroup(TXT_RESOLUTION, 0, 0);
#ifdef MACINTOSH
#ifdef USE_OPENGL
resolution = sheet->AddFirstLongRadioButton("640x480");
if (gDSpContext[DSP_800x600])
sheet->AddLongRadioButton("800x600");
if (gDSpContext[DSP_1024x768])
sheet->AddLongRadioButton("1024x768");
// if(gDSpContext[DSP_1152x870])
// sheet->AddLongRadioButton("1152x870");
// if(gDSpContext[DSP_1280x960])
// sheet->AddLongRadioButton("1280x960");
#else
// resolution = sheet->AddFirstLongRadioButton("512x384");
// sheet->AddLongRadioButton("640x480");
resolution = sheet->AddFirstLongRadioButton("640x480");
extern int Glide_num_texelfx;
if (Glide_num_texelfx > 1) {
sheet->AddLongRadioButton("800x600");
sheet->AddLongRadioButton("960x720");
}
// sheet->AddLongRadioButton("1024x768");
#endif
#else
resolution = sheet->AddFirstLongRadioButton("512x384");
sheet->AddLongRadioButton("640x480");
sheet->AddLongRadioButton("800x600");
@ -761,7 +677,6 @@ struct video_menu {
sheet->AddLongRadioButton("1024x768");
sheet->AddLongRadioButton("1280x960");
sheet->AddLongRadioButton("1600x1200");
#endif
*resolution = iTemp;
#if !(defined(MACINTOSH) || defined(__LINUX__))
@ -794,10 +709,8 @@ struct video_menu {
sheet->NewGroup(TXT_MONITOR, 0, 180);
vsync = sheet->AddLongCheckBox(TXT_CFG_VSYNCENABLED, (Render_preferred_state.vsync_on != 0));
#ifndef __LINUX__
#if !(defined(MACINTOSH) && defined(USE_OPENGL))
sheet->AddText("");
sheet->AddLongButton(TXT_AUTO_GAMMA, IDV_AUTOGAMMA);
#endif
#endif
return sheet;
};
@ -841,20 +754,15 @@ struct video_menu {
// process
void process(int res) {
#ifndef __LINUX__
#if !(defined(MACINTOSH) && defined(USE_OPENGL))
switch (res) {
case IDV_AUTOGAMMA:
config_gamma();
break;
}
#endif
#endif
};
};
#ifdef MACINTOSH
#pragma mark sound --
#endif
//////////////////////////////////////////////////////////////////
// SOUND MENU
@ -896,16 +804,9 @@ struct sound_menu {
// sound fx quality radio list.
if (GetFunctionMode() != GAME_MODE && GetFunctionMode() != EDITOR_GAME_MODE) {
sheet->NewGroup(TXT_SNDQUALITY, 0, 95);
#ifdef MACINTOSH
fxquality = sheet->AddFirstRadioButton(TXT_LOW);
sheet->AddRadioButton(TXT_CFG_MEDIUM);
sheet->AddRadioButton(TXT_CFG_HIGH);
*fxquality = Sound_system.GetSoundQuality();
#else
fxquality = sheet->AddFirstRadioButton(TXT_SNDNORMAL);
sheet->AddRadioButton(TXT_SNDHIGH);
*fxquality = Sound_system.GetSoundQuality() == SQT_HIGH ? 1 : 0;
#endif
slider_set.min_val.i = MIN_SOUNDS_MIXED;
slider_set.max_val.i = MAX_SOUNDS_MIXED;
slider_set.type = SLIDER_UNITS_INT;
@ -1012,11 +913,7 @@ struct sound_menu {
}
if (fxquality) {
#ifdef MACINTOSH
Sound_system.SetSoundQuality(*fxquality);
#else
Sound_system.SetSoundQuality((*fxquality == 1) ? SQT_HIGH : SQT_NORMAL);
#endif
}
//@@ iTemp = (*powerupvoices);
@ -1049,9 +946,6 @@ struct sound_menu {
};
};
#ifdef MACINTOSH
#pragma mark toggles --
#endif
//////////////////////////////////////////////////////////////////
// GENERAL SETTINGS (TOGGLES) MENU
@ -1099,7 +993,6 @@ struct toggles_menu {
//: (Missile_camera_window==SVW_RIGHT) ? 3 : 0;
*missile_view = (Missile_camera_window == SVW_LEFT) ? 1 : (Missile_camera_window == SVW_RIGHT) ? 2 : 0;
#ifndef MACINTOSH
sheet->NewGroup(TXT_CONTROL_TOGGLES, 110, 0);
joy_enabled = sheet->AddLongCheckBox(TXT_JOYENABLED);
mse_enabled = sheet->AddLongCheckBox(TXT_CFG_MOUSEENABLED);
@ -1122,15 +1015,6 @@ struct toggles_menu {
if (ff_found) {
sheet->AddLongButton(TXT_CFG_CONFIGFORCEFEEDBACK, UID_SHORTCUT_FORCEFEED);
}
#else
sheet->NewGroup(TXT_TOGGLES, 110, 40);
reticle_toggle = sheet->AddLongCheckBox(TXT_TOG_SHOWRETICLE);
guided_toggle = sheet->AddLongCheckBox(TXT_TOG_GUIDEDMISSILE);
shipsnd_toggle = sheet->AddLongCheckBox(TXT_TOG_SHIPSOUNDS);
*reticle_toggle = Game_toggles.show_reticle;
*guided_toggle = Game_toggles.guided_mainview;
*shipsnd_toggle = Game_toggles.ship_noises;
#endif
return sheet;
};
@ -1145,10 +1029,8 @@ struct toggles_menu {
//@@ Missile_camera_window = (iTemp==1) ? SVW_LEFT : (iTemp==2) ? SVW_CENTER : (iTemp==3) ? SVW_RIGHT
//: -1;
Missile_camera_window = (iTemp == 1) ? SVW_LEFT : (iTemp == 2) ? SVW_RIGHT : -1;
#ifndef MACINTOSH
Current_pilot.read_controller = (*joy_enabled) ? READF_JOY : 0;
Current_pilot.read_controller |= (*mse_enabled) ? READF_MOUSE : 0;
#endif
Game_toggles.show_reticle = (*reticle_toggle);
Game_toggles.guided_mainview = (*guided_toggle);
Game_toggles.ship_noises = (*shipsnd_toggle);
@ -1172,9 +1054,6 @@ struct toggles_menu {
};
};
#ifdef MACINTOSH
#pragma mark HUD --
#endif
//////////////////////////////////////////////////////////////////
// HUD CONFIG MENU
@ -1300,9 +1179,6 @@ struct hud_menu {
};
};
#ifdef MACINTOSH
#pragma mark details --
#endif
//////////////////////////////////////////////////////////////////
// DETAILS MENU
@ -1376,17 +1252,6 @@ struct details_menu {
sheet->AddRadioButton(TXT_CFG_HIGH);
*objcomp = Detail_settings.Object_complexity;
#ifdef MACINTOSH
if (GetFunctionMode() != GAME_MODE && GetFunctionMode() != EDITOR_GAME_MODE) {
sheet->NewGroup(TXT_TEXTURE_QUALITY, 174, 152);
Database->read_int("RS_texture_quality", &Render_state.cur_texture_quality);
iTemp = Render_state.cur_texture_quality;
texture_quality = sheet->AddFirstRadioButton(TXT_LOW);
sheet->AddRadioButton(TXT_CFG_MEDIUM);
sheet->AddRadioButton(TXT_CFG_HIGH);
*texture_quality = Render_state.cur_texture_quality;
}
#endif
return sheet;
};
@ -1409,24 +1274,6 @@ struct details_menu {
Default_detail_level = *detail_level;
Database->write("PredefDetailSetting", Default_detail_level);
#ifdef MACINTOSH
if (GetFunctionMode() != GAME_MODE && GetFunctionMode() != EDITOR_GAME_MODE) {
Render_state.cur_texture_quality = *texture_quality;
Database->write("RS_texture_quality", Render_state.cur_texture_quality);
if (Render_state.cur_texture_quality == 0) {
Mem_low_memory_mode = true;
Mem_superlow_memory_mode = true;
} else if (Render_state.cur_texture_quality == 1) {
Mem_low_memory_mode = true;
Mem_superlow_memory_mode = false;
} else if (Render_state.cur_texture_quality == 2) {
Mem_low_memory_mode = false;
Mem_superlow_memory_mode = false;
}
}
InitVisEffects(); // reset max_vis_effects l
#endif
sheet = NULL;
};

View File

@ -135,14 +135,6 @@ typedef struct tGameToggles {
extern tGameToggles Game_toggles;
// this list should match the list in config.cpp to work.
#ifdef MACINTOSH
#define N_SUPPORTED_VIDRES 3
#define RES_640X480 0
#define RES_800X600 1
#define RES_960X720 2
#define RES_1024X768 3
#else
#define N_SUPPORTED_VIDRES 8
#define RES_512X384 0
@ -152,7 +144,6 @@ extern tGameToggles Game_toggles;
#define RES_1024X768 4
#define RES_1280X960 5
#define RES_1600X1200 6
#endif
// stored resolution list and desired game resolution
typedef struct tVideoResolution {
ushort width;
@ -200,4 +191,4 @@ extern int Default_detail_level;
// displays new options menu
extern void OptionsMenu();
#endif
#endif

View File

@ -176,13 +176,8 @@ class pilot;
#define READF_MOUSE 0x2
#define READF_JOY 0x1
#ifdef MACINTOSH
#define JOY_AXIS_SENS_RANGE 2.0f
#define MSE_AXIS_SENS_RANGE 2.0f
#else
#define JOY_AXIS_SENS_RANGE 4.0f
#define MSE_AXIS_SENS_RANGE 4.0f
#endif
// used to set or get axis sensitivity
#define HEADING_AXIS 0
@ -283,4 +278,4 @@ void SaveControlConfig(pilot *plt = NULL);
// Reads movement only
void DoMovement(game_controls *controls);
#endif
#endif

View File

@ -290,10 +290,6 @@
#include "D3ForceFeedback.h"
#include "hlsoundlib.h"
#include "ddio.h"
#ifdef MACINTOSH
#include "insprocket.h" //DAJ
#include "maccontroller.h"
#endif
#include <string.h>
//////////////////////////////////////////////////////////////////////////////
#define IDV_KCONFIG 10
@ -305,11 +301,6 @@
#define CFG_AXIS_SENS_RANGE 20
const short UID_JOYCFG = 0x1000;
#ifdef MACINTOSH
short *joy_sens[N_JOY_AXIS] = {0, 0, 0, 0, 0, 0};
float old_sens[N_JOY_AXIS];
short *deadzone = 0;
#endif
// Setup of config screens.
#define CCITEM_WPN_X 0
@ -573,72 +564,16 @@ void joy_cfg_screen::setup(newuiLargeMenu *menu) {
m_menu = menu;
m_sheet = menu->AddOption(IDV_CCONFIG, TXT_OPTCUSTCONT);
#ifdef MACINTOSH
short curpos;
tSliderSettings slider_set;
int axis_str[N_JOY_AXIS] = {TXI_KB_HEADING, TXI_KB_PITCH, TXI_KB_BANK,
TXI_KB_SLIDEHORIZ, TXI_KB_SLIDEVERT, TXI_KB_FORWARD};
for (i = 0; i < N_JOY_AXIS; i++) {
old_sens[i] = Controller->get_axis_sensitivity(ctAxis, i + 1);
}
m_controller_settings.Create(m_menu, UID_CFGSETTINGS, TXT_SPROCKETS_CONFIG,
KEYCFG_EXTRAS_X + m_sheet->X() + KEYCFG_EXTRAS_W, KEYCFG_EXTRAS_Y + m_sheet->Y(),
NEWUI_BTNF_LONG);
// sensitivity sliders for joystick
m_sheet->NewGroup(TXT_SENSITIVITY, 80, 60);
for (i = 0; i < N_JOY_AXIS; i++) {
char str[16];
float val = Controller->get_axis_sensitivity(ctAxis, i + 1);
slider_set.min_val.f = 0.0f;
slider_set.max_val.f = JOY_AXIS_SENS_RANGE;
slider_set.type = SLIDER_UNITS_FLOAT;
curpos = CALC_SLIDER_POS_FLOAT(val, &slider_set, CFG_AXIS_SENS_RANGE);
sprintf(str, "%s", TXT(axis_str[i]));
joy_sens[i] = m_sheet->AddSlider(str, CFG_AXIS_SENS_RANGE, curpos, &slider_set);
}
m_sheet->NewGroup(TXT_JOYSTICK_DEADZONE, 320, 60);
int val = Controller->get_controller_deadzone(MC_JOY);
slider_set.min_val.i = 0;
slider_set.max_val.i = 25;
slider_set.type = SLIDER_UNITS_INT;
curpos = CALC_SLIDER_POS_INT(val, &slider_set, 25);
deadzone = m_sheet->AddSlider("", 25, curpos, &slider_set);
#else
// save original settings.
for (i = 0; i < N_JOY_CFG_FN; i++) {
Controller->get_controller_function(Cfg_joy_elements[i].fn_id, m_old_controls[i].type, &m_old_controls[i].value,
m_old_controls[i].flags);
}
#endif
}
void joy_cfg_screen::finish() {}
void joy_cfg_screen::process(int res) {
int i;
#ifdef MACINTOSH
float uval = CALC_SLIDER_FLOAT_VALUE(*deadzone, 0.0, 25, 25);
Controller->set_controller_deadzone(MC_JOY, uval);
for (i = 0; i < N_JOY_AXIS; i++) {
float val = CALC_SLIDER_FLOAT_VALUE(*joy_sens[i], 0.0f, JOY_AXIS_SENS_RANGE, CFG_AXIS_SENS_RANGE);
Controller->set_axis_sensitivity(ctAxis, i + 1, val);
}
switch (res) {
case UID_RESETDEFAULTS:
for (i = 0; i < N_JOY_AXIS; i++)
Controller->set_axis_sensitivity(ctAxis, i + 1, 1.0);
break;
case UID_CFGSETTINGS:
inSprocket_Configure();
break;
case UID_REVERT:
for (i = 0; i < N_JOY_AXIS; i++)
Controller->set_axis_sensitivity(ctAxis, i + 1, old_sens[i]);
break;
}
#else
for (i = 0; i < N_JOY_CFG_FN; i++) {
if (m_elem[i].GetID() != -1 && m_elem[i].GetID() == res) {
// we chose a slot to configure.
@ -673,14 +608,11 @@ void joy_cfg_screen::process(int res) {
}
break;
}
#endif
}
void joy_cfg_screen::realize() {
int i, x = 0, y;
t_cfg_element *cfg_elem = &Cfg_joy_elements[0];
#ifdef MACINTOSH
#else
m_reset_btn.Create(m_menu, UID_RESETDEFAULTS, TXT_RESETTODEFAULT, KEYCFG_EXTRAS_X + m_sheet->X(),
KEYCFG_EXTRAS_Y + m_sheet->Y(), NEWUI_BTNF_LONG);
m_controller_settings.Create(m_menu, UID_CFGSETTINGS, TXT_ADJUSTSETTINGS,
@ -702,14 +634,11 @@ void joy_cfg_screen::realize() {
y += m_elem[i].H() + 2;
cfg_elem++;
}
#endif
}
void joy_cfg_screen::unrealize() {
// create controls
int i;
#ifdef MACINTOSH
#else
m_controller_settings.Destroy();
t_cfg_element *cfg_elem = &Cfg_joy_elements[0];
for (i = 0; i < N_JOY_CFG_FN; i++) {
@ -720,7 +649,6 @@ void joy_cfg_screen::unrealize() {
m_help1_txt.Destroy();
m_reset_btn.Destroy();
m_revert_btn.Destroy();
#endif
}
//////////////////////////////////////////////////////////////////////////////
// WEAPON SEL CONFIG
@ -1242,7 +1170,6 @@ void joystick_settings_dialog() {
snprintf(str, sizeof(str), TXT_CONTAXIS, axis_str[i]);
joy_sens[i] = sheet->AddSlider(str, CFG_AXIS_SENS_RANGE, curpos, &slider_set);
}
#ifndef MACINTOSH // DAJ
sheet->NewGroup(TXT_MSESENS, 0, 220);
for (i = 0; i < N_MOUSE_AXIS; i++) {
@ -1286,10 +1213,6 @@ void joystick_settings_dialog() {
slider_set.type = SLIDER_UNITS_PERCENT;
ff_gain = sheet->AddSlider(TXT_CFG_FORCEGAIN, 50, curpos, &slider_set);
}
#else
sheet->NewGroup(NULL, 210, 20);
sheet->AddLongButton("Input Sprocket", UID_JOYCFG);
#endif
wnd.Open();
do {
res = wnd.DoUI();
@ -1297,11 +1220,7 @@ void joystick_settings_dialog() {
break;
}
if (res == UID_JOYCFG) {
#ifdef MACINTOSH
inSprocket_Configure();
#else
joystick_calibration();
#endif
}
} while (res != UID_OK && res != UID_CANCEL);
if (res == UID_OK) {
@ -1312,7 +1231,6 @@ void joystick_settings_dialog() {
float val = CALC_SLIDER_FLOAT_VALUE(*joy_sens[i], 0.0f, JOY_AXIS_SENS_RANGE, CFG_AXIS_SENS_RANGE);
Controller->set_axis_sensitivity(ctAxis, i + 1, val);
}
#ifndef MACINTOSH
Current_pilot.read_controller |= (*mse_enabled) ? READF_MOUSE : 0;
for (i = 0; i < N_MOUSE_AXIS; i++) {
float val = CALC_SLIDER_FLOAT_VALUE(*mse_sens[i], 0.0f, MSE_AXIS_SENS_RANGE, CFG_AXIS_SENS_RANGE);
@ -1338,16 +1256,11 @@ void joystick_settings_dialog() {
f_temp = (*ff_gain) * 0.5f;
ForceSetGain(f_temp);
}
#endif
}
wnd.Close();
wnd.Destroy();
}
#ifdef MACINTOSH
#define CFG_KEY_RAMP_MAX 2.0f
#else
#define CFG_KEY_RAMP_MAX 1.0f
#endif
#define CFG_KEY_RAMP_RANGE 20
void key_settings_dialog() {
newuiTiledWindow wnd;

View File

@ -75,4 +75,4 @@ void CtlConfig(int mode);
void joystick_settings_dialog();
void key_settings_dialog();
#endif
#endif

View File

@ -78,4 +78,4 @@ unsigned long SerialGetSerialNum(void);
// -1 : detected a hacked exe
char GetInternalSerializationNumber(int *num);
#endif
#endif

View File

@ -159,4 +159,4 @@ void UnshakePlayer();
// moving. If NULL, uses the negative of the surface normal
void BreakGlassFace(room *rp, int facenum, vector *hitpnt = NULL, vector *hitvec = NULL);
#endif
#endif

View File

@ -39,4 +39,4 @@
#define GD_MELEE_ATTACK 7 // From a melee robot attack
#define GD_VOLATILE_HISS 8 // Touched a volatile substance (such as acid)
#endif
#endif

View File

@ -53,4 +53,4 @@ void DebugGraph_DisplayOptions(void);
void DebugGraph_Initialize(void);
#endif
#endif

View File

@ -138,9 +138,6 @@ typedef int socklen_t;
#include "ship.h"
#include "hud.h"
#ifdef MACINTOSH
#include "macsock.h"
#endif
bool Dedicated_server = false;

View File

@ -410,9 +410,6 @@
#include "multi_dll_mgr.h"
#include "localization.h"
#include "mem.h"
#if defined(MACINTOSH) && defined(GAMERANGER)
#include "GameRanger.h"
#endif
// ---------------------------------------------------------------------------
// Variables
// ---------------------------------------------------------------------------
@ -562,12 +559,6 @@ void Descent3() {
SetFunctionMode(GAMEGAUGE_MODE);
}
#if defined(MACINTOSH) && defined(GAMERANGER)
if (GRCheckFileForCmd()) {
SetFunctionMode(GAME_MODE);
GRGetWaitingCmd();
}
#endif
MainLoop();
// delete the lock file in the temp directory (as long as it belongs to us)
@ -815,9 +806,7 @@ void RenderBlankScreen(void);
char *GetCDVolume(int cd_num) {
char *p = NULL;
#if defined(MACINTOSH)
char volume_labels[3][_MAX_PATH] = {"", "Descent3", "Descent3"};
#elif !defined(OEM)
#if !defined(OEM)
char volume_labels[3][_MAX_PATH] = {"", "D3_1", "D3_2"};
#else
char volume_labels[3][_MAX_PATH] = {"", "D3OEM_1", ""};
@ -840,12 +829,7 @@ char *GetCDVolume(int cd_num) {
// prompt them to enter the disk...
do {
char message_txt[50];
#ifdef MACINTOSH
strcpy(message_txt, TXT_CDPROMPT);
message_txt[strlen(message_txt) - 2] = '\0';
#else
snprintf(message_txt, sizeof(message_txt), TXT_CDPROMPT, cd_num);
#endif
// We need a background drawn!
#if defined(LINUX)
void (*ui_cb)() = GetUICallback();
@ -886,11 +870,7 @@ file_vols file_volumes[] = {
// Filename, directory it might be installed on the hard drive, CD number to look for it
{"d3.mn3", "missions", 1, false}, {"d3_2.mn3", "missions", 2, false}, {"level1.mve", "movies", 1, true},
{"level5.mve", "movies", 2, true}, {"end.mve", "movies", 2, true}, {"intro.mve", "movies", 1, true},
#ifdef MACINTOSH
{"ppics.hog", "missions", 1, true}, {"training.mn3", "missions", 1, true},
#else
{"dolby1.mv8", "movies", 1, true},
#endif
{"d3voice1.hog", "missions", 1, true}, {"d3voice2.hog", "missions", 2, true}};
int num_cd_files = sizeof(file_volumes) / sizeof(file_vols);

View File

@ -44,4 +44,4 @@ extern float Diff_general_inv_scalar[5]; // Trainee = 0.50f HotShot = 1.0f
extern float Diff_shield_energy_scalar[5];
extern float Diff_ai_turret_speed[5];
extern float Diff_ai_min_fire_spread[5];
#endif
#endif

View File

@ -28,4 +28,4 @@
#define DIFFICULTY_ACE 3
#define DIFFICULTY_INSANE 4
#endif
#endif

View File

@ -171,4 +171,4 @@ void RemapDoors();
#endif
#endif
#endif

View File

@ -612,9 +612,6 @@
#include <stdlib.h>
#include <string.h>
#include "psrand.h"
#if defined(MACINTOSH)
#include "Macros.h"
#endif
#include <algorithm>

View File

@ -290,4 +290,4 @@ void CreateElectricalBolts(object *objp, int num_bolts);
// Play the explosion sound for this object
void PlayObjectExplosionSound(object *objp);
#endif
#endif

View File

@ -80,4 +80,4 @@
#define FT_BILLOW 3
#define FT_SPARK 4
#endif
#endif

View File

@ -961,16 +961,10 @@ void SetScreenMode(int sm, bool force_res_change) {
scr_width = Video_res_list[Game_video_resolution].width;
scr_height = Video_res_list[Game_video_resolution].height;
scr_bitdepth = Render_preferred_bitdepth;
#ifdef MACINTOSH
SwitchDSpContex(Game_video_resolution);
#endif
} else {
scr_width = FIXED_SCREEN_WIDTH;
scr_height = FIXED_SCREEN_HEIGHT;
scr_bitdepth = 16;
#ifdef MACINTOSH
SwitchDSpContex(0);
#endif
}
if (!rend_initted) {

View File

@ -222,4 +222,4 @@ typedef struct {
} tGameCinematic;
#endif
#endif

View File

@ -75,4 +75,4 @@ void FreeEvent(int index);
extern game_event GameEvent[MAX_EVENTS];
extern int Num_events;
#endif
#endif

View File

@ -22,11 +22,7 @@
#include "pstypes.h"
#include "manage.h"
#ifdef MACINTOSH
#define MAX_GAMEFILES 1300
#else
#define MAX_GAMEFILES 1500
#endif
typedef struct {
char name[PAGENAME_LEN];

View File

@ -123,4 +123,4 @@ void LoadAllFonts();
// Set the HUD font resolution based on the render width
void SelectHUDFont(int rend_with);
#endif
#endif

View File

@ -298,9 +298,6 @@
#include "d3music.h"
#include "weather.h"
#ifdef MACINTOSH
#include "ddio_mac.h"
#endif
// function prototypes.
void SGSSnapshot(CFILE *fp);
@ -350,11 +347,7 @@ void QuickSaveGame() {
snprintf(filename, sizeof(filename), "saveg00%d", i);
ddio_MakePath(pathname, Base_directory, "savegame", filename, NULL);
#ifdef MACINTOSH
fp = mac_fopen(pathname, "rb");
#else
fp = fopen(pathname, "rb");
#endif
if (fp) {
// slot valid, save here.
fclose(fp);
@ -425,11 +418,7 @@ void SaveGameDialog() {
occupied_slot[i] = false;
#ifdef MACINTOSH
fp = mac_fopen(pathname, "rb");
#else
fp = fopen(pathname, "rb");
#endif
if (fp) {
fclose(fp);
@ -625,11 +614,7 @@ bool LoadGameDialog() {
occupied_slot[i] = false;
#ifdef MACINTOSH
fp = mac_fopen(pathname, "rb");
#else
fp = fopen(pathname, "rb");
#endif
if (fp) {
int bm_handle;
int *pbm_handle;
@ -1354,16 +1339,6 @@ void SGSSnapshot(CFILE *fp) {
g3_EndFrame();
EndFrame();
rend_Flip();
#ifdef MACINTOSH // DAJ do it again to insure dialog is not snaped
// Render the world
GameRenderWorld(Viewer_object, &Viewer_object->pos, Viewer_object->roomnum, &Viewer_object->orient, Render_zoom,
false);
// Done rendering
g3_EndFrame();
EndFrame();
rend_Flip();
#endif
bm_handle = bm_AllocBitmap(Max_window_w, Max_window_h, 0);
cf_WriteByte(fp, (bm_handle > 0) ? 1 : 0);

View File

@ -1504,9 +1504,7 @@ void StartLevel() {
// Initialize a bunch of stuff for this level
MakeBOA();
#ifndef MACINTOSH
ComputeAABB(true);
#endif
// Clear/reset objects & events
ClearAllEvents();
@ -1601,10 +1599,8 @@ void StartLevel() {
Render_zoom = D3_DEFAULT_ZOOM;
// flush controller system.
#ifndef MACINTOSH
ResumeControls();
Controller->flush();
#endif
Level_goals.InitLevel();
@ -1653,18 +1649,6 @@ void StartLevel() {
// #endif
LoadLevelProgress(LOAD_PROGRESS_DONE, 0);
#ifdef MACINTOSH
// flush controller system.
ResumeControls();
Controller->flush();
#ifdef USE_OPENGL
extern void opengl_ResetContext(void);
opengl_ResetContext();
#endif
#ifdef USE_PROFILER
ProfilerSetStatus(1);
#endif
#endif
}
// Loads a level and starts everything up
@ -1899,16 +1883,10 @@ void FlushDataCache() {
}
for (i = 0; i < MAX_SOUNDS; i++) {
#ifndef MACINTOSH // on Mac, free all sounds
if (Sounds_to_free[i] != 0)
#endif
{
soundsfreed++;
#ifndef MACINTOSH
int index = Sounds[i].sample_index;
#else
int index = i;
#endif
if (SoundFiles[index].sample_16bit) {
GlobalFree(SoundFiles[index].sample_16bit);
SoundFiles[index].sample_16bit = NULL;
@ -2076,13 +2054,8 @@ void RunGameMenu() {
if (!(Game_mode & GM_MULTI)) {
pause_game = true;
#ifndef MACINTOSH
PauseGame();
D3MusicResume();
#else
StopTime(); // DAJ just the time man
Game_paused = true;
#endif
}
switch (Game_interface_mode) {
@ -2144,11 +2117,7 @@ void RunGameMenu() {
if (Game_mode & GM_MULTI)
AddHUDMessage(TXT_NOPAUSEINMULTI);
else {
#ifdef MACINTOSH
DoMessageBoxAdvanced(TXT(TXI_HLPPAUSE), TXT_PRESSOKTOCONT, TXT_OK, KEY_PAGEDOWN, NULL);
#else
DoMessageBoxAdvanced(TXT(TXI_HLPPAUSE), TXT_PRESSOKTOCONT, TXT_OK, KEY_PAUSE, NULL);
#endif
// DoMessageBox(TXT(TXI_HLPPAUSE),TXT_PRESSOKTOCONT, MSGBOX_OK);
}
break;
@ -2247,12 +2216,7 @@ void RunGameMenu() {
}
if (pause_game) {
#ifndef MACINTOSH
ResumeGame();
#else
StartTime(); // DAJ
Game_paused = false;
#endif
pause_game = false;
}

View File

@ -169,4 +169,4 @@ inline void SetGameState(tGameState state) { Game_state = state; }
inline tGameState GetGameState() { return Game_state; }
#endif
#endif

View File

@ -647,14 +647,12 @@ extern int Low_vidmem;
void PageInTexture(int n, bool resize) {
static int super_low_mem = -1;
#ifndef MACINTOSH
if (super_low_mem == -1) {
if (Mem_superlow_memory_mode || FindArg("-dedicated"))
super_low_mem = 1;
else
super_low_mem = 0;
}
#endif
if (GameTextures[n].used == 0)
return;
@ -663,11 +661,7 @@ void PageInTexture(int n, bool resize) {
bm_data(texp->bm_handle, 0);
#ifndef EDITOR
#ifdef MACINTOSH
if (resize == true && (Render_state.cur_texture_quality <= 1 || Low_vidmem))
#else
if (resize == true && (Mem_low_memory_mode || Low_vidmem))
#endif
{
if (!(texp->flags & (TF_TEXTURE_32 | TF_TEXTURE_256)) && !(texp->flags & TF_PROCEDURAL)) {
int bm_handle = texp->bm_handle;
@ -681,11 +675,7 @@ void PageInTexture(int n, bool resize) {
w /= 2;
h /= 2;
#ifdef MACINTOSH
if (Render_state.cur_texture_quality == 0)
#else
if (super_low_mem)
#endif
{
if (w != 32 || h != 32) {
w = 32;

View File

@ -366,4 +366,4 @@ int AllocateProceduralForTexture(int handle);
#endif
#endif
#endif

View File

@ -169,13 +169,8 @@ int HelpText[] = {TXI_ESC,
TXI_DROPSMARKER,
TXI_SHFTTAB,
TXI_TCMM,
#ifdef MACINTOSH
TXI_PAGE_DOWN,
TXI_HLPPAUSEDESC,
#else
TXI_HLPPAUSE,
TXI_HLPPAUSEDESC,
#endif
TXI_PLUSMINUS,
TXI_HLPSCRNSIZE,
TXI_HLPPRNTSCRN,

View File

@ -37,4 +37,4 @@
void HelpDisplay(void);
#endif
#endif

View File

@ -111,4 +111,4 @@ void DisplayHotSpots(hotspotmap_t *hsmap,
void FreeHotSpotMapInternals(hotspotmap_t *hsmap); // Deletes allocated memory within a hotspotmap struct
ushort menutga_translate_pixel(int pixel, char *alpha_value);
#endif
#endif

View File

@ -916,15 +916,6 @@ int FindCustomtext2HUDItem() {
void UpdateCustomtext2HUDItem(char *text) {
int i;
#ifdef MACINTOSH
char *p = text;
char ch;
while (ch = *p) {
if (ch == '\r')
*p = '\n';
p++;
}
#endif
for (i = 0; i < MAX_HUD_ITEMS; i++) {
if (HUD_array[i].stat && (HUD_array[i].type == HUD_ITEM_CUSTOMTEXT2)) {
ASSERT(HUD_array[i].data.text != NULL);

View File

@ -239,9 +239,6 @@
#include <stdio.h>
#include <stdarg.h>
#if defined(MACINTOSH)
#include "Macros.h"
#endif
#include <algorithm>

View File

@ -1083,13 +1083,7 @@ void PreGameCdCheck() {
CD_inserted = 0;
do {
char *p = NULL;
#if defined(MACINTOSH)
p = ddio_GetCDDrive("Descent3");
if (p && *p) {
CD_inserted = 1;
break;
}
#elif defined(OEM)
#if defined(OEM)
p = ddio_GetCDDrive("D3OEM_1");
if (p && *p) {
CD_inserted = 1;
@ -1124,11 +1118,6 @@ void PreGameCdCheck() {
}
ShowCursor(false);
#elif defined(MACINTOSH)
::ShowCursor();
short action = ::Alert(130, NULL);
if (action == 1)
::ExitToShell();
#elif defined(__LINUX__)
// ummm what should we do in Linux?
// right now I'm just going to return this hopefully will be safe, as I think
@ -1156,10 +1145,8 @@ void PreInitD3Systems() {
#ifdef LOGGER
console_output = true;
#endif
#ifndef MACINTOSH
if (FindArg("-logfile"))
Debug_Logfile("d3.log");
#endif
#endif
@ -1185,9 +1172,7 @@ void PreInitD3Systems() {
Mem_low_memory_mode = Mem_superlow_memory_mode = true;
if (FindArg("-dedicated"))
Mem_low_memory_mode = true;
#ifndef MACINTOSH
mem_Init();
#endif
if (FindArg("-himem")) {
Mem_low_memory_mode = false;
Mem_superlow_memory_mode = false;
@ -1300,7 +1285,6 @@ void SaveGameSettings() {
Database->write("VoiceAll", PlayVoices);
// Write out force feedback
#ifndef MACINTOSH
Database->write("EnableJoystickFF", D3Use_force_feedback);
Database->write("ForceFeedbackAutoCenter", D3Force_auto_center);
ubyte force_gain;
@ -1310,7 +1294,6 @@ void SaveGameSettings() {
D3Force_gain = 1.0f;
force_gain = (ubyte)((100.0f * D3Force_gain) + 0.5f);
Database->write("ForceFeedbackGain", force_gain);
#endif
#ifndef RELEASE // never save this value out in release.
Database->write("SoundMixer", Sound_mixer);
@ -1366,43 +1349,20 @@ void LoadGameSettings() {
Render_preferred_state.gamma = 1.5;
PreferredRenderer = RENDERER_NONE;
#ifdef MACINTOSH
// DAJ render switch
#if defined(USE_OPENGL)
PreferredRenderer = RENDERER_OPENGL;
#elif defined(USE_GLIDE)
PreferredRenderer = RENDERER_GLIDE;
#elif defined(USE_SOFTWARE)
PreferredRenderer = RENDERER_SOFTWARE_16BIT;
#else
PreferredRenderer = RENDERER_NONE;
#endif
#endif
Sound_system.SetLLSoundQuantity(MIN_SOUNDS_MIXED + (MAX_SOUNDS_MIXED - MIN_SOUNDS_MIXED) / 2);
D3MusicSetVolume(0.5f);
Detail_settings.Pixel_error = 8.0;
#ifdef MACINTOSH
Sound_system.SetMasterVolume(0.7);
Detail_settings.Terrain_render_distance = 10.0 * TERRAIN_SIZE; // DAJ
#else
Sound_system.SetMasterVolume(1.0);
Detail_settings.Terrain_render_distance = 70.0 * TERRAIN_SIZE;
D3Use_force_feedback = true;
D3Force_gain = 1.0f;
D3Force_auto_center = true;
#endif
Game_video_resolution = RES_640X480;
PlayPowerupVoice = true;
PlayVoices = true;
Sound_mixer = SOUND_MIXER_SOFTWARE_16;
#ifdef MACINTOSH
Sound_quality = SQT_LOW;
#else
Sound_quality = SQT_NORMAL;
#endif
Missile_camera_window = SVW_LEFT;
Render_preferred_state.vsync_on = true;
Detail_settings.Fog_enabled = true;
@ -1461,18 +1421,6 @@ void LoadGameSettings() {
Database->read_int("RS_color_model", &Render_state.cur_color_model);
Database->read_int("RS_light", &Render_state.cur_light_state);
Database->read_int("RS_texture_quality", &Render_state.cur_texture_quality);
#ifdef MACINTOSH
if (Render_state.cur_texture_quality == 0) {
Mem_low_memory_mode = true;
Mem_superlow_memory_mode = true;
} else if (Render_state.cur_texture_quality == 1) {
Mem_low_memory_mode = true;
Mem_superlow_memory_mode = false;
} else if (Render_state.cur_texture_quality == 2) {
Mem_low_memory_mode = false;
Mem_superlow_memory_mode = false;
}
#else
// force feedback stuff
Database->read("EnableJoystickFF", &D3Use_force_feedback);
Database->read("ForceFeedbackAutoCenter", &D3Force_auto_center);
@ -1481,7 +1429,6 @@ void LoadGameSettings() {
if (force_gain > 100)
force_gain = 100;
D3Force_gain = ((float)force_gain) / 100.0f;
#endif
Database->read_int("PreferredRenderer", &PreferredRenderer);
Database->read_int("MissileView", &Missile_camera_window);
Database->read("FastHeadlight", &Detail_settings.Fast_headlight_on);
@ -1539,15 +1486,7 @@ void LoadGameSettings() {
// function)
int level;
#ifdef MACINTOSH
#ifdef USE_OPENGL
level = DETAIL_LEVEL_LOW;
#else
level = DETAIL_LEVEL_HIGH;
#endif
#else
level = DETAIL_LEVEL_MED;
#endif
Database->read_int("PredefDetailSetting", &level);
ConfigSetDetailLevel(level);
@ -1828,24 +1767,6 @@ void InitIOSystems(bool editor) {
extern int Num_languages;
void InitStringTable() {
#if defined(MACINTOSH) && !defined(DAJ_DEBUG)
if (cfopen("german.lan", "rt")) {
Localization_SetLanguage(LANGUAGE_GERMAN);
ddio_SetKeyboardLanguage(KBLANG_GERMAN);
} else if (cfopen("spanish.lan", "rt")) {
Localization_SetLanguage(LANGUAGE_SPANISH);
ddio_SetKeyboardLanguage(KBLANG_AMERICAN);
} else if (cfopen("italian.lan", "rt")) {
Localization_SetLanguage(LANGUAGE_ITALIAN);
ddio_SetKeyboardLanguage(KBLANG_AMERICAN);
} else if (cfopen("french.lan", "rt")) {
Localization_SetLanguage(LANGUAGE_FRENCH);
ddio_SetKeyboardLanguage(KBLANG_FRENCH);
} else {
Localization_SetLanguage(LANGUAGE_ENGLISH);
ddio_SetKeyboardLanguage(KBLANG_AMERICAN);
}
#else
int language = LANGUAGE_ENGLISH;
Database->read("LanguageType", &language, sizeof(language));
@ -1855,7 +1776,6 @@ void InitStringTable() {
}
Localization_SetLanguage(language);
#endif
int string_count = LoadStringTables();
if (string_count == 0)
@ -2040,20 +1960,9 @@ void ShowStaticScreen(char *bitmap_filename, bool timed = false, float delay_tim
void IntroScreen() {
// #if (defined(OEM) || defined(DEMO) )
#ifdef DEMO
#ifdef MACINTOSH
ShowStaticScreen("graphsim.ogf", true, 3.0);
#else
ShowStaticScreen("tantrum.ogf", true, 3.0);
#endif
ShowStaticScreen("outrage.ogf", true, 3.0);
#else
#ifdef MACINTOSH
if (cfopen("publisher.ogf", "rb"))
ShowStaticScreen("publisher.ogf", true, 3.0);
if (cfopen("graphsim.ogf", "rb"))
ShowStaticScreen("graphsim.ogf", true, 3.0);
#endif
#endif
#ifdef DEMO
@ -2412,7 +2321,6 @@ void SetupTempDirectory(void) {
mprintf((0, "Temp Directory Set To: \"%s\"\n", Descent3_temp_directory));
#ifndef MACINTOSH
// Lock the directory
int lock_res = ddio_CreateLockFile(Descent3_temp_directory);
switch (lock_res) {
@ -2449,7 +2357,6 @@ void SetupTempDirectory(void) {
exit(1);
break;
}
#endif
// restore working dir
ddio_SetWorkingDir(Base_directory);
}
@ -2465,11 +2372,7 @@ void DeleteTempFiles(void) {
do {
ddio_DeleteFile(filename);
}
#ifdef MACINTOSH
while (ddio_FindFileStart(temp_file_wildcards[i].wildcard, filename));
#else
while (ddio_FindNextFile(filename));
#endif
}
ddio_FindFileClose();
}

View File

@ -180,4 +180,4 @@ public:
extern levelgoals Level_goals;
#endif
#endif

View File

@ -64,4 +64,4 @@
#define MAX_GOAL_LISTS 4
#endif
#endif

View File

@ -71,11 +71,7 @@ extern lightmap_info *LightmapInfo;
extern int Num_of_lightmap_info;
extern int Num_lightmap_infos_read;
#ifdef MACINTOSH
#define MAX_LIGHTMAP_INFOS (60000)
#else
#define MAX_LIGHTMAP_INFOS (65534)
#endif
// Sets all the lightmaps to unused
void InitLightmapInfo(int nummaps = 0);

View File

@ -52,4 +52,4 @@ void *GetListItem(list **listp, int index);
// Returns -1 if not found
int GetListItemIndex(list **listp, void *item);
#endif
#endif

View File

@ -93,4 +93,4 @@ private:
tbufferinfo *curr;
};
#endif
#endif

View File

@ -37,4 +37,4 @@ extern int Marker_message;
extern char MarkerMessages[MAX_PLAYERS * 2][MAX_MARKER_MESSAGE_LENGTH];
#endif
#endif

View File

@ -175,9 +175,6 @@
#include "psrand.h"
#include "demofile.h"
#if defined(MACINTOSH)
#include "Macros.h"
#endif
#include <algorithm>

View File

@ -215,4 +215,4 @@ void DoMatcensFrame();
void DoMatcensRenderFrame();
void InitMatcensForLevel();
#endif
#endif

View File

@ -66,4 +66,4 @@
#define MT_ROOM 1
#define MT_UNASSIGNED 2
#endif
#endif

View File

@ -1225,15 +1225,6 @@ bool MenuNewGame() {
n_missions = count_missions(LocalLevelsDir, "*.msn");
#endif
n_missions += count_missions(D3MissionsDir, "*.mn3");
#ifdef MACINTOSH
char cdpath[_MAX_PATH];
char *cdvol = GetCDVolume(1);
if (cdvol) {
ddio_MakePath(cdpath, cdvol, "missions", NULL);
n_missions += count_missions(cdpath, "*.mn3");
}
mem_free(cdvol);
#endif
if (n_missions) {
// allocate extra mission slot because of check below which adds a name to the filelist.
filelist = (char **)mem_malloc(sizeof(char *) * (n_missions + 1));
@ -1262,11 +1253,7 @@ bool MenuNewGame() {
}
}
if (!found) {
#ifdef MACINTOSH
filelist[n_missions - 1] = mem_strdup("d3.mn3");
#else
filelist[n_missions] = mem_strdup("d3.mn3");
#endif
msn_lb->AddItem(TXT_MAINMISSION);
n_missions++;
}
@ -1428,11 +1415,7 @@ redo_level_choose:
// Loads a level and starts the game
bool MenuLoadLevel(void) {
char buffer[_MAX_PATH];
#ifdef MACINTOSH
ddio_MakePath(buffer, Base_directory, "data", NULL);
#else
buffer[0] = '\0';
#endif
if (DoPathFileDialog(false, buffer, "Load Level", "*.d3l", PFDF_FILEMUSTEXIST)) {
SimpleStartLevel(buffer);
SetFunctionMode(GAME_MODE);

View File

@ -110,4 +110,4 @@ void MenuOptions(bool ingame);
// pass in the max level allowed to be chosen, if -1, than all levels are allowed (a.k.a level warp cheat)
int DisplayLevelWarpDlg(int max_level);
#endif
#endif

View File

@ -137,9 +137,7 @@
#include "mission_download.h"
#include "renderer.h"
#ifndef MACINTOSH
#include "unzip.h"
#endif
int Got_url;
msn_urls msn_URL = {"", {"", "", "", "", ""}};
@ -613,11 +611,6 @@ int msn_CheckGetMission(network_address *net_addr, char *filename) {
if (cfexist(filename) || cfexist(pathname)) {
return 1;
}
#if defined(MACINTOSH)
// DoMessageBox(TXT_ERROR,TXT_FMTCANTDNLD,MSGBOX_OK);
DoMessageBox(TXT_ERROR, "The Selected mission is not in the missions folder", MSGBOX_OK);
return 0;
#endif
msn_urls *murls;
@ -701,7 +694,6 @@ void _get_zipfilename(char *output, char *directory, char *zipfilename) {
// return 0 on failure
// return 1 on success
int msn_ExtractZipFile(char *zipfilename, char *mn3name) {
#ifndef MACINTOSH
mprintf((0, "Extracting ZIP File (%s) to missions directory\n", zipfilename));
if (!cfexist(zipfilename)) {
@ -836,9 +828,6 @@ int msn_ExtractZipFile(char *zipfilename, char *mn3name) {
return 0;
return 1;
#else
return 0;
#endif
}
#ifdef __LINUX__

View File

@ -196,11 +196,7 @@ void mmItem::OnDestroy() {
}
void mmItem::OnSelect() {
#ifdef MACINTOSH
PlayMenuSound(m_window->SoundHandles[MM_SELECT_SOUND], false); // why wait?
#else
PlayMenuSound(m_window->SoundHandles[MM_SELECT_SOUND], true);
#endif
UIGadget::OnSelect();
}

View File

@ -1710,9 +1710,6 @@
#include "../md5/md5.h"
void MultiProcessShipChecksum(MD5 *md5, int ship_index);
#if defined(MACINTOSH)
#include "Macros.h"
#endif
#include <algorithm>
@ -2588,12 +2585,6 @@ void MultiDoPlayer(ubyte *data) {
// Put in address
memcpy(&NetPlayers[slot].addr, data + count, sizeof(network_address));
#ifdef MACINTOSH // DAJ if the addr is comming from a PC swap it
if (NetPlayers[slot].addr.connection_type > NP_DIRECTPLAY) {
NetPlayers[slot].addr.port = SWAPSHORT(NetPlayers[slot].addr.port);
NetPlayers[slot].addr.connection_type = (network_protocol)SWAPINT(NetPlayers[slot].addr.connection_type);
}
#endif
char dbg_output[50];
nw_GetNumbersFromHostAddress(&NetPlayers[slot].addr, dbg_output);
mprintf((0, "Got player address of: %s\n", dbg_output));
@ -2704,12 +2695,6 @@ void MultiDoPlayerEnteredGame(ubyte *data) {
// Get the player's network address
memcpy(&NetPlayers[slot].addr, data + count, sizeof(network_address));
#ifdef MACINTOSH // DAJ if the addr is comming from a PC swap it
if (NetPlayers[slot].addr.connection_type > NP_DIRECTPLAY) {
NetPlayers[slot].addr.port = SWAPSHORT(NetPlayers[slot].addr.port);
NetPlayers[slot].addr.connection_type = (network_protocol)SWAPINT(NetPlayers[slot].addr.connection_type);
}
#endif
count += sizeof(network_address);
// Get PPS

View File

@ -39,4 +39,4 @@ extern int Current_saved_move;
extern int MultiAllocSavedMove();
extern void MultiFreeSavedMove(int);
#endif
#endif

View File

@ -615,8 +615,6 @@ int LoadMultiDLL(char *name) {
// Make the dll filename
#if defined(WIN32)
snprintf(dll_name, sizeof(dll_name), "%s.dll", name);
#elif defined(MACINTOSH)
sprintf(dll_name, "%s.msl", name);
#else
snprintf(dll_name, sizeof(dll_name), "%s.so", name);
#endif

View File

@ -193,4 +193,4 @@ void ScoreAPIPlayerLeft(int playernum);
void ScoreAPIPlayerEntered(int playernum);
void ScoreAPIPlayerKilled(int killer, int killed);
#endif
#endif

View File

@ -48,4 +48,4 @@
int MultiSaveSettings(char *filename);
int MultiLoadSettings(char *filename);
#endif
#endif

View File

@ -80,4 +80,4 @@ void GetNewRankings(object *killed, object *killer);
// Returns -1 if not a pxo game (ie no rankings in this game)
int GetRankIndex(int pnum, char *rankbuf = NULL);
#endif
#endif

View File

@ -36,4 +36,4 @@ void MultiGameOptionsMenu(int alloptions);
int ReturnMultiplayerGameMenu(void);
int MultiLevelSelection(void);
bool DoPlayerMouselookCheck(unsigned int flags);
#endif
#endif

View File

@ -67,4 +67,4 @@
#define OCF_LIGHT_COLOR (1 << 2)
#define OCF_PHYS_FLAGS (1 << 3)
#endif
#endif

View File

@ -670,9 +670,6 @@
#include "osiris_predefs.h"
#include "viseffect.h"
#include "levelgoal.h"
#ifdef MACINTOSH
#include "osiris_common.h" //DAJ explicit include so it know its here
#endif
#include <algorithm>

View File

@ -35,4 +35,4 @@ void msafe_GetValue(int type, msafe_struct *mstruct);
void MultiSendMSafeFunction(ubyte type, msafe_struct *mstruct);
void MultiSendMSafePowerup(msafe_struct *mstruct);
#endif
#endif

View File

@ -557,4 +557,4 @@ protected:
virtual void OnDestroy();
};
#endif
#endif

View File

@ -741,4 +741,4 @@ inline int CALC_SLIDER_INT_VALUE(short val, int min, int max, short range) {
return retval;
}
#endif
#endif

View File

@ -358,4 +358,4 @@
#define ROBOT_GUIDEBOTRED 0 // NOTE: this must match GENOBJ_GUIDEBOTRED
#endif
#endif
#endif

View File

@ -64,4 +64,4 @@ light_info *ObjGetLightInfo(object *objp);
// Sets an object to have local lighting info
void ObjSetLocalLighting(object *objp);
#endif
#endif

Some files were not shown because too many files have changed in this diff Show More