Skip to content

Commit

Permalink
Release build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lgt2x committed Jun 7, 2024
1 parent 1821da9 commit bcca927
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 34 deletions.
6 changes: 2 additions & 4 deletions Descent3/SLEW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
* $NoKeywords: $
*/

#ifdef _DEBUG
#if (defined(_DEBUG) || defined(EDITOR))

#ifdef EDITOR
#include "editor\mainfrm.h"
Expand Down Expand Up @@ -226,10 +226,8 @@ int Joystick_active = -1;
void SlewControlInit() {
Joystick_active = -1;

#ifdef EDITOR
if (!D3EditState.joy_slewing)
return;
#endif

if (joy_IsValid(JOYSTICK_1)) {
tJoyPos joystate;
Expand All @@ -244,7 +242,7 @@ void SlewControlInit() {
}
#endif

int SlewStop(object *obj) {
int SlewStop(object *obj) {
if (!obj)
return 0;

Expand Down
2 changes: 1 addition & 1 deletion Descent3/gamecinematics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@

#include <algorithm>

#ifdef _DEBUG
#if (defined(_DEBUG) || defined(EDITOR))
bool Cinematics_enabled = true;
extern int DoAI;
#ifdef EDITOR
Expand Down
27 changes: 14 additions & 13 deletions Descent3/render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,7 @@ int Global_buffer_index;
int No_render_windows_hack = -1;
#define WALL_PULSE_INCREMENT .01
// Variables for various debugging features
#ifndef _DEBUG
#define In_editor_mode 0
#define Outline_lightmaps 0
#define Outline_alpha 0
#define Render_floating_triggers 0
#define Use_software_zbuffer 0
#define Render_all_external_rooms 0
#define Render_portals 0
#define Render_one_room_only 0
#define Render_inside_only 0
#define Shell_render_flag 0
#else // ifdef _DEBUG
#if (defined(_DEBUG) || defined(NEWEDITOR) || defined(EDITOR))
// If true, draw white outline for each polygon
int Render_portals = 0;
uint8_t Outline_mode = 0;
Expand All @@ -125,7 +114,19 @@ bool Render_all_external_rooms = 0;
bool In_editor_mode = 0;
bool Render_one_room_only = 0;
bool Render_inside_only = 0;
#endif // ifdef _DEBUG
#else
#define In_editor_mode 0
#define Outline_lightmaps 0
#define Outline_alpha 0
#define Render_floating_triggers 0
#define Use_software_zbuffer 0
#define Render_all_external_rooms 0
#define Render_portals 0
#define Render_one_room_only 0
#define Render_inside_only 0
#define Shell_render_flag 0
#endif

#ifndef RELEASE
int Mine_depth;
#endif
Expand Down
2 changes: 1 addition & 1 deletion Descent3/render.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
#include "3d.h"

// Variables for debug/test
#if (defined(_DEBUG) || defined(NEWEDITOR))
#if (defined(_DEBUG) || defined(NEWEDITOR) || defined(EDITOR))

#define SRF_NO_SHELL 1 // don't render the shell
#define SRF_NO_NON_SHELL 2 // don't render the non-shell
Expand Down
4 changes: 2 additions & 2 deletions Descent3/room.h
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ extern int Highest_room_index; // index of highest-numbered room
// Zeroes out the rooms array
void InitRooms();

#ifdef _DEBUG
#if (defined(_DEBUG) || defined(EDITOR))
// Allows a spew'er to find out if he is in a room or external to the mine
// NOTE: THIS FUNCTION IS NOT FOR IN GAME STUFF. It is REALLY SLOW and accurate.
// Talk to Chris if you need something like this function.
Expand Down Expand Up @@ -560,7 +560,7 @@ static inline int GetFacePhysicsFlags(const room *rp, const face *fp) {

// Computes a bounding sphere for the current room
// Parameters: center - filled in with the center point of the sphere
// rp - the room we’re bounding
// rp - the room were bounding
// Returns: the radius of the bounding sphere
float ComputeRoomBoundingSphere(vector *center, room *rp);

Expand Down
2 changes: 1 addition & 1 deletion Descent3/slew.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#ifndef _SLEW_H
#define _SLEW_H

#ifndef RELEASE
#if (defined(_DEBUG) || defined(EDITOR))

#include "object.h"

Expand Down
2 changes: 1 addition & 1 deletion Descent3/terrain.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ extern uint8_t Show_invisible_terrain;

extern int Camera_direction, Sort_direction;

#if (defined(_DEBUG) || defined(NEWEDITOR))
#if (defined(_DEBUG) || defined(EDITOR) || defined(NEWEDITOR))
extern uint8_t TerrainSelected[];
extern int Num_terrain_selected;
#endif
Expand Down
1 change: 0 additions & 1 deletion editor/BriefEdit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ BEGIN_MESSAGE_MAP(CBriefEdit, CDialog)
ON_CBN_SELCHANGE(IDC_BRIEF_SCREEN_LIST, OnSelchangeBriefScreenList)
ON_BN_CLICKED(IDC_BRIEF_SAVE, OnBriefSave)
ON_BN_CLICKED(IDC_LOAD, OnLoad)
ON_WM_TIMER()
ON_BN_CLICKED(IDC_MANAGE, OnManage)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
Expand Down
6 changes: 5 additions & 1 deletion editor/gameeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -927,8 +927,12 @@ void EditorToGame()
void InitEditGameSystems()
{
tUIInitInfo uiinit;
#if defined(RELEASE)
SetDebugBreakHandlers(NULL, NULL);
#else
SetDebugBreakHandlers(D3DebugStopHandler, D3DebugResumeHandler);
#endif

SetDebugBreakHandlers(D3DebugStopHandler, D3DebugResumeHandler);
Descent->set_defer_handler(D3DeferHandler);

LoadAllFonts();
Expand Down
6 changes: 2 additions & 4 deletions lib/pserror.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
*
* $NoKeywords: $
*/

#ifndef PSERROR_H
#define PSERROR_H
#include <assert.h>
Expand All @@ -163,13 +164,10 @@ void Int3MessageBox(const char *file, int line);
#define MBOX_YESNO 2
#define MBOX_YESNOCANCEL 3
#define MBOX_ABORTRETRYIGNORE 4
#ifndef RELEASE
#if (defined(EDITOR) || defined(NEWEDITOR) || defined(_DEBUG))
// prints out a standard OS messagebox
void OutrageMessageBox(const char *str, ...);
int OutrageMessageBox(int type, const char *str, ...);
#else
void OutrageMessageBox(const char *str, ...) {};
int OutrageMessageBox(int type, const char *str, ...) {};
#endif
// Sets the title for future OutrageMessageBox() dialogs
void SetMessageBoxTitle(const char *title);
Expand Down
4 changes: 2 additions & 2 deletions manage/pagelock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ extern const char *PageNames[];
void mng_InitPagelocks() {
// If there is not a pagelock file, create one with a dummy header.

CFILE *infile, *outfile;
CFILE *infile = nullptr, *outfile = nullptr;
mngs_Pagelock testlock;

if (!Network_up)
Expand Down Expand Up @@ -268,7 +268,7 @@ int TableVersionCurrent() {
// Call this before any chokepoint functions are executed.
// Locks the whole table system for our exclusive use
int mng_MakeLocker() {
CFILE *outfile;
CFILE *outfile = nullptr;
int len;
char *locker;

Expand Down
4 changes: 1 addition & 3 deletions misc/error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ void SetMessageBoxTitle(const char *title) { strncpy(Messagebox_title, title, si

#define BUF_LEN 1024

#ifndef RELEASE
// Pops up a dialog box to display a message
void OutrageMessageBox(const char *str, ...) {
char buf[BUF_LEN];
Expand Down Expand Up @@ -283,5 +282,4 @@ int OutrageMessageBox(int type, const char *str, ...) {
"The dialog that follows this one overflowed its text buffer. The program may crash.");

return Debug_MessageBox(os_flags, Messagebox_title, buf);
}
#endif // RELEASE
}

0 comments on commit bcca927

Please sign in to comment.