mirror of
https://github.com/kevinbentley/Descent3.git
synced 2025-01-22 11:28:56 +00:00
Avoid using ASSERT in interface headers
This commit is contained in:
parent
a59503f881
commit
cc9e054509
@ -475,6 +475,7 @@
|
||||
#include "objinfo.h"
|
||||
#include "AIMain.h"
|
||||
#include "room.h"
|
||||
#include "pserror.h"
|
||||
#include "psrand.h"
|
||||
#include "BOA.h"
|
||||
#include "findintersection.h"
|
||||
|
@ -92,10 +92,10 @@
|
||||
|
||||
#include "ConfigItem.h"
|
||||
#include "newui.h"
|
||||
#include "descent.h"
|
||||
#include "log.h"
|
||||
#include "gamefont.h"
|
||||
#include "mem.h"
|
||||
#include "pserror.h"
|
||||
#include "stringtable.h"
|
||||
|
||||
#define UI_CHECKBOX_OFF_CHAR 28
|
||||
|
@ -113,18 +113,18 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "CtlCfgElem.h"
|
||||
#include "descent.h"
|
||||
|
||||
#include "Macros.h"
|
||||
#include "ddio.h"
|
||||
#include "application.h"
|
||||
#include "renderer.h"
|
||||
#include "stringtable.h"
|
||||
#include "gamefont.h"
|
||||
#include "localization.h"
|
||||
|
||||
#include <string.h>
|
||||
#include "pserror.h"
|
||||
#include "joystick.h"
|
||||
|
||||
// all controller binding texts
|
||||
|
@ -861,6 +861,7 @@
|
||||
#include "gamefont.h"
|
||||
#include "renderobject.h"
|
||||
#include "buddymenu.h"
|
||||
#include "pserror.h"
|
||||
|
||||
#ifdef EDITOR
|
||||
#include "editor\d3edit.h"
|
||||
|
@ -61,15 +61,8 @@
|
||||
*/
|
||||
|
||||
#include "NewPyroGauges.h"
|
||||
#include "gauges.h"
|
||||
#include "gamefont.h"
|
||||
#include "game.h"
|
||||
#include "hud.h"
|
||||
#include "grdefs.h"
|
||||
#include "bitmap.h"
|
||||
#include "player.h"
|
||||
#include "polymodel.h"
|
||||
#include "3d.h"
|
||||
#include "pserror.h"
|
||||
#include "renderer.h"
|
||||
#include "gametexture.h"
|
||||
|
||||
|
@ -63,13 +63,13 @@
|
||||
#include <cstdio>
|
||||
|
||||
#include "bitmap.h"
|
||||
#include "player.h"
|
||||
#include "pilot.h"
|
||||
#include "cfile.h"
|
||||
#include "log.h"
|
||||
#include "ddio.h"
|
||||
#include "manage.h"
|
||||
#include "PilotPicsAPI.h"
|
||||
#include "pserror.h"
|
||||
#include "mem.h"
|
||||
|
||||
#define PILOTPIC_DATABASE_HOG "PPics.Hog"
|
||||
|
@ -519,6 +519,7 @@
|
||||
#include "hlsoundlib.h"
|
||||
#include "soundload.h"
|
||||
#include "textaux.h"
|
||||
#include "pserror.h"
|
||||
#include "psrand.h"
|
||||
#include "controls.h"
|
||||
#include "d3music.h"
|
||||
|
@ -143,6 +143,7 @@
|
||||
#include "vecmat.h"
|
||||
#include "textaux.h"
|
||||
#include "hlsoundlib.h"
|
||||
#include "pserror.h"
|
||||
#include "soundload.h"
|
||||
|
||||
tceffect TCEffects[MAX_TCEFFECTS];
|
||||
|
@ -56,6 +56,7 @@
|
||||
#include "hlsoundlib.h"
|
||||
#include "log.h"
|
||||
#include "mem.h"
|
||||
#include "pserror.h"
|
||||
#include "textaux.h"
|
||||
|
||||
int glitch_dx = 0, glitch_dy = 0;
|
||||
|
@ -936,6 +936,7 @@
|
||||
#include "config.h"
|
||||
#include "ObjScript.h"
|
||||
#include "doorway.h"
|
||||
#include "pserror.h"
|
||||
#include "psrand.h"
|
||||
#include "BOA.h"
|
||||
|
||||
|
@ -48,12 +48,13 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "cstdint"
|
||||
#include <cstring>
|
||||
|
||||
#include "vecmat.h"
|
||||
#include "terrain.h"
|
||||
#include "pstypes.h"
|
||||
#include "findintersection.h"
|
||||
#include "pserror.h"
|
||||
#include "aiterrain.h"
|
||||
#include <string.h>
|
||||
|
||||
#define AI_MAX_SEGS_CHECKED 200
|
||||
|
||||
|
@ -82,6 +82,7 @@
|
||||
|
||||
#include "room.h"
|
||||
#include "game.h"
|
||||
#include "pserror.h"
|
||||
#include "psrand.h"
|
||||
|
||||
#define MAX_AMBIENT_SOUND_PATTERNS 100
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "demofile.h"
|
||||
#include "polymodel.h"
|
||||
#include "objinfo.h"
|
||||
#include "pserror.h"
|
||||
|
||||
/* // Determines the necessary orientation and position of the moving object
|
||||
f_use_uvec = true;
|
||||
|
@ -104,9 +104,9 @@
|
||||
#include "mem.h"
|
||||
#include "vecmat.h"
|
||||
#include "terrain.h"
|
||||
#include "room.h"
|
||||
#include "findintersection.h"
|
||||
#include "BOA.h"
|
||||
#include "pserror.h"
|
||||
#include "psrand.h"
|
||||
|
||||
bn_list BNode_terrain_list[8];
|
||||
|
@ -52,6 +52,7 @@
|
||||
#include "mem.h"
|
||||
#include "polymodel.h"
|
||||
#include "object.h"
|
||||
#include "pserror.h"
|
||||
#include "psrand.h"
|
||||
|
||||
#define BSP_TREE_VERSION 10003
|
||||
|
@ -200,6 +200,7 @@
|
||||
#include "log.h"
|
||||
#include "ship.h"
|
||||
#include "player.h"
|
||||
#include "pserror.h"
|
||||
#include "room.h"
|
||||
#include "hlsoundlib.h"
|
||||
#include "sounds.h"
|
||||
|
@ -291,6 +291,7 @@
|
||||
#include "terrain.h"
|
||||
#include "physics.h"
|
||||
#include "pilot.h"
|
||||
#include "pserror.h"
|
||||
#include "hud.h"
|
||||
#include "bitmap.h"
|
||||
#include "game.h"
|
||||
|
@ -92,6 +92,7 @@
|
||||
#include "mem.h"
|
||||
#include "d3music.h"
|
||||
#include "hlsoundlib.h"
|
||||
#include "pserror.h"
|
||||
#include "psrand.h"
|
||||
|
||||
/*
|
||||
|
@ -292,6 +292,7 @@
|
||||
#include "D3ForceFeedback.h"
|
||||
#include "hlsoundlib.h"
|
||||
#include "ddio.h"
|
||||
#include "pserror.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
#define IDV_KCONFIG 10
|
||||
|
@ -586,6 +586,7 @@
|
||||
#include "DeathInfo.h"
|
||||
#include "AIGoal.h"
|
||||
#include "viseffect.h"
|
||||
#include "pserror.h"
|
||||
#include "psrand.h"
|
||||
|
||||
|
||||
|
@ -294,6 +294,7 @@
|
||||
#include "osiris_dll.h"
|
||||
#include "args.h"
|
||||
#include "gamecinematics.h"
|
||||
#include "pserror.h"
|
||||
#include "psrand.h"
|
||||
#include "cockpit.h"
|
||||
// We borrow a lot of code from the savegame system
|
||||
|
@ -183,7 +183,6 @@
|
||||
#ifndef _GAME_H
|
||||
#define _GAME_H
|
||||
|
||||
#include "pserror.h"
|
||||
#include "renderer.h"
|
||||
#include "object.h"
|
||||
|
||||
|
@ -73,6 +73,7 @@
|
||||
#include "spew.h"
|
||||
#include "mem.h"
|
||||
#include "player.h"
|
||||
#include "pserror.h"
|
||||
|
||||
int Num_events = 0;
|
||||
game_event GameEvent[MAX_EVENTS];
|
||||
|
@ -296,6 +296,7 @@
|
||||
#include "matcen.h"
|
||||
#include "marker.h"
|
||||
#include "d3music.h"
|
||||
#include "pserror.h"
|
||||
#include "weather.h"
|
||||
|
||||
// function prototypes.
|
||||
|
@ -200,6 +200,7 @@
|
||||
#include "ship.h"
|
||||
#include "3d.h"
|
||||
#include "weapon.h"
|
||||
#include "pserror.h"
|
||||
#include "stringtable.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -110,6 +110,7 @@
|
||||
#include "mem.h"
|
||||
#include "bitmap.h"
|
||||
#include "manage.h"
|
||||
#include "pserror.h"
|
||||
|
||||
static void makecorner(int corner_bmp, int back_bmp, const char *tmap, int l, int t, int r, int b);
|
||||
static int CreateHotSpotMap(const char *map, int width, int height, hotspotmap_t *hsmap);
|
||||
|
@ -431,6 +431,7 @@
|
||||
#include "d3music.h"
|
||||
#include "demofile.h"
|
||||
#include "stringtable.h"
|
||||
#include "pserror.h"
|
||||
#include "pstring.h"
|
||||
#include "config.h"
|
||||
#include "gamecinematics.h"
|
||||
|
@ -350,6 +350,7 @@
|
||||
#include "sounds.h"
|
||||
#include "hlsoundlib.h"
|
||||
#include "args.h"
|
||||
#include "pserror.h"
|
||||
|
||||
#define HUD_MESSAGE_NORMAL 0
|
||||
#define HUD_MESSAGE_BLINKING 1
|
||||
|
@ -175,6 +175,7 @@
|
||||
#include "osiris_share.h"
|
||||
#include "multisafe.h"
|
||||
#include "multi_world_state.h"
|
||||
#include "pserror.h"
|
||||
|
||||
#define GOAL_MESSAGE_TIME 10.0
|
||||
#define GOAL_MESSAGE_COLOR GR_RGB(0, 242, 148)
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include "config.h"
|
||||
#include "dedicated_server.h"
|
||||
#include "objinfo.h"
|
||||
#include "pserror.h"
|
||||
|
||||
#define NUM_DYNAMIC_CLASSES 7
|
||||
#define MAX_DYNAMIC_FACES 2000
|
||||
|
@ -217,6 +217,7 @@
|
||||
#include "weather.h"
|
||||
#include "cockpit.h"
|
||||
#include "hud.h"
|
||||
#include "pserror.h"
|
||||
|
||||
extern void PageInAllData();
|
||||
|
||||
|
@ -96,6 +96,7 @@
|
||||
#include "localization.h"
|
||||
#include "log.h"
|
||||
#include "mem.h"
|
||||
#include "pserror.h"
|
||||
|
||||
struct tLangTag {
|
||||
const char *tag;
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "player.h"
|
||||
#include "multi.h"
|
||||
#include "game.h"
|
||||
#include "pserror.h"
|
||||
#ifdef _DEBUG
|
||||
#include "AIMain.h"
|
||||
#endif
|
||||
|
@ -175,6 +175,7 @@
|
||||
#include "ObjScript.h"
|
||||
#include "psrand.h"
|
||||
#include "demofile.h"
|
||||
#include "pserror.h"
|
||||
|
||||
// Beginning of the real file
|
||||
#define LEVEL_DATA_MATCEN_VERSION 1
|
||||
|
@ -135,6 +135,7 @@
|
||||
#include "grtext.h"
|
||||
#include "Mission.h"
|
||||
#include "mission_download.h"
|
||||
#include "pserror.h"
|
||||
#include "renderer.h"
|
||||
#include "unzip.h"
|
||||
|
||||
|
@ -109,6 +109,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "mmItem.h"
|
||||
#include "game.h"
|
||||
#include "program.h"
|
||||
@ -117,12 +119,9 @@
|
||||
#include "hlsoundlib.h"
|
||||
#include "soundload.h"
|
||||
#include "d3music.h"
|
||||
|
||||
#include "ddio.h"
|
||||
// #include <malloc.h>
|
||||
#include "mem.h"
|
||||
|
||||
#include <string.h>
|
||||
#include "pserror.h"
|
||||
|
||||
// externed from newui.cpp
|
||||
extern int UI_frame_result;
|
||||
|
@ -142,6 +142,7 @@
|
||||
#include "player.h"
|
||||
#include "ddio.h"
|
||||
#include "pilot.h"
|
||||
#include "pserror.h"
|
||||
#include "Mission.h"
|
||||
#include "stringtable.h"
|
||||
#include "ship.h"
|
||||
|
@ -263,6 +263,7 @@
|
||||
#include "Mission.h"
|
||||
#include "stringtable.h"
|
||||
#include "pilot.h"
|
||||
#include "pserror.h"
|
||||
#include "ship.h"
|
||||
#include "args.h"
|
||||
#include "ui.h"
|
||||
|
@ -639,6 +639,7 @@
|
||||
#include "LoadLevel.h"
|
||||
#include "Mission.h"
|
||||
#include "game2dll.h"
|
||||
#include "pserror.h"
|
||||
#include "stringtable.h"
|
||||
|
||||
// #define USE_DIRECTPLAY
|
||||
|
@ -331,6 +331,7 @@
|
||||
#include "manage.h"
|
||||
#include "menu.h"
|
||||
#include "pilot.h"
|
||||
#include "pserror.h"
|
||||
#include "ddio.h"
|
||||
#include "objinfo.h"
|
||||
#include "ship.h"
|
||||
|
@ -657,6 +657,7 @@
|
||||
#include "sounds.h"
|
||||
#include "ship.h"
|
||||
#include "player.h"
|
||||
#include "pserror.h"
|
||||
#include "object_lighting.h"
|
||||
#include "soundload.h"
|
||||
#include "streamaudio.h"
|
||||
|
@ -304,7 +304,6 @@
|
||||
#include "log.h"
|
||||
#include "newui.h"
|
||||
#include "game.h"
|
||||
#include "descent.h"
|
||||
#include "renderer.h"
|
||||
#include "3d.h"
|
||||
#include "gamefont.h"
|
||||
@ -314,6 +313,7 @@
|
||||
#include "newui_core.h"
|
||||
#include "hlsoundlib.h"
|
||||
#include "dedicated_server.h"
|
||||
#include "pserror.h"
|
||||
|
||||
#define MSGBOX_HEIGHT msgbox.H()
|
||||
#define BTN_WIDTH 96
|
||||
|
@ -109,6 +109,7 @@
|
||||
#include "game.h"
|
||||
#include "log.h"
|
||||
#include "newui.h"
|
||||
#include "pserror.h"
|
||||
#include "pstring.h"
|
||||
#include "renderer.h"
|
||||
#include "stringtable.h"
|
||||
|
@ -3327,6 +3327,24 @@ bool ObjGetAnimUpdate(uint16_t objnum, custom_anim *multi_anim_info) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void SetObjectDeadFlag(object *obj, bool tell_clients_to_remove, bool play_sound_on_clients) {
|
||||
int objnum = OBJNUM(obj);
|
||||
ASSERT(objnum != -1);
|
||||
ASSERT(objnum != 0);
|
||||
ASSERT(obj->type != OBJ_NONE);
|
||||
ASSERT(obj != Player_object);
|
||||
|
||||
obj->flags |= OF_DEAD;
|
||||
|
||||
if (tell_clients_to_remove) {
|
||||
if (play_sound_on_clients) {
|
||||
obj->flags |= OF_SEND_MULTI_REMOVE_ON_DEATHWS;
|
||||
} else {
|
||||
obj->flags |= OF_SEND_MULTI_REMOVE_ON_DEATH;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetObjectControlType(object *obj, int control_type) {
|
||||
ASSERT(obj);
|
||||
ASSERT(OBJNUM(obj) >= 0 && OBJNUM(obj) < MAX_OBJECTS);
|
||||
|
@ -632,7 +632,6 @@
|
||||
|
||||
#include "object_external_struct.h"
|
||||
#include "object_external.h"
|
||||
#include "pserror.h"
|
||||
|
||||
/*
|
||||
* CONSTANTS
|
||||
@ -706,24 +705,7 @@ extern int16_t BigObjectList[MAX_BIG_OBJECTS]; // DAJ_MR utb int
|
||||
*/
|
||||
|
||||
// Set the dead flag for an object
|
||||
static inline void SetObjectDeadFlag(object *obj, bool tell_clients_to_remove = false, bool play_sound_on_clients = false);
|
||||
static inline void SetObjectDeadFlag(object *obj, bool tell_clients_to_remove, bool play_sound_on_clients) {
|
||||
int objnum = OBJNUM(obj);
|
||||
ASSERT(objnum != -1);
|
||||
ASSERT(objnum != 0);
|
||||
ASSERT(obj->type != OBJ_NONE);
|
||||
ASSERT(obj != Player_object);
|
||||
|
||||
obj->flags |= OF_DEAD;
|
||||
|
||||
if (tell_clients_to_remove) {
|
||||
if (play_sound_on_clients) {
|
||||
obj->flags |= OF_SEND_MULTI_REMOVE_ON_DEATHWS;
|
||||
} else {
|
||||
obj->flags |= OF_SEND_MULTI_REMOVE_ON_DEATH;
|
||||
}
|
||||
}
|
||||
}
|
||||
void SetObjectDeadFlag(object *obj, bool tell_clients_to_remove = false, bool play_sound_on_clients = false);
|
||||
|
||||
void SetObjectControlType(object *obj, int control_type);
|
||||
|
||||
|
@ -108,6 +108,7 @@
|
||||
#include "hlsoundlib.h"
|
||||
#include "soundload.h"
|
||||
#include "hud.h"
|
||||
#include "pserror.h"
|
||||
#include "stringtable.h"
|
||||
|
||||
// How far the headlight casts light
|
||||
|
@ -597,6 +597,7 @@
|
||||
#include "newui.h"
|
||||
#include "pilot.h"
|
||||
#include "polymodel.h"
|
||||
#include "pserror.h"
|
||||
#include "pstring.h"
|
||||
#include "renderer.h"
|
||||
#include "render.h"
|
||||
|
@ -76,13 +76,13 @@
|
||||
#include "..\neweditor\globals.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "object.h"
|
||||
#include "viseffect.h"
|
||||
#include "render.h"
|
||||
#include "renderobject.h"
|
||||
#include "room.h"
|
||||
#include "postrender.h"
|
||||
#include "pserror.h"
|
||||
#include "config.h"
|
||||
#include "terrain.h"
|
||||
#include "renderer.h"
|
||||
|
@ -29,6 +29,7 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
@ -58,6 +59,7 @@
|
||||
#include "TelComAutoMap.h"
|
||||
#include "postrender.h"
|
||||
#include "mem.h"
|
||||
#include "pserror.h"
|
||||
#include "psrand.h"
|
||||
#include "player.h"
|
||||
#include "args.h"
|
||||
@ -65,8 +67,6 @@
|
||||
#include "editor\d3edit.h"
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
// #define KATMAI
|
||||
|
||||
// Katmai enhanced rotate only in a release build, because not
|
||||
|
@ -608,6 +608,7 @@
|
||||
#include "game2dll.h"
|
||||
#include "marker.h"
|
||||
#include "ship.h"
|
||||
#include "pserror.h"
|
||||
#include "psrand.h"
|
||||
|
||||
#ifdef EDITOR
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "SmallViews.h"
|
||||
#include "physics.h"
|
||||
#include "AIMain.h"
|
||||
#include "pserror.h"
|
||||
#include "psrand.h"
|
||||
|
||||
// Fires a multiplayer and AI on/off weapon
|
||||
|
@ -416,6 +416,7 @@
|
||||
#include "multi_world_state.h"
|
||||
#include "damage_external.h"
|
||||
#include "descent.h"
|
||||
#include "pserror.h"
|
||||
#ifdef EDITOR
|
||||
#include "editor\editor_lighting.h"
|
||||
#endif
|
||||
|
@ -203,6 +203,7 @@
|
||||
#include "log.h"
|
||||
#include "sounds.h"
|
||||
#include "pilot.h"
|
||||
#include "pserror.h"
|
||||
#include "joystick.h"
|
||||
|
||||
#define LVLRES_FADEIN_TIME 0.50f
|
||||
|
@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "fireball.h"
|
||||
#include "object.h"
|
||||
@ -23,13 +24,9 @@
|
||||
#include "polymodel.h"
|
||||
#include "renderer.h"
|
||||
#include "gametexture.h"
|
||||
|
||||
#include "Macros.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "pserror.h"
|
||||
#include "psrand.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
// Given an object, renders the representation of this splinter
|
||||
void DrawSplinterObject(object *obj) {
|
||||
|
@ -108,6 +108,17 @@ int Terrain_checksum = -1;
|
||||
uint8_t Terrain_occlusion_map[256][32];
|
||||
int Terrain_occlusion_checksum = -2;
|
||||
|
||||
#ifndef RELEASE
|
||||
int TERRAIN_REGION(int x) {
|
||||
ASSERT(x != -1 && "invalid/unset room number (-1)!");
|
||||
// Note: due to the 0x7FFFFFFF mask, terrSegIdx will be >= 0
|
||||
int terrSegIdx = 0x7FFFFFFF & x;
|
||||
// catch other invalid cell/segment numbers than -1 as well
|
||||
ASSERT((terrSegIdx < TERRAIN_WIDTH * TERRAIN_DEPTH) && "invalid cellnum!");
|
||||
return (Terrain_seg[terrSegIdx].flags & TFM_REGION_MASK) >> 5;
|
||||
}
|
||||
#endif
|
||||
|
||||
// returns the index of the highest float
|
||||
int GetHighestDelta(float *deltas, int count) {
|
||||
int high_index = -999;
|
||||
|
@ -214,14 +214,7 @@ extern int16_t Terrain_seg_render_objs[];
|
||||
#ifdef RELEASE
|
||||
#define TERRAIN_REGION(x) ((Terrain_seg[0x7FFFFFFF & x].flags & TFM_REGION_MASK) >> 5)
|
||||
#else // debug(-ish) builds - check if x is valid
|
||||
static inline int TERRAIN_REGION(int x) {
|
||||
ASSERT(x != -1 && "invalid/unset room number (-1)!");
|
||||
// Note: due to the 0x7FFFFFFF mask, terrSegIdx will be >= 0
|
||||
int terrSegIdx = 0x7FFFFFFF & x;
|
||||
// catch other invalid cell/segment numbers than -1 as well
|
||||
ASSERT((terrSegIdx < TERRAIN_WIDTH * TERRAIN_DEPTH) && "invalid cellnum!");
|
||||
return (Terrain_seg[terrSegIdx].flags & TFM_REGION_MASK) >> 5;
|
||||
}
|
||||
int TERRAIN_REGION(int x);
|
||||
#endif
|
||||
|
||||
extern terrain_sky Terrain_sky;
|
||||
|
@ -454,6 +454,7 @@
|
||||
#include "physics.h"
|
||||
#include "player.h"
|
||||
#include "polymodel.h"
|
||||
#include "pserror.h"
|
||||
#include "psrand.h"
|
||||
#include "room.h"
|
||||
#include "terrain.h"
|
||||
|
@ -26,9 +26,10 @@ target_include_directories(ddebug PUBLIC
|
||||
PRIVATE ${PROJECT_BINARY_DIR}/lib # For d3_version.h
|
||||
)
|
||||
target_link_libraries(ddebug PRIVATE
|
||||
logger
|
||||
$<$<PLATFORM_ID:Windows>:
|
||||
mem
|
||||
misc
|
||||
>
|
||||
PUBLIC
|
||||
logger
|
||||
)
|
||||
|
@ -400,22 +400,26 @@
|
||||
#endif // OS check
|
||||
|
||||
#else // Release build
|
||||
|
||||
#ifdef DEBUG_BREAK
|
||||
#undef DEBUG_BREAK
|
||||
#define DEBUG_BREAK()
|
||||
#endif
|
||||
#define DEBUG_BREAK()
|
||||
|
||||
#define DLLASSERT(x)
|
||||
#define DLLmprintf(...)
|
||||
|
||||
#ifdef Int3
|
||||
#undef Int3
|
||||
#define Int3()
|
||||
#endif
|
||||
#define Int3()
|
||||
|
||||
#ifdef ASSERT
|
||||
#undef ASSERT
|
||||
#endif
|
||||
#define ASSERT(x)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // #ifndef RELEASE
|
||||
|
||||
#ifdef mprintf // undefine mprintf and redirect it to use DLLmprintf
|
||||
#undef mprintf
|
||||
|
@ -294,6 +294,7 @@
|
||||
#include "directplay.h"
|
||||
#include "dplay.h"
|
||||
#include "dplobby.h"
|
||||
#include "module.h"
|
||||
|
||||
typedef int socklen_t;
|
||||
#endif
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "physics.h"
|
||||
#include "player.h"
|
||||
#include "polymodel.h"
|
||||
#include "pserror.h"
|
||||
#include "terrain.h"
|
||||
#include "vecmat.h"
|
||||
#include "viseffect.h"
|
||||
|
@ -59,7 +59,7 @@
|
||||
#include "application.h"
|
||||
#include "soundload.h"
|
||||
#include "gametexture.h"
|
||||
|
||||
#include "pserror.h"
|
||||
|
||||
static llsGeometry *Geometry = NULL;
|
||||
static int16_t Sound_room_list[SOUND_RENDER_ROOM_LIMIT + 1];
|
||||
|
@ -123,7 +123,9 @@
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "pserror.h"
|
||||
#include "UIlib.h"
|
||||
#include "ui.h"
|
||||
|
||||
#if defined(POSIX)
|
||||
int UIButton::m_ButtonFont;
|
||||
@ -161,6 +163,11 @@ void UIButton::Create(UIWindow *parent, int id, UIItem *item, int x, int y, int
|
||||
UIGadget::Create(parent, id, x, y, w, h, flags);
|
||||
}
|
||||
|
||||
UIItem *UIButton::GetStateItem(int state) {
|
||||
ASSERT(state < UI_BTS_NUM);
|
||||
return m_Items[state];
|
||||
};
|
||||
|
||||
// sets the background bitmap for a specified button state
|
||||
void UIButton::SetStateItem(int state, UIItem *item) {
|
||||
ASSERT(state < UI_BTS_NUM);
|
||||
@ -172,6 +179,11 @@ void UIButton::SetStateItem(int state, UIItem *item) {
|
||||
m_Items[state] = item->CopyUIItem();
|
||||
}
|
||||
|
||||
int UIButton::GetColor(int state) const {
|
||||
ASSERT(state < UI_BTS_NUM);
|
||||
return m_Colors[state];
|
||||
};
|
||||
|
||||
// sets the background color for a specified button state
|
||||
void UIButton::SetColor(int state, ddgr_color col) {
|
||||
ASSERT(state < UI_BTS_NUM);
|
||||
|
@ -60,6 +60,7 @@
|
||||
#include "UIlib.h"
|
||||
#include "grtext.h"
|
||||
#include "mem.h"
|
||||
#include "pserror.h"
|
||||
#include "textaux.h"
|
||||
|
||||
#define CONSOLE_LINE_FILLER 128
|
||||
|
@ -141,7 +141,7 @@
|
||||
#include "log.h"
|
||||
#include "Macros.h"
|
||||
#include "mem.h"
|
||||
|
||||
#include "pserror.h"
|
||||
|
||||
static UIEdit *UI_current_editbox = NULL;
|
||||
|
||||
|
@ -121,6 +121,7 @@
|
||||
|
||||
#include "UIlib.h"
|
||||
#include "Macros.h"
|
||||
#include "pserror.h"
|
||||
|
||||
int UIGadget::m_LastKey = 0;
|
||||
int UIGadget::m_LastKeyCount = 0;
|
||||
|
@ -49,6 +49,7 @@
|
||||
|
||||
#include "UIlib.h"
|
||||
#include "mem.h"
|
||||
#include "pserror.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// UIGroup
|
||||
|
@ -78,6 +78,7 @@
|
||||
*/
|
||||
|
||||
#include "UIlib.h"
|
||||
#include "pserror.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// UIHotspot
|
||||
|
@ -162,6 +162,7 @@
|
||||
|
||||
#include "UIlib.h"
|
||||
#include "log.h"
|
||||
#include "pserror.h"
|
||||
|
||||
#define SCROLL_BUTTON_GAP 4
|
||||
|
||||
|
@ -40,6 +40,7 @@
|
||||
|
||||
#include "UIlib.h"
|
||||
#include "log.h"
|
||||
#include "pserror.h"
|
||||
|
||||
UIObject::UIObject() {
|
||||
m_X = m_Y = 0;
|
||||
|
@ -62,6 +62,7 @@
|
||||
*/
|
||||
|
||||
#include "UIlib.h"
|
||||
#include "pserror.h"
|
||||
|
||||
// Construction and destruction
|
||||
|
||||
|
@ -170,6 +170,7 @@
|
||||
#include "application.h"
|
||||
#include "bitmap.h"
|
||||
#include "log.h"
|
||||
#include "pserror.h"
|
||||
#include "renderer.h"
|
||||
#include "Macros.h"
|
||||
|
||||
|
@ -152,6 +152,7 @@
|
||||
#include "UIlib.h"
|
||||
#include "Macros.h"
|
||||
#include "log.h"
|
||||
#include "pserror.h"
|
||||
|
||||
// the window font for all windows
|
||||
int UIWindow::m_WindowFont = 0;
|
||||
|
11
ui/ui.h
11
ui/ui.h
@ -270,7 +270,6 @@
|
||||
#include <cstdint>
|
||||
|
||||
#include "grdefs.h"
|
||||
#include "pserror.h"
|
||||
#include "uires.h"
|
||||
|
||||
// Class identification
|
||||
@ -554,15 +553,9 @@ private:
|
||||
protected:
|
||||
int m_State; // state of button
|
||||
|
||||
UIItem *GetStateItem(int state) {
|
||||
ASSERT(state < UI_BTS_NUM);
|
||||
return m_Items[state];
|
||||
};
|
||||
UIItem *GetStateItem(int state);
|
||||
|
||||
int GetColor(int state) const {
|
||||
ASSERT(state < UI_BTS_NUM);
|
||||
return m_Colors[state];
|
||||
};
|
||||
int GetColor(int state) const;
|
||||
|
||||
public:
|
||||
static void SetDefaultFont(int font) { // sets the button font
|
||||
|
@ -146,9 +146,8 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
|
||||
#include "vecmat.h"
|
||||
#include "mono.h"
|
||||
@ -160,7 +159,7 @@ const matrix Identity_matrix = IDENTITY_MATRIX;
|
||||
|
||||
void vm_AverageVector(vector *a, int num) {
|
||||
// Averages a vector. ie divides each component of vector a by num
|
||||
assert(num != 0);
|
||||
ASSERT(num != 0);
|
||||
a->x = a->x / (float)num;
|
||||
a->y = a->y / (float)num;
|
||||
a->z = a->z / (float)num;
|
||||
@ -254,7 +253,7 @@ void vm_DivVector(vector *dest, vector *src, float n) {
|
||||
// Divides a vector into n portions
|
||||
// Dest can equal src
|
||||
|
||||
assert(n != 0);
|
||||
ASSERT(n != 0);
|
||||
dest->x = src->x / n;
|
||||
dest->y = src->y / n;
|
||||
dest->z = src->z / n;
|
||||
@ -325,7 +324,7 @@ void vm_TransposeMatrix(matrix *m) {
|
||||
void vm_MatrixMulVector(vector *result, vector *v, matrix *m) {
|
||||
// Rotates a vector thru a matrix
|
||||
|
||||
assert(result != v);
|
||||
ASSERT(result != v);
|
||||
|
||||
result->x = *v * m->rvec;
|
||||
result->y = *v * m->uvec;
|
||||
@ -334,7 +333,7 @@ void vm_MatrixMulVector(vector *result, vector *v, matrix *m) {
|
||||
|
||||
// Multiply a vector times the transpose of a matrix
|
||||
void vm_VectorMulTMatrix(vector *result, vector *v, matrix *m) {
|
||||
assert(result != v);
|
||||
ASSERT(result != v);
|
||||
|
||||
result->x = vm_Dot3Vector(m->rvec.x, m->uvec.x, m->fvec.x, v);
|
||||
result->y = vm_Dot3Vector(m->rvec.y, m->uvec.y, m->fvec.y, v);
|
||||
@ -344,7 +343,7 @@ void vm_VectorMulTMatrix(vector *result, vector *v, matrix *m) {
|
||||
void vm_MatrixMul(matrix *dest, matrix *src0, matrix *src1) {
|
||||
// For multiplying two 3x3 matrices together
|
||||
|
||||
assert((dest != src0) && (dest != src1));
|
||||
ASSERT((dest != src0) && (dest != src1));
|
||||
|
||||
dest->rvec.x = vm_Dot3Vector(src0->rvec.x, src0->uvec.x, src0->fvec.x, &src1->rvec);
|
||||
dest->uvec.x = vm_Dot3Vector(src0->rvec.x, src0->uvec.x, src0->fvec.x, &src1->uvec);
|
||||
@ -363,7 +362,7 @@ void vm_MatrixMul(matrix *dest, matrix *src0, matrix *src1) {
|
||||
void vm_MatrixMulTMatrix(matrix *dest, matrix *src0, matrix *src1) {
|
||||
// For multiplying two 3x3 matrices together
|
||||
|
||||
assert((dest != src0) && (dest != src1));
|
||||
ASSERT((dest != src0) && (dest != src1));
|
||||
|
||||
dest->rvec.x = src0->rvec.x * src1->rvec.x + src0->uvec.x * src1->uvec.x + src0->fvec.x * src1->fvec.x;
|
||||
dest->uvec.x = src0->rvec.x * src1->rvec.y + src0->uvec.x * src1->uvec.y + src0->fvec.x * src1->fvec.y;
|
||||
|
Loading…
Reference in New Issue
Block a user