Vendor the Shockolate engine and build it via a Docker image with every
build / build (push) Failing after 5s

dependency (SDL2, SDL2_mixer, fluidsynth-lite, a MIDI soundfont)
prebuilt, so compiling the engine needs no network access - just the
image and the engine source. Add res/assets/extract_assets.sh to pull
the game's data files out of a purchased GOG installer, and a Makefile
that assembles a runnable dist/ from the two.

Also add `make package`, which builds a redistributable tarball that
omits the proprietary game assets (shipping res/GET_ASSETS.txt instead)
plus license information for both the MIT tooling and the GPLv3 engine,
and a Gitea Actions workflow that builds and publishes it to
dl.ladkau.de on every push.
This commit is contained in:
ml
2026-07-19 15:43:38 +02:00
parent 3ed6400466
commit a5ec8db5f7
826 changed files with 214554 additions and 0 deletions
+153
View File
@@ -0,0 +1,153 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* FrUtils.c
*
* MLA - 4/14/95
*
* Contiains Mac specific utils for the renderer (fast draw slot view, full screen, etc.)
*
*/
#include "FrUtils.h"
#include "gr2ss.h"
#include "Shock.h"
#include "2d.h"
// ------------------
// GLOBALS
// ------------------
//Handle gDoubleSizeOffHdl = NULL;
grs_canvas gDoubleSizeOffCanvas;
//---------------------------------------------------------------------
// Allocate the intermediate offscreen buffer for low-res mode in Shock.
//---------------------------------------------------------------------
/*
int AllocDoubleBuffer(int w, int h) {
#if 1
STUB_ONCE("");
return 0;
#else
Size dummy;
FreeDoubleBuffer(); // If one's there, free it first.
if (h == 259) // Major Hack!!! In slot view, the double
h++; // buffer needs to be 260 (even number).
MaxMem(&dummy); // Compact heap before big alloc.
gDoubleSizeOffHdl = NewHandle(w * h); // Allocate new buffer.
if (gDoubleSizeOffHdl) // If successful, make a canvas for it.
{
HLockHi(gDoubleSizeOffHdl);
gr_init_canvas(&gDoubleSizeOffCanvas, (uchar *)*gDoubleSizeOffHdl, BMT_FLAT8, w, h);
return 1;
} else
return 0;
#endif
}
*/
//---------------------------------------------------------------------
//---------------------------------------------------------------------
/*
void FreeDoubleBuffer(void) {
if (gDoubleSizeOffHdl) // If there's a buffer,
{
HUnlock(gDoubleSizeOffHdl);
DisposeHandle(gDoubleSizeOffHdl); // free it.
gDoubleSizeOffHdl = NULL;
}
}
*/
// hard coded to copy from 56,57 to 56+536,57+259 to the screen
#define kFastSlotWide 536
#define kFastSlotHigh 259
#define kFastSlotLeft 28
#define kFastSlotTop 24
#define kFastSlotWide_Half 268
#define kFastSlotHigh_Half 129
#define LoadStoreTwoDoub(a, b) \
doub1 = src[a]; \
doub2 = src[b]; \
dest[a] = doub1; \
dest[b] = doub2;
// copy the slot view from offscreen to on
void Fast_Slot_Copy(grs_bitmap *bm) {
gr_bitmap(bm, SCONV_X(kFastSlotLeft), SCONV_Y(kFastSlotTop));
}
// copy the full screen view from offscreen to on
// hard coded to copy from 0,0 to 640,480 to the screen
void Fast_FullScreen_Copy(grs_bitmap *bm) { gr_bitmap(bm, 0, 0); }
//=================================================================
// Doubling routines
extern bool SkipLines;
// copy the slot view from offscreen to on, doubling it
// extern "C"
//{
//extern void BlitLargeAlign(uchar *draw_buffer, int dstRowBytes, void *dstPtr, long w, long h, long modulus);
//extern void BlitLargeAlignSkip(uchar *draw_buffer, int dstRowBytes, void *dstPtr, long w, long h, long modulus);
//}
/*
void Fast_Slot_Double(grs_bitmap *bm, long w, long h) {
if (!SkipLines)
BlitLargeAlign(bm->bits, gScreenRowbytes, gScreenAddress + (kFastSlotTop * gScreenRowbytes) + kFastSlotLeft, w,
h, bm->row);
else
BlitLargeAlignSkip(bm->bits, gScreenRowbytes, gScreenAddress + (kFastSlotTop * gScreenRowbytes) + kFastSlotLeft,
w, h, bm->row);
}
*/
void FastSlotDouble2Canvas(grs_bitmap *bm, grs_canvas *destCanvas, long w, long h) {
if (SkipLines) {
gr_clear(0xFF);
// BlitLargeAlignSkip(bm->bits, destCanvas->bm.row, destCanvas->bm.bits, w, h + 1, bm->row);
} else {
// BlitLargeAlign(bm->bits, destCanvas->bm.row, destCanvas->bm.bits, w, h + 1, bm->row);
}
}
// copy the full screen view from offscreen to on
// hard coded to copy from 0,0 to 640,480 to the screen
/*
void Fast_FullScreen_Double(grs_bitmap *bm, long w, long h) {
if (!SkipLines)
BlitLargeAlign(bm->bits, gScreenRowbytes, gScreenAddress, w, h, bm->row);
else
BlitLargeAlignSkip(bm->bits, gScreenRowbytes, gScreenAddress, w, h, bm->row);
}
*/
void FastFullscreenDouble2Canvas(grs_bitmap *bm, grs_canvas *destCanvas, long w, long h) {
if (SkipLines) {
gr_clear(0xFF);
// BlitLargeAlignSkip(bm->bits, destCanvas->bm.row, destCanvas->bm.bits, w, h + 1, bm->row);
} else {
// BlitLargeAlign(bm->bits, destCanvas->bm.row, destCanvas->bm.bits, w, h + 1, bm->row);
}
}
+33
View File
@@ -0,0 +1,33 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// externs for functions in FrUtils.C
extern void Fast_Slot_Copy(grs_bitmap *bm);
extern void Fast_FullScreen_Copy(grs_bitmap *bm);
// extern void Fast_Slot_Double(grs_bitmap *bm, long w, long h);
// extern void Fast_FullScreen_Double(grs_bitmap *bm, long w, long h);
void FastSlotDouble2Canvas(grs_bitmap *bm, grs_canvas *destCanvas, long w, long h);
void FastFullscreenDouble2Canvas(grs_bitmap *bm, grs_canvas *destCanvas, long w, long h);
// Stuff for the low-res temporary offscreen buffer.
extern grs_canvas gDoubleSizeOffCanvas;
// int AllocDoubleBuffer(int w, int h);
// void FreeDoubleBuffer(void);
+103
View File
@@ -0,0 +1,103 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __AI_H
#define __AI_H
/*
* $Source: n:/project/cit/src/inc/RCS/ai.h $
* $Revision: 1.22 $
* $Author: xemu $
* $Date: 1994/06/21 02:14:10 $
*
*
*/
// Includes
#include "objects.h"
// Defines
#define NUM_AI_MOODS 5
#define AI_MOOD_FRIENDLY 0
#define AI_MOOD_NEUTRAL 1
#define AI_MOOD_HOSTILE 2
#define AI_MOOD_ISOLATION 3
#define AI_MOOD_ATTACKING 4
#define NUM_AI_ORDERS 6
#define AI_ORDERS_GUARD 0 // hang out until player comes around
#define AI_ORDERS_ROAM 1 // wander about
#define AI_ORDERS_SLEEP 2 // do nothing ever until awakened
#define AI_ORDERS_PATROL 3 // back n forth between 2 points
#define AI_ORDERS_HIGHWAY 4 // follow invisible highway
#define AI_ORDERS_NOMOVE 5 // like guard, but will never move
#define AI_FLAG_NONE 0x00
#define AI_FLAG_FLYING 0x01 // we can fly
#define AI_FLAG_NOALERT 0x02 // don't speed up reaction when in combat
#define AI_FLAG_SMALL 0x04 // for musicai
#define SPREAD_DIST 2
#define SLOW_PROJECTILE_DURATION 1000
#define SLOW_PROJECTILE_GRAVITY fix_make(0,0x0C00)
// Macros
// Prototypes
errtype set_posture_safe(ObjSpecID osid, ubyte new_pos);
errtype set_posture_movesafe(ObjSpecID osid, ubyte new_pos);
errtype clear_critter_controls(ObjSpecID osid);
errtype apply_EDMS_controls(ObjSpecID osid);
errtype roll_on_dnd_treasure_tables(int *pcont, char treasure_type);
// External Functions:
// Let all the AI system spend time figuring out what to do. Those AIs that know what they are doing,
// do it, others plan, the time load is hopefully distributed as nicely as possible
errtype ai_run(void);
// What do do when we are hit
errtype ai_critter_hit(ObjSpecID osid, short damage, uchar tranq, uchar stun);
// When we pretend that we're dead (pretend we're dead)
errtype ai_critter_die(ObjSpecID osid);
errtype ai_critter_really_dead(ObjSpecID osid);
// actually do attack
errtype ai_attack_player(ObjSpecID osid, char a);
errtype ai_fire_special(ObjID src, ObjID target, int proj_triple, ObjLoc src_loc, ObjLoc target_loc, uchar a,
int duration);
// Change a critter's posture, and do appropriate
// things to other anim variables
errtype set_posture(ObjSpecID osid, ubyte new_pos);
// Looting.
errtype do_regular_loot(ObjSpecID source_critter, ObjID corpse);
errtype do_random_loot(ObjID corpse);
void ai_find_player(ObjID id);
void ai_critter_seen(void);
void ai_misses(ObjSpecID osid);
// Globals
#endif // __AI_H
+25
View File
@@ -0,0 +1,25 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define AI_FLAG_CHASING 0x0001
#define AI_FLAG_NOLOOT 0x0002
#define AI_FLAG_CONFUSED 0x0004
#define AI_FLAG_TRANQ 0x0010
#define ai_critter_sleeping(osid) \
((objCritters[(osid)].orders == AI_ORDERS_SLEEP) || (objCritters[(osid)].flags & AI_FLAG_TRANQ))
+26
View File
@@ -0,0 +1,26 @@
/*
Copyright (C) 2020 Shockolate Project
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef AIRUPT_H
#define AIRUPT_H
errtype check_asynch_ai(uchar new_score_ok);
void grind_music_ai(void);
#endif
+123
View File
@@ -0,0 +1,123 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __AMAP_H
#define __AMAP_H
// header for the real infernal automap
// defines
#define AMAP_PURE_MODE 0x0000
#define AMAP_INT_WALLS 0x0001
#define AMAP_SHOW_CRIT 0x0002
#define AMAP_SHOW_ROB 0x0004
#define AMAP_SHOW_HAZ 0x0008
#define AMAP_SHOW_FLR 0x0010
#define AMAP_SHOW_MSG 0x0020
#define AMAP_SHOW_HGT 0x0040
#define AMAP_TRACK_OBJ 0x0080
#define AMAP_SHOW_SEC 0x0100
#define AMAP_FULL_MSG 0x0200
#define AMAP_SHOW_ALL 0x0400
#define AMAP_SHOW_SENS 0x0800
#define AMAP_AVAIL_ALWAYS (AMAP_SHOW_SENS | AMAP_SHOW_FLR | AMAP_FULL_MSG)
#define AMAP_SET 1
#define AMAP_UNSET 0
#define AMAP_TOGGLE -1
#define AMAP_PAN_N 1
#define AMAP_PAN_E 2
#define AMAP_PAN_S 3
#define AMAP_PAN_W 4
#define AMAP_DEF_DST 0x40000
#define AMAP_MAX_ZOOM 6
#define AMAP_MIN_ZOOM 1
#define AMAP_OFF_MAP 0
#define AMAP_HAVE_NOTE 1
#define AMAP_NO_NOTE 2
// really should live in the player structure....
typedef struct {
uchar init;
uchar zoom;
int xf, yf;
ushort lw, lh;
ushort obj_to_follow, sensor_obj;
ushort note_obj;
ushort flags;
ushort avail_flags;
uchar version_id;
ushort sensor_rad; // in obj coords
} curAMap;
// prototypes
uchar amap_kb_callback(curAMap *amptr, int code);
void amap_draw(curAMap *amptr, int expose);
void amap_version_set(int id, int new_ver);
void automap_init(int version, int id);
void amap_invalidate(int id);
uchar amap_flags(curAMap *amptr, int flags, int set); // set -1 to toggle
uchar amap_zoom(curAMap *amptr, uchar set, int zoom_delta);
void amap_pan(curAMap *amptr, int dir, int *dist);
uchar amap_get_note(curAMap *amptr, char *buf);
void amap_pixratio_set(fix ratio);
void amap_settings_copy(curAMap *from, curAMap *to);
grs_bitmap *screen_automap_bitmap(char which_amap);
// this is a mess
// it modifies x and y to be map location of click
// returns null if off map, (void*)mapelemptr if within map
// sets amptr->note_obj to the note if found, else OBJ_NULL
void *amap_deal_with_map_click(curAMap *amptr, int *x, int *y);
// strings
void amap_str_init(void);
char *amap_str_next(void);
void amap_str_grab(char *str);
int amap_str_deref(char *str);
char *amap_str_reref(int offs);
void amap_str_delete(char *toast_str);
void amap_str_startup(int magic_num);
#define MFD_FULLSCR_MAP 2
#define NUM_O_AMAP MFD_FULLSCR_MAP + 1
// globals
// for now
#define oAMap(mid) (&(level_gamedata.auto_maps[mid]))
//#define oAMap(mid) (auto_maps[mid])
#define amap_reset() \
do { \
int i; \
for (i = 0; i < NUM_O_AMAP; i++) \
amap_invalidate(i); \
} while (0)
#define amap_note_value(objid) (objTraps[objs[objid].specID].p4)
#define amap_note_string(objid) (amap_str_reref(amap_note_value(objid)))
#define AMAP_STRING_SIZE 2048
#endif
+38
View File
@@ -0,0 +1,38 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* $Source: n:/project/cit/src/inc/RCS/amaploop.h $
* $Revision: 1.1 $
* $Author: dc $
* $Date: 1994/04/06 07:27:10 $
*/
#include "amap.h"
#define AMAP_FULLEXPOSE (LL_CHG_BASE << 1)
#define AMAP_MAP_EV (LL_CHG_BASE << 2)
#define AMAP_BUTTON_EV (LL_CHG_BASE << 3)
#define AMAP_MESSAGE_EV (LL_CHG_BASE << 4)
uchar amap_ms_callback(curAMap *amptr, int x, int y, short action, ubyte but);
uchar amap_scroll_handler(uiEvent *ev, LGRegion *r, intptr_t user_data);
void automap_loop(void);
char *fsmap_get_lev_str(char *buf, int siz);
void fsmap_startup(void);
void fsmap_free(void);
+29
View File
@@ -0,0 +1,29 @@
/*
Copyright (C) 2020 Shockolate Project
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef AMMOMFD_H
#define AMMOMFD_H
#include "event.h"
#include "mfdint.h"
void mfd_ammo_expose(ubyte control);
uchar mfd_ammo_handler(MFD *m, uiEvent *ev);
#endif
+80
View File
@@ -0,0 +1,80 @@
#ifndef ANIM_H
#define ANIM_H
#include <rect.h>
//#include <llist.h>
#include <res.h>
#include <2d.h>
#include <2dres.h>
#include <fix.h>
// Animation event codes
typedef uchar AnimCode;
#define ANCODE_NEWFRAME 0x01 // new frame, update screen
#define ANCODE_END 0x04 // end anim w/o kill (no arg)
#define ANCODE_KILL 0x08 // kill anim (no arg)
typedef struct {
uchar unknown;
uchar frameRunStart;
uchar frameRunEnd;
fix frameDelay;
} AnimCodeData;
typedef struct {
LGPoint size; // size of anim
Id frameSetId; // resource id of binary frame set
uchar unknown1[6];
short unknown2;
AnimCodeData data[];
} AnimHead;
// ActAnim: describes an active animation record
typedef struct ActAnim_ {
LGRegion *reg;
AnimHead *pah; // ptr to animation header
LGPoint loc;
grs_canvas cnv;
void (*notifyFunc) (struct ActAnim_ *paa, AnimCode ancode, AnimCodeData *animData); // owner evt handler
void (*composeFunc) (LGRect *area, ubyte flags); // owner compose handler
Ref currFrameRef; // current frame ref
int curSeq;
int frameNum;
fix animRate; // animation rate
ulong timeContinue; // time at which to advance to next step
void *dataBuffer; // data buffer to use for frames, or NULL
long dataBufferLen; // length of data buffer
} ActAnim;
// General prototypes: anim.c
void AnimRecur(); // update animations in progress
// Play and control anims: anim.c
ActAnim *AnimPlayRegion(Ref animRef, LGRegion *region, LGPoint loc, char unknown, // play anim into canvas
void (*composeFunc)(LGRect *area, ubyte flags));
void AnimKill(ActAnim *paa); // kill one or all anims
void AnimSetNotify(ActAnim *paa, void *powner, AnimCode mask,
void (*func) (ActAnim *, AnimCode ancode, AnimCodeData *animData));
// Deal with animation resources: anim.c
bool AnimPreloadFrames(ActAnim *paa, Ref animRef); // preload an anim's frames
// Macro to read anim header from resource
#define AnimReadHeader(ref,pAnhead) (*pAnhead = (* ((AnimHead *) RefGet(ref))));
// Convenience macros
#define AnimSetDataBuffer(paa, buffer) { \
(paa)->dataBuffer = (buffer); (paa)->dataBufferLen = 0x7FFFFFFFL; }
#define AnimSetDataBufferSafe(paa, buffer, len) { \
(paa)->dataBuffer = (buffer); (paa)->dataBufferLen = (len); }
#endif
@@ -0,0 +1,23 @@
#if !defined(ARCHIVEFORMAT_H)
#define ARCHIVEFORMAT_H
#include "res.h"
// A single 32-bit integer. A couple of resources are just a number.
extern const ResourceFormat U32Format;
#define FORMAT_U32 (&U32Format)
// The schedules have fixed resource IDs and do not form part of the main
// archive tables.
extern const ResourceFormat ScheduleFormat;
#define FORMAT_SCHEDULE (&ScheduleFormat)
extern const ResourceFormat ScheduleQueueFormat;
#define FORMAT_SCHEDULE_QUEUE (&ScheduleQueueFormat)
// Master tables for level archives.
#define MAX_LEVEL_INDEX 51 // based from xx02; level resources go up to xx53
extern const ResourceFormat LevelVersion11Format[MAX_LEVEL_INDEX+1];
extern const ResourceFormat LevelVersion12Format[MAX_LEVEL_INDEX+1];
#endif // !defined(ARCHIVEFORMAT_H)
+36
View File
@@ -0,0 +1,36 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* $Source: r:/prj/cit/src/inc/RCS/audiolog.h $
* $Revision: 1.4 $
* $Author: dc $
* $Date: 1994/11/19 20:44:42 $
*/
//#include "error.h"
//#include "lg.h"
extern errtype audiolog_init();
extern errtype audiolog_play(int email_id);
extern errtype audiolog_bark_play(int bark_id);
extern void audiolog_stop();
extern errtype audiolog_loop_callback();
extern bool audiolog_playing(int email_id);
extern uchar audiolog_setting;
+106
View File
@@ -0,0 +1,106 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __AUTOMAP_H
#define __AUTOMAP_H
/*
* $Source: q:/inc/RCS/automap.h $
* $Revision: 1.5 $
* $Author: xemu $
* $Date: 1993/09/02 23:06:30 $
*
* $Log: automap.h $
* Revision 1.5 1993/09/02 23:06:30 xemu
* angle me baby
*
* Revision 1.4 1993/08/09 20:45:21 spaz
* Changed some #define's.
*
*
* Revision 1.3 1993/08/09 14:33:12 mahk
* Fixed syntax errors
*
* Revision 1.2 1993/08/09 13:27:47 spaz
* Linked automap stub functions to the MFD system.
*
* Revision 1.1 1993/05/03 11:51:58 xemu
* Initial revision
*
*
*/
// Includes
#include "rect.h"
// C Library Includes
// System Library Includes
// Master Game Includes
// Game Library Includes
// Game Object Includes
// Defines
typedef struct _AutoText {
char *letters;
LGPoint coordinate;
int color;
struct _AutoText *next_entry;
} AutoText;
#define AUTOMAP_TERRAIN 0x0001
#define AUTOMAP_ELEVATION 0x0002
#define AUTOMAP_SECURITY 0x0004
#define AUTOMAP_CRITTERS 0x0008
#define AUTOMAP_INFORMATION 0x0010
#define AUTOMAP_ALIGNMENT 0x0020
#define AUTOMAP_ZOOMIN_X 16
#define AUTOMAP_ZOOMIN_Y 16
#define AUTOMAP_ZOOMOUT_X 32
#define AUTOMAP_ZOOMOUT_Y 32
// Prototypes
// Specify which level is the "current" automap level for viewing
errtype automap_current(int level);
// Set what kinds of information are shown by the automap
errtype automap_infotype(ulong map_info);
// Draw the automap, scaled to specified size, in the area with upper left corner
// as specified.
errtype automap_draw(int map_size, LGPoint ul_coord);
// Get a handle to a new text entry field on the automap, at specified coords
errtype automap_new_entry(LGPoint coord, AutoText *new_text);
// Delete a given text entry
errtype automap_delete_entry(AutoText *victim);
// Stubs for the MFD system
void mfd_map_expose(MFD *m, ubyte control);
errtype mfd_map_init(MFD_Func *);
uchar mfd_map_handler(MFD *m, uiEvent *e);
// Globals
#endif // __AUTOMAP_H
+55
View File
@@ -0,0 +1,55 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* $Source: r:/prj/cit/src/inc/RCS/bark.h $
* $Revision: 1.3 $
* $Author: tjs $
* $Date: 1994/08/02 13:56:04 $
*
* $Log: bark.h $
* Revision 1.3 1994/08/02 13:56:04 tjs
* Rescaled bark timeouts.
*
* Revision 1.2 1994/05/26 20:52:23 tjs
* Added null bark timeout
*
* Revision 1.1 1994/05/26 17:59:08 tjs
* Initial revision
*
*
*
*/
#ifndef BARK_H
#define BARK_H
#include "mfdint.h" // for MFD struct
#define MFD_BARK_FUNC 17
#define NULL_BARK_TIMEOUT 3
#define mfd_bark_string (*(int *)(&player_struct.mfd_func_data[MFD_BARK_FUNC][0]))
#define mfd_bark_speaker (*(ObjID *)(&player_struct.mfd_func_data[MFD_BARK_FUNC][sizeof(int)]))
#define mfd_bark_color (player_struct.mfd_func_data[MFD_BARK_FUNC][sizeof(int) + sizeof(ObjID)])
#define mfd_bark_mug (player_struct.mfd_func_data[MFD_BARK_FUNC][sizeof(int) + sizeof(ObjID) + sizeof(uchar)])
void mfd_bark_expose(MFD *mfd, ubyte control);
void long_bark(ObjID speaker_id, uchar mug_id, int string_id, ubyte color);
#endif
+31
View File
@@ -0,0 +1,31 @@
/*
Copyright (C) 2020 Shockolate Project
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BIOHELP_H
#define BIOHELP_H
#include "mfdint.h"
errtype biohelp_load_cursor();
errtype mfd_biohelp_init(MFD_Func *f);
void mfd_biohelp_expose(MFD *mfd, ubyte control);
uchar mfd_biohelp_handler(MFD *m, uiEvent *e);
#endif
+42
View File
@@ -0,0 +1,42 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __BIOTRAX_H
#define __BIOTRAX_H
/*
* $Source: n:/project/cit/src/inc/RCS/biotrax.h $
* $Revision: 1.1 $
* $Author: mahk $
* $Date: 1994/02/23 13:20:34 $
*
*/
// Defines
#define ENERGY_TRACK 0
#define BIOHAZARD_TRACK (ENERGY_TRACK + 1)
#define RADIATION_TRACK (BIOHAZARD_TRACK + 1)
#define LOOPLINE_TRACK (RADIATION_TRACK + 1)
#define HEART_TRACK (NUM_BIO_TRACKS - 2)
#define SINE_TRACK (NUM_BIO_TRACKS - 1)
// Prototypes
// Globals
#endif // __BIOTRAX_H
+32
View File
@@ -0,0 +1,32 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __CANVCHEK_H
#define __CANVCHEK_H
/*
* $Source: r:/prj/cit/src/inc/RCS/canvchek.h $
* $Revision: 1.1 $
* $Author: mahk $
* $Date: 1994/11/09 20:44:24 $
*
*/
#define is_onscreen() (grd_canvas != NULL && grd_canvas->bm.type == BMT_DEVICE)
#endif // __CANVCHEK_H
+25
View File
@@ -0,0 +1,25 @@
/*
Copyright (C) 2020 Shockolate Project
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CARDMFD_H
#define CARDMFD_H
void mfd_accesscard_expose(MFD *mfd, ubyte control);
#endif
+49
View File
@@ -0,0 +1,49 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __CIT2D_H
#define __CIT2D_H
/*
* $Source: r:/prj/cit/src/inc/RCS/cit2d.h $
* $Revision: 1.4 $
* $Author: mahk $
* $Date: 1994/08/18 17:20:17 $
*
*/
// Stuff that we wish the 2d had, but is too cool.
#define FONT_IS_MONO(fontptr) ((fontptr)->id != 0xCCCC)
void draw_shadowed_string(char *s, short x, short y, uchar shadow);
#ifdef BROKEN_SAFE_CLIPRECT
#define safe_set_cliprect(a, b, c, d) \
do { \
short _safe_x = a; \
short _safe_y = b; \
short _safe_p = c; \
short _safe_q = d; \
gr_safe_set_cliprect(_safe_x, _safe_y, _safe_p, _safe_q); \
} while (0)
#else
#define safe_set_cliprect(a, b, c, d) gr_safe_set_cliprect(a, b, c, d)
#endif
#endif // __CIT2D_H
+143
View File
@@ -0,0 +1,143 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* This file created by RESTOOL */
#ifndef __CITALOG_H
#define __CITALOG_H
#define RES_alog_email0 0xab5 // (2741)
#define RES_alog_email1 0xab6 // (2742)
#define RES_alog_email2 0xab7 // (2743)
#define RES_alog_email3 0xab8 // (2744)
#define RES_alog_email4 0xab9 // (2745)
#define RES_alog_email5 0xaba // (2746)
#define RES_alog_email6 0xabb // (2747)
#define RES_alog_email7 0xabc // (2748)
#define RES_alog_email8 0xabd // (2749)
#define RES_alog_email9 0xabe // (2750)
#define RES_alog_email10 0xabf // (2751)
#define RES_alog_email11 0xac0 // (2752)
#define RES_alog_email12 0xac1 // (2753)
#define RES_alog_email13 0xac2 // (2754)
#define RES_alog_email14 0xac3 // (2755)
#define RES_alog_email15 0xac4 // (2756)
#define RES_alog_email16 0xac5 // (2757)
#define RES_alog_email17 0xac6 // (2758)
#define RES_alog_email18 0xac7 // (2759)
#define RES_alog_email19 0xac8 // (2760)
#define RES_alog_email20 0xac9 // (2761)
#define RES_alog_email21 0xaca // (2762)
#define RES_alog_email22 0xacb // (2763)
#define RES_alog_email23 0xacc // (2764)
#define RES_alog_email24 0xacd // (2765)
#define RES_alog_email25 0xace // (2766)
#define RES_alog_email26 0xacf // (2767)
#define RES_alog_email27 0xad0 // (2768)
#define RES_alog_email28 0xad1 // (2769)
#define RES_alog_email29 0xad2 // (2770)
#define RES_alog_log00 0xae4 // (2788)
#define RES_alog_log01 0xae5 // (2789)
#define RES_alog_log02 0xae6 // (2790)
#define RES_alog_log03 0xae7 // (2791)
#define RES_alog_log04 0xae8 // (2792)
#define RES_alog_log05 0xae9 // (2793)
#define RES_alog_log10 0xaf4 // (2804)
#define RES_alog_log11 0xaf5 // (2805)
#define RES_alog_log12 0xaf6 // (2806)
#define RES_alog_log13 0xaf7 // (2807)
#define RES_alog_log14 0xaf8 // (2808)
#define RES_alog_log15 0xaf9 // (2809)
#define RES_alog_log16 0xafa // (2810)
#define RES_alog_log17 0xafb // (2811)
#define RES_alog_log18 0xafc // (2812)
#define RES_alog_log19 0xafd // (2813)
#define RES_alog_log110 0xafe // (2814)
#define RES_alog_log111 0xaff // (2815)
#define RES_alog_log112 0xb00 // (2816)
#define RES_alog_log113 0xb01 // (2817)
#define RES_alog_log114 0xb02 // (2818)
#define RES_alog_log115 0xb03 // (2819)
#define RES_alog_log20 0xb04 // (2820)
#define RES_alog_log21 0xb05 // (2821)
#define RES_alog_log22 0xb06 // (2822)
#define RES_alog_log23 0xb07 // (2823)
#define RES_alog_log24 0xb08 // (2824)
#define RES_alog_log25 0xb09 // (2825)
#define RES_alog_log26 0xb0a // (2826)
#define RES_alog_log27 0xb0b // (2827)
#define RES_alog_log28 0xb0c // (2828)
#define RES_alog_log29 0xb0d // (2829)
#define RES_alog_log210 0xb0e // (2830)
#define RES_alog_log211 0xb0f // (2831)
#define RES_alog_log212 0xb10 // (2832)
#define RES_alog_log30 0xb14 // (2836)
#define RES_alog_log31 0xb15 // (2837)
#define RES_alog_log32 0xb16 // (2838)
#define RES_alog_log33 0xb17 // (2839)
#define RES_alog_log34 0xb18 // (2840)
#define RES_alog_log35 0xb19 // (2841)
#define RES_alog_log36 0xb1a // (2842)
#define RES_alog_log37 0xb1b // (2843)
#define RES_alog_log38 0xb1c // (2844)
#define RES_alog_log40 0xb24 // (2852)
#define RES_alog_log41 0xb25 // (2853)
#define RES_alog_log42 0xb26 // (2854)
#define RES_alog_log43 0xb27 // (2855)
#define RES_alog_log44 0xb28 // (2856)
#define RES_alog_log45 0xb29 // (2857)
#define RES_alog_log46 0xb2a // (2858)
#define RES_alog_log50 0xb34 // (2868)
#define RES_alog_log51 0xb35 // (2869)
#define RES_alog_log52 0xb36 // (2870)
#define RES_alog_log53 0xb37 // (2871)
#define RES_alog_log54 0xb38 // (2872)
#define RES_alog_log55 0xb39 // (2873)
#define RES_alog_log56 0xb3a // (2874)
#define RES_alog_log57 0xb3b // (2875)
#define RES_alog_log58 0xb3c // (2876)
#define RES_alog_log59 0xb3d // (2877)
#define RES_alog_log510 0xb3e // (2878)
#define RES_alog_log511 0xb3f // (2879)
#define RES_alog_log60 0xb44 // (2884)
#define RES_alog_log61 0xb45 // (2885)
#define RES_alog_log62 0xb46 // (2886)
#define RES_alog_log63 0xb47 // (2887)
#define RES_alog_log64 0xb48 // (2888)
#define RES_alog_log65 0xb49 // (2889)
#define RES_alog_log66 0xb4a // (2890)
#define RES_alog_log67 0xb4b // (2891)
#define RES_alog_log68 0xb4c // (2892)
#define RES_alog_log69 0xb4d // (2893)
#define RES_alog_log70 0xb54 // (2900)
#define RES_alog_log71 0xb55 // (2901)
#define RES_alog_log72 0xb56 // (2902)
#define RES_alog_log73 0xb57 // (2903)
#define RES_alog_log74 0xb58 // (2904)
#define RES_alog_log75 0xb59 // (2905)
#define RES_alog_log76 0xb5a // (2906)
#define RES_alog_log77 0xb5b // (2907)
#define RES_alog_log78 0xb5c // (2908)
#define RES_alog_log80 0xb64 // (2916)
#define RES_alog_log81 0xb65 // (2917)
#define RES_alog_log82 0xb66 // (2918)
#define RES_alog_log83 0xb67 // (2919)
#define RES_alog_log84 0xb68 // (2920)
#define RES_alog_log85 0xb69 // (2921)
#endif
+132
View File
@@ -0,0 +1,132 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* This file created by RESTOOL */
#ifndef __CITBARK_H
#define __CITBARK_H
#define RES_alog_bark0 0xc1c // (3100)
#define RES_alog_bark1 0xc1d // (3101)
#define RES_alog_bark2 0xc1e // (3102)
#define RES_alog_bark3 0xc1f // (3103)
#define RES_alog_bark4 0xc20 // (3104)
#define RES_alog_bark5 0xc21 // (3105)
#define RES_alog_bark6 0xc22 // (3106)
#define RES_alog_bark7 0xc23 // (3107)
#define RES_alog_bark8 0xc24 // (3108)
#define RES_alog_bark9 0xc25 // (3109)
#define RES_alog_bark10 0xc26 // (3110)
#define RES_alog_bark11 0xc27 // (3111)
#define RES_alog_bark12 0xc28 // (3112)
#define RES_alog_bark13 0xc29 // (3113)
#define RES_alog_bark14 0xc2a // (3114)
#define RES_alog_bark15 0xc2b // (3115)
#define RES_alog_bark16 0xc2c // (3116)
#define RES_alog_bark17 0xc2d // (3117)
#define RES_alog_bark18 0xc2e // (3118)
#define RES_alog_bark19 0xc2f // (3119)
#define RES_alog_bark20 0xc30 // (3120)
#define RES_alog_bark21 0xc31 // (3121)
#define RES_alog_bark22 0xc32 // (3122)
#define RES_alog_bark23 0xc33 // (3123)
#define RES_alog_bark24 0xc34 // (3124)
#define RES_alog_bark25 0xc35 // (3125)
#define RES_alog_bark26 0xc36 // (3126)
#define RES_alog_bark27 0xc37 // (3127)
#define RES_alog_bark28 0xc38 // (3128)
#define RES_alog_bark29 0xc39 // (3129)
#define RES_alog_bark30 0xc3a // (3130)
#define RES_alog_bark31 0xc3b // (3131)
#define RES_alog_bark32 0xc3c // (3132)
#define RES_alog_bark33 0xc3d // (3133)
#define RES_alog_bark34 0xc3e // (3134)
#define RES_alog_bark35 0xc3f // (3135)
#define RES_alog_bark36 0xc40 // (3136)
#define RES_alog_bark37 0xc41 // (3137)
#define RES_alog_bark38 0xc42 // (3138)
#define RES_alog_bark39 0xc43 // (3139)
#define RES_alog_bark40 0xc44 // (3140)
#define RES_alog_bark41 0xc45 // (3141)
#define RES_alog_bark42 0xc46 // (3142)
#define RES_alog_bark43 0xc47 // (3143)
#define RES_alog_bark44 0xc48 // (3144)
#define RES_alog_bark45 0xc49 // (3145)
#define RES_alog_bark46 0xc4a // (3146)
#define RES_alog_bark47 0xc4b // (3147)
#define RES_alog_bark48 0xc4c // (3148)
#define RES_alog_bark49 0xc4d // (3149)
#define RES_alog_bark50 0xc4e // (3150)
#define RES_alog_bark51 0xc4f // (3151)
#define RES_alog_bark52 0xc50 // (3152)
#define RES_alog_bark53 0xc51 // (3153)
#define RES_alog_bark54 0xc52 // (3154)
#define RES_alog_bark55 0xc53 // (3155)
#define RES_alog_bark56 0xc54 // (3156)
#define RES_alog_bark57 0xc55 // (3157)
#define RES_alog_bark58 0xc56 // (3158)
#define RES_alog_bark59 0xc57 // (3159)
#define RES_alog_bark60 0xc58 // (3160)
#define RES_alog_bark61 0xc59 // (3161)
#define RES_alog_bark62 0xc5a // (3162)
#define RES_alog_bark63 0xc5b // (3163)
#define RES_alog_bark64 0xc5c // (3164)
#define RES_alog_bark65 0xc5d // (3165)
#define RES_alog_bark66 0xc5e // (3166)
#define RES_alog_bark67 0xc5f // (3167)
#define RES_alog_bark68 0xc60 // (3168)
#define RES_alog_bark69 0xc61 // (3169)
#define RES_alog_bark70 0xc62 // (3170)
#define RES_alog_bark71 0xc63 // (3171)
#define RES_alog_bark72 0xc64 // (3172)
#define RES_alog_bark73 0xc65 // (3173)
#define RES_alog_bark74 0xc66 // (3174)
#define RES_alog_bark75 0xc67 // (3175)
#define RES_alog_bark76 0xc68 // (3176)
#define RES_alog_bark77 0xc69 // (3177)
#define RES_alog_bark78 0xc6a // (3178)
#define RES_alog_bark79 0xc6b // (3179)
#define RES_alog_bark80 0xc6c // (3180)
#define RES_alog_bark81 0xc6d // (3181)
#define RES_alog_bark82 0xc6e // (3182)
#define RES_alog_bark83 0xc6f // (3183)
#define RES_alog_bark84 0xc70 // (3184)
#define RES_alog_bark85 0xc71 // (3185)
#define RES_alog_bark86 0xc72 // (3186)
#define RES_alog_bark87 0xc73 // (3187)
#define RES_alog_bark88 0xc74 // (3188)
#define RES_alog_bark89 0xc75 // (3189)
#define RES_alog_bark90 0xc76 // (3190)
#define RES_alog_bark91 0xc77 // (3191)
#define RES_alog_bark92 0xc78 // (3192)
#define RES_alog_bark93 0xc79 // (3193)
#define RES_alog_bark94 0xc7a // (3194)
#define RES_alog_bark95 0xc7b // (3195)
#define RES_alog_bark96 0xc7c // (3196)
#define RES_alog_bark97 0xc7d // (3197)
#define RES_alog_bark98 0xc7e // (3198)
#define RES_alog_bark99 0xc7f // (3199)
#define RES_alog_bark100 0xc80 // (3200)
#define RES_alog_bark101 0xc81 // (3201)
#define RES_alog_bark102 0xc82 // (3202)
#define RES_alog_bark103 0xc83 // (3203)
#define RES_alog_bark104 0xc84 // (3204)
#define RES_alog_bark105 0xc85 // (3205)
#define RES_alog_bark106 0xc86 // (3206)
#endif
+28
View File
@@ -0,0 +1,28 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* This file created by RESTOOL */
#ifndef __CITMAT_H
#define __CITMAT_H
#define RES_smallTextureMaps 0x141 // (321)
#define RES_materialMaps 0x1db // (475)
#define RES_customTextureMaps 0x884 // (2180)
#endif
+55
View File
@@ -0,0 +1,55 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __CITRES_H
#define __CITRES_H
/*
* $Source: r:/prj/cit/src/inc/RCS/citres.h $
* $Revision: 1.8 $
* $Author: mahk $
* $Date: 1994/09/01 18:31:03 $
*
*/
// Includes
// Defines
// Typedefs
// Prototypes
#define lock_bitmap_from_ref(r) lock_bitmap_from_ref_anchor(r, NULL)
grs_bitmap *lock_bitmap_from_ref_anchor(Ref r, LGRect *anchor);
#define get_bitmap_from_ref(r) get_bitmap_from_ref_anchor(r, NULL)
grs_bitmap *get_bitmap_from_ref_anchor(Ref r, LGRect *anchor);
errtype load_bitmap_from_res(grs_bitmap *bmp, Id id_num, int i, uchar transp, LGRect *anchor);
// loads in a bitmap or a bitmap cursor, malloc'ing the bits
// field.
errtype simple_load_res_bitmap(grs_bitmap *bmp, Ref rid);
errtype simple_load_res_bitmap_cursor(LGCursor *c, grs_bitmap *bmp, Ref rid);
// loads a bitmap, specifying whether to malloc the bits or not.
errtype load_res_bitmap(grs_bitmap *bmp, Ref rid, uchar alloc);
errtype load_res_bitmap_cursor(LGCursor *c, grs_bitmap *bmp, Ref rid, uchar alloc);
errtype load_hires_bitmap_cursor(LGCursor *c, grs_bitmap *bmp, Ref rid, uchar alloc);
// Globals
#endif // __CITRES_H
+45
View File
@@ -0,0 +1,45 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __COLORS_H
#define __COLORS_H
/*
* $Source: n:/project/cit/src/inc/RCS/colors.h $
* $Revision: 1.3 $
* $Author: dc $
* $Date: 1993/10/18 03:28:38 $
*/
// Color defines for the Citadel Palette
#define PURPLE_BASE 0x20
#define TAN_BASE 0x29
#define RED_BASE 0x30
#define ORANGE_YELLOW_BASE 0x3d
#define GREEN_YELLOW_BASE 0x4b
#define GREEN_BASE 0x58
#define TURQUOISE_BASE 0x65
#define BLUE_BASE 0x70
#define RED_BROWN_BASE 0x7f
#define BROWN_BASE 0x83
#define TAN_GRAY_BASE 0xc0
#define GRAY_BASE 0xd0
#define BLACK 0x00
#define WHITE 0x02
#endif // __COLORS_H
+79
View File
@@ -0,0 +1,79 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __COMBAT_H
#define __COMBAT_H
/*
* $Source: r:/prj/cit/src/inc/RCS/combat.h $
* $Revision: 1.21 $
* $Author: minman $
* $Date: 1994/07/21 01:45:51 $
*
*
*/
// Includes
#include "objects.h"
#define RAYCAST_ATTACK_SIZE (fix_make(0, 0x0400))
#define NO_RAYCAST_KICKBACK_SPEED (fix_make(0, 0x0100))
// all temporary stuff
typedef struct {
fix x;
fix y;
fix z;
} Combat_Pt;
typedef struct {
fix dx;
fix dy;
fix dz;
Combat_Pt origin;
fix mass;
fix size;
fix speed;
fix range;
physics_handle exclusion;
} Combat_Ray;
// ******* RAYCAST FUNCTIONS *************
// the following ray_cast_* functions do the same thing, but allow for different types of input
// returns the first object hit, and returns OBJ_NULL, if ray does not hit any object
// does a ray cast from object src to the ObjLoc dest
ObjID ray_cast_attack(ObjID src, ObjLoc dest, fix bullet_mass, fix bullet_size, fix bullet_speed, fix bullet_range);
// does a ray cast between point src to point dest
ObjID ray_cast_points(ObjID exclusion, Combat_Pt src, Combat_Pt dest, fix bullet_mass, fix bullet_size,
fix bullet_speed, fix bullet_range);
// does a ray cast from point src in the direction of vector
// returns hit location at src
ObjID ray_cast_vector(ObjID exclusion, Combat_Pt *src, Combat_Pt vector, fix bullet_mass, fix bullet_size,
fix bullet_speed, fix bullet_range);
// does a ray cast from object src to object dest
ObjID ray_cast_objects(ObjID src, ObjID dest, fix bullet_mass, fix bullet_size, fix bullet_speed, fix bullet_range);
// given the point on the 3d view window, returns the vector in that direction to
// be used for ray_tracing
void find_fire_vector(LGPoint *pt, Combat_Pt *vector);
#endif // __COMBAT_H
+74
View File
@@ -0,0 +1,74 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __CONE_H
#define __CONE_H
/*
* $Source: n:/project/cit/src/inc/RCS/cone.h $
* $Revision: 1.8 $
* $Author: dc $
* $Date: 1994/01/02 17:15:58 $
*
* $Log: cone.h $
* Revision 1.8 1994/01/02 17:15:58 dc
* indoor terrain renderer
*
* Revision 1.7 1993/11/16 16:26:05 minman
* got rid of testing prototypes so there's not
* a depnedency on this file from menus.c
*
* Revision 1.6 1993/11/16 16:22:43 minman
* redid find_view_area prototype
*
* Revision 1.5 1993/10/19 19:40:08 minman
* added simple_cone_clip_pass
*
* Revision 1.4 1993/09/02 23:07:14 xemu
* angle me baby
*
* Revision 1.3 1993/07/01 01:03:52 minman
* added cone test
*
* Revision 1.2 1993/06/24 01:58:49 minman
* find_view_area takes a radius argument now
*
* Revision 1.1 1993/06/17 20:13:19 minman
* Initial revision
*
*
*/
// Includes
// finds the view area polygon - modifies first argument to become
// an array of fix points that represents the view area
// polygon is in clockwise order
// x,y order - *count is the number of points in the polygon.
// return TRUE if it's a valid polygon (not one or two points)
uchar find_view_area(fix *cone_list, fix fix_floor, fix fix_roof, int *count, fix radius);
// run the cone clip and render it.
void simple_cone_clip_pass(void);
extern fix span_lines[8];
extern byte span_index[2];
extern fix span_intersect[4];
#endif // __CONE_H
+52
View File
@@ -0,0 +1,52 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __CRITERR_H
#define __CRITERR_H
/*
* $Source: n:/project/cit/src/inc/RCS/criterr.h $
* $Revision: 1.3 $
* $Author: xemu $
* $Date: 1994/05/26 17:20:11 $
*
*/
// Defines
#define CRITERR_CLASSES 16
#define CRITERR_CODES 0x10000
#define CRITERR_CFG 0x1000 // config errors
#define CRITERR_RES 0x2000 // Resource errors
#define CRITERR_MEM 0x3000 // Out of memory
#define CRITERR_FILE 0x4000 // Misc file error
#define CRITERR_EXEC 0x5000 // execution error
#define CRITERR_MISC 0xF000 // miscellaneous/glitches
#define CRITERR_TEST 0x0000 // Test code
#define NO_CRITICAL_ERROR 0x0000
// Prototypes
void criterr_init(void);
// Initializes critical error system.
void critical_error(unsigned short code);
// Exits the program with error status, printing
// the error string for the specified code.
#endif // __CRITERR_H
+34
View File
@@ -0,0 +1,34 @@
#ifndef __CUTSLOOP_H
#define __CUTSLOOP_H
// Includes
// C Library Includes
// System Library Includes
// Master Game Includes
// Game Library Includes
// Game Object Includes
// Defines
// CC: These are all wrong, should find the right resource IDs
#define START_CUTSCENE 0
#define DEATH_CUTSCENE 1
#define WIN_CUTSCENE 2
#define ENDGAME_CUTSCENE 3
// Prototypes
void cutscene_loop(void);
void cutscene_start(void);
void cutscene_exit(void);
short play_cutscene(int id, bool show_credits);
// Globals
#endif // __CUTSLOOP_H
+59
View File
@@ -0,0 +1,59 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "player.h"
errtype exit_cyberspace_stuff();
errtype enter_cyberspace_stuff(char dest_level);
errtype early_exit_cyberspace_stuff();
errtype check_cspace_death();
#define NUM_CS_EFFECTS 3
#define CS_TURBO_EFF 0
#define CS_DECOY_EFF 1
#define CS_MATCHBOX_EFF 2
#define CYBER_DIFF (player_struct.difficulty[CYBER_DIFF_INDEX])
//#define BASE_CSPACE_TIME ((CYBER_DIFF == 0) ? (CIT_CYCLE * 3600) : ((CYBER_DIFF == 1) ? (CIT_CYCLE * 720) :
//(CIT_CYCLE * 360)))
#define BASE_CSPACE_TIME 1800 * CIT_CYCLE
#define CSPACE_MIN_TIME (CYBER_DIFF ? CIT_CYCLE * 90 : BASE_CSPACE_TIME)
#define CSPACE_MAX_TIME \
((CYBER_DIFF == 0) ? BASE_CSPACE_TIME \
: (CYBER_DIFF == 1) ? (BASE_CSPACE_TIME / 3) \
: (CYBER_DIFF == 2) ? (BASE_CSPACE_TIME / 6) : (BASE_CSPACE_TIME / 12))
// no time penalties at diff 0 and 1, harsh ones at 3
#define CSPACE_EXIT_PENALTY ((CYBER_DIFF <= 2) ? 0 : (CIT_CYCLE * 5))
#define CSPACE_DEATH_PENALTY ((CYBER_DIFF < 2) ? 0 : ((CYBER_DIFF == 2) ? (CIT_CYCLE * 3) : (CIT_CYCLE * 12)))
#define CSPACE_MUX_BONUS CIT_CYCLE * 30
#define CYBERMINE_DAMAGE 15
#define CYBERHEAL_QUANTITY 70
// Time until SHODAN appears to kick the player out of cyberspace.
extern uint32_t time_until_shodan_avatar;
extern void (*cspace_effect_turnoff[])(uchar, uchar);
extern ulong cspace_effect_times[NUM_CS_EFFECTS];
extern ulong cspace_effect_durations[NUM_CS_EFFECTS];
extern ObjID cspace_decoy_obj;
extern ObjLoc recall_objloc;
+28
View File
@@ -0,0 +1,28 @@
/*
Copyright (C) 2020 Shockolate Project
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CYBERMFD_H
#define CYBERMFD_H
#include "mfdint.h"
// The cyberspace MFD
void mfd_cspace_expose(MFD *mfd, ubyte control);
#endif
+64
View File
@@ -0,0 +1,64 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __CYBMEM_H
#define __CYBMEM_H
/*
* $Source: r:/prj/cit/src/inc/RCS/cybmem.h $
* $Revision: 1.23 $
* $Author: xemu $
* $Date: 1994/11/01 09:19:29 $
*
*/
// Defines
// Typedefs
// Prototypes
errtype load_dynamic_memory(int mask);
errtype free_dynamic_memory(int mask);
int avail_memory(int debug_src);
void Memory_Check();
int slorkatron_memory_check();
int flush_resource_cache(void);
// If LZW stuff ever gets lots more efficient, may need to raise this up some.
#define BIG_BUFFER_SIZE (LZW_BUFF_SIZE + 3)
#define MINIMUM_GAME_THRESHOLD 540000 // this will be tweaked as appropriate...
#define BIG_CACHE_THRESHOLD MINIMUM_GAME_THRESHOLD + 1900000
#define EXTRA_TMAP_THRESHOLD BIG_CACHE_THRESHOLD
#define BLEND_THRESHOLD EXTRA_TMAP_THRESHOLD + 64000
#define BIG_HACKCAM_THRESHOLD BLEND_THRESHOLD + 32000
#define PRELOAD_ANIMATION_THRESHOLD EXTRA_TMAP_THRESHOLD // for simplicity, can be set different if we are psyched
// Globals
#ifdef __CYBMEM_SRC
uchar big_buffer[BIG_BUFFER_SIZE + 16384];
int start_mem;
#else
extern uchar big_buffer[BIG_BUFFER_SIZE + 16384];
extern int start_mem;
#endif
#endif // __CYBMEM_H
+59
View File
@@ -0,0 +1,59 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __CYBRLOOP_H
#define __CYBRLOOP_H
/*
* $Source: q:/inc/RCS/cybrloop.h $
* $Revision: 1.2 $
* $Author: xemu $
* $Date: 1993/09/02 23:07:25 $
*
* $Log: cybrloop.h $
* Revision 1.2 1993/09/02 23:07:25 xemu
* angle me baby
*
* Revision 1.1 1993/05/14 15:46:51 xemu
* Initial revision
*
*
*/
// Includes
// C Library Includes
// System Library Includes
// Master Game Includes
// Game Library Includes
// Game Object Includes
// Defines
#define CL_VITALS_UPDATE 0
#define CL_MFD_UPDATE 1
// Prototypes
void cyber_loop(void);
// Globals
#endif // __CYBRLOOP_H
+69
View File
@@ -0,0 +1,69 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __CYBRND_H
#define __CYBRND_H
/*
* $Source: n:/project/cit/src/inc/RCS/cybrnd.h $
* $Revision: 1.5 $
* $Author: minman $
* $Date: 1993/12/15 22:56:25 $
*
* $Log: cybrnd.h $
* Revision 1.5 1993/12/15 22:56:25 minman
* added effect random var
*
* Revision 1.4 1993/09/02 23:07:26 xemu
* angle me baby
*
* Revision 1.3 1993/08/17 14:17:55 minman
* added make-info random number
*
* Revision 1.2 1993/08/12 19:45:06 minman
* added grenade random no
*
* Revision 1.1 1993/08/12 19:22:58 minman
* Initial revision
*
*
*/
#include "rnd.h"
#ifdef __CYBRND_SRC
RNDSTREAM_STD(damage_rnd);
RNDSTREAM_STD(grenade_rnd);
RNDSTREAM_STD(obj_make_rnd);
RNDSTREAM_STD(effect_rnd);
#else
extern RndStream damage_rnd;
extern RndStream grenade_rnd;
extern RndStream obj_make_rnd;
extern RndStream effect_rnd;
#endif
// so i feel like using prime numbers - got a problem with that????
#define DAMAGE_SEED 23
#define GRENADE_SEED 31
#define OBJMAKE_SEED 29
#define EFFECT_SEED 37
void rnd_init(void);
#endif // __CYBRND_H
File diff suppressed because it is too large Load Diff
+146
View File
@@ -0,0 +1,146 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* $Source: r:/prj/cit/src/inc/RCS/damage.h $
* $Revision: 1.34 $
* $Author: minman $
* $Date: 1994/08/09 04:46:01 $
*
*/
#ifndef __DAMAGE_H
#define __DAMAGE_H
// Includes
#include "objects.h"
#include "combat.h"
#define EXPLOSION_TYPE 1
#define ENERGY_BEAM_TYPE 2
#define MAGNETIC_TYPE 3
#define RADIATION_TYPE 4
#define GAS_TYPE 5
#define TRANQ_TYPE 6
#define NEEDLE_TYPE 7
#define BIO_TYPE 8
#define DAMAGE_TYPE2MASK(n) (1 << ((n) - 1))
#define DAMAGE_TYPE_FIELD 0x00FF
#define PRIMARY_DAMAGE_FIELD 0x0F00
#define PRIMARY_DAMAGE(X) (((X) >> 8) & 0xF)
#define SUPER_DAMAGE_FIELD 0xF000
#define SUPER_DAMAGE(X) (((X) >> 12) & 0xF)
#define CYBER_EXPLOSION_TYPE 1
#define CYBER_PROJECTILE_TYPE 2
#define CYBER_DRILL_TYPE 3
#define EXPLOSION_FLAG (0x01 << (EXPLOSION_TYPE - 1))
#define ENERGY_BEAM_FLAG (0x01 << (ENERGY_BEAM_TYPE - 1))
#define MAGNETIC_FLAG (0x01 << (MAGNETIC_TYPE - 1))
#define RADIATION_FLAG (0x01 << (RADIATION_TYPE - 1))
#define GAS_FLAG (0x01 << (GAS_TYPE - 1))
#define TRANQ_FLAG (0x01 << (TRANQ_TYPE - 1))
#define NEEDLE_FLAG (0x01 << (NEEDLE_TYPE - 1))
#define SLEEP_FLAG (0x01 << (SLEEP_TYPE - 1))
#define CYBER_EXPLOSION_FLAG (0x01 << (CYBER_EXPLOSION_TYPE - 1))
#define CYBER_PROJECTILE_FLAG (0x01 << (CYBER_PROJECTILE_TYPE - 1))
#define CYBER_DRILL_FLAG (0x01 << (CYBER_DRILL_TYPE - 1))
#define DAMAGE_MIN 0
#define DAMAGE_MAX 4
#define DAMAGE_DEGREES 6
#define DAMAGE_NONE 0
#define DAMAGE_LIGHT 1
#define DAMAGE_MEDIUM 2
#define DAMAGE_SEVERE 3
#define DAMAGE_CRITICAL 4
#define DAMAGE_INEFFECTIVE 5
#define DAMAGE_TRANQ 6
#define DAMAGE_STUN 7
// attack_object flags
#define NO_SHIELD_ABSORBTION 0x01 // should the player's shield not absorb damage
// default is to absorb
#define FLASH_BLOOD 0x02
#define STUN_ATTACK 0x04
#define MAX_DESTROYED_OBJS 100
extern short destroyed_obj_count;
extern ObjID destroyed_ids[MAX_DESTROYED_OBJS];
#define ADD_DESTROYED_OBJECT(X) (destroyed_ids[destroyed_obj_count++] = X)
// is_obj_destroyed()
// returns TRUE, if object with id, is scheduled for destruction
uchar is_obj_destroyed(ObjID id);
// destroy_destroyed_objects()
// destroy all objects that have been scheduled to be destroyed
void destroy_destroyed_objects(void);
// damage_object()
// flags - if the low bit is set - then damage is not absorbed by shields
// damage_modifier - raw damage value of attack - 0 if attacking player
ubyte damage_object(ObjID target_id, int damage, int dtype, ubyte flags);
int compute_damage(ObjID target, int damage_type, int damage_mod, ubyte offense, ubyte penet, int power_level,
ubyte *effect, ubyte *effect_row, ubyte attack_effect_type);
ubyte object_affect(ObjID target_id, short dtype);
// simple_damage object just takes some damage and damage type
// (and flags) and damages the object if it is vulnerable.
uchar simple_damage_object(ObjID target, int damage, ubyte dtype, ubyte flags);
uchar terrain_damage_object(physics_handle ph, fix raw_damage);
uchar special_terrain_hit(ObjID cobjid);
// attack_object()
//
// general all purpose attack/damage object
// target - the ObjID of the target being attacked
// weapon_triple - the triple for the bullet, grenade, or beam gun
// flags - see above
// power_level - will be ignored for projectile weapons, but used for grenades and beam guns
//
ubyte attack_object(ObjID target, int damage_type, int damage_mod, ubyte offense, ubyte penet, ubyte flags,
int power_level, ubyte *effect_row, ubyte *effect, ubyte attack_effect_type, int *damage_inflicted);
// player_attack_object
//
ubyte player_attack_object(ObjID target, int wpn_triple, int power_level, Combat_Pt origin);
// get an estimate of how damaged we are, with above numerical index
int get_damage_estimate(ObjSpecID osid);
void spew_object_specs(void);
uchar test_object_specs(short keycode, ulong context, void *data);
uchar damage_player(int damage, ubyte dtype, ubyte flags);
uchar kill_player(void);
void regenerate_player(void);
void slow_proj_hit(ObjID id, ObjID victim);
#endif // __DAMAGE_H
+27
View File
@@ -0,0 +1,27 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// difficulty defines
#define MISSION_DIFF_QVAR 0xD
#define CYBER_DIFF_QVAR 0xE
#define COMBAT_DIFF_QVAR 0xF
#define PUZZLE_DIFF_QVAR 0x1E
// 7 hours on mission difficulty 3
#define MISSION_3_TICKS CIT_CYCLE * 3600 * 7
+28
View File
@@ -0,0 +1,28 @@
/*
Copyright (C) 2020 Shockolate Project
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DIGIFX_H
#define DIGIFX_H
int compute_sfx_vol(ushort x1, ushort y1, ushort x2, ushort y2);
int compute_sfx_pan(ushort x1, ushort y1, ushort x2, ushort y2, fixang our_ang);
uchar set_sample_pan_gain(snd_digi_parms *sdp);
#endif
+36
View File
@@ -0,0 +1,36 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Here is the high and mighty Dirac Frame header file, courtesy of Mr. Robert Fermier...
// ======================================================================================
// Struct...
// ---------
typedef struct {
fix mass, hardness, roughness, gravity;
fix corners[10][4];
} Dirac_frame;
physics_handle EDMS_make_Dirac_frame(Dirac_frame *d, State *s);
void EDMS_get_Dirac_frame_viewpoint(physics_handle ph, State *s);
void EDMS_set_Dirac_frame_parameters(physics_handle ph, Dirac_frame *d);
void EDMS_get_Dirac_frame_parameters(physics_handle ph, Dirac_frame *d);
void EDMS_control_Dirac_frame(physics_handle ph, fix forward, fix pitch, fix yaw, fix roll);
+29
View File
@@ -0,0 +1,29 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// at which frame and above the door is considered "open" to physics....
#define DOOR_OPEN_FRAME 3
#define DOOR_CLOSED(id) (objs[(id)].info.current_frame < DOOR_OPEN_FRAME)
#define DOOR_REALLY_CLOSED(id) (objs[(id)].info.current_frame == 0)
#define NEVER_AUTOCLOSE_COOKIE ((ubyte)-1)
extern uchar check_object_dist(ObjID obj1, ObjID obj2, fix crit);
extern uchar door_locked(ObjID);
extern uchar door_moving(ObjID, uchar);
+104
View File
@@ -0,0 +1,104 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __DRUGS_H
#define __DRUGS_H
/*
* $Source: n:/project/cit/src/inc/RCS/drugs.h $
* $Revision: 1.11 $
* $Author: xemu $
* $Date: 1994/05/13 21:11:25 $
*
* $Log: drugs.h $
* Revision 1.11 1994/05/13 21:11:25 xemu
* reflex
*
* Revision 1.10 1994/02/01 04:37:07 mahk
* DRUGS !
*
* Revision 1.9 1993/09/02 23:07:28 xemu
* angle me baby
*
* Revision 1.8 1993/08/11 20:53:43 spaz
* Changed drug identifying #define's
*
* Revision 1.7 1993/07/28 16:57:02 mahk
* Added drug2triple & triple2drug
*
* Revision 1.6 1993/07/26 21:24:47 spaz
* moved drug id's to #define's here
*
* Revision 1.5 1993/07/19 11:39:48 mahk
* Added inventory stuff
*
* Revision 1.4 1993/07/08 13:29:35 spaz
* Moved some #define's around.
*
* Revision 1.3 1993/07/01 19:16:38 spaz
* Added constants and prototypes for generic drug.c funcs.
*
* Revision 1.2 1993/07/01 17:19:37 spaz
* Added NUM_DRUGZ #define, and drugs_time[] static array.
*
* Revision 1.1 1993/07/01 16:26:23 mahk
* Initial revision
*
*
*/
// Defines
#define DRUG_STAMINUP 0
#define DRUG_SIGHT 1
#define DRUG_LSD 2
#define DRUG_MEDIC 3
#define DRUG_REFLEX 4
#define DRUG_GENIUS 5
#define DRUG_DETOX 6
// Includes
// C Library Includes
// System Library Includes
// Master Game Includes
// Game Library Includes
// Game Object Includes
// Defines
// Prototypes
char *get_drug_name(int type, char *buf);
void drug_use(int type);
void drug_wear_off(int type);
void drug_effect(int type);
void drugs_update();
void drugs_init();
void drug_startup(bool visible);
void drug_closedown(bool visible);
int drug2triple(int type);
int triple2drug(int triple);
// Globals
#endif // __DRUGS_H
+28
View File
@@ -0,0 +1,28 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define DYNMEM_ALL 0xFFFFFFFF
#define DYNMEM_NONE 0x00000000
#define DYNMEM_TEXTURES 0x00000001
#define DYNMEM_SIDEICONS 0x00000002
#define DYNMEM_FHANDLE_1 0x00000004
#define DYNMEM_FHANDLE_2 0x00000008
#define DYNMEM_FHANDLE_3 0x00000010
#define DYNMEM_FHANDLE_4 0x00000020
#define DYNMEM_FILEHANDLES DYNMEM_FHANDLE_1 | DYNMEM_FHANDLE_2 | DYNMEM_FHANDLE_3 | DYNMEM_FHANDLE_4
#define DYNMEM_PARTIAL DYNMEM_SIDEICONS | DYNMEM_FHANDLE_1 | DYNMEM_FHANDLE_3 | DYNMEM_FHANDLE_4
+197
View File
@@ -0,0 +1,197 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __EFFECT_H
#define __EFFECT_H
/*
* $Source: r:/prj/cit/src/inc/RCS/effect.h $
* $Revision: 1.35 $
* $Author: xemu $
* $Date: 1994/11/21 21:05:41 $
*
*/
// Includes
#include "objects.h"
#include "objcrit.h"
#include "objgame.h"
#include "objwpn.h"
#define BLOOD_LIGHT 1
#define CAMERA_EXPL 2
#define TV_EXPL 3
#define SMOKE 4
#define PLNT_EXPL 5
#define BULL_HIT_WALL 6
#define BEAM_HIT_WALL 7
#define IMPACT 8
#define BULLET_ROBOT 9
#define BEAM_ROBOT_LT 10
#define BEAM_ROBOT_HVY 11
#define M_EXPL1 12
#define M_EXPL2 13
#define M_EXPL3 14
#define LG_EXPL 15
#define MAG_HIT 16
#define STUN_HIT 17
#define PLASMA_HIT 18
#define SMOKEY_EXPL 19
#define CRATE_EXPL 20
#define MNTR_EXPL2 21
#define GAS_EXPL 22
#define EMP_EXPL 23
#define CORPSE_HUM_EXPL 24
#define CORPSE_ROB_EXPL 25
#define EFFECT_NUMS 25
// should these be here - or is this just for special effects in the 3D??
#define SHIELD_HIT_EFFECT 40
#define SHIELD_GONE_EFFECT 41
#define BODY_HIT_EFFECT 42
#define CRIT_HIT_NUM 5
#define SEVERITIES 2
#define AMMO_TYPES 4
#define PROJ_TYPE 0
#define BEAM_TYPE 1
#define HAND_TYPE 2
#define GREN_TYPE 3
#define NON_CRITTER_EFFECT (CRIT_HIT_NUM - 1)
#define SPECIAL_TYPE CRIT_HIT_NUM
extern ubyte effect_matrix[CRIT_HIT_NUM][AMMO_TYPES][SEVERITIES];
// info about the destruction of an object
// (a) should we play an effect?
// (b) should we destroy the object DURING the effect
// (c) should we play a sound effect?
#define EFFECT_VAL(x) ((x)&0x1F)
#define DESTROY_SOUND_EFFECT(x) (((x)&0x60) >> 5)
#define DESTROY_OBJ_EFFECT(x) ((x)&0x80)
// these are things about the state of the effects
// they are cleverly hidden in the instance data of the effect
// in start_frame
#define EFFECT_LIGHT_FLAG 0x01
#define EFFECT_LIGHT_MAP_SHIFT 3
#define EFFECT_LIGHT_MAP_MASK 0x78
#define EFFECT_DESTROY_OBJ_FLAG 0x80
#define EFFECT_LIGHT_MAP(x) (((x)&EFFECT_LIGHT_MAP_MASK) >> EFFECT_LIGHT_MAP_SHIFT)
#define SET_EFFECT_LIGHT_MAP(x, y) (x = (((x) & ~(EFFECT_LIGHT_MAP_MASK)) | (y << EFFECT_LIGHT_MAP_SHIFT)))
#define CLEAR_EFFECT_LIGHT_MAP(x) ((x) &= ~(EFFECT_LIGHT_MAP_MASK))
#define EFFECT_DESTROY_OBJ(x) ((x) & EFFECT_DESTROY_OBJ_FLAG)
#define SET_EFFECT_DESTROY_OBJ(x) ((x) |= EFFECT_DESTROY_OBJ_FLAG)
#define CLEAR_EFFECT_DESTROY_OBJ(x) ((x) &= ~(EFFECT_DESTROY_OBJ_FLAG))
#define START_FRAME(x) ((x) & ~(EFFECT_LIGHT_MAP_MASK | EFFECT_DESTROY_OBJ_FLAG))
// the effect location
#define EFFECT_LOC(id) (objs[id].info.make_info & 0x03)
#define SET_EFFECT_LOC(id, x) (objs[id].info.make_info &= (~0x03 | x))
#define EFFECT_LEFT 01
#define EFFECT_RIGHT 02
#define EFFECT_CENTER 03
// the effect number
#define EFFECT_NUM(id) ((objs[id].info.make_info & 0x7C) >> 2)
#define SET_EFFECT_NUM(id, x) (objs[id].info.make_info &= (~0x7C | (x << 2)))
// show two effects????????
#define EFFECT_DUAL(id) (objs[id].info.make_info & 0x80)
#define SET_EFFECT_DUAL(id, x) (objs[id].info.make_info &= (x << 7))
// frame count
#define EFFECT_FRAME(id) ((objCritters[objs[id].specID].mood & 0x70) >> 4)
#define SET_EFFECT_FRAME(id, x) (objCritters[objs[id].specID].mood &= (~0x70 | x << 4))
// height's range is from 1-7 (one being the lowest, 3 the center)
#define EFFECT_HEIGHT(id) ((objCritters[objs[id].specID].orders & 0x70) >> 4)
#define SET_EFFECT_HEIGHT(id, x) (objCritters[objs[id].specID].orders &= (~0x70 | x << 4))
// scale's range is from 1-3 (1 being the smallest)
#define EFFECT_SCALE(id) \
(((objCritters[objs[id].specID].orders & 0x80) >> 6) | ((objCritters[objs[id].specID].mood & 0x80) >> 7))
#define SET_EFFECT_SCALE(id, x) \
do { \
objCritters[objs[id].specID].orders &= (0x7F | ((x & 0x02) << 6)); \
objCritters[objs[id].specID].mood &= (0x7F | ((x & 0x01) << 7)); \
} while (0);
#define EFFECT_EIGHTH(id) ((objCritters[objs[id].specID].current_posture & 0xE0) >> 5)
#define SET_EFFECT_EIGHTH(id, x) (objCritters[objs[id].specID].current_posture &= (~0xE0 | (x << 5)))
#define EFFT2TRIP(num) \
((num <= NUM_TRANSITORY_ANIMATING) ? (BLOOD1_TRIPLE + num - 1) \
: (EXPLOSION1_TRIPLE + num - (NUM_TRANSITORY_ANIMATING + 1)))
#define OBJ_LOC_TO_LIGHT_LOC(val) ((val + 0x80) >> 8)
#define CRITTER_LAMP_MASK 0xF0
#define CRITTER_LAMP_SHIFT 4
#define CRITLIT(id) (objCritters[objs[id].specID].current_posture)
#define CRITLOCX(id) (objs[id].info.make_info)
#define SET_CRITLOCX(id, val) (objs[id].info.make_info = val)
#define CRITLOCY(id) (objCritters[objs[id].specID].ai_mode)
#define SET_CRITLOCY(id, val) (objCritters[objs[id].specID].ai_mode = val)
#define CRITTER_LAMP(id) ((CRITLIT(id) & CRITTER_LAMP_MASK) >> CRITTER_LAMP_SHIFT)
#define SET_CRITTER_LAMP(id, lval) (CRITLIT(id) = ((CRITLIT(id) & (~CRITTER_LAMP_MASK)) | (lval << CRITTER_LAMP_SHIFT)))
#define CLEAR_CRITTER_LAMP(id) (CRITLIT(id) &= (~CRITTER_LAMP_MASK))
typedef void (*AnimlistCB)(ObjID id, intptr_t user_data);
// do_special_effect
ObjID do_special_effect(ObjID owner, ubyte effect, ubyte start, ObjID obj, short location);
ObjID do_special_effect_location(ObjID owner, ubyte effect, ubyte start, ObjLoc *loc, short location);
void advance_animations(void);
errtype add_obj_to_animlist(ObjID id, uchar repeat, uchar reverse, uchar cycle, short speed, int cb_id, intptr_t user_data,
short cbtype);
errtype remove_obj_from_animlist(ObjID id);
errtype animlist_clear();
uchar anim_data_from_id(ObjID id, bool *reverse, bool *cycle);
#define MAX_ANIMLIST_SIZE 64
#define ANIMCB_REMOVE 1
#define ANIMCB_REPEAT 2
#define ANIMCB_CYCLE 3
#define ANIMFLAG_REPEAT 1
#define ANIMFLAG_REVERSE 2
#define ANIMFLAG_CYCLE 4
typedef struct {
ObjID id;
uchar flags;
short cbtype;
int callback;
intptr_t user_data;
short speed;
} AnimListing;
extern short anim_counter;
extern AnimListing animlist[MAX_ANIMLIST_SIZE];
#endif // __EFFECT_H
+41
View File
@@ -0,0 +1,41 @@
/*
Copyright (C) 2020 Shockolate Project
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EMAIL_H
#define EMAIL_H
#include "mfdint.h"
void add_email_handler(LGRegion *r);
uchar email_color_func(void *dp, int num);
char *email_name_func(void *dp, int num, char *buf);
void read_email(Id new_base, int num);
void select_email(int num, uchar scr);
void set_email_flags(int n);
void update_email_ware();
void email_page_exit(void);
void mfd_emailmug_expose(MFD *mfd, ubyte control);
uchar mfd_emailmug_handler(MFD *m, uiEvent *ev);
errtype mfd_emailware_init(MFD_Func *f);
void mfd_emailware_expose(MFD *mfd, ubyte control);
void email_turnon(uchar visible, uchar real_start);
void email_turnoff(uchar visible, uchar real_stop);
#endif
+43
View File
@@ -0,0 +1,43 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __EMAILBIT_H
#define __EMAILBIT_H
/*
* $Source: r:/prj/cit/src/inc/RCS/emailbit.h $
* $Revision: 1.2 $
* $Author: tjs $
* $Date: 1994/08/12 21:04:42 $
*
*/
// bit masks for the player_struct email inventory
#define EMAIL_GOT 0x80u // we've got the email
#define EMAIL_READ 0x40u // we've read it.
#define EMAIL_SEQ 0x3Fu // sequence number of emails from this sender
#define EMAIL_SEQ_SHF 0u
// flavors of data
#define EMAIL_VER 0
#define LOG_VER 1
#define DATA_VER 2
#endif // __EMAILBIT_H
+25
View File
@@ -0,0 +1,25 @@
/*
Copyright (C) 2020 Shockolate Project
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FACEOBJ_H_
#define FACEOBJ_H_
void facelet_obj(ObjID cobjid);
#endif
+33
View File
@@ -0,0 +1,33 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FAKETIME_H
#define __FAKETIME_H
/* total bogosity that saves having to alter 50 source files */
/* the non-time-faking parts of faketime + the new improved timer.h */
#define CIT_CYCLE 280
#define CIT_FREQ (TMD_FREQ / CIT_CYCLE)
#define APPROX_CIT_CYCLE_HZ 256u
#define APPROX_CIT_CYCLE_SHFT 8u
extern volatile uint32_t *tmd_ticks;
#endif /* !__FAKETIME_H */
+37
View File
@@ -0,0 +1,37 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FATIGUE_H
#define __FATIGUE_H
/*
* $Source: n:/project/cit/src/inc/RCS/fatigue.h $
* $Revision: 1.1 $
* $Author: mahk $
* $Date: 1994/05/05 16:57:50 $
*
*/
// Defines
#define MAX_FATIGUE 10000
// Prototypes
// Globals
#endif // __FATIGUE_H
+110
View File
@@ -0,0 +1,110 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FAUXRINT_H
#define __FAUXRINT_H
#define CFG_REND_TEST "rend_test"
#define PLAYER_HEIGHT 174
#define FR_CUR_OBJ_BASE 65
// axis setup for the zany extra math-o-tron 3d
//#define AXIS_ORDER X_AXIS,Z_AXIS,Y_AXIS
//#define ANGLE_ORDER ORDER_ZXY
//#define AXIS_ORDER X_AXIS,-Y_AXIS,Z_AXIS
//#define AXIS_ORDER X_AXIS,Y_AXIS,Z_AXIS
#define AXIS_ORDER AXIS_RIGHT, AXIS_DOWN, AXIS_IN
#define ANGLE_ORDER ORDER_YXZ
#define pitch tx
#define bank tz
#define head ty
#define xaxis gX
#define yaxis gY
#define zaxis gZ
// conversions
#define build_fix_angle(ang) ((65536 * (ang)) / 360)
// masks for quadrant/octant free facing check
#define FMK_NW (1 << 0)
#define FMK_EW (1 << 1)
#define FMK_SW (1 << 2)
#define FMK_WW (1 << 3)
#define FMK_D1 (1 << 4)
#define FMK_D3 (1 << 5)
#define FMK_D5 (1 << 6)
#define FMK_D7 (1 << 7)
#define MK_O_N (0)
#define MK_O_E (1)
#define MK_O_S (2)
#define MK_O_W (3)
#define HG_NW (1 << 1)
#define HG_NE (1 << 2)
#define HG_SE (1 << 3)
#define HG_SW (1 << 0)
#define RNG_MUL 4
#define RNG_1 (0 * RNG_MUL)
#define RNG_2 (1 * RNG_MUL)
#define RNG_3 (2 * RNG_MUL)
#define BOT_P 0
#define TOP_P 2
#define BOT_S 0
#define TOP_S 1
#define LEFT_E 0
#define RIGHT_E 1
/* note: 9 is unused
*
* 1 B 3
* 0 2
* 8 D A not detected yet
* 4 6
* 5 C 7
*/
#define QUAD_N_BASE 0
#define QUAD_S_BASE 4
#define QUAD_A_BASE 8
#define QUAD_X_OFF 2
#define QUAD_D_OFF 1
#define QUAD_CENTER 0xB
#define FACE_FLOOR 0
#define FACE_CEIL 1
#define FACE_WALLS 2
#define REND_BT_N (1 << 0)
#define REND_BT_E (1 << 1)
#define REND_BT_S (1 << 2)
#define REND_BT_W (1 << 3)
#define REND_BT_FLR (1 << 4)
#define REND_BT_CIE (1 << 5)
#define REND_BT_INT (1 << 6)
#endif
+29
View File
@@ -0,0 +1,29 @@
/*
Copyright (C) 2020 Shockolate Project
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FIXTRMFD_H
#define FIXTRMFD_H
// ----------
// PROTOTYPES
// ----------
void mfd_fixture_expose(MFD *mfd, ubyte control);
uchar mfd_fixture_handler(MFD *m, uiEvent *e);
#endif
+53
View File
@@ -0,0 +1,53 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* $Source: n:/project/cit/src/inc/RCS/fr3d.h $
* $Revision: 1.2 $
* $Author: dc $
* $Date: 1994/06/01 22:50:23 $
*
* Citadel Renderer
* setup and stuff for point counts, initialization, and so on
*/
//#define FR_PT_CNT 1024
#define FR_PT_CNT 256
#define FR_DEF_FOV 80
#define FR_DEF_AXIS 'X'
#define AXIS_ORDER AXIS_RIGHT, AXIS_DOWN, AXIS_IN
#define ANGLE_ORDER ORDER_YXZ
#define pitch tx
#define bank tz
#define head ty
#define xaxis gX
#define yaxis gY
#define zaxis gZ
// conversions
// does anyone ever call this... oh yea, for matts stuff...
// ick
#define build_fix_angle(ang) ((65536 * (ang)) / 360)
// coordinate merge - have to inc frcamera.h to use these
#define coor(val) (fr_camera_last[val])
#define ang(val) (fr_camera_last[val])
#define last_coor(val) (fr_camera_last[val])
#define last_ang(val) (fr_camera_last[val])
+33
View File
@@ -0,0 +1,33 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FRAMER8_H
#define __FRAMER8_H
/*
* $Source: r:/prj/cit/src/inc/RCS/framer8.h $
* $Revision: 1.1 $
* $Author: mahk $
* $Date: 1994/09/06 00:11:53 $
*
*/
#define MIN_FRAME_RATE 6
#define MAX_FRAME_RATE 70
#endif // __FRAMER8_H
+136
View File
@@ -0,0 +1,136 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* FrCamera.h
*
* $Source: n:/project/cit/src/inc/RCS/frcamera.h $
* $Revision: 1.6 $
* $Author: dc $
* $Date: 1994/04/10 05:16:16 $
*
* Citadel Renderer
* camera position/modification/creation system
*
* $Log: frcamera.h $
* Revision 1.6 1994/04/10 05:16:16 dc
* support for cyberman, vfx1, other 6d control structure, inc. HEAD_H
*
* Revision 1.5 1994/01/31 05:37:27 dc
* yea yea yea
*
* Revision 1.4 1994/01/02 17:16:19 dc
* Initial revision
*
* Revision 1.3 1993/09/17 17:00:31 mahk
* Added 360 support
*
* Revision 1.2 1993/09/16 23:55:06 dc
* support for fr internal camera view changing
*
* Revision 1.1 1993/09/05 20:58:57 dc
* Initial revision
*
*/
#ifndef __FRCAMERA_H
#define __FRCAMERA_H
#define CAM_COOR_CNT 6
#define CAM_ARGS_CNT 3
typedef struct {
uchar type; // camera type code
ushort obj_id; // current obj_id, or null if abs used
fix coor[CAM_COOR_CNT]; // current abs pos
fix args[CAM_ARGS_CNT]; // args interpreted based on type
} cams;
uchar fr_camera_create(cams *cam, int camtype, ushort oid, fix *coor, fix *args);
uchar fr_camera_modtype(cams *cam, uchar type_on, uchar type_off);
int fr_camera_update(cams *cam, uintptr_t arg1, int whicharg, uintptr_t arg2);
void fr_camera_slewone(cams *cam, int which, int how);
void fr_camera_setone(cams *cam, int which, int newCam);
fix *fr_camera_getpos(cams *cam);
void fr_camera_slewcam(cams *cam, int which, int how);
cams *fr_camera_getdef(void);
void fr_camera_setdef(cams *cam);
void fr_camera_getobjloc(int oid, fix *store);
extern fix cam_slew_scale[CAM_COOR_CNT];
extern fix fr_camera_last[CAM_COOR_CNT];
// cameras are now 8 bit flags
// 1 mods, 1 flt, 2 ang, 2 off, 1 obj
//
//
#define CAMOBJ_S 0u
#define CAMOBJ_Z 1u
#define CAMOFF_S (CAMOBJ_S + CAMOBJ_Z)
#define CAMOFF_Z 2u
#define CAMANG_S (CAMOFF_S + CAMOFF_Z)
#define CAMANG_Z 2u
#define CAMFLT_S (CAMANG_S + CAMANG_Z)
#define CAMFLT_Z 1u
#define CAMMOD_S (CAMFLT_S + CAMFLT_Z)
#define CAMMOD_Z 1u
//#define MakeCambit(x) CAMBIT_##x## (((1<<CAM##x##_Z)-1)<<CAM##x##_S)
//#define MakeCambit(OBJ)
//#define MakeCambit(OFF)
//#define MakeCambit(ANG)
#define CAMBIT_OBJ (((1 << CAMOBJ_Z) - 1) << CAMOBJ_S)
#define CAMBIT_OFF (((1 << CAMOFF_Z) - 1) << CAMOFF_S)
#define CAMBIT_ANG (((1 << CAMANG_Z) - 1) << CAMANG_S)
#define CAMBIT_FLT (((1 << CAMFLT_Z) - 1) << CAMFLT_S)
#define CAMBIT_MOD (((1 << CAMMOD_Z) - 1) << CAMMOD_S)
#define CAMANG_STRAIGHT (0u << CAMANG_S)
#define CAMANG_LEFT (1u << CAMANG_S)
#define CAMANG_BACK (2u << CAMANG_S)
#define CAMANG_RIGHT (3u << CAMANG_S)
#define CAMOFF_NORM (0 << CAMOFF_S)
#define CAMOFF_ORBIT (1 << CAMOFF_S)
#define CAMOFF_SHOULDER (2 << CAMOFF_S)
#define CAMTYPE_ABS (0 << CAMOBJ_S)
#define CAMTYPE_OBJ (1 << CAMOBJ_S)
#define CAMFLT_FULL3D (0 << CAMFLT_S)
#define CAMFLT_FLAT (1 << CAMFLT_S)
#define CAMMOD_NOMOD (0 << CAMMOD_S)
#define CAMMOD_USEMOD (1 << CAMMOD_S)
#define CAM_UPDATE_ALL (-1)
#define CAM_UPDATE_NONE (CAM_COOR_CNT)
// camera/eyeposition controllers
#define EYE_X 0
#define EYE_Y 1
#define EYE_Z 2
#define EYE_H 3
#define EYE_P 4
#define EYE_B 5
#define EYE_RESET 6
#define EYE_HEADH 7
#endif
+31
View File
@@ -0,0 +1,31 @@
/*
Copyright (C) 2020 Shockolate Project
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CURSORS_H
#define CURSORS_H
uchar cursor_get_callback(LGRegion* reg, LGRect* rect, void* vp);
errtype ui_init_cursor_stack(uiSlab* slab, LGCursor* default_cursor);
errtype ui_init_cursors(void);
errtype ui_shutdown_cursors(void);
uchar ui_set_current_cursor(LGPoint pos);
void ui_update_cursor(LGPoint pos);
#endif
+51
View File
@@ -0,0 +1,51 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* $Source: n:/project/cit/src/inc/RCS/fredge.h $
* $Revision: 1.2 $
* $Author: dc $
* $Date: 1994/06/13 18:01:56 $
*/
// noway, no how, no nothing, null space
#define MEDGE_NO_TILE 0x0000
// a full wall, end of the line, no further can you go
#define MEDGE_NO_EGRESS 0x0001
#define MEDGE_FULL_WALL 0x0001
// no floor height difference
#define MEDGE_FLAT_CASE 0x0002
// various partial things
#define MEDGE_SMALL_STEP 0x0004
#define MEDGE_LARGE_STEP 0x0008
#define MEDGE_CLIFF_THING 0x0010
// secret bug cases for playtest
#define MEDGE_BOWTIE_CASE 0x1000
#define MEDGE_INTERNAL_CROSSING 0x2000
int get_edge_code(void *mp, int edge);
char *map_get_edge(void *mp, int edge, int ceil_p);
#ifndef __FRTERR_SRC
// left val, right val, "sum" val
extern char edge_vals[3];
#endif
+136
View File
@@ -0,0 +1,136 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// flags
#define FR_HACKCAM_SHFT 31u
#define FR_HACKCAM_MASK (0x1u << FR_HACKCAM_SHFT)
#define FR_PALETTE_SHFT 28u // which palette to output through
#define FR_PALETTE_MASK (0x7u << FR_PALETTE_SHFT)
#define FR_WINDOWD_SHFT 24u // what window dressing to use
#define FR_WINDOWD_MASK (0xfu << FR_WINDOWD_SHFT)
#define FR_CURFREE_SHFT 20u
#define FR_CURFREE_MASK (0xfu << FR_CURFREE_SHFT)
#define FR_NOTRANS_SHFT 19u //
#define FR_NOTRANS_MASK (0x1u << FR_NOTRANS_SHFT)
#define FR_OVERLAY_SHFT 16u // what is being overlayed/ie. hand art or pings
#define FR_OVERLAY_MASK (0x7u << FR_OVERLAY_SHFT)
#define FR_SOLIDFR_SHFT 13u // are we just a solid this frame
#define FR_SOLIDFR_MASK (0x7u << FR_SOLIDFR_SHFT)
#define FR_DOHFLIP_SHFT 12u
#define FR_DOHFLIP_MASK (0x1u << FR_DOHFLIP_SHFT)
#define FR_OWNBITS_SHFT 11u // your canvas and all came from you
#define FR_OWNBITS_MASK (0x1u << FR_OWNBITS_SHFT)
#define FR_TITLEBR_SHFT 9u // should we be showing a title
#define FR_TITLEBR_MASK (0x3u << FR_TITLEBR_SHFT)
#define FR_SHOWALL_SHFT 8u
#define FR_SHOWALL_MASK (0x1u << FR_SHOWALL_SHFT)
#define FR_DOUBLEB_SHFT 7u // are we double buffering
#define FR_DOUBLEB_MASK (0x1u << FR_DOUBLEB_SHFT)
#define FR_CURVIEW_SHFT 5u
#define FR_CURVIEW_MASK (0x3u << FR_CURVIEW_SHFT)
#define FR_PICKUPM_SHFT 4u
#define FR_PICKUPM_MASK (0x1u << FR_PICKUPM_SHFT)
#define FR_NORENDR_SHFT 3u
#define FR_NORENDR_MASK (0x1u << FR_NORENDR_SHFT)
#define FR_SFX_SHFT 0u
#define FR_SFX_MASK (0x7u << FR_SFX_SHFT)
// yet another way to have multiple views
#define FR_CURVIEW_STRT (0u << FR_CURVIEW_SHFT)
#define FR_CURVIEW_LEFT (1u << FR_CURVIEW_SHFT)
#define FR_CURVIEW_BACK (2u << FR_CURVIEW_SHFT)
#define FR_CURVIEW_RGHT (3u << FR_CURVIEW_SHFT)
// Hey, some solid stuff
#define FR_SOLIDFR_NORMAL (0u << FR_SOLIDFR_SHFT)
#define FR_SOLIDFR_STATIC (1u << FR_SOLIDFR_SHFT)
#define FR_SOLIDFR_SLDCLR (2u << FR_SOLIDFR_SHFT)
#define FR_SOLIDFR_SLDKEEP (3u << FR_SOLIDFR_SHFT)
#ifndef __GAMEREND_SRC
extern uchar fr_solidfr_color;
#else
uchar fr_solidfr_color;
#endif
// Cool warping effects on the screen, and other draw hacks
#define FR_SFX_NONE (0u << FR_SFX_SHFT)
#define FR_SFX_VHOLD (1u << FR_SFX_SHFT)
#define FR_SFX_HHOLD (2u << FR_SFX_SHFT)
#define FR_SFX_STATIC (3u << FR_SFX_SHFT)
#define FR_SFX_SHAKE (4u << FR_SFX_SHFT)
#define FR_SFX_SHIELD (5u << FR_SFX_SHFT)
#define FR_SFX_TELEPORT (6u << FR_SFX_SHFT)
// Overlays -- currently this is only SHODAN
#define FR_OVERLAY_NONE (0u << FR_OVERLAY_SHFT)
#define FR_OVERLAY_SHODAN (1u << FR_OVERLAY_SHFT)
// Palette setup
#define FR_PALETTE_BW (1u << FR_PALETTE_SHFT)
#define FR_PALETTE_GREEN (2u << FR_PALETTE_SHFT)
#define FR_PALETTE_ORANGE (3u << FR_PALETTE_SHFT)
#define FR_PALETTE_IR (FR_PALETTE_BW | FR_MONOCHR_MASK)
#define FR_PALETTE_LOWTECH (FR_PALETTE_GREEN | FR_MONOCHR_MASK)
// Hack cameras
#define FR_HACKCAM_FLAG (1u << FR_HACKCAM_SHFT)
#define _fr_get_pal_idx(f) ((f & FR_PALETTE_MASK) >> FR_PALETTE_SHFT)
#define FR_MONOPAL_MASK (FR_PALETTE_MASK | FR_MONOCHR_MASK)
// it was unintentional, when i spit in your beer
// im overinfluenced, by movies
#define FR_DBG_DBG_ALL (0xffffffff)
#define FR_DBG_MONO_MAP (1 << 1)
#define FR_DBG_MONO_LIST (1 << 2)
#define FR_DBG_NO_MATH (1 << 3)
#define FR_DBG_NO_REND (1 << 4)
#define FR_DBG_NO_2D (1 << 5)
#define FR_DBG_PT_SPEW (1 << 6)
#define FR_DBG_SHOW_BASE (1 << 7)
#define FR_DBG_SANITY (1 << 8)
#define FR_DBG_NO_RTF (1 << 9)
#define FR_DBG_CURSOR (1 << 10)
#define FR_DBG_ANAL_CHK (1 << 11)
#define FR_DBG_ALTCAM (1 << 12)
#define FR_DBG_VECSPEW (1 << 13)
#define FR_DBG_VECTRACK (1 << 14)
#define FR_DBG_POLY_MODE (1 << 15)
#define FR_DBG_NO_SUB_CLIP (1 << 16)
#define FR_DBG_STATS (1 << 17)
#define FR_DBG_SPAN_PARSE (1 << 18)
#define FR_DBG_NO_CONE (1 << 19)
#define FR_DBG_NO_TILE (1 << 20)
#define FR_DBG_OBJ_TALK (1 << 21)
#define FR_DBG_LOC_TMAPS (1 << 22)
#define FR_DBG_SHOW_PICKUP (1 << 23)
#define FR_DBG_LIST_TILES (1 << 24)
#define FR_DBG_NEW_PTS (1 << 25)
//#define FR_DBG_STATIC_FLG (FR_DBG_SANITY|FR_DBG_SHOW_PICKUP|FR_DBG_VECSPEW|FR_DBG_VECTRACK)
#ifndef FR_DBG_STATIC_FLG
#define FR_DBG_STATIC_FLG (0)
#endif
// actual behavior controls, cause heck, why not
#define CLEAR_AS_WE_GO
+139
View File
@@ -0,0 +1,139 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* $Source: n:/project/cit/src/inc/RCS/frintern.h $
* $Revision: 1.3 $
* $Author: dc $
* $Date: 1994/01/16 05:22:06 $
*
* Citadel Renderer
* internal prototypes for the renderer
*
* $Log: frintern.h $
* Revision 1.3 1994/01/16 05:22:06 dc
* facelet parse obj
*
* Revision 1.2 1994/01/12 22:04:22 dc
* facelet code hacking
*
* Revision 1.1 1994/01/02 17:16:27 dc
* Initial revision
*
*/
#ifndef __FRINTERN_H
#define __FRINTERN_H
#include "frcamera.h"
#include "frprotox.h"
#include "frshipm.h"
#include "frworld.h"
//======== From frsetup.c
// setup current view, send it out
int fr_prepare_view(frc *view);
int fr_start_view(void);
int fr_send_view(void);
#ifdef __FRTYPES_H
extern fauxrend_context *_fr, *_sr;
#endif // only know about context itself if you already include types
extern uint _fr_curflags, _fr_glob_flags;
extern uchar *_fr_clut_list[4];
//======== From frpipe.c
// pipe setup and control
int fr_pipe_resize(int x, int y, int z, void *mptr);
int fr_pipe_start(int rad);
int fr_pipe_go(void);
int fr_pipe_end(void);
int fr_pipe_freemem(void);
extern int fr_map_x, fr_map_y, fr_map_z;
extern int _fr_x_cen, _fr_y_cen;
//======== from frpts.c
int fr_pts_frame_start(void);
int fr_pts_resize(int x, int y);
int fr_pts_freemem(void);
int fr_pts_update(int y, int lx, int rx);
int fr_pts_setup(int pt_code); // must call before update
#ifdef __3D_H
extern g3s_phandle *_fr_ptbase, *_fr_ptnext;
#endif // __3D_H
//======== From frclip.c
// these all set and modify global clipping arrays
// so, we cannot do these in parallel
int fr_clip_resize(int x, int y);
int fr_clip_frame_start(void);
int fr_clip_frame_end(void);
int fr_clip_cone(void);
int fr_clip_tile(void);
int fr_clip_freemem(void);
//======== From frtables.c
// setup and integrity test various renderer data tables
int fr_tables_build(void);
//======== From frobj.c
void render_parse_obj(void);
void facelet_parse_obj(void);
//======== From frutil.c
#define FR_CUR_OBJ_BASE 65
extern uchar fr_cur_obj_col;
extern ushort fr_col_to_obj[256];
//======== From frterr.c
void fr_draw_tile(void);
void fr_terr_frame_start(void);
void fr_terr_frame_end(void);
void _fr_facelet_init(void);
#ifdef __3D_H
int _fr_do_light(g3s_phandle work, int hgt_code);
#endif
#ifndef __FRTERR_SRC
// map/world data layout
#ifdef __3D_H
extern sfix _fr_sfuv_list[];
#endif
extern fix _fr_fhgt_step;
extern fix _fr_fhgt_list[];
extern fix slope_norm[][3];
extern int wall_adds[], csp_trans_add[];
// pipeline controller
extern int _fdt_x, _fdt_y, _fdt_mask, _fdt_dist, _fdt_pbase;
#ifdef __MAP_H
extern MapElem *_fdt_mptr;
#endif
#endif
#endif // __FRINTERN_H
// she flew low above the highway
// and i saw the wind
// throwing back her barbie doll hair
// robin flies again, robin flies again
// and in a kitchen in kentucky
// she thinks she's peter pan
// and in the bottom of her concrete basement
// robin flies again, robin flies again
+60
View File
@@ -0,0 +1,60 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* FrOslew.h
*
* $Source: n:/project/cit/src/inc/RCS/froslew.h $
* $Revision: 1.2 $
* $Author: dc $
* $Date: 1994/01/02 17:16:29 $
*
* Citadel Renderer
* object slew system controllers/prototypes/vars
*
* $Log: froslew.h $
* Revision 1.2 1994/01/02 17:16:29 dc
* Initial revision
*
* Revision 1.1 1993/09/05 20:59:07 dc
* Initial revision
*
*/
#ifndef __FROSLEW_H
#define __FROSLEW_H
#include "frcamera.h"
#ifndef __RENDTEST__
#include "objects.h"
#else
//¥¥#include <rtestobj.h>
#endif
int32_t *fr_objslew_obj_to_fix(int32_t *flist, Obj *cobj, int count);
Obj *fr_objslew_fix_to_obj(int32_t *flist, Obj *cobj, int count);
uchar fr_objslew_tele_to(Obj *cobj, int x, int y);
uchar fr_objslew_allowed(Obj *cobj, int32_t *eye);
uchar fr_objslew_moveone(Obj *objp, ObjID objnum, int which, int how, uchar conform);
uchar fr_objslew_go_real_height(Obj *cobj, int32_t *eye);
uchar fr_objslew_setone(int which, int l_new);
extern int32_t eye_mods[3];
extern uchar slew_conform_to_terrain, slew_full_3d;
#endif
+113
View File
@@ -0,0 +1,113 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* $Source: r:/prj/cit/src/inc/RCS/frparams.h $
* $Revision: 1.3 $
* $Author: dc $
* $Date: 1994/07/20 23:05:51 $
*
* Citadel Renderer
* global parameters structures, setting, and defines
*
* $Log: frparams.h $
* Revision 1.3 1994/07/20 23:05:51 dc
* odrop
*
* Revision 1.2 1994/01/30 01:54:53 dc
* global lighting
*
* Revision 1.1 1994/01/02 17:16:32 dc
* Initial revision
*
*/
#define TM_SIZE_CNT 3 /* # of different tmap sizes */
typedef struct {
struct {
uchar main : 1; /* any textures? */
uchar wall : 1; /* if any, any walls */
uchar floor : 1; /* any floor */
uchar ceiling : 1; /* any ceiling */
uchar cyber : 1; /* cyberspace instead */
uchar cyber_full : 1; /* full cursors */
} faces;
struct {
uchar highlights : 1; /* tilemap highlights of cones */
uchar tilecursor : 1; /* show the tilemap cursor in 3d */
uchar nodraw : 1; /* dont actually render FB */
} features;
struct {
#ifdef C_WERE_SUPER_COOL
uchar lighting : 1; /* any lighting at all? */
uchar terrain : 1; /* terrain light values checked and used? */
uchar camera : 1; /* camera light values used */
uchar normal_chk : 1; /* use normal when computing wall lighting */
#else
uchar flags; /* 0,0,0,0,any,terr,cam,normal */
#endif
int normal_shf; /* what to shift normal by when adding to dist */
uchar rad[2]; /* inner, outer lighting radius */
uchar base[2]; /* inner, outer light values */
fix slope; /* slope and yintercept */
fix yint; /* of lighting line */
short global_mod; /* change to all lighting */
} lighting;
struct {
uchar qscale_obj; /* radius at which to qscale objects */
uchar qscale_crit; /* radius at which to qscale critters */
uchar qscale_texture; /* radius at which to qscale textures */
uchar detail; /* detail setting */
uchar clear_color; /* color to clear background too */
uchar drop_rad[TM_SIZE_CNT]; /* radii to switch to lower res tmaps */
uchar odrop_rad[TM_SIZE_CNT]; /* original (base) drop radii to switch to lower res tmaps */
uchar radius; /* maximal view radius */
uchar show_all : 1; /* render whole world - no clip */
uchar cone_only : 1; /* no 2 1/2D clip, cone only */
} view;
struct {
long last_chk_time;
long last_frame_cnt;
long tot_frame_cnt;
long last_frame_len;
} time;
} fauxrend_parameters;
extern fauxrend_parameters _frp;
#define get_frp() (_frp)
#define LIGHT_BITS_MASK 0xfu
#define LIGHT_BITS_ANY 0x8u
#define LIGHT_BITS_TERR 0x4u
#define LIGHT_BITS_CAM 0x2u
#define LIGHT_BITS_NORM 0x1u
#define LIGHT_BITS_HOW (LIGHT_BITS_NORM | LIGHT_BITS_CAM | LIGHT_BITS_TERR)
#define _frp_light_bits_any() (_frp.lighting.flags & LIGHT_BITS_ANY)
#define _frp_light_bits_how() (_frp.lighting.flags & LIGHT_BITS_HOW)
#define _frp_light_bits_cam() (_frp.lighting.flags & LIGHT_BITS_CAM)
#define _frp_light_bits_norm() (_frp.lighting.flags & LIGHT_BITS_NORM)
#define _frp_light_bits_terr() (_frp.lighting.flags & LIGHT_BITS_TERR)
#define _frp_light_bits_set(m) (_frp.lighting.flags |= m)
#define _frp_light_bits_clear(m) (_frp.lighting.flags &= ~m)
#define _frp_light_bits_tog(m) \
if (_frp.lighting.flags | m) \
_frp_light_bits_clear(m) else _frp_light_bits_set(m)
+131
View File
@@ -0,0 +1,131 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FRPROTOX_H
#define __FRPROTOX_H
/*
* $Source: r:/prj/cit/src/inc/RCS/frprotox.h $
* $Revision: 1.11 $
* $Author: xemu $
* $Date: 1994/08/05 03:06:45 $
*
* Citadel Renderer
* global external prototypes for the renderer
*
* $Log: frprotox.h $
* Revision 1.11 1994/08/05 03:06:45 xemu
* look, fr_get_at with transparency
*
* Revision 1.10 1994/04/23 09:56:24 xemu
* new params1
*
* Revision 1.9 1994/04/14 15:00:33 kevin
* New detail stuff.
*
* Revision 1.8 1994/03/13 17:18:33 dc
* more fields for obj_block
*
* Revision 1.7 1994/03/03 12:18:27 dc
* place view takes a canvas now
*
* Revision 1.6 1994/02/13 05:48:00 dc
* rend_start
*
* Revision 1.5 1994/01/02 17:16:34 dc
* Initial revision
*
*/
#ifndef __FRTYPESX_H
typedef void frc;
typedef void fmp;
#endif
//======== Basic truths
#define FR_OK (1)
#define FR_BAD_VIEW (-1)
#define FR_NOMEM (-2)
#define FR_NULL_PTR (-3)
#define FR_NO_NEED (-4)
//======== Random prettiness
#define FR_NOCAM ((void *)(-1))
#define FR_DEFCAM (NULL)
#define FR_DEFVIEW (NULL)
#define FR_NEWVIEW (NULL)
//======== From frsetup.c
// global initialization
void fr_startup(void);
void fr_shutdown(void);
void fr_closedown(void);
// view control/setup
frc *fr_place_view(frc *view, void *cam, void *canvas, int pflags, char axis, int fov, int xc, int yc, int wid,
int hgt);
void fr_use_global_detail(frc *view);
int fr_view_resize(frc *view, int wid, int hgt);
int fr_view_full(frc *view, int wid, int hgt);
int fr_mod_size(frc *view, int xc, int yc, int wid, int hgt);
int fr_mod_cams(frc *view, void *cam, int mod_fac);
int fr_context_mod_flag(frc *view, int pflags_on, int pflags_off); // remember to set flags_off for things you turn on
int fr_global_mod_flag(int flags_on, int flags_off);
void *fr_get_canvas(frc *view); // really returns a grs_canvas, but no want 2d.h
int fr_set_view(frc *view);
int fr_free_view(frc *view);
void fr_set_cluts(uchar *base, uchar *bwclut, uchar *greenclut, uchar *amberclut);
int fr_set_callbacks(frc *view, int (*draw)(void *dstc, void *dstbm, int x, int y, int flg),
void (*horizon)(void *dstbm, int flg), void (*render)(void *dstbm, int flg));
int fr_set_global_callbacks(int (*draw)(void *dstc, void *dstbm, int x, int y, int flg),
void (*horizon)(void *dstbm, int flg), void (*render)(void *dstbm, int flg));
//======== From frcompil.c
void fr_compile_rect(fmp *fm, int llx, int lly, int ulx, int uly, uchar seen_bits);
void fr_compile_restart(fmp *fm);
//======== From frmain.c
int fr_rend(frc *view);
ushort fr_get_at(frc *view, int x, int y, uchar transp);
//======== From frutil.c
char *fr_get_frame_rate(void);
ushort fr_get_again(frc *fr, int x, int y);
//======== Externals to provide, initialized to dumb things
extern int _fr_default_detail;
extern int _fr_global_detail;
extern void (*fr_mouse_hide)(void), (*fr_mouse_show)(void);
extern int (*fr_get_idx)(void);
extern uchar (*fr_obj_block)(void *mptr, uchar *_sclip, int *loc);
extern void (*fr_clip_start)(uchar headnorth);
extern void (*fr_rend_start)(void);
#ifdef __2D_H
extern grs_bitmap *(*fr_get_tmap)(void);
#endif
// default versions of above, defined in frsetup and set there
void fr_default_mouse(void);
int fr_default_idx(void), fr_pickup_idx(void);
uchar fr_default_block(void *mptr, uchar *_sclip, int *loc);
void fr_default_clip_start(uchar headnorth);
void fr_default_rend_start(void);
#ifdef __2D_H
grs_bitmap *fr_default_tmap(void);
#endif
#endif // __FRPROTOX_H
+68
View File
@@ -0,0 +1,68 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* $Source: r:/prj/cit/src/inc/RCS/frquad.h $
* $Revision: 1.2 $
* $Author: dc $
* $Date: 1994/09/05 06:43:05 $
*
* Citadel Renderer
* quadrant defines and layout, flags, etc...
*/
/* note: 9 is unused
*
* 1 B 3
* 0 2
* 8 D A
* 4 6
* 5 C 7
*/
#define QUAD_N_BASE 0
#define QUAD_S_BASE 4
#define QUAD_A_BASE 8
#define QUAD_X_OFF 2
#define QUAD_D_OFF 1
#define QUAD_CENTER 0xB
/*
* 1 0 2
* B 4
* 9 C 3
* A 5
* 8 6 7
*/
#define QUAD2_BASE 0
#define QUAD2_RIGHT_FORK 1
#define QUAD2_LEFT_FORK 2
#define QUAD2_DELTA 3
#define QUAD2_CENTER 0xC
// masks for quadrant/octant free facing check
#define FMK_NW (1 << 0)
#define FMK_EW (1 << 1)
#define FMK_SW (1 << 2)
#define FMK_WW (1 << 3)
#define FMK_INT_NW (1 << (4 + 0))
#define FMK_INT_EW (1 << (4 + 1))
#define FMK_INT_SW (1 << (4 + 2))
#define FMK_INT_WW (1 << (4 + 3))
+25
View File
@@ -0,0 +1,25 @@
/*
Copyright (C) 2020 Shockolate Project
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SCREEN_H
#define SCREEN_H
errtype load_misc_cursors(void);
#endif
+54
View File
@@ -0,0 +1,54 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FRSHIPM_H
#define __FRSHIPM_H
/*
* $Source: n:/project/cit/src/inc/RCS/frshipm.h $
* $Revision: 1.1 $
* $Author: dc $
* $Date: 1994/01/02 17:16:41 $
*
* Citadel renderer
* ship vs. not debug spew stuff
*/
// have to learn about fixing fr_ret and all to be null
#define _chkNull(ptr)
#define _chkNullcast(pt, cast)
#define _fr_top(vr) \
if ((vr) == NULL) \
_fr = _sr; \
else \
_fr = (fauxrend_context *)(vr)
#define _fr_top_cast(vr, cast) _fr_top(vr)
#define _fr_ret return FR_OK
#define _fr_ret_val(v) return v
#define _fr_dbg(exp)
#define _fr_dbgchk(flg, exp)
#define _fr_sdbg(flg, exp)
#define _fr_ndbg(flg, exp) exp
#define _fr_defdbg(flg) 0
#define static static
#define _fr_dbgflg_add(flg)
#define _fr_dbgflg_tog(flg)
#define _fr_dbgflg_chk(flg) (0)
#endif // __FRSHIPM_H
+53
View File
@@ -0,0 +1,53 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* $Source: n:/project/cit/src/inc/RCS/frspans.h $
* $Revision: 1.1 $
* $Author: dc $
* $Date: 1994/01/02 17:16:44 $
*
* Citadel Renderer
* clipped and coned spans
*/
//
extern uchar *x_span_lists;
extern uchar *cone_span_list;
void cone_span_set(int y, int lx, int rx);
void store_x_span(int y, int lx, int rx);
// maximum spans on a database scan line
#define MAX_SPANS 7
#define SPAN_MEM (2 * MAX_SPANS + 2)
#define SPAN_SHIFT 4 // 8 spans, each 2 entries, 16 values
#define SPAN_LEFT 0
#define SPAN_RIGHT 1
#define span_count(y) (x_span_lists[((y) << SPAN_SHIFT) + (MAX_SPANS << 1)])
#define span_left(y, s) (x_span_lists[((y) << SPAN_SHIFT) + ((s) << 1) + SPAN_LEFT])
#define span_right(y, s) (x_span_lists[((y) << SPAN_SHIFT) + ((s) << 1) + SPAN_RIGHT])
#define cone_span_left(y) (cone_span_list[(y) << 1])
#define cone_span_right(y) (cone_span_list[((y) << 1) + 1])
#ifdef CLIPPER_CRACK_CHECK
#define SPAN_NOCRACK 0xff
#define span_crack(y) (x_span_lists[((y) << SPAN_SHIFT) + (MAX_SPANS << 1) + 1])
#endif
+81
View File
@@ -0,0 +1,81 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* $Source: n:/project/cit/src/inc/RCS/frsubclp.h $
* $Revision: 1.1 $
* $Author: dc $
* $Date: 1994/01/02 17:16:45 $
*
* Citadel renderer
* definition and accessors for subclip data
*/
// each vec is hi 14 bits of intersection (low word of a fix & ~3) and low 2 bit face code
// so to test if exists & the longword with 0x00030003 and if = 0x00030003 then it means nil
// subclip cache size
#define FR_SC_FULL 0xff
#define NUM_SUBCLIP (FR_SC_FULL + 1)
#define FR_SC_NONE 0
#define FR_SC_BASE 1
// subclip region id's
#define SC_LEFT_BASE 0
#define SC_LEFT_END 1
#define SC_RIGHT_BASE 2
#define SC_RIGHT_END 3
#define SC_VEC_COUNT 4
#ifndef __FRCLIP_SRC
extern ushort sc_reg[NUM_SUBCLIP][SC_VEC_COUNT];
extern ushort *cur_sc_ptr;
extern uint cur_sc_reg;
#endif
#define SC_FACE_MASK 0x0003
#define SC_INTR_MASK (~SC_FACE_MASK) //#define SC_INTR_MASK 0xFFFC
#define SC_NILL_VECT ((SC_FACE_MASK << 16) | SC_FACE_MASK)
#define FIRST_SC_REG (1)
#define SUBCLIP_OUT_OF_CONE (0xFF)
#define SUBCLIP_FULL_TILE (0x00)
// if the compiler doesnt shift here (or even better, scalar) i will kill it
#define sc_get_fullv(sc, vn) (sc_reg[sc][vn])
#define sc_get_facev(sc, vn) (sc_reg[sc][vn] & SC_INTR_MASK)
#define sc_get_intrv(sc, vn) (sc_reg[sc][vn] & SC_FACE_MASK)
#define sc_set_partv(sc, vn, v, f) (sc_reg[sc][vn] = (v) | (f))
#define sc_set_fullv(sc, vn, v) (sc_reg[sc][vn] = v)
#define sc_set_facev(sc, vn, f) (sc_reg[sc][vn] = (sc_reg[sc][vn] & SC_INTR_MASK) | (f))
#define sc_set_intrv(sc, vn, i) (sc_reg[sc][vn] = (sc_reg[sc][vn] & SC_FACE_MASK) | (i & SC_INTR_MASK))
// wacky read it as a long, vn is the base, ie. 0 or 2
#define sc_set_novec(sc, vn) ((*((long *)&sc_reg[sc][vn])) = SC_NILL_VECT)
#define sc_chk_novec(sc, vn) ((*((long *)&sc_reg[sc][vn])) == SC_NILL_VECT)
#define sc_reset() \
{ \
cur_sc_ptr = &sc_reg[FIRST_SC_REG][0]; \
cur_sc_reg = FIRST_SC_REG; \
}
#define sc_nxtvec() \
{ \
cur_sc_ptr += SC_VEC_COUNT; \
cur_sc_reg++; \
}
#define sc_region() cur_sc_reg
+280
View File
@@ -0,0 +1,280 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* FrTables.h
*
* $Source: n:/project/cit/src/inc/RCS/frtables.h $
* $Revision: 1.2 $
* $Author: dc $
* $Date: 1994/01/12 22:04:14 $
*
* Citadel Renderer
* externs of the tables for the tile definitions/quadrant codes
*
* $Log: frtables.h $
* Revision 1.2 1994/01/12 22:04:14 dc
* facelet code hacking
*
* Revision 1.1 1994/01/02 17:16:49 dc
* Initial revision
*
*/
// data structures
#define FRTILETYPES 51
//======== Points
// layout of points
//
// 4 D E F 8
// 3 g h 7
// b d
//
// 2 6
//
// a c
// 1 e f 5
// 0 9 A B C
//
// a-h are really 16-23 for octagonal setups
// each point has 2bits of zmod and then the code as above
// a table is used to take the pretransformed base points into the above
// in uv table note _uv1 is full, a is 2000, b is FROCT, c is 8000, d is -FROCT, e is -2000
// pack to uchar, uchar, int
typedef struct {
short base, modcnt;
fix arg;
} pt_mods;
//-- constants
#define FRPTSUNIQUE 24
#define FRPTSOFFS 8
#define FRPTSZSHF 6
#define FRPTSZMOD (2 << FRPTSZSHF)
#define FRPTSZPICK (1 << FRPTSZSHF)
#define FRPTSZMASK (3 << FRPTSZSHF)
#define FRPTSPTOFF ((1 << FRPTSZSHF) - 1)
// zcoor
#define FRPTSZBASE (0 << FRPTSZSHF)
#define FRPTSZCEIL (1 << FRPTSZSHF)
#define FRPTSZBASEU (2 << FRPTSZSHF)
#define FRPTSZCEILD (3 << FRPTSZSHF)
// once shifted down, use these
#define FRPTSZPICK_DN (1)
#define FRPTSZCEIL_DN (1)
#define FRPTSZFLR_DN (0)
#define FRMODNONE 0
#define FRMODYAXIS 1
#define FRMODXAXIS 2
// 0x2000*8/(2+sqrt(2))
// =side of a regular octagon whose bounding box is a square of size fix1.0
#define FROCTNUM 19195
#define FROCTFIX fix_make(0, 19195)
//-- externs
extern fix pt_offs[FRPTSOFFS];
extern pt_mods pt_deref[FRPTSUNIQUE];
extern ushort pt_uv[FRPTSUNIQUE][4][2];
extern uchar pt_from_faceoff[4][FRPTSOFFS];
//======== WallstoPts
// this corresponds to the list of point codes that make up an internal
// wall of a given wall code, note that the external walls are tacked on
// at the end for the compiler or dynamic parsing
// the wall codes are, in order
// 0-3 : main diagonals, SW to NE, NW norm then SE norm, then opposite NE norm SW norm
// 4-11 : quarter diagonals, slope 1/2 low hi, then -1/2 low hi
// 12-19 : quarter diagonals, slope 2 left right, then -2 left right
// 20-23 : halve tiles, EW N norm S norm, then NS W norm E norm
// 24-27 : one foots, S wall, N wall, E wall, W wall
// 28-31 : triangle, NS left right, EW north south facing
// 32-37 : octagonal, NS W three then E three, top to bottom
// 38-43 : octagonal, EW N three then S three, top to bottom
// 44-51 : parameterized main diagonals, 2 of each order, bot then top
// bonus extra
// 52-55 : N,E,S,W
typedef struct {
// union {
uchar ul, ur, lr, ll;
// uchar ptlst[4];
// };
} WallsToPts;
#define FRWALLPTSCNT 56
#define FROUTERWALLS (FRWALLPTSCNT - 4)
extern WallsToPts wall_pts[FRWALLPTSCNT];
// one has to wonder, doesnt one?
#define ED (32 + 4)
#define JOE (40 - 4)
//======== TilestoWalls
// for each tile type in tilename, we need a list of what walls it contains
// this is done as a bitfield of N|E|S|W|Internal, where internal is a 4bit count
// the second byte is the base into the wall_pts array for this tile, where from
// that value up to that value + internal count are the internal walls
typedef struct {
uchar wallbits;
uchar wallbase;
} TilesToWalls;
#define FRWALLNORTH (1 << 7)
#define FRWALLEAST (1 << 6)
#define FRWALLSOUTH (1 << 5)
#define FRWALLWEST (1 << 4)
#define FRWALLINT (0xf)
#define FRTILEWALLCNT FRTILETYPES
extern TilesToWalls tile_walls[FRTILEWALLCNT];
//======== TilesToFloors
// a tile has one or two floors, depending on whether it is a split slope/diagonal
// or not. it also has a cieling or not. it also has potential for points on it
// to be modified by the parameter. there is also a double bit for vsplits.
// Each floor has 3 or 4 points, depending on diagonal nature or not...
// this is expressed as an 8 element reference, containing a header flags list, a
// byte containing the number of points per floor element, and a 6 byte data area
// holding either a 4 element floor or 1 or 2 3 element floors
typedef struct {
uchar flags;
uchar ptsper;
uchar data[6];
} TilesToFloors;
#define FRFLRFLG_2ELEM 0x40
#define FRFLRSHF_2ELEM 6
#define FRFLRFLG_USEPR 0x20
#define FRFLRFLG_DBL 0x10
#define FRFLRFLG_NOTOP 0x08
#define FRFLRFLG_PMSK 0x07 // not currently used, but could pack ptsper into struct
// note set up for zany xor hacking for floor decode
// ie we can xor zmod with 1 if flipped, or and with ~
// if we want a flat floor or cieling
#define FRFLRDATA_ZMOD FRPTSZMOD
#define FRFLRDATA_PMSK FRPTSPTOFF
#define FRTILEFLOORCNT FRTILETYPES
extern TilesToFloors tile_floors[FRTILEFLOORCNT];
//======== Normals
#define FRWNORM_MAX 8
#define FRWNORM_MASK 0xf
#define FRWNORM_SHFT 4
#define FRFNORM_SLPN 0
#define FRFNORM_SLPE 1
#define FRFNORM_SLPS 2
#define FRFNORM_SLPW 3
#define FRFNORM_VZERO 4
#define FRFNORM_VFULL 5
#define FRFNORM_VZ_MIR 6
#define FRFNORM_VF_MIR 7
extern ushort fr_wnorm_list[FRWALLPTSCNT];
extern uchar fr_fnorm_list[FRTILEFLOORCNT];
extern fix fr_norm_elements[FRWNORM_MAX + 1];
//======== Obstruct
// face obstruct data contains the width data for each face of each
// tile. The format is l parm r parm packed into a byte, which can be looked
// up eventually in the big table, as opposed to actively decoded.
#define FO_L_PARM 0x80
#define FO_L_PMSK 0x38
#define FO_L_SHFT 3
#define FO_R_PARM 0x40
#define FO_R_PMSK 0x07
#define FO_R_SHFT 0
#define FO_LR_MSK 0x3F
#define FO_HT_MSK 0xC0
#define FACE_CNT 4
#define FRFACEOBSTRUCTCNT FRTILETYPES
#define FOBASECODES 64
extern uchar face_obstruct[FRFACEOBSTRUCTCNT][FACE_CNT];
extern fix fo_unpack[FOBASECODES][2];
extern fix fo_anti_unpack[FOBASECODES][2];
//======== Merger
// what to or pt_codes with prior to derefing for mirror compatibility
// mirror by flr/ciel by xor/and
extern uchar merge_masks[5][2][2];
extern uchar mmask_facelet[5][2][2];
//======== Tilelets
// a tilelet is a list of facelet entries
// there is a 16 bit pointer in each map square to a tile
// if it is NULL, there are no external walls
// otherwise, the low 4 bits are length, the top 12 an offset into the
// tilelet list array, where # 16bit facelet id's live
typedef ushort TileLet;
#define TL_LEN_MASK (0x000F)
#define TL_PTR_MASK (0xFFF0)
#define TL_PTR_SHFT 4
#define TileLet_Len(x) (x & TL_LEN_MASK)
#define TileLet_Ptr(x) (x & TL_PTR_MASK) // at 16 val res?, or shift down?
#define TileLet_Idx(x) (x >> TL_PTR_SHFT)
//======== Facelets
// a facelet id contains a 4bit header, 2 bits of type and 2 bits of which face
// followed by a 12 bit value, either data or ptr based on type
// types are:
// simple - 5 bit top 5 bit bottom
// middle - ptr to 4 5 bit fields + 4 bit width codes (3 bytes)
// full - ptr to 4 8 bit heights + 2 4 bit width codes (5 bytes)
typedef ushort FaceLet;
#define FL_LEN_MASK 0x0003
#define FL_FACE_MASK 0x000C
#define FL_DATA_MASK 0xFFF0
#define FL_DATA_SHFT 4
#define FaceLet_Len(x) (x & FL_LEN_MASK)
#define FaceLet_Face(x) (x & FL_FACE_MASK)
#define FaceLet_Ptr(x) (x & FL_DATA_MASK)
#define FaceLet_Data(x) (x >> FL_DATA_SHFT)
+53
View File
@@ -0,0 +1,53 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FRTYPES_H
#define __FRTYPES_H
/*
* $Source: n:/project/cit/src/inc/RCS/frtypes.h $
* $Revision: 1.8 $
* $Author: kevin $
* $Date: 1994/04/14 15:01:10 $
*
* Citadel renderer
* actual type definitions and such
*/
#include "frcamera.h"
#include "res.h"
#include "2d.h"
#include "lg.h"
// structures
typedef struct {
grs_canvas draw_canvas, main_canvas, hack_canvas;
uchar double_buffer;
int xtop, ytop;
int xwid, ywid; /* ywid is, of course, height */
fix viewer_zoom;
int fov;
char axis;
int flags, detail, last_detail;
int (*draw_call)(void *dest_canvas, void *dest_bm, int x, int y, int flags);
void (*horizon_call)(void *dest_bm, int flags);
void (*render_call)(void *dest_bm, int flags);
cams *camptr, *xtracam;
char *realCanvasPtr;
} fauxrend_context;
#endif // __FRTYPES_H
+29
View File
@@ -0,0 +1,29 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FRTYPESX_H
#define __FRTYPESX_H
/* FrTypesx.h
* $Revision: 1.2 $
* goofy goofy goofy attempt to cut out include dependencies
*/
#ifndef __FRPROTOX_H
typedef void frc;
typedef void fmp;
#endif
#endif
+38
View File
@@ -0,0 +1,38 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* $Source: n:/project/cit/src/inc/RCS/frworld.h $
* $Revision: 1.1 $
* $Author: dc $
* $Date: 1994/01/02 17:16:56 $
*
* Citadel Renderer
* world size/layout defines
*/
// default map x by y
#define DEF_MAP_SZ 32
// number of discrete heights in database
#define HGT_STEPS 32
// how many fake tmaps to build
#define FAKE_TMAPS 64
// sizeof defines
+26
View File
@@ -0,0 +1,26 @@
/*
Copyright (C) 2020 Shockolate Project
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FULLAMAP_H
#define FULLAMAP_H
void amap_start(void);
void amap_exit(void);
#endif
+79
View File
@@ -0,0 +1,79 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FULLSCRN_H
#define __FULLSCRN_H
/*
* $Source: n:/project/cit/src/inc/RCS/fullscrn.h $
* $Revision: 1.4 $
* $Author: tjs $
* $Date: 1994/05/17 02:32:03 $
*
* $Log: fullscrn.h $
* Revision 1.4 1994/05/17 02:32:03 tjs
* Save\restore mfd in fullscreen fix.
*
* Revision 1.3 1994/03/04 07:05:02 mahk
* Full screen mania.
*
* Revision 1.2 1993/09/22 00:46:57 xemu
* added raising & lowering of invent * mfd regions
*
* Revision 1.1 1993/09/19 19:06:26 xemu
* Initial revision
*
*
*/
// Includes
#include "frtypesx.h"
// Defines
#define FULL_VIEW_X 0
#define FULL_VIEW_Y 0
#define FULL_VIEW_HEIGHT 200
#define FULL_VIEW_WIDTH 320
// Note, these have been kludged to parallel the
// view360 context numbers.
#define FULL_R_MFD_MASK 0x01
#define FULL_L_MFD_MASK 0x02
#define FULL_INVENT_MASK 0x04
#define FULL_MFD_MASK(id) (((id) == 0) ? FULL_L_MFD_MASK : FULL_R_MFD_MASK)
// Typedefs
// Prototypes
void change_svga_screen_mode();
errtype fullscreen_init(void);
void fullscreen_start();
void fullscreen_exit(void);
errtype fullscreen_overlay();
errtype full_lower_region(LGRegion *r);
errtype full_raise_region(LGRegion *r);
// Globals
extern LGRegion *fullroot_region, *fullview_region;
extern LGRegion *inventory_region_full;
extern LGRegion *pagebutton_region_full;
extern uchar full_game_3d;
extern uchar full_visible;
#endif // __FULLSCRN_H
+82
View File
@@ -0,0 +1,82 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GAMESCREEN_H
#define __GAMESCREEN_H
/*
* $Source: n:/project/cit/src/inc/RCS/screen.h $
* $Revision: 1.20 $
* $Author: dc $
* $Date: 1994/05/11 21:42:04 $
*
*
*/
#define GADGET_GAMESCREEN
// C Library Includes
// System Library Includes
#include "frtypesx.h"
// Master Game Includes
// Game Library Includes
// Game Object Includes
// Defines
#define SCREEN_VIEW_X 28
#define SCREEN_VIEW_Y 24
#define SCREEN_VIEW_HEIGHT 108
#define SCREEN_VIEW_WIDTH 268
// Prototypes
// Initialize the main game screen. This should only be called once, at
// the major initialization stage of the program.
errtype screen_init(void);
// Bring the main game screen to the monitor, doing appropriate cool
// looking tricks (palette fading, etc.) as necessary
void screen_start(void);
// Do appropriate stuff to indicate that we have left the game screen
void screen_exit(void);
// Force a draw of the whole durned screen
errtype screen_draw(void);
// Stop doing graphics things
errtype screen_shutdown(void);
// Handle keyboard input anywhere on the main screen
uchar main_kb_callback(uiEvent *h, LGRegion *r, intptr_t udata);
// rct NULL means fullscreen, slb NULL is no slabinit, key and maus are callbacks, NULL is no install
void generic_reg_init(uchar create_reg, LGRegion *reg, LGRect *rct, uiSlab *slb, uiHandlerProc key_h, uiHandlerProc maus_h);
// Globals
extern uchar *default_font_buf;
extern LGRegion *root_region, *mainview_region, *inventory_region_game, *status_region;
extern LGRegion *pagebutton_region_game;
extern LGCursor globcursor, wait_cursor, fire_cursor;
extern frc *normal_game_fr_context;
#endif // __GAMESCREEN_H
+84
View File
@@ -0,0 +1,84 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GAMELOOP_H
#define __GAMELOOP_H
/*
* $Source: n:/project/cit/src/inc/RCS/gameloop.h $
* $Revision: 1.9 $
* $Author: xemu $
* $Date: 1993/09/18 00:16:39 $
*
* $Log: gameloop.h $
* Revision 1.9 1993/09/18 00:16:39 xemu
* FULLSCREEN_UPDATE
*
* Revision 1.8 1993/09/02 23:07:40 xemu
* angle me baby
*
* Revision 1.7 1993/07/06 01:13:37 mahk
* Added inventory stuff
*
* Revision 1.6 1993/06/06 00:44:11 xemu
* real rendering change flags
*
* Revision 1.5 1993/06/03 17:49:54 minman
* added anim update
*
* Revision 1.4 1993/05/23 19:01:35 xemu
* rmoved time flags
*
* Revision 1.3 1993/05/18 15:19:00 xemu
* new time constants
*
* Revision 1.2 1993/05/14 15:48:40 xemu
* change flags
*
* Revision 1.1 1993/05/12 14:20:21 xemu
* Initial revision
*
*
*/
// Includes
// C Library Includes
// System Library Includes
// Master Game Includes
// Game Library Includes
// Game Object Includes
// Defines
#define VITALS_UPDATE LL_CHG_BASE << 0u
#define MFD_UPDATE LL_CHG_BASE << 1u
#define ANIM_UPDATE LL_CHG_BASE << 2u
#define DEMOVIEW_UPDATE LL_CHG_BASE << 3u
#define INVENTORY_UPDATE LL_CHG_BASE << 4u
#define FULLSCREEN_UPDATE LL_CHG_BASE << 5u
// Prototypes
void game_loop(void);
// Globals
#endif // __GAMELOOP_H
+51
View File
@@ -0,0 +1,51 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FAUXOBJD_H
#define __FAUXOBJD_H
/*
* $Source: n:/project/cit/src/inc/RCS/gameobj.h $
* $Revision: 1.2 $
* $Author: dc $
* $Date: 1994/01/22 23:30:59 $
*/
#include "objects.h"
void show_obj(ObjRefID oRef);
// list of special obj numbers for renderer
#define FAUBJ_UNKNOWN 0
#define FAUBJ_TEXTPOLY 1
#define FAUBJ_BITMAP 2
#define FAUBJ_TPOLY 3
#define FAUBJ_CRIT 4
#define FAUBJ_ANIMPOLY 5
#define FAUBJ_VOX 6
#define FAUBJ_NOOBJ 7
#define FAUBJ_TEXBITMAP 8
#define FAUBJ_FLATPOLY 9
#define FAUBJ_MULTIVIEW 10
#define FAUBJ_SPECIAL 11
#define FAUBJ_TL_POLY 12
#define NUM_OBJ_RENDER_TYPES (FAUBJ_TL_POLY + 1)
short compute_3drep(Obj *cobj, ObjID cobjid, int obj_type);
#endif // __FAUXOBJD_H
+28
View File
@@ -0,0 +1,28 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* This file created by RESTOOL */
#ifndef __GAMEPAL_H
#define __GAMEPAL_H
#define RES_gamePalette 0x2bc // (700)
#define RES_gamePalette2 0x2bd // (701)
#define RES_gamePalette3 0x2be // (702)
#endif
+81
View File
@@ -0,0 +1,81 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GAMEREND_H
#define __GAMEREND_H
/*
* $Source: r:/prj/cit/src/inc/RCS/gamerend.h $
* $Revision: 1.5 $
* $Author: tjs $
* $Date: 1994/08/14 02:33:18 $
*
* $Log: gamerend.h $
* Revision 1.5 1994/08/14 02:33:18 tjs
* time limit
*
* Revision 1.4 1994/05/20 03:39:31 dc
* dmg types
*
* Revision 1.3 1994/05/09 06:06:10 dc
* protoypes and defines for secret_fx
*
* Revision 1.2 1993/12/21 03:03:47 minman
* added gamerend_init() prototype
*
* Revision 1.1 1993/10/18 23:42:26 xemu
* Initial revision
*
*
*/
// Includes
#define SNOW_COLOR_SET 0
#define BLOOD_COLOR_SET 1
#define SHIELD_COLOR_SET 2
#define TYPE_REND_SFX 0x0F00
#define VAL_REND_SFX 0x00FF
#define DYING_REND_SFX 0x0100
#define REBORN_REND_SFX 0x0200
#define FAKEWIN_REND_SFX 0x0300
#define TIMELIMIT_REND_SFX 0x0400
#define DMG_SHIELD 0
#define DMG_BLOOD 1
#define DMG_RAD 2
// Prototypes
void begin_shodan_conquer_fx(uchar begin);
errtype gamerend_init(void);
void set_dmg_percentage(int which, ubyte percent);
void draw_full_static(grs_bitmap *stat_dest, int c_base);
int gamesys_draw_func(void *fake_dest_canvas, void *fake_dest_bm, int x, int y, int flags);
void gamesys_render_func(void *fake_dest_bitmap, int flags);
void set_shield_raisage(uchar going_up);
#ifdef __GAMEREND_SRC
int secret_render_fx = 0;
#else
extern int secret_render_fx;
#endif
#endif // __GAMEREND_H
+241
View File
@@ -0,0 +1,241 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* This file created by RESTOOL */
#ifndef __GAMESCR_H
#define __GAMESCR_H
#define RES_helpscreen_english 0x543 // (1347)
#define REF_IMG_bmHelpOverlayEnglish 0x5430000
#define RES_helpscreen_french 0x544 // (1348)
#define REF_IMG_bmHelpOverlayFrench 0x5440000
#define RES_helpscreen_german 0x545 // (1349)
#define REF_IMG_bmHelpOverlayGerman 0x5450000
#define RES_gamescrGfx 0x259 // (601)
#define REF_IMG_bmBlankMessageLine 0x2590000
#define REF_IMG_bmBlankInventoryPanel 0x2590001
#define REF_IMG_bmBlankMFD 0x2590002
#define REF_IMG_bmDiffBio 0x2590003
#define REF_IMG_bmBiorhythm 0x2590004
#define REF_IMG_bmVitalInnardsTop 0x2590005
#define REF_IMG_bmVitalInnardsBottom 0x2590006
#define REF_IMG_bmStatusAngle1 0x2590007
#define REF_IMG_bmStatusAngle2 0x2590008
#define REF_IMG_bmStatusAngle3 0x2590009
#define REF_IMG_bmStatusAngle4 0x259000a
#define REF_IMG_bmHealthIcon1 0x259000b
#define REF_IMG_bmHealthIcon2 0x259000c
#define REF_IMG_bmHealthIcon3 0x259000d
#define REF_IMG_bmEnergyIcon1 0x259000e
#define REF_IMG_bmEnergyIcon2 0x259000f
#define REF_IMG_bmEnergyIcon3 0x2590010
#define REF_IMG_bmCyberIcon1 0x2590011
#define REF_IMG_bmCyberIcon2 0x2590012
#define REF_IMG_bmCyberIcon3 0x2590013
#define REF_IMG_bm3dBackground1 0x2590014
#define REF_IMG_bm3dBackground2 0x2590015
#define REF_IMG_bm3dBackground3 0x2590016
#define REF_IMG_bm3dBackground4 0x2590017
#define REF_IMG_bm3dBackground5 0x2590018
#define REF_IMG_bm3dBackground6 0x2590019
#define REF_IMG_bmMFDButtonBackground 0x259001a
#define REF_IMG_bmInventoryButtonBackground 0x259001b
#define RES_smallTechFont 0x25a // (602)
#define RES_tinyTechFont 0x25b // (603)
#define RES_mediumTechFont 0x25c // (604)
#define RES_largeTechFont 0x25d // (605)
#define RES_citadelFont 0x25e // (606)
#define RES_mediumLEDFont 0x25f // (607)
#define RES_bigLEDFont 0x260 // (608)
#define RES_graffitiFont 0x261 // (609)
#define RES_mfdFont 0x262 // (610)
#define RES_cutsceneFont 0x263 // (611)
#define RES_readingFont 0x264 // (612)
#define RES_coloraliasedFont 0x265 // (613)
#define RES_editorGfx 0x266 // (614)
#define REF_IMG_bmBitsIcon 0x2660000
#define REF_IMG_bmHeightIcon 0x2660001
#define REF_IMG_bmPokeIcon 0x2660002
#define REF_IMG_bmPaintIcon 0x2660003
#define REF_IMG_bmParamsIcon 0x2660004
#define REF_IMG_bmStringsIcon 0x2660005
#define REF_IMG_bmToggle3DIcon 0x2660006
#define REF_IMG_bmBlankIcon1 0x2660007
#define REF_IMG_bmStopGoIcon 0x2660008
#define REF_IMG_bmDemoIcon 0x2660009
#define REF_IMG_bmMusicIcon 0x266000a
#define REF_IMG_bmClearHighlightsIcon 0x266000b
#define REF_IMG_bmRubberbandIcon 0x266000c
#define REF_IMG_bmDebugIcon 0x266000d
#define REF_IMG_bmRenderIcon 0x266000e
#define REF_IMG_bmQuitIcon 0x266000f
#define REF_IMG_bmBlankIcon2 0x2660010
#define REF_IMG_bmEmptyIcon1 0x2660011
#define REF_IMG_bmFindIcon 0x2660012
#define REF_IMG_bmTextureIcon 0x2660013
#define REF_IMG_bmZoomIcon 0x2660014
#define REF_IMG_bmRaiseIcon 0x2660015
#define REF_IMG_bmLoadLevelIcon 0x2660016
#define REF_IMG_bmPhysicsIcon 0x2660017
#define REF_IMG_bmTilePopupIcon 0x2660018
#define REF_IMG_bmBlankIcon3 0x2660019
#define REF_IMG_bmEmptyIcon2 0x266001a
#define REF_IMG_bmEyeballIcon 0x266001b
#define REF_IMG_bmObjectIcon 0x266001c
#define REF_IMG_bmUnzoomIcon 0x266001d
#define REF_IMG_bmLowerIcon 0x266001e
#define REF_IMG_bmSaveLevelIcon 0x266001f
#define REF_IMG_bmTmapSelectIcon 0x2660020
#define REF_IMG_bmEditPaintIcon 0x2660021
#define REF_IMG_bmBlankIcon5 0x2660022
#define REF_IMG_bmEmptyIcon3 0x2660023
#define REF_IMG_bmLoadIcon 0x2660024
#define REF_IMG_bmSaveIcon 0x2660025
#define REF_IMG_bmCutpasteIcon 0x2660026
#define REF_IMG_bmGunPistolIcon 0x2660027
#define REF_IMG_bmGunAutoIcon 0x2660028
#define REF_IMG_bmGunSpecialIcon 0x2660029
#define REF_IMG_bmGunHandtohandIcon 0x266002a
#define REF_IMG_bmGunBeamIcon 0x266002b
#define REF_IMG_bmGunBeamprojIcon 0x266002c
#define REF_IMG_bmAmmoPistolIcon 0x266002d
#define REF_IMG_bmAmmoNeedleIcon 0x266002e
#define REF_IMG_bmAmmoMagnumIcon 0x266002f
#define REF_IMG_bmAmmoRifleIcon 0x2660030
#define REF_IMG_bmAmmoFlechetteIcon 0x2660031
#define REF_IMG_bmAmmoAutoIcon 0x2660032
#define REF_IMG_bmAmmoProjIcon 0x2660033
#define REF_IMG_bmPhysicsTracerIcon 0x2660034
#define REF_IMG_bmPhysicsSlowIcon 0x2660035
#define REF_IMG_bmPhysicsCameraIcon 0x2660036
#define REF_IMG_bmGrenadeDirectIcon 0x2660037
#define REF_IMG_bmGrenadeTimedIcon 0x2660038
#define REF_IMG_bmDrugStatsIcon 0x2660039
#define REF_IMG_bmHardwareGoggleIcon 0x266003a
#define REF_IMG_bmHardwareHardwareIcon 0x266003b
#define REF_IMG_bmSoftwareOffensiveIcon 0x266003c
#define REF_IMG_bmSoftwareDefensiveIcon 0x266003d
#define REF_IMG_bmSoftwareMiscIcon 0x266003e
#define REF_IMG_bmSoftwareOneShotIcon 0x266003f
#define REF_IMG_bmSoftwareDataIcon 0x2660040
#define REF_IMG_bmBigstuffElectronicsIcon 0x2660041
#define REF_IMG_bmBigstuffFurnishingsIcon 0x2660042
#define REF_IMG_bmBigstuffOnthewallIcon 0x2660043
#define REF_IMG_bmBigstuffLightIcon 0x2660044
#define REF_IMG_bmBigstuffLabgearIcon 0x2660045
#define REF_IMG_bmBigstuffTechnoIcon 0x2660046
#define REF_IMG_bmBigstuffDecor 0x2660047
#define REF_IMG_bmBigstuffTerrain 0x2660048
#define REF_IMG_bmSmallstuffUselessIcon 0x2660049
#define REF_IMG_bmSmallstuffBrokenIcon 0x266004a
#define REF_IMG_bmSmallstuffCorpselikeIcon 0x266004b
#define REF_IMG_bmSmallstuffGearIcon 0x266004c
#define REF_IMG_bmSmallstuffCardsIcon 0x266004d
#define REF_IMG_bmSmallstuffCyberIcon 0x266004e
#define REF_IMG_bmSmallstuffOnthewall 0x266004f
#define REF_IMG_bmSmallstuffPlot 0x2660050
#define REF_IMG_bmFixtureControlIcon 0x2660051
#define REF_IMG_bmFixtureReceptacleIcon 0x2660052
#define REF_IMG_bmFixtureTerminalIcon 0x2660053
#define REF_IMG_bmFixturePanelIcon 0x2660054
#define REF_IMG_bmFixtureVendingIcon 0x2660055
#define REF_IMG_bmFixtureCyberIcon 0x2660056
#define REF_IMG_bmDoorNormalIcon 0x2660057
#define REF_IMG_bmDoorDoorwaysIcon 0x2660058
#define REF_IMG_bmDoorForceIcon 0x2660059
#define REF_IMG_bmDoorElevatorIcon 0x266005a
#define REF_IMG_bmDoorSpecialIcon 0x266005b
#define REF_IMG_bmAnimatingObjectsIcon 0x266005c
#define REF_IMG_bmAnimatingTransitoryIcon 0x266005d
#define REF_IMG_bmAnimatingExplosionIcon 0x266005e
#define REF_IMG_bmTrapTriggerIcon 0x266005f
#define REF_IMG_bmTrapFeedbackIcon 0x2660060
#define REF_IMG_bmTrapSecretIcon 0x2660061
#define REF_IMG_bmContainerActualIcon 0x2660062
#define REF_IMG_bmContainerWasteIcon 0x2660063
#define REF_IMG_bmContainerLiquidIcon 0x2660064
#define REF_IMG_bmContainerMutantCorpseIcon 0x2660065
#define REF_IMG_bmContainerRobotCorpseIcon 0x2660066
#define REF_IMG_bmContainerCyborgCorpseIcon 0x2660067
#define REF_IMG_bmContainerOtherCorpseIcon 0x2660068
#define REF_IMG_bmCritterMutantIcon 0x2660069
#define REF_IMG_bmCritterRobotIcon 0x266006a
#define REF_IMG_bmCritterCyborgIcon 0x266006b
#define REF_IMG_bmCritterCyberIcon 0x266006c
#define REF_IMG_bmCritterRobobabeIcon 0x266006d
#define RES_leanmeterstub 0x267 // (615)
#define RES_popups 0x268 // (616)
#define RES_gamescrFull 0x269 // (617)
#define REF_IMG_bmGamescreenBackground 0x2690000
#define RES_gamescrSHODAN 0x26a // (618)
#define REF_IMG_bmSHODANEndgame 0x26a0000
#define REF_IMG_bmSHODANEndgameFull 0x26a0001
#define RES_SideIconArt 0x550 // (1360)
#define RES_FullAmapBack 0x551 // (1361)
#define REF_IMG_bmTriLogoBack 0x5510000
#define RES_cursorNormal 0x552 // (1362)
#define REF_IMG_bmTargetCursor 0x5520000
#define REF_IMG_bmUpCursor 0x5520001
#define REF_IMG_bmUpLeftCursor 0x5520002
#define REF_IMG_bmUpRightCursor 0x5520003
#define REF_IMG_bmCircLeftCursor 0x5520004
#define REF_IMG_bmCircRightCursor 0x5520005
#define REF_IMG_bmLeftCursor 0x5520006
#define REF_IMG_bmRightCursor 0x5520007
#define REF_IMG_bmDownCursor 0x5520008
#define REF_IMG_bmSprintCursor 0x5520009
#define REF_IMG_bmMfdPhaserCursor 0x552000a
#define REF_IMG_bmVmailCursor 0x552000b
#define RES_cursorMisc 0x553 // (1363)
#define REF_IMG_bmWaitCursor 0x5530000
#define REF_IMG_bmOptionCursor 0x5530001
#define REF_IMG_bmFireCursor 0x5530002
#define REF_IMG_bmXCursor 0x5530003
#define RES_cursorCyber 0x554 // (1364)
#define REF_IMG_bmCyberUpLeftCursor 0x5540000
#define REF_IMG_bmCyberUpCursor 0x5540001
#define REF_IMG_bmCyberUpRightCursor 0x5540002
#define REF_IMG_bmCyberBankLeftCursor 0x5540003
#define REF_IMG_bmCyberForwardCursor 0x5540004
#define REF_IMG_bmCyberBankRightCursor 0x5540005
#define REF_IMG_bmCyberRollLeftCursor 0x5540006
#define REF_IMG_bmCyberDownCursor 0x5540007
#define REF_IMG_bmCyberRollRightCursor 0x5540008
#define RES_leanMeterBase 0x555 // (1365)
#define RES_leanMeterBio 0x556 // (1366)
#define RES_leanMeterRad 0x557 // (1367)
#define RES_leanShield1 0x558 // (1368)
#define RES_leanShield2 0x559 // (1369)
#define RES_leanShield3 0x55a // (1370)
#define RES_leanShield4 0x55b // (1371)
#define RES_leanMeterBack 0x55c // (1372)
#define REF_IMG_bmLeanBkgnd 0x55c0000
#define REF_IMG_bmEyeIconL 0x55c0001
#define REF_IMG_bmEyeIconLdark 0x55c0002
#define REF_IMG_bmEyeIconR 0x55c0003
#define REF_IMG_bmEyeIconRdark 0x55c0004
#define REF_IMG_bmLeanBkgndTransp 0x55c0005
#define RES_doubleTinyTechFont 0x730 // (1840)
#define RES_megaTinyTechFont 0x731 // (1841)
#define RES_doubleMediumLEDFont 0x732 // (1842)
#define RES_megaMediumLEDFont 0x733 // (1843)
#define RES_tallTinyTechFont 0x734 // (1844)
#define RES_doubleCutsceneFont 0x735 // (1845)
#endif
+21
View File
@@ -0,0 +1,21 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
void render_sort_start(void);
void render_sorted_objs(void);
void sort_show_obj(ObjRefID oRef);
+77
View File
@@ -0,0 +1,77 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GAMESTRN_H
#define __GAMESTRN_H
/*
* $Source: n:/project/cit/src/inc/RCS/gamestrn.h $
* $Revision: 1.6 $
* $Author: dc $
* $Date: 1993/10/18 03:35:48 $
*
* $Log: gamestrn.h $
* Revision 1.6 1993/10/18 03:35:48 dc
* adding dumb-o @ifndef __SPEW
*
* Revision 1.5 1993/10/08 03:11:27 mahk
* Added more getters for greater flexibility.
*
* Revision 1.4 1993/09/02 23:07:40 xemu
* angle me baby
*
* Revision 1.3 1993/08/06 15:20:53 mahk
* Added long/short name accessors.
*
* Revision 1.2 1993/07/20 14:24:57 mahk
* Added init_strings
*
* Revision 1.1 1993/07/06 01:13:43 mahk
* Initial revision
*
*
*/
// Includes
// C Library Includes
// System Library Includes
// Master Game Includes
// Game Library Includes
// Game Object Includes
// Defines
// Prototypes
void init_strings(void);
char *get_string(int num, char *buf, int bufsize);
char *get_object_short_name(int triple, char *buf, int bufsize);
char *get_object_long_name(int triple, char *buf, int bufsize);
char *get_alloc_string(int num);
char *get_temp_string(int num);
void shutdown_strings(void);
char *get_texture_name(int abs_texture, char *buf, int bufsiz);
char *get_texture_use_string(int abs_texture, char *buf, int bufsiz);
// Globals
#endif // __GAMESTRN_H
+148
View File
@@ -0,0 +1,148 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GAMESYS_H
#define __GAMESYS_H
/*
* $Source: n:/project/cit/src/inc/RCS/gamesys.h $
* $Revision: 1.18 $
* $Author: mahk $
* $Date: 1993/12/29 16:16:52 $
*
* $Log: gamesys.h $
* Revision 1.18 1993/12/29 16:16:52 mahk
* Added some more fatigue defines
*
* Revision 1.17 1993/11/24 21:04:57 mahk
* Added a new game time schedule.
*
* Revision 1.16 1993/11/15 19:33:51 xemu
* level control box params
*
* Revision 1.15 1993/11/14 18:51:00 minman
* got rid of MAX_HP -cause we're using PLAYER_MAX_HP now
*
* Revision 1.14 1993/10/21 21:25:32 xemu
* MAX_ENERGY = 2555
* errr, 255 that is
*
* Revision 1.13 1993/09/02 23:07:41 xemu
* angle me baby
*
* Revision 1.12 1993/08/11 20:53:59 spaz
* #define'd maximum energy,hp,accuracy
*
* Revision 1.11 1993/08/06 16:01:41 minman
* modified software numbers
*
* Revision 1.10 1993/08/05 14:13:09 minman
* forgot objwpn.h
*
* Revision 1.9 1993/08/05 14:04:12 minman
* changed to new object properties order
*
* Revision 1.8 1993/07/29 20:16:42 minman
* made it rely on objprop.h
*
* Revision 1.7 1993/07/23 12:14:45 mahk
* Changed numbers of combat & defense softs
*
* Revision 1.6 1993/07/19 11:39:57 mahk
* Moved #defines for numbers of things back here.
*
* Revision 1.5 1993/07/02 14:16:23 mahk
* Removed NUM_WEAPONZ
*
* Revision 1.4 1993/07/01 17:18:58 spaz
* Removed double definition of NUM_DRUGZ (now in drugs.h)
*
* Revision 1.3 1993/06/29 09:53:46 mahk
* Modes for fatigue
*
* Revision 1.2 1993/06/16 23:01:45 xemu
* more #defines
*
* Revision 1.1 1993/05/12 14:20:51 xemu
* Initial revision
*
*
*/
// Includes
#include "map.h"
#include "objwpn.h"
#include "objwarez.h"
#include "schedtyp.h"
// Defines
#define NUM_LEVELZ 22
#define NUM_HARDWAREZ NUM_HARDWARE // Steal from Objwarez.h
#define NUM_COMBAT_SOFTS NUM_OFFENSE_SOFTWARE
#define NUM_DEFENSE_SOFTS NUM_DEFENSE_SOFTWARE
#define NUM_MISC_SOFTS (NUM_ONESHOT_SOFTWARE + NUM_MISC_SOFTWARE)
#define NUM_GRENADEZ 7
#define NUM_DRUGZ 7
#define NUM_WEAPONZ 16
#define NUM_AMMO_TYPES NUM_AMMO // Steal from Objwpn.h
// just so you don't screw up.
#define NUM_GRENADES NUM_GRENADEZ
#define NUM_LEVELS NUM_LEVELZ
#define NUM_DRUGS NUM_DRUGZ
#define NUM_WEAPONS NUM_WEAPONZ
#define SPRINT_CONTROL_THRESHOLD 70 // threshold between sprint and jog
#define MAX_ENERGY 255
#define MAX_ACCURACY 100
#define LEVEL_GRAV_NORMAL 0
#define LEVEL_GRAV_LOW 1
#define LEVEL_GRAV_ZERO 2
#define LEVEL_MIST_NONE 0
#define LEVEL_MIST_LIGHT 1
#define LEVEL_MIST_HEAVY 2
#define LEVEL_BIOHAZARD_NONE 0
#define LEVEL_BIOHAZARD_PARTIAL 1
#define LEVEL_BIOHAZARD_SEVERE 2
#define GAME_SCHEDULE_SIZE 64
// Prototypes
// Run the game system for one frame
errtype gamesys_run(void);
void check_panel_ref(uchar puntme);
void unshodanizing_callback(ObjID id, intptr_t user_data);
void game_sched_init(void);
void game_sched_free(void);
void check_hazard_regions(MapElem *newElem);
void expose_player(byte damage, ubyte type, ushort tsecs);
// Globals
extern Schedule game_seconds_schedule;
#endif // __GAMESYS_H
+76
View File
@@ -0,0 +1,76 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GAMETIME_H
#define __GAMETIME_H
/*
* $Source: n:/project/cit/src/inc/RCS/gametime.h $
* $Revision: 1.5 $
* $Author: mahk $
* $Date: 1994/02/28 12:16:57 $
*
* $Log: gametime.h $
* Revision 1.5 1994/02/28 12:16:57 mahk
* Added suspend_ and resume_game_time
*
* Revision 1.4 1993/09/02 23:07:42 xemu
* angle me baby
*
* Revision 1.3 1993/07/12 16:03:42 mahk
* Changed proto to update_state
*
* Revision 1.2 1993/07/01 13:57:02 mahk
* Added run_fatigue_rate
*
* Revision 1.1 1993/05/12 14:20:32 xemu
* Initial revision
*
*
*/
// Includes
// C Library Includes
// System Library Includes
// Master Game Includes
// Game Library Includes
// Game Object Includes
// Defines
// Prototypes
void update_level_gametime(void);
// Increment game time by one frame
errtype update_state(uchar run_time);
// suspend and resume game time, so that sim doesn't
// get run while doing non-real-time stuff.
void suspend_game_time(void);
void resume_game_time(void);
// Globals
extern int run_fatigue_rate;
#endif // __GAMETIME_H
+67
View File
@@ -0,0 +1,67 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GAMEWRAP_H
#define __GAMEWRAP_H
/*
* $Source: n:/project/cit/src/inc/RCS/gamewrap.h $
* $Revision: 1.13 $
* $Author: xemu $
* $Date: 1994/03/24 01:22:08 $
*
*
*/
// Includes
// Remember, change in wrapper.c also
extern char *modding_archive_override;
#define OLD_SAVE_GAME_ID_BASE 550
#define SAVE_GAME_ID_BASE 4000
#define NUM_RESIDS_PER_LEVEL 100
#define CURRENT_GAME_FNAME "CurrentGame.dat"
#define ARCHIVE_FNAME (modding_archive_override != NULL ? modding_archive_override : "res/data/archive.dat")
#define ResIdFromLevel(level) (SAVE_GAME_ID_BASE + (level * NUM_RESIDS_PER_LEVEL) + 2)
// Defines
// Typedefs
// Prototypes
// Loads or saves a game named by fname.
errtype copy_file(char *src_fname, char *dest_fname);
// errtype copy_file(FSSpec *srcFile, FSSpec *destFile, Boolean saveGameFile);
errtype save_game(char *fname, char *comment);
// errtype save_game(FSSpec *fSpec);
errtype load_game(char *fname);
// errtype load_game(FSSpec *loadSpec);
errtype write_level_to_disk(int idnum, uchar flush_mem);
uchar create_initial_game_func(short keycode, ulong context, void *data);
uchar create_level_archive_func(short keycode, ulong context, void *data);
errtype load_level_from_file(int level_num);
void startup_game(uchar visible);
void closedown_game(uchar visible);
// Globals
#endif // __GAMEWRAP_H
+26
View File
@@ -0,0 +1,26 @@
/*
Copyright (C) 2020 Shockolate Project
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GEARMFD_H
#define GEARMFD_H
void mfd_gear_expose(MFD *mfd, ubyte control);
uchar mfd_gear_handler(MFD *m, uiEvent *e);
#endif
+32
View File
@@ -0,0 +1,32 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Wacky macros and special texture map manipulation functions
// note: you must first include textmaps.h
// Note: places where this won't quite work right...
// cybmem.c, where we reclaim the memory
// textpal.c, where we reclaim the memory (since we loaded it wacky for the selector)
// of course, textmaps.c where we load them in the old way, and in texture_crunch_go there where we unload them
// ok, those should be fixed
#define BUILD_TEXTURE_BITMAPS
extern grs_bitmap *get_texture_map(int idx, int sz);
#define SAFE_TEXTURE (get_texture_map(0, 0))
+140
View File
@@ -0,0 +1,140 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "frprotox.h"
#ifdef SVGA_SUPPORT
extern void ss_string(char *s, short x, short y);
void ss_scale_string(char *s, short x, short y);
extern void ss_bitmap(grs_bitmap *bmp, short x, short y);
extern void ss_ubitmap(grs_bitmap *bmp, short x, short y);
extern void ss_scale_bitmap(grs_bitmap *bmp, short x, short y, short w, short h);
extern void ss_noscale_bitmap(grs_bitmap *bmp, short x, short y);
extern void ss_rect(short x1, short y1, short x2, short y2);
extern void ss_box(short x1, short y1, short x2, short y2);
extern void ss_int_line(short x1, short y1, short x2, short y2);
extern void ss_thick_int_line(short x1, short y1, short x2, short y2);
extern void ss_int_disk(short x1, short y1, short rad);
extern void ss_safe_set_cliprect(short x1, short y1, short x2, short y2);
extern void ss_cset_cliprect(grs_canvas *pcanv, short x1, short y1, short x2, short y2);
extern void ss_vline(short x1, short y1, short y2);
extern void ss_hline(short x1, short y1, short y2);
extern void ss_fix_line(fix x1, fix y1, fix x2, fix y2);
extern void ss_thick_fix_line(fix x1, fix y1, fix x2, fix y2);
extern void ss_get_bitmap(grs_bitmap *bmp, short x, short y);
extern void ss_set_pixel(long color, short x, short y);
extern void ss_set_thick_pixel(long color, short x, short y);
extern void ss_clut_ubitmap(grs_bitmap *bmp, short x, short y, uchar *cl);
extern void ss_recompute_zoom(frc *w, short oldm);
extern void ss_mouse_convert(short *px, short *py, uchar down);
extern void ss_mouse_convert_round(short *px, short *py, uchar down);
extern void ss_point_convert(short *px, short *py, uchar down);
extern void gr2ss_register_init(char convert_type, short init_x, short init_y);
extern void gr2ss_register_mode(char conv_mode, short nx, short ny);
extern short ss_curr_mode_width(void);
extern short ss_curr_mode_height(void);
extern void ss_set_hack_mode(short new_m, short *tval);
#define MAX_CONVERT_TYPES 4
#define MAX_USE_MODES 8
extern fix convert_x[MAX_CONVERT_TYPES][MAX_USE_MODES];
extern fix convert_y[MAX_CONVERT_TYPES][MAX_USE_MODES];
extern fix inv_convert_x[MAX_CONVERT_TYPES][MAX_USE_MODES];
extern fix inv_convert_y[MAX_CONVERT_TYPES][MAX_USE_MODES];
extern char convert_type;
extern char convert_use_mode;
void mouse_unconstrain(void);
uchar perform_svga_conversion(uchar mask);
extern short MODE_SCONV_X(short cval, short m);
extern short MODE_SCONV_Y(short cval, short m);
#define SCONV_X(x) \
(convert_use_mode ? fast_fix_mul_int(fix_make((x), 0), convert_x[convert_type][convert_use_mode]) : x)
#define SCONV_Y(y) \
(convert_use_mode ? fast_fix_mul_int(fix_make((y), 0), convert_y[convert_type][convert_use_mode]) : y)
#define RSCONV_X(x) fix_int(0x8000 + fast_fix_mul(fix_make((x), 0), convert_x[convert_type][convert_use_mode]))
#define RSCONV_Y(y) fix_int(0x8000 + fast_fix_mul(fix_make((y), 0), convert_y[convert_type][convert_use_mode]))
#define INV_SCONV_X(x) \
(convert_use_mode ? fast_fix_mul_int(fix_make((x), 0), inv_convert_x[convert_type][convert_use_mode]) : x)
#define INV_SCONV_Y(y) \
(convert_use_mode ? fast_fix_mul_int(fix_make((y), 0), inv_convert_y[convert_type][convert_use_mode]) : y)
#define FIXCONV_X(x) fast_fix_mul((x), convert_x[convert_type][convert_use_mode])
#define FIXCONV_Y(y) fast_fix_mul((y), convert_y[convert_type][convert_use_mode])
#define INV_FIXCONV_X(x) fast_fix_mul((x), inv_convert_x[convert_type][convert_use_mode])
#define INV_FIXCONV_Y(y) fast_fix_mul((y), inv_convert_y[convert_type][convert_use_mode])
extern uchar gr2ss_override;
#define OVERRIDE_NONE 0x00
#define OVERRIDE_SCALE 0x01
#define OVERRIDE_FONT 0x02
#define OVERRIDE_CLIP 0x04
#define OVERRIDE_GET_BM 0x10
#define OVERRIDE_ALL 0x7F
#define OVERRIDE_FAIL 0x80
#else
#define ss_string(s, x, y) gr_string(s, x, y)
#define ss_bitmap(bmp, x, y) gr_bitmap(bmp, x, y)
#define ss_ubitmap(bmp, x, y) gr_ubitmap(bmp, x, y)
#define ss_noscale_bitmap(bmp, x, y) gr_bitmap(bmp, x, y)
#define ss_scale_bitmap(bmp, x, y, w, h) gr_scale_bitmap(bmp, x, y, w, h)
#define ss_rect(x1, y1, x2, y2) gr_rect(x1, y1, x2, y2)
#define ss_box(x1, y1, x2, y2) gr_box(x1, y1, x2, y2)
#define ss_int_line(x1, y1, x2, y2) gr_int_line(x1, y1, x2, y2)
#define ss_thick_int_line(x1, y1, x2, y2) gr_int_line(x1, y1, x2, y2)
#define ss_int_disk(x1, y1, rad) gr_int_disk(x1, y1, rad)
#define ss_safe_set_cliprect(x1, y1, x2, y2) gr_safe_set_cliprect(x1, y1, x2, y2)
#define ss_cset_cliprect(pcanv, x1, y1, x2, y2) gr_cset_cliprect(pcanv, x1, y1, x2, y2)
#define ss_vline(x1, y1, y2) gr_vline(x1, y1, y2)
#define ss_hline(x1, y1, y2) gr_hline(x1, y1, y2)
#define ss_fix_line(x1, y1, x2, y2) gr_fix_line(x1, y1, x2, y2)
#define ss_thick_fix_line(x1, y1, x2, y2) gr_fix_line(x1, y1, x2, y2)
#define ss_get_bitmap(bmp, x, y) gr_get_bitmap(bmp, x, y)
#define ss_set_pixel(color, x, y) gr_set_pixel(color, x, y)
#define ss_set_thick_pixel(color, x, y) gr_set_pixel(color, x, y)
#define ss_clut_ubitmap(bmp, x, y, cl) gr_clut_ubitmap(bmp, x, y, cl)
#define ss_recompute_zoom(w, oldm)
#define gr2ss_register_init(convert_type, init_x, init_y)
#define gr2ss_register_mode(conv_mode, nx, ny)
extern void ss_mouse_convert(short *px, short *py, uchar down);
extern void ss_mouse_convert_round(short *px, short *py, uchar down);
#define SCONV_X(x) x
#define SCONV_Y(y) y
#define INV_SCONV_X(x) x
#define INV_SCONV_Y(y) y
#define FIXCONV_X(x) x
#define FIXCONV_Y(y) y
#define INV_FIXCONV_X(x) x
#define INV_FIXCONV_Y(y) y
#define MODE_SCONV_X(x, m) x
#define MODE_SCONV_Y(y, m) y
#endif
+104
View File
@@ -0,0 +1,104 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GRENADES_H
#define __GRENADES_H
/*
* $Source: n:/project/cit/src/inc/RCS/grenades.h $
* $Revision: 1.17 $
* $Author: minman $
* $Date: 1994/06/20 22:59:39 $
*
*/
// Includes
#include "objects.h"
#include "objclass.h"
// Defines
// type flags
#define GREN_CONTACT_TYPE 0x01
#define GREN_MOTION_TYPE 0x02
#define GREN_TIMING_TYPE 0x04
#define GREN_MINE_TYPE 0x08
// instance flags
#define GREN_ACTIVE_FLAG 0x01
#define GREN_DUD_FLAG 0x02
#define GREN_MINE_STILL 0x04
typedef struct {
ushort timestamp;
ushort type;
ObjID gren_id;
ubyte unique_id;
ubyte filler;
} GrenSchedEvent;
typedef struct {
fix radius;
fix radius_change;
int damage_mod;
int damage_change;
int dtype;
fix knock_mass;
ubyte offense;
ubyte penet;
} ExplosionData;
#define SMALL_GAME_EXPL 0
#define MEDIUM_GAME_EXPL 1
#define LARGE_GAME_EXPL 2
#define GAME_EXPLS 3
extern ExplosionData game_explosions[GAME_EXPLS];
#define UNIQUE_LIMIT 255
// Prototypes
// Get the name for a particular grenade type.
char *get_grenade_name(int gtype, char *buf);
// this will activate the grenade - also set the timing stuff if it's a timing grenade
// give it the SpecID of the grenade
void activate_grenade(ObjSpecID osid);
// do_explosion()
// will explode the grenade with id, and it'll show a special effect if arg is TRUE
void do_explosion(ObjLoc loc, ObjID exclusion, ubyte special_effect, ExplosionData *attack_data);
void do_object_explosion(ObjID id);
// void do_explosion(ObjLoc loc, ObjID exclusion, ubyte special_effect, fix radius, fix radius_change, int damage_mod,
// int damage_change, int dtype, fix knock_mass, fix knock_speed, ubyte offense,ubyte penet);/ void do_explosion(ObjID
// id, uchar special_effect);
uchar activate_grenade_on_cursor(void);
void reactivate_mine(ObjID id);
void do_grenade_explosion(ObjID id, uchar special_effect);
void grenade_stopped(ObjID id);
void grenade_contact(ObjID id, int severity);
#define GRENADE_COLOR WHITE
#endif // __GRENADES_H
+54
View File
@@ -0,0 +1,54 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __HAND_H
#define __HAND_H
/*
* $Source: n:/project/cit/src/inc/RCS/hand.h $
* $Revision: 1.4 $
* $Author: minman $
* $Date: 1994/01/24 07:26:03 $
*
* $Log: hand.h $
* Revision 1.4 1994/01/24 07:26:03 minman
* cleaned up code
*
* Revision 1.3 1993/12/21 03:04:01 minman
* get_handart asks for a mouse_y now
*
* Revision 1.2 1993/11/09 02:56:51 xemu
* added mouse_x to handart
*
* Revision 1.1 1993/09/08 18:44:46 minman
* Initial revision
*
*
*/
// Includes
#include "objwpn.h"
extern ubyte weapon_to_handart[NUM_GUN];
Ref get_handart(int *x_offset, int *y_offset, int *beam_x_offset, short mouse_x, short mouse_y);
void notify_draw_handart(void);
void reset_handart_count(int wpn_num);
#endif // __HAND_H
+41
View File
@@ -0,0 +1,41 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* This file created by RESTOOL */
#ifndef __HANDART_H
#define __HANDART_H
#define RES_handArt_0 0x29e // (670)
#define RES_handArt_1 0x29f // (671)
#define RES_handArt_2 0x2a0 // (672)
#define RES_handArt_3 0x2a1 // (673)
#define RES_handArt_4 0x2a2 // (674)
#define RES_handArt_5 0x2a3 // (675)
#define RES_handArt_6 0x2a4 // (676)
#define RES_handArt_7 0x2a5 // (677)
#define RES_handArt_8 0x2a6 // (678)
#define RES_handArt_9 0x2a7 // (679)
#define RES_handArt_10 0x2a8 // (680)
#define RES_handArt_11 0x2a9 // (681)
#define RES_handArt_12 0x2aa // (682)
#define RES_handArt_13 0x2ab // (683)
#define RES_handArt_14 0x2ac // (684)
#define RES_handArt_15 0x2ad // (685)
#endif
+194
View File
@@ -0,0 +1,194 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __HKEYFUNC_H
#define __HKEYFUNC_H
/*
* $Source: n:/project/cit/src/inc/RCS/hkeyfunc.h $
* $Revision: 1.24 $
* $Author: dc $
* $Date: 1994/01/16 05:22:46 $
*
* $Log: hkeyfunc.h $
* Revision 1.24 1994/01/16 05:22:46 dc
* inp6d
*
* Revision 1.23 1994/01/12 11:43:37 xemu
* cutpaste mode
*
* Revision 1.22 1993/09/09 03:22:31 dc
* bkpt_me
*
* Revision 1.21 1993/09/02 23:07:44 xemu
* angle me baby
*
* Revision 1.20 1993/08/24 12:21:10 xemu
* sfx toggle
*
* Revision 1.19 1993/07/13 00:45:52 spaz
* killed newmfd.h dependency
*
* Revision 1.18 1993/07/12 01:59:27 spaz
* #ifdef's to distinguish between old and new mfd systems,
* which are still coexisting. (ugh)
*
* Revision 1.17 1993/07/08 14:49:27 xemu
* physics_toggle
*
* Revision 1.16 1993/06/24 20:25:28 mahk
* Added bitsmode
*
* Revision 1.15 1993/06/16 18:25:48 xemu
* really_quit and edit_flag
*
* Revision 1.14 1993/06/16 16:21:05 mahk
* Added new level data
*
* Revision 1.13 1993/06/16 15:52:39 xemu
* mono functions
*
* Revision 1.12 1993/06/14 15:36:51 xemu
* music_stop
*
* Revision 1.11 1993/06/04 17:16:53 xemu
* music hotkey
*
* Revision 1.10 1993/06/01 19:48:26 xemu
* esc hotkey func added
*
* Revision 1.9 1993/05/25 00:00:37 xemu
* slewing and view zoom
*
* Revision 1.8 1993/05/24 15:19:56 xemu
* combined loop switchers
*
* Revision 1.7 1993/05/23 16:35:22 xemu
* find_func, pallete_mode
*
* Revision 1.6 1993/05/21 17:45:34 xemu
* eyeball_mode
*
* Revision 1.5 1993/05/20 20:58:43 xemu
* control_panel_func
*
* Revision 1.4 1993/05/20 09:01:17 mahk
* Added tilemap resize & move. Implemented a currently somewhat broken version of
* the 3d toggle button. Added tilemap cursor.
*
* Revision 1.3 1993/05/19 17:12:57 xemu
* added a bazillion stubs
*
* Revision 1.2 1993/05/18 14:58:02 mahk
* Added zooming and debuggin functions.
*
* Revision 1.1 1993/05/14 15:46:27 xemu
* Initial revision
*
*
*/
// Includes
// C Library Includes
// System Library Includes
// Master Game Includes
// Game Library Includes
// Game Object Includes
// Defines
#define ZOOM_IN 0
#define ZOOM_OUT 1
#define TERRAIN_MODE 0
#define TEXTURING_MODE 1
#define OBJECT_MODE 2
#define EYEBALL_MODE 3
#define MUSIC_MODE 4
#define BITS_MODE 5
#define CUTPASTE_MODE 6
#define POKE_MODE 0
#define PAINT_MODE 1
#define RUBBERBAND_MODE 2
// Prototypes
uchar quit_key_func(ushort keycode, uint32_t context, intptr_t data);
uchar really_quit_key_func(ushort keycode, uint32_t context, intptr_t data);
uchar change_mode_func(ushort keycode, uint32_t context, intptr_t data);
uchar toggle_time_func(ushort keycode, uint32_t context, intptr_t data);
uchar do_popup_textmenu(ushort keycode, uint32_t context, intptr_t g);
uchar mono_config_func(ushort keycode, uint32_t context, intptr_t data);
uchar zoom_func(ushort keycode, uint32_t context, intptr_t data);
uchar load_level_func(ushort keycode, uint32_t context, intptr_t data);
uchar save_level_func(ushort keycode, uint32_t context, intptr_t data);
uchar run_intro_func(ushort keycode, uint32_t context, intptr_t data);
uchar toggle_3d_func(ushort keycode, uint32_t context, intptr_t data);
uchar texture_selection_func(ushort keycode, uint32_t context, intptr_t data);
uchar tilemap_mode_func(ushort keycode, uint32_t context, intptr_t data);
uchar draw_mode_func(ushort keycode, uint32_t context, intptr_t data);
uchar clear_highlight_func(ushort keycode, uint32_t context, intptr_t data);
uchar lighting_func(ushort keycode, uint32_t context, intptr_t data);
uchar inp6d_panel_func(ushort keycode, uint32_t context, intptr_t data);
uchar render_panel_func(ushort keycode, uint32_t context, intptr_t data);
uchar bkpt_me(ushort keycode, uint32_t context, intptr_t data);
uchar popup_tilemap_func(ushort keycode, uint32_t context, intptr_t data);
uchar editor_options_func(ushort keycode, uint32_t context, intptr_t data);
uchar editor_modes_func(ushort keycode, uint32_t context, intptr_t data);
uchar misc_menu_func(ushort keycode, uint32_t context, intptr_t data);
uchar control_panel_func(ushort keycode, uint32_t context, intptr_t data);
uchar do_find_func(ushort keycode, uint32_t context, intptr_t data);
uchar stupid_slew_func(ushort keycode, uint32_t context, intptr_t data);
uchar zoom_3d_func(ushort keycode, uint32_t context, intptr_t data);
uchar menu_close_func(ushort keycode, uint32_t context, intptr_t data);
void start_music(void);
void stop_music(void);
uchar toggle_music_func(ushort, uint32_t, intptr_t);
uchar mono_clear_func(ushort keycode, uint32_t context, intptr_t data);
uchar edit_flags_func(ushort keycode, uint32_t context, intptr_t data);
uchar mono_toggle_func(ushort keycode, uint32_t context, intptr_t data);
uchar new_level_func(ushort keycode, uint32_t context, intptr_t data);
uchar toggle_physics_func(ushort keycode, uint32_t context, intptr_t data);
uchar toggle_giveall_func(ushort keycode, uint32_t context, intptr_t data);
uchar toggle_up_level_func(ushort keycode, uint32_t context, intptr_t data);
uchar toggle_down_level_func(ushort keycode, uint32_t context, intptr_t data);
uchar toggle_sfx_func(ushort keycode, uint32_t context, intptr_t data);
uchar save_hotkey_func(ushort, uint32_t, intptr_t);
uchar pause_game_func(ushort, uint32_t, intptr_t);
uchar clear_fullscreen_func(ushort keycode, uint32_t context, intptr_t data);
uchar arm_grenade_hotkey(ushort keycode, uint32_t context, intptr_t data);
uchar select_grenade_hotkey(ushort keycode, uint32_t context, intptr_t data);
uchar select_drug_hotkey(ushort keycode, uint32_t context, intptr_t data);
uchar use_drug_hotkey(ushort keycode, uint32_t context, intptr_t data);
uchar toggle_mouse_look(ushort keycode, uint32_t context, intptr_t data);
// uchar (ushort keycode, uint32_t context, intptr_t data);
// Globals
// Unused?
extern int current_palette_mode;
#endif // __HKEYFUNC_H
+96
View File
@@ -0,0 +1,96 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __HUD_H
#define __HUD_H
/*
* $Source: r:/prj/cit/src/inc/RCS/hud.h $
* $Revision: 1.23 $
* $Author: mahk $
* $Date: 1994/08/11 18:31:34 $
*
*
*/
// Includes
#include "frtypesx.h"
// C Library Includes
// System Library Includes
// Master Game Includes
// Game Library Includes
// Game Object Includes
// Defines
#define HUD_RADIATION 0x00000001u // Are we in radiation
#define HUD_BIOHAZARD 0x00000002u // Are we in a bio area
#define HUD_RANGE 0x00000004u // Range to target
#define HUD_FATIGUE 0x00000008u // High fatigue levels
#define HUD_TARGRECT 0x00000010u // Rectangle around target
#define HUD_GRENADE 0x00000020u // Time to detonate grenade
#define HUD_INFRARED 0x00000040u // Infrared active
#define HUD_SHIELD 0x00000080u // Show shield absorption
#define HUD_SHODOMETER 0x00000100u // Changes in shodometer
#define HUD_DETECT_EXP 0x00000200u // Explosion detection
#define HUD_COMPASS 0x00000400u // Compass
#define HUD_ZEROGRAV 0x00000800u // abnormal gravity conditions
#define HUD_FAKEID 0x00001000u // fakeid software in use
#define HUD_DECOY 0x00002000u // decoy software in use
#define HUD_TURBO 0x00004000u // turbo software in use
#define HUD_CYBERTIME 0x00008000u // time remaining until SHODAN sends his avatar against you
#define HUD_CYBERDANGER 0x00010000u // imminent peril of being ejected from cspace
#define HUD_RADPOISON 0x00100000u // taking radiation damage
#define HUD_BIOPOISON 0x00200000u // taking bio damage
#define HUD_BEAMHOT 0x00400000u // weapon about to overheat
#define HUD_MSGLINE 0x00800000u // message line.
#define HUD_GAMETIME 0x01000000u // time remaining in game
#define HUD_ENERGYUSE 0x02000000u // energy usage notification
#define HUD_ENVIROUSE 0x04000000u // enviro suit drain/absorb
#define HUD_MESSAGE 0x80000000u // general hud bit for hud_message (NIY)
#define HUD_ALL 0xFFFFFFFFu
#define HUD_COLOR_BANKS 3
#define HUD_COLORS_PER_BANK 5
// Prototypes
// Update the HUD. If redraw_whole is TRUE, better draw the
// whole durned thing.
errtype hud_update(uchar redraw_whole, frc *context);
errtype cyber_hud_update(uchar redraw_whole);
// Set the data being displayed by the HUD.
errtype hud_set(ulong hud_modes);
errtype hud_unset(ulong hud_modes);
errtype hud_set_time(ulong hud_modes, ulong ticks);
void hud_do_objs(short xtop, short ytop, short xwid, short ywid, uchar reverse);
void hud_shutdown_lines(void);
// Globals
extern LGRect target_screen_rect;
extern ubyte hud_colors[HUD_COLOR_BANKS][HUD_COLORS_PER_BANK];
extern ubyte hud_color_bank;
#endif // __HUD_H
+93
View File
@@ -0,0 +1,93 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __HUDOBJ_H
#define __HUDOBJ_H
/*
* $Source: n:/project/cit/src/inc/RCS/hudobj.h $
* $Revision: 1.3 $
* $Author: mahk $
* $Date: 1994/06/29 00:47:25 $
*
* $Log: hudobj.h $
* Revision 1.3 1994/06/29 00:47:25 mahk
* Added hudobj_rect_capable.
*
* Revision 1.2 1993/12/18 00:32:33 xemu
* made flag definition in line with objbit.h
*
* Revision 1.1 1993/10/13 21:47:24 mahk
* Initial revision
*
*
*/
// Includes
// ---------
// INTERNALS
// ---------
extern ushort hudobj_classes[];
#define HUDOBJ_INST_FLAG 0x01
#define NUM_HUDOBJS 16
extern struct _hudobj_data {
short id;
short xl, yl, xh, yh;
} hudobj_vec[NUM_HUDOBJS];
extern ubyte current_num_hudobjs;
// ------------
// RENDERER API
// ------------
// given an objid, determin whether this is an object the renderer
// should store in the u
#define IS_HUDOBJ(id) \
((objs[id].info.inst_flags & HUDOBJ_INST_FLAG) || ((1 << objs[id].subclass) & hudobj_classes[objs[id].obclass]))
#define SET_HUDOBJ_RECT(oid, oxl, oyl, oxh, oyh) \
if (current_num_hudobjs < NUM_HUDOBJS) { \
struct _hudobj_data *hd = &hudobj_vec[current_num_hudobjs++]; \
hd->id = (oid); \
hd->xl = (oxl); \
hd->xh = (oxh); \
hd->yl = (oyl); \
hd->yh = (oyh); \
}
// ---------------
// GAME SYSTEM API
// ---------------
#define HUDOBJ_ALL_SUBCLASSES 0xFF
void hudobj_set_subclass(ubyte l_class, ubyte subclass, uchar val);
// Sets the value of IS_HUDOBJ for all objects of a particular class & subclass.
// if subclass is HUDOBJ_ALL_SUBCLASSES then all subclasses will be set accordingly.
void hudobj_set_id(short id, uchar val);
// Sets the value of IS_HUDOBJ for the specified object.
#define hudobj_rect_capable(triple) (ObjProps[OPTRIP(triple)].render_type == FAUBJ_BITMAP)
// Globals
#endif // __HUDOBJ_H
+45
View File
@@ -0,0 +1,45 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "objects.h"
// Macro to determine whether or not a given object is ice'd. Assumes that
// A. We are in cyberspace and
// B. That there are no otherwise animating objects in cyberspace (well, besides things of CLASS_ANIMATING)
// If either of these assumptions change, this will probably have to change as well.
#define obj_ICE_ICE_BABY(cobj) \
((cobj)->info.current_frame && ((cobj)->obclass != CLASS_ANIMATING) && ((cobj)->obclass != CLASS_CRITTER))
#define obj_DEICE(cobj) \
do { \
(cobj)->info.current_frame = 0; \
} while (0)
#define obj_ICE_AGIT(cobj) ((cobj)->info.make_info)
#define obj_SET_ICE_AGIT(cobj, nv) ((cobj)->info.make_info = nv)
#define obj_ICE_LEVEL(cobj) ((cobj)->info.inst_flags >> 6)
// note level is overall level, color in 3d
// agit is how annoyed it is
// hp is strength/size, moded by level and agit, i guess
#define ICE_ICE_BABY(id) obj_ICE_ICE_BABY(&objs[(id)])
#define DEICE(id) obj_DEICE(&objs[(id)])
#define ICE_AGIT(id) obj_ICE_AGIT(&objs[(id)])
#define SET_ICE_AGIT(id, newval) obj_SET_ICE_AGIT(&objs[(id)], newval)
#define ICE_LEVEL(id) obj_ICE_LEVEL(&objs[(id)])
#define MAX_AGIT 255
+35
View File
@@ -0,0 +1,35 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __INIT_H
#define __INIT_H
// init.h
extern void init_all(void);
extern void free_all(void);
extern uchar ppall[]; // pointer to main shadow palette
extern void shock_alloc_ipal();
errtype load_da_palette(void);
void object_data_flush(void);
errtype object_data_load(void);
extern uchar objdata_loaded;
#endif
+88
View File
@@ -0,0 +1,88 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __INPUT_H
#define __INPUT_H
#include "frtypesx.h"
#include "objects.h"
// -------
// DEFINES
// -------
#define NUM_HOTKEYS 50 // an arbitrary constant
// Hotkey contexts
#define DEMO_CONTEXT 0x01
#define EDIT_CONTEXT 0x02
#define CYBER_CONTEXT 0x04
#define SETUP_CONTEXT 0x08
#define MWORK_CONTEXT 0x10
#define SVGA_CONTEXT 0x20
#define AMAP_CONTEXT 0x40
#define EVERY_CONTEXT 0xFFFFFFFF
// input modes
#define INPUT_NORMAL_CURSOR 0
#define INPUT_OBJECT_CURSOR 1
#define INPUT_CHAINING
#define CHAINING_VAR "kb_chain"
#define MAX_JUMP_CONTROL (CONTROL_MAX_VAL / 2)
// ------
// PROTOS
// ------
/**
* @deprecated does nothing
*/
void alloc_cursor_bitmaps(void);
/**
* @deprecated does nothing
*/
void free_cursor_bitmaps();
void input_chk(void);
// uchar main_kb_callback(uiEvent *h, LGRegion *r, intptr_t udata);
void shutdown_input(void);
void init_input(void);
void install_motion_mouse_handler(LGRegion *r, frc *fr);
void install_motion_keyboard_handler(LGRegion *r);
void pop_cursor_object(void);
void push_cursor_object(short id);
void reload_motion_cursors(uchar cyber);
void reset_input_system(void);
char *get_object_lookname(ObjID id, char use_string[], int sz);
uchar check_object_dist(ObjID obj1, ObjID obj2, fix crit);
void SetMotionCursorForMouseXY(void);
uchar citadel_check_input(void);
// -------
// GLOBALS
// ------
extern int input_cursor_mode;
extern short object_on_cursor;
#endif
+62
View File
@@ -0,0 +1,62 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __INVDIMS_H
#define __INVDIMS_H
/*
* $Source: r:/prj/cit/src/inc/RCS/invdims.h $
* $Revision: 1.5 $
* $Author: mahk $
* $Date: 1994/08/19 05:07:22 $
*
* $Log: invdims.h $
* Revision 1.5 1994/08/19 05:07:22 mahk
* added one to inventory panel size.
*
* Revision 1.4 1994/01/23 04:00:08 dc
* w+h for message line
*
* Revision 1.3 1993/11/12 19:44:13 mahk
* Changed dimensions for purposes of 360 view
*
* Revision 1.2 1993/09/18 03:55:12 mahk
* Added message line coords as well.c
*
* Revision 1.1 1993/09/17 16:59:25 mahk
* Initial revision
*
*
*/
// INVENTORY PANEL DIMENSIONS
#define GAME_MESSAGE_X 87
#define GAME_MESSAGE_Y 138
#define GAME_MESSAGE_W 145
#define GAME_MESSAGE_H 7
#define INVENTORY_PANEL_X 87
#define INVENTORY_PANEL_Y 145
#define INVENTORY_PANEL_WIDTH 145
#define INVENTORY_PANEL_HEIGHT 50
#define INV_FULL_WD (INVENTORY_PANEL_WIDTH + INVENTORY_PANEL_X - GAME_MESSAGE_X)
#define INV_FULL_HT (INVENTORY_PANEL_HEIGHT + INVENTORY_PANEL_Y - GAME_MESSAGE_Y)
#endif // __INVDIMS_H
+105
View File
@@ -0,0 +1,105 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __INVENT_H
#define __INVENT_H
/*
* $Source: r:/prj/cit/src/inc/RCS/invent.h $
* $Revision: 1.14 $
* $Author: xemu $
* $Date: 1994/07/18 21:31:31 $
*
*/
// Includes
#include "invdims.h"
// C Library Includes
// System Library Includes
#include "objects.h"
// Master Game Includes
// Game Library Includes
// Game Object Includes
#define MAX_GENERAL_INVENTORY 12
// Prototypes
// creates and initializes the inventory region
LGRegion *create_invent_region(LGRegion *parent, LGRegion **pbuttons, LGRegion **pinvent);
// Draw the inventory area. Keeps information on most recent draw so only does
// incremental updates.
errtype inventory_draw(void);
// Force the inventory panel to draw, no matter what
errtype inventory_full_redraw(void);
// switch the inventory page to pgnum and redraw
errtype inventory_draw_new_page(int pgnum);
// clears the inventory region
errtype inventory_clear(void);
// Add the appropriate kind of object to the player's inventory. Returns whether
// or not the action succeded (typical failure reason being not enough inventory
// slots remaining).
uchar inventory_add_object(ObjID new_object, uchar select);
// Removes the specified object from the player's inventory. Does not do any
// correlation with the rest of the Universe -- this needs to be handed by
// the dropping/consuming/destroying code.
errtype inventory_remove_object(ObjID new_object);
void draw_page_buttons(uchar full);
void inv_change_fullscreen(uchar on);
void inv_update_fullscreen(uchar full);
errtype inventory_update_screen_mode();
void push_inventory_cursors(LGCursor *newcurs);
void pop_inventory_cursors(void);
void super_drop_func(int dispnum, int row);
void super_use_func(int dispnum, int row);
void absorb_object_on_cursor(ushort keycode, uint32_t context, intptr_t data);
uchar cycle_weapons_func(ushort keycode, uint32_t context, intptr_t data);
void push_live_grenade_cursor(ObjID obj);
void set_current_active(int activenum);
void remove_general_item(ObjID obj);
void add_email_datamunge(short mung, uchar select);
void invent_language_change(void);
// Globals
extern short inventory_page;
extern short inv_last_page;
#endif // __INVENT_H
+51
View File
@@ -0,0 +1,51 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __INVPAGES_H
#define __INVPAGES_H
/*
* $Source: r:/prj/cit/src/inc/RCS/invpages.h $
* $Revision: 1.2 $
* $Author: mahk $
* $Date: 1994/07/28 23:07:14 $
*
*/
// ----------------------
// INVENTORY PAGE NUMBERS
// ----------------------
#define INV_BLANK_PAGE -1
#define INV_MAIN_PAGE 0
#define INV_HARDWARE_PAGE 1
#define INV_GENERAL_PAGE 2
#define INV_SOFTWARE_PAGE 5
#define INV_LOG_MAIN_PAGE 7
#define INV_DATA_PAGE 8
#define INV_AMMO_PAGE 9
#define INV_EMAIL0_PAGE 50
#define INV_EMAIL1_PAGE 51
#define INV_EMAIL2_PAGE 52
#define INV_LOG0_PAGE 20
#define INV_3DVIEW_PAGE -5
#define INV_EMAILTEXT_PAGE -10
#endif // __INVPAGES_H
+45
View File
@@ -0,0 +1,45 @@
/*
Copyright (C) 2020 Shockolate Project
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LEANMETR_H
#define LEANMETR_H
// ---------
// PROTOTYPES
// ---------
void set_base_lean_bmap(uchar shield);
fix compute_filter_weight(ulong deltat);
fix apply_weighted_filter(fix input, fix state, ulong deltat);
void slam_posture_meter_state(void);
fix velocity_crouch_filter(fix crouch);
void lean_icon(LGPoint *pos, grs_bitmap **icon, int *inum);
void player_reset_eye(void);
byte player_get_eye(void);
void player_set_eye_fixang(int ang);
int player_get_eye_fixang(void);
uchar eye_mouse_handler(uiEvent *ev, LGRegion *r, intptr_t);
uchar lean_mouse_handler(uiEvent *ev, LGRegion *r, intptr_t);
void init_posture_meters(LGRegion *root, uchar fullscreen);
void update_lean_meter(uchar force);
void draw_eye_bitmap(grs_bitmap *eye_bmap, LGPoint pos, int lasty);
void update_eye_meter(uchar force);
void update_meters(uchar force);
void zoom_to_lean_meter(void);
#endif
+27
View File
@@ -0,0 +1,27 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LOOPS_H
#define __LOOPS_H
#include "mainloop.h"
#include "gameloop.h"
#include "cybrloop.h"
#include "setploop.h"
#endif
+74
View File
@@ -0,0 +1,74 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LVLDATA_H
#define __LVLDATA_H
/*
* $Source: r:/prj/cit/src/inc/RCS/lvldata.h $
* $Revision: 1.6 $
* $Author: tjs $
* $Date: 1994/09/03 23:43:36 $
*
* $Log: lvldata.h $
* Revision 1.6 1994/09/03 23:43:36 tjs
* Automaps are in level_gamedata instead of being Malloc'd
*
* Revision 1.5 1994/08/11 18:31:40 mahk
* New enviro line
*
* Revision 1.4 1994/03/31 20:45:15 xemu
* zero grav for bio
*
* Revision 1.3 1994/02/08 02:00:21 mahk
* Added bio_h and rad_h
*
* Revision 1.2 1994/01/26 23:35:24 mahk
* New bio and rad regime.
*
* Revision 1.1 1993/11/19 05:30:36 mahk
* Initial revision
*
*
*/
// Includes
#include "amap.h" // for our scheme to put automaps in here.
// Game system data for each level.
typedef struct _level_data {
short size; // size of this structure.
uchar mist;
uchar gravity;
struct _hazard {
uchar rad;
uchar bio; // post-exposure damage, or gravity level
uchar zerogbio; // if this is true, bio is interpreted as zero gravity
uchar bio_h;
uchar rad_h;
} hazard;
ulong exit_time; // timestamp at which we exited the level
curAMap auto_maps[NUM_O_AMAP];
} LevelData;
extern LevelData level_gamedata;
#define OLD_LEVEL_GAMEDATA_SIZE 5 // for misc_saveload versions less than 5
#endif // __LVLDATA_H
+95
View File
@@ -0,0 +1,95 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __MAINLOOP_H
#define __MAINLOOP_H
#include "gameloop.h"
#include "frtypesx.h"
#define QUIT_LOOP -1
#define GAME_LOOP 0
#define FULLSCREEN_LOOP 1
#define EDIT_LOOP 2
#define CYBER_LOOP 3
#define SETUP_LOOP 4
#define MWORK_LOOP 5
#define CUTSCENE_LOOP 6
#define SVGA_LOOP 7
#define AUTOMAP_LOOP 8
#define ML 0x1000
#define GL 0x1100
#define EL 0x1200
#define CL 0x1400
#define SL 0x1800
#define WL 0x2000
#define FL 0x2100
#define AL 0x2200
#define ML_CHG_MASK 0xF000u /* mask for main loop bits in change_flag */
#define ML_CHG_BASE 0x1000u /* mask for single main loop bit of change_flag */
#define LL_CHG_MASK 0x0FFFu /* mask for local loop bits of change_flag */
#define LL_CHG_BASE 0x0001u /* mask for single local loop bit out of change_flag */
#define chg_set_flg(x) (_change_flag |= x)
#define chg_get_flg(x) (_change_flag & x)
#define chg_unset_flg(x) (_change_flag &= ~(x))
#define chg_set_sta(x) (_static_change |= x)
#define chg_get_sta(x) (_static_change & x)
#define chg_unset_sta(x) (_static_change &= ~(x))
#define GL_CHG_1 (ML_CHG_BASE << 0u)
#define GL_CHG_2 (ML_CHG_BASE << 1u)
#define GL_CHG_3 (ML_CHG_BASE << 2u)
#define GL_CHG_LOOP (ML_CHG_BASE << 3u)
void mainloop(int argc, char *argv[]);
void loopmode_switch(short *cmode);
errtype static_change_copy();
void loopmode_exit(short loopmode);
void loopmode_enter(short loopmode);
extern short _current_loop; // which loop we currently are
extern short _current_3d_flag;
extern frc *_current_fr_context;
#ifdef GADGET
extern Gadget *_current_root;
#endif
extern uint _change_flag; // change flags for loop
extern uint _static_change; // current static changes
extern short _new_mode; // mode to change to, if any
extern short _last_mode; // last mode we were in, to switch back to
extern uchar player_invulnerable;
extern uchar player_immortal;
extern uchar physics_running;
extern uchar ai_on;
extern uchar anim_on;
extern uchar always_render;
extern uchar saves_allowed;
extern uchar time_passes;
extern uchar pal_fx_on;
extern LGRegion *_current_view;
#define loopLine(num, code_line) code_line
#define localChanges (_change_flag & LL_CHG_MASK)
#define globalChanges (_change_flag & ML_CHG_MASK)
#endif
+427
View File
@@ -0,0 +1,427 @@
/*
Copyright (C) 2015-2018 Night Dive Studios, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __MAP_H
#define __MAP_H
/*
*
*
* $Source: r:/prj/cit/src/inc/RCS/map.h $
* $Revision: 1.41 $
* $Author: minman $
* $Date: 1994/08/28 02:38:51 $
*
* $Log: map.h $
* Revision 1.41 1994/08/28 02:38:51 minman
* hey / we have a correct macro for changing fixang to objang
*
* Revision 1.40 1994/07/21 16:28:25 dc
* im a moron, forgot to add reshifting to flags and all last night
* now ALL MUST PAY
* AND PAY
* BLOOD
* HAH HAH HAH HAH GURGLE
*
* Revision 1.39 1994/07/21 01:51:20 dc
* wanted to change some #defines
*
* Revision 1.38 1994/01/26 23:34:08 mahk
* Changed hazard bit stuff.
*
* Revision 1.37 1994/01/22 18:56:59 dc
* new map regieme, take 4
*
* Revision 1.36 1994/01/02 17:17:09 dc
* indoor terrain renderer
*
* Revision 1.35 1993/10/18 03:35:49 dc
* adding dumb-o @ifndef __SPEW
*
* Revision 1.34 1993/09/08 00:59:21 xemu
* increase map number...EIT!
* sorry, had to do it for loved_textures
*
* Revision 1.33 1993/09/06 05:57:19 mahk
* Map has been packed.
*
* Revision 1.31 1993/09/05 21:01:52 dc
* added the great "pile of translations"
* soon tilenames will get taken out, but not yet
*
*/
#include "schedtyp.h"
#define MAP_TYPES 32
#define MAP_NUM_TMAP1 128
#define MAP_NUM_TMAP2 32
#define MAP_NUM_TMAP3 16
#define MAP_HEIGHTS 32
#define MAP_PARAMS 16
#define TMAP_FLR 0
#define TMAP_WALL 1
#define TMAP_CEIL 2
#define HGT_CEIL 0
#define HGT_FLOOR 1
#define LITE_FLOOR 0
#define LITE_CEIL 1
#define MAP_SCHEDULE_GAMETIME 0
#define NUM_MAP_SCHEDULES 1
// CC: simplified savegames version
#define MAP_EASYSAVES_VERSION_NUMBER ((int)12)
#define MAP_VERSION_NUMBER ((int)11)
// so we auto convert from it
#define OLD_MAP
#define OLD_MAP_VERSION_NUMBER ((int)10)
// probably should kick it up to 16 bytes, expand one of the bitfields to three uchars instead
typedef struct _map_element {
// struct _bitfields
// {
// ushort tiletype:6;
// ushort flr_height:5;
// ushort ceil_height:5;
// };
uchar tiletype; // 2 free bits
uchar flr_rotnhgt; // 1 free bit
uchar ceil_rotnhgt; // 1 free bit
uchar param;
short objRef;
// struct _lighting
// {
// uchar floor:4;
// uchar ceil:4;
// } templight;
ushort tmap_ccolor;
// union _space
// {
// struct _tmaps
// {
// ushort floor:5;
// ushort ceil:5;
// ushort wall:6;
// } real;
// struct _cybcolors
// {
// uchar floor;
// uchar ceil;
// } cyber;
// } space;
uchar flag1; // KLC swapped around
uchar flag2;
uchar flag3;
uchar flag4; // rename these, perhaps
// ulong flags;
uchar sub_clip;
uchar clearsolid;
uchar flick_qclip;
uchar templight;
// struct _render_info {
// uchar sub_clip;
// uchar clear;
// uchar rotflr:2;
// uchar rotceil:2;
// uchar flicker:4;
// } rinfo;
} MapElem;
#ifdef OLD_MAP
typedef struct _omap_element {
//struct _bitfields {
// ushort tiletype : 6;
// ushort flr_height : 5;
// ushort ceil_height : 5;
//};
uchar param;
struct _lighting {
uchar floor : 4;
uchar ceil : 4;
} templight;
union _space {
struct _tmaps {
ushort floor : 5;
ushort ceil : 5;
ushort wall : 6;
} real;
struct _cybcolors {
uchar floor;
uchar ceil;
} cyber;
} space;
ulong flags;
short objRef;
struct _render_info {
uchar sub_clip;
uchar clear;
uchar rotflr : 2;
uchar rotceil : 2;
uchar flicker : 4;
} rinfo;
} oMapElem;
typedef struct {
int x_size, y_size;
int x_shft, y_shft, z_shft;
oMapElem *map;
uchar cyber;
int x_scale, y_scale, z_scale;
Schedule sched[NUM_MAP_SCHEDULES];
} oFullMap;
#define ome_tiletype(me_ptr) ((me_ptr)->tiletype)
#define ome_tmap_flr(me_ptr) ((me_ptr)->space.real.floor)
#define ome_tmap_wall(me_ptr) ((me_ptr)->space.real.wall)
#define ome_tmap_ceil(me_ptr) ((me_ptr)->space.real.ceil)
#define ome_tmap(me_ptr, idx) \
(((idx) == TMAP_FLR) ? me_tmap_flr(me_ptr) : (((idx) == TMAP_CEIL) ? me_tmap_ceil(me_ptr) : me_tmap_wall(me_ptr)))
#define ome_objref(me_ptr) ((me_ptr)->objRef)
#define ome_flags(me_ptr) ((me_ptr)->flags)
#define ome_height_flr(me_ptr) ((me_ptr)->flr_height)
#define ome_height_ceil(me_ptr) ((me_ptr)->ceil_height)
#define ome_param(me_ptr) ((me_ptr)->param)
#define ome_height(me_ptr,idx) (((idx) == HGT_FLOOR) ? me_height_flr(me_ptr) : me_height_ceil(me_ptr))
#define ome_cybcolor_flr(me_ptr) ((me_ptr)->space.cyber.floor)
#define ome_cybcolor_ceil(me_ptr) ((me_ptr)->space.cyber.ceil)
#define ome_templight_flr(me_ptr) ((me_ptr)->templight.floor)
#define ome_templight_ceil(me_ptr) ((me_ptr)->templight.ceil)
#define ome_subclip(me_ptr) ((me_ptr)->rinfo.sub_clip)
#define ome_clearsolid(me_ptr) ((me_ptr)->rinfo.clear)
#define ome_rotflr(me_ptr) ((me_ptr)->rinfo.rotflr)
#define ome_rotceil(me_ptr) ((me_ptr)->rinfo.rotceil)
#define ome_flicker(me_ptr) ((me_ptr)->rinfo.flicker)
#endif
typedef struct {
int32_t x_size, y_size;
int32_t x_shft, y_shft, z_shft;
MapElem *map;
uchar cyber;
int32_t x_scale, y_scale, z_scale;
Schedule sched[NUM_MAP_SCHEDULES];
} FullMap;
#define _me_normal_x(me_ptr, strname, maskname) ((me_ptr)->strname & (maskname##_MASK))
#define _me_normal_n(me_ptr, strname, maskname) (_me_normal_x(me_ptr, strname, maskname) >> maskname##_SHF)
#define _me_tiletype(me_ptr) ((me_ptr)->tiletype)
#define MAP_HGT_MASK 0x1f
#define MAP_HGT_SHF 0
#define _me_height_flr(me_ptr) _me_normal_x(me_ptr, flr_rotnhgt, MAP_HGT)
#define _me_height_ceil(me_ptr) _me_normal_x(me_ptr, ceil_rotnhgt, MAP_HGT)
#define _me_height(me_ptr, idx) (((idx) == HGT_FLOOR) ? me_height_flr(me_ptr) : me_height_ceil(me_ptr))
#define _me_param(me_ptr) ((me_ptr)->param)
#define _me_objref(me_ptr) ((me_ptr)->objRef)
#define MAP_TM_FLOOR_MASK 0xF800
#define MAP_TM_FLOOR_SHF 11
#define MAP_TM_CEIL_MASK 0x07C0
#define MAP_TM_CEIL_SHF 6
#define MAP_TM_WALL_MASK 0x003F
#define MAP_TM_WALL_SHF 0
#define _me_tmap_flr_x(me_ptr) _me_normal_x(me_ptr, tmap_ccolor, MAP_TM_FLOOR)
#define _me_tmap_flr(me_ptr) _me_normal_n(me_ptr, tmap_ccolor, MAP_TM_FLOOR)
#define _me_tmap_ceil_x(me_ptr) _me_normal_x(me_ptr, tmap_ccolor, MAP_TM_CEIL)
#define _me_tmap_ceil(me_ptr) _me_normal_n(me_ptr, tmap_ccolor, MAP_TM_CEIL)
#define _me_tmap_wall_x(me_ptr) _me_normal_x(me_ptr, tmap_ccolor, MAP_TM_WALL)
#define _me_tmap_wall(me_ptr) _me_normal_n(me_ptr, tmap_ccolor, MAP_TM_WALL)
#define _me_tmap(me_ptr, idx) \
(((idx) == TMAP_FLR) ? me_tmap_flr(me_ptr) : (((idx) == TMAP_CEIL) ? me_tmap_ceil(me_ptr) : me_tmap_wall(me_ptr)))
#define _me_cybcolor_flr(me_ptr) (*((uchar *)(&((me_ptr)->tmap_ccolor))))
#define _me_cybcolor_ceil(me_ptr) (*((uchar *)(&((me_ptr)->tmap_ccolor)) + 1))
// note this returns a long of form f4f3f2f1, so flag4 is most significant, as it were
#define _me_flags(me_ptr) (*((ulong *)(&((me_ptr)->flag1)))) // KLC changed
#define _me_flag1(me_ptr) ((me_ptr)->flag1)
#define _me_flag2(me_ptr) ((me_ptr)->flag2)
#define _me_flag3(me_ptr) ((me_ptr)->flag3)
#define _me_flag4(me_ptr) ((me_ptr)->flag4)
#define _me_subclip(me_ptr) ((me_ptr)->sub_clip)
#define _me_clearsolid(me_ptr) ((me_ptr)->clearsolid)
#define MAP_ROT_MASK 0x60
#define MAP_ROT_SHF 5
#define _me_rotflr_x(me_ptr) _me_normal_x(me_ptr, flr_rotnhgt, MAP_ROT)
#define _me_rotflr(me_ptr) _me_normal_n(me_ptr, flr_rotnhgt, MAP_ROT)
#define _me_rotceil_x(me_ptr) _me_normal_x(me_ptr, ceil_rotnhgt, MAP_ROT)
#define _me_rotceil(me_ptr) _me_normal_n(me_ptr, ceil_rotnhgt, MAP_ROT)
#define MAP_HAZARD_MASK 0x80
#define MAP_HAZARD_SHF 7
#define _me_hazard_bio_x(me_ptr) _me_normal_x(me_ptr, flr_rotnhgt, MAP_HAZARD)
#define _me_hazard_bio(me_ptr) _me_normal_n(me_ptr, flr_rotnhgt, MAP_HAZARD)
#define _me_hazard_rad_x(me_ptr) _me_normal_x(me_ptr, ceil_rotnhgt, MAP_HAZARD)
#define _me_hazard_rad(me_ptr) _me_normal_n(me_ptr, ceil_rotnhgt, MAP_HAZARD)
#define MAP_FLICKER_MASK 0xF0
#define MAP_FLICKER_SHF 4
#define MAP_QUICKCLIP_MASK 0x0F
#define MAP_QUICKCLIP_SHF 0
#define _me_flicker_x(me_ptr) _me_normal_x(me_ptr, flick_qclip, MAP_FLICKER)
#define _me_flicker(me_ptr) _me_normal_n(me_ptr, flick_qclip, MAP_FLICKER)
#define _me_quickclip_x(me_ptr) _me_normal_x(me_ptr, flick_qclip, MAP_QUICKCLIP)
#define _me_quickclip(me_ptr) _me_normal_n(me_ptr, flick_qclip, MAP_QUICKCLIP)
#define MAP_TLGHT_CEIL_MASK 0xF0
#define MAP_TLGHT_CEIL_SHF 4
#define MAP_TLGHT_FLOOR_MASK 0x0F
#define MAP_TLGHT_FLOOR_SHF 0
#define _me_templight_ceil_x(me_ptr) _me_normal_x(me_ptr, templight, MAP_TLGHT_CEIL)
#define _me_templight_ceil(me_ptr) _me_normal_n(me_ptr, templight, MAP_TLGHT_CEIL)
#define _me_templight_flr_x(me_ptr) _me_normal_x(me_ptr, templight, MAP_TLGHT_FLOOR)
#define _me_templight_flr(me_ptr) _me_normal_n(me_ptr, templight, MAP_TLGHT_FLOOR)
// implicit me_ptr and v
#define _me_merge_set(me_ptr, v, strname, maskname) \
((me_ptr)->strname = ((me_ptr)->strname & ~(maskname##_MASK)) | ((v) << (maskname##_SHF)))
// Now all the set primitives
#define _me_tiletype_set(me_ptr, v) ((me_ptr)->tiletype = (v))
#define _me_height_flr_set(me_ptr, v) _me_merge_set(me_ptr, v, flr_rotnhgt, MAP_HGT)
#define _me_height_ceil_set(me_ptr, v) _me_merge_set(me_ptr, v, ceil_rotnhgt, MAP_HGT)
#define _me_height_set(me_ptr, idx, v) \
(((idx) == HGT_FLOOR) ? me_height_flr_set(me_ptr, v) : me_height_ceil_set(me_ptr, v))
#define _me_param_set(me_ptr, v) ((me_ptr)->param = (v))
#define _me_objref_set(me_ptr, v) ((me_ptr)->objRef = (v))
#define _me_tmap_flr_set(me_ptr, v) _me_merge_set(me_ptr, v, tmap_ccolor, MAP_TM_FLOOR)
#define _me_tmap_ceil_set(me_ptr, v) _me_merge_set(me_ptr, v, tmap_ccolor, MAP_TM_CEIL)
#define _me_tmap_wall_set(me_ptr, v) _me_merge_set(me_ptr, v, tmap_ccolor, MAP_TM_WALL)
#define _me_tmap_set(me_ptr, idx, v) \
(((idx) == TMAP_FLR) ? me_tmap_flr_set(me_ptr, v) \
: (((idx) == TMAP_CEIL) ? me_tmap_ceil_set(me_ptr, v) : me_tmap_wall_set(me_ptr, v)))
#define _me_cybcolor_flr_set(me_ptr, v) (_me_cybcolor_flr(me_ptr) = (v))
#define _me_cybcolor_ceil_set(me_ptr, v) (_me_cybcolor_ceil(me_ptr) = (v))
#define _me_flags_set(me_ptr, v) (_me_flags(me_ptr) = (v))
#define _me_flag1_set(me_ptr, v) ((me_ptr)->flag1 = (v))
#define _me_flag2_set(me_ptr, v) ((me_ptr)->flag2 = (v))
#define _me_flag3_set(me_ptr, v) ((me_ptr)->flag3 = (v))
#define _me_flag4_set(me_ptr, v) ((me_ptr)->flag4 = (v))
#define _me_subclip_set(me_ptr, v) ((me_ptr)->sub_clip = (v))
#define _me_clearsolid_set(me_ptr, v) ((me_ptr)->clearsolid = (v))
#define _me_rotflr_set(me_ptr, v) _me_merge_set(me_ptr, v, flr_rotnhgt, MAP_ROT)
#define _me_rotceil_set(me_ptr, v) _me_merge_set(me_ptr, v, ceil_rotnhgt, MAP_ROT)
#define _me_hazard_bio_set(me_ptr, v) _me_merge_set(me_ptr, v, flr_rotnhgt, MAP_HAZARD)
#define _me_hazard_rad_set(me_ptr, v) _me_merge_set(me_ptr, v, ceil_rotnhgt, MAP_HAZARD)
#define _me_flicker_set(me_ptr, v) _me_merge_set(me_ptr, v, flick_qclip, MAP_FLICKER)
#define _me_quickclip_set(me_ptr, v) _me_merge_set(me_ptr, v, flick_qclip, MAP_QUICKCLIP)
#define _me_templight_ceil_set(me_ptr, v) _me_merge_set(me_ptr, v, templight, MAP_TLGHT_CEIL)
#define _me_templight_flr_set(me_ptr, v) _me_merge_set(me_ptr, v, templight, MAP_TLGHT_FLOOR)
// bind the non _ version of the macros correctly
#ifdef MAP_ACCESS_COUNT
#include "mapcount.h"
#else
#include "mapnorm.h"
#endif
extern MapElem *global_map;
extern FullMap *global_fullmap;
FullMap *map_create(int xshf, int yshf, int zshf, uchar cyb);
uchar map_set_default(FullMap *fmap);
void map_init(void);
void map_free(void);
#define DEFAULT_XSHF 6u
#define DEFAULT_YSHF 6u
#define DEFAULT_ZSHF 3u
#ifndef MAP_RESIZING
#define fm_x_sz(fm_ptr) (1u << DEFAULT_XSHF)
#define fm_y_sz(fm_ptr) (1u << DEFAULT_YSHF)
#define fm_x_shft(fm_ptr) (DEFAULT_XSHF)
#define fm_y_shft(fm_ptr) (DEFAULT_YSHF)
#else
#define fm_x_sz(fm_ptr) ((fm_ptr)->x_size)
#define fm_y_sz(fm_ptr) ((fm_ptr)->y_size)
#define fm_x_shft(fm_ptr) ((fm_ptr)->x_shft)
#define fm_y_shft(fm_ptr) ((fm_ptr)->y_shft)
#endif
#ifndef MAP_RESHIFTING
#define fm_z_shft(fm_ptr) (DEFAULT_ZSHF)
#else
#define fm_z_shft(fm_ptr) ((fm_ptr)->z_shft)
#endif
// look, non stupid non hardcoded defines, how wacky!
#define MAP_YSIZE (fm_y_sz(global_fullmap))
#define MAP_XSIZE (fm_x_sz(global_fullmap))
#define MAP_YSHF (fm_y_shft(global_fullmap))
#define MAP_XSHF (fm_x_shft(global_fullmap))
#define MAP_ZSHF (fm_z_shft(global_fullmap))
#define fm_map(fm_ptr) ((fm_ptr)->map)
#define MAP_MAP (fm_map(global_fullmap))
#define FULLMAP_GET_XY(fmap, x, y) ((fmap)->map + (x) + ((y) << fm_x_shft(fmap)))
#define MAP_GET_XY(x, y) FULLMAP_GET_XY(global_fullmap, x, y)
// who uses these?
#define MAP_ROWS 64
#define MAP_COLS 64
#define SLOPE_TOTAL 5u
#define SLOPE_SHIFT MAP_ZSHF
#define SLOPE_SHIFT_U SLOPE_SHIFT
#define SLOPE_SHIFT_D (SLOPE_TOTAL - SLOPE_SHIFT_U)
#define MAP_SC 256
#define MAP_SH 8
#define MAP_MK 0xff
#define MAP_MS 8
#ifdef SAFE_FIX
#define obj_coord_from_fix(fixval) ((fix_int((fixval)) & 0xFF) << 8) + (fix_frac((fixval)) >> 8)
#define obj_height_from_fix(fixval) (fix_int((fixval) * (1 << 8 - SLOPE_SHIFT_D)))
#define obj_angle_from_fix(fixval) (fix_int(fix_div((fixval), fix_2pi) * 255))
#define obj_angle_from_fixang(fixval) (fix_div((fixval), FIXANG_PI) >> 9)
#define fix_from_obj_coord(sval) (fix_make((sval) >> 8, ((sval)&0xFF) << 8))
#define fix_from_obj_height(oid) (ACK)
#define fix_from_obj_height_val(hval) (ACK)
#define fix_from_obj_angle(byteval) ((255 - fix_make(byteval, 0)) / 64)
#else
#define obj_coord_from_fix(fixval) ((int)(fixval) >> 8)
#define obj_height_from_fix(fixval) ((fixval) >> (8 + SLOPE_SHIFT_D))
#define obj_angle_from_fix(fixval) (fix_int(fix_div((fixval), fix_2pi) * 255))
#define obj_angle_from_fixang(fixval) (fix_div((fixval), FIXANG_PI) >> 9)
#define fix_from_obj_coord(sval) ((fix)(sval) << 8)
#define fix_from_obj_height(oid) ((fix)objs[(oid)].loc.z << (8u + SLOPE_SHIFT_D))
#define fix_from_obj_height_val(hval) ((hval) << (8 + SLOPE_SHIFT_D))
#define fix_from_obj_angle(byteval) ((255 - fix_make(byteval, 0)) / 64)
#endif
#define fix_inv2pi (fix_make(0, 10430))
#define obj_angle_from_phys(fixinrad) (64 - (((ushort)fix_div(fixinrad, fix_2pi)) >> 8))
#define phys_angle_from_obj(citang) (fix_mul((64 - citang) << 16, fix_2pi) >> 8)
#define phys_angle_from_fixang(fang) (fixang_to_fixrad(FIXANG_PI/2 - (fang))
#define fixang_from_phys_angle(fixdingus) (FIXANG_PI / 2 - fixrad_to_fixang(fixdingus))
// this stuff needs a safe fix version
#define fix_from_map_height(mht) (fix_make((mht), 0) >> SLOPE_SHIFT)
#define map_height_from_fix(fht) (fix_int(fht << SLOPE_SHIFT))
#endif // __MAP_H

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