mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 14:52:01 +00:00
Remove dead "polymer-perf" branch
git-svn-id: https://svn.eduke32.com/eduke32@3054 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
9120696e86
commit
902f4fb0ea
356 changed files with 0 additions and 239179 deletions
|
@ -1,11 +0,0 @@
|
|||
#ifndef __CONFIG_TYPES_H__
|
||||
#define __CONFIG_TYPES_H__
|
||||
|
||||
/* these are filled in by configure */
|
||||
typedef int16_t ogg_int16_t;
|
||||
typedef u_int16_t ogg_uint16_t;
|
||||
typedef int32_t ogg_int32_t;
|
||||
typedef u_int32_t ogg_uint32_t;
|
||||
typedef int64_t ogg_int64_t;
|
||||
|
||||
#endif
|
|
@ -1,202 +0,0 @@
|
|||
/********************************************************************
|
||||
* *
|
||||
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
|
||||
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||
* *
|
||||
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
|
||||
* by the Xiph.Org Foundation http://www.xiph.org/ *
|
||||
* *
|
||||
********************************************************************
|
||||
|
||||
function: toplevel libogg include
|
||||
last mod: $Id: ogg.h 7188 2004-07-20 07:26:04Z xiphmont $
|
||||
|
||||
********************************************************************/
|
||||
#ifndef _OGG_H
|
||||
#define _OGG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <ogg/os_types.h>
|
||||
|
||||
typedef struct {
|
||||
long endbyte;
|
||||
int endbit;
|
||||
|
||||
unsigned char *buffer;
|
||||
unsigned char *ptr;
|
||||
long storage;
|
||||
} oggpack_buffer;
|
||||
|
||||
/* ogg_page is used to encapsulate the data in one Ogg bitstream page *****/
|
||||
|
||||
typedef struct {
|
||||
unsigned char *header;
|
||||
long header_len;
|
||||
unsigned char *body;
|
||||
long body_len;
|
||||
} ogg_page;
|
||||
|
||||
/* ogg_stream_state contains the current encode/decode state of a logical
|
||||
Ogg bitstream **********************************************************/
|
||||
|
||||
typedef struct {
|
||||
unsigned char *body_data; /* bytes from packet bodies */
|
||||
long body_storage; /* storage elements allocated */
|
||||
long body_fill; /* elements stored; fill mark */
|
||||
long body_returned; /* elements of fill returned */
|
||||
|
||||
|
||||
int *lacing_vals; /* The values that will go to the segment table */
|
||||
ogg_int64_t *granule_vals; /* granulepos values for headers. Not compact
|
||||
this way, but it is simple coupled to the
|
||||
lacing fifo */
|
||||
long lacing_storage;
|
||||
long lacing_fill;
|
||||
long lacing_packet;
|
||||
long lacing_returned;
|
||||
|
||||
unsigned char header[282]; /* working space for header encode */
|
||||
int header_fill;
|
||||
|
||||
int e_o_s; /* set when we have buffered the last packet in the
|
||||
logical bitstream */
|
||||
int b_o_s; /* set after we've written the initial page
|
||||
of a logical bitstream */
|
||||
long serialno;
|
||||
long pageno;
|
||||
ogg_int64_t packetno; /* sequence number for decode; the framing
|
||||
knows where there's a hole in the data,
|
||||
but we need coupling so that the codec
|
||||
(which is in a seperate abstraction
|
||||
layer) also knows about the gap */
|
||||
ogg_int64_t granulepos;
|
||||
|
||||
} ogg_stream_state;
|
||||
|
||||
/* ogg_packet is used to encapsulate the data and metadata belonging
|
||||
to a single raw Ogg/Vorbis packet *************************************/
|
||||
|
||||
typedef struct {
|
||||
unsigned char *packet;
|
||||
long bytes;
|
||||
long b_o_s;
|
||||
long e_o_s;
|
||||
|
||||
ogg_int64_t granulepos;
|
||||
|
||||
ogg_int64_t packetno; /* sequence number for decode; the framing
|
||||
knows where there's a hole in the data,
|
||||
but we need coupling so that the codec
|
||||
(which is in a seperate abstraction
|
||||
layer) also knows about the gap */
|
||||
} ogg_packet;
|
||||
|
||||
typedef struct {
|
||||
unsigned char *data;
|
||||
int storage;
|
||||
int fill;
|
||||
int returned;
|
||||
|
||||
int unsynced;
|
||||
int headerbytes;
|
||||
int bodybytes;
|
||||
} ogg_sync_state;
|
||||
|
||||
/* Ogg BITSTREAM PRIMITIVES: bitstream ************************/
|
||||
|
||||
extern void oggpack_writeinit(oggpack_buffer *b);
|
||||
extern void oggpack_writetrunc(oggpack_buffer *b,long bits);
|
||||
extern void oggpack_writealign(oggpack_buffer *b);
|
||||
extern void oggpack_writecopy(oggpack_buffer *b,void *source,long bits);
|
||||
extern void oggpack_reset(oggpack_buffer *b);
|
||||
extern void oggpack_writeclear(oggpack_buffer *b);
|
||||
extern void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes);
|
||||
extern void oggpack_write(oggpack_buffer *b,unsigned long value,int bits);
|
||||
extern long oggpack_look(oggpack_buffer *b,int bits);
|
||||
extern long oggpack_look1(oggpack_buffer *b);
|
||||
extern void oggpack_adv(oggpack_buffer *b,int bits);
|
||||
extern void oggpack_adv1(oggpack_buffer *b);
|
||||
extern long oggpack_read(oggpack_buffer *b,int bits);
|
||||
extern long oggpack_read1(oggpack_buffer *b);
|
||||
extern long oggpack_bytes(oggpack_buffer *b);
|
||||
extern long oggpack_bits(oggpack_buffer *b);
|
||||
extern unsigned char *oggpack_get_buffer(oggpack_buffer *b);
|
||||
|
||||
extern void oggpackB_writeinit(oggpack_buffer *b);
|
||||
extern void oggpackB_writetrunc(oggpack_buffer *b,long bits);
|
||||
extern void oggpackB_writealign(oggpack_buffer *b);
|
||||
extern void oggpackB_writecopy(oggpack_buffer *b,void *source,long bits);
|
||||
extern void oggpackB_reset(oggpack_buffer *b);
|
||||
extern void oggpackB_writeclear(oggpack_buffer *b);
|
||||
extern void oggpackB_readinit(oggpack_buffer *b,unsigned char *buf,int bytes);
|
||||
extern void oggpackB_write(oggpack_buffer *b,unsigned long value,int bits);
|
||||
extern long oggpackB_look(oggpack_buffer *b,int bits);
|
||||
extern long oggpackB_look1(oggpack_buffer *b);
|
||||
extern void oggpackB_adv(oggpack_buffer *b,int bits);
|
||||
extern void oggpackB_adv1(oggpack_buffer *b);
|
||||
extern long oggpackB_read(oggpack_buffer *b,int bits);
|
||||
extern long oggpackB_read1(oggpack_buffer *b);
|
||||
extern long oggpackB_bytes(oggpack_buffer *b);
|
||||
extern long oggpackB_bits(oggpack_buffer *b);
|
||||
extern unsigned char *oggpackB_get_buffer(oggpack_buffer *b);
|
||||
|
||||
/* Ogg BITSTREAM PRIMITIVES: encoding **************************/
|
||||
|
||||
extern int ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op);
|
||||
extern int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og);
|
||||
extern int ogg_stream_flush(ogg_stream_state *os, ogg_page *og);
|
||||
|
||||
/* Ogg BITSTREAM PRIMITIVES: decoding **************************/
|
||||
|
||||
extern int ogg_sync_init(ogg_sync_state *oy);
|
||||
extern int ogg_sync_clear(ogg_sync_state *oy);
|
||||
extern int ogg_sync_reset(ogg_sync_state *oy);
|
||||
extern int ogg_sync_destroy(ogg_sync_state *oy);
|
||||
|
||||
extern char *ogg_sync_buffer(ogg_sync_state *oy, long size);
|
||||
extern int ogg_sync_wrote(ogg_sync_state *oy, long bytes);
|
||||
extern long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og);
|
||||
extern int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og);
|
||||
extern int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og);
|
||||
extern int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op);
|
||||
extern int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op);
|
||||
|
||||
/* Ogg BITSTREAM PRIMITIVES: general ***************************/
|
||||
|
||||
extern int ogg_stream_init(ogg_stream_state *os,int serialno);
|
||||
extern int ogg_stream_clear(ogg_stream_state *os);
|
||||
extern int ogg_stream_reset(ogg_stream_state *os);
|
||||
extern int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno);
|
||||
extern int ogg_stream_destroy(ogg_stream_state *os);
|
||||
extern int ogg_stream_eos(ogg_stream_state *os);
|
||||
|
||||
extern void ogg_page_checksum_set(ogg_page *og);
|
||||
|
||||
extern int ogg_page_version(ogg_page *og);
|
||||
extern int ogg_page_continued(ogg_page *og);
|
||||
extern int ogg_page_bos(ogg_page *og);
|
||||
extern int ogg_page_eos(ogg_page *og);
|
||||
extern ogg_int64_t ogg_page_granulepos(ogg_page *og);
|
||||
extern int ogg_page_serialno(ogg_page *og);
|
||||
extern long ogg_page_pageno(ogg_page *og);
|
||||
extern int ogg_page_packets(ogg_page *og);
|
||||
|
||||
extern void ogg_packet_clear(ogg_packet *op);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OGG_H */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
/********************************************************************
|
||||
* *
|
||||
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
|
||||
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||
* *
|
||||
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
|
||||
* by the Xiph.Org Foundation http://www.xiph.org/ *
|
||||
* *
|
||||
********************************************************************
|
||||
|
||||
function: #ifdef jail to whip a few platforms into the UNIX ideal.
|
||||
last mod: $Id: os_types.h 7524 2004-08-11 04:20:36Z conrad $
|
||||
|
||||
********************************************************************/
|
||||
#ifndef _OS_TYPES_H
|
||||
#define _OS_TYPES_H
|
||||
|
||||
/* make it easy on the folks that want to compile the libs with a
|
||||
different malloc than stdlib */
|
||||
#define _ogg_malloc malloc
|
||||
#define _ogg_calloc calloc
|
||||
#define _ogg_realloc realloc
|
||||
#define _ogg_free free
|
||||
|
||||
#if defined(_WIN32)
|
||||
|
||||
# if defined(__CYGWIN__)
|
||||
# include <_G_config.h>
|
||||
typedef _G_int64_t ogg_int64_t;
|
||||
typedef _G_int32_t ogg_int32_t;
|
||||
typedef _G_uint32_t ogg_uint32_t;
|
||||
typedef _G_int16_t ogg_int16_t;
|
||||
typedef _G_uint16_t ogg_uint16_t;
|
||||
# elif defined(__MINGW32__)
|
||||
typedef short ogg_int16_t;
|
||||
typedef unsigned short ogg_uint16_t;
|
||||
typedef int ogg_int32_t;
|
||||
typedef unsigned int ogg_uint32_t;
|
||||
typedef long long ogg_int64_t;
|
||||
typedef unsigned long long ogg_uint64_t;
|
||||
# elif defined(__MWERKS__)
|
||||
typedef long long ogg_int64_t;
|
||||
typedef int ogg_int32_t;
|
||||
typedef unsigned int ogg_uint32_t;
|
||||
typedef short ogg_int16_t;
|
||||
typedef unsigned short ogg_uint16_t;
|
||||
# else
|
||||
/* MSVC/Borland */
|
||||
typedef __int64 ogg_int64_t;
|
||||
typedef __int32 ogg_int32_t;
|
||||
typedef unsigned __int32 ogg_uint32_t;
|
||||
typedef __int16 ogg_int16_t;
|
||||
typedef unsigned __int16 ogg_uint16_t;
|
||||
# endif
|
||||
|
||||
#elif defined(__MACOS__)
|
||||
|
||||
# include <sys/types.h>
|
||||
typedef SInt16 ogg_int16_t;
|
||||
typedef UInt16 ogg_uint16_t;
|
||||
typedef SInt32 ogg_int32_t;
|
||||
typedef UInt32 ogg_uint32_t;
|
||||
typedef SInt64 ogg_int64_t;
|
||||
|
||||
#elif defined(__MACOSX__) /* MacOS X Framework build */
|
||||
|
||||
# include <sys/types.h>
|
||||
typedef int16_t ogg_int16_t;
|
||||
typedef u_int16_t ogg_uint16_t;
|
||||
typedef int32_t ogg_int32_t;
|
||||
typedef u_int32_t ogg_uint32_t;
|
||||
typedef int64_t ogg_int64_t;
|
||||
|
||||
#elif defined(__BEOS__)
|
||||
|
||||
/* Be */
|
||||
# include <inttypes.h>
|
||||
typedef int16_t ogg_int16_t;
|
||||
typedef u_int16_t ogg_uint16_t;
|
||||
typedef int32_t ogg_int32_t;
|
||||
typedef u_int32_t ogg_uint32_t;
|
||||
typedef int64_t ogg_int64_t;
|
||||
|
||||
#elif defined (__EMX__)
|
||||
|
||||
/* OS/2 GCC */
|
||||
typedef short ogg_int16_t;
|
||||
typedef unsigned short ogg_uint16_t;
|
||||
typedef int ogg_int32_t;
|
||||
typedef unsigned int ogg_uint32_t;
|
||||
typedef long long ogg_int64_t;
|
||||
|
||||
#elif defined (DJGPP)
|
||||
|
||||
/* DJGPP */
|
||||
typedef short ogg_int16_t;
|
||||
typedef int ogg_int32_t;
|
||||
typedef unsigned int ogg_uint32_t;
|
||||
typedef long long ogg_int64_t;
|
||||
|
||||
#elif defined(R5900)
|
||||
|
||||
/* PS2 EE */
|
||||
typedef long ogg_int64_t;
|
||||
typedef int ogg_int32_t;
|
||||
typedef unsigned ogg_uint32_t;
|
||||
typedef short ogg_int16_t;
|
||||
|
||||
#elif defined(__SYMBIAN32__)
|
||||
|
||||
/* Symbian GCC */
|
||||
typedef signed short ogg_int16_t;
|
||||
typedef unsigned short ogg_uint16_t;
|
||||
typedef signed int ogg_int32_t;
|
||||
typedef unsigned int ogg_uint32_t;
|
||||
typedef long long int ogg_int64_t;
|
||||
|
||||
#else
|
||||
|
||||
# include <sys/types.h>
|
||||
# include <ogg/config_types.h>
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _OS_TYPES_H */
|
|
@ -1,241 +0,0 @@
|
|||
/********************************************************************
|
||||
* *
|
||||
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
|
||||
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||
* *
|
||||
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
|
||||
* by the Xiph.Org Foundation http://www.xiph.org/ *
|
||||
|
||||
********************************************************************
|
||||
|
||||
function: libvorbis codec headers
|
||||
last mod: $Id: codec.h 13293 2007-07-24 00:09:47Z xiphmont $
|
||||
|
||||
********************************************************************/
|
||||
|
||||
#ifndef _vorbis_codec_h_
|
||||
#define _vorbis_codec_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <ogg/ogg.h>
|
||||
|
||||
typedef struct vorbis_info{
|
||||
int version;
|
||||
int channels;
|
||||
long rate;
|
||||
|
||||
/* The below bitrate declarations are *hints*.
|
||||
Combinations of the three values carry the following implications:
|
||||
|
||||
all three set to the same value:
|
||||
implies a fixed rate bitstream
|
||||
only nominal set:
|
||||
implies a VBR stream that averages the nominal bitrate. No hard
|
||||
upper/lower limit
|
||||
upper and or lower set:
|
||||
implies a VBR bitstream that obeys the bitrate limits. nominal
|
||||
may also be set to give a nominal rate.
|
||||
none set:
|
||||
the coder does not care to speculate.
|
||||
*/
|
||||
|
||||
long bitrate_upper;
|
||||
long bitrate_nominal;
|
||||
long bitrate_lower;
|
||||
long bitrate_window;
|
||||
|
||||
void *codec_setup;
|
||||
} vorbis_info;
|
||||
|
||||
/* vorbis_dsp_state buffers the current vorbis audio
|
||||
analysis/synthesis state. The DSP state belongs to a specific
|
||||
logical bitstream ****************************************************/
|
||||
typedef struct vorbis_dsp_state{
|
||||
int analysisp;
|
||||
vorbis_info *vi;
|
||||
|
||||
float **pcm;
|
||||
float **pcmret;
|
||||
int pcm_storage;
|
||||
int pcm_current;
|
||||
int pcm_returned;
|
||||
|
||||
int preextrapolate;
|
||||
int eofflag;
|
||||
|
||||
long lW;
|
||||
long W;
|
||||
long nW;
|
||||
long centerW;
|
||||
|
||||
ogg_int64_t granulepos;
|
||||
ogg_int64_t sequence;
|
||||
|
||||
ogg_int64_t glue_bits;
|
||||
ogg_int64_t time_bits;
|
||||
ogg_int64_t floor_bits;
|
||||
ogg_int64_t res_bits;
|
||||
|
||||
void *backend_state;
|
||||
} vorbis_dsp_state;
|
||||
|
||||
typedef struct vorbis_block{
|
||||
/* necessary stream state for linking to the framing abstraction */
|
||||
float **pcm; /* this is a pointer into local storage */
|
||||
oggpack_buffer opb;
|
||||
|
||||
long lW;
|
||||
long W;
|
||||
long nW;
|
||||
int pcmend;
|
||||
int mode;
|
||||
|
||||
int eofflag;
|
||||
ogg_int64_t granulepos;
|
||||
ogg_int64_t sequence;
|
||||
vorbis_dsp_state *vd; /* For read-only access of configuration */
|
||||
|
||||
/* local storage to avoid remallocing; it's up to the mapping to
|
||||
structure it */
|
||||
void *localstore;
|
||||
long localtop;
|
||||
long localalloc;
|
||||
long totaluse;
|
||||
struct alloc_chain *reap;
|
||||
|
||||
/* bitmetrics for the frame */
|
||||
long glue_bits;
|
||||
long time_bits;
|
||||
long floor_bits;
|
||||
long res_bits;
|
||||
|
||||
void *internal;
|
||||
|
||||
} vorbis_block;
|
||||
|
||||
/* vorbis_block is a single block of data to be processed as part of
|
||||
the analysis/synthesis stream; it belongs to a specific logical
|
||||
bitstream, but is independant from other vorbis_blocks belonging to
|
||||
that logical bitstream. *************************************************/
|
||||
|
||||
struct alloc_chain{
|
||||
void *ptr;
|
||||
struct alloc_chain *next;
|
||||
};
|
||||
|
||||
/* vorbis_info contains all the setup information specific to the
|
||||
specific compression/decompression mode in progress (eg,
|
||||
psychoacoustic settings, channel setup, options, codebook
|
||||
etc). vorbis_info and substructures are in backends.h.
|
||||
*********************************************************************/
|
||||
|
||||
/* the comments are not part of vorbis_info so that vorbis_info can be
|
||||
static storage */
|
||||
typedef struct vorbis_comment{
|
||||
/* unlimited user comment fields. libvorbis writes 'libvorbis'
|
||||
whatever vendor is set to in encode */
|
||||
char **user_comments;
|
||||
int *comment_lengths;
|
||||
int comments;
|
||||
char *vendor;
|
||||
|
||||
} vorbis_comment;
|
||||
|
||||
|
||||
/* libvorbis encodes in two abstraction layers; first we perform DSP
|
||||
and produce a packet (see docs/analysis.txt). The packet is then
|
||||
coded into a framed OggSquish bitstream by the second layer (see
|
||||
docs/framing.txt). Decode is the reverse process; we sync/frame
|
||||
the bitstream and extract individual packets, then decode the
|
||||
packet back into PCM audio.
|
||||
|
||||
The extra framing/packetizing is used in streaming formats, such as
|
||||
files. Over the net (such as with UDP), the framing and
|
||||
packetization aren't necessary as they're provided by the transport
|
||||
and the streaming layer is not used */
|
||||
|
||||
/* Vorbis PRIMITIVES: general ***************************************/
|
||||
|
||||
extern void vorbis_info_init(vorbis_info *vi);
|
||||
extern void vorbis_info_clear(vorbis_info *vi);
|
||||
extern int vorbis_info_blocksize(vorbis_info *vi,int zo);
|
||||
extern void vorbis_comment_init(vorbis_comment *vc);
|
||||
extern void vorbis_comment_add(vorbis_comment *vc, char *comment);
|
||||
extern void vorbis_comment_add_tag(vorbis_comment *vc,
|
||||
char *tag, char *contents);
|
||||
extern char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count);
|
||||
extern int vorbis_comment_query_count(vorbis_comment *vc, char *tag);
|
||||
extern void vorbis_comment_clear(vorbis_comment *vc);
|
||||
|
||||
extern int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb);
|
||||
extern int vorbis_block_clear(vorbis_block *vb);
|
||||
extern void vorbis_dsp_clear(vorbis_dsp_state *v);
|
||||
extern double vorbis_granule_time(vorbis_dsp_state *v,
|
||||
ogg_int64_t granulepos);
|
||||
|
||||
/* Vorbis PRIMITIVES: analysis/DSP layer ****************************/
|
||||
|
||||
extern int vorbis_analysis_init(vorbis_dsp_state *v,vorbis_info *vi);
|
||||
extern int vorbis_commentheader_out(vorbis_comment *vc, ogg_packet *op);
|
||||
extern int vorbis_analysis_headerout(vorbis_dsp_state *v,
|
||||
vorbis_comment *vc,
|
||||
ogg_packet *op,
|
||||
ogg_packet *op_comm,
|
||||
ogg_packet *op_code);
|
||||
extern float **vorbis_analysis_buffer(vorbis_dsp_state *v,int vals);
|
||||
extern int vorbis_analysis_wrote(vorbis_dsp_state *v,int vals);
|
||||
extern int vorbis_analysis_blockout(vorbis_dsp_state *v,vorbis_block *vb);
|
||||
extern int vorbis_analysis(vorbis_block *vb,ogg_packet *op);
|
||||
|
||||
extern int vorbis_bitrate_addblock(vorbis_block *vb);
|
||||
extern int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd,
|
||||
ogg_packet *op);
|
||||
|
||||
/* Vorbis PRIMITIVES: synthesis layer *******************************/
|
||||
extern int vorbis_synthesis_idheader(ogg_packet *op);
|
||||
extern int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,
|
||||
ogg_packet *op);
|
||||
|
||||
extern int vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi);
|
||||
extern int vorbis_synthesis_restart(vorbis_dsp_state *v);
|
||||
extern int vorbis_synthesis(vorbis_block *vb,ogg_packet *op);
|
||||
extern int vorbis_synthesis_trackonly(vorbis_block *vb,ogg_packet *op);
|
||||
extern int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb);
|
||||
extern int vorbis_synthesis_pcmout(vorbis_dsp_state *v,float ***pcm);
|
||||
extern int vorbis_synthesis_lapout(vorbis_dsp_state *v,float ***pcm);
|
||||
extern int vorbis_synthesis_read(vorbis_dsp_state *v,int samples);
|
||||
extern long vorbis_packet_blocksize(vorbis_info *vi,ogg_packet *op);
|
||||
|
||||
extern int vorbis_synthesis_halfrate(vorbis_info *v,int flag);
|
||||
extern int vorbis_synthesis_halfrate_p(vorbis_info *v);
|
||||
|
||||
/* Vorbis ERRORS and return codes ***********************************/
|
||||
|
||||
#define OV_FALSE -1
|
||||
#define OV_EOF -2
|
||||
#define OV_HOLE -3
|
||||
|
||||
#define OV_EREAD -128
|
||||
#define OV_EFAULT -129
|
||||
#define OV_EIMPL -130
|
||||
#define OV_EINVAL -131
|
||||
#define OV_ENOTVORBIS -132
|
||||
#define OV_EBADHEADER -133
|
||||
#define OV_EVERSION -134
|
||||
#define OV_ENOTAUDIO -135
|
||||
#define OV_EBADPACKET -136
|
||||
#define OV_EBADLINK -137
|
||||
#define OV_ENOSEEK -138
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
|
|
@ -1,112 +0,0 @@
|
|||
/********************************************************************
|
||||
* *
|
||||
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
|
||||
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||
* *
|
||||
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
|
||||
* by the Xiph.Org Foundation http://www.xiph.org/ *
|
||||
* *
|
||||
********************************************************************
|
||||
|
||||
function: vorbis encode-engine setup
|
||||
last mod: $Id: vorbisenc.h 13293 2007-07-24 00:09:47Z xiphmont $
|
||||
|
||||
********************************************************************/
|
||||
|
||||
#ifndef _OV_ENC_H_
|
||||
#define _OV_ENC_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include "codec.h"
|
||||
|
||||
extern int vorbis_encode_init(vorbis_info *vi,
|
||||
long channels,
|
||||
long rate,
|
||||
|
||||
long max_bitrate,
|
||||
long nominal_bitrate,
|
||||
long min_bitrate);
|
||||
|
||||
extern int vorbis_encode_setup_managed(vorbis_info *vi,
|
||||
long channels,
|
||||
long rate,
|
||||
|
||||
long max_bitrate,
|
||||
long nominal_bitrate,
|
||||
long min_bitrate);
|
||||
|
||||
extern int vorbis_encode_setup_vbr(vorbis_info *vi,
|
||||
long channels,
|
||||
long rate,
|
||||
|
||||
float quality /* quality level from 0. (lo) to 1. (hi) */
|
||||
);
|
||||
|
||||
extern int vorbis_encode_init_vbr(vorbis_info *vi,
|
||||
long channels,
|
||||
long rate,
|
||||
|
||||
float base_quality /* quality level from 0. (lo) to 1. (hi) */
|
||||
);
|
||||
|
||||
extern int vorbis_encode_setup_init(vorbis_info *vi);
|
||||
|
||||
extern int vorbis_encode_ctl(vorbis_info *vi,int number,void *arg);
|
||||
|
||||
/* deprecated rate management supported only for compatability */
|
||||
#define OV_ECTL_RATEMANAGE_GET 0x10
|
||||
#define OV_ECTL_RATEMANAGE_SET 0x11
|
||||
#define OV_ECTL_RATEMANAGE_AVG 0x12
|
||||
#define OV_ECTL_RATEMANAGE_HARD 0x13
|
||||
|
||||
struct ovectl_ratemanage_arg {
|
||||
int management_active;
|
||||
|
||||
long bitrate_hard_min;
|
||||
long bitrate_hard_max;
|
||||
double bitrate_hard_window;
|
||||
|
||||
long bitrate_av_lo;
|
||||
long bitrate_av_hi;
|
||||
double bitrate_av_window;
|
||||
double bitrate_av_window_center;
|
||||
};
|
||||
|
||||
|
||||
/* new rate setup */
|
||||
#define OV_ECTL_RATEMANAGE2_GET 0x14
|
||||
#define OV_ECTL_RATEMANAGE2_SET 0x15
|
||||
|
||||
struct ovectl_ratemanage2_arg {
|
||||
int management_active;
|
||||
|
||||
long bitrate_limit_min_kbps;
|
||||
long bitrate_limit_max_kbps;
|
||||
long bitrate_limit_reservoir_bits;
|
||||
double bitrate_limit_reservoir_bias;
|
||||
|
||||
long bitrate_average_kbps;
|
||||
double bitrate_average_damping;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#define OV_ECTL_LOWPASS_GET 0x20
|
||||
#define OV_ECTL_LOWPASS_SET 0x21
|
||||
|
||||
#define OV_ECTL_IBLOCK_GET 0x30
|
||||
#define OV_ECTL_IBLOCK_SET 0x31
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -1,183 +0,0 @@
|
|||
/********************************************************************
|
||||
* *
|
||||
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
|
||||
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||
* *
|
||||
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
|
||||
* by the Xiph.Org Foundation http://www.xiph.org/ *
|
||||
* *
|
||||
********************************************************************
|
||||
|
||||
function: stdio-based convenience library for opening/seeking/decoding
|
||||
last mod: $Id: vorbisfile.h 13293 2007-07-24 00:09:47Z xiphmont $
|
||||
|
||||
********************************************************************/
|
||||
|
||||
#ifndef _OV_FILE_H_
|
||||
#define _OV_FILE_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "codec.h"
|
||||
|
||||
/* The function prototypes for the callbacks are basically the same as for
|
||||
* the stdio functions fread, fseek, fclose, ftell.
|
||||
* The one difference is that the FILE * arguments have been replaced with
|
||||
* a void * - this is to be used as a pointer to whatever internal data these
|
||||
* functions might need. In the stdio case, it's just a FILE * cast to a void *
|
||||
*
|
||||
* If you use other functions, check the docs for these functions and return
|
||||
* the right values. For seek_func(), you *MUST* return -1 if the stream is
|
||||
* unseekable
|
||||
*/
|
||||
typedef struct {
|
||||
size_t (*read_func) (void *ptr, size_t size, size_t nmemb, void *datasource);
|
||||
int (*seek_func) (void *datasource, ogg_int64_t offset, int whence);
|
||||
int (*close_func) (void *datasource);
|
||||
long (*tell_func) (void *datasource);
|
||||
} ov_callbacks;
|
||||
|
||||
/* a few sets of convenient callbacks, especially for use under
|
||||
* Windows where ov_open_callbacks() should always be used instead of
|
||||
* ov_open() to avoid problems with incompatable crt.o version linking
|
||||
* issues. */
|
||||
|
||||
static int _ov_header_fseek_wrap(FILE *f,ogg_int64_t off,int whence){
|
||||
if(f==NULL)return(-1);
|
||||
return fseek(f,off,whence);
|
||||
}
|
||||
|
||||
static ov_callbacks OV_CALLBACKS_DEFAULT = {
|
||||
(size_t (*)(void *, size_t, size_t, void *)) fread,
|
||||
(int (*)(void *, ogg_int64_t, int)) _ov_header_fseek_wrap,
|
||||
(int (*)(void *)) fclose,
|
||||
(long (*)(void *)) ftell
|
||||
};
|
||||
|
||||
static ov_callbacks OV_CALLBACKS_NOCLOSE = {
|
||||
(size_t (*)(void *, size_t, size_t, void *)) fread,
|
||||
(int (*)(void *, ogg_int64_t, int)) _ov_header_fseek_wrap,
|
||||
(int (*)(void *)) NULL,
|
||||
(long (*)(void *)) ftell
|
||||
};
|
||||
|
||||
static ov_callbacks OV_CALLBACKS_STREAMONLY = {
|
||||
(size_t (*)(void *, size_t, size_t, void *)) fread,
|
||||
(int (*)(void *, ogg_int64_t, int)) NULL,
|
||||
(int (*)(void *)) fclose,
|
||||
(long (*)(void *)) NULL
|
||||
};
|
||||
|
||||
static ov_callbacks OV_CALLBACKS_STREAMONLY_NOCLOSE = {
|
||||
(size_t (*)(void *, size_t, size_t, void *)) fread,
|
||||
(int (*)(void *, ogg_int64_t, int)) NULL,
|
||||
(int (*)(void *)) NULL,
|
||||
(long (*)(void *)) NULL
|
||||
};
|
||||
|
||||
#define NOTOPEN 0
|
||||
#define PARTOPEN 1
|
||||
#define OPENED 2
|
||||
#define STREAMSET 3
|
||||
#define INITSET 4
|
||||
|
||||
typedef struct OggVorbis_File {
|
||||
void *datasource; /* Pointer to a FILE *, etc. */
|
||||
int seekable;
|
||||
ogg_int64_t offset;
|
||||
ogg_int64_t end;
|
||||
ogg_sync_state oy;
|
||||
|
||||
/* If the FILE handle isn't seekable (eg, a pipe), only the current
|
||||
stream appears */
|
||||
int links;
|
||||
ogg_int64_t *offsets;
|
||||
ogg_int64_t *dataoffsets;
|
||||
long *serialnos;
|
||||
ogg_int64_t *pcmlengths; /* overloaded to maintain binary
|
||||
compatability; x2 size, stores both
|
||||
beginning and end values */
|
||||
vorbis_info *vi;
|
||||
vorbis_comment *vc;
|
||||
|
||||
/* Decoding working state local storage */
|
||||
ogg_int64_t pcm_offset;
|
||||
int ready_state;
|
||||
long current_serialno;
|
||||
int current_link;
|
||||
|
||||
double bittrack;
|
||||
double samptrack;
|
||||
|
||||
ogg_stream_state os; /* take physical pages, weld into a logical
|
||||
stream of packets */
|
||||
vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
|
||||
vorbis_block vb; /* local working space for packet->PCM decode */
|
||||
|
||||
ov_callbacks callbacks;
|
||||
|
||||
} OggVorbis_File;
|
||||
|
||||
|
||||
extern int ov_clear(OggVorbis_File *vf);
|
||||
extern int ov_fopen(char *path,OggVorbis_File *vf);
|
||||
extern int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
|
||||
extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf,
|
||||
char *initial, long ibytes, ov_callbacks callbacks);
|
||||
|
||||
extern int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
|
||||
extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf,
|
||||
char *initial, long ibytes, ov_callbacks callbacks);
|
||||
extern int ov_test_open(OggVorbis_File *vf);
|
||||
|
||||
extern long ov_bitrate(OggVorbis_File *vf,int i);
|
||||
extern long ov_bitrate_instant(OggVorbis_File *vf);
|
||||
extern long ov_streams(OggVorbis_File *vf);
|
||||
extern long ov_seekable(OggVorbis_File *vf);
|
||||
extern long ov_serialnumber(OggVorbis_File *vf,int i);
|
||||
|
||||
extern ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i);
|
||||
extern ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i);
|
||||
extern double ov_time_total(OggVorbis_File *vf,int i);
|
||||
|
||||
extern int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos);
|
||||
extern int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos);
|
||||
extern int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos);
|
||||
extern int ov_time_seek(OggVorbis_File *vf,double pos);
|
||||
extern int ov_time_seek_page(OggVorbis_File *vf,double pos);
|
||||
|
||||
extern int ov_raw_seek_lap(OggVorbis_File *vf,ogg_int64_t pos);
|
||||
extern int ov_pcm_seek_lap(OggVorbis_File *vf,ogg_int64_t pos);
|
||||
extern int ov_pcm_seek_page_lap(OggVorbis_File *vf,ogg_int64_t pos);
|
||||
extern int ov_time_seek_lap(OggVorbis_File *vf,double pos);
|
||||
extern int ov_time_seek_page_lap(OggVorbis_File *vf,double pos);
|
||||
|
||||
extern ogg_int64_t ov_raw_tell(OggVorbis_File *vf);
|
||||
extern ogg_int64_t ov_pcm_tell(OggVorbis_File *vf);
|
||||
extern double ov_time_tell(OggVorbis_File *vf);
|
||||
|
||||
extern vorbis_info *ov_info(OggVorbis_File *vf,int link);
|
||||
extern vorbis_comment *ov_comment(OggVorbis_File *vf,int link);
|
||||
|
||||
extern long ov_read_float(OggVorbis_File *vf,float ***pcm_channels,int samples,
|
||||
int *bitstream);
|
||||
extern long ov_read(OggVorbis_File *vf,char *buffer,int length,
|
||||
int bigendianp,int word,int sgned,int *bitstream);
|
||||
extern int ov_crosslap(OggVorbis_File *vf1,OggVorbis_File *vf2);
|
||||
|
||||
extern int ov_halfrate(OggVorbis_File *vf,int flag);
|
||||
extern int ov_halfrate_p(OggVorbis_File *vf);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,84 +0,0 @@
|
|||
EDuke32:
|
||||
|
||||
Added: activatecheat CON command to trick the game into thinking a specific cheat was typed in
|
||||
Added: addlogvar console command to print the value of a gamevar
|
||||
Added: althud to get/setuserdef to allow forcing the althud on or off
|
||||
Added: ambient light level slider in video setup and r_ambientlight cvar
|
||||
Added: a menu option and cvar to control crosshair size
|
||||
Added: animtilerange to .def format to allow assigning animation flags to dummytiles
|
||||
Added: basic Mac OSX support
|
||||
Added: cmenu CON command and current_menu special gamevar to jump to a different menu index when a menu is being drawn
|
||||
Added: code to automatically replace "SPACE" in quote 13 with "OPEN"
|
||||
Added: color code support to minitext
|
||||
Added: CON access to tsprite via new EVENT_ANIMATESPRITES event and gettspr/settspr commands
|
||||
Added: crosshairscale to get/setuserdef to allow manipulation of the crosshair size
|
||||
Added: display_bonus_screen to setuserdef to allow coders to force the bonus screen to display when using startlevel
|
||||
Added: drag-and-drop support for maps, CONs, GRPs, et cetera
|
||||
Added: experimental software-based 3D model visibility checking (r_modelocclusionchecking)
|
||||
Added: extended control over console text display via osdeditpal/osdeditshade/osdhightile/osdpromptpal/osdpromptshade/osdtextmode/osdtextshade/osdtextpal cvars and a new menu option to switch console text between "nice" sprite-based rendering and "fast" internal text rendering
|
||||
Added: gettimedate CON command to get the current month/day/year/time into gamevars
|
||||
Added: htflags member to get/setactor to control the spritenoshade/spritenvg/spriteshadow flags
|
||||
Added: line numbers to in-game CON errors thrown when attempting to operate on invalid data and improved error messages
|
||||
Added: map listing printout to "map" console command when no map name is given
|
||||
Added: menu option to control multiplayer death messages and cvar r_obituaries
|
||||
Added: mod directory selection to startup and unified "configuration" and "game" tabs of startup window
|
||||
Added: new alternate version of the small HUD (enabled by default) and a menu option to turn it off if so desired and several hud_* cvars to control it
|
||||
Added: new brightness/contrast/gamma controls and new cvars vid_brightness, vid_contrast and vid_gamma
|
||||
Added: new sound configuration menu which allows changing bitrate, sample size and voices in-game
|
||||
Added: obituaries to get/setuserdef to allow forcing the multiplayer obituaries on or off
|
||||
Added: r_downsize cvar and texture quality slider to video settings menu, defaults to medium and allows hightile textures without the nocompress flag to be scaled down to improve performance
|
||||
Added: r_fullbrights cvar to control rendering fullbright pixels for 8-bit tiles in OpenGL
|
||||
Added: savemapstate/loadmapstate/clearmapstate commands to manipulate map states and GAMEVAR_FLAG_NORESET (131072) to allow specific gamevars to be preserved when the map state is loaded
|
||||
Added: scriptsize CON command to set the CON script size manually to avoid resizing the chunk of memory several times at startup with large CONs
|
||||
Added: setdefname CON command to set the name of the definitions file to be loaded
|
||||
Added: setgamepalette CON command to change between normal/water/slime/nightvision palettes manually
|
||||
Added: support for changing the crosshair color via the crosshaircolor console command
|
||||
Added: support for changing the window title of a mod via the setgamename command
|
||||
Added: support for colored console text
|
||||
Added: support for importing configuration data from duke3d.cfg when a config specified by command line or CON isn't found
|
||||
Added: support for saving/loading the state of a map separately from savegames, enabling Hexen and Half-Life style map setups
|
||||
Added: vsync menu option and cvar (r_swapinterval)
|
||||
Changed: adjusted framerate counter averaging
|
||||
Changed: improved detection of external IP address for multiplayer
|
||||
Changed: improved multiplayer text line wrapping
|
||||
Changed: improved startup time on Windows
|
||||
Changed: increased max sound definitions to 2560
|
||||
Changed: modified ldist to return 0 instead of 1 when the points checked are the same, but changed CON divide-by-zero errors into soft errors
|
||||
Changed: renamed binds.cfg to cfgname_binds.cfg, where cfgname is the name of the main configuration file in use
|
||||
Changed: reworked HUD level stats display
|
||||
Changed: updated user map menu
|
||||
Changed: various fairly insignificant optimizations
|
||||
Changed: various improvements to many other menus
|
||||
Fixed: 8-bit fullscreen palette corruption bug
|
||||
Fixed: autoloading from directories other than ~/.eduke32/autoload on Linux
|
||||
Fixed: bounds checking for htg_t member used with getactor/setactor
|
||||
Fixed: bug where a projectile's extra_rand wasn't applied with certain weapon flags
|
||||
Fixed: bug where hitscan projectile trails would continue through walls after the projectile hit
|
||||
Fixed: bug with console command history and added new "history" command to print out the current history
|
||||
Fixed: console crash with TCs without tile 1141
|
||||
Fixed: gibs not assuming the palette of the actor which spawned them in all cases
|
||||
Fixed: occasional crash when spawning a sprite with no owner
|
||||
Fixed: out-of-sync bug with DeathMessages = 0 in cfg
|
||||
Fixed: problems with definemodelframe and nonexistent models
|
||||
Fixed: problem with devistator rocket timing which caused an unintentional nerf of the devistator's damage
|
||||
Fixed: problem with eshoot returning -1 when firing RPGs
|
||||
Fixed: problem with invalid gamearray definitions mangling further errors in the log
|
||||
Fixed: problem with model rendering when using animation blending and added option to toggle it to the video menu
|
||||
Fixed: problem with weapon up/down transition when using pipebombs with PIPEBOMB_CONTROL set to PIPEBOMB_TIMER
|
||||
Fixed: random CON value corruption issue which occurred dependent on the memory addresses and size of the compiled CON code
|
||||
Fixed: several situations in which invalid memory access occurred while using noclip
|
||||
Fixed: text spacing problem with gametext
|
||||
|
||||
Mapster32:
|
||||
|
||||
Added: gradient background in tile selector info at bottom of screen to improve readability
|
||||
Added: drag-and-drop support for maps, GRPs, et cetera
|
||||
Changed: improved tile grouping support, tiles.cfg now controls the various Duke-specific actor and item related functions in 2D mode as well as 2D mode sprite colors
|
||||
Changed: use underwater palette when in an underwater sector
|
||||
Fixed: bug where wall coordinate editing didn't properly move both sides of a wall
|
||||
Fixed: crash with previous/next map in dir shortcut keys when a .map file in the current directory is invalid
|
||||
Fixed: issue in file selector where sometimes jumping to a map on the list by typing the first letter of its name would leave you at the wrong place in the map list
|
||||
Fixed: possible crashes due to invalid memory access associated with the file selector
|
||||
Fixed: problem where sometimes the tile selector would select the wrong tile
|
||||
Fixed: problem where the tile group list wouldn't refresh after alt-tab
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<meta name="Author" content="TX" />
|
||||
<title>ChangeLog for EDuke32</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: "Bitstream Vera Sans","Tahoma","Arial",sans-serif;
|
||||
font-size: 10pt;
|
||||
margin: 0.5em;
|
||||
border: 2px dashed #ccc;
|
||||
padding: 1em;
|
||||
}
|
||||
h2,h3,h4 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0.5em;
|
||||
color: #777;
|
||||
}
|
||||
h1 {
|
||||
margin-top: 0; margin-bottom: 0.5em;
|
||||
padding: 3px;
|
||||
background-color: #ddd;
|
||||
font-size: 170%;
|
||||
color: #444;
|
||||
}
|
||||
h2 { font-size: 145%; }
|
||||
h3 { font-size: 125%; }
|
||||
h4 { font-size: 110%; }
|
||||
p { margin-top: 0.5em; margin-bottom: 0.75em; }
|
||||
pre { margin-left: 0.75em; padding-left: 0.75em; border-left: 2px solid #ddd; }
|
||||
|
||||
dl { margin-left: 3em; }
|
||||
dt { font-weight: bold; }
|
||||
dd { padding-bottom: 1em; margin-left: 2em; }
|
||||
table { margin: 1em; }
|
||||
table.center { margin-left: auto; margin-right: auto; }
|
||||
caption { font-style: oblique; }
|
||||
|
||||
span.warning { color: #f00; }
|
||||
|
||||
address {
|
||||
margin-top: 3em;
|
||||
font-size: 85%;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@media print {
|
||||
body { border: none; margin: 0; }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>ChangeLog for EDuke32</h1>
|
||||
<p>1.4.0 beta 2, released July 18, 2006</p>
|
||||
|
||||
<h2>Core changes</h2>
|
||||
<ul>
|
||||
<li>reworked/enhanced Polymost shading</li>
|
||||
<li>cleaned up code to properly build without Polymost/OpenGL support</li>
|
||||
<li>added widescreen support for Polymost</li>
|
||||
<li>added support for toggling correct HUD model rendering on/off</li>
|
||||
<li>removed broken support for linking OpenGL statically</li>
|
||||
<li>added support for DDS textures (JF)</li>
|
||||
<li>added support for dynamically loading GTK (JF)</li>
|
||||
</ul>
|
||||
<h2>Game changes</h2>
|
||||
<ul>
|
||||
<li>new startup window (JF)</li>
|
||||
<li>added support for using the mouse and a joystick simultaneously (JF)</li>
|
||||
<li>fixed an issue preventing skill selection, bonus screen and episode ending animation sounds from playing</li>
|
||||
<li>fixed a problem where the player was unable to exit some pools of water in some maps</li>
|
||||
<li>made further adjustments to the weapon properties in order to more closely emulate Duke 1.5</li>
|
||||
<li>fixed an issue where you could disable map exits in multiplayer, have all players quit, start a single player game and then have exits continue to kill you</li>
|
||||
</ul>
|
||||
<h2>Multiplayer changes</h2>
|
||||
<ul>
|
||||
<li>fixed numerous minor bugs in the voting system</li>
|
||||
<li>added a more noticeable message to indicate that the player hasn't voted yet in an active vote</li>
|
||||
<li>added support for /me in text chat</li>
|
||||
<li>increased size of player chat icon</li>
|
||||
<li>added "nat-free" support from Adam Fazakerley</li>
|
||||
<li>fixed inventory respawn bug</li>
|
||||
<li>minor fixes to DukesterX 1.5 compatibility wrapper</li>
|
||||
</ul>
|
||||
<h2>CON changes</h2>
|
||||
<ul>
|
||||
<li>reworked movement_lock member of the player struct to use bit flags</li>
|
||||
<li>reworked findnearactor3d, findnearactor3dvar, findnearsprite3d, and findnearsprite3dvar</li>
|
||||
<li>added findnearactorz, findnearactorzvar, findnearspritez, and findnearspritezvar</li>
|
||||
<li>added WEAPON_FLAG_RESET (65536) to weapon system in order to properly emulate the chaingun and freezer</li>
|
||||
<li>fixed "eshoot" and added "ezshoot"</li>
|
||||
<li>reworked weapon system; note that your custom weapons may need adjustments to work again</li>
|
||||
<li>updated sample enhance.con</li>
|
||||
</ul>
|
||||
|
||||
<p><br />Please see JonoF's JFDuke3D release notes <a href="http://www.jonof.id.au/modsuppt/jfduke3d/releasenotes.html">here</a> for information on features JFDuke3D shares with EDuke32</p>
|
||||
|
||||
<address>Richard "TerminX" Gobeille (<a href="mailto:terminx@gmail.com">terminx@gmail.com</a>)</address>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
Preamble
|
||||
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
|
||||
|
||||
|
||||
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
|
||||
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
|
||||
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
|
||||
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
|
||||
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
|
@ -1,47 +0,0 @@
|
|||
# GNU Makefile to prepare source and binary distributions.
|
||||
# make -f MakeDistributions [source|binary]
|
||||
|
||||
SOURCEFILES=GNU.TXT buildlic.txt \
|
||||
Makefile Makefile.deps Makefile.msvc Makefile.watcom MakeDistributions \
|
||||
duke3d.def.sample SEHELP.HLP STHELP.HLP enhance.con.sample names.h
|
||||
|
||||
BINARYFILES=mapster32.exe eduke32.exe GNU.TXT buildlic.txt \
|
||||
ChangeLog.html setup.exe duke3d.def.sample SEHELP.HLP STHELP.HLP \
|
||||
ChangeLog enhance.con.sample duke3d_w32.exe names.h
|
||||
|
||||
.PHONY: source binary
|
||||
|
||||
datenow=$(shell date +%Y%m%d)
|
||||
|
||||
sourcedir=eduke32_src_$(datenow)
|
||||
binarydir=eduke32_$(datenow)
|
||||
|
||||
all: source binary
|
||||
|
||||
source:
|
||||
rm -rf $(sourcedir) $(sourcedir).zip
|
||||
mkdir -p $(sourcedir) $(sourcedir)/eobj $(sourcedir)/obj
|
||||
mkdir -p $(sourcedir)/eobj.nix $(sourcedir)/obj.nix
|
||||
touch $(sourcedir)/eobj/keep.me $(sourcedir)/obj/keep.me
|
||||
touch $(sourcedir)/eobj.nix/keep.me $(sourcedir)/obj.nix/keep.me
|
||||
cp $(SOURCEFILES) $(sourcedir)
|
||||
find . -name "*~" -exec rm -rf '{}' ';';
|
||||
find . -name "*.orig" -exec rm -rf '{}' ';';
|
||||
find . -name "*.rej" -exec rm -rf '{}' ';';
|
||||
find . -name "*.mine" -exec rm -rf '{}' ';';
|
||||
find . -name "*.c.r*" -exec rm -rf '{}' ';';
|
||||
find . -name "*.h.r*" -exec rm -rf '{}' ';';
|
||||
cp -R source rsrc $(sourcedir)
|
||||
find $(sourcedir) | grep -i svn | xargs rm -rf
|
||||
kzip -r $(sourcedir).zip $(sourcedir)
|
||||
|
||||
binary:
|
||||
make RELEASE=1
|
||||
# upx -9 mapster32.exe eduke32.exe duke3d_w32.exe setup.exe
|
||||
rm -rf $(binarydir)
|
||||
mkdir $(binarydir)
|
||||
# mkdir $(binarydir) $(binarydir)/models
|
||||
cp $(BINARYFILES) $(binarydir)
|
||||
# cp models/* $(binarydir)/models
|
||||
kzip -r $(binarydir).zip $(binarydir)
|
||||
|
|
@ -1,305 +0,0 @@
|
|||
#
|
||||
# EDuke32 Makefile for GNU Make
|
||||
#
|
||||
|
||||
include Makefile.common
|
||||
|
||||
|
||||
# SDK locations - adjust to match your setup
|
||||
ifneq ($(DXROOT_OVERRIDE),)
|
||||
DXROOT=$(DXROOT_OVERRIDE)
|
||||
else
|
||||
DXROOT=../sdk/dx
|
||||
#DXROOT=c:/sdks/directx/dx8
|
||||
endif
|
||||
|
||||
|
||||
# Build locations
|
||||
SRC=source
|
||||
RSRC=rsrc
|
||||
ESRC=$(EROOT)/src
|
||||
EINC=$(EROOT)/include
|
||||
INC=$(SRC)
|
||||
o=o
|
||||
# ENETROOT=$(ESRC)/enet
|
||||
|
||||
ifneq (0,$(RELEASE))
|
||||
# Debugging disabled
|
||||
debug+= $(F_NO_STACK_PROTECTOR)
|
||||
else
|
||||
# Debugging enabled
|
||||
ifneq (0,$(KRANDDEBUG))
|
||||
debug+= -fno-inline -fno-inline-functions -fno-inline-functions-called-once
|
||||
endif
|
||||
endif
|
||||
|
||||
OURCFLAGS=$(BASECFLAGS) \
|
||||
-I$(INC) -I$(EINC) -I$(SRC)/jmact -I$(JAUDIOLIBDIR)/include -I$(ENETDIR)/include \
|
||||
$(ARCH)
|
||||
|
||||
OURCXXFLAGS=$(BASECXXFLAGS)
|
||||
NASMFLAGS=$(BASEASFLAGS)
|
||||
|
||||
|
||||
JAUDIOLIBDIR=$(SRC)/jaudiolib
|
||||
JAUDIOLIB=libjfaudiolib.a
|
||||
|
||||
ENETDIR=$(SRC)/enet
|
||||
ENETLIB=libenet.a
|
||||
|
||||
include $(EROOT)/Makefile.shared
|
||||
|
||||
|
||||
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
OBJ=obj_win
|
||||
EOBJ=eobj_win
|
||||
LIBS+= $(L_SSP) -Wl,--enable-auto-import
|
||||
else
|
||||
LIBS+= -ldl -pthread
|
||||
ifneq (0,$(PROFILER))
|
||||
LIBS+= -lprofiler
|
||||
debug+= -pg
|
||||
endif
|
||||
OBJ=obj
|
||||
EOBJ=eobj
|
||||
endif
|
||||
|
||||
JMACTOBJ=$(OBJ)/file_lib.$o \
|
||||
$(OBJ)/control.$o \
|
||||
$(OBJ)/keyboard.$o \
|
||||
$(OBJ)/mouse.$o \
|
||||
$(OBJ)/mathutil.$o \
|
||||
$(OBJ)/scriplib.$o \
|
||||
$(OBJ)/animlib.$o
|
||||
|
||||
GAMEOBJS=$(OBJ)/game.$o \
|
||||
$(OBJ)/actors.$o \
|
||||
$(OBJ)/anim.$o \
|
||||
$(OBJ)/config.$o \
|
||||
$(OBJ)/demo.$o \
|
||||
$(OBJ)/gamedef.$o \
|
||||
$(OBJ)/gameexec.$o \
|
||||
$(OBJ)/gamevars.$o \
|
||||
$(OBJ)/global.$o \
|
||||
$(OBJ)/menus.$o \
|
||||
$(OBJ)/namesdyn.$o \
|
||||
$(OBJ)/net.$o \
|
||||
$(OBJ)/player.$o \
|
||||
$(OBJ)/premap.$o \
|
||||
$(OBJ)/savegame.$o \
|
||||
$(OBJ)/sector.$o \
|
||||
$(OBJ)/rts.$o \
|
||||
$(OBJ)/osdfuncs.$o \
|
||||
$(OBJ)/osdcmds.$o \
|
||||
$(OBJ)/grpscan.$o \
|
||||
$(OBJ)/sounds.$o \
|
||||
$(JMACTOBJ)
|
||||
|
||||
EDITOROBJS=$(OBJ)/astub.$o \
|
||||
$(OBJ)/m32def.$o \
|
||||
$(OBJ)/m32exec.$o \
|
||||
$(OBJ)/m32vars.$o \
|
||||
$(OBJ)/mathutil.$o \
|
||||
$(OBJ)/sounds_mapster32.$o
|
||||
|
||||
# PLATFORM SPECIFIC SETTINGS
|
||||
|
||||
ifeq ($(PLATFORM),LINUX)
|
||||
OURCFLAGS += -fno-pic
|
||||
NASMFLAGS += -f elf
|
||||
LIBS += -lvorbisfile -lvorbis -logg
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),DARWIN)
|
||||
ifeq (1,$(SDL_FRAMEWORK))
|
||||
APPLE_INCLUDE_DIR=$(abspath Apple/include)
|
||||
OURCFLAGS += -fno-pic -I$(APPLE_INCLUDE_DIR) -I/Library/Frameworks/SDL.framework/Headers \
|
||||
-I/Library/Frameworks/SDL_mixer.framework/Headers
|
||||
LIBS += -read_only_relocs suppress -LApple/lib -lvorbisfile -lvorbis -logg -lm \
|
||||
-Wl,-framework,SDL -Wl,-framework,SDL_mixer Apple/lib/libSDLmain.a \
|
||||
-Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,OpenGL \
|
||||
-Wl,-framework,CoreMidi -Wl,-framework,AudioUnit \
|
||||
-Wl,-framework,AudioToolbox -Wl,-framework,IOKit -Wl,-framework,AGL \
|
||||
-Wl,-framework,QuickTime -lm
|
||||
# I like to have the SDLMain.m from the OSX SDL package to be in this dir:
|
||||
LIBS += $(realpath SDLMain.m)
|
||||
else
|
||||
OURCFLAGS += -fno-pic -I$(SDLROOT)/include -I$(SDLROOT)/include/SDL
|
||||
LIBS += -read_only_relocs suppress -lvorbisfile -lvorbis -logg -lm -lSDL_mixer \
|
||||
-Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,OpenGL \
|
||||
-Wl,-framework,CoreMidi -Wl,-framework,AudioUnit \
|
||||
-Wl,-framework,AudioToolbox -Wl,-framework,IOKit -Wl,-framework,AGL \
|
||||
-Wl,-framework,QuickTime -lm
|
||||
endif
|
||||
NASMFLAGS += -f Mach-O
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
OURCFLAGS += -fno-pic -DUNDERSCORES -I$(DXROOT)/include
|
||||
NASMFLAGS+= -DUNDERSCORES -f win32
|
||||
LIBS += -L$(JAUDIOLIBDIR)/third-party/mingw32/lib -lvorbisfile -lvorbis -logg -lwsock32 -lws2_32 -lwinmm -ldsound
|
||||
GAMEOBJS+= $(OBJ)/gameres.$o $(OBJ)/winbits.$o $(OBJ)/startwin.game.$o $(OBJ)/music.$o $(OBJ)/midi.$o $(OBJ)/mpu401.$o
|
||||
EDITOROBJS+= $(OBJ)/buildres.$o
|
||||
JAUDIOLIB=libjfaudiolib_win32.a
|
||||
ENETLIB=libenet_win32.a
|
||||
else
|
||||
# -lGLU to build with gluBuild2DMipmaps
|
||||
ifeq ($(RENDERTYPE),SDL)
|
||||
ifeq (0,$(SDL_FRAMEWORK))
|
||||
OURCFLAGS+= $(subst -Dmain=SDL_main,,$(shell $(SDLCONFIG) --cflags))
|
||||
LIBS+= -lSDL_mixer
|
||||
else
|
||||
OURCFLAGS += -DSDL_FRAMEWORK
|
||||
endif
|
||||
|
||||
ifeq (1,$(HAVE_GTK2))
|
||||
OURCFLAGS+= -DHAVE_GTK2 $(shell pkg-config --cflags gtk+-2.0)
|
||||
GAMEOBJS+= $(OBJ)/game_banner.$o $(OBJ)/startgtk.game.$o
|
||||
EDITOROBJS+= $(OBJ)/editor_banner.$o
|
||||
endif
|
||||
|
||||
GAMEOBJS+= $(OBJ)/game_icon.$o $(OBJ)/sdlmusic.$o
|
||||
EDITOROBJS+= $(OBJ)/build_icon.$o
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
OURCFLAGS+= $(BUILDCFLAGS)
|
||||
OURCXXFLAGS+= $(BUILDCFLAGS)
|
||||
|
||||
MISCLINKOPTS=
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
MISCLINKOPTS+= -Wl,--large-address-aware
|
||||
endif
|
||||
ifneq (0,$(KRANDDEBUG))
|
||||
MISCLINKOPTS+=-Wl,-Map=$@.memmap
|
||||
endif
|
||||
ifneq (0,$(PROFILER))
|
||||
MISCLINKOPTS+=-pg
|
||||
endif
|
||||
|
||||
ifeq ($(PRETTY_OUTPUT),1)
|
||||
.SILENT:
|
||||
endif
|
||||
.PHONY: clean all engine $(EOBJ)/$(ENGINELIB) $(EOBJ)/$(EDITORLIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(ENETDIR)/$(ENETLIB)
|
||||
|
||||
# TARGETS
|
||||
|
||||
all: notice eduke32$(EXESUFFIX) mapster32$(EXESUFFIX)
|
||||
|
||||
all:
|
||||
$(BUILD_FINISHED)
|
||||
@ls -l eduke32$(EXESUFFIX)
|
||||
@ls -l mapster32$(EXESUFFIX)
|
||||
|
||||
notice:
|
||||
$(BUILD_STARTED)
|
||||
|
||||
eduke32$(EXESUFFIX): $(GAMEOBJS) $(EOBJ)/$(ENGINELIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(ENETDIR)/$(ENETLIB)
|
||||
$(LINK_STATUS)
|
||||
if $(CC) $(CFLAGS) $(OURCFLAGS) -o $@ $^ $(LIBS) $(STDCPPLIB) $(MISCLINKOPTS); then $(LINK_OK); else $(LINK_FAILED); fi
|
||||
ifeq (1,$(RELEASE))
|
||||
ifeq (0,$(DEBUGANYWAY))
|
||||
$(STRIP) eduke32$(EXESUFFIX)
|
||||
endif
|
||||
endif
|
||||
|
||||
mapster32$(EXESUFFIX): $(EDITOROBJS) $(EOBJ)/$(EDITORLIB) $(EOBJ)/$(ENGINELIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB)
|
||||
$(LINK_STATUS)
|
||||
if $(CC) $(CFLAGS) $(OURCFLAGS) -o $@ $^ $(LIBS) $(STDCPPLIB) $(MISCLINKOPTS); then $(LINK_OK); else $(LINK_FAILED); fi
|
||||
ifeq (1,$(RELEASE))
|
||||
ifeq (0,$(DEBUGANYWAY))
|
||||
$(STRIP) mapster32$(EXESUFFIX)
|
||||
endif
|
||||
endif
|
||||
|
||||
include Makefile.deps
|
||||
|
||||
.PHONY: enginelib editorlib
|
||||
enginelib editorlib:
|
||||
-mkdir -p $(EOBJ)
|
||||
ifeq ($(PRETTY_OUTPUT),1)
|
||||
printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)/$(EROOT)\033[0;35m \033[0m\n"
|
||||
endif
|
||||
$(MAKE) -C $(EROOT)/ "OBJ=../$(EOBJ)" $@
|
||||
#\
|
||||
DEBUGANYWAY=$(DEBUGANYWAY) KRANDDEBUG=$(KRANDDEBUG)\
|
||||
USE_OPENGL=$(USE_OPENGL) BUILD32_ON_64=$(BUILD32_ON_64) PROFILER=$(PROFILER)\
|
||||
NOASM=$(NOASM) NEDMALLOC=$(NEDMALLOC) RELEASE=$(RELEASE) OPTLEVEL=$(OPTLEVEL) $@
|
||||
ifeq ($(PRETTY_OUTPUT),1)
|
||||
printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)\033[0;35m \033[0m\n"
|
||||
endif
|
||||
|
||||
$(EOBJ)/$(ENGINELIB): enginelib
|
||||
$(EOBJ)/$(EDITORLIB): editorlib
|
||||
$(JAUDIOLIBDIR)/$(JAUDIOLIB):
|
||||
ifeq ($(PRETTY_OUTPUT),1)
|
||||
printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)/$(JAUDIOLIBDIR)\033[0;35m \033[0m\n"
|
||||
endif
|
||||
$(MAKE) -C $(JAUDIOLIBDIR) #PRETTY_OUTPUT=$(PRETTY_OUTPUT) EROOT=$(EROOT) RELEASE=$(RELEASE) OPTLEVEL=$(OPTLEVEL) DEBUGANYWAY=$(DEBUGANYWAY)
|
||||
ifeq ($(PRETTY_OUTPUT),1)
|
||||
printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)\033[0;35m \033[0m\n"
|
||||
endif
|
||||
|
||||
$(ENETDIR)/$(ENETLIB):
|
||||
ifeq ($(PRETTY_OUTPUT),1)
|
||||
printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)/$(ENETDIR)\033[0;35m \033[0m\n"
|
||||
endif
|
||||
$(MAKE) -C $(ENETDIR) #PRETTY_OUTPUT=$(PRETTY_OUTPUT) EROOT=$(EROOT) RELEASE=$(RELEASE) OPTLEVEL=$(OPTLEVEL)
|
||||
ifeq ($(PRETTY_OUTPUT),1)
|
||||
printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)\033[0;35m \033[0m\n"
|
||||
endif
|
||||
|
||||
|
||||
# RULES
|
||||
$(OBJ)/%.$o: $(SRC)/%.nasm
|
||||
$(COMPILE_STATUS)
|
||||
$(AS) $(NASMFLAGS) $< -o $@
|
||||
|
||||
$(OBJ)/%.$o: $(SRC)/%.c
|
||||
$(COMPILE_STATUS)
|
||||
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
||||
|
||||
$(OBJ)/%.$o: $(SRC)/%.cpp
|
||||
$(COMPILE_STATUS)
|
||||
if $(CXX) $(CXXFLAGS) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
||||
|
||||
$(OBJ)/%.$o: $(SRC)/jmact/%.c
|
||||
$(COMPILE_STATUS)
|
||||
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
||||
|
||||
$(OBJ)/%.$o: $(SRC)/misc/%.rc
|
||||
$(COMPILE_STATUS)
|
||||
if $(RC) -i $< -o $@ --include-dir=$(EINC) --include-dir=$(SRC) -DPOLYMER=$(POLYMER); then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
||||
|
||||
$(OBJ)/%.$o: $(SRC)/util/%.c
|
||||
$(COMPILE_STATUS)
|
||||
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
||||
|
||||
$(OBJ)/%.$o: $(RSRC)/%.c
|
||||
$(COMPILE_STATUS)
|
||||
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
||||
|
||||
$(OBJ)/game_banner.$o: $(RSRC)/game_banner.c
|
||||
$(COMPILE_STATUS)
|
||||
if $(CC) $(CFLAGS) $(OURCFLAGS) -Wno-pointer-sign -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
||||
|
||||
$(OBJ)/editor_banner.$o: $(RSRC)/editor_banner.c
|
||||
$(COMPILE_STATUS)
|
||||
if $(CC) $(CFLAGS) $(OURCFLAGS) -Wno-pointer-sign -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
||||
|
||||
$(RSRC)/game_banner.c: $(RSRC)/game.bmp
|
||||
echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@
|
||||
gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
|
||||
$(RSRC)/editor_banner.c: $(RSRC)/build.bmp
|
||||
echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@
|
||||
gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
|
||||
|
||||
# PHONIES
|
||||
|
||||
clean:
|
||||
-rm -f $(OBJ)/* eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) core* duke3d_w32$(EXESUFFIX) && $(MAKE) -C $(JAUDIOLIBDIR) clean && $(MAKE) -C $(ENETDIR) clean
|
||||
|
||||
veryclean: clean
|
||||
-rm -f $(EOBJ)/* $(RSRC)/*banner*
|
|
@ -1,101 +0,0 @@
|
|||
|
||||
## common definitions for Makefile, build/Makefile, source/enet/Makefile and
|
||||
## source/jaudiolib/Makefile
|
||||
|
||||
# Use colored output
|
||||
PRETTY_OUTPUT ?= 1
|
||||
|
||||
# DirectX SDK location - if nonempty, overrides the DXROOTs of the individual
|
||||
# Makefiles. Should be set to an absolute path since this Makefile is included
|
||||
# at different directory levels
|
||||
DXROOT_OVERRIDE:=
|
||||
|
||||
# Engine options
|
||||
# USE_OPENGL - enables basic OpenGL Polymost renderer
|
||||
# POLYMER - enables fancy Polymer renderer
|
||||
# NOASM - disables the use of inline assembly pragmas
|
||||
# LINKED_GTK - enables compile-time linkage to GTK
|
||||
#
|
||||
POLYMER = 1
|
||||
USE_OPENGL = 1
|
||||
NOASM = 0
|
||||
LINKED_GTK = 0
|
||||
BUILD32_ON_64 = 0
|
||||
NEDMALLOC = 1
|
||||
|
||||
ifeq (0,$(USE_OPENGL))
|
||||
POLYMER = 0
|
||||
endif
|
||||
|
||||
|
||||
# Debugging/Build options
|
||||
# RELEASE - 1 = no debugging
|
||||
# DEBUGANYWAY - 1 = include debug symbols even when generating release code
|
||||
# KRANDDEBUG - 1 = include logging of krand() calls for debugging the demo system
|
||||
# EFENCE - 1 = compile with Electric Fence for malloc() debugging
|
||||
# OPTLEVEL - 0..3 = GCC optimization strategy
|
||||
#
|
||||
RELEASE?=1
|
||||
DEBUGANYWAY?=0
|
||||
KRANDDEBUG?=0
|
||||
EFENCE?=0
|
||||
OPTLEVEL?=2
|
||||
PROFILER?=0
|
||||
NOSOUND?=0
|
||||
|
||||
ifneq (0,$(KRANDDEBUG))
|
||||
RELEASE=0
|
||||
endif
|
||||
ifneq (0,$(PROFILER))
|
||||
DEBUGANYWAY=1
|
||||
endif
|
||||
|
||||
|
||||
# Tools
|
||||
CC=gcc
|
||||
CXX=g++
|
||||
AS=nasm
|
||||
AR=ar
|
||||
RC=windres
|
||||
RANLIB=ranlib
|
||||
STRIP=strip
|
||||
|
||||
# compiler flags etc.
|
||||
LIBS=-lm
|
||||
ifneq (0,$(RELEASE))
|
||||
# Debugging disabled
|
||||
debug=-fomit-frame-pointer -funswitch-loops -O$(OPTLEVEL)
|
||||
else
|
||||
# Debugging enabled
|
||||
debug=-ggdb -O0 -DDEBUGGINGAIDS
|
||||
ifeq ($(PLATFORM),LINUX)
|
||||
LIBS+=-rdynamic
|
||||
endif
|
||||
ifneq (0,$(PROFILER))
|
||||
LIBS+= -lprofiler
|
||||
debug+= -pg
|
||||
endif
|
||||
ifneq (0,$(KRANDDEBUG))
|
||||
debug+=-DKRANDDEBUG=1
|
||||
endif
|
||||
endif
|
||||
ifneq (0,$(DEBUGANYWAY))
|
||||
debug+=-ggdb
|
||||
endif
|
||||
|
||||
W_NO_UNUSED_RESULT := $(shell echo '' | $(CC) -E -Wno-unused-result - 2>/dev/null && echo -Wno-unused-result)
|
||||
W_NO_UNUSED_RESULT := $(findstring -Wno-unused-result,$(W_NO_UNUSED_RESULT))
|
||||
|
||||
BASECFLAGS=$(debug) -W -Wall -Wimplicit -Werror-implicit-function-declaration \
|
||||
-funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -D_FORTIFY_SOURCE=2 \
|
||||
$(F_JUMP_TABLES) $(W_NO_UNUSED_RESULT)
|
||||
|
||||
BASECXXFLAGS= -fno-exceptions -fno-rtti
|
||||
BASEASFLAGS=-s #-g
|
||||
|
||||
|
||||
# Misc. stuff that is constant between Makefiles
|
||||
EROOT:=build
|
||||
|
||||
# will be potentially overridden in build/Makefile.shared
|
||||
EXESUFFIX=
|
|
@ -1,67 +0,0 @@
|
|||
duke3d_h=$(EINC)/build.h $(EINC)/polymer.h $(EINC)/pragmas.h $(EINC)/compat.h $(EINC)/cache1d.h $(EINC)/baselayer.h $(SRC)/jmact/file_lib.h $(SRC)/jmact/keyboard.h $(SRC)/jmact/control.h $(INC)/gamedefs.h $(INC)/function.h $(INC)/config.h $(INC)/sounds.h $(INC)/rts.h $(INC)/_rts.h $(INC)/soundefs.h $(JAUDIOLIBDIR)/include/fx_man.h $(JAUDIOLIBDIR)/include/music.h $(INC)/namesdyn.h $(INC)/duke3d.h $(INC)/player.h $(INC)/sector.h $(INC)/game.h $(INC)/actors.h
|
||||
|
||||
gamedef_h=$(SRC)/gamedef.h $(SRC)/gameexec.h $(SRC)/gamevars.h
|
||||
|
||||
$(OBJ)/game.$o: $(SRC)/game.c $(SRC)/jmact/scriplib.h $(duke3d_h) $(INC)/osdfuncs.h $(INC)/osdcmds.h $(INC)/grpscan.h $(INC)/demo.h
|
||||
$(OBJ)/actors.$o: $(SRC)/actors.c $(duke3d_h)
|
||||
$(OBJ)/anim.$o: $(SRC)/anim.c $(duke3d_h) $(SRC)/jmact/animlib.h
|
||||
$(OBJ)/demo.$o: $(SRC)/demo.c $(duke3d_h)
|
||||
$(OBJ)/gamedef.$o: $(SRC)/gamedef.c $(duke3d_h) $(gamedef_h)
|
||||
$(OBJ)/gameexec.$o: $(SRC)/gameexec.c $(SRC)/gamestructures.c $(duke3d_h) $(gamedef_h)
|
||||
$(OBJ)/gamestructures.$o: $(SRC)/gamestructures.c $(duke3d_h) $(gamedef_h)
|
||||
$(OBJ)/gamevars.$o: $(SRC)/gamevars.c $(SRC)/gamestructures.c $(duke3d_h) $(gamedef_h)
|
||||
$(OBJ)/global.$o: $(SRC)/*.c $(SRC)/global.c $(duke3d_h)
|
||||
$(OBJ)/mdump.$o: $(SRC)/mdump.cpp $(SRC)/mdump.h
|
||||
$(OBJ)/menus.$o: $(SRC)/menus.c $(duke3d_h) $(SRC)/jmact/mouse.h
|
||||
$(OBJ)/namesdyn.$o: $(SRC)/namesdyn.c $(duke3d_h)
|
||||
$(OBJ)/net.$o: $(SRC)/net.c $(duke3d_h)
|
||||
$(OBJ)/player.$o: $(SRC)/player.c $(duke3d_h)
|
||||
$(OBJ)/premap.$o: $(SRC)/premap.c $(duke3d_h) $(EINC)/osd.h
|
||||
$(OBJ)/savegame.$o: $(SRC)/savegame.c $(duke3d_h)
|
||||
$(OBJ)/sector.$o: $(SRC)/sector.c $(duke3d_h)
|
||||
$(OBJ)/sounds.$o: $(SRC)/sounds.c $(duke3d_h)
|
||||
$(OBJ)/rts.$o: $(SRC)/rts.c $(duke3d_h)
|
||||
$(OBJ)/config.$o: $(SRC)/config.c $(duke3d_h) $(SRC)/jmact/scriplib.h $(INC)/_functio.h
|
||||
$(OBJ)/winbits.$o: $(SRC)/winbits.c
|
||||
$(OBJ)/osdfuncs.$o: $(SRC)/names.h $(EINC)/build.h $(EINC)/osd.h
|
||||
$(OBJ)/osdcmds.$o: $(SRC)/osdcmds.c $(INC)/osdcmds.h $(EINC)/osd.h $(duke3d_h)
|
||||
|
||||
$(OBJ)/astub.$o: $(SRC)/astub.c $(SRC)/mapster32.h $(EINC)/build.h $(EINC)/pragmas.h $(EINC)/compat.h $(EINC)/editor.h
|
||||
|
||||
$(OBJ)/game_icon.$o: $(RSRC)/game_icon.c
|
||||
$(OBJ)/build_icon.$o: $(RSRC)/build_icon.c
|
||||
|
||||
$(OBJ)/grpscan.$o: $(SRC)/grpscan.c $(EINC)/compat.h $(EINC)/baselayer.h $(EINC)/scriptfile.h $(EINC)/cache1d.h $(EINC)/crc32.h $(INC)/grpscan.h
|
||||
$(OBJ)/gameres.$o: $(SRC)/misc/gameres.rc $(SRC)/startwin.game.h $(RSRC)/game.bmp $(RSRC)/game_icon.ico
|
||||
$(OBJ)/buildres.$o: $(SRC)/misc/buildres.rc $(EINC)/startwin.editor.h $(RSRC)/build.bmp $(RSRC)/build_icon.ico
|
||||
$(OBJ)/startwin.game.$o: $(SRC)/startwin.game.c $(duke3d_h) $(EINC)/build.h $(EINC)/winlayer.h $(EINC)/compat.h $(INC)/grpscan.h
|
||||
$(OBJ)/startgtk.game.$o: $(SRC)/startgtk.game.c $(duke3d_h) $(EINC)/dynamicgtk.h $(EINC)/build.h $(EINC)/baselayer.h $(EINC)/compat.h
|
||||
|
||||
|
||||
# jMACT objects
|
||||
$(OBJ)/animlib.$o: $(SRC)/jmact/animlib.c $(SRC)/jmact/animlib.h $(EINC)/compat.h
|
||||
$(OBJ)/file_lib.$o: $(SRC)/jmact/file_lib.c $(SRC)/jmact/file_lib.h
|
||||
$(OBJ)/control.$o: $(SRC)/jmact/control.c $(SRC)/jmact/control.h $(SRC)/jmact/keyboard.h $(SRC)/jmact/mouse.h $(EINC)/baselayer.h
|
||||
$(OBJ)/keyboard.$o: $(SRC)/jmact/keyboard.c $(SRC)/jmact/keyboard.h $(EINC)/compat.h $(EINC)/baselayer.h
|
||||
$(OBJ)/mouse.$o: $(SRC)/jmact/mouse.c $(SRC)/jmact/mouse.h $(EINC)/baselayer.h
|
||||
$(OBJ)/mathutil.$o: $(SRC)/jmact/mathutil.c
|
||||
$(OBJ)/scriplib.$o: $(SRC)/jmact/scriplib.c $(SRC)/jmact/scriplib.h $(SRC)/jmact/_scrplib.h $(EINC)/compat.h
|
||||
|
||||
# jAudioLib objects
|
||||
|
||||
$(OBJ)/mv_mix.$o: $(SRC)/jaudiolib/mv_mix.nasm
|
||||
$(OBJ)/mv_mix16.$o: $(SRC)/jaudiolib/mv_mix16.nasm
|
||||
$(OBJ)/mvreverb.$o: $(SRC)/jaudiolib/mvreverb.nasm
|
||||
$(OBJ)/mv_mix-c.$o: $(SRC)/jaudiolib/mv_mix-c.c
|
||||
$(OBJ)/mvreverb-c.$o: $(SRC)/jaudiolib/mvreverb-c.c
|
||||
$(OBJ)/pitch.$o: $(SRC)/jaudiolib/pitch.c $(SRC)/jaudiolib/pitch.h
|
||||
$(OBJ)/multivoc.$o: $(SRC)/jaudiolib/multivoc.c $(SRC)/jaudiolib/linklist.h $(SRC)/jaudiolib/pitch.h $(SRC)/jaudiolib/multivoc.h $(SRC)/jaudiolib/_multivc.h
|
||||
$(OBJ)/fx_man.$o: $(SRC)/jaudiolib/fx_man.c $(SRC)/jaudiolib/multivoc.h $(SRC)/jaudiolib/ll_man.h $(SRC)/jaudiolib/fx_man.h
|
||||
$(OBJ)/dsoundout.$o: $(SRC)/jaudiolib/dsoundout.c $(SRC)/jaudiolib/dsoundout.h
|
||||
$(OBJ)/openal.$o: $(SRC)/jaudiolib/openal.c $(SRC)/jaudiolib/openal.h
|
||||
$(OBJ)/dsl.$o: $(SRC)/jaudiolib/dsl.c $(SRC)/jaudiolib/dsl.h $(EINC)/compat.h
|
||||
|
||||
$(OBJ)/midi.$o: $(SRC)/midi.c $(SRC)/_midi.h $(SRC)/midi.h $(JAUDIOLIBDIR)/include/music.h
|
||||
$(OBJ)/mpu401.$o: $(SRC)/mpu401.c $(SRC)/mpu401.h $(JAUDIOLIBDIR)/include/music.h
|
||||
$(OBJ)/music.$o: $(SRC)/music.c $(SRC)/midi.h $(SRC)/mpu401.h $(JAUDIOLIBDIR)/include/music.h
|
||||
|
|
@ -1,186 +0,0 @@
|
|||
# EDuke32 Makefile for Microsoft NMake
|
||||
|
||||
SRC=source
|
||||
OBJ=obj_win
|
||||
EROOT=build
|
||||
EINC=$(EROOT)\include
|
||||
EOBJ=eobj_win
|
||||
INC=$(SRC)
|
||||
RSRC=rsrc
|
||||
o=obj
|
||||
|
||||
JAUDIOLIBDIR=$(SRC)\jaudiolib
|
||||
JAUDIOLIB=libjfaudiolib.lib
|
||||
|
||||
ENETDIR=$(SRC)\enet
|
||||
ENETLIB=libenet.lib
|
||||
|
||||
ENGINELIB=engine.lib
|
||||
EDITORLIB=build.lib
|
||||
|
||||
# the WDK allows us to link against msvcrt.dll instead of msvcrxxx.dll
|
||||
# this path should match build\Makefile.msvc
|
||||
WDKROOT="H:\WinDDK\7600.16385.1"
|
||||
DXROOT="H:\Microsoft DirectX SDK (February 2010)"
|
||||
|
||||
!ifdef DEBUG
|
||||
# debugging options
|
||||
flags_cl= /Od /Zi
|
||||
flags_link=/DEBUG
|
||||
!else
|
||||
# release options
|
||||
flags_cl=/O2 /GL /arch:SSE /MP /I$(WDKROOT)\inc\crt
|
||||
flags_link=/RELEASE /LTCG /LIBPATH:$(WDKROOT)\lib\wxp\i386 /LIBPATH:$(WDKROOT)\lib\Crt\i386
|
||||
!endif
|
||||
|
||||
ENGINEOPTS=/DUSE_OPENGL /DPOLYMER
|
||||
|
||||
CC=cl
|
||||
AS=ml
|
||||
LINK=link /nologo /opt:ref
|
||||
MT=mt
|
||||
CFLAGS= /MT /J /nologo $(flags_cl) \
|
||||
/I$(INC) /I$(EINC)\msvc /I$(EINC)\ /I$(SRC)\jmact /I$(JAUDIOLIBDIR)\include /I$(ENETDIR)\include \
|
||||
/W2 $(ENGINEOPTS) \
|
||||
/I$(DXROOT)\include /DRENDERTYPEWIN=1
|
||||
|
||||
LIBS=user32.lib gdi32.lib shell32.lib winmm.lib ws2_32.lib dxguid.lib comctl32.lib \
|
||||
vorbisfile_static.lib vorbis_static.lib ogg_static.lib dsound.lib advapi32.lib
|
||||
|
||||
LIBS=/NODEFAULTLIB:glu32.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcrtd.lib /NODEFAULTLIB:libcmt.lib \
|
||||
/NODEFAULTLIB:libcmtd.lib $(LIBS)
|
||||
|
||||
ASFLAGS=/nologo /coff /c
|
||||
EXESUFFIX=.exe
|
||||
!ifdef DEBUG
|
||||
CFLAGS=$(CFLAGS) /DDEBUGGINGAIDS /D "_CRT_SECURE_NO_DEPRECATE"
|
||||
LIBS=$(LIBS) msvcrtd.lib
|
||||
!else
|
||||
# comment msvcrt_winxp.obj if not using the WDK
|
||||
LIBS=$(LIBS) msvcrt.lib msvcrt_winxp.obj
|
||||
!endif
|
||||
|
||||
JMACTOBJ=$(OBJ)\file_lib.$o \
|
||||
$(OBJ)\control.$o \
|
||||
$(OBJ)\keyboard.$o \
|
||||
$(OBJ)\mouse.$o \
|
||||
$(OBJ)\mathutil.$o \
|
||||
$(OBJ)\scriplib.$o
|
||||
|
||||
AUDIOLIBOBJ=$(OBJ)\midi.$o $(OBJ)\music.$o $(OBJ)\mpu401.$o
|
||||
|
||||
GAMEOBJS=$(OBJ)\game.$o \
|
||||
$(OBJ)\actors.$o \
|
||||
$(OBJ)\anim.$o \
|
||||
$(OBJ)\demo.$o \
|
||||
$(OBJ)\gamedef.$o \
|
||||
$(OBJ)\gameexec.$o \
|
||||
$(OBJ)\gamevars.$o \
|
||||
$(OBJ)\global.$o \
|
||||
$(OBJ)\menus.$o \
|
||||
$(OBJ)\namesdyn.$o \
|
||||
$(OBJ)\net.$o \
|
||||
$(OBJ)\player.$o \
|
||||
$(OBJ)\premap.$o \
|
||||
$(OBJ)\savegame.$o \
|
||||
$(OBJ)\sector.$o \
|
||||
$(OBJ)\rts.$o \
|
||||
$(OBJ)\config.$o \
|
||||
$(OBJ)\animlib.$o\
|
||||
$(OBJ)\osdfuncs.$o \
|
||||
$(OBJ)\osdcmds.$o \
|
||||
$(OBJ)\grpscan.$o \
|
||||
$(OBJ)\winbits.$o \
|
||||
$(OBJ)\gameres.res \
|
||||
$(OBJ)\startwin.game.$o \
|
||||
$(JMACTOBJ) \
|
||||
$(AUDIOLIBOBJ) \
|
||||
$(OBJ)\sounds.$o \
|
||||
!ifdef DEBUG
|
||||
$(OBJ)\mdump.$o
|
||||
!endif
|
||||
|
||||
EDITOROBJS=$(OBJ)\astub.$o \
|
||||
$(OBJ)\mathutil.$o \
|
||||
$(OBJ)\m32def.$o \
|
||||
$(OBJ)\m32vars.$o \
|
||||
$(OBJ)\m32exec.$o \
|
||||
$(OBJ)\sounds_mapster32.$o \
|
||||
$(OBJ)\buildres.res \
|
||||
$(AUDIOLIB_FX) \
|
||||
!ifdef DEBUG
|
||||
$(OBJ)\mdump.$o
|
||||
!endif
|
||||
|
||||
|
||||
# RULES
|
||||
.SUFFIXES: .masm
|
||||
|
||||
{$(SRC)\}.masm{$(OBJ)\}.$o:
|
||||
$(AS) /c $(ASFLAGS) /Fo$@ $<
|
||||
|
||||
{$(SRC)\jmact}.c{$(OBJ)\}.$o:
|
||||
$(CC) /c $(CFLAGS) /Fo$@ $<
|
||||
|
||||
{$(SRC)\util}.c{$(OBJ)\}.$o:
|
||||
$(CC) /c $(CFLAGS) /Fo$@ $<
|
||||
|
||||
{$(SRC)\}.c{$(OBJ)\}.$o:
|
||||
$(CC) /c $(CFLAGS) /Fo$@ $<
|
||||
|
||||
{$(SRC)\}.cpp{$(OBJ)\}.$o:
|
||||
$(CC) /c $(CFLAGS) /Fo$@ $<
|
||||
|
||||
{$(SRC)\misc}.rc{$(OBJ)\}.res:
|
||||
$(RC) /i$(EINC)\ /i$(SRC)\ /DPOLYMER /fo$@ /r $<
|
||||
|
||||
|
||||
# TARGETS
|
||||
all: eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) # duke3d_w32$(EXESUFFIX);
|
||||
|
||||
eduke32$(EXESUFFIX): $(GAMEOBJS) $(EOBJ)\$(ENGINELIB) $(JAUDIOLIBDIR)\$(JAUDIOLIB) $(ENETDIR)\$(ENETLIB)
|
||||
$(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib\x86 $(flags_link) /MAP $** $(LIBS)
|
||||
$(MT) -manifest $(RSRC)\manifest.game.xml -hashupdate -outputresource:$@ -out:$@.manifest
|
||||
|
||||
mapster32$(EXESUFFIX): $(EDITOROBJS) $(EOBJ)\$(ENGINELIB) $(EOBJ)\$(EDITORLIB) $(JAUDIOLIBDIR)\$(JAUDIOLIB)
|
||||
$(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib\x86 $(flags_link) /MAP $** $(LIBS)
|
||||
$(MT) -manifest $(RSRC)\manifest.build.xml -hashupdate -outputresource:$@ -out:$@.manifest
|
||||
|
||||
!include Makefile.deps
|
||||
|
||||
enginelib editorlib: AlwaysBuild
|
||||
-mkdir $(EOBJ)
|
||||
echo OBJ=$(MAKEDIR)\$(EOBJ)\ > $(EOBJ)\overrides.mak
|
||||
echo CFLAGS=$(ENGINEOPTS) >> $(EOBJ)\overrides.mak
|
||||
cd $(EROOT)
|
||||
nmake /f Makefile.msvc "OVERRIDES=$(MAKEDIR)\$(EOBJ)\overrides.mak" $@
|
||||
cd $(MAKEDIR)
|
||||
|
||||
jaudiolib:
|
||||
cd $(JAUDIOLIBDIR)
|
||||
nmake /f Makefile.msvc
|
||||
cd $(MAKEDIR)
|
||||
|
||||
enet:
|
||||
cd $(ENETDIR)
|
||||
nmake /f Makefile.msvc
|
||||
cd $(MAKEDIR)
|
||||
|
||||
AlwaysBuild: ;
|
||||
$(EOBJ)\$(EDITORLIB): editorlib ;
|
||||
$(EOBJ)\$(ENGINELIB): enginelib ;
|
||||
$(JAUDIOLIBDIR)\$(JAUDIOLIB): jaudiolib ;
|
||||
$(ENETDIR)\$(ENETLIB): enet ;
|
||||
|
||||
# PHONIES
|
||||
clean:
|
||||
-del /Q $(OBJ)\* eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) duke3d_w32$(EXESUFFIX) \
|
||||
*.pdb *.map *.manifest
|
||||
cd $(JAUDIOLIBDIR)
|
||||
nmake /f Makefile.msvc clean
|
||||
cd $(MAKEDIR)\$(ENETDIR)
|
||||
nmake /f Makefile.msvc clean
|
||||
cd $(MAKEDIR)
|
||||
|
||||
veryclean: clean
|
||||
-del /Q $(EOBJ)\*
|
|
@ -1,35 +0,0 @@
|
|||
-Sector Effector Help-
|
||||
|
||||
0 : Rotating Sector
|
||||
1 : Pivot Sprite for SE 0
|
||||
2 : Earthquake
|
||||
3 : Random Lights After Shot Out
|
||||
4 : Random Lights
|
||||
6 : Subway
|
||||
7 : Teleporter
|
||||
8 : Up Open Door Lights
|
||||
9 : Down Open Door Lights
|
||||
10 : Door Auto Close (Hitag = Delay)
|
||||
11 : Rotate Sector Door
|
||||
12 : Light Switch
|
||||
13 : C-9 Explosive
|
||||
14 : Subway Car
|
||||
15 : Slide Door (ST 25)
|
||||
16 : Rotate Reactor Sector
|
||||
17 : Elevator Transport (ST 15)
|
||||
18 : Incremental Sector Rise/Fall
|
||||
19 : Explosion Lowers Ceiling
|
||||
20 : Stretch (ST 27)
|
||||
21 : Drop Floor (ST 28)
|
||||
22 : Teeth Door Prong (ST 29)
|
||||
23 : One-Way Teleporter Destination
|
||||
24 : Conveyor Belt or Water Current
|
||||
25 : Engine Piston
|
||||
27 : Demo Camera
|
||||
28 : Lightning
|
||||
29 : Float (for Waves)
|
||||
30 : Two-Way Train (ST 31)
|
||||
31 : Floor Rise/Fall
|
||||
32 : Ceiling Rise/Fall
|
||||
33 : Earthquake Debris
|
||||
36 : Projectile Shooter
|
|
@ -1,25 +0,0 @@
|
|||
-Sector Tags Help-
|
||||
|
||||
1 : Above Water (SE 7)
|
||||
2 : Underwater (SE 7)
|
||||
9 : Sliding Star Trek Doors
|
||||
15 : Elevator Transport (SE 17)
|
||||
16 : Elevator Platform Down
|
||||
17 : Elevator Platform Up
|
||||
18 : Elevator Down
|
||||
19 : Elevator Up
|
||||
20 : Ceiling Door
|
||||
21 : Floor Door
|
||||
22 : Splitting Door
|
||||
23 : Swinging Door
|
||||
25 : Sliding Door (SE 15)
|
||||
26 : Splitting Star Trek Door
|
||||
27 : Stretch (SE 20)
|
||||
28 : Drop Floor (SE 21)
|
||||
29 : Teeth Door Prong (SE 22)
|
||||
30 : Rotate and Rise Bridge
|
||||
31 : Two-Way Train (SE 30)
|
||||
10+++ : One-Time Sound
|
||||
32767 : Secret Room
|
||||
65534 : End Of Level with Message
|
||||
65535 : End Of Level
|
Binary file not shown.
|
@ -1,48 +0,0 @@
|
|||
# GNU Makefile to prepare source and binary distributions.
|
||||
# make -f MakeDistributions [source|binary]
|
||||
|
||||
SOURCEFILES=buildlic.txt ChangeLog LICENSE \
|
||||
Makefile Makefile.deps Makefile.shared Makefile.msvc Makefile.watcom \
|
||||
MakeDistributions makegnu.bat makemsc.bat makew.bat NAMES.H README
|
||||
|
||||
BINARYFILES=build.exe buildlic.txt ChangeLog fmod.dll \
|
||||
game.exe LICENSE NAMES.H neatsong.ogg README
|
||||
|
||||
BINARYCHECKS=checkfmoddll checkneatsongogg
|
||||
|
||||
.PHONY: source binary $(BINARYCHECKS)
|
||||
|
||||
datenow=$(shell date +%Y%m%d)
|
||||
|
||||
sourcedir=txbuild_src_$(datenow)
|
||||
binarydir=txbuild_$(datenow)
|
||||
|
||||
all: source binary
|
||||
|
||||
source:
|
||||
rm -rf $(sourcedir) $(sourcedir).zip
|
||||
mkdir $(sourcedir) $(sourcedir)/obj.gnu $(sourcedir)/obj.watcom $(sourcedir)/obj.msc
|
||||
touch $(sourcedir)/obj.gnu/keep.me $(sourcedir)/obj.watcom/keep.me $(sourcedir)/obj.msc/keep.me
|
||||
cp $(SOURCEFILES) $(sourcedir)
|
||||
find . -name "*~" -exec rm -rf '{}' ';';
|
||||
find . -name "*.orig" -exec rm -rf '{}' ';';
|
||||
find . -name "*.rej" -exec rm -rf '{}' ';';
|
||||
find . -name "*.mine" -exec rm -rf '{}' ';';
|
||||
find . -name "*.c.r*" -exec rm -rf '{}' ';';
|
||||
find . -name "*.h.r*" -exec rm -rf '{}' ';';
|
||||
cp -R src rsrc include devcpp testgame $(sourcedir)
|
||||
find $(sourcedir) | grep -i svn | xargs rm -rf
|
||||
rm -f $(sourcedir)/src/tmp/*
|
||||
touch $(sourcedir)/src/tmp/keep.me
|
||||
kzip -r $(sourcedir).zip $(sourcedir)
|
||||
|
||||
binary: $(BINARYCHECKS)
|
||||
make RELEASE=1
|
||||
upx --best build.exe game.exe
|
||||
mkdir $(binarydir)
|
||||
cp $(BINARYFILES) $(binarydir)
|
||||
kzip -r $(binarydir).zip $(binarydir)
|
||||
|
||||
# Binary checks
|
||||
checkfmoddll: fmod.dll
|
||||
checkneatsongogg: neatsong.ogg
|
|
@ -1,264 +0,0 @@
|
|||
#
|
||||
# Build Makefile for GNU Make
|
||||
#
|
||||
|
||||
# Notes:
|
||||
# As of 6 July 2005, the engine should handle optimisations being enabled.
|
||||
# If things seem to be going wrong, lower or disable optimisations, then
|
||||
# try again. If things are still going wrong, call me.
|
||||
#
|
||||
|
||||
include ../Makefile.common
|
||||
|
||||
|
||||
# SDK locations for Windows - adjust to match your setup
|
||||
#
|
||||
ifneq ($(DXROOT_OVERRIDE),)
|
||||
DXROOT=$(DXROOT_OVERRIDE)
|
||||
else
|
||||
DXROOT=c:/sdks/directx/dx61
|
||||
endif
|
||||
FMODROOTWIN=c:/sdks/fmodapi374win/api
|
||||
|
||||
# Build locations - OBJ gets overridden to the game-specific objects dir
|
||||
#
|
||||
OBJ?=obj.gnu
|
||||
SRC=src
|
||||
RSRC=rsrc
|
||||
INC=include
|
||||
|
||||
# ENETROOT=$(SRC)/enet
|
||||
|
||||
# Filename extensions - these won't need to change
|
||||
#
|
||||
o=o
|
||||
res=o
|
||||
asm=nasm
|
||||
|
||||
# Debugging and release
|
||||
#
|
||||
ifneq ($(RELEASE),0)
|
||||
# Debugging disabled
|
||||
debug+= $(F_NO_STACK_PROTECTOR)
|
||||
else
|
||||
# Debugging enabled
|
||||
debug+= -DNOSDLPARACHUTE
|
||||
LIBS+= $(L_SSP) -Wl,--enable-auto-import
|
||||
endif
|
||||
|
||||
OURCFLAGS=$(BASECFLAGS) -Wno-char-subscripts -I$(INC) $(ARCH)
|
||||
OURCXXFLAGS=$(BASECXXFLAGS)
|
||||
ASFLAGS=$(BASEASFLAGS)
|
||||
|
||||
include Makefile.shared
|
||||
|
||||
|
||||
UTILLIBS=-lpthread
|
||||
|
||||
ENGINEOBJS=
|
||||
ifeq (0,$(NOASM))
|
||||
ENGINEOBJS+= $(OBJ)/a.$o
|
||||
endif
|
||||
|
||||
ifneq ($(PLATFORM),WINDOWS)
|
||||
LIBS+= -ldl -pthread
|
||||
endif
|
||||
|
||||
|
||||
ENGINEOBJS+= \
|
||||
$(OBJ)/a-c.$o \
|
||||
$(OBJ)/baselayer.$o \
|
||||
$(OBJ)/cache1d.$o \
|
||||
$(OBJ)/compat.$o \
|
||||
$(OBJ)/crc32.$o \
|
||||
$(OBJ)/defs.$o \
|
||||
$(OBJ)/engine.$o \
|
||||
$(OBJ)/polymost.$o \
|
||||
$(OBJ)/hightile.$o \
|
||||
$(OBJ)/textfont.$o \
|
||||
$(OBJ)/smalltextfont.$o \
|
||||
$(OBJ)/kplib.$o \
|
||||
$(OBJ)/quicklz.$o \
|
||||
$(OBJ)/md4.$o \
|
||||
$(OBJ)/osd.$o \
|
||||
$(OBJ)/pragmas.$o \
|
||||
$(OBJ)/scriptfile.$o \
|
||||
$(OBJ)/mutex.$o
|
||||
|
||||
ifeq (1,$(USE_OPENGL))
|
||||
ENGINEOBJS+= $(OBJ)/mdsprite.$o
|
||||
ENGINEOBJS+= $(OBJ)/glbuild.$o
|
||||
endif
|
||||
|
||||
ifeq (1,$(POLYMER))
|
||||
ENGINEOBJS+= $(OBJ)/polymer.$o
|
||||
endif
|
||||
|
||||
ifeq (1,$(NEDMALLOC))
|
||||
ENGINEOBJS+= $(OBJ)/nedmalloc.$o
|
||||
endif
|
||||
|
||||
EDITOROBJS=$(OBJ)/build.$o \
|
||||
$(OBJ)/config.$o
|
||||
|
||||
# PLATFORM SPECIFIC SETTINGS
|
||||
|
||||
ifeq ($(PLATFORM),LINUX)
|
||||
ASFLAGS+= -f elf
|
||||
endif
|
||||
ifeq ($(PLATFORM),DARWIN)
|
||||
ENGINEOBJS += $(OBJ)/StartupWinController.editor.$o \
|
||||
$(OBJ)//osxbits.$o
|
||||
ASFLAGS += -f Mach-O
|
||||
OURCFLAGS += -fno-pic
|
||||
TARGETOPTS += -DNOASM
|
||||
endif
|
||||
ifeq ($(PLATFORM),BSD)
|
||||
ASFLAGS+= -f elf
|
||||
OURCFLAGS+= -I/usr/X11R6/include
|
||||
endif
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
OURCFLAGS+= -DUNDERSCORES -I$(DXROOT)/include -I$(FMODROOTWIN)/inc # -I$(ENETROOT)/include
|
||||
LIBS+= -lwsock32 -lws2_32 -lwinmm #-L$(ENETROOT)
|
||||
ASFLAGS+= -DUNDERSCORES -f win32
|
||||
endif
|
||||
ifeq ($(PLATFORM),BEOS)
|
||||
ASFLAGS+= -f elf
|
||||
TARGETOPTS+= -DNOASM
|
||||
endif
|
||||
ifeq ($(PLATFORM),SYLLABLE)
|
||||
ASFLAGS+= -f elf
|
||||
endif
|
||||
|
||||
ifeq ($(RENDERTYPE),SDL)
|
||||
ENGINEOBJS+= $(OBJ)/sdlayer.$o
|
||||
OURCFLAGS+= $(subst -Dmain=SDL_main,,$(SDLCONFIG_CFLAGS))
|
||||
|
||||
ifeq (1,$(HAVE_GTK2))
|
||||
OURCFLAGS+= -DHAVE_GTK2 $(shell pkg-config --cflags gtk+-2.0)
|
||||
ENGINEOBJS+= $(OBJ)/gtkbits.$o
|
||||
ifeq ($(LINKED_GTK),0)
|
||||
ENGINEOBJS+= $(OBJ)/dynamicgtk.$o
|
||||
endif
|
||||
EDITOROBJS+= $(OBJ)/startgtk.editor.$o
|
||||
endif
|
||||
endif
|
||||
ifeq ($(RENDERTYPE),WIN)
|
||||
ENGINEOBJS+= $(OBJ)/winlayer.$o $(OBJ)/rawinput.$o
|
||||
EDITOROBJS+= $(OBJ)/startwin.editor.$o
|
||||
endif
|
||||
|
||||
ifneq (0,$(EFENCE))
|
||||
LIBS+= -lefence
|
||||
OURCFLAGS+= -DEFENCE
|
||||
endif
|
||||
|
||||
OURCFLAGS+= $(BUILDCFLAGS)
|
||||
|
||||
.SILENT:
|
||||
.PHONY: clean veryclean all utils enginelib editorlib
|
||||
|
||||
# TARGETS
|
||||
|
||||
UTILS=kextract$(EXESUFFIX) kgroup$(EXESUFFIX) transpal$(EXESUFFIX) wad2art$(EXESUFFIX) wad2map$(EXESUFFIX) md2tool$(EXESUFFIX)
|
||||
|
||||
# all: $(OBJ)/$(ENGINELIB) $(OBJ)/$(EDITORLIB)
|
||||
utils: $(UTILS)
|
||||
|
||||
enginelib: $(OBJ)/$(ENGINELIB)
|
||||
$(OBJ)/$(ENGINELIB): $(ENGINEOBJS)
|
||||
$(BUILD_ECHOFLAGS)
|
||||
$(ARCHIVE_STATUS)
|
||||
if $(AR) rc $@ $^; then $(ARCHIVE_OK); else $(ARCHIVE_FAILED); fi
|
||||
$(RANLIB) $@
|
||||
|
||||
editorlib: $(OBJ)/$(EDITORLIB)
|
||||
$(OBJ)/$(EDITORLIB): $(EDITOROBJS)
|
||||
$(BUILD_ECHOFLAGS)
|
||||
$(ARCHIVE_STATUS)
|
||||
if $(AR) rc $@ $^; then $(ARCHIVE_OK); else $(ARCHIVE_FAILED); fi
|
||||
$(RANLIB) $@
|
||||
|
||||
pragmacheck$(EXESUFFIX): $(OBJ)/pragmacheck.$o $(OBJ)/pragmas.$o
|
||||
$(CC) $(subst -Dmain=app_main,,$(OURCFLAGS)) -o $@ $^
|
||||
|
||||
kextract$(EXESUFFIX): $(OBJ)/kextract.$o $(OBJ)/compat.$o $(OBJ)/nedmalloc.$o
|
||||
$(CC) -o $@ $^ $(UTILLIBS)
|
||||
kgroup$(EXESUFFIX): $(OBJ)/kgroup.$o $(OBJ)/compat.$o $(OBJ)/nedmalloc.$o
|
||||
$(CC) -o $@ $^ $(UTILLIBS)
|
||||
transpal$(EXESUFFIX): $(OBJ)/transpal.$o $(OBJ)/pragmas.$o $(OBJ)/compat.$o $(OBJ)/nedmalloc.$o
|
||||
$(CC) -o $@ $^ $(UTILLIBS)
|
||||
wad2art$(EXESUFFIX): $(OBJ)/wad2art.$o $(OBJ)/pragmas.$o $(OBJ)/compat.$o $(OBJ)/nedmalloc.$o
|
||||
$(CC) -o $@ $^ $(UTILLIBS)
|
||||
wad2map$(EXESUFFIX): $(OBJ)/wad2map.$o $(OBJ)/pragmas.$o $(OBJ)/compat.$o $(OBJ)/nedmalloc.$o
|
||||
$(CC) -o $@ $^ $(UTILLIBS)
|
||||
md2tool$(EXESUFFIX): $(OBJ)/md2tool.$o $(OBJ)/compat.$o $(OBJ)/nedmalloc.$o
|
||||
$(CC) -o $@ $^ $(UTILLIBS)
|
||||
generateicon$(EXESUFFIX): $(OBJ)/generateicon.$o $(OBJ)/kplib.$o
|
||||
$(CC) -o $@ $^ $(UTILLIBS)
|
||||
cacheinfo$(EXESUFFIX): $(OBJ)/cacheinfo.$o $(OBJ)/compat.$o $(OBJ)/nedmalloc.$o
|
||||
$(CC) -o $@ $^ $(UTILLIBS)
|
||||
enumdisplay$(EXESUFFIX): src/misc/enumdisplay.c
|
||||
$(CC) -g -Os -o $@ $^ $(UTILLIBS) -I$(DXROOT)/include -lgdi32
|
||||
mapdump$(EXESUFFIX): $(OBJ)/mapdump.$o
|
||||
$(CC) -o $@ $^ $(UTILLIBS)
|
||||
|
||||
# DEPENDENCIES
|
||||
include Makefile.deps
|
||||
|
||||
# RULES
|
||||
$(OBJ)/%.$o: $(SRC)/%.nasm
|
||||
$(COMPILE_STATUS)
|
||||
if $(AS) $(ASFLAGS) $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
||||
|
||||
$(OBJ)/%.$o: $(SRC)/%.c
|
||||
$(COMPILE_STATUS)
|
||||
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
||||
|
||||
$(OBJ)/%.$o: $(SRC)/%.m
|
||||
$(COMPILE_STATUS)
|
||||
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
||||
|
||||
$(OBJ)/%.$o: $(SRC)/%.cpp
|
||||
$(COMPILE_STATUS)
|
||||
if $(CXX) $(CXXFLAGS) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
||||
|
||||
$(OBJ)/%.$o: $(SRC)/%.cxx
|
||||
$(CXX) $(CXXFLAGS) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJ)/%.$o: $(SRC)/misc/%.rc
|
||||
$(COMPILE_STATUS)
|
||||
if $(RC) -i $< -o $@ --include-dir=$(INC) --include-dir=$(SRC); then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
||||
|
||||
$(OBJ)/%.$o: $(SRC)/util/%.c
|
||||
$(COMPILE_STATUS)
|
||||
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
||||
|
||||
$(OBJ)/%.$o: $(RSRC)/%.c
|
||||
$(COMPILE_STATUS)
|
||||
if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
||||
|
||||
$(OBJ)/editor_banner.$o: $(RSRC)/editor_banner.c
|
||||
echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@
|
||||
gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
|
||||
$(RSRC)/editor_banner.c: $(RSRC)/build.bmp
|
||||
echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@
|
||||
gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
|
||||
|
||||
# PHONIES
|
||||
|
||||
clean:
|
||||
-rm -f $(OBJ)/*
|
||||
|
||||
veryclean: clean
|
||||
-rm -f $(ENGINELIB) $(EDITORLIB) $(UTILS)
|
||||
|
||||
.PHONY: fixlineends
|
||||
fixlineends:
|
||||
for a in `find . -type f \( -name '*.c' -o -name '*.h' -o -name 'Makefile*' \) \! -path '*/.svn/*'`; do \
|
||||
echo Fixing $$a && tr -d "\015" < $$a > $$a.fix && mv $$a.fix $$a; \
|
||||
done
|
||||
|
||||
# DO NOT DELETE
|
||||
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
# Build Engine dependencies
|
||||
#
|
||||
$(OBJ)/a-c.$o: $(SRC)/a-c.c $(INC)/a.h
|
||||
$(OBJ)/a.$o: $(SRC)/a.$(asm)
|
||||
$(OBJ)/baselayer.$o: $(SRC)/baselayer.c $(INC)/compat.h $(INC)/baselayer.h $(INC)/build.h $(INC)/osd.h
|
||||
$(OBJ)/build.$o: $(SRC)/build.c $(INC)/build.h $(INC)/pragmas.h $(INC)/compat.h $(INC)/baselayer.h $(INC)/editor.h
|
||||
$(OBJ)/cache1d.$o: $(SRC)/cache1d.c $(INC)/compat.h $(INC)/cache1d.h $(INC)/pragmas.h $(INC)/baselayer.h
|
||||
$(OBJ)/compat.$o: $(SRC)/compat.c $(INC)/compat.h
|
||||
$(OBJ)/config.$o: $(SRC)/config.c $(INC)/compat.h $(INC)/osd.h $(INC)/editor.h
|
||||
$(OBJ)/crc32.$o: $(SRC)/crc32.c $(INC)/crc32.h
|
||||
$(OBJ)/defs.$o: $(SRC)/defs.c $(INC)/build.h $(INC)/baselayer.h $(INC)/scriptfile.h $(INC)/compat.h
|
||||
$(OBJ)/engine.$o: $(SRC)/engine.c $(INC)/compat.h $(INC)/build.h $(INC)/pragmas.h $(INC)/cache1d.h $(INC)/a.h $(INC)/osd.h $(INC)/baselayer.h $(SRC)/engine_priv.h $(INC)/polymost.h $(INC)/hightile.h $(INC)/mdsprite.h $(INC)/polymer.h
|
||||
$(OBJ)/polymost.$o: $(SRC)/polymost.c $(INC)/md4.h $(INC)/quicklz.h $(INC)/lzwnew.h $(SRC)/engine_priv.h $(INC)/polymost.h $(INC)/hightile.h $(INC)/mdsprite.h
|
||||
$(OBJ)/hightile.$o: $(SRC)/hightile.c $(INC)/kplib.h $(INC)/hightile.h
|
||||
$(OBJ)/mdsprite.$o: $(SRC)/mdsprite.c $(SRC)/engine_priv.h $(INC)/polymost.h $(INC)/hightile.h $(INC)/mdsprite.h
|
||||
$(OBJ)/textfont.$o: $(SRC)/textfont.c
|
||||
$(OBJ)/smalltextfont.$o: $(SRC)/smalltextfont.c
|
||||
$(OBJ)/glbuild.$o: $(SRC)/glbuild.c $(INC)/glbuild.h $(INC)/baselayer.h
|
||||
$(OBJ)/kplib.$o: $(SRC)/kplib.c $(INC)/compat.h
|
||||
$(OBJ)/quicklz.$o: $(SRC)/quicklz.c $(INC)/quicklz.h
|
||||
$(OBJ)/lzwnew.$o: $(SRC)/lzwnew.c
|
||||
$(OBJ)/md4.$o: $(SRC)/md4.c $(INC)/md4.h $(INC)/compat.h
|
||||
$(OBJ)/osd.$o: $(SRC)/osd.c $(INC)/build.h $(INC)/osd.h $(INC)/compat.h $(INC)/baselayer.h
|
||||
$(OBJ)/pragmas.$o: $(SRC)/pragmas.c $(INC)/compat.h
|
||||
$(OBJ)/scriptfile.$o: $(SRC)/scriptfile.c $(INC)/scriptfile.h $(INC)/cache1d.h $(INC)/compat.h
|
||||
$(OBJ)/sdlayer.$o: $(SRC)/sdlayer.c $(INC)/compat.h $(INC)/sdlayer.h $(INC)/baselayer.h $(INC)/cache1d.h $(INC)/pragmas.h $(INC)/a.h $(INC)/build.h $(INC)/osd.h $(INC)/glbuild.h
|
||||
$(OBJ)/winlayer.$o: $(SRC)/winlayer.c $(INC)/compat.h $(INC)/winlayer.h $(INC)/baselayer.h $(INC)/pragmas.h $(INC)/build.h $(INC)/a.h $(INC)/osd.h $(INC)/dxdidf.h $(INC)/glbuild.h $(INC)/rawinput.h
|
||||
$(OBJ)/gtkbits.$o: $(SRC)/gtkbits.c $(INC)/baselayer.h $(INC)/build.h $(INC)/dynamicgtk.h
|
||||
$(OBJ)/dynamicgtk.$o: $(SRC)/dynamicgtk.c $(INC)/dynamicgtk.h
|
||||
$(OBJ)/polymer.$o: $(SRC)/polymer.c $(INC)/polymer.h $(INC)/compat.h $(INC)/build.h $(INC)/glbuild.h $(INC)/osd.h $(INC)/pragmas.h $(INC)/mdsprite.h $(INC)/polymost.h
|
||||
$(OBJ)/nedmalloc.$o: $(SRC)/nedmalloc.c $(INC)/nedmalloc.h $(INC)/malloc.c.h
|
||||
$(OBJ)/mutex.$o: $(SRC)/mutex.c $(INC)/mutex.h
|
||||
$(OBJ)/rawinput.$o: $(SRC)/rawinput.c $(INC)/rawinput.h
|
||||
|
||||
$(OBJ)/buildres.$(res): $(SRC)/misc/buildres.rc $(INC)/startwin.editor.h
|
||||
$(OBJ)/startwin.editor.$o: $(SRC)/startwin.editor.c $(INC)/build.h $(INC)/editor.h $(INC)/winlayer.h $(INC)/compat.h $(INC)/startwin.editor.h
|
||||
$(OBJ)/startgtk.editor.$o: $(SRC)/startgtk.editor.c $(INC)/baselayer.h $(INC)/build.h $(INC)/editor.h $(INC)/compat.h
|
||||
|
||||
$(OBJ)/build_icon.$o: $(RSRC)/build_icon.c
|
||||
|
||||
$(OBJ)/kextract.$o: $(SRC)/util/kextract.c $(INC)/compat.h
|
||||
$(OBJ)/kgroup.$o: $(SRC)/util/kgroup.c $(INC)/compat.h
|
||||
$(OBJ)/transpal.$o: $(SRC)/util/transpal.c $(INC)/compat.h $(INC)/pragmas.h
|
||||
$(OBJ)/wad2art.$o: $(SRC)/util/wad2art.c $(INC)/compat.h $(INC)/pragmas.h
|
||||
$(OBJ)/wad2map.$o: $(SRC)/util/wad2map.c $(INC)/compat.h $(INC)/pragmas.h
|
||||
$(OBJ)/generateicon.$o: $(SRC)/util/generateicon.c
|
||||
$(OBJ)/cacheinfo.$o: $(SRC)/util/cacheinfo.c $(INC)/compat.h
|
|
@ -1,156 +0,0 @@
|
|||
# Build Makefile for Microsoft NMake
|
||||
!ifdef OVERRIDES
|
||||
!include $(OVERRIDES)
|
||||
!endif
|
||||
|
||||
SRC=src
|
||||
!ifndef OBJ
|
||||
OBJ=obj.msc
|
||||
!endif
|
||||
INC=include\ #
|
||||
!ifndef CFLAGS
|
||||
CFLAGS=/DUSE_OPENGL /DPOLYMER # /DNEDMALLOC
|
||||
!endif
|
||||
|
||||
o=obj
|
||||
res=res
|
||||
asm=masm
|
||||
|
||||
ENGINELIB=engine.lib
|
||||
EDITORLIB=build.lib
|
||||
|
||||
# this path should match eduke32\Makefile.msvc
|
||||
WDKROOT="C:\WinDDK\7600.16385.1"
|
||||
|
||||
# /D these to enable certain features of the port's compile process
|
||||
# NOASM When defined, uses C instead of assembly code
|
||||
!ifdef NOASM
|
||||
TARGETOPTS=/DNOASM
|
||||
!endif
|
||||
|
||||
!ifdef DEBUG
|
||||
# debugging options
|
||||
flags_cl=/Od /Zi
|
||||
flags_link=/DEBUG
|
||||
flags_lib=
|
||||
!else
|
||||
# release options
|
||||
flags_cl=/O2 /GL /arch:SSE /MP /I$(WDKROOT)\inc\crt
|
||||
flags_link=/RELEASE /LTCG /LIBPATH:$(WDKROOT)\lib\Crt\i386 /LIBPATH:$(WDKROOT)\lib\wxp\i386
|
||||
flags_lib=/LTCG
|
||||
!endif
|
||||
|
||||
CC=cl
|
||||
AS=ml
|
||||
RC=rc
|
||||
LINK=link /opt:ref /nologo
|
||||
CFLAGS=$(CFLAGS) /nologo /MT /J $(flags_cl) $(TARGETOPTS) /I$(INC)
|
||||
ASFLAGS=/nologo /coff /c
|
||||
EXESUFFIX=.exe
|
||||
!ifdef DEBUG
|
||||
CFLAGS=$(CFLAGS) /DDEBUGGINGAIDS /D "_CRT_SECURE_NO_DEPRECATE"
|
||||
!endif
|
||||
|
||||
ENGINEOBJS= \
|
||||
!ifdef NOASM
|
||||
$(OBJ)\a-c.$o \
|
||||
!else
|
||||
$(OBJ)\a.$o \
|
||||
!endif
|
||||
$(OBJ)\baselayer.$o \
|
||||
$(OBJ)\cache1d.$o \
|
||||
$(OBJ)\compat.$o \
|
||||
$(OBJ)\crc32.$o \
|
||||
$(OBJ)\defs.$o \
|
||||
$(OBJ)\engine.$o \
|
||||
$(OBJ)\polymost.$o \
|
||||
$(OBJ)\hightile.$o \
|
||||
$(OBJ)\mdsprite.$o \
|
||||
$(OBJ)\textfont.$o \
|
||||
$(OBJ)\smalltextfont.$o \
|
||||
$(OBJ)\glbuild.$o \
|
||||
$(OBJ)\kplib.$o \
|
||||
$(OBJ)\quicklz.$o \
|
||||
$(OBJ)\lzwnew.$o \
|
||||
$(OBJ)\md4.$o \
|
||||
$(OBJ)\osd.$o \
|
||||
$(OBJ)\pragmas.$o \
|
||||
$(OBJ)\scriptfile.$o \
|
||||
$(OBJ)\winlayer.$o \
|
||||
$(OBJ)\polymer.$o \
|
||||
$(OBJ)\mutex.$o \
|
||||
$(OBJ)\rawinput.$o
|
||||
|
||||
EDITOROBJS=$(OBJ)\build.$o \
|
||||
$(OBJ)\startwin.editor.$o \
|
||||
$(OBJ)\config.$o
|
||||
|
||||
RENDERTYPE=WIN
|
||||
LIBS=$(LIBS) user32.lib gdi32.lib shell32.lib wsock32.lib comctl32.lib dxguid.lib
|
||||
CFLAGS=$(CFLAGS) /DRENDERTYPE$(RENDERTYPE)=1 /W2
|
||||
|
||||
# RULES
|
||||
.SUFFIXES: .masm
|
||||
|
||||
{$(SRC)}.masm{$(OBJ)}.$o:
|
||||
$(AS) /c $(ASFLAGS) /Fo$@ $<
|
||||
|
||||
{$(SRC)\tmp}.c{$(OBJ)}.$o:
|
||||
$(CC) /c $(CFLAGS) /Fo$@ $<
|
||||
|
||||
{$(SRC)\util}.c{$(OBJ)}.$o:
|
||||
$(CC) /c $(CFLAGS) /Fo$@ $<
|
||||
|
||||
{$(SRC)\misc}.rc{$(OBJ)}.$(res):
|
||||
$(RC) /i$(INC)\ /fo$@ /r $<
|
||||
|
||||
{$(SRC)}.c{$(OBJ)}.$o:
|
||||
$(CC) /c $(CFLAGS) /Fo$@ $<
|
||||
|
||||
{$(SRC)}.cpp{$(OBJ)}.$o:
|
||||
$(CC) /c $(CFLAGS) /Fo$@ $<
|
||||
|
||||
# TARGETS
|
||||
UTILS=kextract$(EXESUFFIX) kgroup$(EXESUFFIX) transpal$(EXESUFFIX) wad2art$(EXESUFFIX) wad2map$(EXESUFFIX)
|
||||
|
||||
all: $(OBJ)/$(ENGINELIB) $(OBJ)/$(EDITORLIB);
|
||||
utils: $(UTILS) ;
|
||||
|
||||
enginelib: $(OBJ)\$(ENGINELIB) ;
|
||||
$(OBJ)\$(ENGINELIB): $(ENGINEOBJS)
|
||||
lib $(flags_lib) /out:$@ /nologo $**
|
||||
|
||||
editorlib: $(OBJ)\$(EDITORLIB) ;
|
||||
$(OBJ)\$(EDITORLIB): $(EDITOROBJS)
|
||||
lib $(flags_lib) /out:$@ /nologo $**
|
||||
|
||||
# the tools
|
||||
kextract$(EXESUFFIX): $(OBJ)\kextract.$o $(OBJ)\compat.$o $(OBJ)\nedmalloc.$o
|
||||
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
|
||||
$(MT) -manifest $@.manifest -outputresource:$@
|
||||
|
||||
kgroup$(EXESUFFIX): $(OBJ)\kgroup.$o $(OBJ)\compat.$o $(OBJ)\nedmalloc.$o
|
||||
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
|
||||
$(MT) -manifest $@.manifest -outputresource:$@
|
||||
|
||||
transpal$(EXESUFFIX): $(OBJ)\transpal.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o $(OBJ)\nedmalloc.$o
|
||||
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
|
||||
$(MT) -manifest $@.manifest -outputresource:$@
|
||||
|
||||
wad2map$(EXESUFFIX): $(OBJ)\wad2map.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o $(OBJ)\nedmalloc.$o
|
||||
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
|
||||
$(MT) -manifest $@.manifest -outputresource:$@
|
||||
|
||||
wad2art$(EXESUFFIX): $(OBJ)\wad2art.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o $(OBJ)\nedmalloc.$o
|
||||
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
|
||||
$(MT) -manifest $@.manifest -outputresource:$@
|
||||
|
||||
# DEPENDENCIES
|
||||
!include Makefile.deps
|
||||
|
||||
# PHONIES
|
||||
clean:
|
||||
-del /Q $(ENGINEOBJS) $(EDITOROBJS) $(OBJ)\kextract.$o $(OBJ)\kgroup.$o $(OBJ)\transpal.$o $(OBJ)\wad2map.$o $(OBJ)\wad2art.$o
|
||||
veryclean: clean
|
||||
-del /Q $(OBJ)\$(ENGINELIB) $(OBJ)\$(EDITORLIB) $(UTILS) *.map *.manifest *.pdb
|
||||
|
|
@ -1,232 +0,0 @@
|
|||
# Shared make information between Build engine and games
|
||||
|
||||
ENGINELIB=libengine.a
|
||||
EDITORLIB=libbuild.a
|
||||
|
||||
SDLCONFIG = /usr/local/bin/sdl-configinvalid
|
||||
|
||||
ifeq ($(wildcard $(SDLCONFIG)),$(SDLCONFIG))
|
||||
SDLROOT = /usr/local
|
||||
else
|
||||
SDLCONFIG = /usr/bin/sdl-config
|
||||
endif
|
||||
|
||||
SDL_FRAMEWORK = 0
|
||||
|
||||
# Overridden for OSes that don't have the cutdown stdc++ that is supc++
|
||||
STDCPPLIB=-lsupc++
|
||||
BUILDCFLAGS=
|
||||
|
||||
# GCC version, for conditional selection of flags.
|
||||
# This is easier than trying to squeeze it out of gcc --version:
|
||||
GCC_MAJOR ?= 4
|
||||
ifeq (4,$(GCC_MAJOR))
|
||||
F_NO_STACK_PROTECTOR := -fno-stack-protector
|
||||
# there are some link-time issues with stack protectors, so make it possible to override
|
||||
F_STACK_PROTECTOR_ALL ?= -fstack-protector-all
|
||||
F_JUMP_TABLES := -fjump-tables
|
||||
M_TUNE_GENERIC := -mtune=generic
|
||||
M_STACKREALIGN := -mstackrealign
|
||||
L_SSP := -lssp
|
||||
endif
|
||||
|
||||
|
||||
ifndef ARCH
|
||||
ifeq ($(findstring i686, $(shell uname -m)), i686)
|
||||
ARCH=-march=pentium3 $(M_TUNE_GENERIC) -mmmx # -msse2 -mfpmath=sse,387 -malign-double $(M_STACKREALIGN)
|
||||
else
|
||||
ARCH=
|
||||
endif
|
||||
endif
|
||||
|
||||
# Detect the platform if it wasn't explicitly given to us from
|
||||
# the outside world. This allows cross-compilation by overriding
|
||||
# CC and giving us PLATFORM specifically.
|
||||
#
|
||||
ifndef PLATFORM
|
||||
uname=$(strip $(shell uname -s))
|
||||
PLATFORM=UNKNOWN
|
||||
ifeq ($(findstring Linux,$(uname)),Linux)
|
||||
PLATFORM=LINUX
|
||||
endif
|
||||
ifeq ($(findstring BSD,$(uname)),BSD)
|
||||
PLATFORM=BSD
|
||||
endif
|
||||
ifeq ($(findstring MINGW,$(uname)),MINGW)
|
||||
PLATFORM=WINDOWS
|
||||
endif
|
||||
ifeq ($(findstring Darwin,$(uname)),Darwin)
|
||||
PLATFORM=DARWIN
|
||||
endif
|
||||
ifeq ($(findstring BeOS,$(uname)),BeOS)
|
||||
PLATFORM=BEOS
|
||||
endif
|
||||
ifeq ($(findstring skyos,$(uname)),skyos)
|
||||
PLATFORM=SKYOS
|
||||
endif
|
||||
ifeq ($(findstring QNX,$(uname)),QNX)
|
||||
PLATFORM=QNX
|
||||
endif
|
||||
ifeq ($(findstring SunOS,$(uname)),SunOS)
|
||||
PLATFORM=SUNOS
|
||||
endif
|
||||
ifeq ($(findstring syllable,$(uname)),syllable)
|
||||
PLATFORM=SYLLABLE
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),LINUX)
|
||||
RENDERTYPE=SDL
|
||||
BUILDCFLAGS+= -DHAVE_INTTYPES
|
||||
GTKCOMPAT32=0
|
||||
|
||||
ifeq ($(findstring x86_64,$(shell uname -m)),x86_64)
|
||||
ifeq (1,$(BUILD32_ON_64))
|
||||
# On my 64bit Gentoo these are the 32bit emulation libs
|
||||
LIBS+= -m32 -L/emul/linux/x86/usr/lib
|
||||
BUILDCFLAGS+= -m32
|
||||
# Override WITHOUT_GTK=0
|
||||
GTKCOMPAT32=1
|
||||
else
|
||||
override NOASM=1
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
ifeq ($(PLATFORM),DARWIN)
|
||||
RENDERTYPE = SDL
|
||||
BUILDCFLAGS += -DHAVE_INTTYPES
|
||||
GTKCOMPAT32 = 0
|
||||
SDL_FRAMEWORK = 1
|
||||
# ASM won't work on PowerPC and currently throws errors on i386 too :-/
|
||||
override NOASM = 1
|
||||
endif
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
RENDERTYPE ?= WIN
|
||||
BUILDCFLAGS+= -DHAVE_INTTYPES
|
||||
EXESUFFIX=.exe
|
||||
LIBS+= -lmingwex -lwinmm -L$(DXROOT)/lib -lwsock32 -lcomctl32 #-lshfolder
|
||||
# STDCPPLIB=-lstdc++
|
||||
endif
|
||||
ifeq ($(PLATFORM),BSD)
|
||||
RENDERTYPE=SDL
|
||||
BUILDCFLAGS+= -DHAVE_INTTYPES
|
||||
endif
|
||||
ifeq ($(PLATFORM),BEOS)
|
||||
RENDERTYPE=SDL
|
||||
STDCPPLIB=-lstdc++
|
||||
endif
|
||||
ifeq ($(PLATFORM),SKYOS)
|
||||
RENDERTYPE=SDL
|
||||
EXESUFFIX=.app
|
||||
override NOASM=1
|
||||
BUILDCFLAGS+= -DUNDERSCORES
|
||||
SDLCONFIG=
|
||||
SDLCONFIG_CFLAGS=-I/boot/programs/sdk/include/sdl
|
||||
LIBS+= -lSDL -lnet
|
||||
endif
|
||||
ifeq ($(PLATFORM),QNX)
|
||||
RENDERTYPE=SDL
|
||||
override USE_OPENGL=0
|
||||
override NOASM=1
|
||||
STDCPPLIB=-lstdc++
|
||||
LIBS+= -lsocket
|
||||
endif
|
||||
ifeq ($(PLATFORM),SUNOS)
|
||||
RENDERTYPE=SDL
|
||||
override USE_OPENGL=0
|
||||
override NOASM=1
|
||||
STDCPPLIB=-lstdc++
|
||||
LIBS+= -lsocket -lnsl
|
||||
endif
|
||||
ifeq ($(PLATFORM),SYLLABLE)
|
||||
RENDERTYPE=SDL
|
||||
override USE_OPENGL=0
|
||||
override NOASM=1
|
||||
endif
|
||||
|
||||
ifeq ($(RENDERTYPE),SDL)
|
||||
ifeq ($(SDL_FRAMEWORK),1)
|
||||
LIBS += -Wl,-framework,SDL
|
||||
SDLCONFIG_CFLAGS+= -I/Library/Frameworks/SDL.framework/Headers
|
||||
else
|
||||
ifneq ($(SDLCONFIG),)
|
||||
LIBS+= $(shell $(SDLCONFIG) --libs)
|
||||
SDLCONFIG_CFLAGS+=$(shell $(SDLCONFIG) --cflags)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq (1,$(WITHOUT_GTK))
|
||||
HAVE_GTK2=0
|
||||
else
|
||||
ifneq (No,$(shell pkg-config --exists gtk+-2.0 || echo No))
|
||||
HAVE_GTK2=1
|
||||
# On my 64bit Gentoo box I have Cairo enabled which means the libs list includes
|
||||
# -lpangocairo-1.0 and -lcairo, however the 32bit compatibility libraries don't
|
||||
# include cairo, so we need to filter out those -l switches in order to link
|
||||
ifneq ($(LINKED_GTK),0)
|
||||
ifeq ($(GTKCOMPAT32),1)
|
||||
LIBS+= $(shell pkg-config --libs gtk+-2.0 | sed 's/\s-l\(pango\)\{0,1\}cairo\S*\s/ /g')
|
||||
else
|
||||
LIBS+= $(shell pkg-config --libs gtk+-2.0)
|
||||
endif
|
||||
endif
|
||||
else
|
||||
HAVE_GTK2=0
|
||||
endif
|
||||
endif
|
||||
else
|
||||
ifeq ($(RENDERTYPE),WIN)
|
||||
LIBS+= -mwindows -ldxguid
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
BUILDCFLAGS+= -DRENDERTYPE$(RENDERTYPE)=1
|
||||
|
||||
ifneq (0,$(USE_OPENGL))
|
||||
BUILDCFLAGS+= -DUSE_OPENGL
|
||||
endif
|
||||
ifneq (0,$(NOASM))
|
||||
BUILDCFLAGS+= -DNOASM
|
||||
endif
|
||||
ifneq (0,$(LINKED_GTK))
|
||||
BUILDCFLAGS+= -DLINKED_GTK
|
||||
endif
|
||||
|
||||
ifneq (0,$(POLYMER))
|
||||
ifneq (0,$(USE_OPENGL))
|
||||
BUILDCFLAGS+= -DPOLYMER
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq (0,$(NEDMALLOC))
|
||||
BUILDCFLAGS+= -DNEDMALLOC
|
||||
endif
|
||||
|
||||
ifeq ($(PRETTY_OUTPUT),1)
|
||||
BUILD_STARTED = printf "\033[K\033[1;36mBuild started using \"$(CC) $(OURCFLAGS)\"\033[0m\n"
|
||||
BUILD_ECHOFLAGS = printf "\033[K\033[1;36mEnded compilation in this directory using \"$(CC) $(OURCFLAGS)\"\033[0m\n"
|
||||
BUILD_FINISHED = printf "\033[K\033[1;36mBuild successful:\033[0m\n"
|
||||
COMPILE_STATUS = printf "\033[K\033[0mBuilding object \033[1m$@\033[0m...\033[0m\r"
|
||||
COMPILE_OK = printf "\033[K\033[0;32mBuilt object \033[1;32m$@\033[0;32m \033[0m\n"
|
||||
COMPILE_FAILED = printf "\033[K\033[0;31mFailed building \033[1;31m$@\033[0;31m from\033[0m \033[1;31m$<\033[0;31m!\033[0m\n"; exit 1
|
||||
ARCHIVE_STATUS = printf "\033[K\033[0mCreating library archive \033[1m$@\033[0m...\033[0m\r"
|
||||
ARCHIVE_OK = printf "\033[K\033[0;32mCreated library archive \033[1;32m$@\033[0;32m \033[0m\n"
|
||||
ARCHIVE_FAILED = printf "\033[K\033[0;31mFailed creating library archive \033[1;31m$@\033[0;31m from\033[0m \033[1;31m$<\033[0;31m!\033[0m\n"; exit 1
|
||||
LINK_STATUS = printf "\033[K\033[0;0mLinking executable \033[1m$@\033[0;0m...\033[0m\r"
|
||||
LINK_OK = printf "\033[K\033[0;32mLinked executable \033[1;32m$@\033[0;32m \033[0m\n"
|
||||
LINK_FAILED = printf "\033[K\033[0;31mFailed linking executable \033[1;31m$@\033[0;31m!\033[0m\n"; exit 1
|
||||
else
|
||||
BUILD_STARTED =
|
||||
BUILD_ECHOFLAGS=
|
||||
BUILD_FINISHED =
|
||||
COMPILE_STATUS =
|
||||
COMPILE_OK = true
|
||||
COMPILE_FAILED = false; exit 1
|
||||
ARCHIVE_STATUS =
|
||||
ARCHIVE_OK = true
|
||||
ARCHIVE_FAILED = false; exit 1
|
||||
LINK_STATUS =
|
||||
LINK_OK = true
|
||||
LINK_FAILED = false; exit 1
|
||||
endif
|
|
@ -1,71 +0,0 @@
|
|||
BUILD SOURCE CODE LICENSE TERMS: 06/20/2000
|
||||
|
||||
[1] I give you permission to make modifications to my Build source and
|
||||
distribute it, BUT:
|
||||
|
||||
[2] Any derivative works based on my Build source may be distributed ONLY
|
||||
through the INTERNET.
|
||||
|
||||
[3] Distribution of any derivative works MUST be done completely FREE of
|
||||
charge - no commercial exploitation whatsoever.
|
||||
|
||||
[4] Anything you distribute which uses a part of my Build Engine source
|
||||
code MUST include:
|
||||
|
||||
[A] The following message somewhere in the archive:
|
||||
|
||||
// "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman
|
||||
// Ken Silverman's official web site: "http://www.advsys.net/ken"
|
||||
// See the included license file "BUILDLIC.TXT" for license info.
|
||||
|
||||
[B] This text file "BUILDLIC.TXT" along with it.
|
||||
|
||||
[C] Any source files that you modify must include this message as well:
|
||||
|
||||
// This file has been modified from Ken Silverman's original release
|
||||
|
||||
[5] The use of the Build Engine for commercial purposes will require an
|
||||
appropriate license arrangement with me. Contact information is
|
||||
on my web site.
|
||||
|
||||
[6] I take no responsibility for damage to your system.
|
||||
|
||||
[7] Technical support: Before contacting me with questions, please read
|
||||
and do ALL of the following!
|
||||
|
||||
[A] Look through ALL of my text files. There are 7 of them (including this
|
||||
one). I like to think that I wrote them for a reason. You will find
|
||||
many of your answers in the history section of BUILD.TXT and
|
||||
BUILD2.TXT (they're located inside SRC.ZIP).
|
||||
|
||||
[B] If that doesn't satisfy you, then try going to:
|
||||
|
||||
"http://www.advsys.net/ken/buildsrc"
|
||||
|
||||
where I will maintain a Build Source Code FAQ (or perhaps I might
|
||||
just provide a link to a good FAQ).
|
||||
|
||||
[C] I am willing to respond to questions, but ONLY if they come at a rate
|
||||
that I can handle.
|
||||
|
||||
PLEASE TRY TO AVOID ASKING DUPLICATE QUESTIONS!
|
||||
|
||||
As my line of defense, I will post my current policy about
|
||||
answering Build source questions (right below the E-mail address
|
||||
on my web site.) You can check there to see if I'm getting
|
||||
overloaded with questions or not.
|
||||
|
||||
If I'm too busy, it might say something like this:
|
||||
|
||||
I'm too busy to answer Build source questions right now.
|
||||
Sorry, but don't expect a reply from me any time soon.
|
||||
|
||||
If I'm open for Build source questions, please state your question
|
||||
clearly and don't include any unsolicited attachments unless
|
||||
they're really small (like less than 50k). Assume that I have
|
||||
a 28.8k modem. Also, don't leave out important details just
|
||||
to make your question appear shorter - making me guess what
|
||||
you're asking doesn't save me time!
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
-Ken S. (official web site: http://www.advsys.net/ken)
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,882 +0,0 @@
|
|||
// "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman
|
||||
// Ken Silverman's official web site: "http://www.advsys.net/ken"
|
||||
// See the included license file "BUILDLIC.TXT" for license info.
|
||||
|
||||
Build information to get you started:
|
||||
|
||||
The first half of this file explains the .ART, .MAP, and PALETTE.DAT formats.
|
||||
The second half has documentation about every BUILD engine function, what it
|
||||
does, and what the parameters are.
|
||||
|
||||
-Ken S.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
Documentation on Ken's .ART file format by Ken Silverman
|
||||
|
||||
I am documenting my ART format to allow you to program your own custom
|
||||
art utilites if you so desire. I am still planning on writing the script
|
||||
system.
|
||||
|
||||
All art files must have xxxxx###.ART. When loading an art file you
|
||||
should keep trying to open new xxxxx###'s, incrementing the number, until
|
||||
an art file is not found.
|
||||
|
||||
|
||||
1. long artversion;
|
||||
|
||||
The first 4 bytes in the art format are the version number. The current
|
||||
current art version is now 1. If artversion is not 1 then either it's the
|
||||
wrong art version or something is wrong.
|
||||
|
||||
2. long numtiles;
|
||||
|
||||
Numtiles is not really used anymore. I wouldn't trust it. Actually
|
||||
when I originally planning art version 1 many months ago, I thought I
|
||||
would need this variable, but it turned it is was unnecessary. To get
|
||||
the number of tiles, you should search all art files, and check the
|
||||
localtilestart and localtileend values for each file.
|
||||
|
||||
3. long localtilestart;
|
||||
|
||||
Localtilestart is the tile number of the first tile in this art file.
|
||||
|
||||
4. long localtileend;
|
||||
|
||||
Localtileend is the tile number of the last tile in this art file.
|
||||
Note: Localtileend CAN be higher than the last used slot in an art
|
||||
file.
|
||||
|
||||
Example: If you chose 256 tiles per art file:
|
||||
TILES000.ART -> localtilestart = 0, localtileend = 255
|
||||
TILES001.ART -> localtilestart = 256, localtileend = 511
|
||||
TILES002.ART -> localtilestart = 512, localtileend = 767
|
||||
TILES003.ART -> localtilestart = 768, localtileend = 1023
|
||||
|
||||
5. short tilesizx[localtileend-localtilestart+1];
|
||||
|
||||
This is an array of shorts of all the x dimensions of the tiles
|
||||
in this art file. If you chose 256 tiles per art file then
|
||||
[localtileend-localtilestart+1] should equal 256.
|
||||
|
||||
6. short tilesizy[localtileend-localtilestart+1];
|
||||
|
||||
This is an array of shorts of all the y dimensions.
|
||||
|
||||
7. long picanm[localtileend-localtilestart+1];
|
||||
|
||||
This array of longs stores a few attributes for each tile that you
|
||||
can set inside EDITART. You probably won't be touching this array, but
|
||||
I'll document it anyway.
|
||||
|
||||
Bit: |31 24|23 16|15 8|7 0|
|
||||
-----------------------------------------------------------------
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
-----------------------------------------------------------------
|
||||
| Anim. | Signed char | Signed char | | Animate |
|
||||
| Speed | Y-center | X-center | | number |
|
||||
--------| offset | offset | |------------
|
||||
--------------------------------| ------------
|
||||
| Animate type:|
|
||||
| 00 - NoAnm |
|
||||
| 01 - Oscil |
|
||||
| 10 - AnmFd |
|
||||
| 11 - AnmBk |
|
||||
----------------
|
||||
You probably recognize these:
|
||||
Animate speed - EDITART key: 'A', + and - to adjust
|
||||
Signed char x&y offset - EDITART key: '`', Arrows to adjust
|
||||
Animate number&type - EDITART key: +/- on keypad
|
||||
|
||||
8. After the picanm's, the rest of the file is straight-forward rectangular
|
||||
art data. You must go through the tilesizx and tilesizy arrays to find
|
||||
where the artwork is actually stored in this file.
|
||||
|
||||
Note: The tiles are stored in the opposite coordinate system than
|
||||
the screen memory is stored. Example on a 4*4 file:
|
||||
|
||||
Offsets:
|
||||
-----------------
|
||||
| 0 | 4 | 8 |12 |
|
||||
-----------------
|
||||
| 1 | 5 | 9 |13 |
|
||||
-----------------
|
||||
| 2 | 6 |10 |14 |
|
||||
-----------------
|
||||
| 3 | 7 |11 |15 |
|
||||
-----------------
|
||||
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
If you wish to display the artwork, you will also need to load your
|
||||
palette. To load the palette, simply read the first 768 bytes of your
|
||||
palette.dat and write it directly to the video card - like this:
|
||||
|
||||
Example:
|
||||
long i, fil;
|
||||
|
||||
fil = open("palette.dat",O_BINARY|O_RDWR,S_IREAD);
|
||||
read(fil,&palette[0],768);
|
||||
close(fil);
|
||||
|
||||
outp(0x3c8,0);
|
||||
for(i=0;i<768;i++)
|
||||
outp(0x3c9,palette[i]);
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
Packet format for DUKE3D (specifically for network mode 1, n(n-1) mode):
|
||||
|
||||
Example bunch of packets:
|
||||
A B C D E F G H I J K L M N... O
|
||||
---------------------------------------------------------------------
|
||||
d9 00 d9 11 01 00 - - - - - - - - - - 4f 16 31
|
||||
da 00 da 11 01 00 - - - - - - - - - - b2 b7 9d
|
||||
db 00 db 11 01 00 - - - - - - - - - - b1 24 62
|
||||
dc 00 dc 11 01 00 - - - - - - - - - - ca 1d 58
|
||||
dd 00 dd 11 01 00 - - - - - - - - - - a9 94 14
|
||||
de 00 de 11 01 05 00 00 - - 03 00 - - - - c5 50 b9
|
||||
df 00 df 11 01 0f a1 ff fe 09 00 00 26 - - - e2 88 6f
|
||||
e0 00 e0 11 01 04 - - - - fd ff - - - - 77 51 d7
|
||||
e1 00 e1 11 01 03 1f 00 ff 09 - - - - - - ac 14 b7
|
||||
e2 00 e2 11 01 0b 9c 00 fb 09 - - 24 - - - f8 6c 22
|
||||
|
||||
GAME sends fields D-N
|
||||
MMULTI adds fields A-C and O for error correction.
|
||||
|
||||
A: Packet count sending modulo 256
|
||||
B: Error state. Usually 0. To request a resend, bit 0 is set. In order
|
||||
to catch up on networks, sending many packets is bad, so 2 packets
|
||||
are sent in 1 IPX packet. To send 2 packets in 1 packet, bit 1 is set.
|
||||
In special cases, this value may be different.
|
||||
C: Packet count receiving modulo 256
|
||||
|
||||
D: Message header byte. These are all the possible values currently. You
|
||||
are probably only interested in case 17. Note that fields E-N apply
|
||||
to case 17 only.
|
||||
0: send movement info from master to slave (network mode 0 only)
|
||||
1: send movement info from slave to master (network mode 0 only)
|
||||
4: user-typed messages
|
||||
5: Re-start level with given parameters
|
||||
6: Send player name
|
||||
7: Play Remote Ridicule sound
|
||||
8: Re-start level with given parameters for a user map
|
||||
17: send movement info to everybody else (network mode 1 only)
|
||||
250: Wait for Everybody (Don't start until everybody's done loading)
|
||||
255: Player quit to DOS
|
||||
|
||||
E: Timing byte used to calculate lag time. This prevents the 2 computer's
|
||||
timers from drifting apart.
|
||||
|
||||
F: Bits field byte. Fields G-M are sent only when certain bits
|
||||
in this byte are set.
|
||||
|
||||
G: X momentum update (2 bytes). Sent only if ((F&1) != 0)
|
||||
|
||||
H: Y momentum update (2 bytes). Sent only if ((F&2) != 0)
|
||||
|
||||
I: Angle momentum update (2 bytes). Sent only if ((F&4) != 0)
|
||||
|
||||
J: The states of 8 different keys (1 byte). Sent only if ((F&8) != 0)
|
||||
K: The states of 8 different keys (1 byte). Sent only if ((F&16) != 0)
|
||||
L: The states of 8 different keys (1 byte). Sent only if ((F&32) != 0)
|
||||
M: The states of 8 different keys (1 byte). Sent only if ((F&64) != 0)
|
||||
|
||||
N: Sync checking byte. Useful for debugging programming errors. Can be a
|
||||
variable number of bytes. Actual number of sync checking bytes is
|
||||
calculated by length of the whole packet minus the rest of the bytes sent.
|
||||
|
||||
O: CRC-16
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
| @@@@@@@@@@@ @@@ @@@ @@@@@@@@@ @@@ @@@@@@@@@ |
|
||||
| @@@@@@@@@@@@@ @@@ @@@ @@@@@@@@@ @@@ @@@@@@@@@@@ |
|
||||
| @@@ @@@@ @@@ @@@ @@@ @@@ @@@ @@@@@ |
|
||||
| @@@ @@@ @@@ @@@ @@@ @@@ @@@ @@@@ |
|
||||
| @@@ @@@@ @@@ @@@ @@@ @@@ @@@ @@@ |
|
||||
| @@@@@@@@@@@@@ @@@ @@@ @@@ @@@ @@@ @@@ |
|
||||
| @@@@@@@@@@@@@ @@@ @@@ @@@ @@@ @@@ @@@ |
|
||||
| @@@ @@@@ @@@ @@@ @@@ @@@ @@@ @@@ |
|
||||
| @@@ @@@ @@@ @@@ @@@ @@@ @@@ @@@@ |
|
||||
| @@@ @@@@ @@@@ @@@@ @@@ @@@ @@@ @@@@@ |
|
||||
| @@@@@@@@@@@@@ @@@@@@@@@@@ @@@@@@@@@ @@@@@@@@@@@@ @@@@@@@@@@@ |
|
||||
| @@@@@@@@@@@ @@@@@@@ @@@@@@@@@ @@@@@@@@@@@@ @@@@@@@@@ |
|
||||
| |
|
||||
| M A P F O R M A T ! |
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
Here is Ken's documentation on the COMPLETE BUILD map format:
|
||||
BUILD engine and editor programmed completely by Ken Silverman
|
||||
|
||||
Here's how you should read a BUILD map file:
|
||||
{
|
||||
fil = open(???);
|
||||
|
||||
//Load map version number (current version is 7L)
|
||||
read(fil,&mapversion,4);
|
||||
|
||||
//Load starting position
|
||||
read(fil,posx,4);
|
||||
read(fil,posy,4);
|
||||
read(fil,posz,4); //Note: Z coordinates are all shifted up 4
|
||||
read(fil,ang,2); //All angles are from 0-2047, clockwise
|
||||
read(fil,cursectnum,2); //Sector of starting point
|
||||
|
||||
//Load all sectors (see sector structure described below)
|
||||
read(fil,&numsectors,2);
|
||||
read(fil,§or[0],sizeof(sectortype)*numsectors);
|
||||
|
||||
//Load all walls (see wall structure described below)
|
||||
read(fil,&numwalls,2);
|
||||
read(fil,&wall[0],sizeof(walltype)*numwalls);
|
||||
|
||||
//Load all sprites (see sprite structure described below)
|
||||
read(fil,&numsprites,2);
|
||||
read(fil,&sprite[0],sizeof(spritetype)*numsprites);
|
||||
|
||||
close(fil);
|
||||
}
|
||||
|
||||
-------------------------------------------------------------
|
||||
| @@@@@@@ @@@@@@@ @@@@@@@ @@@@@@@@ @@@@@@@ @@@@@@@ @@@@@@@ |
|
||||
| @@ @@ @@ @@ @@ @@ @@ @@@ @@ |
|
||||
| @@@@@@@ @@@@@ @@ @@ @@ @@ @@@@@@@ @@@@@@@ |
|
||||
| @@ @@ @@ @@ @@ @@ @@ @@@ @@ |
|
||||
| @@@@@@@ @@@@@@@ @@@@@@@ @@ @@@@@@@ @@ @@ @@@@@@@ |
|
||||
-------------------------------------------------------------
|
||||
|
||||
//sizeof(sectortype) = 40
|
||||
typedef struct
|
||||
{
|
||||
short wallptr, wallnum;
|
||||
long ceilingz, floorz;
|
||||
short ceilingstat, floorstat;
|
||||
short ceilingpicnum, ceilingheinum;
|
||||
signed char ceilingshade;
|
||||
char ceilingpal, ceilingxpanning, ceilingypanning;
|
||||
short floorpicnum, floorheinum;
|
||||
signed char floorshade;
|
||||
char floorpal, floorxpanning, floorypanning;
|
||||
char visibility, filler;
|
||||
short lotag, hitag, extra;
|
||||
} sectortype;
|
||||
sectortype sector[1024];
|
||||
|
||||
wallptr - index to first wall of sector
|
||||
wallnum - number of walls in sector
|
||||
z's - z coordinate (height) of ceiling / floor at first point of sector
|
||||
stat's
|
||||
bit 0: 1 = parallaxing, 0 = not "P"
|
||||
bit 1: 1 = sloped, 0 = not
|
||||
bit 2: 1 = swap x&y, 0 = not "F"
|
||||
bit 3: 1 = double smooshiness "E"
|
||||
bit 4: 1 = x-flip "F"
|
||||
bit 5: 1 = y-flip "F"
|
||||
bit 6: 1 = Align texture to first wall of sector "R"
|
||||
bits 7-15: reserved
|
||||
picnum's - texture index into art file
|
||||
heinum's - slope value (rise/run) (0-parallel to floor, 4096-45 degrees)
|
||||
shade's - shade offset of ceiling/floor
|
||||
pal's - palette lookup table number (0 - use standard colors)
|
||||
panning's - used to align textures or to do texture panning
|
||||
visibility - determines how fast an area changes shade relative to distance
|
||||
filler - useless byte to make structure aligned
|
||||
lotag, hitag, extra - These variables used by the game programmer only
|
||||
|
||||
|
||||
-----------------------------------------------
|
||||
| @@ @@ @@@@@@@@ @@ @@ @@@@@@@ |
|
||||
| @@ @@ @@ @@ @@ @@ @@ |
|
||||
| @@ @@ @@ @@@@@@@@ @@ @@ @@@@@@@ |
|
||||
| @@ @@@@ @@ @@ @@ @@ @@ @@ |
|
||||
| @@@ @@@@ @@ @@ @@@@@@@ @@@@@@@ @@@@@@@ |
|
||||
----------------------------------------------|
|
||||
|
||||
//sizeof(walltype) = 32
|
||||
typedef struct
|
||||
{
|
||||
long x, y;
|
||||
short point2, nextwall, nextsector, cstat;
|
||||
short picnum, overpicnum;
|
||||
signed char shade;
|
||||
char pal, xrepeat, yrepeat, xpanning, ypanning;
|
||||
short lotag, hitag, extra;
|
||||
} walltype;
|
||||
walltype wall[8192];
|
||||
|
||||
x, y: Coordinate of left side of wall, get right side from next wall's left side
|
||||
point2: Index to next wall on the right (always in the same sector)
|
||||
nextwall: Index to wall on other side of wall (-1 if there is no sector)
|
||||
nextsector: Index to sector on other side of wall (-1 if there is no sector)
|
||||
cstat:
|
||||
bit 0: 1 = Blocking wall (use with clipmove, getzrange) "B"
|
||||
bit 1: 1 = bottoms of invisible walls swapped, 0 = not "2"
|
||||
bit 2: 1 = align picture on bottom (for doors), 0 = top "O"
|
||||
bit 3: 1 = x-flipped, 0 = normal "F"
|
||||
bit 4: 1 = masking wall, 0 = not "M"
|
||||
bit 5: 1 = 1-way wall, 0 = not "1"
|
||||
bit 6: 1 = Blocking wall (use with hitscan / cliptype 1) "H"
|
||||
bit 7: 1 = Transluscence, 0 = not "T"
|
||||
bit 8: 1 = y-flipped, 0 = normal "F"
|
||||
bit 9: 1 = Transluscence reversing, 0 = normal "T"
|
||||
bits 10-15: reserved
|
||||
picnum - texture index into art file
|
||||
overpicnum - texture index into art file for masked walls / 1-way walls
|
||||
shade - shade offset of wall
|
||||
pal - palette lookup table number (0 - use standard colors)
|
||||
repeat's - used to change the size of pixels (stretch textures)
|
||||
pannings - used to align textures or to do texture panning
|
||||
lotag, hitag, extra - These variables used by the game programmer only
|
||||
|
||||
-------------------------------------------------------------
|
||||
| @@@@@@@ @@@@@@@ @@@@@@@ @@@@@@ @@@@@@@@ @@@@@@@ @@@@@@@ |
|
||||
| @@ @@ @@ @@ @@@ @@ @@ @@ @@ |
|
||||
| @@@@@@@ @@@@@@@ @@@@@@@ @@ @@ @@@@@ @@@@@@@ |
|
||||
| @@ @@ @@ @@ @@ @@ @@ @@ |
|
||||
| @@@@@@@ @@ @@ @@ @@@@@@ @@ @@@@@@@ @@@@@@@ |
|
||||
-------------------------------------------------------------
|
||||
|
||||
//sizeof(spritetype) = 44
|
||||
typedef struct
|
||||
{
|
||||
long x, y, z;
|
||||
short cstat, picnum;
|
||||
signed char shade;
|
||||
char pal, clipdist, filler;
|
||||
unsigned char xrepeat, yrepeat;
|
||||
signed char xoffset, yoffset;
|
||||
short sectnum, statnum;
|
||||
short ang, owner, xvel, yvel, zvel;
|
||||
short lotag, hitag, extra;
|
||||
} spritetype;
|
||||
spritetype sprite[4096];
|
||||
x, y, z - position of sprite - can be defined at center bottom or center
|
||||
cstat:
|
||||
bit 0: 1 = Blocking sprite (use with clipmove, getzrange) "B"
|
||||
bit 1: 1 = transluscence, 0 = normal "T"
|
||||
bit 2: 1 = x-flipped, 0 = normal "F"
|
||||
bit 3: 1 = y-flipped, 0 = normal "F"
|
||||
bits 5-4: 00 = FACE sprite (default) "R"
|
||||
01 = WALL sprite (like masked walls)
|
||||
10 = FLOOR sprite (parallel to ceilings&floors)
|
||||
bit 6: 1 = 1-sided sprite, 0 = normal "1"
|
||||
bit 7: 1 = Real centered centering, 0 = foot center "C"
|
||||
bit 8: 1 = Blocking sprite (use with hitscan / cliptype 1) "H"
|
||||
bit 9: 1 = Transluscence reversing, 0 = normal "T"
|
||||
bits 10-14: reserved
|
||||
bit 15: 1 = Invisible sprite, 0 = not invisible
|
||||
picnum - texture index into art file
|
||||
shade - shade offset of sprite
|
||||
pal - palette lookup table number (0 - use standard colors)
|
||||
clipdist - the size of the movement clipping square (face sprites only)
|
||||
filler - useless byte to make structure aligned
|
||||
repeat's - used to change the size of pixels (stretch textures)
|
||||
offset's - used to center the animation of sprites
|
||||
sectnum - current sector of sprite
|
||||
statnum - current status of sprite (inactive/monster/bullet, etc.)
|
||||
|
||||
ang - angle the sprite is facing
|
||||
owner, xvel, yvel, zvel, lotag, hitag, extra - These variables used by the
|
||||
game programmer only
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
| IMPORTANT ENGINE FUNCTIONS: |
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
initengine()
|
||||
Initializes many variables for the BUILD engine. You should call this
|
||||
once before any other functions of the BUILD engine are used.
|
||||
|
||||
uninitengine();
|
||||
Frees buffers. You should call this once at the end of the program
|
||||
before quitting to dos.
|
||||
|
||||
loadboard(char *filename, long *posx, long *posy, long *posz, short *ang, short *cursectnum)
|
||||
saveboard(char *filename, long *posx, long *posy, long *posz, short *ang, short *cursectnum)
|
||||
Loads/saves the given board file from memory. Returns -1 if file not
|
||||
found. If no extension is given, .MAP will be appended to the filename.
|
||||
|
||||
loadpics(char *filename);
|
||||
Loads the given artwork file into memory for the BUILD engine.
|
||||
Returns -1 if file not found. If no extension is given, .ART will
|
||||
be appended to the filename.
|
||||
|
||||
loadtile(short tilenum)
|
||||
Loads a given tile number from disk into memory if it is not already in
|
||||
memory. This function calls allocache internally. A tile is not in the
|
||||
cache if (waloff[tilenum] == 0)
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
| SCREEN STATUS FUNCTIONS: |
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
setgamemode(char vidoption, long xdim, long ydim);
|
||||
This function sets the video mode to 320*200*256color graphics.
|
||||
Since BUILD supports several different modes including mode x,
|
||||
mode 13h, and other special modes, I don't expect you to write
|
||||
any graphics output functions. (Soon I have all the necessary
|
||||
functions) If for some reason, you use your own graphics mode,
|
||||
you must call this function again before using the BUILD drawing
|
||||
functions.
|
||||
|
||||
vidoption can be anywhere from 0-6
|
||||
xdim,ydim can be any vesa resolution if vidoption = 1
|
||||
xdim,ydim must be 320*200 for any other mode.
|
||||
(see graphics mode selection in my setup program)
|
||||
|
||||
setview(long x1, long y1, long x2, long y2)
|
||||
Sets the viewing window to a given rectangle of the screen.
|
||||
Example: For full screen 320*200, call like this: setview(0L,0L,319L,199L);
|
||||
|
||||
nextpage();
|
||||
This function flips to the next video page. After a screen is prepared,
|
||||
use this function to view the screen.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
| DRAWING FUNCTIONS: |
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
drawrooms(long posx, long posy, long posz, short ang, long horiz, short cursectnum)
|
||||
This function draws the 3D screen to the current drawing page,
|
||||
which is not yet shown. This way, you can overwrite some things
|
||||
over the 3D screen such as a gun. Be sure to call the drawmasks()
|
||||
function soon after you call the drawrooms() function. To view
|
||||
the screen, use the nextpage() function. The nextpage() function
|
||||
should always be called sometime after each draw3dscreen()
|
||||
function.
|
||||
|
||||
drawmasks();
|
||||
This function draws all the sprites and masked walls to the current
|
||||
drawing page which is not yet shown. The reason I have the drawing
|
||||
split up into these 2 routines is so you can animate just the
|
||||
sprites that are about to be drawn instead of having to animate
|
||||
all the sprites on the whole board. Drawrooms() prepares these
|
||||
variables: spritex[], spritey[], spritepicnum[], thesprite[],
|
||||
and spritesortcnt. Spritesortcnt is the number of sprites about
|
||||
to be drawn to the page. To change the sprite's picnum, simply
|
||||
modify the spritepicnum array If you want to change other parts
|
||||
of the sprite structure, then you can use the thesprite array to
|
||||
get an index to the actual sprite number.
|
||||
|
||||
clearview(long col)
|
||||
Clears the current video page to the given color
|
||||
|
||||
clearallviews(long col)
|
||||
Clears all video pages to the given color
|
||||
|
||||
drawmapview (long x, long y, long zoom, short ang)
|
||||
Draws the 2-D texturized map at the given position into the viewing window.
|
||||
|
||||
rotatesprite (long sx, long sy, long z, short a, short picnum,
|
||||
signed char dashade, char dapalnum, char dastat,
|
||||
long cx1, long cy1, long cx2, long cy2)
|
||||
(sx, sy) is the center of the sprite to draw defined as
|
||||
screen coordinates shifted up by 16.
|
||||
(z) is the zoom. Normal zoom is 65536.
|
||||
Ex: 131072 is zoomed in 2X and 32768 is zoomed out 2X.
|
||||
(a) is the angle (0 is straight up)
|
||||
(picnum) is the tile number
|
||||
(dashade) is 0 normally but can be any standard shade up to 31 or 63.
|
||||
(dapalnum) can be from 0-255.
|
||||
if ((dastat&1) == 0) - no transluscence
|
||||
if ((dastat&1) != 0) - transluscence
|
||||
if ((dastat&2) == 0) - don't scale to setview's viewing window
|
||||
if ((dastat&2) != 0) - scale to setview's viewing window (windowx1,etc.)
|
||||
if ((dastat&4) == 0) - nuttin' special
|
||||
if ((dastat&4) != 0) - y-flip image
|
||||
if ((dastat&8) == 0) - clip to startumost/startdmost
|
||||
if ((dastat&8) != 0) - don't clip to startumost/startdmost
|
||||
if ((dastat&16) == 0) - use Editart center as point passed
|
||||
if ((dastat&16) != 0) - force point passed to be top-left corner
|
||||
if ((dastat&32) == 0) - nuttin' special
|
||||
if ((dastat&32) != 0) - use reverse transluscence
|
||||
if ((dastat&64) == 0) - masked drawing (check 255's) (slower)
|
||||
if ((dastat&64) != 0) - draw everything (don't check 255's) (faster)
|
||||
if ((dastat&128) == 0) - nuttin' special
|
||||
if ((dastat&128) != 0) - automatically draw to all video pages
|
||||
|
||||
Note: As a special case, if both ((dastat&2) != 0) and ((dastat&8) != 0)
|
||||
then rotatesprite will scale to the full screen (0,0,xdim-1,ydim-1)
|
||||
rather than setview's viewing window. (windowx1,windowy1,etc.) This
|
||||
case is useful for status bars, etc.
|
||||
|
||||
Ex: rotatesprite(160L<<16,100L<<16,65536,totalclock<<4,
|
||||
DEMOSIGN,2,50L,50L,270L,150L);
|
||||
This example will draw the DEMOSIGN tile in the center of the
|
||||
screen and rotate about once per second. The sprite will only
|
||||
get drawn inside the rectangle from (50,50) to (270,150)
|
||||
|
||||
drawline256(long x1, long y1, long x2, long y2, char col)
|
||||
Draws a solid line from (x1,y1) to (x2,y2) with color (col)
|
||||
For this function, screen coordinates are all shifted up 16 for precision.
|
||||
|
||||
printext256(long xpos, long ypos, short col, short backcol,
|
||||
char *message, char fontsize)
|
||||
Draws a text message to the screen.
|
||||
(xpos,ypos) - position of top left corner
|
||||
col - color of text
|
||||
backcol - background color, if -1, then background is transparent
|
||||
message - text message
|
||||
fontsize - 0 - 8*8 font
|
||||
1 - 4*6 font
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
| MOVEMENT COLLISION FUNCTIONS: |
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
clipmove(long *x, long *y, long *z, short *sectnum, long xvect, long yvect,
|
||||
long walldist, long ceildist, long flordist, unsigned long cliptype)
|
||||
Moves any object (x, y, z) in any direction at any velocity and will
|
||||
make sure the object will stay a certain distance from walls (walldist)
|
||||
Pass the pointers of the starting position (x, y, z). Then
|
||||
pass the starting position's sector number as a pointer also.
|
||||
Also these values will be modified accordingly. Pass the
|
||||
direction and velocity by using a vector (xvect, yvect).
|
||||
If you don't fully understand these equations, please call me.
|
||||
xvect = velocity * cos(angle)
|
||||
yvect = velocity * sin(angle)
|
||||
Walldist tells how close the object can get to a wall. I use
|
||||
128L as my default. If you increase walldist all of a sudden
|
||||
for a certain object, the object might leak through a wall, so
|
||||
don't do that!
|
||||
Cliptype is a mask that tells whether the object should be clipped
|
||||
to or not. The lower 16 bits are anded with wall[].cstat and the higher
|
||||
16 bits are anded with sprite[].cstat.
|
||||
|
||||
Clipmove can either return 0 (touched nothing)
|
||||
32768+wallnum (wall first touched)
|
||||
49152+spritenum (sprite first touched)
|
||||
|
||||
pushmove (long *x, long *y, long *z, short *sectnum,
|
||||
long walldist, long ceildist, long flordist, unsigned long cliptype)
|
||||
This function makes sure a player or monster (defined by x, y, z, sectnum)
|
||||
is not too close to a wall. If it is, then it attempts to push it away.
|
||||
If after 256 tries, it is unable to push it away, it returns -1, in which
|
||||
case the thing should gib.
|
||||
|
||||
getzrange(long x, long y, long z, short sectnum,
|
||||
long *ceilz, long *ceilhit,
|
||||
long *florz, long *florhit,
|
||||
long walldist, unsigned long cliptype)
|
||||
|
||||
Use this in conjunction with clipmove. This function will keep the
|
||||
player from falling off cliffs when you're too close to the edge. This
|
||||
function finds the highest and lowest z coordinates that your clipping
|
||||
BOX can get to. It must search for all sectors (and sprites) that go
|
||||
into your clipping box. This method is better than using
|
||||
sector[cursectnum].ceilingz and sector[cursectnum].floorz because this
|
||||
searches the whole clipping box for objects, not just 1 point.
|
||||
Pass x, y, z, sector normally. Walldist can be 128. Cliptype is
|
||||
defined the same way as it is for clipmove. This function returns the
|
||||
z extents in ceilz and florz. It will return the object hit in ceilhit
|
||||
and florhit. Ceilhit and florhit will also be either:
|
||||
16384+sector (sector first touched) or
|
||||
49152+spritenum (sprite first touched)
|
||||
|
||||
hitscan(long xstart, long ystart, long zstart, short startsectnum,
|
||||
long vectorx, long vectory, long vectorz,
|
||||
short *hitsect, short *hitwall, short *hitsprite,
|
||||
long *hitx, long *hity, long *hitz);
|
||||
|
||||
Pass the starting 3D position:
|
||||
(xstart, ystart, zstart, startsectnum)
|
||||
Then pass the 3D angle to shoot (defined as a 3D vector):
|
||||
(vectorx, vectory, vectorz)
|
||||
Then set up the return values for the object hit:
|
||||
(hitsect, hitwall, hitsprite)
|
||||
and the exact 3D point where the ray hits:
|
||||
(hitx, hity, hitz)
|
||||
|
||||
How to determine what was hit:
|
||||
* Hitsect is always equal to the sector that was hit (always >= 0).
|
||||
|
||||
* If the ray hits a sprite then:
|
||||
hitsect = thesectornumber
|
||||
hitsprite = thespritenumber
|
||||
hitwall = -1
|
||||
|
||||
* If the ray hits a wall then:
|
||||
hitsect = thesectornumber
|
||||
hitsprite = -1
|
||||
hitwall = thewallnumber
|
||||
|
||||
* If the ray hits the ceiling of a sector then:
|
||||
hitsect = thesectornumber
|
||||
hitsprite = -1
|
||||
hitwall = -1
|
||||
vectorz < 0
|
||||
(If vectorz < 0 then you're shooting upward which means
|
||||
that you couldn't have hit a floor)
|
||||
|
||||
* If the ray hits the floor of a sector then:
|
||||
hitsect = thesectornumber
|
||||
hitsprite = -1
|
||||
hitwall = -1
|
||||
vectorz > 0
|
||||
(If vectorz > 0 then you're shooting downard which means
|
||||
that you couldn't have hit a ceiling)
|
||||
|
||||
neartag(long x, long y, long z, short sectnum, short ang, //Starting position & angle
|
||||
short *neartagsector, //Returns near sector if sector[].tag != 0
|
||||
short *neartagwall, //Returns near wall if wall[].tag != 0
|
||||
short *neartagsprite, //Returns near sprite if sprite[].tag != 0
|
||||
long *neartaghitdist, //Returns actual distance to object (scale: 1024=largest grid size)
|
||||
long neartagrange, //Choose maximum distance to scan (scale: 1024=largest grid size)
|
||||
char tagsearch) //1-lotag only, 2-hitag only, 3-lotag&hitag
|
||||
Neartag works sort of like hitscan, but is optimized to
|
||||
scan only close objects and scan only objects with
|
||||
tags != 0. Neartag is perfect for the first line of your space bar code.
|
||||
It will tell you what door you want to open or what switch you want to
|
||||
flip.
|
||||
|
||||
cansee(long x1, long y1, long z1, short sectnum1,
|
||||
long x2, long y2, long z2, short sectnum2); returns 0 or 1
|
||||
This function determines whether or not two 3D points can "see" each
|
||||
other or not. All you do is pass it the coordinates of a 3D line defined
|
||||
by two 3D points (with their respective sectors) The function will return
|
||||
a 1 if the points can see each other or a 0 if there is something blocking
|
||||
the two points from seeing each other. This is how I determine whether a
|
||||
monster can see you or not. Try playing DOOM1.DAT to fully enjoy this
|
||||
great function!
|
||||
|
||||
updatesector(long x, long y, §num);
|
||||
This function updates the sector number according to the x and y values
|
||||
passed to it. Be careful when you use this function with sprites because
|
||||
remember that the sprite's sector number should not be modified directly.
|
||||
If you want to update a sprite's sector, I recomment using the setsprite
|
||||
function described below.
|
||||
|
||||
inside(long x, long y, short sectnum);
|
||||
Tests to see whether the overhead point (x, y) is inside sector (sectnum)
|
||||
Returns either 0 or 1, where 1 means it is inside, and 0 means it is not.
|
||||
|
||||
clipinsidebox(long x, long y, short wallnum, long walldist)
|
||||
Returns TRUE only if the given line (wallnum) intersects the square with
|
||||
center (x,y) and radius, walldist.
|
||||
|
||||
dragpoint(short wallnum, long newx, long newy);
|
||||
This function will drag a point in the exact same way a point is dragged
|
||||
in 2D EDIT MODE using the left mouse button. Simply pass it which wall
|
||||
to drag and then pass the new x and y coordinates for that point.
|
||||
Please use this function because if you don't and try to drag points
|
||||
yourself, I can guarantee that it won't work as well as mine and you
|
||||
will get confused. Note: Every wall of course has 2 points. When you
|
||||
pass a wall number to this function, you are actually passing 1 point,
|
||||
the left side of the wall (given that you are in the sector of that wall)
|
||||
Got it?
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
| MATH HELPER FUNCTIONS: |
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
krand()
|
||||
Random number function - returns numbers from 0-65535
|
||||
|
||||
ksqrt(long num)
|
||||
Returns the integer square root of the number.
|
||||
|
||||
getangle(long xvect, long yvect)
|
||||
Gets the angle of a vector (xvect,yvect)
|
||||
These are 2048 possible angles starting from the right, going clockwise
|
||||
|
||||
rotatepoint(long xpivot, long ypivot, long x, long y,
|
||||
short daang, long *x2, long *y2);
|
||||
This function is a very convenient and fast math helper function.
|
||||
Rotate points easily with this function without having to juggle your
|
||||
cosines and sines. Simply pass it:
|
||||
|
||||
Input: 1. Pivot point (xpivot,ypivot)
|
||||
2. Original point (x,y)
|
||||
3. Angle to rotate (0 = nothing, 512 = 90ø CW, etc.)
|
||||
Output: 4. Rotated point (*x2,*y2)
|
||||
|
||||
lastwall(short point);
|
||||
Use this function as a reverse function of wall[].point2. In order
|
||||
to save memory, my walls are only on a single linked list.
|
||||
|
||||
nextsectorneighborz(short sectnum, long thez, short topbottom, short direction)
|
||||
This function is used to tell where elevators should stop. It searches
|
||||
nearby sectors for the next closest ceilingz or floorz it should stop at.
|
||||
sectnum - elevator sector
|
||||
thez - current z to start search from
|
||||
topbottom - search ceilingz's/floorz's only
|
||||
direction - search upwards/downwards
|
||||
|
||||
getceilzofslope(short sectnum, long x, long y)
|
||||
getflorzofslope(short sectnum, long x, long y)
|
||||
getzsofslope(short sectnum, long x, long y, long *ceilz, long *florz)
|
||||
These 3 functions get the height of a ceiling and/or floor in a sector
|
||||
at any (x,y) location. Use getzsofslope only if you need both the ceiling
|
||||
and floor.
|
||||
|
||||
alignceilslope(short sectnum, long x, long y, long z)
|
||||
alignflorslope(short sectnum, long x, long y, long z)
|
||||
Given a sector and assuming it's first wall is the pivot wall of the slope,
|
||||
this function makes the slope pass through the x,y,z point. One use of
|
||||
this function is used for sin-wave floors.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
| SPRITE FUNCTIONS: |
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
insertsprite(short sectnum, short statnum); //returns (short)spritenum;
|
||||
Whenever you insert a sprite, you must pass it the sector
|
||||
number, and a status number (statnum). The status number can be any
|
||||
number from 0 to MAXSTATUS-1. Insertsprite works like a memory
|
||||
allocation function and returns the sprite number.
|
||||
|
||||
deletesprite(short spritenum);
|
||||
Deletes the sprite.
|
||||
|
||||
changespritesect(short spritenum, short newsectnum);
|
||||
Changes the sector of sprite (spritenum) to the
|
||||
newsector (newsectnum). This function may become
|
||||
internal to the engine in the movesprite function. But
|
||||
this function is necessary since all the sectors have
|
||||
their own doubly-linked lists of sprites.
|
||||
|
||||
changespritestat(short spritenum, short newstatnum);
|
||||
Changes the status of sprite (spritenum) to status
|
||||
(newstatus). Newstatus can be any number from 0 to MAXSTATUS-1.
|
||||
You can use this function to put a monster on a list of active sprites
|
||||
when it first sees you.
|
||||
|
||||
setsprite(short spritenum, long newx, long newy, long newz);
|
||||
This function simply sets the sprite's position to a specified
|
||||
coordinate (newx, newy, newz) without any checking to see
|
||||
whether the position is valid or not. You could directly
|
||||
modify the sprite[].x, sprite[].y, and sprite[].z values, but
|
||||
if you use my function, the sprite is guaranteed to be in the
|
||||
right sector.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
| CACHE FUNCTIONS: |
|
||||
-----------------------------------------------------------------------------
|
||||
initcache(long dacachestart, long dacachesize)
|
||||
First allocate a really large buffer (as large as possible), then pass off
|
||||
the memory bufer the initcache
|
||||
dacachestart: 32-bit offset in memory of start of cache
|
||||
dacachesize: number of bytes that were allocated for the cache to use
|
||||
|
||||
allocache (long *bufptr, long bufsiz, char *lockptr)
|
||||
*bufptr = pointer to 4-byte pointer to buffer. This
|
||||
allows allocache to remove previously allocated things
|
||||
from the cache safely by setting the 4-byte pointer to 0.
|
||||
bufsiz = number of bytes to allocate
|
||||
*lockptr = pointer to locking char which tells whether
|
||||
the region can be removed or not. If *lockptr = 0 then
|
||||
the region is not locked else its locked.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
| GROUP FILE FUNCTIONS: |
|
||||
-----------------------------------------------------------------------------
|
||||
initgroupfile(char *filename)
|
||||
Tells the engine what the group file name is.
|
||||
You should call this before any of the following group file functions.
|
||||
uninitgroupfile()
|
||||
Frees buffers. You should call this once at the end of the program
|
||||
before quitting to dos.
|
||||
|
||||
kopen4load(char *filename, char searchfirst)
|
||||
Open a file. First tries to open a stand alone file. Then searches for
|
||||
it in the group file. If searchfirst is nonzero, it will check the group
|
||||
file only.
|
||||
|
||||
kread(long handle, void *buffer, long leng)
|
||||
klseek(long handle, long offset, long whence)
|
||||
kfilelength(long handle)
|
||||
kclose(long handle)
|
||||
These 4 functions simply shadow the dos file functions - they
|
||||
can do file I/O on the group file in addition to stand-along files.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
| COMMUNICATIONS FUNCTIONS: |
|
||||
-----------------------------------------------------------------------------
|
||||
Much of the following code is to keep compatibity with older network code:
|
||||
|
||||
initmultiplayers(char damultioption, char dacomrateoption, char dapriority)
|
||||
The parameters are ignored - just pass 3 0's
|
||||
uninitmultiplayers() Does nothing
|
||||
|
||||
sendpacket(long other, char *bufptr, long messleng)
|
||||
other - who to send the packet to
|
||||
bufptr - pointer to message to send
|
||||
messleng - length of message
|
||||
short getpacket (short *other, char *bufptr)
|
||||
returns the number of bytes of the packet received, 0 if no packet
|
||||
other - who the packet was received from
|
||||
bufptr - pointer to message that was received
|
||||
|
||||
sendlogon() Does nothing
|
||||
sendlogoff()
|
||||
Sends a packet to everyone else where the
|
||||
first byte is 255, and the
|
||||
second byte is myconnectindex
|
||||
|
||||
getoutputcirclesize() Does nothing - just a stub function, returns 0
|
||||
setsocket(short newsocket) Does nothing
|
||||
|
||||
flushpackets()
|
||||
Clears all packet buffers
|
||||
genericmultifunction(long other, char *bufptr, long messleng, long command)
|
||||
Passes a buffer to the commit driver. This command provides a gateway
|
||||
for game programmer to access COMMIT directly.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
| PALETTE FUNCTIONS: |
|
||||
-----------------------------------------------------------------------------
|
||||
VBE_setPalette(long start, long num, char *palettebuffer)
|
||||
VBE_getPalette(long start, long num, char *palettebuffer)
|
||||
Set (num) palette palette entries starting at (start)
|
||||
palette entries are in a 4-byte format in this order:
|
||||
0: Blue (0-63)
|
||||
1: Green (0-63)
|
||||
2: Red (0-63)
|
||||
3: Reserved
|
||||
|
||||
makepalookup(long palnum, char *remapbuf,
|
||||
signed char r, signed char g, signed char b,
|
||||
char dastat)
|
||||
This function allows different shirt colors for sprites. First prepare
|
||||
remapbuf, which is a 256 byte buffer of chars which the colors to remap.
|
||||
Palnum can be anywhere from 1-15. Since 0 is where the normal palette is
|
||||
stored, it is a bad idea to call this function with palnum=0.
|
||||
In BUILD.H notice I added a new variable, spritepal[MAXSPRITES].
|
||||
Usually the value of this is 0 for the default palette. But if you
|
||||
change it to the palnum in the code between drawrooms() and drawmasks
|
||||
then the sprite will be drawn with that remapped palette. The last 3
|
||||
parameters are the color that the palette fades to as you get further
|
||||
away. This color is normally black (0,0,0). White would be (63,63,63).
|
||||
if ((dastat&1) == 0) then makepalookup will allocate & deallocate
|
||||
the memory block for use but will not waste the time creating a palookup
|
||||
table (assuming you will create one yourself)
|
||||
|
||||
setbrightness(char gammalevel, char *dapal)
|
||||
Use this function to adjust for gamma correction.
|
||||
Gammalevel - ranges from 0-15, 0 is darkest, 15 brightest. Default: 0
|
||||
dapal: standard VGA palette (768 bytes)
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
| This document brought to you by: |
|
||||
| |
|
||||
| @@@@@@ @@@@@@ @@@@@@@@@@@@@@@@@@ @@@@@@@@ @@@@@@ |
|
||||
| @@@@@@ @@@@@@ @@@@@@@@@@@@@@@@@@ @@@@@@@@@ @@@@@@ |
|
||||
| @@@@@@ @@@@@@@ @@@@@@@@@@@@@@@@@@ @@@@@@@@@@ @@@@@@ |
|
||||
| @@@@@@ @@@@@@@ @@@@@@ @@@@@@@@@@@ @@@@@@ |
|
||||
| @@@@@@ @@@@@@@ @@@@@@ @@@@@@@@@@@@ @@@@@@ |
|
||||
| @@@@@@ @@@@@@@ @@@@@@ @@@@@@@@@@@@@ @@@@@@ |
|
||||
| @@@@@@@@@@@@ @@@@@@@@@@@@@@@ @@@@@@ @@@@@@@ @@@@@@ |
|
||||
| @@@@@@@ @@@@@@@@@@@ @@@@@@@@@@@@@@@ @@@@@@ @@@@@@@ @@@@@@ |
|
||||
| @@@@@@@@@@@@ @@@@@@@@@@@@@@@ @@@@@@ @@@@@@@ @@@@@@ |
|
||||
| @@@@@@ @@@@@@@ @@@@@@ @@@@@@ @@@@@@@@@@@@@ |
|
||||
| @@@@@@ @@@@@@@ @@@@@@ @@@@@@ @@@@@@@@@@@@ |
|
||||
| @@@@@@ @@@@@@@ @@@@@@ @@@@@@ @@@@@@@@@@@ |
|
||||
| @@@@@@ @@@@@@@ @@@@@@@@@@@@@@@@@@ @@@@@@ @@@@@@@@@@ |
|
||||
| @@@@@@ @@@@@@ @@@@@@@@@@@@@@@@@@ @@@@@@ @@@@@@@@@ |
|
||||
| @@@@@@ @@@@@@ @@@@@@@@@@@@@@@@@@ @@@@@@ @@@@@@@@ |
|
||||
| |
|
||||
| Ken Silverman of East Greenwich, RI USA |
|
||||
------------------------------------------------------------------------------
|
|
@ -1,157 +0,0 @@
|
|||
// Assembly-language function wrappers for a.asm functions
|
||||
// for the Build Engine
|
||||
// by Jonathon Fowler (jonof@edgenetwk.com)
|
||||
|
||||
|
||||
#ifndef __a_h__
|
||||
#define __a_h__
|
||||
|
||||
#include "compat.h"
|
||||
|
||||
#if defined(__GNUC__) && defined(__i386__) && !defined(NOASM)
|
||||
|
||||
#if defined(__linux) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__SYLLABLE__)
|
||||
#define __cdecl
|
||||
#endif
|
||||
|
||||
extern int32_t __cdecl mmxoverlay();
|
||||
extern int32_t __cdecl sethlinesizes(int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl setpalookupaddress(char *);
|
||||
extern int32_t __cdecl setuphlineasm4(int32_t,int32_t);
|
||||
extern int32_t __cdecl hlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl setuprhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl rhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl setuprmhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl rmhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl setupqrhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl qrhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl setvlinebpl(int32_t);
|
||||
extern int32_t __cdecl fixtransluscence(int32_t);
|
||||
extern int32_t __cdecl prevlineasm1(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl vlineasm1(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl setuptvlineasm(int32_t);
|
||||
extern int32_t __cdecl tvlineasm1(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl setuptvlineasm2(int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl tvlineasm2(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl mvlineasm1(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl setupvlineasm(int32_t);
|
||||
extern int32_t __cdecl vlineasm4(int32_t,int32_t);
|
||||
extern int32_t __cdecl setupmvlineasm(int32_t);
|
||||
extern int32_t __cdecl mvlineasm4(int32_t,int32_t);
|
||||
extern int32_t __cdecl setupspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl spritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl msetupspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl mspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl tsetupspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl tspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl mhline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl mhlineskipmodify(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl msethlineshift(int32_t,int32_t);
|
||||
extern int32_t __cdecl thline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl thlineskipmodify(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl tsethlineshift(int32_t,int32_t);
|
||||
extern int32_t __cdecl setupslopevlin(int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl slopevlin(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t __cdecl settransnormal();
|
||||
extern int32_t __cdecl settransreverse();
|
||||
extern int32_t __cdecl setupdrawslab(int32_t,int32_t);
|
||||
extern int32_t __cdecl drawslab(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern void __cdecl stretchhline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
|
||||
#elif defined(_MSC_VER) && !defined(NOASM) // __GNUC__ && __i386__
|
||||
|
||||
extern int32_t _cdecl mmxoverlay();
|
||||
extern int32_t _cdecl sethlinesizes(int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl setpalookupaddress(char *);
|
||||
extern int32_t _cdecl setuphlineasm4(int32_t,int32_t);
|
||||
extern int32_t _cdecl hlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl setuprhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl rhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl setuprmhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl rmhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl setupqrhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl qrhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl setvlinebpl(int32_t);
|
||||
extern int32_t _cdecl fixtransluscence(int32_t);
|
||||
extern int32_t _cdecl prevlineasm1(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl vlineasm1(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl setuptvlineasm(int32_t);
|
||||
extern int32_t _cdecl tvlineasm1(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl setuptvlineasm2(int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl tvlineasm2(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl mvlineasm1(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl setupvlineasm(int32_t);
|
||||
extern int32_t _cdecl vlineasm4(int32_t,int32_t);
|
||||
extern int32_t _cdecl setupmvlineasm(int32_t);
|
||||
extern int32_t _cdecl mvlineasm4(int32_t,int32_t);
|
||||
extern int32_t _cdecl setupspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl spritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl msetupspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl mspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl tsetupspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl tspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl mhline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl mhlineskipmodify(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl msethlineshift(int32_t,int32_t);
|
||||
extern int32_t _cdecl thline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl thlineskipmodify(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl tsethlineshift(int32_t,int32_t);
|
||||
extern int32_t _cdecl setupslopevlin(int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl slopevlin(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern int32_t _cdecl settransnormal();
|
||||
extern int32_t _cdecl settransreverse();
|
||||
extern int32_t _cdecl setupdrawslab(int32_t,int32_t);
|
||||
extern int32_t _cdecl drawslab(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
extern void _cdecl stretchhline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
|
||||
#else // _MSC_VER
|
||||
|
||||
#define ENGINE_USING_A_C
|
||||
#include <stdint.h>
|
||||
|
||||
void setvlinebpl(int32_t dabpl);
|
||||
void fixtransluscence(intptr_t datransoff);
|
||||
void settransnormal(void);
|
||||
void settransreverse(void);
|
||||
|
||||
void sethlinesizes(int32_t logx, int32_t logy, intptr_t bufplc);
|
||||
void setpalookupaddress(char *paladdr);
|
||||
void setuphlineasm4(int32_t bxinc, int32_t byinc);
|
||||
void hlineasm4(int32_t cnt, int32_t skiploadincs, int32_t paloffs, uint32_t by, uint32_t bx, intptr_t p);
|
||||
|
||||
void setupslopevlin(int32_t logylogx, intptr_t bufplc, int32_t pinc);
|
||||
void slopevlin(intptr_t p, int32_t i, intptr_t slopaloffs, int32_t cnt, int32_t bx, int32_t by);
|
||||
|
||||
void setupvlineasm(int32_t neglogy);
|
||||
void vlineasm1(int32_t vinc, intptr_t paloffs, int32_t cnt, uint32_t vplc, intptr_t bufplc, intptr_t p);
|
||||
|
||||
void setupmvlineasm(int32_t neglogy);
|
||||
void mvlineasm1(int32_t vinc, intptr_t paloffs, int32_t cnt, uint32_t vplc, intptr_t bufplc, intptr_t p);
|
||||
|
||||
void setuptvlineasm(int32_t neglogy);
|
||||
void tvlineasm1(int32_t vinc, intptr_t paloffs, int32_t cnt, uint32_t vplc, intptr_t bufplc, intptr_t p);
|
||||
|
||||
void msethlineshift(int32_t logx, int32_t logy);
|
||||
void mhline(intptr_t bufplc, uint32_t bx, int32_t cntup16, int32_t junk, uint32_t by, intptr_t p);
|
||||
|
||||
void tsethlineshift(int32_t logx, int32_t logy);
|
||||
void thline(intptr_t bufplc, uint32_t bx, int32_t cntup16, int32_t junk, uint32_t by, intptr_t p);
|
||||
|
||||
void setupspritevline(intptr_t paloffs, int32_t bxinc, int32_t byinc, int32_t ysiz);
|
||||
void spritevline(int32_t bx, int32_t by, int32_t cnt, intptr_t bufplc, intptr_t p);
|
||||
|
||||
void msetupspritevline(intptr_t paloffs, int32_t bxinc, int32_t byinc, int32_t ysiz);
|
||||
void mspritevline(int32_t bx, int32_t by, int32_t cnt, intptr_t bufplc, intptr_t p);
|
||||
|
||||
void tsetupspritevline(intptr_t paloffs, int32_t bxinc, int32_t byinc, int32_t ysiz);
|
||||
void tspritevline(int32_t bx, int32_t by, int32_t cnt, intptr_t bufplc, intptr_t p);
|
||||
|
||||
void setupdrawslab (int32_t dabpl, intptr_t pal);
|
||||
void drawslab (int32_t dx, int32_t v, int32_t dy, int32_t vi, intptr_t vptr, intptr_t p);
|
||||
void stretchhline (intptr_t p0, int32_t u, int32_t cnt, int32_t uinc, intptr_t rptr, intptr_t p);
|
||||
|
||||
void mmxoverlay();
|
||||
|
||||
#endif // else
|
||||
|
||||
#endif // __a_h__
|
|
@ -1,181 +0,0 @@
|
|||
// Base services interface declaration
|
||||
// for the Build Engine
|
||||
// by Jonathon Fowler (jonof@edgenetwk.com)
|
||||
|
||||
#ifndef __baselayer_h__
|
||||
#define __baselayer_h__
|
||||
|
||||
#include "compat.h"
|
||||
#include "osd.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SYSTEM_POOL_SIZE (64 * 1048576)
|
||||
|
||||
extern int32_t _buildargc;
|
||||
extern const char **_buildargv;
|
||||
|
||||
extern char quitevent, appactive;
|
||||
|
||||
extern int32_t vsync;
|
||||
|
||||
// NOTE: these are implemented in game-land so they may be overridden in game specific ways
|
||||
extern int32_t startwin_open(void);
|
||||
extern int32_t startwin_close(void);
|
||||
extern int32_t startwin_puts(const char *);
|
||||
extern int32_t startwin_settitle(const char *);
|
||||
extern int32_t startwin_idle(void *);
|
||||
|
||||
// video
|
||||
extern int32_t r_usenewaspect, newaspect_enable;
|
||||
extern uint32_t r_screenxy;
|
||||
extern int32_t xres, yres, bpp, fullscreen, bytesperline, imageSize;
|
||||
extern intptr_t frameplace;
|
||||
extern char offscreenrendering;
|
||||
|
||||
extern void (*baselayer_onvideomodechange)(int32_t);
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
extern int32_t osdcmd_glinfo(const osdfuncparm_t *parm);
|
||||
|
||||
struct glinfo_t {
|
||||
const char *vendor;
|
||||
const char *renderer;
|
||||
const char *version;
|
||||
const char *extensions;
|
||||
|
||||
float maxanisotropy;
|
||||
char bgra;
|
||||
char clamptoedge;
|
||||
char texcompr;
|
||||
char texnpot;
|
||||
char multisample;
|
||||
char nvmultisamplehint;
|
||||
char arbfp;
|
||||
char depthtex;
|
||||
char shadow;
|
||||
char fbos;
|
||||
char rect;
|
||||
char multitex;
|
||||
char envcombine;
|
||||
char vbos;
|
||||
char vsync;
|
||||
char sm4;
|
||||
char occlusionqueries;
|
||||
char glsl;
|
||||
char dumped;
|
||||
};
|
||||
|
||||
extern struct glinfo_t glinfo;
|
||||
extern void setvsync(int32_t sync);
|
||||
#endif
|
||||
|
||||
extern char inputdevices;
|
||||
|
||||
// keys
|
||||
#define KEYFIFOSIZ 64
|
||||
extern char keystatus[256], keyfifo[KEYFIFOSIZ], keyfifoplc, keyfifoend;
|
||||
extern char keyasciififo[KEYFIFOSIZ], keyasciififoplc, keyasciififoend;
|
||||
extern char scantoasc[128], remap[256], key_names[256][24];
|
||||
extern int32_t remapinit;
|
||||
|
||||
extern int32_t defaultres[][2];
|
||||
|
||||
extern void SetKey(int32_t key, int32_t state);
|
||||
|
||||
// mouse
|
||||
extern volatile int32_t mousex, mousey, mouseb;
|
||||
|
||||
// joystick
|
||||
extern int32_t *joyaxis, *joyhat, joyb;
|
||||
extern char joyisgamepad, joynumaxes, joynumbuttons, joynumhats;
|
||||
extern int32_t joyaxespresent;
|
||||
|
||||
extern int32_t qsetmode;
|
||||
|
||||
int32_t initsystem(void);
|
||||
void uninitsystem(void);
|
||||
|
||||
extern int32_t flushlogwindow;
|
||||
void initprintf(const char *, ...) ATTRIBUTE((format(printf,1,2)));
|
||||
void debugprintf(const char *,...) ATTRIBUTE((format(printf,1,2)));
|
||||
|
||||
int32_t handleevents(void);
|
||||
extern void (*after_handleevents_hook)(void);
|
||||
extern inline void idle(void);
|
||||
extern inline void idle_waitevent(void);
|
||||
extern inline void idle_waitevent_timeout(uint32_t timeout);
|
||||
|
||||
extern void (*keypresscallback)(int32_t,int32_t);
|
||||
extern void (*mousepresscallback)(int32_t,int32_t);
|
||||
extern void (*joypresscallback)(int32_t,int32_t);
|
||||
|
||||
int32_t initinput(void);
|
||||
void uninitinput(void);
|
||||
void releaseallbuttons(void);
|
||||
void setkeypresscallback(void (*callback)(int32_t,int32_t));
|
||||
void setmousepresscallback(void (*callback)(int32_t,int32_t));
|
||||
void setjoypresscallback(void (*callback)(int32_t,int32_t));
|
||||
const char *getkeyname(int32_t num);
|
||||
const char *getjoyname(int32_t what, int32_t num); // what: 0=axis, 1=button, 2=hat
|
||||
char *Bstrtolower(char *str);
|
||||
|
||||
char bgetchar(void);
|
||||
#define bkbhit() (keyasciififoplc != keyasciififoend)
|
||||
|
||||
void bflushchars(void);
|
||||
|
||||
int32_t initmouse(void);
|
||||
void uninitmouse(void);
|
||||
void grabmouse(char a);
|
||||
void readmousexy(int32_t *x, int32_t *y);
|
||||
void readmousebstatus(int32_t *b);
|
||||
void setjoydeadzone(int32_t axis, uint16_t dead, uint16_t satur);
|
||||
void getjoydeadzone(int32_t axis, uint16_t *dead, uint16_t *satur);
|
||||
|
||||
int32_t inittimer(int32_t);
|
||||
void uninittimer(void);
|
||||
void sampletimer(void);
|
||||
uint32_t getticks(void);
|
||||
int32_t gettimerfreq(void);
|
||||
void (*installusertimercallback(void (*callback)(void)))(void);
|
||||
|
||||
int32_t checkvideomode(int32_t *x, int32_t *y, int32_t c, int32_t fs, int32_t forced);
|
||||
int32_t setvideomode(int32_t x, int32_t y, int32_t c, int32_t fs);
|
||||
void getvalidmodes(void);
|
||||
void resetvideomode(void);
|
||||
|
||||
void begindrawing(void);
|
||||
void enddrawing(void);
|
||||
void showframe(int32_t);
|
||||
|
||||
int32_t setpalette(int32_t start, int32_t num);
|
||||
//int32_t getpalette(int32_t start, int32_t num, char *dapal);
|
||||
int32_t setgamma(void);
|
||||
extern double vid_gamma, vid_contrast, vid_brightness;
|
||||
|
||||
#define DEFAULT_GAMMA 1.0
|
||||
#define DEFAULT_CONTRAST 1.0
|
||||
#define DEFAULT_BRIGHTNESS 0.0
|
||||
|
||||
#define GAMMA_CALC (int32_t)(min(max((float)((vid_gamma-1.0)*10.0),0),15))
|
||||
|
||||
int32_t switchrendermethod(int32_t,int32_t); // 0 = software, 1 = opengl | bool = reinit
|
||||
|
||||
int32_t wm_msgbox(char *name, char *fmt, ...) ATTRIBUTE((format(printf,2,3)));
|
||||
int32_t wm_ynbox(char *name, char *fmt, ...) ATTRIBUTE((format(printf,2,3)));
|
||||
void wm_setapptitle(char *name);
|
||||
|
||||
// baselayer.c
|
||||
int32_t baselayer_init();
|
||||
|
||||
void makeasmwriteable(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __baselayer_h__
|
||||
|
|
@ -1,755 +0,0 @@
|
|||
// "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman
|
||||
// Ken Silverman's official web site: "http://www.advsys.net/ken"
|
||||
// See the included license file "BUILDLIC.TXT" for license info.
|
||||
//
|
||||
// This file has been modified from Ken Silverman's original release
|
||||
// by Jonathon Fowler (jonof@edgenetwk.com)
|
||||
|
||||
|
||||
#ifndef __build_h__
|
||||
#define __build_h__
|
||||
|
||||
#include "compat.h"
|
||||
#include "pragmas.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MAXSECTORSV8 4096
|
||||
#define MAXWALLSV8 16384
|
||||
#define MAXSPRITESV8 16384
|
||||
|
||||
#define MAXSECTORSV7 1024
|
||||
#define MAXWALLSV7 8192
|
||||
#define MAXSPRITESV7 4096
|
||||
|
||||
#define MAXSECTORS MAXSECTORSV8
|
||||
#define MAXWALLS MAXWALLSV8
|
||||
#define MAXWALLSB ((MAXWALLS>>2)+(MAXWALLS>>3))
|
||||
#define MAXSPRITES MAXSPRITESV8
|
||||
|
||||
// additional space beyond wall, in walltypes:
|
||||
#define M32_FIXME_WALLS 512
|
||||
#define M32_FIXME_SECTORS 2
|
||||
|
||||
#define MAXTILES 15360
|
||||
#define MAXVOXELS 4096
|
||||
#define MAXSTATUS 1024
|
||||
#define MAXPLAYERS 16
|
||||
#define MAXXDIM 3072
|
||||
#define MAXYDIM 2304
|
||||
#define MAXBASEPALS 8
|
||||
#define MAXPALOOKUPS 256
|
||||
#define MAXPSKYTILES 256
|
||||
#define MAXSPRITESONSCREEN 4096
|
||||
#define MAXUNIQHUDID 256 //Extra slots so HUD models can store animation state without messing game sprites
|
||||
|
||||
#define RESERVEDPALS 4 // don't forget to increment this when adding reserved pals
|
||||
#define DETAILPAL (MAXPALOOKUPS - 1)
|
||||
#define GLOWPAL (MAXPALOOKUPS - 2)
|
||||
#define SPECULARPAL (MAXPALOOKUPS - 3)
|
||||
#define NORMALPAL (MAXPALOOKUPS - 4)
|
||||
|
||||
#define TSPR_TEMP 99
|
||||
#define TSPR_MIRROR 100
|
||||
|
||||
#define PR_LIGHT_PRIO_MAX 0
|
||||
#define PR_LIGHT_PRIO_MAX_GAME 1
|
||||
#define PR_LIGHT_PRIO_HIGH 2
|
||||
#define PR_LIGHT_PRIO_HIGH_GAME 3
|
||||
#define PR_LIGHT_PRIO_LOW 4
|
||||
#define PR_LIGHT_PRIO_LOW_GAME 5
|
||||
|
||||
////////// yax defs //////////
|
||||
#define YAX_BIT 1024
|
||||
#define YAX_CEILING 0
|
||||
#define YAX_FLOOR 1
|
||||
|
||||
#define YAX_SECTORFLD(Sect,Fld, Cf) (*((Cf) ? (§or[Sect].floor##Fld) : (§or[Sect].ceiling##Fld)))
|
||||
|
||||
int16_t yax_getbunch(int16_t i, int16_t cf);
|
||||
void yax_setbunch(int16_t i, int16_t cf, int16_t bunchnum);
|
||||
|
||||
|
||||
#define CLIPMASK0 (((1L)<<16)+1L)
|
||||
#define CLIPMASK1 (((256L)<<16)+64L)
|
||||
|
||||
// max x/y val (= max editorgridextent in Mapster32)
|
||||
#define BXY_MAX 524288
|
||||
|
||||
//Make all variables in BUILD.H defined in the ENGINE,
|
||||
//and externed in GAME
|
||||
#ifdef ENGINE
|
||||
# define EXTERN
|
||||
#else
|
||||
# define EXTERN extern
|
||||
#endif
|
||||
|
||||
#pragma pack(push,1)
|
||||
|
||||
//ceilingstat/floorstat:
|
||||
// bit 0: 1 = parallaxing, 0 = not "P"
|
||||
// bit 1: 1 = groudraw, 0 = not
|
||||
// bit 2: 1 = swap x&y, 0 = not "F"
|
||||
// bit 3: 1 = double smooshiness "E"
|
||||
// bit 4: 1 = x-flip "F"
|
||||
// bit 5: 1 = y-flip "F"
|
||||
// bit 6: 1 = Align texture to first wall of sector "R"
|
||||
// bits 7-8: "T"
|
||||
// 00 = normal floors
|
||||
// 01 = masked floors
|
||||
// 10 = transluscent masked floors
|
||||
// 11 = reverse transluscent masked floors
|
||||
// bits 9-15: reserved
|
||||
|
||||
//40 bytes
|
||||
typedef struct
|
||||
{
|
||||
int16_t wallptr, wallnum;
|
||||
int32_t ceilingz, floorz;
|
||||
int16_t ceilingstat, floorstat;
|
||||
int16_t ceilingpicnum, ceilingheinum;
|
||||
int8_t ceilingshade;
|
||||
uint8_t ceilingpal, ceilingxpanning, ceilingypanning;
|
||||
int16_t floorpicnum, floorheinum;
|
||||
int8_t floorshade;
|
||||
uint8_t floorpal, floorxpanning, floorypanning;
|
||||
uint8_t visibility, filler;
|
||||
int16_t lotag, hitag, extra;
|
||||
} sectortype;
|
||||
|
||||
//cstat:
|
||||
// bit 0: 1 = Blocking wall (use with clipmove, getzrange) "B"
|
||||
// bit 1: 1 = bottoms of invisible walls swapped, 0 = not "2"
|
||||
// bit 2: 1 = align picture on bottom (for doors), 0 = top "O"
|
||||
// bit 3: 1 = x-flipped, 0 = normal "F"
|
||||
// bit 4: 1 = masking wall, 0 = not "M"
|
||||
// bit 5: 1 = 1-way wall, 0 = not "1"
|
||||
// bit 6: 1 = Blocking wall (use with hitscan / cliptype 1) "H"
|
||||
// bit 7: 1 = Transluscence, 0 = not "T"
|
||||
// bit 8: 1 = y-flipped, 0 = normal "F"
|
||||
// bit 9: 1 = Transluscence reversing, 0 = normal "T"
|
||||
// bits 10-15: reserved
|
||||
|
||||
//32 bytes
|
||||
typedef struct
|
||||
{
|
||||
int32_t x, y;
|
||||
int16_t point2, nextwall, nextsector, cstat;
|
||||
int16_t picnum, overpicnum;
|
||||
int8_t shade;
|
||||
uint8_t pal, xrepeat, yrepeat, xpanning, ypanning;
|
||||
int16_t lotag, hitag, extra;
|
||||
} walltype;
|
||||
|
||||
//cstat:
|
||||
// bit 0: 1 = Blocking sprite (use with clipmove, getzrange) "B"
|
||||
// bit 1: 1 = transluscence, 0 = normal "T"
|
||||
// bit 2: 1 = x-flipped, 0 = normal "F"
|
||||
// bit 3: 1 = y-flipped, 0 = normal "F"
|
||||
// bits 5-4: 00 = FACE sprite (default) "R"
|
||||
// 01 = WALL sprite (like masked walls)
|
||||
// 10 = FLOOR sprite (parallel to ceilings&floors)
|
||||
// bit 6: 1 = 1-sided sprite, 0 = normal "1"
|
||||
// bit 7: 1 = Real centered centering, 0 = foot center "C"
|
||||
// bit 8: 1 = Blocking sprite (use with hitscan / cliptype 1) "H"
|
||||
// bit 9: 1 = Transluscence reversing, 0 = normal "T"
|
||||
// bit 10: reserved (in use by a renderer hack)
|
||||
// bit 11: 1 = determine shade based only on its own shade member (see CON's spritenoshade command)
|
||||
// bit 12: reserved
|
||||
// bit 13: 1 = does not cast shadow
|
||||
// bit 14: 1 = invisible but casts shadow
|
||||
// bit 15: 1 = Invisible sprite, 0 = not invisible
|
||||
|
||||
//44 bytes
|
||||
typedef struct
|
||||
{
|
||||
int32_t x, y, z;
|
||||
int16_t cstat, picnum;
|
||||
int8_t shade;
|
||||
uint8_t pal, clipdist, filler;
|
||||
uint8_t xrepeat, yrepeat;
|
||||
int8_t xoffset, yoffset;
|
||||
int16_t sectnum, statnum;
|
||||
int16_t ang, owner, xvel, yvel, zvel;
|
||||
int16_t lotag, hitag, extra;
|
||||
} spritetype;
|
||||
|
||||
typedef struct {
|
||||
uint32_t mdanimtims;
|
||||
int16_t mdanimcur;
|
||||
int16_t angoff, pitch, roll;
|
||||
int32_t xoff, yoff, zoff;
|
||||
uint8_t flags;
|
||||
uint8_t xpanning, ypanning;
|
||||
uint8_t filler;
|
||||
float alpha;
|
||||
spritetype *tspr;
|
||||
} spriteext_t;
|
||||
|
||||
typedef struct {
|
||||
float smoothduration;
|
||||
int16_t mdcurframe, mdoldframe;
|
||||
int16_t mdsmooth;
|
||||
uint8_t filler[2];
|
||||
} spritesmooth_t;
|
||||
|
||||
#define SPREXT_NOTMD 1
|
||||
#define SPREXT_NOMDANIM 2
|
||||
#define SPREXT_AWAY1 4
|
||||
#define SPREXT_AWAY2 8
|
||||
#define SPREXT_TSPRACCESS 16
|
||||
|
||||
EXTERN spriteext_t *spriteext;
|
||||
EXTERN spritesmooth_t *spritesmooth;
|
||||
EXTERN int32_t guniqhudid;
|
||||
|
||||
EXTERN sectortype *sector;
|
||||
EXTERN walltype *wall;
|
||||
EXTERN int16_t maskwall[MAXWALLSB], maskwallcnt;
|
||||
EXTERN int16_t thewall[MAXWALLSB];
|
||||
EXTERN spritetype *sprite;
|
||||
EXTERN spritetype *tspriteptr[MAXSPRITESONSCREEN + 1];
|
||||
|
||||
EXTERN int32_t spritesortcnt;
|
||||
EXTERN spritetype *tsprite;
|
||||
|
||||
EXTERN int32_t xdim, ydim, numpages;
|
||||
EXTERN int32_t yxaspect, viewingrange;
|
||||
EXTERN intptr_t ylookup[MAXYDIM+1];
|
||||
|
||||
#define MAXVALIDMODES 256
|
||||
EXTERN int32_t validmodecnt;
|
||||
struct validmode_t {
|
||||
int32_t xdim,ydim;
|
||||
char bpp;
|
||||
char fs; // bit 0 = fullscreen flag
|
||||
char filler[2];
|
||||
int32_t extra; // internal use
|
||||
};
|
||||
EXTERN struct validmode_t validmode[MAXVALIDMODES];
|
||||
|
||||
EXTERN int16_t numsectors, numwalls;
|
||||
EXTERN char display_mirror;
|
||||
EXTERN /*volatile*/ int32_t totalclock;
|
||||
EXTERN int32_t numframes, randomseed;
|
||||
EXTERN int16_t sintable[2048];
|
||||
EXTERN uint8_t palette[768];
|
||||
EXTERN int16_t numpalookups;
|
||||
EXTERN char *palookup[MAXPALOOKUPS];
|
||||
EXTERN char parallaxtype, showinvisibility;
|
||||
EXTERN int32_t parallaxyoffs, parallaxyscale;
|
||||
EXTERN int32_t visibility, parallaxvisibility;
|
||||
|
||||
EXTERN int32_t windowx1, windowy1, windowx2, windowy2;
|
||||
EXTERN int16_t startumost[MAXXDIM], startdmost[MAXXDIM];
|
||||
|
||||
EXTERN int16_t pskyoff[MAXPSKYTILES], pskybits;
|
||||
|
||||
EXTERN int16_t headspritesect[MAXSECTORS+1], headspritestat[MAXSTATUS+1];
|
||||
EXTERN int16_t prevspritesect[MAXSPRITES], prevspritestat[MAXSPRITES];
|
||||
EXTERN int16_t nextspritesect[MAXSPRITES], nextspritestat[MAXSPRITES];
|
||||
|
||||
EXTERN int16_t tilesizx[MAXTILES], tilesizy[MAXTILES];
|
||||
EXTERN char picsiz[MAXTILES];
|
||||
EXTERN char walock[MAXTILES];
|
||||
EXTERN int32_t pow2long[32];
|
||||
EXTERN int32_t numtiles, picanm[MAXTILES];
|
||||
EXTERN intptr_t waloff[MAXTILES]; // stores pointers to cache -- SA
|
||||
|
||||
EXTERN int32_t windowpos, windowx, windowy;
|
||||
|
||||
//These variables are for auto-mapping with the draw2dscreen function.
|
||||
//When you load a new board, these bits are all set to 0 - since
|
||||
//you haven't mapped out anything yet. Note that these arrays are
|
||||
//bit-mapped.
|
||||
//If you want draw2dscreen() to show sprite #54 then you say:
|
||||
// spritenum = 54;
|
||||
// show2dsprite[spritenum>>3] |= (1<<(spritenum&7));
|
||||
//And if you want draw2dscreen() to not show sprite #54 then you say:
|
||||
// spritenum = 54;
|
||||
// show2dsprite[spritenum>>3] &= ~(1<<(spritenum&7));
|
||||
//Automapping defaults to 0 (do nothing). If you set automapping to 1,
|
||||
// then in 3D mode, the walls and sprites that you see will show up the
|
||||
// next time you flip to 2D mode.
|
||||
|
||||
EXTERN char show2dsector[(MAXSECTORS+7)>>3];
|
||||
EXTERN char show2dwall[(MAXWALLS+7)>>3];
|
||||
EXTERN char show2dsprite[(MAXSPRITES+7)>>3];
|
||||
EXTERN char automapping;
|
||||
|
||||
EXTERN char gotpic[(MAXTILES+7)>>3];
|
||||
EXTERN char gotsector[(MAXSECTORS+7)>>3];
|
||||
|
||||
EXTERN char captureformat;
|
||||
EXTERN char editorcolors[256];
|
||||
|
||||
EXTERN int32_t faketilesiz[MAXTILES];
|
||||
EXTERN char *faketiledata[MAXTILES];
|
||||
|
||||
EXTERN char spritecol2d[MAXTILES][2];
|
||||
extern char vgapal16[4*256];
|
||||
|
||||
extern char vgapalette[5*256];
|
||||
extern uint32_t drawlinepat;
|
||||
|
||||
extern void faketimerhandler(void);
|
||||
|
||||
extern char apptitle[256];
|
||||
typedef struct {
|
||||
char r,g,b,f;
|
||||
} palette_t;
|
||||
extern palette_t curpalette[256], curpalettefaded[256], palfadergb;
|
||||
extern char palfadedelta;
|
||||
|
||||
extern int32_t dommxoverlay, novoxmips;
|
||||
|
||||
extern float debug1, debug2;
|
||||
|
||||
extern int32_t tiletovox[MAXTILES];
|
||||
extern int32_t usevoxels, voxscale[MAXVOXELS];
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
extern int32_t usemodels, usehightile;
|
||||
extern int32_t rendmode;
|
||||
#endif
|
||||
EXTERN int32_t h_xsize[MAXTILES], h_ysize[MAXTILES];
|
||||
EXTERN int8_t h_xoffs[MAXTILES], h_yoffs[MAXTILES];
|
||||
|
||||
extern const char *engineerrstr;
|
||||
extern char noclip;
|
||||
|
||||
EXTERN int32_t editorzrange[2];
|
||||
|
||||
EXTERN int32_t myconnectindex, numplayers;
|
||||
EXTERN int32_t connecthead, connectpoint2[MAXPLAYERS];
|
||||
|
||||
static inline int32_t getrendermode(void)
|
||||
{
|
||||
#ifndef USE_OPENGL
|
||||
return 0;
|
||||
#else
|
||||
return rendmode;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
POSITION VARIABLES:
|
||||
|
||||
POSX is your x - position ranging from 0 to 65535
|
||||
POSY is your y - position ranging from 0 to 65535
|
||||
(the length of a side of the grid in EDITBORD would be 1024)
|
||||
POSZ is your z - position (height) ranging from 0 to 65535, 0 highest.
|
||||
ANG is your angle ranging from 0 to 2047. Instead of 360 degrees, or
|
||||
2 * PI radians, I use 2048 different angles, so 90 degrees would
|
||||
be 512 in my system.
|
||||
|
||||
SPRITE VARIABLES:
|
||||
|
||||
EXTERN short headspritesect[MAXSECTORS+1], headspritestat[MAXSTATUS+1];
|
||||
EXTERN short prevspritesect[MAXSPRITES], prevspritestat[MAXSPRITES];
|
||||
EXTERN short nextspritesect[MAXSPRITES], nextspritestat[MAXSPRITES];
|
||||
|
||||
Example: if the linked lists look like the following:
|
||||
????????????????
|
||||
Sector lists: Status lists:
|
||||
????????????????J
|
||||
Sector0: 4, 5, 8 Status0: 2, 0, 8
|
||||
Sector1: 16, 2, 0, 7 Status1: 4, 5, 16, 7, 3, 9
|
||||
Sector2: 3, 9
|
||||
????????????????
|
||||
Notice that each number listed above is shown exactly once on both the
|
||||
left and right side. This is because any sprite that exists must
|
||||
be in some sector, and must have some kind of status that you define.
|
||||
|
||||
|
||||
Coding example #1:
|
||||
To go through all the sprites in sector 1, the code can look like this:
|
||||
|
||||
sectnum = 1;
|
||||
i = headspritesect[sectnum];
|
||||
while (i != -1)
|
||||
{
|
||||
nexti = nextspritesect[i];
|
||||
|
||||
//your code goes here
|
||||
//ex: printf("Sprite %d is in sector %d\n",i,sectnum);
|
||||
|
||||
i = nexti;
|
||||
}
|
||||
|
||||
Coding example #2:
|
||||
To go through all sprites with status = 1, the code can look like this:
|
||||
|
||||
statnum = 1; //status 1
|
||||
i = headspritestat[statnum];
|
||||
while (i != -1)
|
||||
{
|
||||
nexti = nextspritestat[i];
|
||||
|
||||
//your code goes here
|
||||
//ex: printf("Sprite %d has a status of 1 (active)\n",i,statnum);
|
||||
|
||||
i = nexti;
|
||||
}
|
||||
|
||||
insertsprite(short sectnum, short statnum);
|
||||
deletesprite(short spritenum);
|
||||
changespritesect(short spritenum, short newsectnum);
|
||||
changespritestat(short spritenum, short newstatnum);
|
||||
|
||||
TILE VARIABLES:
|
||||
NUMTILES - the number of tiles found TILES.DAT.
|
||||
TILESIZX[MAXTILES] - simply the x-dimension of the tile number.
|
||||
TILESIZY[MAXTILES] - simply the y-dimension of the tile number.
|
||||
WALOFF[MAXTILES] - the actual 32-bit offset pointing to the top-left
|
||||
corner of the tile.
|
||||
PICANM[MAXTILES] - flags for animating the tile.
|
||||
|
||||
TIMING VARIABLES:
|
||||
TOTALCLOCK - When the engine is initialized, TOTALCLOCK is set to zero.
|
||||
From then on, it is incremented 120 times a second by 1. That
|
||||
means that the number of seconds elapsed is totalclock / 120.
|
||||
NUMFRAMES - The number of times the draw3dscreen function was called
|
||||
since the engine was initialized. This helps to determine frame
|
||||
rate. (Frame rate = numframes * 120 / totalclock.)
|
||||
|
||||
OTHER VARIABLES:
|
||||
|
||||
STARTUMOST[320] is an array of the highest y-coordinates on each column
|
||||
that my engine is allowed to write to. You need to set it only
|
||||
once.
|
||||
STARTDMOST[320] is an array of the lowest y-coordinates on each column
|
||||
that my engine is allowed to write to. You need to set it only
|
||||
once.
|
||||
SINTABLE[2048] is a sin table with 2048 angles rather than the
|
||||
normal 360 angles for higher precision. Also since SINTABLE is in
|
||||
all integers, the range is multiplied by 16383, so instead of the
|
||||
normal -1<sin(x)<1, the range of sintable is -16383<sintable[]<16383
|
||||
If you use this sintable, you can possibly speed up your code as
|
||||
well as save space in memory. If you plan to use sintable, 2
|
||||
identities you may want to keep in mind are:
|
||||
sintable[ang&2047] = sin(ang * (3.141592/1024)) * 16383
|
||||
sintable[(ang+512)&2047] = cos(ang * (3.141592/1024)) * 16383
|
||||
NUMSECTORS - the total number of existing sectors. Modified every time
|
||||
you call the loadboard function.
|
||||
***************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
int32_t x, y;
|
||||
} vec2_t;
|
||||
|
||||
typedef struct {
|
||||
int32_t x, y, z;
|
||||
} vec3_t;
|
||||
|
||||
typedef struct {
|
||||
vec3_t pos;
|
||||
int16_t hitsprite, hitwall, hitsect;
|
||||
} hitdata_t;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
int32_t preinitengine(void); // a partial setup of the engine used for launch windows
|
||||
int32_t initengine(void);
|
||||
void uninitengine(void);
|
||||
void initspritelists(void);
|
||||
int32_t loadboard(char *filename, char flags, int32_t *daposx, int32_t *daposy, int32_t *daposz, int16_t *daang, int16_t *dacursectnum);
|
||||
int32_t loadmaphack(const char *filename);
|
||||
void delete_maphack_lights();
|
||||
int32_t clipmapinfo_load(const char *filename);
|
||||
int32_t saveboard(const char *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz, int16_t *daang, int16_t *dacursectnum);
|
||||
int32_t loadpics(const char *filename, int32_t askedsize);
|
||||
void loadtile(int16_t tilenume);
|
||||
int32_t qloadkvx(int32_t voxindex, const char *filename);
|
||||
int32_t allocatepermanenttile(int16_t tilenume, int32_t xsiz, int32_t ysiz);
|
||||
void copytilepiece(int32_t tilenume1, int32_t sx1, int32_t sy1, int32_t xsiz, int32_t ysiz, int32_t tilenume2, int32_t sx2, int32_t sy2);
|
||||
void makepalookup(int32_t palnum, char *remapbuf, int8_t r, int8_t g, int8_t b, char dastat);
|
||||
void setvgapalette(void);
|
||||
void setbasepaltable(uint8_t **basepaltable, uint8_t basepalcount);
|
||||
void setbrightness(char dabrightness, uint8_t dapalid, char noapply);
|
||||
void setpalettefade(char r, char g, char b, char offset);
|
||||
void squarerotatetile(int16_t tilenume);
|
||||
|
||||
int32_t setgamemode(char davidoption, int32_t daxdim, int32_t daydim, int32_t dabpp);
|
||||
void nextpage(void);
|
||||
void setaspect_new();
|
||||
void setview(int32_t x1, int32_t y1, int32_t x2, int32_t y2);
|
||||
void setaspect(int32_t daxrange, int32_t daaspect);
|
||||
void flushperms(void);
|
||||
|
||||
void plotlines2d(const int32_t *xx, const int32_t *yy, int32_t numpoints, char col) ATTRIBUTE((nonnull(1,2)));
|
||||
|
||||
void plotpixel(int32_t x, int32_t y, char col);
|
||||
char getpixel(int32_t x, int32_t y);
|
||||
void setviewtotile(int16_t tilenume, int32_t xsiz, int32_t ysiz);
|
||||
void setviewback(void);
|
||||
void preparemirror(int32_t dax, int32_t day, int32_t daz, int16_t daang, int32_t dahoriz, int16_t dawall, int16_t dasector, int32_t *tposx, int32_t *tposy, int16_t *tang);
|
||||
void completemirror(void);
|
||||
|
||||
void drawrooms(int32_t daposx, int32_t daposy, int32_t daposz, int16_t daang, int32_t dahoriz, int16_t dacursectnum);
|
||||
void drawmasks(void);
|
||||
void clearview(int32_t dacol);
|
||||
void clearallviews(int32_t dacol);
|
||||
void drawmapview(int32_t dax, int32_t day, int32_t zoome, int16_t ang);
|
||||
void rotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum, int8_t dashade, char dapalnum, int32_t dastat, int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2);
|
||||
void drawline256(int32_t x1, int32_t y1, int32_t x2, int32_t y2, char col);
|
||||
int32_t printext16(int32_t xpos, int32_t ypos, int16_t col, int16_t backcol, const char *name, char fontsize) ATTRIBUTE((nonnull(5)));
|
||||
void printext256(int32_t xpos, int32_t ypos, int16_t col, int16_t backcol, const char *name, char fontsize) ATTRIBUTE((nonnull(5)));
|
||||
|
||||
extern int32_t clipmoveboxtracenum;
|
||||
int32_t clipmove(vec3_t *vect, int16_t *sectnum, int32_t xvect, int32_t yvect, int32_t walldist, int32_t ceildist, int32_t flordist, uint32_t cliptype) ATTRIBUTE((nonnull(1,2)));
|
||||
int32_t clipinsidebox(int32_t x, int32_t y, int16_t wallnum, int32_t walldist);
|
||||
int32_t clipinsideboxline(int32_t x, int32_t y, int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t walldist);
|
||||
int32_t pushmove(vec3_t *vect, int16_t *sectnum, int32_t walldist, int32_t ceildist, int32_t flordist, uint32_t cliptype) ATTRIBUTE((nonnull(1,2)));
|
||||
void getzrange(const vec3_t *vect, int16_t sectnum, int32_t *ceilz, int32_t *ceilhit, int32_t *florz, int32_t *florhit, int32_t walldist, uint32_t cliptype) ATTRIBUTE((nonnull(1,3,4,5,6)));
|
||||
int32_t hitscan(const vec3_t *sv, int16_t sectnum, int32_t vx, int32_t vy, int32_t vz, hitdata_t *hitinfo, uint32_t cliptype) ATTRIBUTE((nonnull(1,6)));
|
||||
int32_t neartag(int32_t xs, int32_t ys, int32_t zs, int16_t sectnum, int16_t ange, int16_t *neartagsector, int16_t *neartagwall, int16_t *neartagsprite, int32_t *neartaghitdist, int32_t neartagrange, uint8_t tagsearch) ATTRIBUTE((nonnull(6,7,8)));
|
||||
int32_t cansee(int32_t x1, int32_t y1, int32_t z1, int16_t sect1, int32_t x2, int32_t y2, int32_t z2, int16_t sect2);
|
||||
void updatesector(int32_t x, int32_t y, int16_t *sectnum) ATTRIBUTE((nonnull(3)));
|
||||
void updatesectorexclude(int32_t x, int32_t y, int16_t *sectnum, const uint8_t *excludesectbitmap) ATTRIBUTE((nonnull(3)));
|
||||
void updatesectorz(int32_t x, int32_t y, int32_t z, int16_t *sectnum) ATTRIBUTE((nonnull(4)));
|
||||
int32_t inside(int32_t x, int32_t y, int16_t sectnum);
|
||||
void dragpoint(int16_t pointhighlight, int32_t dax, int32_t day);
|
||||
void setfirstwall(int16_t sectnum, int16_t newfirstwall);
|
||||
int32_t checksectorpointer(int16_t i, int16_t sectnum);
|
||||
|
||||
void getmousevalues(int32_t *mousx, int32_t *mousy, int32_t *bstatus) ATTRIBUTE((nonnull(1,2,3)));
|
||||
int32_t krand(void);
|
||||
int32_t ksqrt(int32_t num);
|
||||
// int32_t getangle(int32_t xvect, int32_t yvect);
|
||||
|
||||
//
|
||||
// getangle
|
||||
//
|
||||
|
||||
EXTERN int16_t radarang[1280];
|
||||
|
||||
static inline int32_t getangle(int32_t xvect, int32_t yvect)
|
||||
{
|
||||
if ((xvect|yvect) == 0) return(0);
|
||||
if (xvect == 0) return 512+((yvect<0)<<10);
|
||||
if (yvect == 0) return ((xvect<0)<<10);
|
||||
if (xvect == yvect) return 256+((xvect<0)<<10);
|
||||
if (xvect == -yvect) return 768+((xvect>0)<<10);
|
||||
if (klabs(xvect) > klabs(yvect))
|
||||
return ((radarang[640+scale(160,yvect,xvect)]>>6)+((xvect<0)<<10))&2047;
|
||||
return ((radarang[640-scale(160,xvect,yvect)]>>6)+512+((yvect<0)<<10))&2047;
|
||||
}
|
||||
|
||||
void rotatepoint(int32_t xpivot, int32_t ypivot, int32_t x, int32_t y, int16_t daang, int32_t *x2, int32_t *y2) ATTRIBUTE((nonnull(6,7)));
|
||||
int32_t lastwall(int16_t point);
|
||||
int32_t nextsectorneighborz(int16_t sectnum, int32_t thez, int16_t topbottom, int16_t direction);
|
||||
int32_t getceilzofslope(int16_t sectnum, int32_t dax, int32_t day);
|
||||
int32_t getflorzofslope(int16_t sectnum, int32_t dax, int32_t day);
|
||||
void getzsofslope(int16_t sectnum, int32_t dax, int32_t day, int32_t *ceilz, int32_t *florz) ATTRIBUTE((nonnull(4,5)));
|
||||
void alignceilslope(int16_t dasect, int32_t x, int32_t y, int32_t z);
|
||||
void alignflorslope(int16_t dasect, int32_t x, int32_t y, int32_t z);
|
||||
int32_t sectorofwall(int16_t theline);
|
||||
int32_t sectorofwall_noquick(int16_t theline);
|
||||
int32_t loopnumofsector(int16_t sectnum, int16_t wallnum);
|
||||
|
||||
// int32_t insertsprite(int16_t sectnum, int16_t statnum);
|
||||
// int32_t deletesprite(int16_t spritenum);
|
||||
|
||||
//
|
||||
// insertsprite
|
||||
//
|
||||
|
||||
int32_t insertspritesect(int16_t sectnum);
|
||||
int32_t insertspritestat(int16_t statnum);
|
||||
int32_t deletespritesect(int16_t deleteme);
|
||||
int32_t deletespritestat(int16_t deleteme);
|
||||
|
||||
int32_t lineintersect(int32_t x1, int32_t y1, int32_t z1, int32_t x2, int32_t y2, int32_t z2, int32_t x3,
|
||||
int32_t y3, int32_t x4, int32_t y4, int32_t *intx, int32_t *inty, int32_t *intz);
|
||||
|
||||
int32_t rayintersect(int32_t x1, int32_t y1, int32_t z1, int32_t vx, int32_t vy, int32_t vz, int32_t x3,
|
||||
int32_t y3, int32_t x4, int32_t y4, int32_t *intx, int32_t *inty, int32_t *intz);
|
||||
|
||||
static inline int32_t insertsprite(int16_t sectnum, int16_t statnum)
|
||||
{
|
||||
insertspritestat(statnum);
|
||||
return(insertspritesect(sectnum));
|
||||
}
|
||||
|
||||
//
|
||||
// deletesprite
|
||||
//
|
||||
static inline int32_t deletesprite(int16_t spritenum)
|
||||
{
|
||||
deletespritestat(spritenum);
|
||||
return(deletespritesect(spritenum));
|
||||
}
|
||||
|
||||
int32_t changespritesect(int16_t spritenum, int16_t newsectnum);
|
||||
int32_t changespritestat(int16_t spritenum, int16_t newstatnum);
|
||||
int32_t setsprite(int16_t spritenum, const vec3_t *new) ATTRIBUTE((nonnull(2)));
|
||||
|
||||
int32_t spriteheight(int16_t i, int32_t *basez);
|
||||
|
||||
int32_t screencapture(const char *filename, char inverseit) ATTRIBUTE((nonnull(1)));
|
||||
|
||||
int32_t getclosestcol(int32_t r, int32_t g, int32_t b);
|
||||
|
||||
// PLAG: line utility functions
|
||||
typedef struct s_equation {
|
||||
float a, b, c;
|
||||
} _equation;
|
||||
typedef struct s_point2d {
|
||||
float x, y;
|
||||
} _point2d;
|
||||
int32_t wallvisible(int32_t x, int32_t y, int16_t wallnum);
|
||||
|
||||
#define STATUS2DSIZ 144
|
||||
#define STATUS2DSIZ2 26
|
||||
|
||||
void qsetmode640350(void);
|
||||
void qsetmode640480(void);
|
||||
void qsetmodeany(int32_t,int32_t);
|
||||
void clear2dscreen(void);
|
||||
void draw2dgrid(int32_t posxe, int32_t posye, int32_t posze, int16_t cursectnum, int16_t ange, int32_t zoome, int16_t gride);
|
||||
void draw2dscreen(const vec3_t *pos, int16_t cursectnum, int16_t ange, int32_t zoome, int16_t gride) ATTRIBUTE((nonnull(1)));
|
||||
int32_t drawline16(int32_t x1, int32_t y1, int32_t x2, int32_t y2, char col);
|
||||
void drawcircle16(int32_t x1, int32_t y1, int32_t r, int32_t eccen, char col);
|
||||
|
||||
int32_t setrendermode(int32_t renderer);
|
||||
int32_t getrendermode(void);
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
void setrollangle(int32_t rolla);
|
||||
#endif
|
||||
|
||||
// pal: pass -1 to invalidate all palettes for the tile, or >=0 for a particular palette
|
||||
// how: pass -1 to invalidate all instances of the tile in texture memory, or a bitfield
|
||||
// bit 0: opaque or masked (non-translucent) texture, using repeating
|
||||
// bit 1: ignored
|
||||
// bit 2: 33% translucence, using repeating
|
||||
// bit 3: 67% translucence, using repeating
|
||||
// bit 4: opaque or masked (non-translucent) texture, using clamping
|
||||
// bit 5: ignored
|
||||
// bit 6: 33% translucence, using clamping
|
||||
// bit 7: 67% translucence, using clamping
|
||||
// clamping is for sprites, repeating is for walls
|
||||
void invalidatetile(int16_t tilenume, int32_t pal, int32_t how);
|
||||
|
||||
int32_t animateoffs(int16_t tilenum, int16_t fakevar);
|
||||
|
||||
void setpolymost2dview(void); // sets up GL for 2D drawing
|
||||
|
||||
int32_t polymost_drawtilescreen(int32_t tilex, int32_t tiley, int32_t wallnum, int32_t dimen, int32_t tilezoom);
|
||||
void polymost_glreset(void);
|
||||
void polymost_precache(int32_t dapicnum, int32_t dapalnum, int32_t datype);
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
extern int32_t glanisotropy;
|
||||
extern int32_t glusetexcompr;
|
||||
extern int32_t gltexfiltermode;
|
||||
extern int32_t glredbluemode;
|
||||
extern int32_t glusetexcache;
|
||||
extern int32_t glmultisample, glnvmultisamplehint;
|
||||
extern int32_t glwidescreen, glprojectionhacks;
|
||||
extern int32_t gltexmaxsize;
|
||||
void gltexapplyprops (void);
|
||||
void invalidatecache(void);
|
||||
|
||||
extern int32_t r_detailmapping;
|
||||
extern int32_t r_glowmapping;
|
||||
extern int32_t r_vertexarrays;
|
||||
extern int32_t r_vbos;
|
||||
extern int32_t r_vbocount;
|
||||
extern int32_t r_animsmoothing;
|
||||
extern int32_t r_parallaxskyclamping;
|
||||
extern int32_t r_parallaxskypanning;
|
||||
extern int32_t r_modelocclusionchecking;
|
||||
extern int32_t r_fullbrights;
|
||||
extern int32_t r_downsize;
|
||||
extern int32_t r_downsizevar;
|
||||
extern int32_t mdtims, omdtims;
|
||||
extern int32_t glrendmode;
|
||||
#endif
|
||||
|
||||
void hicinit(void);
|
||||
// effect bitset: 1 = greyscale, 2 = invert
|
||||
void hicsetpalettetint(int32_t palnum, char r, char g, char b, char effect);
|
||||
// flags bitset: 1 = don't compress
|
||||
int32_t hicsetsubsttex(int32_t picnum, int32_t palnum, const char *filen, float alphacut, float xscale, float yscale, float specpower, float specfactor, char flags);
|
||||
int32_t hicsetskybox(int32_t picnum, int32_t palnum, char *faces[6]);
|
||||
int32_t hicclearsubst(int32_t picnum, int32_t palnum);
|
||||
|
||||
int32_t Ptile2tile(int32_t tile, int32_t pallet);
|
||||
int32_t md_loadmodel(const char *fn);
|
||||
int32_t md_setmisc(int32_t modelid, float scale, int32_t shadeoff, float zadd, int32_t flags);
|
||||
// int32_t md_tilehasmodel(int32_t tilenume, int32_t pal);
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
typedef struct
|
||||
{
|
||||
// maps build tiles to particular animation frames of a model
|
||||
int32_t modelid;
|
||||
int32_t skinnum;
|
||||
int32_t framenum; // calculate the number from the name when declaring
|
||||
float smoothduration;
|
||||
int32_t next;
|
||||
char pal;
|
||||
} tile2model_t;
|
||||
|
||||
#define EXTRATILES MAXTILES
|
||||
|
||||
EXTERN int32_t mdinited;
|
||||
EXTERN tile2model_t tile2model[MAXTILES+EXTRATILES];
|
||||
|
||||
static inline int32_t md_tilehasmodel(int32_t tilenume,int32_t pal)
|
||||
{
|
||||
if (!mdinited) return -1;
|
||||
return tile2model[Ptile2tile(tilenume,pal)].modelid;
|
||||
}
|
||||
#endif
|
||||
|
||||
int32_t md_defineframe(int32_t modelid, const char *framename, int32_t tilenume, int32_t skinnum, float smoothduration, int32_t pal);
|
||||
int32_t md_defineanimation(int32_t modelid, const char *framestart, const char *frameend, int32_t fps, int32_t flags);
|
||||
int32_t md_defineskin(int32_t modelid, const char *skinfn, int32_t palnum, int32_t skinnum, int32_t surfnum, float param, float specpower, float specfactor);
|
||||
int32_t md_definehud (int32_t modelid, int32_t tilex, double xadd, double yadd, double zadd, double angadd, int32_t flags, int32_t fov);
|
||||
int32_t md_undefinetile(int32_t tile);
|
||||
int32_t md_undefinemodel(int32_t modelid);
|
||||
|
||||
int32_t loaddefinitionsfile(const char *fn);
|
||||
|
||||
extern int32_t mapversion; // if loadboard() fails with -2 return, try loadoldboard(). if it fails with -2, board is dodgy
|
||||
int32_t loadoldboard(char *filename, char fromwhere, int32_t *daposx, int32_t *daposy, int32_t *daposz, int16_t *daang, int16_t *dacursectnum);
|
||||
|
||||
// Hash functions
|
||||
|
||||
typedef struct _hashitem // size is 12/24 bits.
|
||||
{
|
||||
char *string;
|
||||
int32_t key;
|
||||
struct _hashitem *next;
|
||||
} hashitem_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t size;
|
||||
hashitem_t **items;
|
||||
} hashtable_t;
|
||||
|
||||
void hash_init(hashtable_t *t);
|
||||
void hash_free(hashtable_t *t);
|
||||
int32_t hash_findcase(hashtable_t *t, const char *s);
|
||||
int32_t hash_find(hashtable_t *t, const char *s);
|
||||
void hash_add(hashtable_t *t, const char *s, int32_t key, int32_t replace);
|
||||
|
||||
#ifdef POLYMER
|
||||
# include "polymer.h"
|
||||
#else
|
||||
#ifdef USE_OPENGL
|
||||
# include "polymost.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __build_h__
|
|
@ -1,73 +0,0 @@
|
|||
// cache1d.h
|
||||
|
||||
#ifndef __cache1d_h__
|
||||
#define __cache1d_h__
|
||||
|
||||
#include "compat.h"
|
||||
#include "mutex.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MAXGROUPFILES 8 //Warning: Fix groupfil if this is changed
|
||||
#define MAXOPENFILES 64 //Warning: Fix filehan if this is changed
|
||||
|
||||
extern char filegrp[MAXOPENFILES];
|
||||
|
||||
void initcache(intptr_t dacachestart, int32_t dacachesize);
|
||||
void allocache(intptr_t *newhandle, int32_t newbytes, char *newlockptr);
|
||||
void suckcache(intptr_t *suckptr);
|
||||
void agecache(void);
|
||||
|
||||
extern int32_t pathsearchmode; // 0 = gamefs mode (default), 1 = localfs mode (editor's mode)
|
||||
int32_t addsearchpath(const char *p);
|
||||
int32_t findfrompath(const char *fn, char **where);
|
||||
int32_t openfrompath(const char *fn, int32_t flags, int32_t mode);
|
||||
BFILE *fopenfrompath(const char *fn, const char *mode);
|
||||
|
||||
int32_t initgroupfile(const char *filename);
|
||||
void uninitsinglegroupfile(int32_t grphandle);
|
||||
void uninitgroupfile(void);
|
||||
int32_t kopen4load(const char *filename, char searchfirst); // searchfirst: 0 = anywhere, 1 = first group, 2 = any group
|
||||
int32_t kread(int32_t handle, void *buffer, int32_t leng);
|
||||
int32_t klseek(int32_t handle, int32_t offset, int32_t whence);
|
||||
int32_t kfilelength(int32_t handle);
|
||||
int32_t ktell(int32_t handle);
|
||||
void kclose(int32_t handle);
|
||||
|
||||
typedef struct { intptr_t *hand; int32_t leng; char *lock ; } cactype;
|
||||
|
||||
enum {
|
||||
CACHE1D_FIND_FILE = 1,
|
||||
CACHE1D_FIND_DIR = 2,
|
||||
CACHE1D_FIND_DRIVE = 4,
|
||||
|
||||
CACHE1D_OPT_NOSTACK = 0x100,
|
||||
|
||||
// the lower the number, the higher the priority
|
||||
CACHE1D_SOURCE_DRIVE = 0,
|
||||
CACHE1D_SOURCE_CURDIR = 1,
|
||||
CACHE1D_SOURCE_PATH = 2, // + path stack depth
|
||||
CACHE1D_SOURCE_ZIP = 0x7ffffffe,
|
||||
CACHE1D_SOURCE_GRP = 0x7fffffff,
|
||||
};
|
||||
typedef struct _CACHE1D_FIND_REC {
|
||||
char *name;
|
||||
int32_t type, source;
|
||||
struct _CACHE1D_FIND_REC *next, *prev, *usera, *userb;
|
||||
} CACHE1D_FIND_REC;
|
||||
void klistfree(CACHE1D_FIND_REC *rec);
|
||||
CACHE1D_FIND_REC *klistpath(const char *path, const char *mask, int32_t type);
|
||||
|
||||
int32_t kdfread(void *buffer, bsize_t dasizeof, bsize_t count, int32_t fil);
|
||||
int32_t dfread(void *buffer, bsize_t dasizeof, bsize_t count, BFILE *fil);
|
||||
void kdfwrite(void *buffer, bsize_t dasizeof, bsize_t count, int32_t fil);
|
||||
void dfwrite(void *buffer, bsize_t dasizeof, bsize_t count, BFILE *fil);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __cache1d_h__
|
||||
|
|
@ -1,573 +0,0 @@
|
|||
// Compatibility declarations for things which might not be present in
|
||||
// certain build environments. It also levels the playing field caused
|
||||
// by different platforms.
|
||||
|
||||
#ifndef __compat_h__
|
||||
#define __compat_h__
|
||||
|
||||
# ifdef _WIN32
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
# endif
|
||||
|
||||
#ifndef UNREFERENCED_PARAMETER
|
||||
#define UNREFERENCED_PARAMETER(x) x=x
|
||||
#endif
|
||||
|
||||
#define clamp(in, min, max) ((in) <= (min) ? (min) : (in) >= (max) ? (max) : (in))
|
||||
|
||||
#if defined __GNUC__ || defined __clang__
|
||||
# define ATTRIBUTE(attrlist) __attribute__(attrlist)
|
||||
#else
|
||||
# define ATTRIBUTE(attrlist)
|
||||
#endif
|
||||
|
||||
// This gives us access to 'intptr_t' and 'uintptr_t', which are
|
||||
// abstractions to the size of a pointer on a given platform
|
||||
// (ie, they're guaranteed to be the same size as a pointer)
|
||||
#ifdef HAVE_INTTYPES
|
||||
# include <inttypes.h>
|
||||
#elif defined(_MSC_VER)
|
||||
# include "msvc/inttypes.h" // from http://code.google.com/p/msinttypes/
|
||||
#endif
|
||||
|
||||
#ifndef _MSC_VER
|
||||
#if defined(__GNUC__) && defined(__i386__)
|
||||
#ifndef __fastcall
|
||||
#define __fastcall __attribute__((fastcall))
|
||||
#endif
|
||||
#else
|
||||
#define __fastcall
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEDMALLOC
|
||||
#include "nedmalloc.h"
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#define WITHKPLIB
|
||||
|
||||
// Define this to rewrite all 'B' versions to library functions. This
|
||||
// is for platforms which give us a standard sort of C library so we
|
||||
// link directly. Platforms like PalmOS which don't have a standard C
|
||||
// library will need to wrap these functions with suitable emulations.
|
||||
#define __compat_h_macrodef__
|
||||
|
||||
#ifdef __cplusplus
|
||||
# include <cstdarg>
|
||||
# ifdef __compat_h_macrodef__
|
||||
# include <cstdio>
|
||||
# include <cstring>
|
||||
# include <cstdlib>
|
||||
# include <ctime>
|
||||
# endif
|
||||
#else
|
||||
# include <stdarg.h>
|
||||
# include <stddef.h>
|
||||
#endif
|
||||
|
||||
#ifdef __compat_h_macrodef__
|
||||
# ifndef __cplusplus
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
# include <stdlib.h>
|
||||
# include <time.h>
|
||||
# endif
|
||||
# include <fcntl.h>
|
||||
# include <ctype.h>
|
||||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
# include <errno.h>
|
||||
# if defined(_WIN32)
|
||||
# include <io.h>
|
||||
# else
|
||||
# include <unistd.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef EFENCE
|
||||
# include <efence.h>
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# define inline __inline
|
||||
# define longlong(x) x##i64
|
||||
static inline float nearbyintf(float x)
|
||||
{
|
||||
uint32_t w1, w2;
|
||||
__asm fnstcw w1
|
||||
w2 = w1 | 0x00000020;
|
||||
__asm
|
||||
{
|
||||
fldcw w2
|
||||
fld x
|
||||
frndint
|
||||
fclex
|
||||
fldcw w1
|
||||
}
|
||||
}
|
||||
#else
|
||||
# define longlong(x) x##ll
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
# define NULL ((void *)0)
|
||||
#endif
|
||||
|
||||
#if defined(__linux)
|
||||
# include <endian.h>
|
||||
# if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
# define B_LITTLE_ENDIAN 1
|
||||
# define B_BIG_ENDIAN 0
|
||||
# elif __BYTE_ORDER == __BIG_ENDIAN
|
||||
# define B_LITTLE_ENDIAN 0
|
||||
# define B_BIG_ENDIAN 1
|
||||
# endif
|
||||
# define B_ENDIAN_C_INLINE 1
|
||||
|
||||
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
# include <sys/endian.h>
|
||||
# if _BYTE_ORDER == _LITTLE_ENDIAN
|
||||
# define B_LITTLE_ENDIAN 1
|
||||
# define B_BIG_ENDIAN 0
|
||||
# elif _BYTE_ORDER == _BIG_ENDIAN
|
||||
# define B_LITTLE_ENDIAN 0
|
||||
# define B_BIG_ENDIAN 1
|
||||
# endif
|
||||
# define B_SWAP64(x) __bswap64(x)
|
||||
# define B_SWAP32(x) __bswap32(x)
|
||||
# define B_SWAP16(x) __bswap16(x)
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
# if defined(__LITTLE_ENDIAN__)
|
||||
# define B_LITTLE_ENDIAN 1
|
||||
# define B_BIG_ENDIAN 0
|
||||
# elif defined(__BIG_ENDIAN__)
|
||||
# define B_LITTLE_ENDIAN 0
|
||||
# define B_BIG_ENDIAN 1
|
||||
# endif
|
||||
# include <libkern/OSByteOrder.h>
|
||||
# define B_SWAP64(x) OSSwapConstInt64(x)
|
||||
# define B_SWAP32(x) OSSwapConstInt32(x)
|
||||
# define B_SWAP16(x) OSSwapConstInt16(x)
|
||||
|
||||
#elif defined(__BEOS__)
|
||||
# include <posix/endian.h>
|
||||
# if LITTLE_ENDIAN != 0
|
||||
# define B_LITTLE_ENDIAN 1
|
||||
# define B_BIG_ENDIAN 0
|
||||
# elif BIG_ENDIAN != 0
|
||||
# define B_LITTLE_ENDIAN 0
|
||||
# define B_BIG_ENDIAN 1
|
||||
# endif
|
||||
# define B_ENDIAN_C_INLINE 1
|
||||
|
||||
#elif defined(__QNX__)
|
||||
# if defined __LITTLEENDIAN__
|
||||
# define B_LITTLE_ENDIAN 1
|
||||
# define B_BIG_ENDIAN 0
|
||||
# elif defined __BIGENDIAN__
|
||||
# define B_LITTLE_ENDIAN 0
|
||||
# define B_BIG_ENDIAN 1
|
||||
# endif
|
||||
# define B_ENDIAN_C_INLINE 1
|
||||
|
||||
#elif defined(__sun)
|
||||
# if defined _LITTLE_ENDIAN
|
||||
# define B_LITTLE_ENDIAN 1
|
||||
# define B_BIG_ENDIAN 0
|
||||
# elif defined _BIG_ENDIAN
|
||||
# define B_LITTLE_ENDIAN 0
|
||||
# define B_BIG_ENDIAN 1
|
||||
# endif
|
||||
# define B_ENDIAN_C_INLINE 1
|
||||
|
||||
#elif defined(_WIN32) || defined(SKYOS) || defined(__SYLLABLE__)
|
||||
# define B_LITTLE_ENDIAN 1
|
||||
# define B_BIG_ENDIAN 0
|
||||
# define B_ENDIAN_C_INLINE 1
|
||||
#endif
|
||||
|
||||
#if !defined(B_LITTLE_ENDIAN) || !defined(B_BIG_ENDIAN)
|
||||
# error Unknown endianness
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
# ifndef SCREWED_UP_CPP
|
||||
// using namespace std;
|
||||
# endif
|
||||
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined B_ENDIAN_X86_INLINE
|
||||
# if defined(_MSC_VER)
|
||||
// inline asm using bswap/xchg
|
||||
# elif defined(__GNUC__)
|
||||
// inline asm using bswap/xchg
|
||||
# endif
|
||||
#elif defined B_ENDIAN_C_INLINE
|
||||
static inline uint16_t B_SWAP16(uint16_t s) { return (s>>8)|(s<<8); }
|
||||
static inline uint32_t B_SWAP32(uint32_t l) { return ((l>>8)&0xff00)|((l&0xff00)<<8)|(l<<24)|(l>>24); }
|
||||
static inline uint64_t B_SWAP64(uint64_t l) { return (l>>56)|((l>>40)&0xff00)|((l>>24)&0xff0000)|((l>>8)&0xff000000)|((l&255)<<56)|((l&0xff00)<<40)|((l&0xff0000)<<24)|((l&0xff000000)<<8); }
|
||||
#endif
|
||||
|
||||
#if defined(USE_MSC_PRAGMAS)
|
||||
static inline void ftol(float f, int32_t *a)
|
||||
{
|
||||
_asm
|
||||
{
|
||||
mov eax, a
|
||||
fld f
|
||||
fistp dword ptr [eax]
|
||||
}
|
||||
}
|
||||
|
||||
static inline void dtol(double d, int32_t *a)
|
||||
{
|
||||
_asm
|
||||
{
|
||||
mov eax, a
|
||||
fld d
|
||||
fistp dword ptr [eax]
|
||||
}
|
||||
}
|
||||
#elif defined(USE_GCC_PRAGMAS)
|
||||
|
||||
static inline void ftol(float f, int32_t *a)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
#if 0 //(__GNUC__ >= 3)
|
||||
"flds %1; fistpl %0;"
|
||||
#else
|
||||
"flds %1; fistpl (%0);"
|
||||
#endif
|
||||
: "=r"(a) : "m"(f) : "memory","cc");
|
||||
}
|
||||
|
||||
static inline void dtol(double d, int32_t *a)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
#if 0 //(__GNUC__ >= 3)
|
||||
"fldl %1; fistpl %0;"
|
||||
#else
|
||||
"fldl %1; fistpl (%0);"
|
||||
#endif
|
||||
: "=r"(a) : "m"(d) : "memory","cc");
|
||||
}
|
||||
|
||||
#else
|
||||
static inline void ftol(float f, int32_t *a)
|
||||
{
|
||||
*a = (int32_t)f;
|
||||
}
|
||||
|
||||
static inline void dtol(double d, int32_t *a)
|
||||
{
|
||||
*a = (int32_t)d;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if B_LITTLE_ENDIAN == 1
|
||||
# define B_LITTLE64(x) (x)
|
||||
# define B_BIG64(x) B_SWAP64(x)
|
||||
# define B_LITTLE32(x) (x)
|
||||
# define B_BIG32(x) B_SWAP32(x)
|
||||
# define B_LITTLE16(x) (x)
|
||||
# define B_BIG16(x) B_SWAP16(x)
|
||||
#elif B_BIG_ENDIAN == 1
|
||||
# define B_LITTLE64(x) B_SWAP64(x)
|
||||
# define B_BIG64(x) (x)
|
||||
# define B_LITTLE32(x) B_SWAP32(x)
|
||||
# define B_BIG32(x) (x)
|
||||
# define B_LITTLE16(x) B_SWAP16(x)
|
||||
# define B_BIG16(x) (x)
|
||||
#endif
|
||||
|
||||
#ifndef FP_OFF
|
||||
# define FP_OFF(__p) ((uintptr_t)(__p))
|
||||
#endif
|
||||
|
||||
#ifdef __compat_h_macrodef__
|
||||
|
||||
# ifndef O_BINARY
|
||||
# define O_BINARY 0
|
||||
# endif
|
||||
# ifndef O_TEXT
|
||||
# define O_TEXT 0
|
||||
# endif
|
||||
|
||||
# ifndef F_OK
|
||||
# define F_OK 0
|
||||
# endif
|
||||
|
||||
# define BO_BINARY O_BINARY
|
||||
# define BO_TEXT O_TEXT
|
||||
# define BO_RDONLY O_RDONLY
|
||||
# define BO_WRONLY O_WRONLY
|
||||
# define BO_RDWR O_RDWR
|
||||
# define BO_APPEND O_APPEND
|
||||
# define BO_CREAT O_CREAT
|
||||
# define BO_TRUNC O_TRUNC
|
||||
# define BS_IRGRP S_IRGRP
|
||||
# define BS_IWGRP S_IWGRP
|
||||
# define BS_IEXEC S_IEXEC
|
||||
# define BS_IWRITE S_IWRITE
|
||||
# define BS_IREAD S_IREAD
|
||||
# define BS_IFIFO S_IFIFO
|
||||
# define BS_IFCHR S_IFCHR
|
||||
# define BS_IFBLK S_IFBLK
|
||||
# define BS_IFDIR S_IFDIR
|
||||
# define BS_IFREG S_IFREG
|
||||
# define BSEEK_SET SEEK_SET
|
||||
# define BSEEK_CUR SEEK_CUR
|
||||
# define BSEEK_END SEEK_END
|
||||
#else
|
||||
# define BO_BINARY 0
|
||||
# define BO_TEXT 1
|
||||
# define BO_RDONLY 2
|
||||
# define BO_WRONLY 4
|
||||
# define BO_RDWR 6
|
||||
# define BO_APPEND 8
|
||||
# define BO_CREAT 16
|
||||
# define BO_TRUNC 32
|
||||
# define BS_IRGRP 0
|
||||
# define BS_IWGRP 0
|
||||
# define BS_IEXEC 1
|
||||
# define BS_IWRITE 2
|
||||
# define BS_IREAD 4
|
||||
# define BS_IFIFO 0x1000
|
||||
# define BS_IFCHR 0x2000
|
||||
# define BS_IFBLK 0x3000
|
||||
# define BS_IFDIR 0x4000
|
||||
# define BS_IFREG 0x8000
|
||||
# define BSEEK_SET 0
|
||||
# define BSEEK_CUR 1
|
||||
# define BSEEK_END 2
|
||||
#endif
|
||||
|
||||
#ifdef UNDERSCORES
|
||||
# define ASMSYM(x) "_" x
|
||||
#else
|
||||
# define ASMSYM(x) x
|
||||
#endif
|
||||
|
||||
#ifndef min
|
||||
# define min(a,b) ( ((a) < (b)) ? (a) : (b) )
|
||||
#endif
|
||||
|
||||
#ifndef max
|
||||
# define max(a,b) ( ((a) > (b)) ? (a) : (b) )
|
||||
#endif
|
||||
|
||||
|
||||
#define BMAX_PATH 256
|
||||
|
||||
|
||||
struct Bdirent {
|
||||
uint16_t namlen;
|
||||
char *name;
|
||||
uint32_t mode;
|
||||
uint32_t size;
|
||||
uint32_t mtime;
|
||||
};
|
||||
typedef void BDIR;
|
||||
|
||||
BDIR* Bopendir(const char *name);
|
||||
struct Bdirent* Breaddir(BDIR *dir);
|
||||
int32_t Bclosedir(BDIR *dir);
|
||||
|
||||
|
||||
#ifdef __compat_h_macrodef__
|
||||
typedef FILE BFILE;
|
||||
# define bsize_t size_t
|
||||
# define bssize_t ssize_t
|
||||
#else
|
||||
typedef void BFILE;
|
||||
typedef uint32_t bsize_t;
|
||||
typedef int32_t bssize_t;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __compat_h_macrodef__
|
||||
# define Brand rand
|
||||
# define Balloca alloca
|
||||
#ifdef NEDMALLOC
|
||||
# define Bmalloc nedmalloc
|
||||
# define Bcalloc nedcalloc
|
||||
# define Brealloc nedrealloc
|
||||
# define Bfree nedfree
|
||||
# define Bstrdup nedstrdup
|
||||
# define Bmemalign nedmemalign
|
||||
#else
|
||||
# define Bmalloc malloc
|
||||
# define Bcalloc calloc
|
||||
# define Brealloc realloc
|
||||
# define Bfree free
|
||||
# define Bstrdup strdup
|
||||
# define Bmemalign memalign
|
||||
#endif
|
||||
# define Bopen open
|
||||
# define Bclose close
|
||||
# define Bwrite write
|
||||
# define Bread read
|
||||
# define Blseek lseek
|
||||
# if defined(__GNUC__)
|
||||
# define Btell(h) lseek(h,0,SEEK_CUR)
|
||||
# else
|
||||
# define Btell tell
|
||||
# endif
|
||||
# define Bstat stat
|
||||
# define Bfopen fopen
|
||||
# define Bfclose fclose
|
||||
# define Bfeof feof
|
||||
# define Bfgetc fgetc
|
||||
# define Brewind rewind
|
||||
# define Bfgets fgets
|
||||
# define Bfputc fputc
|
||||
# define Bfputs fputs
|
||||
# define Bfread fread
|
||||
# define Bfwrite fwrite
|
||||
# define Bfprintf fprintf
|
||||
# define Bstrcpy strcpy
|
||||
# define Bstrncpy strncpy
|
||||
# define Bstrcmp strcmp
|
||||
# define Bstrncmp strncmp
|
||||
# if defined(_MSC_VER)
|
||||
# define Bstrcasecmp _stricmp
|
||||
# define Bstrncasecmp _strnicmp
|
||||
# else
|
||||
# if defined(__QNX__)
|
||||
# define Bstrcasecmp stricmp
|
||||
# define Bstrncasecmp strnicmp
|
||||
# else
|
||||
# define Bstrcasecmp strcasecmp
|
||||
# define Bstrncasecmp strncasecmp
|
||||
# endif
|
||||
# endif
|
||||
# if defined(_WIN32)
|
||||
# define Bstrlwr strlwr
|
||||
# define Bstrupr strupr
|
||||
# define Bmkdir(s,x) mkdir(s)
|
||||
# else
|
||||
# define Bmkdir mkdir
|
||||
# endif
|
||||
# define Bstrcat strcat
|
||||
# define Bstrncat strncat
|
||||
# define Bstrlen strlen
|
||||
# define Bstrchr strchr
|
||||
# define Bstrrchr strrchr
|
||||
# define Batoi atoi
|
||||
# define Batol atol
|
||||
# define Bstrtol strtol
|
||||
# define Bstrtoul strtoul
|
||||
# define Bstrtod strtod
|
||||
# define Bstrstr strstr
|
||||
# define Btoupper toupper
|
||||
# define Btolower tolower
|
||||
# define Bmemcpy memcpy
|
||||
# define Bmemmove memmove
|
||||
# define Bmemchr memchr
|
||||
# define Bmemset memset
|
||||
# define Bmemcmp memcmp
|
||||
# define Bprintf printf
|
||||
# define Bsprintf sprintf
|
||||
# ifdef _MSC_VER
|
||||
# define Bsnprintf _snprintf
|
||||
# define Bvsnprintf _vsnprintf
|
||||
# else
|
||||
# define Bsnprintf snprintf
|
||||
# define Bvsnprintf vsnprintf
|
||||
# endif
|
||||
# define Bvfprintf vfprintf
|
||||
# define Bgetcwd getcwd
|
||||
# define Bgetenv getenv
|
||||
# define Btime() time(NULL)
|
||||
|
||||
#else
|
||||
|
||||
int32_t Brand(void);
|
||||
void *Bmalloc(bsize_t size);
|
||||
void Bfree(void *ptr);
|
||||
int32_t Bopen(const char *pathname, int32_t flags, unsigned mode);
|
||||
int32_t Bclose(int32_t fd);
|
||||
bssize_t Bwrite(int32_t fd, const void *buf, bsize_t count);
|
||||
bssize_t Bread(int32_t fd, void *buf, bsize_t count);
|
||||
int32_t Blseek(int32_t fildes, int32_t offset, int32_t whence);
|
||||
BFILE *Bfopen(const char *path, const char *mode);
|
||||
int32_t Bfclose(BFILE *stream);
|
||||
int32_t Bfeof(BFILE *stream);
|
||||
int32_t Bfgetc(BFILE *stream);
|
||||
void Brewind(BFILE *stream);
|
||||
char *Bfgets(char *s, int32_t size, BFILE *stream);
|
||||
int32_t Bfputc(int32_t c, BFILE *stream);
|
||||
int32_t Bfputs(const char *s, BFILE *stream);
|
||||
bsize_t Bfread(void *ptr, bsize_t size, bsize_t nmemb, BFILE *stream);
|
||||
bsize_t Bfwrite(const void *ptr, bsize_t size, bsize_t nmemb, BFILE *stream);
|
||||
char *Bstrdup(const char *s);
|
||||
char *Bstrcpy(char *dest, const char *src);
|
||||
char *Bstrncpy(char *dest, const char *src, bsize_t n);
|
||||
int32_t Bstrcmp(const char *s1, const char *s2);
|
||||
int32_t Bstrncmp(const char *s1, const char *s2, bsize_t n);
|
||||
int32_t Bstrcasecmp(const char *s1, const char *s2);
|
||||
int32_t Bstrncasecmp(const char *s1, const char *s2, bsize_t n);
|
||||
char *Bstrcat(char *dest, const char *src);
|
||||
char *Bstrncat(char *dest, const char *src, bsize_t n);
|
||||
bsize_t Bstrlen(const char *s);
|
||||
char *Bstrchr(const char *s, int32_t c);
|
||||
char *Bstrrchr(const char *s, int32_t c);
|
||||
int32_t Batoi(const char *nptr);
|
||||
int32_t Batol(const char *nptr);
|
||||
int32_t Bstrtol(const char *nptr, char **endptr, int32_t base);
|
||||
uint32_t Bstrtoul(const char *nptr, char **endptr, int32_t base);
|
||||
void *Bmemcpy(void *dest, const void *src, bsize_t n);
|
||||
void *Bmemmove(void *dest, const void *src, bsize_t n);
|
||||
void *Bmemchr(const void *s, int32_t c, bsize_t n);
|
||||
void *Bmemset(void *s, int32_t c, bsize_t n);
|
||||
int32_t Bmemcmp(const void *s1, const void *s2, bsize_t n);
|
||||
int32_t Bprintf(const char *format, ...) ATTRIBUTE((format(printf,1,2)));
|
||||
int32_t Bsprintf(char *str, const char *format, ...) ATTRIBUTE((format(printf,2,3)));
|
||||
int32_t Bsnprintf(char *str, bsize_t size, const char *format, ...) ATTRIBUTE((format(printf,3,4)));
|
||||
int32_t Bvsnprintf(char *str, bsize_t size, const char *format, va_list ap);
|
||||
char *Bgetcwd(char *buf, bsize_t size);
|
||||
char *Bgetenv(const char *name);
|
||||
#endif
|
||||
|
||||
char *Bgethomedir(void);
|
||||
char *Bgetsupportdir(int32_t global);
|
||||
uint32_t Bgetsysmemsize(void);
|
||||
int32_t Bcorrectfilename(char *filename, int32_t removefn);
|
||||
int32_t Bcanonicalisefilename(char *filename, int32_t removefn);
|
||||
char *Bgetsystemdrives(void);
|
||||
int32_t Bfilelength(int32_t fd);
|
||||
char *Bstrtoken(char *s, const char *delim, char **ptrptr, int32_t chop);
|
||||
int32_t Bwildmatch (const char *i, const char *j);
|
||||
|
||||
#if !defined(_WIN32)
|
||||
char *Bstrlwr(char *);
|
||||
char *Bstrupr(char *);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
// timer defs for profiling function chunks the simple way
|
||||
#define EDUKE32_TMRDEF int32_t t[20], ti=0; const char *tmrstr=__func__; fprintf(stderr,"%s\n",tmrstr); t[ti++]=getticks();
|
||||
#define EDUKE32_TMRTIC t[ti++]=getticks()
|
||||
#define EDUKE32_TMRPRN do { int ii=0; fprintf(stderr,"%s: ",tmrstr); for (ii=1; ii<ti; ii++) fprintf(stderr,"%d ", t[ii]-t[ii-1]); fprintf(stderr,"\n"); } while (0)
|
||||
|
||||
static inline int32_t ARBNDCHK(int32_t i) { return i<0 ? (*(int32_t *)123=234) : i; }
|
||||
#define DOUBLEWALL(w) wall[ARBNDCHK(w)]
|
||||
|
||||
#endif // __compat_h__
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
#ifndef __crc32_h__
|
||||
#define __crc32_h__
|
||||
|
||||
#include "compat.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern uint32_t crc32table[256];
|
||||
|
||||
void initcrc32table(void);
|
||||
|
||||
uint32_t crc32once(uint8_t *blk, uint32_t len);
|
||||
|
||||
static inline void crc32init(uint32_t *crcvar)
|
||||
{
|
||||
if (!crcvar) return;
|
||||
*crcvar = 0xffffffffl;
|
||||
}
|
||||
|
||||
static inline void crc32block(uint32_t *crcvar, uint8_t *blk, uint32_t len)
|
||||
{
|
||||
uint32_t crc = *crcvar;
|
||||
while (len--) crc = crc32table[(crc ^ *(blk++)) & 0xffl] ^(crc >> 8);
|
||||
*crcvar = crc;
|
||||
}
|
||||
|
||||
static inline uint32_t crc32finish(uint32_t *crcvar)
|
||||
{
|
||||
*crcvar = *crcvar ^ 0xffffffffl;
|
||||
return *crcvar;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,55 +0,0 @@
|
|||
#ifndef __dxdidf_h__
|
||||
#define __dxdidf_h__
|
||||
|
||||
// Joystick
|
||||
|
||||
static DIOBJECTDATAFORMAT c_dfDIJoystick_odf[] = {
|
||||
{ &GUID_XAxis, 0, 0x80FFFF03, 0x00000100 },
|
||||
{ &GUID_YAxis, 4, 0x80FFFF03, 0x00000100 },
|
||||
{ &GUID_ZAxis, 8, 0x80FFFF03, 0x00000100 },
|
||||
{ &GUID_RxAxis, 12, 0x80FFFF03, 0x00000100 },
|
||||
{ &GUID_RyAxis, 16, 0x80FFFF03, 0x00000100 },
|
||||
{ &GUID_RzAxis, 20, 0x80FFFF03, 0x00000100 },
|
||||
{ &GUID_Slider, 24, 0x80FFFF03, 0x00000100 },
|
||||
{ &GUID_Slider, 28, 0x80FFFF03, 0x00000100 },
|
||||
{ &GUID_POV, 32, 0x80FFFF10, 0x00000000 },
|
||||
{ &GUID_POV, 36, 0x80FFFF10, 0x00000000 },
|
||||
{ &GUID_POV, 40, 0x80FFFF10, 0x00000000 },
|
||||
{ &GUID_POV, 44, 0x80FFFF10, 0x00000000 },
|
||||
{ NULL, 48, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 49, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 50, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 51, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 52, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 53, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 54, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 55, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 56, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 57, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 58, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 59, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 60, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 61, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 62, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 63, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 64, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 65, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 66, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 67, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 68, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 69, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 70, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 71, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 72, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 73, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 74, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 75, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 76, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 77, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 78, 0x80FFFF0C, 0x00000000 },
|
||||
{ NULL, 79, 0x80FFFF0C, 0x00000000 }
|
||||
};
|
||||
|
||||
const DIDATAFORMAT c_dfDIJoystick = { 24, 16, 0x00000001, 80, 44, c_dfDIJoystick_odf };
|
||||
|
||||
#endif // __dxdidf_h__
|
|
@ -1,629 +0,0 @@
|
|||
#ifndef __dynamicgtk_h__
|
||||
#define __dynamicgtk_h__
|
||||
|
||||
#include <gdk-pixbuf/gdk-pixdata.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "compat.h"
|
||||
|
||||
#if !GTK_CHECK_VERSION(2,4,0)
|
||||
#error You need at least 2.4.0 version of GTK+
|
||||
#endif
|
||||
|
||||
#if !defined(LINKED_GTK)
|
||||
|
||||
#ifndef G_GNUC_NULL_TERMINATED
|
||||
/* this is a glib-2.8.x thing: */
|
||||
#define G_GNUC_NULL_TERMINATED
|
||||
#endif
|
||||
|
||||
struct _dynamicgtksyms {
|
||||
|
||||
// glib.h
|
||||
void (*g_free) (gpointer mem);
|
||||
// gobject.h
|
||||
gpointer (*g_object_get_data) (GObject *object,
|
||||
const gchar *key);
|
||||
void (*g_object_set_data) (GObject *object,
|
||||
const gchar *key,
|
||||
gpointer data);
|
||||
void (*g_object_set_data_full) (GObject *object,
|
||||
const gchar *key,
|
||||
gpointer data,
|
||||
GDestroyNotify destroy);
|
||||
void (*g_object_unref) (gpointer object);
|
||||
|
||||
// gsignal.h
|
||||
gulong (*g_signal_connect_data) (gpointer instance,
|
||||
const gchar *detailed_signal,
|
||||
GCallback c_handler,
|
||||
gpointer data,
|
||||
GClosureNotify destroy_data,
|
||||
GConnectFlags connect_flags);
|
||||
guint (*g_signal_handlers_block_matched) (gpointer instance,
|
||||
GSignalMatchType mask,
|
||||
guint signal_id,
|
||||
GQuark detail,
|
||||
GClosure *closure,
|
||||
gpointer func,
|
||||
gpointer data);
|
||||
guint (*g_signal_handlers_unblock_matched) (gpointer instance,
|
||||
GSignalMatchType mask,
|
||||
guint signal_id,
|
||||
GQuark detail,
|
||||
GClosure *closure,
|
||||
gpointer func,
|
||||
gpointer data);
|
||||
|
||||
// gtype.h
|
||||
GTypeInstance* (*g_type_check_instance_cast) (GTypeInstance *instance,
|
||||
GType iface_type);
|
||||
|
||||
// gdk-pixdata.h
|
||||
GdkPixbuf* (*gdk_pixbuf_from_pixdata) (const GdkPixdata *pixdata,
|
||||
gboolean copy_pixels,
|
||||
GError **error);
|
||||
|
||||
// gdk-pixbuf-core.h
|
||||
GdkPixbuf *(*gdk_pixbuf_new_from_data) (const guchar *data,
|
||||
GdkColorspace colorspace,
|
||||
gboolean has_alpha,
|
||||
int32_t bits_per_sample,
|
||||
int32_t width, int32_t height,
|
||||
int32_t rowstride,
|
||||
GdkPixbufDestroyNotify destroy_fn,
|
||||
gpointer destroy_fn_data);
|
||||
|
||||
// gtkaccelgroup.h
|
||||
GtkAccelGroup* (*gtk_accel_group_new) (void);
|
||||
|
||||
// gtkalignment.h
|
||||
GtkWidget* (*gtk_alignment_new) (gfloat xalign,
|
||||
gfloat yalign,
|
||||
gfloat xscale,
|
||||
gfloat yscale);
|
||||
|
||||
// gtkbox.h
|
||||
GType (*gtk_box_get_type) (void) G_GNUC_CONST;
|
||||
void (*gtk_box_pack_start) (GtkBox *box,
|
||||
GtkWidget *child,
|
||||
gboolean expand,
|
||||
gboolean fill,
|
||||
guint padding);
|
||||
|
||||
// gtkbbox.h
|
||||
GType (*gtk_button_box_get_type) (void) G_GNUC_CONST;
|
||||
void (*gtk_button_box_set_layout) (GtkButtonBox *widget,
|
||||
GtkButtonBoxStyle layout_style);
|
||||
|
||||
// gtkbutton.h
|
||||
GtkWidget* (*gtk_button_new) (void);
|
||||
|
||||
// gtkcelllayout.h
|
||||
GType (*gtk_cell_layout_get_type) (void) G_GNUC_CONST;
|
||||
void (*gtk_cell_layout_pack_start) (GtkCellLayout *cell_layout,
|
||||
GtkCellRenderer *cell,
|
||||
gboolean expand);
|
||||
void (*gtk_cell_layout_set_attributes) (GtkCellLayout *cell_layout,
|
||||
GtkCellRenderer *cell,
|
||||
...) G_GNUC_NULL_TERMINATED;
|
||||
|
||||
// gtkcellrenderertext.h
|
||||
GtkCellRenderer *(*gtk_cell_renderer_text_new) (void);
|
||||
|
||||
// gtkcheckbutton.h
|
||||
GtkWidget* (*gtk_check_button_new_with_mnemonic) (const gchar *label);
|
||||
|
||||
// gtkcombobox.h
|
||||
gint (*gtk_combo_box_get_active) (GtkComboBox *combo_box);
|
||||
gboolean (*gtk_combo_box_get_active_iter) (GtkComboBox *combo_box,
|
||||
GtkTreeIter *iter);
|
||||
gchar (*gtk_combo_box_get_active_text) (GtkComboBox *combo_box);
|
||||
GtkTreeModel *(*gtk_combo_box_get_model) (GtkComboBox *combo_box);
|
||||
GType (*gtk_combo_box_get_type) (void) G_GNUC_CONST;
|
||||
GtkWidget *(*gtk_combo_box_new_text) (void);
|
||||
GtkWidget *(*gtk_combo_box_new_with_model) (GtkTreeModel *model);
|
||||
void (*gtk_combo_box_set_active) (GtkComboBox *combo_box,
|
||||
gint index_);
|
||||
void (*gtk_combo_box_set_active_iter) (GtkComboBox *combo_box,
|
||||
GtkTreeIter *iter);
|
||||
|
||||
// gtkcontainer.h
|
||||
void (*gtk_container_add) (GtkContainer *container,
|
||||
GtkWidget *widget);
|
||||
void (*gtk_container_foreach) (GtkContainer *container,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
GType (*gtk_container_get_type) (void) G_GNUC_CONST;
|
||||
void (*gtk_container_set_border_width) (GtkContainer *container,
|
||||
guint border_width);
|
||||
|
||||
// gtkdialog.h
|
||||
GType (*gtk_dialog_get_type) (void) G_GNUC_CONST;
|
||||
gint (*gtk_dialog_run) (GtkDialog *dialog);
|
||||
|
||||
// gtkhbox.h
|
||||
GtkWidget* (*gtk_hbox_new) (gboolean homogeneous,
|
||||
gint spacing);
|
||||
|
||||
// gtkhbbox.h
|
||||
GtkWidget* (*gtk_hbutton_box_new) (void);
|
||||
|
||||
// gtkimage.h
|
||||
GtkWidget* (*gtk_image_new_from_pixbuf) (GdkPixbuf *pixbuf);
|
||||
GtkWidget* (*gtk_image_new_from_stock) (const gchar *stock_id,
|
||||
GtkIconSize size);
|
||||
|
||||
// gtkmain.h
|
||||
gboolean (*gtk_init_check) (int32_t *argc,
|
||||
char ***argv);
|
||||
|
||||
// gtklabel.h
|
||||
GType (*gtk_label_get_type) (void) G_GNUC_CONST;
|
||||
GtkWidget* (*gtk_label_new) (const gchar *str);
|
||||
GtkWidget* (*gtk_label_new_with_mnemonic) (const gchar *str);
|
||||
void (*gtk_label_set_mnemonic_widget) (GtkLabel *label,
|
||||
GtkWidget *widget);
|
||||
|
||||
// gtkliststore.h
|
||||
void (*gtk_list_store_append) (GtkListStore *list_store,
|
||||
GtkTreeIter *iter);
|
||||
void (*gtk_list_store_clear) (GtkListStore *list_store);
|
||||
GType (*gtk_list_store_get_type) (void) G_GNUC_CONST;
|
||||
GtkListStore *(*gtk_list_store_new) (gint n_columns,
|
||||
...);
|
||||
void (*gtk_list_store_set) (GtkListStore *list_store,
|
||||
GtkTreeIter *iter,
|
||||
...);
|
||||
|
||||
// gtkmain.h
|
||||
void (*gtk_main) (void);
|
||||
gboolean (*gtk_main_iteration_do) (gboolean blocking);
|
||||
void (*gtk_main_quit) (void);
|
||||
|
||||
// gtkmessagedialog.h
|
||||
GtkWidget* (*gtk_message_dialog_new) (GtkWindow *parent,
|
||||
GtkDialogFlags flags,
|
||||
GtkMessageType type,
|
||||
GtkButtonsType buttons,
|
||||
const gchar *message_format,
|
||||
...) G_GNUC_PRINTF (5, 6);
|
||||
|
||||
// gtkmisc.h
|
||||
GType (*gtk_misc_get_type) (void) G_GNUC_CONST;
|
||||
void (*gtk_misc_set_alignment) (GtkMisc *misc,
|
||||
gfloat xalign,
|
||||
gfloat yalign);
|
||||
|
||||
// gtknotebook.h
|
||||
GtkWidget* (*gtk_notebook_get_nth_page) (GtkNotebook *notebook,
|
||||
gint page_num);
|
||||
GType (*gtk_notebook_get_type) (void) G_GNUC_CONST;
|
||||
GtkWidget * (*gtk_notebook_new) (void);
|
||||
void (*gtk_notebook_set_current_page) (GtkNotebook *notebook,
|
||||
gint page_num);
|
||||
void (*gtk_notebook_set_tab_label) (GtkNotebook *notebook,
|
||||
GtkWidget *child,
|
||||
GtkWidget *tab_label);
|
||||
|
||||
// gtkobject.h
|
||||
GtkType (*gtk_object_get_type) (void) G_GNUC_CONST;
|
||||
|
||||
// gtkscrolledwindow.h
|
||||
GType (*gtk_scrolled_window_get_type) (void) G_GNUC_CONST;
|
||||
GtkWidget* (*gtk_scrolled_window_new) (GtkAdjustment *hadjustment,
|
||||
GtkAdjustment *vadjustment);
|
||||
void (*gtk_scrolled_window_set_policy) (GtkScrolledWindow *scrolled_window,
|
||||
GtkPolicyType hscrollbar_policy,
|
||||
GtkPolicyType vscrollbar_policy);
|
||||
void (*gtk_scrolled_window_set_shadow_type) (GtkScrolledWindow *scrolled_window,
|
||||
GtkShadowType type);
|
||||
// gtktable.h
|
||||
GType (*gtk_table_get_type) (void) G_GNUC_CONST;
|
||||
GtkWidget* (*gtk_table_new) (guint rows,
|
||||
guint columns,
|
||||
gboolean homogeneous);
|
||||
void (*gtk_table_attach) (GtkTable *table,
|
||||
GtkWidget *child,
|
||||
guint left_attach,
|
||||
guint right_attach,
|
||||
guint top_attach,
|
||||
guint bottom_attach,
|
||||
GtkAttachOptions xoptions,
|
||||
GtkAttachOptions yoptions,
|
||||
guint xpadding,
|
||||
guint ypadding);
|
||||
|
||||
|
||||
// gtktextbuffer.h
|
||||
gboolean (*gtk_text_buffer_backspace) (GtkTextBuffer *buffer,
|
||||
GtkTextIter *iter,
|
||||
gboolean interactive,
|
||||
gboolean default_editable);
|
||||
GtkTextMark *(*gtk_text_buffer_create_mark) (GtkTextBuffer *buffer,
|
||||
const gchar *mark_name,
|
||||
const GtkTextIter *where,
|
||||
gboolean left_gravity);
|
||||
void (*gtk_text_buffer_delete_mark) (GtkTextBuffer *buffer,
|
||||
GtkTextMark *mark);
|
||||
void (*gtk_text_buffer_get_end_iter) (GtkTextBuffer *buffer,
|
||||
GtkTextIter *iter);
|
||||
void (*gtk_text_buffer_insert) (GtkTextBuffer *buffer,
|
||||
GtkTextIter *iter,
|
||||
const gchar *text,
|
||||
gint len);
|
||||
|
||||
// gtktextiter.h
|
||||
// FIXME: should I put a #if !GTK_CHECK_VERSION(2,6,0)
|
||||
// around these three, or should I not care?
|
||||
gboolean (*gtk_text_iter_backward_cursor_position) (GtkTextIter *iter);
|
||||
gboolean (*gtk_text_iter_equal) (const GtkTextIter *lhs,
|
||||
const GtkTextIter *rhs);
|
||||
gboolean (*gtk_text_buffer_delete_interactive) (GtkTextBuffer *buffer,
|
||||
GtkTextIter *start_iter,
|
||||
GtkTextIter *end_iter,
|
||||
gboolean default_editable);
|
||||
|
||||
// gtktextview.h
|
||||
GtkTextBuffer *(*gtk_text_view_get_buffer) (GtkTextView *text_view);
|
||||
GType (*gtk_text_view_get_type) (void) G_GNUC_CONST;
|
||||
GtkWidget * (*gtk_text_view_new) (void);
|
||||
void (*gtk_text_view_scroll_to_mark) (GtkTextView *text_view,
|
||||
GtkTextMark *mark,
|
||||
gdouble within_margin,
|
||||
gboolean use_align,
|
||||
gdouble xalign,
|
||||
gdouble yalign);
|
||||
void (*gtk_text_view_set_cursor_visible) (GtkTextView *text_view,
|
||||
gboolean setting);
|
||||
void (*gtk_text_view_set_editable) (GtkTextView *text_view,
|
||||
gboolean setting);
|
||||
void (*gtk_text_view_set_left_margin) (GtkTextView *text_view,
|
||||
gint left_margin);
|
||||
void (*gtk_text_view_set_right_margin) (GtkTextView *text_view,
|
||||
gint right_margin);
|
||||
void (*gtk_text_view_set_wrap_mode) (GtkTextView *text_view,
|
||||
GtkWrapMode wrap_mode);
|
||||
|
||||
// gtktogglebutton.h
|
||||
gboolean (*gtk_toggle_button_get_active) (GtkToggleButton *toggle_button);
|
||||
GType (*gtk_toggle_button_get_type) (void) G_GNUC_CONST;
|
||||
void (*gtk_toggle_button_set_active) (GtkToggleButton *toggle_button,
|
||||
gboolean is_active);
|
||||
|
||||
// gtktreemodel.h
|
||||
void (*gtk_tree_model_get) (GtkTreeModel *tree_model,
|
||||
GtkTreeIter *iter,
|
||||
...);
|
||||
gboolean (*gtk_tree_model_get_iter) (GtkTreeModel *tree_model,
|
||||
GtkTreeIter *iter,
|
||||
GtkTreePath *path);
|
||||
GtkTreePath * (*gtk_tree_model_get_path) (GtkTreeModel *tree_model,
|
||||
GtkTreeIter *iter);
|
||||
GType (*gtk_tree_model_get_type) (void) G_GNUC_CONST;
|
||||
gint *(*gtk_tree_path_get_indices) (GtkTreePath *path);
|
||||
GtkTreePath *(*gtk_tree_path_new_from_indices) (gint first_index,
|
||||
...);
|
||||
// gtktreeselection.h
|
||||
gboolean (*gtk_tree_selection_get_selected) (GtkTreeSelection *selection,
|
||||
GtkTreeModel **model,
|
||||
GtkTreeIter *iter);
|
||||
void (*gtk_tree_selection_select_iter) (GtkTreeSelection *selection,
|
||||
GtkTreeIter *iter);
|
||||
GType (*gtk_tree_selection_get_type) (void) G_GNUC_CONST;
|
||||
|
||||
void (*gtk_tree_selection_set_mode) (GtkTreeSelection *selection,
|
||||
GtkSelectionMode type);
|
||||
|
||||
// gtktreesortable.h
|
||||
GType (*gtk_tree_sortable_get_type) (void) G_GNUC_CONST;
|
||||
|
||||
void (*gtk_tree_sortable_set_sort_column_id) (GtkTreeSortable *sortable,
|
||||
gint sort_column_id,
|
||||
GtkSortType order);
|
||||
void (*gtk_tree_sortable_set_sort_func) (GtkTreeSortable *sortable,
|
||||
gint sort_column_id,
|
||||
GtkTreeIterCompareFunc sort_func,
|
||||
gpointer user_data,
|
||||
GtkDestroyNotify destroy);
|
||||
|
||||
// gtktreeview.h
|
||||
GType (*gtk_tree_view_get_type) (void) G_GNUC_CONST;
|
||||
GtkWidget *(*gtk_tree_view_new_with_model) (GtkTreeModel *model);
|
||||
|
||||
GtkTreeModel *(*gtk_tree_view_get_model) (GtkTreeView *tree_view);
|
||||
|
||||
GtkTreeSelection *(*gtk_tree_view_get_selection) (GtkTreeView *tree_view);
|
||||
gint (*gtk_tree_view_append_column) (GtkTreeView *tree_view,
|
||||
GtkTreeViewColumn *column);
|
||||
void (*gtk_tree_view_set_enable_search) (GtkTreeView *tree_view,
|
||||
gboolean enable_search);
|
||||
void (*gtk_tree_view_set_headers_visible) (GtkTreeView *tree_view,
|
||||
gboolean headers_visible);
|
||||
|
||||
// gtktreeviewcolumn.h
|
||||
GtkTreeViewColumn *(*gtk_tree_view_column_new_with_attributes) (const gchar *title,
|
||||
GtkCellRenderer *cell,
|
||||
...) G_GNUC_NULL_TERMINATED;
|
||||
void (*gtk_tree_view_column_set_expand) (GtkTreeViewColumn *tree_column,
|
||||
gboolean expand);
|
||||
void (*gtk_tree_view_column_set_min_width) (GtkTreeViewColumn *tree_column,
|
||||
gint min_width);
|
||||
|
||||
|
||||
// gtkvbox.h
|
||||
GtkWidget* (*gtk_vbox_new) (gboolean homogeneous,
|
||||
gint spacing);
|
||||
|
||||
// gtkwidget.h
|
||||
void (*gtk_widget_add_accelerator) (GtkWidget *widget,
|
||||
const gchar *accel_signal,
|
||||
GtkAccelGroup *accel_group,
|
||||
guint accel_key,
|
||||
GdkModifierType accel_mods,
|
||||
GtkAccelFlags accel_flags);
|
||||
void (*gtk_widget_destroy) (GtkWidget *widget);
|
||||
GtkWidget* (*gtk_widget_ref) (GtkWidget *widget);
|
||||
void (*gtk_widget_set_sensitive) (GtkWidget *widget,
|
||||
gboolean sensitive);
|
||||
void (*gtk_widget_set_size_request) (GtkWidget *widget,
|
||||
gint width,
|
||||
gint height);
|
||||
void (*gtk_widget_show_all) (GtkWidget *widget);
|
||||
void (*gtk_widget_unref) (GtkWidget *widget);
|
||||
|
||||
// gtkwindow.h
|
||||
void (*gtk_window_add_accel_group) (GtkWindow *window,
|
||||
GtkAccelGroup *accel_group);
|
||||
GType (*gtk_window_get_type) (void) G_GNUC_CONST;
|
||||
GtkWidget* (*gtk_window_new) (GtkWindowType type);
|
||||
void (*gtk_window_set_default_icon) (GdkPixbuf *icon);
|
||||
void (*gtk_window_set_position) (GtkWindow *window,
|
||||
GtkWindowPosition position);
|
||||
void (*gtk_window_set_resizable) (GtkWindow *window,
|
||||
gboolean resizable);
|
||||
void (*gtk_window_set_title) (GtkWindow *window,
|
||||
const gchar *title);
|
||||
void (*gtk_window_set_type_hint) (GtkWindow *window,
|
||||
GdkWindowTypeHint hint);
|
||||
void (*gtk_window_set_default) (GtkWindow *window,
|
||||
GtkWidget *default_widget);
|
||||
|
||||
// gunicode.h
|
||||
gint (*g_utf8_collate) (const gchar *str1,
|
||||
const gchar *str2);
|
||||
|
||||
};
|
||||
extern struct _dynamicgtksyms dynamicgtksyms;
|
||||
|
||||
int32_t dynamicgtk_init(void);
|
||||
void dynamicgtk_uninit(void);
|
||||
|
||||
#ifndef __dynamicgtkfoo__
|
||||
|
||||
// glib.h
|
||||
#define g_free dynamicgtksyms.g_free
|
||||
|
||||
// gobject.h
|
||||
#define g_object_get_data dynamicgtksyms.g_object_get_data
|
||||
#define g_object_set_data dynamicgtksyms.g_object_set_data
|
||||
#define g_object_set_data_full dynamicgtksyms.g_object_set_data_full
|
||||
#define g_object_unref dynamicgtksyms.g_object_unref
|
||||
|
||||
// gsignal.h
|
||||
#define g_signal_connect_data dynamicgtksyms.g_signal_connect_data
|
||||
#define g_signal_handlers_block_matched dynamicgtksyms.g_signal_handlers_block_matched
|
||||
#define g_signal_handlers_unblock_matched dynamicgtksyms.g_signal_handlers_unblock_matched
|
||||
|
||||
// gtype.h
|
||||
#define g_type_check_instance_cast dynamicgtksyms.g_type_check_instance_cast
|
||||
|
||||
// gdk-pixdata.h
|
||||
#define gdk_pixbuf_from_pixdata dynamicgtksyms.gdk_pixbuf_from_pixdata
|
||||
|
||||
// gdk-pixbuf-core.h
|
||||
#define gdk_pixbuf_new_from_data dynamicgtksyms.gdk_pixbuf_new_from_data
|
||||
|
||||
// gtkaccelgroup.h
|
||||
#define gtk_accel_group_new dynamicgtksyms.gtk_accel_group_new
|
||||
|
||||
// gtkalignment.h
|
||||
#define gtk_alignment_new dynamicgtksyms.gtk_alignment_new
|
||||
|
||||
// gtkbox.h
|
||||
#define gtk_box_get_type dynamicgtksyms.gtk_box_get_type
|
||||
#define gtk_box_pack_start dynamicgtksyms.gtk_box_pack_start
|
||||
|
||||
// gtkbbox.h
|
||||
#define gtk_button_box_get_type dynamicgtksyms.gtk_button_box_get_type
|
||||
#define gtk_button_box_set_layout dynamicgtksyms.gtk_button_box_set_layout
|
||||
|
||||
// gtkbutton.h
|
||||
#define gtk_button_new dynamicgtksyms.gtk_button_new
|
||||
|
||||
// gtkcelllayout.h
|
||||
#define gtk_cell_layout_get_type dynamicgtksyms.gtk_cell_layout_get_type
|
||||
#define gtk_cell_layout_pack_start dynamicgtksyms.gtk_cell_layout_pack_start
|
||||
#define gtk_cell_layout_set_attributes dynamicgtksyms.gtk_cell_layout_set_attributes
|
||||
|
||||
// gtkcellrenderertext.h
|
||||
#define gtk_cell_renderer_text_new dynamicgtksyms.gtk_cell_renderer_text_new
|
||||
|
||||
// gtkcheckbutton.h
|
||||
#define gtk_check_button_new_with_mnemonic dynamicgtksyms.gtk_check_button_new_with_mnemonic
|
||||
|
||||
// gtkcombobox.h
|
||||
#define gtk_combo_box_get_active dynamicgtksyms.gtk_combo_box_get_active
|
||||
#define gtk_combo_box_get_active_iter dynamicgtksyms.gtk_combo_box_get_active_iter
|
||||
#define gtk_combo_box_get_active_text dynamicgtksyms.gtk_combo_box_get_active_text
|
||||
#define gtk_combo_box_get_model dynamicgtksyms.gtk_combo_box_get_model
|
||||
#define gtk_combo_box_get_type dynamicgtksyms.gtk_combo_box_get_type
|
||||
#define gtk_combo_box_new_text dynamicgtksyms.gtk_combo_box_new_text
|
||||
#define gtk_combo_box_new_with_model dynamicgtksyms.gtk_combo_box_new_with_model
|
||||
#define gtk_combo_box_set_active dynamicgtksyms.gtk_combo_box_set_active
|
||||
#define gtk_combo_box_set_active_iter dynamicgtksyms.gtk_combo_box_set_active_iter
|
||||
|
||||
// gtkcontainer.h
|
||||
#define gtk_container_add dynamicgtksyms.gtk_container_add
|
||||
#define gtk_container_foreach dynamicgtksyms.gtk_container_foreach
|
||||
#define gtk_container_get_type dynamicgtksyms.gtk_container_get_type
|
||||
#define gtk_container_set_border_width dynamicgtksyms.gtk_container_set_border_width
|
||||
|
||||
// gtkdialog.h
|
||||
#define gtk_dialog_get_type dynamicgtksyms.gtk_dialog_get_type
|
||||
#define gtk_dialog_run dynamicgtksyms.gtk_dialog_run
|
||||
|
||||
// gtkhbox.h
|
||||
#define gtk_hbox_new dynamicgtksyms.gtk_hbox_new
|
||||
|
||||
// gtkhbbox.h
|
||||
#define gtk_hbutton_box_new dynamicgtksyms.gtk_hbutton_box_new
|
||||
|
||||
// gtkimage.h
|
||||
#define gtk_image_new_from_pixbuf dynamicgtksyms.gtk_image_new_from_pixbuf
|
||||
#define gtk_image_new_from_stock dynamicgtksyms.gtk_image_new_from_stock
|
||||
|
||||
// gtkmain.h
|
||||
#define gtk_init_check dynamicgtksyms.gtk_init_check
|
||||
|
||||
// gtklabel.h
|
||||
#define gtk_label_get_type dynamicgtksyms.gtk_label_get_type
|
||||
#define gtk_label_new dynamicgtksyms.gtk_label_new
|
||||
#define gtk_label_new_with_mnemonic dynamicgtksyms.gtk_label_new_with_mnemonic
|
||||
#define gtk_label_set_mnemonic_widget dynamicgtksyms.gtk_label_set_mnemonic_widget
|
||||
|
||||
// gtkliststore.h
|
||||
#define gtk_list_store_append dynamicgtksyms.gtk_list_store_append
|
||||
#define gtk_list_store_clear dynamicgtksyms.gtk_list_store_clear
|
||||
#define gtk_list_store_get_type dynamicgtksyms.gtk_list_store_get_type
|
||||
#define gtk_list_store_new dynamicgtksyms.gtk_list_store_new
|
||||
#define gtk_list_store_set dynamicgtksyms.gtk_list_store_set
|
||||
|
||||
// gtkmain.h
|
||||
#define gtk_main dynamicgtksyms.gtk_main
|
||||
#define gtk_main_iteration_do dynamicgtksyms.gtk_main_iteration_do
|
||||
#define gtk_main_quit dynamicgtksyms.gtk_main_quit
|
||||
|
||||
// gtkmessagedialog.h
|
||||
#define gtk_message_dialog_new dynamicgtksyms.gtk_message_dialog_new
|
||||
|
||||
// gtkmisc.h
|
||||
#define gtk_misc_get_type dynamicgtksyms.gtk_misc_get_type
|
||||
#define gtk_misc_set_alignment dynamicgtksyms.gtk_misc_set_alignment
|
||||
|
||||
// gtknotebook.h
|
||||
#define gtk_notebook_get_nth_page dynamicgtksyms.gtk_notebook_get_nth_page
|
||||
#define gtk_notebook_get_type dynamicgtksyms.gtk_notebook_get_type
|
||||
#define gtk_notebook_new dynamicgtksyms.gtk_notebook_new
|
||||
#define gtk_notebook_set_current_page dynamicgtksyms.gtk_notebook_set_current_page
|
||||
#define gtk_notebook_set_tab_label dynamicgtksyms.gtk_notebook_set_tab_label
|
||||
|
||||
// gtkobject.h
|
||||
#define gtk_object_get_type dynamicgtksyms.gtk_object_get_type
|
||||
|
||||
// gtkscrolledwindow.h
|
||||
#define gtk_scrolled_window_get_type dynamicgtksyms.gtk_scrolled_window_get_type
|
||||
#define gtk_scrolled_window_new dynamicgtksyms.gtk_scrolled_window_new
|
||||
#define gtk_scrolled_window_set_policy dynamicgtksyms.gtk_scrolled_window_set_policy
|
||||
#define gtk_scrolled_window_set_shadow_type dynamicgtksyms.gtk_scrolled_window_set_shadow_type
|
||||
|
||||
// gtktable.h
|
||||
#define gtk_table_get_type dynamicgtksyms.gtk_table_get_type
|
||||
#define gtk_table_new dynamicgtksyms.gtk_table_new
|
||||
#define gtk_table_attach dynamicgtksyms.gtk_table_attach
|
||||
|
||||
// gtktextbuffer.h
|
||||
#define gtk_text_buffer_backspace dynamicgtksyms.gtk_text_buffer_backspace
|
||||
#define gtk_text_buffer_create_mark dynamicgtksyms.gtk_text_buffer_create_mark
|
||||
#define gtk_text_buffer_delete_mark dynamicgtksyms.gtk_text_buffer_delete_mark
|
||||
#define gtk_text_buffer_get_end_iter dynamicgtksyms.gtk_text_buffer_get_end_iter
|
||||
#define gtk_text_buffer_insert dynamicgtksyms.gtk_text_buffer_insert
|
||||
|
||||
// gtktextiter.h
|
||||
#define gtk_text_iter_backward_cursor_position dynamicgtksyms.gtk_text_iter_backward_cursor_position
|
||||
#define gtk_text_iter_equal dynamicgtksyms.gtk_text_iter_equal
|
||||
#define gtk_text_buffer_delete_interactive dynamicgtksyms.gtk_text_buffer_delete_interactive
|
||||
|
||||
// gtktextview.h
|
||||
#define gtk_text_view_get_buffer dynamicgtksyms.gtk_text_view_get_buffer
|
||||
#define gtk_text_view_get_type dynamicgtksyms.gtk_text_view_get_type
|
||||
#define gtk_text_view_new dynamicgtksyms.gtk_text_view_new
|
||||
#define gtk_text_view_scroll_to_mark dynamicgtksyms.gtk_text_view_scroll_to_mark
|
||||
#define gtk_text_view_set_cursor_visible dynamicgtksyms.gtk_text_view_set_cursor_visible
|
||||
#define gtk_text_view_set_editable dynamicgtksyms.gtk_text_view_set_editable
|
||||
#define gtk_text_view_set_left_margin dynamicgtksyms.gtk_text_view_set_left_margin
|
||||
#define gtk_text_view_set_right_margin dynamicgtksyms.gtk_text_view_set_right_margin
|
||||
#define gtk_text_view_set_wrap_mode dynamicgtksyms.gtk_text_view_set_wrap_mode
|
||||
|
||||
// gtktogglebutton.h
|
||||
#define gtk_toggle_button_get_active dynamicgtksyms.gtk_toggle_button_get_active
|
||||
#define gtk_toggle_button_get_type dynamicgtksyms.gtk_toggle_button_get_type
|
||||
#define gtk_toggle_button_set_active dynamicgtksyms.gtk_toggle_button_set_active
|
||||
|
||||
// gtktreemodel.h
|
||||
#define gtk_tree_model_get dynamicgtksyms.gtk_tree_model_get
|
||||
#define gtk_tree_model_get_iter dynamicgtksyms.gtk_tree_model_get_iter
|
||||
#define gtk_tree_model_get_path dynamicgtksyms.gtk_tree_model_get_path
|
||||
#define gtk_tree_model_get_type dynamicgtksyms.gtk_tree_model_get_type
|
||||
#define gtk_tree_path_get_indices dynamicgtksyms.gtk_tree_path_get_indices
|
||||
#define gtk_tree_path_new_from_indices dynamicgtksyms.gtk_tree_path_new_from_indices
|
||||
|
||||
// gtktreeselection.h
|
||||
#define gtk_tree_selection_get_selected dynamicgtksyms.gtk_tree_selection_get_selected
|
||||
#define gtk_tree_selection_select_iter dynamicgtksyms.gtk_tree_selection_select_iter
|
||||
#define gtk_tree_selection_set_mode dynamicgtksyms.gtk_tree_selection_set_mode
|
||||
|
||||
// gtktreesortable.h
|
||||
#define gtk_tree_sortable_get_type dynamicgtksyms.gtk_tree_sortable_get_type
|
||||
#define gtk_tree_sortable_set_sort_column_id dynamicgtksyms.gtk_tree_sortable_set_sort_column_id
|
||||
#define gtk_tree_sortable_set_sort_func dynamicgtksyms.gtk_tree_sortable_set_sort_func
|
||||
|
||||
// gtktreeview.h
|
||||
#define gtk_tree_view_append_column dynamicgtksyms.gtk_tree_view_append_column
|
||||
#define gtk_tree_view_get_model dynamicgtksyms.gtk_tree_view_get_model
|
||||
#define gtk_tree_view_get_selection dynamicgtksyms.gtk_tree_view_get_selection
|
||||
#define gtk_tree_view_get_type dynamicgtksyms.gtk_tree_view_get_type
|
||||
#define gtk_tree_view_new_with_model dynamicgtksyms.gtk_tree_view_new_with_model
|
||||
#define gtk_tree_view_set_enable_search dynamicgtksyms.gtk_tree_view_set_enable_search
|
||||
#define gtk_tree_view_set_headers_visible dynamicgtksyms.gtk_tree_view_set_headers_visible
|
||||
|
||||
// gtktreeviewcolumn.h
|
||||
#define gtk_tree_view_column_new_with_attributes dynamicgtksyms.gtk_tree_view_column_new_with_attributes
|
||||
#define gtk_tree_view_column_set_expand dynamicgtksyms.gtk_tree_view_column_set_expand
|
||||
#define gtk_tree_view_column_set_min_width dynamicgtksyms.gtk_tree_view_column_set_min_width
|
||||
|
||||
|
||||
// gtkvbox.h
|
||||
#define gtk_vbox_new dynamicgtksyms.gtk_vbox_new
|
||||
|
||||
// gtkwidget.h
|
||||
#define gtk_widget_add_accelerator dynamicgtksyms.gtk_widget_add_accelerator
|
||||
#define gtk_widget_destroy dynamicgtksyms.gtk_widget_destroy
|
||||
#define gtk_widget_ref dynamicgtksyms.gtk_widget_ref
|
||||
#define gtk_widget_set_sensitive dynamicgtksyms.gtk_widget_set_sensitive
|
||||
#define gtk_widget_set_size_request dynamicgtksyms.gtk_widget_set_size_request
|
||||
#define gtk_widget_show_all dynamicgtksyms.gtk_widget_show_all
|
||||
#define gtk_widget_unref dynamicgtksyms.gtk_widget_unref
|
||||
|
||||
// gtkwindow.h
|
||||
#define gtk_window_add_accel_group dynamicgtksyms.gtk_window_add_accel_group
|
||||
#define gtk_window_get_type dynamicgtksyms.gtk_window_get_type
|
||||
#define gtk_window_new dynamicgtksyms.gtk_window_new
|
||||
#define gtk_window_set_default_icon dynamicgtksyms.gtk_window_set_default_icon
|
||||
#define gtk_window_set_position dynamicgtksyms.gtk_window_set_position
|
||||
#define gtk_window_set_resizable dynamicgtksyms.gtk_window_set_resizable
|
||||
#define gtk_window_set_title dynamicgtksyms.gtk_window_set_title
|
||||
#define gtk_window_set_type_hint dynamicgtksyms.gtk_window_set_type_hint
|
||||
#define gtk_window_set_default dynamicgtksyms.gtk_window_set_default
|
||||
|
||||
// gunicode.h
|
||||
#define g_utf8_collate dynamicgtksyms.g_utf8_collate
|
||||
|
||||
#endif /* __dynamicgtkfoo__ */
|
||||
|
||||
#endif /* LINKED_GTK */
|
||||
|
||||
#endif /* __dynamicgtk_h__ */
|
||||
|
|
@ -1,229 +0,0 @@
|
|||
// "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman
|
||||
// Ken Silverman's official web site: "http://www.advsys.net/ken"
|
||||
// See the included license file "BUILDLIC.TXT" for license info.
|
||||
|
||||
#ifndef __editor_h__
|
||||
#define __editor_h__
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define VERSION "2.0.0devel"
|
||||
|
||||
// Build keys
|
||||
#define BK_MOVEFORWARD 0
|
||||
#define BK_MOVEBACKWARD 1
|
||||
#define BK_TURNLEFT 2
|
||||
#define BK_TURNRIGHT 3
|
||||
#define BK_RUN 4
|
||||
#define BK_STRAFE 5
|
||||
#define BK_SHOOT 6
|
||||
#define BK_OPEN 7
|
||||
#define BK_MOVEUP 8
|
||||
#define BK_MOVEDOWN 9
|
||||
#define BK_LOOKUP 10
|
||||
#define BK_LOOKDOWN 11
|
||||
#define BK_STRAFELEFT 12
|
||||
#define BK_STRAFERIGHT 13
|
||||
#define BK_MODE2D_3D 14
|
||||
#define BK_PLAYERVIEW 15
|
||||
#define BK_ZOOMIN 16
|
||||
#define BK_ZOOMOUT 17
|
||||
#define BK_MESSAGE 18
|
||||
#define BK_CONSOLE 19
|
||||
#define NUMBUILDKEYS 20
|
||||
|
||||
extern int32_t qsetmode;
|
||||
extern int16_t searchsector, searchwall, searchstat;
|
||||
extern int16_t searchbottomwall;
|
||||
extern int32_t zmode, kensplayerheight, zlock;
|
||||
|
||||
#define DEFAULT_SPRITE_CSTAT 0
|
||||
//extern int16_t defaultspritecstat;
|
||||
|
||||
extern int32_t temppicnum, tempcstat, templotag, temphitag, tempextra;
|
||||
extern uint32_t temppal, tempvis, tempxrepeat, tempyrepeat;
|
||||
extern int32_t tempshade, tempxvel, tempyvel, tempzvel;
|
||||
extern char somethingintab;
|
||||
|
||||
extern uint8_t buildkeys[NUMBUILDKEYS];
|
||||
|
||||
extern double vid_gamma_3d, vid_contrast_3d, vid_brightness_3d;
|
||||
|
||||
extern int32_t ydim16, xdimgame, ydimgame, bppgame, xdim2d, ydim2d, forcesetup;
|
||||
extern int32_t unrealedlook, quickmapcycling;
|
||||
extern int32_t pk_turnaccel,pk_turndecel,pk_uedaccel;
|
||||
extern int32_t revertCTRL,scrollamount;
|
||||
extern int32_t autosave;
|
||||
extern int32_t mlook;
|
||||
extern int16_t prefixtiles[16];
|
||||
|
||||
extern char program_origcwd[BMAX_PATH];
|
||||
extern char *mapster32_fullpath;
|
||||
extern char *testplay_addparam;
|
||||
extern const char *g_namesFileName;
|
||||
|
||||
extern int32_t m32_osd_tryscript;
|
||||
extern int32_t showheightindicators;
|
||||
extern int32_t showambiencesounds;
|
||||
|
||||
// editor side view
|
||||
extern int32_t m32_sideview;
|
||||
extern int32_t m32_sideelev;
|
||||
extern int16_t m32_sideang;
|
||||
extern int32_t m32_sidecos, m32_sidesin;
|
||||
extern int32_t m32_swcnt;
|
||||
extern int16_t *m32_wallsprite;
|
||||
extern int8_t sideview_reversehrot;
|
||||
extern inline int32_t scalescreeny(int32_t sy);
|
||||
extern void screencoords(int32_t *xres, int32_t *yres, int32_t x, int32_t y, int32_t zoome) ATTRIBUTE((nonnull));
|
||||
//extern void invscreencoords(int32_t *dx, int32_t *dy, int32_t sx, int32_t sy, int32_t zoome);
|
||||
extern int32_t getinvdisplacement(int32_t *dx, int32_t *dy, int32_t dz) ATTRIBUTE((nonnull));
|
||||
extern inline int32_t getscreenvdisp(int32_t bz, int32_t zoome);
|
||||
extern void setup_sideview_sincos(void);
|
||||
extern void m32_setkeyfilter(int32_t on);
|
||||
|
||||
extern int32_t wallength(int16_t i);
|
||||
extern void fixrepeats(int16_t i);
|
||||
extern void fixxrepeat(int16_t i, uint32_t lenrepquot);
|
||||
|
||||
extern int32_t ExtInit(void);
|
||||
extern int32_t ExtPreInit(int32_t argc,const char **argv);
|
||||
extern void ExtUnInit(void);
|
||||
extern void ExtPreCheckKeys(void);
|
||||
extern void ExtAnalyzeSprites(void);
|
||||
extern void ExtCheckKeys(void);
|
||||
extern void ExtPreLoadMap(void);
|
||||
extern void ExtLoadMap(const char *mapname);
|
||||
extern void ExtPreSaveMap(void);
|
||||
extern void ExtSaveMap(const char *mapname);
|
||||
extern const char *ExtGetSectorCaption(int16_t sectnum);
|
||||
extern const char *ExtGetWallCaption(int16_t wallnum);
|
||||
extern const char *ExtGetSpriteCaption(int16_t spritenum);
|
||||
extern void ExtShowSectorData(int16_t sectnum);
|
||||
extern void ExtShowWallData(int16_t wallnum);
|
||||
extern void ExtShowSpriteData(int16_t spritenum);
|
||||
extern void ExtEditSectorData(int16_t sectnum);
|
||||
extern void ExtEditWallData(int16_t wallnum);
|
||||
extern void ExtEditSpriteData(int16_t spritenum);
|
||||
extern const char *ExtGetSectorType(int32_t lotag);
|
||||
|
||||
extern int32_t LoadBoard(const char *filename, uint32_t flags);
|
||||
extern const char *SaveBoard(const char *fn, uint32_t flags);
|
||||
|
||||
#define CORRUPT_SECTOR (1<<17)
|
||||
#define CORRUPT_WALL (1<<18)
|
||||
#define CORRUPT_SPRITE (1<<19)
|
||||
#define CORRUPT_MASK (CORRUPT_SECTOR|CORRUPT_WALL|CORRUPT_SPRITE)
|
||||
#define MAXCORRUPTTHINGS 64
|
||||
extern int32_t corruptlevel, numcorruptthings, corruptthings[MAXCORRUPTTHINGS];
|
||||
extern int32_t autocorruptcheck;
|
||||
extern int32_t CheckMapCorruption(int32_t printfromlev, uint64_t tryfixing);
|
||||
|
||||
extern void showsectordata(int16_t sectnum, int16_t small);
|
||||
extern void showwalldata(int16_t wallnum, int16_t small);
|
||||
extern void showspritedata(int16_t spritenum, int16_t small);
|
||||
|
||||
extern void drawsmallabel(const char *text, char col, char backcol, int32_t dax, int32_t day, int32_t daz);
|
||||
|
||||
extern int32_t circlewall;
|
||||
|
||||
int32_t loadsetup(const char *fn); // from config.c
|
||||
int32_t writesetup(const char *fn); // from config.c
|
||||
|
||||
void editinput(void);
|
||||
void clearmidstatbar16(void);
|
||||
|
||||
int32_t _getnumber256(const char *namestart, int32_t num, int32_t maxnumber, char sign, void *(func)(int32_t));
|
||||
#define getnumber256(namestart, num, maxnumber, sign) _getnumber256(namestart, num, maxnumber, sign, NULL)
|
||||
int32_t _getnumber16(const char *namestart, int32_t num, int32_t maxnumber, char sign, void *(func)(int32_t));
|
||||
#define getnumber16(namestart, num, maxnumber, sign) _getnumber16(namestart, num, maxnumber, sign, NULL)
|
||||
void printmessage256(int32_t x, int32_t y, const char *name);
|
||||
void message(const char *fmt, ...) ATTRIBUTE((format(printf,1,2)));
|
||||
|
||||
// currently only for 3d mode
|
||||
const char* getstring_simple(const char *querystr, const char *defaultstr, int32_t maxlen);
|
||||
|
||||
// like snprintf, but pads the output buffer with 'fill' at the end
|
||||
//int32_t snfillprintf(char *outbuf, size_t bufsiz, int32_t fill, const char *fmt, ...);
|
||||
void _printmessage16(const char *fmt, ...) ATTRIBUTE((format(printf,1,2)));
|
||||
|
||||
extern int32_t lastpm16time;
|
||||
#define printmessage16(fmt, ...) lastpm16time = totalclock, _printmessage16(fmt, ## __VA_ARGS__)
|
||||
|
||||
extern char lastpm16buf[156];
|
||||
|
||||
void DoSpriteOrnament(int32_t i);
|
||||
|
||||
void getpoint(int32_t searchxe, int32_t searchye, int32_t *x, int32_t *y);
|
||||
int32_t getpointhighlight(int32_t xplc, int32_t yplc, int32_t point);
|
||||
void update_highlight();
|
||||
void update_highlightsector();
|
||||
|
||||
int32_t inside_editor(const vec3_t *pos, int32_t searchx, int32_t searchy, int32_t zoom,
|
||||
int32_t x, int32_t y, int16_t sectnum);
|
||||
void correct_sprite_yoffset(int32_t i);
|
||||
|
||||
extern uint8_t hlsectorbitmap[MAXSECTORS>>3];
|
||||
|
||||
#ifdef _WIN32
|
||||
#define DEFAULT_GAME_EXEC "eduke32.exe"
|
||||
#define DEFAULT_GAME_LOCAL_EXEC "eduke32.exe"
|
||||
#else
|
||||
#define DEFAULT_GAME_EXEC "eduke32"
|
||||
#define DEFAULT_GAME_LOCAL_EXEC "./eduke32"
|
||||
#endif
|
||||
|
||||
void test_map(int32_t mode);
|
||||
|
||||
|
||||
#define NEXTWALL(i) (wall[wall[i].nextwall])
|
||||
#define POINT2(i) (wall[wall[i].point2])
|
||||
#define SPRITESEC(j) (sector[sprite[j].sectnum])
|
||||
|
||||
#define CLEARLINES2D(Startline, Numlines, Color) clearbuf((char *)(frameplace + ((Startline)*bytesperline)), (bytesperline*(Numlines))>>2, (Color))
|
||||
|
||||
#define SCRIPTHISTSIZ 32 // should be the same as OSD_HISTORYDEPTH for maximum win, should be a power of two
|
||||
extern const char *scripthist[SCRIPTHISTSIZ];
|
||||
extern int32_t scripthistend;
|
||||
|
||||
//////////////////// Aiming ////////////////////
|
||||
#define SEARCH_WALL 0
|
||||
#define SEARCH_CEILING 1
|
||||
#define SEARCH_FLOOR 2
|
||||
#define SEARCH_SPRITE 3
|
||||
#define SEARCH_MASKWALL 4
|
||||
|
||||
#define ASSERT_AIMING (searchstat>=0 && searchstat<=4)
|
||||
|
||||
#define AIMING_AT_WALL (searchstat==0)
|
||||
#define AIMING_AT_CEILING (searchstat==1)
|
||||
#define AIMING_AT_FLOOR (searchstat==2)
|
||||
#define AIMING_AT_SPRITE (searchstat==3)
|
||||
#define AIMING_AT_MASKWALL (searchstat==4)
|
||||
|
||||
#define AIMING_AT_WALL_OR_MASK (AIMING_AT_WALL || AIMING_AT_MASKWALL)
|
||||
#define AIMING_AT_CEILING_OR_FLOOR (AIMING_AT_CEILING || AIMING_AT_FLOOR)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
// showdebug is now used as a general informational on-screen display
|
||||
#define M32_SHOWDEBUG
|
||||
|
||||
// this should be only used if there's no dependency on endwall after the loop.
|
||||
// of course, users of this macro should know that it modifies startwall and endwall.
|
||||
#define WALLS_OF_SECTOR(Sect, Itervar) \
|
||||
startwall=sector[(Sect)].wallptr, endwall=startwall+sector[(Sect)].wallnum, Itervar=startwall; \
|
||||
Itervar < endwall; \
|
||||
Itervar++
|
||||
|
||||
#define BTAG_MAX 65535
|
||||
#define BZ_MAX 8388608
|
||||
|
||||
|
||||
#endif
|
|
@ -1,328 +0,0 @@
|
|||
#ifdef USE_OPENGL
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
# include <OpenGL/gl.h>
|
||||
# include <OpenGL/glu.h>
|
||||
#else
|
||||
# include <GL/gl.h>
|
||||
# include <GL/glu.h>
|
||||
#endif
|
||||
|
||||
// get this header from http://oss.sgi.com/projects/ogl-sample/registry/
|
||||
// if you are missing it
|
||||
//#include <GL/glext.h>
|
||||
#if defined(__APPLE__)
|
||||
# include <OpenGL/glext.h>
|
||||
#else
|
||||
# include "glext.h"
|
||||
#endif
|
||||
|
||||
#ifndef GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
|
||||
#error You should get an updated copy of glext.h from http://oss.sgi.com/projects/ogl-sample/registry/
|
||||
#endif
|
||||
|
||||
#ifndef APIENTRY
|
||||
# define APIENTRY
|
||||
#endif
|
||||
|
||||
# ifdef _WIN32
|
||||
# define PR_CALLBACK __stdcall
|
||||
# else
|
||||
# define PR_CALLBACK
|
||||
# endif
|
||||
|
||||
// those defines are somehow missing from glext.h
|
||||
#define GL_FRAMEBUFFER_EXT 0x8D40
|
||||
#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
|
||||
#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
|
||||
#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
|
||||
|
||||
#define GL_TEXTURE_RECTANGLE 0x84F5
|
||||
|
||||
extern void (APIENTRY * bglClearColor)( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha );
|
||||
extern void (APIENTRY * bglClear)( GLbitfield mask );
|
||||
extern void (APIENTRY * bglColorMask)( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha );
|
||||
extern void (APIENTRY * bglAlphaFunc)( GLenum func, GLclampf ref );
|
||||
extern void (APIENTRY * bglBlendFunc)( GLenum sfactor, GLenum dfactor );
|
||||
extern void (APIENTRY * bglCullFace)( GLenum mode );
|
||||
extern void (APIENTRY * bglFrontFace)( GLenum mode );
|
||||
extern void (APIENTRY * bglPolygonOffset)( GLfloat factor, GLfloat units );
|
||||
extern void (APIENTRY * bglPolygonMode)( GLenum face, GLenum mode );
|
||||
extern void (APIENTRY * bglEnable)( GLenum cap );
|
||||
extern void (APIENTRY * bglDisable)( GLenum cap );
|
||||
extern void (APIENTRY * bglGetDoublev)( GLenum pname, GLdouble *params );
|
||||
extern void (APIENTRY * bglGetFloatv)( GLenum pname, GLfloat *params );
|
||||
extern void (APIENTRY * bglGetIntegerv)( GLenum pname, GLint *params );
|
||||
extern void (APIENTRY * bglPushAttrib)( GLbitfield mask );
|
||||
extern void (APIENTRY * bglPopAttrib)( void );
|
||||
extern GLenum (APIENTRY * bglGetError)( void );
|
||||
extern const GLubyte* (APIENTRY * bglGetString)( GLenum name );
|
||||
extern void (APIENTRY * bglHint)( GLenum target, GLenum mode );
|
||||
extern void (APIENTRY * bglDrawBuffer)(GLenum mode);
|
||||
extern void (APIENTRY * bglReadBuffer)(GLenum mode);
|
||||
extern void (APIENTRY * bglScissor)(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
extern void (APIENTRY * bglClipPlane)(GLenum plane, const GLdouble *equation);
|
||||
|
||||
// Depth
|
||||
extern void (APIENTRY * bglDepthFunc)( GLenum func );
|
||||
extern void (APIENTRY * bglDepthMask)( GLboolean flag );
|
||||
extern void (APIENTRY * bglDepthRange)( GLclampd near_val, GLclampd far_val );
|
||||
|
||||
// Matrix
|
||||
extern void (APIENTRY * bglMatrixMode)( GLenum mode );
|
||||
extern void (APIENTRY * bglOrtho)( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val );
|
||||
extern void (APIENTRY * bglFrustum)( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val );
|
||||
extern void (APIENTRY * bglViewport)( GLint x, GLint y, GLsizei width, GLsizei height );
|
||||
extern void (APIENTRY * bglPushMatrix)( void );
|
||||
extern void (APIENTRY * bglPopMatrix)( void );
|
||||
extern void (APIENTRY * bglLoadIdentity)( void );
|
||||
extern void (APIENTRY * bglLoadMatrixf)( const GLfloat *m );
|
||||
extern void (APIENTRY * bglLoadMatrixd)( const GLdouble *m );
|
||||
extern void (APIENTRY * bglMultMatrixf)( const GLfloat *m );
|
||||
extern void (APIENTRY * bglMultMatrixd)( const GLdouble *m );
|
||||
extern void (APIENTRY * bglRotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
|
||||
extern void (APIENTRY * bglScalef)(GLfloat x, GLfloat y, GLfloat z);
|
||||
extern void (APIENTRY * bglTranslatef)(GLfloat x, GLfloat y, GLfloat z);
|
||||
|
||||
// Drawing
|
||||
extern void (APIENTRY * bglBegin)( GLenum mode );
|
||||
extern void (APIENTRY * bglEnd)( void );
|
||||
extern void (APIENTRY * bglVertex2f)( GLfloat x, GLfloat y );
|
||||
extern void (APIENTRY * bglVertex2i)( GLint x, GLint y );
|
||||
extern void (APIENTRY * bglVertex3f)( GLfloat x, GLfloat y, GLfloat z );
|
||||
extern void (APIENTRY * bglVertex3d)( GLdouble x, GLdouble y, GLdouble z );
|
||||
extern void (APIENTRY * bglVertex3fv)( const GLfloat *v );
|
||||
extern void (APIENTRY * bglVertex3dv)( const GLdouble *v );
|
||||
extern void (APIENTRY * bglColor4f)( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha );
|
||||
extern void (APIENTRY * bglColor4ub)( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
|
||||
extern void (APIENTRY * bglTexCoord2d)( GLdouble s, GLdouble t );
|
||||
extern void (APIENTRY * bglTexCoord2f)( GLfloat s, GLfloat t );
|
||||
extern void (APIENTRY * bglTexCoord2i)( GLint s, GLint t );
|
||||
extern void (APIENTRY * bglNormal3f)( GLfloat x, GLfloat y, GLfloat z );
|
||||
|
||||
// Lighting
|
||||
extern void (APIENTRY * bglShadeModel)( GLenum mode );
|
||||
extern void (APIENTRY * bglLightfv)( GLenum light, GLenum pname, const GLfloat * params );
|
||||
|
||||
// Raster funcs
|
||||
extern void (APIENTRY * bglReadPixels)( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels );
|
||||
extern void (APIENTRY * bglRasterPos4i)( GLint x, GLint y, GLint z, GLint w );
|
||||
extern void (APIENTRY * bglDrawPixels)( GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels );
|
||||
|
||||
// Texture mapping
|
||||
extern void (APIENTRY * bglTexEnvf)( GLenum target, GLenum pname, GLfloat param );
|
||||
extern void (APIENTRY * bglGenTextures)( GLsizei n, GLuint *textures ); // 1.1
|
||||
extern void (APIENTRY * bglDeleteTextures)( GLsizei n, const GLuint *textures); // 1.1
|
||||
extern void (APIENTRY * bglBindTexture)( GLenum target, GLuint texture ); // 1.1
|
||||
extern void (APIENTRY * bglTexImage2D)( GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels );
|
||||
extern void (APIENTRY * bglTexImage3D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
extern void (APIENTRY * bglCopyTexImage2D)( GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border );
|
||||
extern void (APIENTRY * bglCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
extern void (APIENTRY * bglTexSubImage2D)( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ); // 1.1
|
||||
extern void (APIENTRY * bglTexParameterf)( GLenum target, GLenum pname, GLfloat param );
|
||||
extern void (APIENTRY * bglTexParameteri)( GLenum target, GLenum pname, GLint param );
|
||||
extern void (APIENTRY * bglGetTexLevelParameteriv)( GLenum target, GLint level, GLenum pname, GLint *params );
|
||||
extern void (APIENTRY * bglCompressedTexImage2DARB)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
|
||||
extern void (APIENTRY * bglGetCompressedTexImageARB)(GLenum, GLint, GLvoid *);
|
||||
extern void (APIENTRY * bglTexGenfv)(GLenum coord, GLenum pname, const GLfloat *params);
|
||||
|
||||
// Fog
|
||||
extern void (APIENTRY * bglFogf)( GLenum pname, GLfloat param );
|
||||
extern void (APIENTRY * bglFogi)( GLenum pname, GLint param );
|
||||
extern void (APIENTRY * bglFogfv)( GLenum pname, const GLfloat *params );
|
||||
|
||||
// Display Lists
|
||||
extern void (APIENTRY * bglNewList)(GLuint list, GLenum mode);
|
||||
extern void (APIENTRY * bglEndList)(void);
|
||||
extern void (APIENTRY * bglCallList)(GLuint list);
|
||||
extern void (APIENTRY * bglDeleteLists)(GLuint list, GLsizei range);
|
||||
|
||||
// Vertex Arrays
|
||||
extern void (APIENTRY * bglEnableClientState)(GLenum cap);
|
||||
extern void (APIENTRY * bglDisableClientState)(GLenum cap);
|
||||
extern void (APIENTRY * bglVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
extern void (APIENTRY * bglNormalPointer)(GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
extern void (APIENTRY * bglTexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
extern void (APIENTRY * bglDrawArrays)(GLenum mode, GLint first, GLsizei count);
|
||||
extern void (APIENTRY * bglDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
|
||||
|
||||
// Stencil Buffer
|
||||
extern void (APIENTRY * bglClearStencil)(GLint s);
|
||||
extern void (APIENTRY * bglStencilOp)(GLenum fail, GLenum zfail, GLenum zpass);
|
||||
extern void (APIENTRY * bglStencilFunc)(GLenum func, GLint ref, GLuint mask);
|
||||
|
||||
// GPU Programs
|
||||
extern void (APIENTRY * bglGenProgramsARB)(GLsizei, GLuint *);
|
||||
extern void (APIENTRY * bglBindProgramARB)(GLenum, GLuint);
|
||||
extern void (APIENTRY * bglProgramStringARB)(GLenum, GLenum, GLsizei, const GLvoid *);
|
||||
extern void (APIENTRY * bglDeleteProgramsARB)(GLsizei n, const GLuint *programs);
|
||||
|
||||
// Multitexturing
|
||||
extern void (APIENTRY * bglActiveTextureARB)(GLenum texture);
|
||||
extern void (APIENTRY * bglClientActiveTextureARB)(GLenum texture);
|
||||
extern void (APIENTRY * bglMultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t );
|
||||
extern void (APIENTRY * bglMultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t );
|
||||
|
||||
// Frame Buffer Objects
|
||||
extern void (APIENTRY * bglGenFramebuffersEXT)(GLsizei n, GLuint *framebuffers);
|
||||
extern void (APIENTRY * bglBindFramebufferEXT)(GLenum target, GLuint framebuffer);
|
||||
extern void (APIENTRY * bglFramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
extern GLenum (APIENTRY * bglCheckFramebufferStatusEXT)(GLenum target);
|
||||
extern void (APIENTRY * bglDeleteFramebuffersEXT)(GLsizei n, const GLuint *framebuffers);
|
||||
|
||||
// Vertex Buffer Objects
|
||||
extern void (APIENTRY * bglGenBuffersARB)(GLsizei n, GLuint * buffers);
|
||||
extern void (APIENTRY * bglBindBufferARB)(GLenum target, GLuint buffer);
|
||||
extern void (APIENTRY * bglDeleteBuffersARB)(GLsizei n, const GLuint * buffers);
|
||||
extern void (APIENTRY * bglBufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage);
|
||||
extern void (APIENTRY * bglBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data);
|
||||
extern void* (APIENTRY * bglMapBufferARB)(GLenum target, GLenum access);
|
||||
extern GLboolean (APIENTRY * bglUnmapBufferARB)(GLenum target);
|
||||
|
||||
// Occlusion queries
|
||||
extern void (APIENTRY * bglGenQueriesARB)(GLsizei n, GLuint *ids);
|
||||
extern void (APIENTRY * bglDeleteQueriesARB)(GLsizei n, const GLuint *ids);
|
||||
extern GLboolean (APIENTRY * bglIsQueryARB)(GLuint id);
|
||||
extern void (APIENTRY * bglBeginQueryARB)(GLenum target, GLuint id);
|
||||
extern void (APIENTRY * bglEndQueryARB)(GLenum target);
|
||||
extern void (APIENTRY * bglGetQueryivARB)(GLenum target, GLenum pname, GLint *params);
|
||||
extern void (APIENTRY * bglGetQueryObjectivARB)(GLuint id, GLenum pname, GLint *params);
|
||||
extern void (APIENTRY * bglGetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint *params);
|
||||
|
||||
// Shader Objects
|
||||
extern void (APIENTRY * bglDeleteObjectARB)(GLhandleARB);
|
||||
extern GLhandleARB (APIENTRY * bglGetHandleARB)(GLenum);
|
||||
extern void (APIENTRY * bglDetachObjectARB)(GLhandleARB, GLhandleARB);
|
||||
extern GLhandleARB (APIENTRY * bglCreateShaderObjectARB)(GLenum);
|
||||
extern void (APIENTRY * bglShaderSourceARB)(GLhandleARB, GLsizei, const GLcharARB* *, const GLint *);
|
||||
extern void (APIENTRY * bglCompileShaderARB)(GLhandleARB);
|
||||
extern GLhandleARB (APIENTRY * bglCreateProgramObjectARB)(void);
|
||||
extern void (APIENTRY * bglAttachObjectARB)(GLhandleARB, GLhandleARB);
|
||||
extern void (APIENTRY * bglLinkProgramARB)(GLhandleARB);
|
||||
extern void (APIENTRY * bglUseProgramObjectARB)(GLhandleARB);
|
||||
extern void (APIENTRY * bglValidateProgramARB)(GLhandleARB);
|
||||
extern void (APIENTRY * bglUniform1fARB)(GLint, GLfloat);
|
||||
extern void (APIENTRY * bglUniform2fARB)(GLint, GLfloat, GLfloat);
|
||||
extern void (APIENTRY * bglUniform3fARB)(GLint, GLfloat, GLfloat, GLfloat);
|
||||
extern void (APIENTRY * bglUniform4fARB)(GLint, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
extern void (APIENTRY * bglUniform1iARB)(GLint, GLint);
|
||||
extern void (APIENTRY * bglUniform2iARB)(GLint, GLint, GLint);
|
||||
extern void (APIENTRY * bglUniform3iARB)(GLint, GLint, GLint, GLint);
|
||||
extern void (APIENTRY * bglUniform4iARB)(GLint, GLint, GLint, GLint, GLint);
|
||||
extern void (APIENTRY * bglUniform1fvARB)(GLint, GLsizei, const GLfloat *);
|
||||
extern void (APIENTRY * bglUniform2fvARB)(GLint, GLsizei, const GLfloat *);
|
||||
extern void (APIENTRY * bglUniform3fvARB)(GLint, GLsizei, const GLfloat *);
|
||||
extern void (APIENTRY * bglUniform4fvARB)(GLint, GLsizei, const GLfloat *);
|
||||
extern void (APIENTRY * bglUniform1ivARB)(GLint, GLsizei, const GLint *);
|
||||
extern void (APIENTRY * bglUniform2ivARB)(GLint, GLsizei, const GLint *);
|
||||
extern void (APIENTRY * bglUniform3ivARB)(GLint, GLsizei, const GLint *);
|
||||
extern void (APIENTRY * bglUniform4ivARB)(GLint, GLsizei, const GLint *);
|
||||
extern void (APIENTRY * bglUniformMatrix2fvARB)(GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
extern void (APIENTRY * bglUniformMatrix3fvARB)(GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
extern void (APIENTRY * bglUniformMatrix4fvARB)(GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
extern void (APIENTRY * bglGetObjectParameterfvARB)(GLhandleARB, GLenum, GLfloat *);
|
||||
extern void (APIENTRY * bglGetObjectParameterivARB)(GLhandleARB, GLenum, GLint *);
|
||||
extern void (APIENTRY * bglGetInfoLogARB)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
|
||||
extern void (APIENTRY * bglGetAttachedObjectsARB)(GLhandleARB, GLsizei, GLsizei *, GLhandleARB *);
|
||||
extern GLint (APIENTRY * bglGetUniformLocationARB)(GLhandleARB, const GLcharARB *);
|
||||
extern void (APIENTRY * bglGetActiveUniformARB)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
|
||||
extern void (APIENTRY * bglGetUniformfvARB)(GLhandleARB, GLint, GLfloat *);
|
||||
extern void (APIENTRY * bglGetUniformivARB)(GLhandleARB, GLint, GLint *);
|
||||
extern void (APIENTRY * bglGetShaderSourceARB)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
|
||||
|
||||
// Vertex Shaders
|
||||
extern void (APIENTRY * bglVertexAttrib1dARB)(GLuint, GLdouble);
|
||||
extern void (APIENTRY * bglVertexAttrib1dvARB)(GLuint, const GLdouble *);
|
||||
extern void (APIENTRY * bglVertexAttrib1fARB)(GLuint, GLfloat);
|
||||
extern void (APIENTRY * bglVertexAttrib1fvARB)(GLuint, const GLfloat *);
|
||||
extern void (APIENTRY * bglVertexAttrib1sARB)(GLuint, GLshort);
|
||||
extern void (APIENTRY * bglVertexAttrib1svARB)(GLuint, const GLshort *);
|
||||
extern void (APIENTRY * bglVertexAttrib2dARB)(GLuint, GLdouble, GLdouble);
|
||||
extern void (APIENTRY * bglVertexAttrib2dvARB)(GLuint, const GLdouble *);
|
||||
extern void (APIENTRY * bglVertexAttrib2fARB)(GLuint, GLfloat, GLfloat);
|
||||
extern void (APIENTRY * bglVertexAttrib2fvARB)(GLuint, const GLfloat *);
|
||||
extern void (APIENTRY * bglVertexAttrib2sARB)(GLuint, GLshort, GLshort);
|
||||
extern void (APIENTRY * bglVertexAttrib2svARB)(GLuint, const GLshort *);
|
||||
extern void (APIENTRY * bglVertexAttrib3dARB)(GLuint, GLdouble, GLdouble, GLdouble);
|
||||
extern void (APIENTRY * bglVertexAttrib3dvARB)(GLuint, const GLdouble *);
|
||||
extern void (APIENTRY * bglVertexAttrib3fARB)(GLuint, GLfloat, GLfloat, GLfloat);
|
||||
extern void (APIENTRY * bglVertexAttrib3fvARB)(GLuint, const GLfloat *);
|
||||
extern void (APIENTRY * bglVertexAttrib3sARB)(GLuint, GLshort, GLshort, GLshort);
|
||||
extern void (APIENTRY * bglVertexAttrib3svARB)(GLuint, const GLshort *);
|
||||
extern void (APIENTRY * bglVertexAttrib4NbvARB)(GLuint, const GLbyte *);
|
||||
extern void (APIENTRY * bglVertexAttrib4NivARB)(GLuint, const GLint *);
|
||||
extern void (APIENTRY * bglVertexAttrib4NsvARB)(GLuint, const GLshort *);
|
||||
extern void (APIENTRY * bglVertexAttrib4NubARB)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
|
||||
extern void (APIENTRY * bglVertexAttrib4NubvARB)(GLuint, const GLubyte *);
|
||||
extern void (APIENTRY * bglVertexAttrib4NuivARB)(GLuint, const GLuint *);
|
||||
extern void (APIENTRY * bglVertexAttrib4NusvARB)(GLuint, const GLushort *);
|
||||
extern void (APIENTRY * bglVertexAttrib4bvARB)(GLuint, const GLbyte *);
|
||||
extern void (APIENTRY * bglVertexAttrib4dARB)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
|
||||
extern void (APIENTRY * bglVertexAttrib4dvARB)(GLuint, const GLdouble *);
|
||||
extern void (APIENTRY * bglVertexAttrib4fARB)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
extern void (APIENTRY * bglVertexAttrib4fvARB)(GLuint, const GLfloat *);
|
||||
extern void (APIENTRY * bglVertexAttrib4ivARB)(GLuint, const GLint *);
|
||||
extern void (APIENTRY * bglVertexAttrib4sARB)(GLuint, GLshort, GLshort, GLshort, GLshort);
|
||||
extern void (APIENTRY * bglVertexAttrib4svARB)(GLuint, const GLshort *);
|
||||
extern void (APIENTRY * bglVertexAttrib4ubvARB)(GLuint, const GLubyte *);
|
||||
extern void (APIENTRY * bglVertexAttrib4uivARB)(GLuint, const GLuint *);
|
||||
extern void (APIENTRY * bglVertexAttrib4usvARB)(GLuint, const GLushort *);
|
||||
extern void (APIENTRY * bglVertexAttribPointerARB)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
|
||||
extern void (APIENTRY * bglEnableVertexAttribArrayARB)(GLuint);
|
||||
extern void (APIENTRY * bglDisableVertexAttribArrayARB)(GLuint);
|
||||
extern void (APIENTRY * bglGetVertexAttribdvARB)(GLuint, GLenum, GLdouble *);
|
||||
extern void (APIENTRY * bglGetVertexAttribfvARB)(GLuint, GLenum, GLfloat *);
|
||||
extern void (APIENTRY * bglGetVertexAttribivARB)(GLuint, GLenum, GLint *);
|
||||
extern void (APIENTRY * bglGetVertexAttribPointervARB)(GLuint, GLenum, GLvoid* *);
|
||||
extern void (APIENTRY * bglBindAttribLocationARB)(GLhandleARB, GLuint, const GLcharARB *);
|
||||
extern void (APIENTRY * bglGetActiveAttribARB)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
|
||||
extern GLint (APIENTRY * bglGetAttribLocationARB)(GLhandleARB, const GLcharARB *);
|
||||
|
||||
// GLU
|
||||
extern void (APIENTRY * bgluTessBeginContour) (GLUtesselator* tess);
|
||||
extern void (APIENTRY * bgluTessBeginPolygon) (GLUtesselator* tess, GLvoid* data);
|
||||
extern void (APIENTRY * bgluTessCallback) (GLUtesselator* tess, GLenum which, void (PR_CALLBACK CallBackFunc)());
|
||||
extern void (APIENTRY * bgluTessEndContour) (GLUtesselator* tess);
|
||||
extern void (APIENTRY * bgluTessEndPolygon) (GLUtesselator* tess);
|
||||
extern void (APIENTRY * bgluTessNormal) (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
|
||||
extern void (APIENTRY * bgluTessProperty) (GLUtesselator* tess, GLenum which, GLdouble data);
|
||||
extern void (APIENTRY * bgluTessVertex) (GLUtesselator* tess, GLdouble *location, GLvoid* data);
|
||||
extern GLUtesselator* (APIENTRY * bgluNewTess) (void);
|
||||
|
||||
extern void (APIENTRY * bgluPerspective) (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
|
||||
|
||||
extern const GLubyte * (APIENTRY * bgluErrorString) (GLenum error);
|
||||
|
||||
extern GLint (APIENTRY * bgluProject)(GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
|
||||
extern GLint (APIENTRY * bgluUnProject)(GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
// Windows
|
||||
extern HGLRC (WINAPI * bwglCreateContext)(HDC);
|
||||
extern BOOL (WINAPI * bwglDeleteContext)(HGLRC);
|
||||
extern PROC (WINAPI * bwglGetProcAddress)(LPCSTR);
|
||||
extern BOOL (WINAPI * bwglMakeCurrent)(HDC,HGLRC);
|
||||
|
||||
extern BOOL (WINAPI * bwglSwapBuffers)(HDC);
|
||||
extern int32_t (WINAPI * bwglChoosePixelFormat)(HDC,CONST PIXELFORMATDESCRIPTOR*);
|
||||
extern int32_t (WINAPI * bwglDescribePixelFormat)(HDC,int32_t,UINT,LPPIXELFORMATDESCRIPTOR);
|
||||
extern int32_t (WINAPI * bwglGetPixelFormat)(HDC);
|
||||
extern BOOL (WINAPI * bwglSetPixelFormat)(HDC,int32_t,const PIXELFORMATDESCRIPTOR*);
|
||||
extern BOOL (WINAPI * bwglSwapIntervalEXT)(int32_t);
|
||||
#endif
|
||||
|
||||
#endif //USE_OPENGL
|
||||
|
||||
extern char *gldriver;
|
||||
|
||||
int32_t loadgldriver(const char *driver);
|
||||
int32_t loadglextensions(void);
|
||||
int32_t unloadgldriver(void);
|
||||
|
||||
int32_t loadglulibrary(const char *driver);
|
||||
int32_t unloadglulibrary(void);
|
File diff suppressed because it is too large
Load diff
|
@ -1,9 +0,0 @@
|
|||
#ifndef __gtkbits_h__
|
||||
#define __gtkbits_h__
|
||||
|
||||
extern void gtkbuild_init(int32_t *argc, char ***argv);
|
||||
extern void gtkbuild_exit(int32_t r);
|
||||
extern int32_t gtkbuild_msgbox(char *name, char *msg);
|
||||
extern int32_t gtkbuild_ynbox(char *name, char *msg);
|
||||
|
||||
#endif
|
|
@ -1,40 +0,0 @@
|
|||
#ifndef HIGHTILE_PRIV_H
|
||||
#define HIGHTILE_PRIV_H
|
||||
|
||||
struct hicskybox_t {
|
||||
int ignore;
|
||||
char *face[6];
|
||||
};
|
||||
|
||||
typedef struct hicreplc_t {
|
||||
struct hicreplc_t *next;
|
||||
char palnum, ignore, flags, filler;
|
||||
char *filename;
|
||||
float alphacut, xscale, yscale, specpower, specfactor;
|
||||
struct hicskybox_t *skybox;
|
||||
} hicreplctyp;
|
||||
|
||||
extern palette_t hictinting[MAXPALOOKUPS];
|
||||
extern hicreplctyp *hicreplc[MAXTILES];
|
||||
extern char hicfirstinit;
|
||||
|
||||
typedef struct texcachehead_t
|
||||
{
|
||||
char magic[4]; // 'PMST', was 'Polymost'
|
||||
int xdim, ydim; // of image, unpadded
|
||||
int flags; // 1 = !2^x, 2 = has alpha, 4 = lzw compressed
|
||||
int quality; // r_downsize at the time the cache was written
|
||||
} texcacheheader;
|
||||
|
||||
typedef struct texcachepic_t
|
||||
{
|
||||
int size;
|
||||
int format;
|
||||
int xdim, ydim; // of mipmap (possibly padded)
|
||||
int border, depth;
|
||||
} texcachepicture;
|
||||
|
||||
hicreplctyp * hicfindsubst(int picnum, int palnum, int skybox);
|
||||
#define HICEFFECTMASK (1|2|4|8)
|
||||
|
||||
#endif
|
|
@ -1,21 +0,0 @@
|
|||
//High-level (easy) picture loading function:
|
||||
extern void kpzload (const char *, intptr_t *, int32_t *, int32_t *, int32_t *);
|
||||
//Low-level PNG/JPG functions:
|
||||
extern void kpgetdim (const char *, int32_t, int32_t *, int32_t *);
|
||||
extern int32_t kprender (const char *, int32_t, intptr_t, int32_t, int32_t, int32_t, int32_t, int32_t);
|
||||
|
||||
//ZIP functions:
|
||||
extern int32_t kzaddstack (const char *);
|
||||
extern void kzuninit ();
|
||||
extern int32_t kzopen (const char *);
|
||||
extern int32_t kzread (void *, int32_t);
|
||||
extern int32_t kzfilelength ();
|
||||
extern int32_t kzseek (int32_t, int32_t);
|
||||
extern int32_t kztell ();
|
||||
extern int32_t kzgetc ();
|
||||
extern int32_t kzeof ();
|
||||
extern void kzclose ();
|
||||
|
||||
extern void kzfindfilestart (const char *); //pass wildcard string
|
||||
extern int32_t kzfindfile (char *); //you alloc buf, returns 1:found,0:~found
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
int32_t lzwcompress (char *ucompbuf, int32_t ucompleng, char *compbuf);
|
||||
int32_t lzwuncompress (char *compbuf, int32_t compleng, char *ucompbuf, int32_t ucompleng);
|
|
@ -1,296 +0,0 @@
|
|||
//-------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (C) 1996, 2003 - 3D Realms Entertainment
|
||||
Copyright (C) 2000, 2003 - Matt Saettler (EDuke Enhancements)
|
||||
Copyright (C) 2004, 2007 - EDuke32 developers
|
||||
|
||||
This file is part of EDuke32
|
||||
|
||||
EDuke32 is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License version 2
|
||||
as published by the Free Software Foundation.
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
#ifndef _m32script_h_
|
||||
#define _m32script_h_
|
||||
|
||||
#include "compat.h"
|
||||
#include "baselayer.h"
|
||||
#include "build.h"
|
||||
#include "editor.h"
|
||||
|
||||
#define MAXQUOTES 2048
|
||||
#define MAXQUOTELEN 128
|
||||
|
||||
// Some misc #defines
|
||||
//#define NO 0
|
||||
//#define YES 1
|
||||
|
||||
typedef int32_t instype;
|
||||
typedef int32_t ofstype;
|
||||
|
||||
extern char *ScriptQuotes[MAXQUOTES+1], *ScriptQuoteRedefinitions[MAXQUOTES+1];
|
||||
extern int32_t g_numQuoteRedefinitions;
|
||||
|
||||
//extern int16_t neartagsector, neartagwall, neartagsprite;
|
||||
//extern int32_t neartaghitdist;
|
||||
|
||||
extern int32_t VM_Execute(int32_t once);
|
||||
extern void VM_OnEvent(register int32_t iEventID, register int32_t iActor);
|
||||
|
||||
extern void VM_ScriptInfo(void);
|
||||
extern void VM_Disasm(ofstype beg, int32_t size);
|
||||
|
||||
extern int32_t Gv_NewVar(const char *pszLabel, intptr_t lValue, uint32_t dwFlags);
|
||||
extern int32_t Gv_NewArray(const char *pszLabel, void *arrayptr, intptr_t asize, uint32_t dwFlags);
|
||||
extern void Gv_Init(void);
|
||||
|
||||
extern int32_t __fastcall Gv_GetVarX(register int32_t id);
|
||||
extern void __fastcall Gv_SetVarX(register int32_t id, register int32_t lValue);
|
||||
extern int32_t __fastcall Gv_GetVarN(register int32_t id); // 'N' for "no side-effects"... vars and locals only!
|
||||
|
||||
extern void SetGAMEPalette(void);
|
||||
extern void SetWATERPalette(void);
|
||||
extern void SetSLIMEPalette(void);
|
||||
extern void SetBOSS1Palette(void);
|
||||
|
||||
extern int32_t *constants, constants_allocsize;
|
||||
extern int32_t g_numSavedConstants;
|
||||
|
||||
extern instype *script ,*insptr;
|
||||
extern int32_t *labelval;
|
||||
extern uint8_t *labeltype;
|
||||
extern int32_t g_numLabels, g_numDefaultLabels;
|
||||
extern int32_t g_scriptSize;
|
||||
extern char *label;
|
||||
//extern int32_t label_allocsize;
|
||||
|
||||
extern hashtable_t h_labels;
|
||||
|
||||
#define MAXLABELLEN 32
|
||||
|
||||
//extern uint8_t waterpal[768],slimepal[768],titlepal[768],drealms[768],endingpal[768],animpal[768];
|
||||
//extern char currentboardfilename[BMAVM_PATH];
|
||||
|
||||
|
||||
enum GameEvent_t {
|
||||
EVENT_ENTER3DMODE,
|
||||
EVENT_ANALYZESPRITES,
|
||||
EVENT_INSERTSPRITE2D,
|
||||
EVENT_INSERTSPRITE3D,
|
||||
EVENT_DRAW2DSCREEN,
|
||||
EVENT_KEYS2D,
|
||||
EVENT_KEYS3D,
|
||||
EVENT_PREKEYS2D,
|
||||
EVENT_PREKEYS3D,
|
||||
MAXEVENTS
|
||||
};
|
||||
|
||||
extern ofstype aEventOffsets[MAXEVENTS];
|
||||
extern int32_t aEventSizes[MAXEVENTS];
|
||||
extern uint8_t aEventEnabled[MAXEVENTS];
|
||||
extern uint16_t aEventNumLocals[MAXEVENTS];
|
||||
|
||||
|
||||
enum GamevarFlags_t {
|
||||
MAXGAMEVARS = 1024, // must be a power of two between 256 and 4096, inclusive
|
||||
LOG2MAXGV = 10,
|
||||
MAXVARLABEL = MAXLABELLEN, //26,
|
||||
|
||||
GAMEVAR_PERBLOCK = 0x00000001, // per-block (state, event, or top-level) variable
|
||||
GAMEVAR_USER_MASK = GAMEVAR_PERBLOCK,
|
||||
|
||||
GAMEVAR_RESET = 0x00000008, // marks var for to default
|
||||
GAMEVAR_DEFAULT = 0x00000100, // allow override
|
||||
|
||||
GAMEVAR_SYSTEM = 0x00000800, // cannot change mode flags...(only default value)
|
||||
GAMEVAR_READONLY = 0x00001000, // values are read-only (no setvar allowed)
|
||||
|
||||
GAMEVAR_INTPTR = 0x00002000, // plValues is a pointer to an int32_t
|
||||
GAMEVAR_FLOATPTR = 0x00004000, // plValues is a pointer to a float
|
||||
GAMEVAR_SHORTPTR = 0x00008000, // plValues is a pointer to a short
|
||||
GAMEVAR_CHARPTR = 0x00010000, // plValues is a pointer to a char
|
||||
GAMEVAR_PTR_MASK = GAMEVAR_INTPTR|GAMEVAR_FLOATPTR|GAMEVAR_SHORTPTR|GAMEVAR_CHARPTR,
|
||||
|
||||
// GAMEVAR_NORESET = 0x00020000, // var values are not reset when restoring map state
|
||||
GAMEVAR_SPECIAL = 0x00040000, // flag for structure member shortcut vars
|
||||
};
|
||||
|
||||
enum GamearrayFlags_t {
|
||||
MAXGAMEARRAYS = (MAXGAMEVARS>>2), // must be lower than MAXGAMEVARS
|
||||
MAXARRAYLABEL = MAXVARLABEL,
|
||||
|
||||
GAMEARRAY_READONLY = 0x00001000,
|
||||
|
||||
GAMEARRAY_NORMAL = 0,
|
||||
GAMEARRAY_OFCHAR = 0x00000001,
|
||||
GAMEARRAY_OFSHORT = 0x00000002,
|
||||
GAMEARRAY_OFINT = 0x00000004,
|
||||
GAMEARRAY_TYPE_MASK = GAMEARRAY_OFCHAR|GAMEARRAY_OFSHORT|GAMEARRAY_OFINT,
|
||||
|
||||
GAMEARRAY_VARSIZE = 0x00000020,
|
||||
|
||||
GAMEARRAY_RESET = 0x00000008,
|
||||
/// GAMEARRAY_NORESET = 0x00000001,
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
intptr_t lValue; // pointer when (dwFlags & GAMEVAR_*PTR)
|
||||
int32_t *plValues; // array of values when (dwFlags & GAMEVAR_PERBLOCK)
|
||||
} val;
|
||||
intptr_t lDefault;
|
||||
char *szLabel;
|
||||
uint32_t dwFlags;
|
||||
} gamevar_t;
|
||||
|
||||
typedef struct {
|
||||
char *szLabel;
|
||||
void *vals; // array of values, type determined by (dwFlags & GAMEARRAY_TYPEMASK)
|
||||
uint32_t dwFlags;
|
||||
int32_t size; // id to size gamevar when (dwFlags & GAMEARRAY_VARSIZE)
|
||||
} gamearray_t;
|
||||
|
||||
extern gamevar_t aGameVars[MAXGAMEVARS];
|
||||
extern gamearray_t aGameArrays[MAXGAMEARRAYS];
|
||||
extern int32_t g_gameVarCount, g_systemVarCount;
|
||||
extern int32_t g_gameArrayCount, g_systemArrayCount;
|
||||
|
||||
extern uint32_t m32_drawlinepat;
|
||||
|
||||
|
||||
extern int32_t g_iReturnVar;
|
||||
extern int32_t m32_sortvar1, m32_sortvar2;
|
||||
extern int32_t m32_script_expertmode; // if true, make read-only vars writable
|
||||
|
||||
//extern int32_t g_numRealPalettes;
|
||||
//extern int32_t g_scriptDebug;
|
||||
|
||||
extern int32_t g_numQuoteRedefinitions;
|
||||
|
||||
extern hashtable_t h_gamevars;
|
||||
extern hashtable_t h_arrays;
|
||||
//extern hashtable_t h_keywords;
|
||||
extern hashtable_t h_gamefuncs;
|
||||
|
||||
|
||||
extern int16_t asksave;
|
||||
|
||||
extern vec3_t pos;
|
||||
extern int16_t ang;
|
||||
extern int32_t horiz;
|
||||
extern int16_t cursectnum;
|
||||
extern int32_t searchx, searchy;
|
||||
/*
|
||||
extern int16_t searchstat;
|
||||
extern int16_t searchwall;
|
||||
extern int16_t searchsector;
|
||||
extern int16_t searchbottomwall;
|
||||
*/
|
||||
extern int16_t pointhighlight;
|
||||
extern int16_t linehighlight;
|
||||
extern int16_t highlightcnt;
|
||||
extern int16_t highlightsectorcnt;
|
||||
/*
|
||||
extern int32_t temppicnum;
|
||||
extern int32_t tempcstat;
|
||||
extern int32_t templotag;
|
||||
extern int32_t temphitag;
|
||||
extern int32_t tempextra;
|
||||
extern int32_t tempshade;
|
||||
extern uint32_t temppal;
|
||||
extern uint32_t tempvis;
|
||||
extern uint32_t tempxrepeat;
|
||||
extern uint32_t tempyrepeat;
|
||||
*/
|
||||
extern int32_t startposx;
|
||||
extern int32_t startposy;
|
||||
extern int32_t startposz;
|
||||
extern int16_t startang;
|
||||
extern int16_t startsectnum;
|
||||
|
||||
extern int32_t mousxplc;
|
||||
extern int32_t mousyplc;
|
||||
|
||||
extern int16_t highlight[];
|
||||
extern int16_t highlightsector[];
|
||||
|
||||
extern int32_t numsprites;
|
||||
|
||||
extern int32_t zoom;
|
||||
extern int32_t halfxdim16, midydim16;
|
||||
|
||||
|
||||
// gamevar bytecode format:
|
||||
|
||||
// FEDC|BA98|7654|3210|FEDC|BA98|7654|3120
|
||||
// | .. .... .... gamevar ID
|
||||
// | . constant bit (checked first) / get-payload-var bit for array or struct
|
||||
// | . negate bit
|
||||
// | . array bit \___\ if both set:
|
||||
// | . struct bit / / local var
|
||||
// .... .... .... ....| optional payload
|
||||
|
||||
|
||||
|
||||
#define M32_FLAG_CONSTANT (MAXGAMEVARS)
|
||||
#define M32_FLAG_NEGATE (MAXGAMEVARS<<1)
|
||||
|
||||
#define M32_FLAG_VAR (0)
|
||||
#define M32_FLAG_ARRAY (MAXGAMEVARS<<2)
|
||||
#define M32_FLAG_STRUCT (MAXGAMEVARS<<3)
|
||||
#define M32_FLAG_LOCAL (M32_FLAG_ARRAY|M32_FLAG_STRUCT)
|
||||
#define M32_VARTYPE_MASK (M32_FLAG_ARRAY|M32_FLAG_STRUCT)
|
||||
|
||||
#define M32_FLAG_CONSTANTINDEX M32_FLAG_CONSTANT
|
||||
// if set, fetch index for array or struct array from 16 high bits as a constant (otherwise: gamevar)
|
||||
|
||||
#define M32_BITS_MASK (0x0000ffff-(MAXGAMEVARS-1))
|
||||
|
||||
// IDs of special vars
|
||||
#define M32_SPRITE_VAR_ID 0
|
||||
#define M32_SECTOR_VAR_ID 1
|
||||
#define M32_WALL_VAR_ID 2
|
||||
#define M32_TSPRITE_VAR_ID 3
|
||||
|
||||
#define M32_THISACTOR_VAR_ID 4
|
||||
#define M32_RETURN_VAR_ID 5
|
||||
#define M32_LOTAG_VAR_ID 6
|
||||
#define M32_HITAG_VAR_ID 7
|
||||
#define M32_TEXTURE_VAR_ID 8
|
||||
|
||||
#define M32_LOCAL_ARRAY_ID 0
|
||||
|
||||
#define M32_PRINTERROR(Text, ...) OSD_Printf(OSD_ERROR "Line %d, %s: " Text "\n", g_errorLineNum, keyw[g_tw], ## __VA_ARGS__)
|
||||
|
||||
|
||||
// how local gamevars are allocated:
|
||||
|
||||
// uncomment if variable-length arrays are available
|
||||
//#define M32_LOCALS_VARARRAY
|
||||
|
||||
// uncomment if alloca() is available
|
||||
//#define M32_LOCALS_ALLOCA
|
||||
|
||||
// if neither is there, use a constant number of them
|
||||
#define M32_LOCALS_FIXEDNUM 64
|
||||
|
||||
#if defined M32_LOCALS_VARARRAY || defined M32_LOCALS_ALLOCA
|
||||
# define M32_MAX_LOCALS MAXGAMEVARS
|
||||
#else
|
||||
# define M32_MAX_LOCALS M32_LOCALS_FIXEDNUM
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load diff
|
@ -1,38 +0,0 @@
|
|||
/* MD4.H - header file for MD4C.C
|
||||
Modified from original version published in RFC1320 by
|
||||
Jonathon Fowler (jonof@edgenetwork.org)
|
||||
*/
|
||||
|
||||
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
|
||||
rights reserved.
|
||||
|
||||
License to copy and use this software is granted provided that it
|
||||
is identified as the "RSA Data Security, Inc. MD4 Message-Digest
|
||||
Algorithm" in all material mentioning or referencing this software
|
||||
or this function.
|
||||
|
||||
License is also granted to make and use derivative works provided
|
||||
that such works are identified as "derived from the RSA Data
|
||||
Security, Inc. MD4 Message-Digest Algorithm" in all material
|
||||
mentioning or referencing the derived work.
|
||||
|
||||
RSA Data Security, Inc. makes no representations concerning either
|
||||
the merchantability of this software or the suitability of this
|
||||
software for any particular purpose. It is provided "as is"
|
||||
without express or implied warranty of any kind.
|
||||
|
||||
These notices must be retained in any copies of any part of this
|
||||
documentation and/or software.
|
||||
*/
|
||||
|
||||
/* MD4 context. */
|
||||
typedef struct {
|
||||
unsigned int state[4]; /* state (ABCD) */
|
||||
unsigned int count[2]; /* number of bits, modulo 2^64 (lsb first) */
|
||||
unsigned char buffer[64]; /* input buffer */
|
||||
} MD4_CTX;
|
||||
|
||||
void md4once(unsigned char *block, unsigned int len, unsigned char digest[16]);
|
||||
void md4init(MD4_CTX *);
|
||||
void md4block(MD4_CTX *, unsigned char *, unsigned int);
|
||||
void md4finish(unsigned char [16], MD4_CTX *);
|
|
@ -1,248 +0,0 @@
|
|||
#ifndef _mdsprite_h_
|
||||
# define _mdsprite_h_
|
||||
|
||||
#include "hightile.h"
|
||||
|
||||
#ifdef __POWERPC__
|
||||
#define SHIFTMOD32(a) ((a)&31)
|
||||
#else
|
||||
#define SHIFTMOD32(a) (a)
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t mdnum; //VOX=1, MD2=2, MD3=3. NOTE: must be first in structure!
|
||||
int32_t shadeoff;
|
||||
float scale, bscale, zadd;
|
||||
GLuint *texid; // skins
|
||||
int32_t flags;
|
||||
} mdmodel_t;
|
||||
|
||||
typedef struct _mdanim_t
|
||||
{
|
||||
int32_t startframe, endframe;
|
||||
int32_t fpssc, flags;
|
||||
struct _mdanim_t *next;
|
||||
} mdanim_t;
|
||||
#define MDANIM_LOOP 0
|
||||
#define MDANIM_ONESHOT 1
|
||||
|
||||
typedef struct _mdskinmap_t
|
||||
{
|
||||
uint8_t palette, filler[3]; // Build palette number
|
||||
int32_t skinnum, surfnum; // Skin identifier, surface number
|
||||
char *fn; // Skin filename
|
||||
GLuint texid[HICEFFECTMASK+1]; // OpenGL texture numbers for effect variations
|
||||
struct _mdskinmap_t *next;
|
||||
float param, specpower, specfactor;
|
||||
} mdskinmap_t;
|
||||
|
||||
|
||||
//This MD2 code is based on the source code from David Henry (tfc_duke(at)hotmail.com)
|
||||
// Was at http://tfc.duke.free.fr/us/tutorials/models/md2.htm
|
||||
// Available from http://web.archive.org/web/20030816010242/http://tfc.duke.free.fr/us/tutorials/models/md2.htm
|
||||
// Now at http://tfc.duke.free.fr/coding/md2.html (in French)
|
||||
//He probably wouldn't recognize it if he looked at it though :)
|
||||
typedef struct { float x, y, z; } point3d;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t id, vers, skinxsiz, skinysiz, framebytes; //id:"IPD2", vers:8
|
||||
int32_t numskins, numverts, numuv, numtris, numglcmds, numframes;
|
||||
int32_t ofsskins, ofsuv, ofstris, ofsframes, ofsglcmds, ofseof; //ofsskins: skin names (64 bytes each)
|
||||
} md2head_t;
|
||||
|
||||
typedef struct { uint8_t v[3], ni; } md2vert_t; //compressed vertex coords (x,y,z)
|
||||
typedef struct
|
||||
{
|
||||
point3d mul, add; //scale&translation vector
|
||||
char name[16]; //frame name
|
||||
md2vert_t verts[1]; //first vertex of this frame
|
||||
} md2frame_t;
|
||||
|
||||
typedef struct { int16_t u, v; } md2uv_t;
|
||||
typedef struct
|
||||
{
|
||||
uint16_t v[3];
|
||||
uint16_t u[3];
|
||||
} md2tri_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
//WARNING: This top block is a union between md2model&md3model: Make sure it matches!
|
||||
int32_t mdnum; //VOX=1, MD2=2, MD3=3. NOTE: must be first in structure!
|
||||
int32_t shadeoff;
|
||||
float scale, bscale, zadd;
|
||||
GLuint *texid; // texture ids for base skin if no mappings defined
|
||||
int32_t flags;
|
||||
|
||||
int32_t numframes, cframe, nframe, fpssc, usesalpha;
|
||||
float oldtime, curtime, interpol;
|
||||
mdanim_t *animations;
|
||||
mdskinmap_t *skinmap;
|
||||
int32_t numskins, skinloaded; // set to 1+numofskin when a skin is loaded and the tex coords are modified,
|
||||
|
||||
//MD2 specific stuff:
|
||||
int32_t numverts, numglcmds, framebytes, *glcmds;
|
||||
char *frames;
|
||||
char *basepath; // pointer to string of base path
|
||||
char *skinfn; // pointer to first of numskins 64-char strings
|
||||
md2uv_t *uv;
|
||||
md2tri_t* tris;
|
||||
} md2model_t;
|
||||
|
||||
|
||||
typedef struct { char nam[64]; int32_t i; } md3shader_t; //ascz path of shader, shader index
|
||||
typedef struct { int32_t i[3]; } md3tri_t; //indices of tri
|
||||
typedef struct { float u, v; } md3uv_t;
|
||||
typedef struct { int16_t x, y, z; uint8_t nlat, nlng; } md3xyzn_t; //xyz are [10:6] ints
|
||||
|
||||
typedef struct
|
||||
{
|
||||
point3d min, max, cen; //bounding box&origin
|
||||
float r; //radius of bounding sphere
|
||||
char nam[16]; //ascz frame name
|
||||
} md3frame_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char nam[64]; //ascz tag name
|
||||
point3d p, x, y, z; //tag object pos&orient
|
||||
} md3tag_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t id; //IDP3(0x33806873)
|
||||
char nam[64]; //ascz surface name
|
||||
int32_t flags; //?
|
||||
int32_t numframes, numshaders, numverts, numtris; //numframes same as md3head,max shade=~256,vert=~4096,tri=~8192
|
||||
int32_t ofstris;
|
||||
int32_t ofsshaders;
|
||||
int32_t ofsuv;
|
||||
int32_t ofsxyzn;
|
||||
int32_t ofsend;
|
||||
// DO NOT read directly to this structure
|
||||
// the following block is NOT in the file format
|
||||
// be sure to use the SIZEOF_MD3SURF_T macro
|
||||
md3tri_t *tris;
|
||||
md3shader_t *shaders;
|
||||
md3uv_t *uv;
|
||||
md3xyzn_t *xyzn;
|
||||
float *geometry;
|
||||
} md3surf_t;
|
||||
|
||||
#define SIZEOF_MD3SURF_T (11*sizeof(int32_t) + 64*sizeof(char))
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t id, vers; //id=IDP3(0x33806873), vers=15
|
||||
char nam[64]; //ascz path in PK3
|
||||
int32_t flags; //?
|
||||
int32_t numframes, numtags, numsurfs, numskins; //max=~1024,~16,~32,numskins=artifact of MD2; use shader field instead
|
||||
int32_t ofsframes;
|
||||
int32_t ofstags;
|
||||
int32_t ofssurfs;
|
||||
int32_t eof;
|
||||
// DO NOT read directly to this structure
|
||||
// the following block is NOT in the file format
|
||||
// be sure to use the SIZEOF_MD3HEAD_T macro
|
||||
md3frame_t *frames;
|
||||
md3tag_t *tags;
|
||||
md3surf_t *surfs;
|
||||
} md3head_t;
|
||||
|
||||
#define SIZEOF_MD3HEAD_T (sizeof(md3head_t)-3*sizeof(void*))
|
||||
|
||||
typedef struct
|
||||
{
|
||||
//WARNING: This top block is a union between md2model&md3model: Make sure it matches!
|
||||
int32_t mdnum; //VOX=1, MD2=2, MD3=3. NOTE: must be first in structure!
|
||||
int32_t shadeoff;
|
||||
float scale, bscale, zadd;
|
||||
uint32_t *texid; // texture ids for base skin if no mappings defined
|
||||
int32_t flags;
|
||||
|
||||
int32_t numframes, cframe, nframe, fpssc, usesalpha;
|
||||
float oldtime, curtime, interpol;
|
||||
mdanim_t *animations;
|
||||
mdskinmap_t *skinmap;
|
||||
int32_t numskins, skinloaded; // set to 1+numofskin when a skin is loaded and the tex coords are modified,
|
||||
|
||||
//MD3 specific
|
||||
md3head_t head;
|
||||
point3d *muladdframes;
|
||||
uint16_t *indexes;
|
||||
uint16_t *vindexes;
|
||||
float *maxdepths;
|
||||
GLuint* vbos;
|
||||
// polymer VBO names after that, allocated per surface
|
||||
GLuint* indices;
|
||||
GLuint* texcoords;
|
||||
GLuint* geometry;
|
||||
} md3model_t;
|
||||
|
||||
#define VOXBORDWIDTH 1 //use 0 to save memory, but has texture artifacts; 1 looks better...
|
||||
#define VOXUSECHAR 0
|
||||
#if (VOXUSECHAR != 0)
|
||||
typedef struct { uint8_t x, y, z, u, v; } vert_t;
|
||||
#else
|
||||
typedef struct { uint16_t x, y, z, u, v; } vert_t;
|
||||
#endif
|
||||
typedef struct { vert_t v[4]; } voxrect_t;
|
||||
typedef struct
|
||||
{
|
||||
//WARNING: This top block is a union of md2model,md3model,voxmodel: Make sure it matches!
|
||||
int32_t mdnum; //VOX=1, MD2=2, MD3=3. NOTE: must be first in structure!
|
||||
int32_t shadeoff;
|
||||
float scale, bscale, zadd;
|
||||
uint32_t *texid; // skins for palettes
|
||||
int32_t flags;
|
||||
|
||||
//VOX specific stuff:
|
||||
voxrect_t *quad; int32_t qcnt, qfacind[7];
|
||||
int32_t *mytex, mytexx, mytexy;
|
||||
int32_t xsiz, ysiz, zsiz;
|
||||
float xpiv, ypiv, zpiv;
|
||||
int32_t is8bit;
|
||||
} voxmodel_t;
|
||||
|
||||
/*
|
||||
typedef struct
|
||||
{
|
||||
// maps build tiles to particular animation frames of a model
|
||||
int32_t modelid;
|
||||
int32_t skinnum;
|
||||
int32_t framenum; // calculate the number from the name when declaring
|
||||
float smoothduration;
|
||||
int32_t next;
|
||||
char pal;
|
||||
} tile2model_t;
|
||||
|
||||
#define EXTRATILES MAXTILES
|
||||
EXTERN tile2model_t tile2model[MAXTILES+EXTRATILES];
|
||||
*/
|
||||
|
||||
EXTERN mdmodel_t **models;
|
||||
|
||||
void updateanimation(md2model_t *m, spritetype *tspr);
|
||||
int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf);
|
||||
void mdinit(void);
|
||||
void freeallmodels(void);
|
||||
void clearskins(void);
|
||||
int32_t mddraw(spritetype *tspr);
|
||||
|
||||
typedef struct { float xadd, yadd, zadd; int16_t angadd, flags, fov; } hudtyp;
|
||||
|
||||
EXTERN hudtyp hudmem[2][MAXTILES];
|
||||
|
||||
EXTERN int32_t mdpause;
|
||||
EXTERN int32_t nummodelsalloced, nextmodelid;
|
||||
EXTERN voxmodel_t *voxmodels[MAXVOXELS];
|
||||
|
||||
void voxfree(voxmodel_t *m);
|
||||
voxmodel_t *voxload(const char *filnam);
|
||||
int32_t voxdraw(voxmodel_t *m, spritetype *tspr);
|
||||
|
||||
int md3postload_polymer(md3model_t* m);
|
||||
|
||||
#endif // !_mdsprite_h_
|
|
@ -1,305 +0,0 @@
|
|||
// ISO C9x compliant inttypes.h for Microsoft Visual Studio
|
||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||
//
|
||||
// Copyright (c) 2006 Alexander Chemeris
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. The name of the author may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MSC_VER // [
|
||||
#error "Use this header only with Microsoft Visual C++ compilers!"
|
||||
#endif // _MSC_VER ]
|
||||
|
||||
#ifndef _MSC_INTTYPES_H_ // [
|
||||
#define _MSC_INTTYPES_H_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "stdint.h"
|
||||
|
||||
// 7.8 Format conversion of integer types
|
||||
|
||||
typedef struct {
|
||||
intmax_t quot;
|
||||
intmax_t rem;
|
||||
} imaxdiv_t;
|
||||
|
||||
// 7.8.1 Macros for format specifiers
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198
|
||||
|
||||
// The fprintf macros for signed integers are:
|
||||
#define PRId8 "d"
|
||||
#define PRIi8 "i"
|
||||
#define PRIdLEAST8 "d"
|
||||
#define PRIiLEAST8 "i"
|
||||
#define PRIdFAST8 "d"
|
||||
#define PRIiFAST8 "i"
|
||||
|
||||
#define PRId16 "hd"
|
||||
#define PRIi16 "hi"
|
||||
#define PRIdLEAST16 "hd"
|
||||
#define PRIiLEAST16 "hi"
|
||||
#define PRIdFAST16 "hd"
|
||||
#define PRIiFAST16 "hi"
|
||||
|
||||
#define PRId32 "I32d"
|
||||
#define PRIi32 "I32i"
|
||||
#define PRIdLEAST32 "I32d"
|
||||
#define PRIiLEAST32 "I32i"
|
||||
#define PRIdFAST32 "I32d"
|
||||
#define PRIiFAST32 "I32i"
|
||||
|
||||
#define PRId64 "I64d"
|
||||
#define PRIi64 "I64i"
|
||||
#define PRIdLEAST64 "I64d"
|
||||
#define PRIiLEAST64 "I64i"
|
||||
#define PRIdFAST64 "I64d"
|
||||
#define PRIiFAST64 "I64i"
|
||||
|
||||
#define PRIdMAX "I64d"
|
||||
#define PRIiMAX "I64i"
|
||||
|
||||
#define PRIdPTR "Id"
|
||||
#define PRIiPTR "Ii"
|
||||
|
||||
// The fprintf macros for unsigned integers are:
|
||||
#define PRIo8 "o"
|
||||
#define PRIu8 "u"
|
||||
#define PRIx8 "x"
|
||||
#define PRIX8 "X"
|
||||
#define PRIoLEAST8 "o"
|
||||
#define PRIuLEAST8 "u"
|
||||
#define PRIxLEAST8 "x"
|
||||
#define PRIXLEAST8 "X"
|
||||
#define PRIoFAST8 "o"
|
||||
#define PRIuFAST8 "u"
|
||||
#define PRIxFAST8 "x"
|
||||
#define PRIXFAST8 "X"
|
||||
|
||||
#define PRIo16 "ho"
|
||||
#define PRIu16 "hu"
|
||||
#define PRIx16 "hx"
|
||||
#define PRIX16 "hX"
|
||||
#define PRIoLEAST16 "ho"
|
||||
#define PRIuLEAST16 "hu"
|
||||
#define PRIxLEAST16 "hx"
|
||||
#define PRIXLEAST16 "hX"
|
||||
#define PRIoFAST16 "ho"
|
||||
#define PRIuFAST16 "hu"
|
||||
#define PRIxFAST16 "hx"
|
||||
#define PRIXFAST16 "hX"
|
||||
|
||||
#define PRIo32 "I32o"
|
||||
#define PRIu32 "I32u"
|
||||
#define PRIx32 "I32x"
|
||||
#define PRIX32 "I32X"
|
||||
#define PRIoLEAST32 "I32o"
|
||||
#define PRIuLEAST32 "I32u"
|
||||
#define PRIxLEAST32 "I32x"
|
||||
#define PRIXLEAST32 "I32X"
|
||||
#define PRIoFAST32 "I32o"
|
||||
#define PRIuFAST32 "I32u"
|
||||
#define PRIxFAST32 "I32x"
|
||||
#define PRIXFAST32 "I32X"
|
||||
|
||||
#define PRIo64 "I64o"
|
||||
#define PRIu64 "I64u"
|
||||
#define PRIx64 "I64x"
|
||||
#define PRIX64 "I64X"
|
||||
#define PRIoLEAST64 "I64o"
|
||||
#define PRIuLEAST64 "I64u"
|
||||
#define PRIxLEAST64 "I64x"
|
||||
#define PRIXLEAST64 "I64X"
|
||||
#define PRIoFAST64 "I64o"
|
||||
#define PRIuFAST64 "I64u"
|
||||
#define PRIxFAST64 "I64x"
|
||||
#define PRIXFAST64 "I64X"
|
||||
|
||||
#define PRIoMAX "I64o"
|
||||
#define PRIuMAX "I64u"
|
||||
#define PRIxMAX "I64x"
|
||||
#define PRIXMAX "I64X"
|
||||
|
||||
#define PRIoPTR "Io"
|
||||
#define PRIuPTR "Iu"
|
||||
#define PRIxPTR "Ix"
|
||||
#define PRIXPTR "IX"
|
||||
|
||||
// The fscanf macros for signed integers are:
|
||||
#define SCNd8 "d"
|
||||
#define SCNi8 "i"
|
||||
#define SCNdLEAST8 "d"
|
||||
#define SCNiLEAST8 "i"
|
||||
#define SCNdFAST8 "d"
|
||||
#define SCNiFAST8 "i"
|
||||
|
||||
#define SCNd16 "hd"
|
||||
#define SCNi16 "hi"
|
||||
#define SCNdLEAST16 "hd"
|
||||
#define SCNiLEAST16 "hi"
|
||||
#define SCNdFAST16 "hd"
|
||||
#define SCNiFAST16 "hi"
|
||||
|
||||
#define SCNd32 "ld"
|
||||
#define SCNi32 "li"
|
||||
#define SCNdLEAST32 "ld"
|
||||
#define SCNiLEAST32 "li"
|
||||
#define SCNdFAST32 "ld"
|
||||
#define SCNiFAST32 "li"
|
||||
|
||||
#define SCNd64 "I64d"
|
||||
#define SCNi64 "I64i"
|
||||
#define SCNdLEAST64 "I64d"
|
||||
#define SCNiLEAST64 "I64i"
|
||||
#define SCNdFAST64 "I64d"
|
||||
#define SCNiFAST64 "I64i"
|
||||
|
||||
#define SCNdMAX "I64d"
|
||||
#define SCNiMAX "I64i"
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define SCNdPTR "I64d"
|
||||
# define SCNiPTR "I64i"
|
||||
#else // _WIN64 ][
|
||||
# define SCNdPTR "ld"
|
||||
# define SCNiPTR "li"
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// The fscanf macros for unsigned integers are:
|
||||
#define SCNo8 "o"
|
||||
#define SCNu8 "u"
|
||||
#define SCNx8 "x"
|
||||
#define SCNX8 "X"
|
||||
#define SCNoLEAST8 "o"
|
||||
#define SCNuLEAST8 "u"
|
||||
#define SCNxLEAST8 "x"
|
||||
#define SCNXLEAST8 "X"
|
||||
#define SCNoFAST8 "o"
|
||||
#define SCNuFAST8 "u"
|
||||
#define SCNxFAST8 "x"
|
||||
#define SCNXFAST8 "X"
|
||||
|
||||
#define SCNo16 "ho"
|
||||
#define SCNu16 "hu"
|
||||
#define SCNx16 "hx"
|
||||
#define SCNX16 "hX"
|
||||
#define SCNoLEAST16 "ho"
|
||||
#define SCNuLEAST16 "hu"
|
||||
#define SCNxLEAST16 "hx"
|
||||
#define SCNXLEAST16 "hX"
|
||||
#define SCNoFAST16 "ho"
|
||||
#define SCNuFAST16 "hu"
|
||||
#define SCNxFAST16 "hx"
|
||||
#define SCNXFAST16 "hX"
|
||||
|
||||
#define SCNo32 "lo"
|
||||
#define SCNu32 "lu"
|
||||
#define SCNx32 "lx"
|
||||
#define SCNX32 "lX"
|
||||
#define SCNoLEAST32 "lo"
|
||||
#define SCNuLEAST32 "lu"
|
||||
#define SCNxLEAST32 "lx"
|
||||
#define SCNXLEAST32 "lX"
|
||||
#define SCNoFAST32 "lo"
|
||||
#define SCNuFAST32 "lu"
|
||||
#define SCNxFAST32 "lx"
|
||||
#define SCNXFAST32 "lX"
|
||||
|
||||
#define SCNo64 "I64o"
|
||||
#define SCNu64 "I64u"
|
||||
#define SCNx64 "I64x"
|
||||
#define SCNX64 "I64X"
|
||||
#define SCNoLEAST64 "I64o"
|
||||
#define SCNuLEAST64 "I64u"
|
||||
#define SCNxLEAST64 "I64x"
|
||||
#define SCNXLEAST64 "I64X"
|
||||
#define SCNoFAST64 "I64o"
|
||||
#define SCNuFAST64 "I64u"
|
||||
#define SCNxFAST64 "I64x"
|
||||
#define SCNXFAST64 "I64X"
|
||||
|
||||
#define SCNoMAX "I64o"
|
||||
#define SCNuMAX "I64u"
|
||||
#define SCNxMAX "I64x"
|
||||
#define SCNXMAX "I64X"
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define SCNoPTR "I64o"
|
||||
# define SCNuPTR "I64u"
|
||||
# define SCNxPTR "I64x"
|
||||
# define SCNXPTR "I64X"
|
||||
#else // _WIN64 ][
|
||||
# define SCNoPTR "lo"
|
||||
# define SCNuPTR "lu"
|
||||
# define SCNxPTR "lx"
|
||||
# define SCNXPTR "lX"
|
||||
#endif // _WIN64 ]
|
||||
|
||||
#endif // __STDC_FORMAT_MACROS ]
|
||||
|
||||
// 7.8.2 Functions for greatest-width integer types
|
||||
|
||||
// 7.8.2.1 The imaxabs function
|
||||
#define imaxabs _abs64
|
||||
|
||||
// 7.8.2.2 The imaxdiv function
|
||||
|
||||
// This is modified version of div() function from Microsoft's div.c found
|
||||
// in %MSVC.NET%\crt\src\div.c
|
||||
#ifdef STATIC_IMAXDIV // [
|
||||
static
|
||||
#else // STATIC_IMAXDIV ][
|
||||
_inline
|
||||
#endif // STATIC_IMAXDIV ]
|
||||
imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
|
||||
{
|
||||
imaxdiv_t result;
|
||||
|
||||
result.quot = numer / denom;
|
||||
result.rem = numer % denom;
|
||||
|
||||
if (numer < 0 && result.rem > 0) {
|
||||
// did division wrong; must fix up
|
||||
++result.quot;
|
||||
result.rem -= denom;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// 7.8.2.3 The strtoimax and strtoumax functions
|
||||
#define strtoimax _strtoi64
|
||||
#define strtoumax _strtoui64
|
||||
|
||||
// 7.8.2.4 The wcstoimax and wcstoumax functions
|
||||
#define wcstoimax _wcstoi64
|
||||
#define wcstoumax _wcstoui64
|
||||
|
||||
|
||||
#endif // _MSC_INTTYPES_H_ ]
|
|
@ -1,247 +0,0 @@
|
|||
// ISO C9x compliant stdint.h for Microsoft Visual Studio
|
||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||
//
|
||||
// Copyright (c) 2006-2008 Alexander Chemeris
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. The name of the author may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MSC_VER // [
|
||||
#error "Use this header only with Microsoft Visual C++ compilers!"
|
||||
#endif // _MSC_VER ]
|
||||
|
||||
#ifndef _MSC_STDINT_H_ // [
|
||||
#define _MSC_STDINT_H_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
|
||||
// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
|
||||
// or compiler give many errors like this:
|
||||
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
# include <wchar.h>
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
// Define _W64 macros to mark types changing their size, like intptr_t.
|
||||
#ifndef _W64
|
||||
# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
|
||||
# define _W64 __w64
|
||||
# else
|
||||
# define _W64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
// 7.18.1 Integer types
|
||||
|
||||
// 7.18.1.1 Exact-width integer types
|
||||
|
||||
// Visual Studio 6 and Embedded Visual C++ 4 doesn't
|
||||
// realize that, e.g. char has the same size as __int8
|
||||
// so we give up on __intX for them.
|
||||
#if (_MSC_VER < 1300)
|
||||
typedef signed char int8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned int uint32_t;
|
||||
#else
|
||||
typedef signed __int8 int8_t;
|
||||
typedef signed __int16 int16_t;
|
||||
typedef signed __int32 int32_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
#endif
|
||||
typedef signed __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
|
||||
|
||||
// 7.18.1.2 Minimum-width integer types
|
||||
typedef int8_t int_least8_t;
|
||||
typedef int16_t int_least16_t;
|
||||
typedef int32_t int_least32_t;
|
||||
typedef int64_t int_least64_t;
|
||||
typedef uint8_t uint_least8_t;
|
||||
typedef uint16_t uint_least16_t;
|
||||
typedef uint32_t uint_least32_t;
|
||||
typedef uint64_t uint_least64_t;
|
||||
|
||||
// 7.18.1.3 Fastest minimum-width integer types
|
||||
typedef int8_t int_fast8_t;
|
||||
typedef int16_t int_fast16_t;
|
||||
typedef int32_t int_fast32_t;
|
||||
typedef int64_t int_fast64_t;
|
||||
typedef uint8_t uint_fast8_t;
|
||||
typedef uint16_t uint_fast16_t;
|
||||
typedef uint32_t uint_fast32_t;
|
||||
typedef uint64_t uint_fast64_t;
|
||||
|
||||
// 7.18.1.4 Integer types capable of holding object pointers
|
||||
#ifdef _WIN64 // [
|
||||
typedef signed __int64 intptr_t;
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
#else // _WIN64 ][
|
||||
typedef _W64 signed int intptr_t;
|
||||
typedef _W64 unsigned int uintptr_t;
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// 7.18.1.5 Greatest-width integer types
|
||||
typedef int64_t intmax_t;
|
||||
typedef uint64_t uintmax_t;
|
||||
|
||||
|
||||
// 7.18.2 Limits of specified-width integer types
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
|
||||
|
||||
// 7.18.2.1 Limits of exact-width integer types
|
||||
#define INT8_MIN ((int8_t)_I8_MIN)
|
||||
#define INT8_MAX _I8_MAX
|
||||
#define INT16_MIN ((int16_t)_I16_MIN)
|
||||
#define INT16_MAX _I16_MAX
|
||||
#define INT32_MIN ((int32_t)_I32_MIN)
|
||||
#define INT32_MAX _I32_MAX
|
||||
#define INT64_MIN ((int64_t)_I64_MIN)
|
||||
#define INT64_MAX _I64_MAX
|
||||
#define UINT8_MAX _UI8_MAX
|
||||
#define UINT16_MAX _UI16_MAX
|
||||
#define UINT32_MAX _UI32_MAX
|
||||
#define UINT64_MAX _UI64_MAX
|
||||
|
||||
// 7.18.2.2 Limits of minimum-width integer types
|
||||
#define INT_LEAST8_MIN INT8_MIN
|
||||
#define INT_LEAST8_MAX INT8_MAX
|
||||
#define INT_LEAST16_MIN INT16_MIN
|
||||
#define INT_LEAST16_MAX INT16_MAX
|
||||
#define INT_LEAST32_MIN INT32_MIN
|
||||
#define INT_LEAST32_MAX INT32_MAX
|
||||
#define INT_LEAST64_MIN INT64_MIN
|
||||
#define INT_LEAST64_MAX INT64_MAX
|
||||
#define UINT_LEAST8_MAX UINT8_MAX
|
||||
#define UINT_LEAST16_MAX UINT16_MAX
|
||||
#define UINT_LEAST32_MAX UINT32_MAX
|
||||
#define UINT_LEAST64_MAX UINT64_MAX
|
||||
|
||||
// 7.18.2.3 Limits of fastest minimum-width integer types
|
||||
#define INT_FAST8_MIN INT8_MIN
|
||||
#define INT_FAST8_MAX INT8_MAX
|
||||
#define INT_FAST16_MIN INT16_MIN
|
||||
#define INT_FAST16_MAX INT16_MAX
|
||||
#define INT_FAST32_MIN INT32_MIN
|
||||
#define INT_FAST32_MAX INT32_MAX
|
||||
#define INT_FAST64_MIN INT64_MIN
|
||||
#define INT_FAST64_MAX INT64_MAX
|
||||
#define UINT_FAST8_MAX UINT8_MAX
|
||||
#define UINT_FAST16_MAX UINT16_MAX
|
||||
#define UINT_FAST32_MAX UINT32_MAX
|
||||
#define UINT_FAST64_MAX UINT64_MAX
|
||||
|
||||
// 7.18.2.4 Limits of integer types capable of holding object pointers
|
||||
#ifdef _WIN64 // [
|
||||
# define INTPTR_MIN INT64_MIN
|
||||
# define INTPTR_MAX INT64_MAX
|
||||
# define UINTPTR_MAX UINT64_MAX
|
||||
#else // _WIN64 ][
|
||||
# define INTPTR_MIN INT32_MIN
|
||||
# define INTPTR_MAX INT32_MAX
|
||||
# define UINTPTR_MAX UINT32_MAX
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// 7.18.2.5 Limits of greatest-width integer types
|
||||
#define INTMAX_MIN INT64_MIN
|
||||
#define INTMAX_MAX INT64_MAX
|
||||
#define UINTMAX_MAX UINT64_MAX
|
||||
|
||||
// 7.18.3 Limits of other integer types
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define PTRDIFF_MIN _I64_MIN
|
||||
# define PTRDIFF_MAX _I64_MAX
|
||||
#else // _WIN64 ][
|
||||
# define PTRDIFF_MIN _I32_MIN
|
||||
# define PTRDIFF_MAX _I32_MAX
|
||||
#endif // _WIN64 ]
|
||||
|
||||
#define SIG_ATOMIC_MIN INT_MIN
|
||||
#define SIG_ATOMIC_MAX INT_MAX
|
||||
|
||||
#ifndef SIZE_MAX // [
|
||||
# ifdef _WIN64 // [
|
||||
# define SIZE_MAX _UI64_MAX
|
||||
# else // _WIN64 ][
|
||||
# define SIZE_MAX _UI32_MAX
|
||||
# endif // _WIN64 ]
|
||||
#endif // SIZE_MAX ]
|
||||
|
||||
// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
|
||||
#ifndef WCHAR_MIN // [
|
||||
# define WCHAR_MIN 0
|
||||
#endif // WCHAR_MIN ]
|
||||
#ifndef WCHAR_MAX // [
|
||||
# define WCHAR_MAX _UI16_MAX
|
||||
#endif // WCHAR_MAX ]
|
||||
|
||||
#define WINT_MIN 0
|
||||
#define WINT_MAX _UI16_MAX
|
||||
|
||||
#endif // __STDC_LIMIT_MACROS ]
|
||||
|
||||
|
||||
// 7.18.4 Limits of other integer types
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
|
||||
|
||||
// 7.18.4.1 Macros for minimum-width integer constants
|
||||
|
||||
#define INT8_C(val) val##i8
|
||||
#define INT16_C(val) val##i16
|
||||
#define INT32_C(val) val##i32
|
||||
#define INT64_C(val) val##i64
|
||||
|
||||
#define UINT8_C(val) val##ui8
|
||||
#define UINT16_C(val) val##ui16
|
||||
#define UINT32_C(val) val##ui32
|
||||
#define UINT64_C(val) val##ui64
|
||||
|
||||
// 7.18.4.2 Macros for greatest-width integer constants
|
||||
#define INTMAX_C INT64_C
|
||||
#define UINTMAX_C UINT64_C
|
||||
|
||||
#endif // __STDC_CONSTANT_MACROS ]
|
||||
|
||||
|
||||
#endif // _MSC_STDINT_H_ ]
|
|
@ -1,21 +0,0 @@
|
|||
#ifndef __mutex_h__
|
||||
#define __mutex_h__
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
#else
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
typedef HANDLE mutex_t;
|
||||
#else
|
||||
typedef pthread_mutex_t mutex_t;
|
||||
#endif
|
||||
|
||||
extern int32_t mutex_init(mutex_t *mutex);
|
||||
extern int32_t mutex_lock(mutex_t *mutex);
|
||||
extern int32_t mutex_unlock(mutex_t *mutex);
|
||||
|
||||
#endif
|
|
@ -1,302 +0,0 @@
|
|||
/* nedalloc, an alternative malloc implementation for multiple threads without
|
||||
lock contention based on dlmalloc v2.8.3. (C) 2005-2009 Niall Douglas
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef NEDMALLOC_H
|
||||
#define NEDMALLOC_H
|
||||
|
||||
|
||||
/* See malloc.c.h for what each function does.
|
||||
|
||||
REPLACE_SYSTEM_ALLOCATOR on POSIX causes nedalloc's functions to be called
|
||||
malloc, free etc. instead of nedmalloc, nedfree etc. You may or may not want
|
||||
this. On Windows it causes nedmalloc to patch all loaded DLLs and binaries
|
||||
to replace usage of the system allocator.
|
||||
|
||||
NO_NED_NAMESPACE prevents the functions from being defined in the nedalloc
|
||||
namespace when in C++ (uses the global namespace instead).
|
||||
|
||||
NEDMALLOCEXTSPEC can be defined to be __declspec(dllexport) or
|
||||
__attribute__ ((visibility("default"))) or whatever you like. It defaults
|
||||
to extern unless NEDMALLOC_DLL_EXPORTS is set as it would be when building
|
||||
nedmalloc.dll.
|
||||
|
||||
USE_LOCKS can be 2 if you want to define your own MLOCK_T, INITIAL_LOCK,
|
||||
ACQUIRE_LOCK, RELEASE_LOCK, TRY_LOCK, IS_LOCKED and NULL_LOCK_INITIALIZER.
|
||||
|
||||
NEDMALLOC_DEBUG can be defined to cause DEBUG to be set differently for nedmalloc
|
||||
than for the rest of the build. Remember to set NDEBUG to disable all assertion
|
||||
checking too.
|
||||
|
||||
USE_MAGIC_HEADERS causes nedalloc to allocate an extra three sizeof(size_t)
|
||||
to each block. nedpfree() and nedprealloc() can then automagically know when
|
||||
to free a system allocated block. Enabling this typically adds 20-50% to
|
||||
application memory usage.
|
||||
|
||||
ENABLE_TOLERANT_NEDMALLOC is automatically turned on if REPLACE_SYSTEM_ALLOCATOR
|
||||
is set or the Windows DLL is being built. This causes nedmalloc to detect when a
|
||||
system allocator block is passed to it and to handle it appropriately. Note that
|
||||
without USE_MAGIC_HEADERS there is a very tiny chance that nedmalloc will segfault
|
||||
on non-Windows builds (it uses Win32 SEH to trap segfaults on Windows and there
|
||||
is no comparable system on POSIX).
|
||||
|
||||
USE_ALLOCATOR can be one of these settings (it defaults to 1):
|
||||
0: System allocator (nedmalloc now simply acts as a threadcache).
|
||||
WARNING: Intended for DEBUG USE ONLY - not all functions work correctly.
|
||||
1: dlmalloc
|
||||
|
||||
ENABLE_LARGE_PAGES enables support for requesting memory from the system in large
|
||||
(typically >=2Mb) pages if the host OS supports this. These occupy just a single
|
||||
TLB entry and can significantly improve performance in large working set applications.
|
||||
|
||||
ENABLE_FAST_HEAP_DETECTION enables special logic to detect blocks allocated
|
||||
by the system heap. This avoids 1.5%-2% overhead when checking for non-nedmalloc
|
||||
blocks, but it assumes that the NT and glibc heaps function in a very specific
|
||||
fashion which may not hold true across OS upgrades.
|
||||
*/
|
||||
|
||||
#include <stddef.h> /* for size_t */
|
||||
|
||||
#define USE_ALLOCATOR 1
|
||||
#define USE_MAGIC_HEADERS 1
|
||||
#define MAXTHREADSINPOOL 2
|
||||
#define FINEGRAINEDBINS 1
|
||||
#define ENABLE_LARGE_PAGES 1
|
||||
#define ENABLE_FAST_HEAP_DETECTION 1
|
||||
#define NDEBUG 1
|
||||
#define THREADCACHEMAX 4194304
|
||||
#define THREADCACHEMAXBINS ((22-4)*2)
|
||||
|
||||
#ifndef NEDMALLOCEXTSPEC
|
||||
#ifdef NEDMALLOC_DLL_EXPORTS
|
||||
#ifdef WIN32
|
||||
#define NEDMALLOCEXTSPEC extern __declspec(dllexport)
|
||||
#elif defined(__GNUC__)
|
||||
#define NEDMALLOCEXTSPEC extern __attribute__ ((visibility("default")))
|
||||
#endif
|
||||
#ifndef ENABLE_TOLERANT_NEDMALLOC
|
||||
#define ENABLE_TOLERANT_NEDMALLOC 1
|
||||
#endif
|
||||
#else
|
||||
#define NEDMALLOCEXTSPEC extern
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if __STDC_VERSION__ >= 199901L /* C99 or better */
|
||||
#define RESTRICT restrict
|
||||
#else
|
||||
#if defined(_MSC_VER) && _MSC_VER>=1400
|
||||
#define RESTRICT __restrict
|
||||
#endif
|
||||
#ifdef __GNUC__
|
||||
#define RESTRICT __restrict
|
||||
#endif
|
||||
#endif
|
||||
#ifndef RESTRICT
|
||||
#define RESTRICT
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER>=1400
|
||||
#define NEDMALLOCPTRATTR __declspec(restrict)
|
||||
#define NEDMALLOCNOALIASATTR __declspec(noalias)
|
||||
#endif
|
||||
#ifdef __GNUC__
|
||||
#define NEDMALLOCPTRATTR __attribute__ ((malloc))
|
||||
#endif
|
||||
#ifndef NEDMALLOCPTRATTR
|
||||
#define NEDMALLOCPTRATTR
|
||||
#endif
|
||||
#ifndef NEDMALLOCNOALIASATTR
|
||||
#define NEDMALLOCNOALIASATTR
|
||||
#endif
|
||||
|
||||
#ifndef USE_MAGIC_HEADERS
|
||||
#define USE_MAGIC_HEADERS 0
|
||||
#endif
|
||||
|
||||
#ifndef USE_ALLOCATOR
|
||||
#define USE_ALLOCATOR 1 /* dlmalloc */
|
||||
#endif
|
||||
|
||||
#if !USE_ALLOCATOR && !USE_MAGIC_HEADERS
|
||||
#error If you are using the system allocator then you MUST use magic headers
|
||||
#endif
|
||||
|
||||
#ifdef REPLACE_SYSTEM_ALLOCATOR
|
||||
#if USE_ALLOCATOR==0
|
||||
#error Cannot combine using the system allocator with replacing the system allocator
|
||||
#endif
|
||||
#ifndef ENABLE_TOLERANT_NEDMALLOC
|
||||
#define ENABLE_TOLERANT_NEDMALLOC 1
|
||||
#endif
|
||||
#ifndef WIN32 /* We have a dedicated patcher for Windows */
|
||||
#define nedmalloc malloc
|
||||
#define nedcalloc calloc
|
||||
#define nedrealloc realloc
|
||||
#define nedfree free
|
||||
#define nedmemalign memalign
|
||||
#define nedmallinfo mallinfo
|
||||
#define nedmallopt mallopt
|
||||
#define nedmalloc_trim malloc_trim
|
||||
#define nedmalloc_stats malloc_stats
|
||||
#define nedmalloc_footprint malloc_footprint
|
||||
#define nedindependent_calloc independent_calloc
|
||||
#define nedindependent_comalloc independent_comalloc
|
||||
#ifdef _MSC_VER
|
||||
#define nedblksize _msize
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
struct nedmallinfo {
|
||||
size_t arena; /* non-mmapped space allocated from system */
|
||||
size_t ordblks; /* number of free chunks */
|
||||
size_t smblks; /* always 0 */
|
||||
size_t hblks; /* always 0 */
|
||||
size_t hblkhd; /* space in mmapped regions */
|
||||
size_t usmblks; /* maximum total allocated space */
|
||||
size_t fsmblks; /* always 0 */
|
||||
size_t uordblks; /* total allocated space */
|
||||
size_t fordblks; /* total free space */
|
||||
size_t keepcost; /* releasable (via malloc_trim) space */
|
||||
};
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if !defined(NO_NED_NAMESPACE)
|
||||
namespace nedalloc {
|
||||
#else
|
||||
extern "C" {
|
||||
#endif
|
||||
#define THROWSPEC throw()
|
||||
#else
|
||||
#define THROWSPEC
|
||||
#endif
|
||||
|
||||
/* These are the global functions */
|
||||
|
||||
/* Gets the usable size of an allocated block. Note this will always be bigger than what was
|
||||
asked for due to rounding etc. Optionally returns 1 in isforeign if the block came from the
|
||||
system allocator - note that there is a small (>0.01%) but real chance of segfault on non-Windows
|
||||
systems when passing non-nedmalloc blocks if you don't use USE_MAGIC_HEADERS.
|
||||
*/
|
||||
NEDMALLOCEXTSPEC NEDMALLOCNOALIASATTR size_t nedblksize(int *RESTRICT isforeign, void *RESTRICT mem) THROWSPEC;
|
||||
|
||||
NEDMALLOCEXTSPEC NEDMALLOCNOALIASATTR void nedsetvalue(void *v) THROWSPEC;
|
||||
|
||||
NEDMALLOCEXTSPEC NEDMALLOCNOALIASATTR NEDMALLOCPTRATTR void * nedmalloc(size_t size) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC NEDMALLOCNOALIASATTR NEDMALLOCPTRATTR void * nedcalloc(size_t no, size_t size) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC NEDMALLOCNOALIASATTR NEDMALLOCPTRATTR void * nedrealloc(void *mem, size_t size) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC NEDMALLOCNOALIASATTR void nedfree(void *mem) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC NEDMALLOCNOALIASATTR NEDMALLOCPTRATTR void * nedmemalign(size_t alignment, size_t bytes) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC NEDMALLOCNOALIASATTR struct nedmallinfo nedmallinfo(void) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC NEDMALLOCNOALIASATTR int nedmallopt(int parno, int value) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC NEDMALLOCNOALIASATTR void* nedmalloc_internals(size_t *granularity, size_t *magic) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC NEDMALLOCNOALIASATTR int nedmalloc_trim(size_t pad) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC void nedmalloc_stats(void) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC NEDMALLOCNOALIASATTR size_t nedmalloc_footprint(void) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC NEDMALLOCNOALIASATTR NEDMALLOCPTRATTR void **nedindependent_calloc(size_t elemsno, size_t elemsize, void **chunks) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC NEDMALLOCNOALIASATTR NEDMALLOCPTRATTR void **nedindependent_comalloc(size_t elems, size_t *sizes, void **chunks) THROWSPEC;
|
||||
|
||||
/* Destroys the system memory pool used by the functions above.
|
||||
Useful for when you have nedmalloc in a DLL you're about to unload.
|
||||
If you call ANY nedmalloc functions after calling this you will
|
||||
get a fatal exception!
|
||||
*/
|
||||
NEDMALLOCEXTSPEC void neddestroysyspool() THROWSPEC;
|
||||
|
||||
/* These are the pool functions */
|
||||
struct nedpool_t;
|
||||
typedef struct nedpool_t nedpool;
|
||||
|
||||
/* Creates a memory pool for use with the nedp* functions below.
|
||||
Capacity is how much to allocate immediately (if you know you'll be allocating a lot
|
||||
of memory very soon) which you can leave at zero. Threads specifies how many threads
|
||||
will *normally* be accessing the pool concurrently. Setting this to zero means it
|
||||
extends on demand, but be careful of this as it can rapidly consume system resources
|
||||
where bursts of concurrent threads use a pool at once.
|
||||
*/
|
||||
NEDMALLOCEXTSPEC NEDMALLOCPTRATTR nedpool *nedcreatepool(size_t capacity, int threads) THROWSPEC;
|
||||
|
||||
/* Destroys a memory pool previously created by nedcreatepool().
|
||||
*/
|
||||
NEDMALLOCEXTSPEC void neddestroypool(nedpool *p) THROWSPEC;
|
||||
|
||||
/* Returns a zero terminated snapshot of threadpools existing at the time of call. Call
|
||||
nedfree() on the returned list when you are done. Returns zero if there is only the
|
||||
system pool in existence.
|
||||
*/
|
||||
NEDMALLOCEXTSPEC nedpool **nedpoollist() THROWSPEC;
|
||||
|
||||
/* Sets a value to be associated with a pool. You can retrieve this value by passing
|
||||
any memory block allocated from that pool.
|
||||
*/
|
||||
NEDMALLOCEXTSPEC void nedpsetvalue(nedpool *p, void *v) THROWSPEC;
|
||||
|
||||
/* Gets a previously set value using nedpsetvalue() or zero if memory is unknown.
|
||||
Optionally can also retrieve pool. You can detect an unknown block by the return
|
||||
being zero and *p being unmodifed.
|
||||
*/
|
||||
NEDMALLOCEXTSPEC void *nedgetvalue(nedpool **p, void *mem) THROWSPEC;
|
||||
|
||||
/* Trims the thread cache for the calling thread, returning any existing cache
|
||||
data to the central pool. Remember to ALWAYS call with zero if you used the
|
||||
system pool. Setting disable to non-zero replicates neddisablethreadcache().
|
||||
*/
|
||||
NEDMALLOCEXTSPEC void nedtrimthreadcache(nedpool *p, int disable) THROWSPEC;
|
||||
|
||||
/* Disables the thread cache for the calling thread, returning any existing cache
|
||||
data to the central pool. Remember to ALWAYS call with zero if you used the
|
||||
system pool.
|
||||
*/
|
||||
NEDMALLOCEXTSPEC void neddisablethreadcache(nedpool *p) THROWSPEC;
|
||||
|
||||
|
||||
NEDMALLOCEXTSPEC NEDMALLOCPTRATTR void * nedpmalloc(nedpool *p, size_t size) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC NEDMALLOCPTRATTR void * nedpcalloc(nedpool *p, size_t no, size_t size) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC NEDMALLOCPTRATTR void * nedprealloc(nedpool *p, void *mem, size_t size) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC void nedpfree(nedpool *p, void *mem) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC NEDMALLOCPTRATTR void * nedpmemalign(nedpool *p, size_t alignment, size_t bytes) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC struct nedmallinfo nedpmallinfo(nedpool *p) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC int nedpmallopt(nedpool *p, int parno, int value) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC int nedpmalloc_trim(nedpool *p, size_t pad) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC void nedpmalloc_stats(nedpool *p) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC size_t nedpmalloc_footprint(nedpool *p) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC NEDMALLOCPTRATTR void **nedpindependent_calloc(nedpool *p, size_t elemsno, size_t elemsize, void **chunks) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC NEDMALLOCPTRATTR void **nedpindependent_comalloc(nedpool *p, size_t elems, size_t *sizes, void **chunks) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC NEDMALLOCPTRATTR char * nedstrdup(const char *str) THROWSPEC;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,201 +0,0 @@
|
|||
// On-screen display (ie. console)
|
||||
// for the Build Engine
|
||||
// by Jonathon Fowler (jonof@edgenetwk.com)
|
||||
|
||||
#ifndef __osd_h__
|
||||
#define __osd_h__
|
||||
|
||||
|
||||
typedef struct {
|
||||
int32_t numparms;
|
||||
const char *name;
|
||||
const char **parms;
|
||||
const char *raw;
|
||||
} osdfuncparm_t;
|
||||
|
||||
typedef struct _symbol
|
||||
{
|
||||
const char *name;
|
||||
struct _symbol *next;
|
||||
|
||||
const char *help;
|
||||
int32_t (*func)(const osdfuncparm_t *);
|
||||
} symbol_t;
|
||||
|
||||
symbol_t *symbols;
|
||||
|
||||
const char *OSD_StripColors(char *out, const char *in);
|
||||
|
||||
enum cvartype_t
|
||||
{
|
||||
CVAR_FLOAT = 0x00000001,
|
||||
CVAR_INT = 0x00000002,
|
||||
CVAR_UINT = 0x00000004,
|
||||
CVAR_BOOL = 0x00000008,
|
||||
CVAR_STRING = 0x00000010,
|
||||
CVAR_DOUBLE = 0x00000020,
|
||||
CVAR_NOMULTI = 0x00000040,
|
||||
CVAR_MULTI = 0x00000080,
|
||||
CVAR_NOSAVE = 0x00000100,
|
||||
CVAR_FUNCPTR = 0x00000200,
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const char *name;
|
||||
const char *helpstr;
|
||||
void *var;
|
||||
int32_t type; // see cvartype_t
|
||||
int32_t min;
|
||||
int32_t max; // for string, is the length
|
||||
} cvar_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *name;
|
||||
char *helpstr;
|
||||
void *var;
|
||||
int32_t type; // see cvartype_t
|
||||
int32_t min;
|
||||
int32_t max; // for string, is the length
|
||||
|
||||
// everything before this point needs to match cvar_t
|
||||
|
||||
// default value for cvar, assigned when var is registered
|
||||
union
|
||||
{
|
||||
int32_t i;
|
||||
uint32_t uint;
|
||||
float f;
|
||||
double d;
|
||||
} dval;
|
||||
} osdcvar_t;
|
||||
|
||||
enum osdflags_t
|
||||
{
|
||||
OSD_INITIALIZED = 0x00000001,
|
||||
OSD_DRAW = 0x00000002,
|
||||
OSD_CAPTURE = 0x00000004,
|
||||
OSD_OVERTYPE = 0x00000008,
|
||||
OSD_SHIFT = 0x00000010,
|
||||
OSD_CTRL = 0x00000020,
|
||||
OSD_CAPS = 0x00000040
|
||||
};
|
||||
|
||||
#define OSD_ALIAS (void *)0x1337
|
||||
#define OSD_UNALIASED (void *)0xDEAD
|
||||
|
||||
#define OSDCMD_OK 0
|
||||
#define OSDCMD_SHOWHELP 1
|
||||
|
||||
int32_t OSD_ParsingScript(void);
|
||||
|
||||
int32_t OSD_OSDKey(void);
|
||||
int32_t OSD_GetTextMode(void);
|
||||
void OSD_SetTextMode(int32_t mode);
|
||||
|
||||
int32_t OSD_Exec(const char *szScript);
|
||||
|
||||
char *OSD_GetFmt(char *ptr);
|
||||
char *OSD_GetTextPtr(void);
|
||||
char *OSD_GetFmtPtr(void);
|
||||
|
||||
int32_t OSD_GetCols(void);
|
||||
int32_t OSD_IsMoving(void);
|
||||
|
||||
// initializes things
|
||||
void OSD_Init(void);
|
||||
|
||||
// sets the file to echo output to
|
||||
void OSD_SetLogFile(char *fn);
|
||||
|
||||
// sets the functions the OSD will call to interrogate the environment
|
||||
void OSD_SetFunctions(
|
||||
void (*drawchar)(int32_t,int32_t,char,int32_t,int32_t),
|
||||
void (*drawstr)(int32_t,int32_t,char*,int32_t,int32_t,int32_t),
|
||||
void (*drawcursor)(int32_t,int32_t,int32_t,int32_t),
|
||||
int32_t (*colwidth)(int32_t),
|
||||
int32_t (*rowheight)(int32_t),
|
||||
void (*clearbg)(int32_t,int32_t),
|
||||
int32_t (*gettime)(void),
|
||||
void (*onshow)(int32_t)
|
||||
);
|
||||
|
||||
// sets the parameters for presenting the text
|
||||
void OSD_SetParameters(
|
||||
int32_t promptshade, int32_t promptpal,
|
||||
int32_t editshade, int32_t editpal,
|
||||
int32_t textshade, int32_t textpal
|
||||
);
|
||||
|
||||
// sets the scancode for the key which activates the onscreen display
|
||||
void OSD_CaptureKey(int32_t sc);
|
||||
|
||||
// handles keyboard input when capturing input. returns 0 if key was handled
|
||||
// or the scancode if it should be handled by the game.
|
||||
int32_t OSD_HandleScanCode(int32_t sc, int32_t press);
|
||||
int32_t OSD_HandleChar(char ch);
|
||||
|
||||
// handles the readjustment when screen resolution changes
|
||||
void OSD_ResizeDisplay(int32_t w,int32_t h);
|
||||
|
||||
// captures and frees osd input
|
||||
void OSD_CaptureInput(int32_t cap);
|
||||
|
||||
// sets the console version string
|
||||
void OSD_SetVersion(const char *version, int32_t shade, int32_t pal);
|
||||
|
||||
// shows or hides the onscreen display
|
||||
void OSD_ShowDisplay(int32_t onf);
|
||||
|
||||
// draw the osd to the screen
|
||||
void OSD_Draw(void);
|
||||
|
||||
// just like printf
|
||||
void OSD_Printf(const char *fmt, ...) ATTRIBUTE((format(printf,1,2)));
|
||||
|
||||
// executes buffered commands
|
||||
void OSD_DispatchQueued(void);
|
||||
|
||||
// executes a string
|
||||
int32_t OSD_Dispatch(const char *cmd);
|
||||
|
||||
// registers a function
|
||||
// name = name of the function
|
||||
// help = a short help string
|
||||
// func = the entry point to the function
|
||||
int32_t OSD_RegisterFunction(const char *name, const char *help, int32_t (*func)(const osdfuncparm_t*));
|
||||
|
||||
int32_t osdcmd_cvar_set(const osdfuncparm_t *parm);
|
||||
int32_t OSD_RegisterCvar(const cvar_t *cvar);
|
||||
void OSD_WriteCvars(FILE *fp);
|
||||
|
||||
// these correspond to the Duke palettes, so they shouldn't really be here
|
||||
// ...but I don't care
|
||||
|
||||
#define OSDTEXT_BLUE "^00"
|
||||
#define OSDTEXT_GOLD "^07"
|
||||
#define OSDTEXT_DARKRED "^10"
|
||||
#define OSDTEXT_GREEN "^11"
|
||||
#define OSDTEXT_GRAY "^12"
|
||||
#define OSDTEXT_DARKGRAY "^13"
|
||||
#define OSDTEXT_DARKGREEN "^14"
|
||||
#define OSDTEXT_BROWN "^15"
|
||||
#define OSDTEXT_DARKBLUE "^16"
|
||||
#define OSDTEXT_RED "^21"
|
||||
#define OSDTEXT_YELLOW "^23"
|
||||
|
||||
#define OSDTEXT_BRIGHT "^S0"
|
||||
|
||||
#define OSD_ERROR OSDTEXT_DARKRED OSDTEXT_BRIGHT
|
||||
#define TEXTSIZE 32768
|
||||
|
||||
#define OSD_EDITLENGTH 511
|
||||
#define OSD_HISTORYDEPTH 32
|
||||
|
||||
extern char osdhistorybuf[OSD_HISTORYDEPTH][OSD_EDITLENGTH+1]; // history strings
|
||||
extern int32_t osdhistorysize; // number of entries in history
|
||||
extern int32_t osdhistorytotal; // number of total history entries
|
||||
|
||||
#endif // __osd_h__
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
#ifndef __osxbits_h__
|
||||
#define __osxbits_h__
|
||||
#include <sys/types.h>
|
||||
|
||||
int32_t osx_msgbox(char *name, char *msg);
|
||||
int32_t osx_ynbox(char *name, char *msg);
|
||||
|
||||
#endif
|
|
@ -1,11 +0,0 @@
|
|||
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
|
||||
Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
|
||||
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
|
||||
|
||||
Feel free to customize this file to suit your needs
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface SDLMain : NSObject
|
||||
@end
|
|
@ -1,506 +0,0 @@
|
|||
// here lies the GREAT JUSTICE RENDERER
|
||||
// TODO :
|
||||
// - CORE STUFF
|
||||
// o there's also the texture alignment problem Hunter reported (san andreas fault)
|
||||
// o RTT portals (water)
|
||||
// o clip mirrors/portals to their planes
|
||||
// o merge mirrors/portals from the same plane
|
||||
// - SPRITES
|
||||
// o sprite panning
|
||||
// - SKIES
|
||||
// o skyview
|
||||
// - MDSPRITES
|
||||
// o need full translation and rotation support from CON to attach to game world or tags
|
||||
//
|
||||
// the renderer should hopefully be pretty solid after all that
|
||||
// the rest will be a bliss :)
|
||||
|
||||
#ifndef _polymer_h_
|
||||
# define _polymer_h_
|
||||
|
||||
# include "compat.h"
|
||||
# include "baselayer.h"
|
||||
# include "build.h"
|
||||
# include "glbuild.h"
|
||||
# include "osd.h"
|
||||
# include "hightile.h"
|
||||
# include "mdsprite.h"
|
||||
# include "polymost.h"
|
||||
# include "pragmas.h"
|
||||
# include <math.h>
|
||||
|
||||
// CVARS
|
||||
extern int32_t pr_lighting;
|
||||
extern int32_t pr_normalmapping;
|
||||
extern int32_t pr_specularmapping;
|
||||
extern int32_t pr_shadows;
|
||||
extern int32_t pr_shadowcount;
|
||||
extern int32_t pr_shadowdetail;
|
||||
extern int32_t pr_shadowfiltering;
|
||||
extern int32_t pr_maxlightpasses;
|
||||
extern int32_t pr_maxlightpriority;
|
||||
extern int32_t pr_fov;
|
||||
extern float pr_customaspect;
|
||||
extern int32_t pr_billboardingmode;
|
||||
extern int32_t pr_verbosity;
|
||||
extern int32_t pr_wireframe;
|
||||
extern int32_t pr_vbos;
|
||||
extern int32_t pr_gpusmoothing;
|
||||
extern int32_t pr_overrideparallax;
|
||||
extern float pr_parallaxscale;
|
||||
extern float pr_parallaxbias;
|
||||
extern int32_t pr_overridespecular;
|
||||
extern float pr_specularpower;
|
||||
extern float pr_specularfactor;
|
||||
extern int32_t pr_highpalookups;
|
||||
extern int32_t pr_overridehud;
|
||||
extern float pr_hudxadd;
|
||||
extern float pr_hudyadd;
|
||||
extern float pr_hudzadd;
|
||||
extern int32_t pr_hudangadd;
|
||||
extern int32_t pr_hudfov;
|
||||
extern float pr_overridemodelscale;
|
||||
extern int32_t pr_ati_fboworkaround;
|
||||
extern int32_t pr_ati_nodepthoffset;
|
||||
#ifdef __APPLE__
|
||||
extern int32_t pr_ati_textureformat_one;
|
||||
#endif
|
||||
|
||||
extern int32_t r_pr_maxlightpasses;
|
||||
|
||||
// MATERIAL
|
||||
typedef enum {
|
||||
PR_BIT_HEADER, // must be first
|
||||
PR_BIT_ANIM_INTERPOLATION,
|
||||
PR_BIT_LIGHTING_PASS,
|
||||
PR_BIT_NORMAL_MAP,
|
||||
PR_BIT_DIFFUSE_MAP,
|
||||
PR_BIT_DIFFUSE_DETAIL_MAP,
|
||||
PR_BIT_DIFFUSE_MODULATION,
|
||||
PR_BIT_DIFFUSE_MAP2,
|
||||
PR_BIT_HIGHPALOOKUP_MAP,
|
||||
PR_BIT_SPECULAR_MAP,
|
||||
PR_BIT_SPECULAR_MATERIAL,
|
||||
PR_BIT_MIRROR_MAP,
|
||||
PR_BIT_FOG,
|
||||
PR_BIT_GLOW_MAP,
|
||||
PR_BIT_PROJECTION_MAP,
|
||||
PR_BIT_SHADOW_MAP,
|
||||
PR_BIT_LIGHT_MAP,
|
||||
PR_BIT_SPOT_LIGHT,
|
||||
PR_BIT_POINT_LIGHT,
|
||||
PR_BIT_FOOTER, // must be just before last
|
||||
PR_BIT_COUNT // must be last
|
||||
} prbittype;
|
||||
|
||||
typedef struct s_prmaterial {
|
||||
// PR_BIT_ANIM_INTERPOLATION
|
||||
GLfloat frameprogress;
|
||||
GLfloat* nextframedata;
|
||||
// PR_BIT_NORMAL_MAP
|
||||
GLuint normalmap;
|
||||
GLfloat normalbias[2];
|
||||
GLfloat* tbn;
|
||||
// PR_BIT_DIFFUSE_MAP
|
||||
GLuint diffusemap;
|
||||
GLfloat diffusescale[2];
|
||||
// PR_BIT_HIGHPALOOKUP_MAP
|
||||
GLuint highpalookupmap;
|
||||
// PR_BIT_DIFFUSE_DETAIL_MAP
|
||||
GLuint detailmap;
|
||||
GLfloat detailscale[2];
|
||||
// PR_BIT_DIFFUSE_MODULATION
|
||||
GLubyte diffusemodulation[4];
|
||||
// PR_BIT_SPECULAR_MAP
|
||||
GLuint specmap;
|
||||
// PR_BIT_SPECULAR_MATERIAL
|
||||
GLfloat specmaterial[2];
|
||||
// PR_BIT_MIRROR_MAP
|
||||
GLuint mirrormap;
|
||||
// PR_BIT_GLOW_MAP
|
||||
GLuint glowmap;
|
||||
// PR_BIT_SHADOW_MAP
|
||||
GLboolean mdspritespace;
|
||||
} _prmaterial;
|
||||
|
||||
typedef struct s_prrograminfo {
|
||||
GLhandleARB handle;
|
||||
// PR_BIT_ANIM_INTERPOLATION
|
||||
GLint attrib_nextFrameData;
|
||||
GLint attrib_nextFrameNormal;
|
||||
GLint uniform_frameProgress;
|
||||
// PR_BIT_NORMAL_MAP
|
||||
GLint attrib_T;
|
||||
GLint attrib_B;
|
||||
GLint attrib_N;
|
||||
GLint uniform_eyePosition;
|
||||
GLint uniform_normalMap;
|
||||
GLint uniform_normalBias;
|
||||
// PR_BIT_DIFFUSE_MAP
|
||||
GLint uniform_diffuseMap;
|
||||
GLint uniform_diffuseScale;
|
||||
// PR_BIT_HIGHPALOOKUP_MAP
|
||||
GLuint uniform_highPalookupMap;
|
||||
// PR_BIT_DIFFUSE_DETAIL_MAP
|
||||
GLint uniform_detailMap;
|
||||
GLint uniform_detailScale;
|
||||
// PR_BIT_SPECULAR_MAP
|
||||
GLint uniform_specMap;
|
||||
// PR_BIT_SPECULAR_MATERIAL
|
||||
GLint uniform_specMaterial;
|
||||
// PR_BIT_MIRROR_MAP
|
||||
GLint uniform_mirrorMap;
|
||||
// PR_BIT_GLOW_MAP
|
||||
GLint uniform_glowMap;
|
||||
// PR_BIT_PROJECTION_MAP
|
||||
GLint uniform_shadowProjMatrix;
|
||||
// PR_BIT_SHADOW_MAP
|
||||
GLint uniform_shadowMap;
|
||||
// PR_BIT_LIGHT_MAP
|
||||
GLint uniform_lightMap;
|
||||
// PR_BIT_SPOT_LIGHT
|
||||
GLint uniform_spotDir;
|
||||
GLint uniform_spotRadius;
|
||||
} _prprograminfo;
|
||||
|
||||
#define PR_INFO_LOG_BUFFER_SIZE 8192
|
||||
|
||||
// Think about changing highPal[Scale|Bias] in the program bit if you change this
|
||||
#define PR_HIGHPALOOKUP_BIT_DEPTH 6
|
||||
#define PR_HIGHPALOOKUP_DIM (1 << PR_HIGHPALOOKUP_BIT_DEPTH)
|
||||
#define PR_HIGHPALOOKUP_DATA_SIZE (4 * PR_HIGHPALOOKUP_DIM * \
|
||||
PR_HIGHPALOOKUP_DIM * \
|
||||
PR_HIGHPALOOKUP_DIM)
|
||||
|
||||
typedef struct s_prprogrambit {
|
||||
int32_t bit;
|
||||
char* vert_def;
|
||||
char* vert_prog;
|
||||
char* frag_def;
|
||||
char* frag_prog;
|
||||
} _prprogrambit;
|
||||
|
||||
#include "prlights.h"
|
||||
|
||||
// RENDER TARGETS
|
||||
typedef struct s_prrt {
|
||||
GLenum target;
|
||||
GLuint color;
|
||||
GLuint z;
|
||||
GLuint fbo;
|
||||
int32_t xdim, ydim;
|
||||
} _prrt;
|
||||
|
||||
// BUILD DATA
|
||||
typedef struct s_prplane {
|
||||
// geometry
|
||||
GLfloat* buffer;
|
||||
int32_t vertcount;
|
||||
GLuint vbo;
|
||||
// attributes
|
||||
GLfloat tbn[3][3];
|
||||
GLfloat plane[4];
|
||||
_prmaterial material;
|
||||
// elements
|
||||
GLushort* indices;
|
||||
int32_t indicescount;
|
||||
GLuint ivbo;
|
||||
// lights
|
||||
int16_t lights[PR_MAXLIGHTS];
|
||||
uint16_t lightcount;
|
||||
} _prplane;
|
||||
|
||||
typedef struct s_prsector {
|
||||
// polymer data
|
||||
GLdouble* verts;
|
||||
_prplane floor;
|
||||
_prplane ceil;
|
||||
int16_t curindice;
|
||||
int32_t indicescount;
|
||||
int32_t oldindicescount;
|
||||
// stuff
|
||||
float wallsproffset;
|
||||
float floorsproffset;
|
||||
// build sector data
|
||||
int32_t ceilingz, floorz;
|
||||
int16_t ceilingstat, floorstat;
|
||||
int16_t ceilingpicnum, ceilingheinum;
|
||||
int8_t ceilingshade;
|
||||
char ceilingpal, ceilingxpanning, ceilingypanning;
|
||||
int16_t floorpicnum, floorheinum;
|
||||
int8_t floorshade;
|
||||
char floorpal, floorxpanning, floorypanning;
|
||||
|
||||
struct {
|
||||
int32_t empty : 1;
|
||||
int32_t uptodate : 1;
|
||||
int32_t invalidtex : 1;
|
||||
} flags;
|
||||
uint32_t invalidid;
|
||||
} _prsector;
|
||||
|
||||
typedef struct s_prwall {
|
||||
_prplane wall;
|
||||
_prplane over;
|
||||
_prplane mask;
|
||||
// stuff
|
||||
GLfloat* bigportal;
|
||||
GLfloat* cap;
|
||||
GLuint stuffvbo;
|
||||
// build wall data
|
||||
int16_t cstat, nwallcstat;
|
||||
int16_t picnum, overpicnum, nwallpicnum;
|
||||
int8_t shade;
|
||||
char pal, xrepeat, yrepeat, xpanning, ypanning;
|
||||
char nwallxpanning, nwallypanning;
|
||||
int8_t nwallshade;
|
||||
|
||||
char underover;
|
||||
uint32_t invalidid;
|
||||
struct {
|
||||
int32_t empty : 1;
|
||||
int32_t uptodate : 1;
|
||||
int32_t invalidtex : 1;
|
||||
} flags;
|
||||
} _prwall;
|
||||
|
||||
typedef struct s_prsprite {
|
||||
_prplane plane;
|
||||
uint32_t crc;
|
||||
} _prsprite;
|
||||
|
||||
typedef struct s_prmirror {
|
||||
_prplane *plane;
|
||||
int16_t sectnum;
|
||||
int16_t wallnum;
|
||||
} _prmirror;
|
||||
|
||||
typedef struct s_prhighpalookup {
|
||||
char *data;
|
||||
GLuint map;
|
||||
} _prhighpalookup;
|
||||
|
||||
typedef void (*animatespritesptr)(int32_t, int32_t, int32_t, int32_t);
|
||||
|
||||
typedef struct s_pranimatespritesinfo {
|
||||
animatespritesptr animatesprites;
|
||||
int32_t x, y, a, smoothratio;
|
||||
} _pranimatespritesinfo;
|
||||
|
||||
// EXTERNAL FUNCTIONS
|
||||
int32_t polymer_init(void);
|
||||
void polymer_uninit(void);
|
||||
void polymer_setaspect(int32_t);
|
||||
void polymer_glinit(void);
|
||||
void polymer_resetlights(void);
|
||||
void polymer_loadboard(void);
|
||||
void polymer_drawrooms(int32_t daposx, int32_t daposy, int32_t daposz, int16_t daang, int32_t dahoriz, int16_t dacursectnum);
|
||||
void polymer_drawmasks(void);
|
||||
void polymer_editorpick(void);
|
||||
void polymer_inb4rotatesprite(int16_t tilenum, char pal, int8_t shade);
|
||||
void polymer_postrotatesprite(void);
|
||||
void polymer_drawmaskwall(int32_t damaskwallcnt);
|
||||
void polymer_drawsprite(int32_t snum);
|
||||
void polymer_setanimatesprites(animatespritesptr animatesprites, int32_t x, int32_t y, int32_t a, int32_t smoothratio);
|
||||
int16_t polymer_addlight(_prlight* light);
|
||||
void polymer_deletelight(int16_t lighti);
|
||||
void polymer_invalidatelights(void);
|
||||
void polymer_texinvalidate(void);
|
||||
void polymer_definehighpalookup(char basepalnum, char palnum, char *fn);
|
||||
|
||||
# ifdef POLYMER_C
|
||||
|
||||
// CORE
|
||||
static void polymer_displayrooms(int16_t sectnum);
|
||||
static void polymer_drawplane(_prplane* plane);
|
||||
static inline void polymer_inb4mirror(GLfloat* buffer, GLfloat* plane);
|
||||
static void polymer_animatesprites(void);
|
||||
static void polymer_freeboard(void);
|
||||
// SECTORS
|
||||
static int32_t polymer_initsector(int16_t sectnum);
|
||||
static int32_t polymer_updatesector(int16_t sectnum);
|
||||
void PR_CALLBACK polymer_tesserror(GLenum error);
|
||||
void PR_CALLBACK polymer_tessedgeflag(GLenum error);
|
||||
void PR_CALLBACK polymer_tessvertex(void* vertex, void* sector);
|
||||
static int32_t polymer_buildfloor(int16_t sectnum);
|
||||
static void polymer_drawsector(int16_t sectnum);
|
||||
// WALLS
|
||||
static int32_t polymer_initwall(int16_t wallnum);
|
||||
static void polymer_updatewall(int16_t wallnum);
|
||||
static void polymer_drawwall(int16_t sectnum, int16_t wallnum);
|
||||
// HSR
|
||||
static void polymer_computeplane(_prplane* p);
|
||||
static inline void polymer_crossproduct(GLfloat* in_a, GLfloat* in_b, GLfloat* out);
|
||||
static inline void polymer_transformpoint(const float* inpos, float* pos, float* matrix);
|
||||
static inline void polymer_normalize(float* vec);
|
||||
static inline void polymer_pokesector(int16_t sectnum);
|
||||
static void polymer_extractfrustum(GLfloat* modelview, GLfloat* projection, float* frustum);
|
||||
static inline int32_t polymer_planeinfrustum(_prplane *plane, float* frustum);
|
||||
static inline void polymer_scansprites(int16_t sectnum, spritetype* tsprite, int32_t* spritesortcnt);
|
||||
static inline void polymer_updatesprite(int32_t snum);
|
||||
// SKIES
|
||||
static void polymer_getsky(void);
|
||||
static void polymer_drawsky(int16_t tilenum, char palnum, int8_t shade);
|
||||
static void polymer_initartsky(void);
|
||||
static void polymer_drawartsky(int16_t tilenum, char palnum, int8_t shade);
|
||||
static void polymer_drawartskyquad(int32_t p1, int32_t p2, GLfloat height);
|
||||
static void polymer_drawskybox(int16_t tilenum, char palnum, int8_t shade);
|
||||
// MDSPRITES
|
||||
static void polymer_drawmdsprite(spritetype *tspr);
|
||||
static void polymer_loadmodelvbos(md3model_t* m);
|
||||
// MATERIALS
|
||||
static void polymer_getscratchmaterial(_prmaterial* material);
|
||||
static void polymer_getbuildmaterial(_prmaterial* material, int16_t tilenum, char pal, int8_t shade, int32_t cmeth);
|
||||
static int32_t polymer_bindmaterial(_prmaterial material, int16_t* lights, int lightcount);
|
||||
static void polymer_unbindmaterial(int32_t programbits);
|
||||
static void polymer_compileprogram(int32_t programbits);
|
||||
// LIGHTS
|
||||
static void polymer_removelight(int16_t lighti);
|
||||
static void polymer_updatelights(void);
|
||||
static inline void polymer_resetplanelights(_prplane* plane);
|
||||
static void polymer_addplanelight(_prplane* plane, int16_t lighti);
|
||||
static inline void polymer_deleteplanelight(_prplane* plane, int16_t lighti);
|
||||
static int32_t polymer_planeinlight(_prplane* plane, _prlight* light);
|
||||
static void polymer_invalidateplanelights(_prplane* plane);
|
||||
static void polymer_invalidatesectorlights(int16_t sectnum);
|
||||
static void polymer_processspotlight(_prlight* light);
|
||||
static inline void polymer_culllight(int16_t lighti);
|
||||
static void polymer_prepareshadows(void);
|
||||
// RENDER TARGETS
|
||||
static void polymer_initrendertargets(int32_t count);
|
||||
|
||||
// the following from gle/vvector.h
|
||||
|
||||
/* ========================================================== */
|
||||
/* determinant of matrix
|
||||
*
|
||||
* Computes determinant of matrix m, returning d
|
||||
*/
|
||||
|
||||
#define DETERMINANT_3X3(d,m) \
|
||||
{ \
|
||||
d = m[0][0] * (m[1][1]*m[2][2] - m[1][2] * m[2][1]); \
|
||||
d -= m[0][1] * (m[1][0]*m[2][2] - m[1][2] * m[2][0]); \
|
||||
d += m[0][2] * (m[1][0]*m[2][1] - m[1][1] * m[2][0]); \
|
||||
}
|
||||
|
||||
/* ========================================================== */
|
||||
/* i,j,th cofactor of a 4x4 matrix
|
||||
*
|
||||
*/
|
||||
|
||||
#define COFACTOR_4X4_IJ(fac,m,i,j) \
|
||||
{ \
|
||||
int ii[4], jj[4], k; \
|
||||
\
|
||||
/* compute which row, columnt to skip */ \
|
||||
for (k=0; k<i; k++) ii[k] = k; \
|
||||
for (k=i; k<3; k++) ii[k] = k+1; \
|
||||
for (k=0; k<j; k++) jj[k] = k; \
|
||||
for (k=j; k<3; k++) jj[k] = k+1; \
|
||||
\
|
||||
(fac) = m[ii[0]][jj[0]] * (m[ii[1]][jj[1]]*m[ii[2]][jj[2]] \
|
||||
- m[ii[1]][jj[2]]*m[ii[2]][jj[1]]); \
|
||||
(fac) -= m[ii[0]][jj[1]] * (m[ii[1]][jj[0]]*m[ii[2]][jj[2]] \
|
||||
- m[ii[1]][jj[2]]*m[ii[2]][jj[0]]);\
|
||||
(fac) += m[ii[0]][jj[2]] * (m[ii[1]][jj[0]]*m[ii[2]][jj[1]] \
|
||||
- m[ii[1]][jj[1]]*m[ii[2]][jj[0]]);\
|
||||
\
|
||||
/* compute sign */ \
|
||||
k = i+j; \
|
||||
if ( k != (k/2)*2) { \
|
||||
(fac) = -(fac); \
|
||||
} \
|
||||
}
|
||||
|
||||
/* ========================================================== */
|
||||
/* determinant of matrix
|
||||
*
|
||||
* Computes determinant of matrix m, returning d
|
||||
*/
|
||||
|
||||
#define DETERMINANT_4X4(d,m) \
|
||||
{ \
|
||||
double cofac; \
|
||||
COFACTOR_4X4_IJ (cofac, m, 0, 0); \
|
||||
d = m[0][0] * cofac; \
|
||||
COFACTOR_4X4_IJ (cofac, m, 0, 1); \
|
||||
d += m[0][1] * cofac; \
|
||||
COFACTOR_4X4_IJ (cofac, m, 0, 2); \
|
||||
d += m[0][2] * cofac; \
|
||||
COFACTOR_4X4_IJ (cofac, m, 0, 3); \
|
||||
d += m[0][3] * cofac; \
|
||||
}
|
||||
|
||||
/* ========================================================== */
|
||||
/* compute adjoint of matrix and scale
|
||||
*
|
||||
* Computes adjoint of matrix m, scales it by s, returning a
|
||||
*/
|
||||
|
||||
#define SCALE_ADJOINT_3X3(a,s,m) \
|
||||
{ \
|
||||
a[0][0] = (s) * (m[1][1] * m[2][2] - m[1][2] * m[2][1]); \
|
||||
a[1][0] = (s) * (m[1][2] * m[2][0] - m[1][0] * m[2][2]); \
|
||||
a[2][0] = (s) * (m[1][0] * m[2][1] - m[1][1] * m[2][0]); \
|
||||
\
|
||||
a[0][1] = (s) * (m[0][2] * m[2][1] - m[0][1] * m[2][2]); \
|
||||
a[1][1] = (s) * (m[0][0] * m[2][2] - m[0][2] * m[2][0]); \
|
||||
a[2][1] = (s) * (m[0][1] * m[2][0] - m[0][0] * m[2][1]); \
|
||||
\
|
||||
a[0][2] = (s) * (m[0][1] * m[1][2] - m[0][2] * m[1][1]); \
|
||||
a[1][2] = (s) * (m[0][2] * m[1][0] - m[0][0] * m[1][2]); \
|
||||
a[2][2] = (s) * (m[0][0] * m[1][1] - m[0][1] * m[1][0]); \
|
||||
}
|
||||
|
||||
/* ========================================================== */
|
||||
/* compute adjoint of matrix and scale
|
||||
*
|
||||
* Computes adjoint of matrix m, scales it by s, returning a
|
||||
*/
|
||||
|
||||
#define SCALE_ADJOINT_4X4(a,s,m) \
|
||||
{ \
|
||||
int i,j; \
|
||||
\
|
||||
for (i=0; i<4; i++) { \
|
||||
for (j=0; j<4; j++) { \
|
||||
COFACTOR_4X4_IJ (a[j][i], m, i, j); \
|
||||
a[j][i] *= s; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
/* ========================================================== */
|
||||
/* inverse of matrix
|
||||
*
|
||||
* Compute inverse of matrix a, returning determinant m and
|
||||
* inverse b
|
||||
*/
|
||||
|
||||
#define INVERT_3X3(b,det,a) \
|
||||
{ \
|
||||
double tmp; \
|
||||
DETERMINANT_3X3 (det, a); \
|
||||
tmp = 1.0 / (det); \
|
||||
SCALE_ADJOINT_3X3 (b, tmp, a); \
|
||||
}
|
||||
|
||||
/* ========================================================== */
|
||||
/* inverse of matrix
|
||||
*
|
||||
* Compute inverse of matrix a, returning determinant m and
|
||||
* inverse b
|
||||
*/
|
||||
|
||||
#define INVERT_4X4(b,det,a) \
|
||||
{ \
|
||||
double tmp; \
|
||||
DETERMINANT_4X4 (det, a); \
|
||||
tmp = 1.0 / (det); \
|
||||
SCALE_ADJOINT_4X4 (b, tmp, a); \
|
||||
}
|
||||
|
||||
# endif // !POLYMER_C
|
||||
|
||||
#endif // !_polymer_h_
|
|
@ -1,141 +0,0 @@
|
|||
#ifndef _polymost_h_
|
||||
# define _polymost_h_
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
|
||||
#include "hightile.h"
|
||||
|
||||
#define CULL_OFFSET 384
|
||||
#define CULL_DELAY 2
|
||||
#define MAXCULLCHECKS 1024
|
||||
|
||||
extern int32_t lastcullcheck;
|
||||
extern char cullmodel[MAXSPRITES];
|
||||
extern int32_t cullcheckcnt;
|
||||
|
||||
#define PI 3.14159265358979323
|
||||
extern char TEXCACHEFILE[BMAX_PATH];
|
||||
|
||||
typedef struct { char r, g, b, a; } coltype;
|
||||
|
||||
extern int32_t rendmode;
|
||||
extern float gtang;
|
||||
extern float glox1, gloy1;
|
||||
extern double gxyaspect, grhalfxdown10x;
|
||||
extern double gcosang, gsinang, gcosang2, gsinang2;
|
||||
extern double gchang, gshang, gctang, gstang, gvisibility;
|
||||
|
||||
struct glfiltermodes {
|
||||
const char *name;
|
||||
int32_t min,mag;
|
||||
};
|
||||
#define numglfiltermodes 6
|
||||
extern struct glfiltermodes glfiltermodes[numglfiltermodes];
|
||||
|
||||
extern const char *TEXCACHEDIR;
|
||||
void phex(char v, char *s);
|
||||
void uploadtexture(int32_t doalloc, int32_t xsiz, int32_t ysiz, int32_t intexfmt, int32_t texfmt, coltype *pic, int32_t tsizx, int32_t tsizy, int32_t dameth);
|
||||
void polymost_drawsprite(int32_t snum);
|
||||
void polymost_drawmaskwall(int32_t damaskwallcnt);
|
||||
void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum,
|
||||
int8_t dashade, char dapalnum, int32_t dastat, int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2, int32_t uniqid);
|
||||
void polymost_fillpolygon(int32_t npoints);
|
||||
void polymost_initosdfuncs(void);
|
||||
void polymost_drawrooms(void);
|
||||
|
||||
void polymost_glinit(void);
|
||||
void polymost_glreset(void);
|
||||
void polymost_cachesync(void);
|
||||
|
||||
void gltexinvalidate(int32_t dapicnum, int32_t dapalnum, int32_t dameth);
|
||||
void gltexinvalidateall(void);
|
||||
void gltexinvalidate8(void);
|
||||
int32_t polymost_printext256(int32_t xpos, int32_t ypos, int16_t col, int16_t backcol, const char *name, char fontsize);
|
||||
|
||||
extern float curpolygonoffset;
|
||||
|
||||
extern int32_t cachefilehandle;
|
||||
extern FILE *cacheindexptr;
|
||||
extern hashtable_t h_texcache;
|
||||
extern uint8_t *memcachedata;
|
||||
extern int32_t memcachesize;
|
||||
extern int32_t cachepos;
|
||||
|
||||
struct cacheitem_t
|
||||
{
|
||||
char name[BMAX_PATH];
|
||||
int32_t offset;
|
||||
int32_t len;
|
||||
struct cacheitem_t *next;
|
||||
};
|
||||
|
||||
typedef struct cacheitem_t texcacheindex;
|
||||
|
||||
#define TEXCACHEMAGIC "QLZ1"
|
||||
|
||||
extern texcacheindex *firstcacheindex;
|
||||
extern texcacheindex *curcacheindex;
|
||||
extern texcacheindex *cacheptrs[MAXTILES<<1];
|
||||
extern int32_t numcacheentries;
|
||||
|
||||
int32_t dxtfilter(int32_t fil, texcachepicture *pict, char *pic, void *midbuf, char *packbuf, uint32_t miplen);
|
||||
int32_t dedxtfilter(int32_t fil, texcachepicture *pict, char *pic, void *midbuf, char *packbuf, int32_t ispacked);
|
||||
|
||||
void writexcache(char *fn, int32_t len, int32_t dameth, char effect, texcacheheader *head);
|
||||
|
||||
extern float shadescale;
|
||||
extern float alphahackarray[MAXTILES];
|
||||
|
||||
typedef struct pthtyp_t
|
||||
{
|
||||
struct pthtyp_t *next;
|
||||
uint32_t glpic;
|
||||
int16_t picnum;
|
||||
char palnum;
|
||||
char effects;
|
||||
char flags; // 1 = clamped (dameth&4), 2 = hightile, 4 = skybox face, 8 = hasalpha, 16 = hasfullbright, 128 = invalidated
|
||||
char skyface;
|
||||
hicreplctyp *hicr;
|
||||
|
||||
uint16_t sizx, sizy;
|
||||
float scalex, scaley;
|
||||
struct pthtyp_t *ofb; // only fullbright
|
||||
} pthtyp;
|
||||
|
||||
pthtyp * gltexcache (int32_t dapicnum, int32_t dapalnum, int32_t dameth);
|
||||
|
||||
extern palette_t hictinting[MAXPALOOKUPS];
|
||||
extern float gtang;
|
||||
extern int32_t globalposx, globalposy, globalposz, globalhoriz;
|
||||
extern int16_t globalang, globalcursectnum;
|
||||
extern int32_t globalpal, cosglobalang, singlobalang;
|
||||
extern int32_t cosviewingrangeglobalang, sinviewingrangeglobalang;
|
||||
extern float shadescale;
|
||||
extern int32_t globalnoeffect;
|
||||
extern int32_t drawingskybox;
|
||||
|
||||
extern double gyxscale, gxyaspect, gviewxrange, ghalfx, grhalfxdown10, grhalfxdown10x, ghoriz;
|
||||
extern double gcosang, gsinang, gcosang2, gsinang2;
|
||||
extern double gchang, gshang, gctang, gstang, gvisibility;
|
||||
|
||||
#define FOGSCALE 0.0000768
|
||||
|
||||
extern float fogresult, fogcol[4], fogtable[4*MAXPALOOKUPS];
|
||||
|
||||
static inline void fogcalc(const int32_t shade, const int32_t vis, const int32_t pal)
|
||||
{
|
||||
float f = (shade < 0) ? shade * 3.5f :
|
||||
shade * .66f;
|
||||
|
||||
f = (vis > 239) ? (float)(gvisibility*((vis-240+f)/(klabs(vis-256)))) :
|
||||
(float)(gvisibility*(vis+16+f));
|
||||
|
||||
fogresult = clamp(f, 0.001f, 100.f);
|
||||
|
||||
Bmemcpy(fogcol, &fogtable[pal<<2], sizeof(fogcol));
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load diff
|
@ -1,40 +0,0 @@
|
|||
// LIGHTS
|
||||
#ifndef _prlight_h_
|
||||
# define _prlight_h_
|
||||
|
||||
#define PR_MAXLIGHTS 1024
|
||||
#define SHADOW_DEPTH_OFFSET 30
|
||||
#define PR_MAXLIGHTPRIORITY 6
|
||||
|
||||
typedef struct s_prplanelist {
|
||||
struct s_prplane* plane;
|
||||
struct s_prplanelist* n;
|
||||
} _prplanelist;
|
||||
|
||||
#pragma pack(push,1)
|
||||
typedef struct s_prlight {
|
||||
int32_t x, y, z, horiz, range;
|
||||
int16_t angle, faderadius, radius, sector;
|
||||
uint8_t color[3], priority;
|
||||
int8_t minshade, maxshade;
|
||||
int16_t tilenum;
|
||||
// internal members
|
||||
float proj[16];
|
||||
float transform[16];
|
||||
float frustum[5 * 4];
|
||||
int32_t rtindex;
|
||||
struct {
|
||||
int32_t active : 1;
|
||||
int32_t invalidate : 1;
|
||||
int32_t isinview : 1;
|
||||
} flags;
|
||||
uint32_t lightmap;
|
||||
_prplanelist* planelist;
|
||||
int32_t planecount;
|
||||
} _prlight;
|
||||
|
||||
extern _prlight prlights[PR_MAXLIGHTS];
|
||||
extern int32_t lightcount;
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif
|
|
@ -1,150 +0,0 @@
|
|||
#ifndef QLZ_HEADER
|
||||
#define QLZ_HEADER
|
||||
|
||||
// Fast data compression library
|
||||
// Copyright (C) 2006-2009 Lasse Mikkel Reinhold
|
||||
// lar@quicklz.com
|
||||
//
|
||||
// QuickLZ can be used for free under the GPL-1 or GPL-2 license (where anything
|
||||
// released into public must be open source) or under a commercial license if such
|
||||
// has been acquired (see http://www.quicklz.com/order.html). The commercial license
|
||||
// does not cover derived or ported versions created by third parties under GPL.
|
||||
|
||||
// You can edit following user settings. Data must be decompressed with the same
|
||||
// setting of QLZ_COMPRESSION_LEVEL and QLZ_STREAMING_BUFFER as it was compressed
|
||||
// (see manual). If QLZ_STREAMING_BUFFER > 0, scratch buffers must be initially
|
||||
// zeroed out (see manual). First #ifndef makes it possible to define settings from
|
||||
// the outside like the compiler command line.
|
||||
|
||||
// BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION
|
||||
// BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION
|
||||
// BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION
|
||||
// BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION
|
||||
// BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION BETA VERSION
|
||||
|
||||
// 1.5.0 BETA 2
|
||||
|
||||
#ifndef QLZ_COMPRESSION_LEVEL
|
||||
//#define QLZ_COMPRESSION_LEVEL 1
|
||||
#define QLZ_COMPRESSION_LEVEL 2
|
||||
//#define QLZ_COMPRESSION_LEVEL 3
|
||||
|
||||
#define QLZ_STREAMING_BUFFER 0
|
||||
//#define QLZ_STREAMING_BUFFER 100000
|
||||
//#define QLZ_STREAMING_BUFFER 1000000
|
||||
|
||||
//#define QLZ_MEMORY_SAFE
|
||||
#endif
|
||||
|
||||
#define QLZ_VERSION_MAJOR 1
|
||||
#define QLZ_VERSION_MINOR 5
|
||||
#define QLZ_VERSION_REVISION 0
|
||||
|
||||
// Using size_t, memset() and memcpy()
|
||||
#include <string.h>
|
||||
|
||||
// Verify compression level
|
||||
#if QLZ_COMPRESSION_LEVEL != 1 && QLZ_COMPRESSION_LEVEL != 2 && QLZ_COMPRESSION_LEVEL != 3
|
||||
#error QLZ_COMPRESSION_LEVEL must be 1, 2 or 3
|
||||
#endif
|
||||
|
||||
typedef unsigned int ui32;
|
||||
typedef unsigned short int ui16;
|
||||
|
||||
// Decrease QLZ_POINTERS for level 3 to increase compression speed. Do not touch any other values!
|
||||
#if QLZ_COMPRESSION_LEVEL == 1
|
||||
#define QLZ_POINTERS 1
|
||||
#define QLZ_HASH_VALUES 4096
|
||||
#elif QLZ_COMPRESSION_LEVEL == 2
|
||||
#define QLZ_POINTERS 4
|
||||
#define QLZ_HASH_VALUES 2048
|
||||
#elif QLZ_COMPRESSION_LEVEL == 3
|
||||
#define QLZ_POINTERS 16
|
||||
#define QLZ_HASH_VALUES 4096
|
||||
#endif
|
||||
|
||||
// Detect if pointer size is 64-bit. It's not fatal if some 64-bit target is not detected because this is only for adding an optional 64-bit optimization.
|
||||
#if defined _LP64 || defined __LP64__ || defined __64BIT__ || _ADDR64 || defined _WIN64 || defined __arch64__ || __WORDSIZE == 64 || (defined __sparc && defined __sparcv9) || defined __x86_64 || defined __amd64 || defined __x86_64__ || defined _M_X64 || defined _M_IA64 || defined __ia64 || defined __IA64__
|
||||
#define QLZ_PTR_64
|
||||
#endif
|
||||
|
||||
// hash entry
|
||||
typedef struct
|
||||
{
|
||||
#if QLZ_COMPRESSION_LEVEL == 1
|
||||
ui32 cache;
|
||||
#if defined QLZ_PTR_64 && QLZ_STREAMING_BUFFER == 0
|
||||
unsigned int offset;
|
||||
#else
|
||||
const unsigned char *offset;
|
||||
#endif
|
||||
#else
|
||||
const unsigned char *offset[QLZ_POINTERS];
|
||||
#endif
|
||||
|
||||
} qlz_hash_compress;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
#if QLZ_COMPRESSION_LEVEL == 1
|
||||
const unsigned char *offset;
|
||||
#else
|
||||
const unsigned char *offset[QLZ_POINTERS];
|
||||
#endif
|
||||
} qlz_hash_decompress;
|
||||
|
||||
|
||||
// states
|
||||
typedef struct
|
||||
{
|
||||
#if QLZ_STREAMING_BUFFER > 0
|
||||
unsigned char stream_buffer[QLZ_STREAMING_BUFFER];
|
||||
#endif
|
||||
size_t stream_counter;
|
||||
qlz_hash_compress hash[QLZ_HASH_VALUES];
|
||||
unsigned char hash_counter[QLZ_HASH_VALUES];
|
||||
} qlz_state_compress;
|
||||
|
||||
|
||||
#if QLZ_COMPRESSION_LEVEL == 1 || QLZ_COMPRESSION_LEVEL == 2
|
||||
typedef struct
|
||||
{
|
||||
#if QLZ_STREAMING_BUFFER > 0
|
||||
unsigned char stream_buffer[QLZ_STREAMING_BUFFER];
|
||||
#endif
|
||||
qlz_hash_decompress hash[QLZ_HASH_VALUES];
|
||||
unsigned char hash_counter[QLZ_HASH_VALUES];
|
||||
size_t stream_counter;
|
||||
} qlz_state_decompress;
|
||||
#elif QLZ_COMPRESSION_LEVEL == 3
|
||||
typedef struct
|
||||
{
|
||||
#if QLZ_STREAMING_BUFFER > 0
|
||||
unsigned char stream_buffer[QLZ_STREAMING_BUFFER];
|
||||
#endif
|
||||
qlz_hash_decompress hash[QLZ_HASH_VALUES];
|
||||
size_t stream_counter;
|
||||
} qlz_state_decompress;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Public functions of QuickLZ
|
||||
size_t qlz_size_decompressed(const char *source);
|
||||
size_t qlz_size_compressed(const char *source);
|
||||
size_t qlz_compress(const void *source, char *destination, size_t size, qlz_state_compress *state);
|
||||
size_t qlz_decompress(const char *source, void *destination, qlz_state_decompress *state);
|
||||
int qlz_get_setting(int setting);
|
||||
|
||||
extern qlz_state_compress *state_compress;
|
||||
extern qlz_state_decompress *state_decompress;
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
#ifndef rawinput_h__
|
||||
#define rawinput_h__
|
||||
|
||||
#include "compat.h"
|
||||
|
||||
void RI_PollDevices(BOOL loop);
|
||||
void RI_ProcessMessage(MSG *msg);
|
||||
BOOL RI_CaptureInput(BOOL grab, HWND target);
|
||||
|
||||
#ifndef VK_LBUTTON
|
||||
#define VK_LBUTTON 0x01
|
||||
#endif
|
||||
#ifndef VK_RBUTTON
|
||||
#define VK_RBUTTON 0x02
|
||||
#endif
|
||||
#ifndef VK_CANCEL
|
||||
#define VK_CANCEL 0x03
|
||||
#endif
|
||||
#ifndef VK_MBUTTON
|
||||
#define VK_MBUTTON 0x04 /* NOT contiguous with L & RBUTTON */
|
||||
#endif
|
||||
|
||||
#endif // rawinput_h__
|
||||
|
|
@ -1,123 +0,0 @@
|
|||
|
||||
#define sc_None 0
|
||||
#define sc_Bad 0xff
|
||||
#define sc_Comma 0x33
|
||||
#define sc_Period 0x34
|
||||
#define sc_Return 0x1c
|
||||
#define sc_Enter sc_Return
|
||||
#define sc_Escape 0x01
|
||||
#define sc_Space 0x39
|
||||
#define sc_BackSpace 0x0e
|
||||
#define sc_Tab 0x0f
|
||||
#define sc_LeftAlt 0x38
|
||||
#define sc_LeftControl 0x1d
|
||||
#define sc_CapsLock 0x3a
|
||||
#define sc_LeftShift 0x2a
|
||||
#define sc_RightShift 0x36
|
||||
#define sc_F1 0x3b
|
||||
#define sc_F2 0x3c
|
||||
#define sc_F3 0x3d
|
||||
#define sc_F4 0x3e
|
||||
#define sc_F5 0x3f
|
||||
#define sc_F6 0x40
|
||||
#define sc_F7 0x41
|
||||
#define sc_F8 0x42
|
||||
#define sc_F9 0x43
|
||||
#define sc_F10 0x44
|
||||
#define sc_F11 0x57
|
||||
#define sc_F12 0x58
|
||||
#define sc_Kpad_Star 0x37
|
||||
#define sc_Pause 0x59
|
||||
#define sc_ScrollLock 0x46
|
||||
#define sc_NumLock 0x45
|
||||
#define sc_Slash 0x35
|
||||
#define sc_SemiColon 0x27
|
||||
#define sc_Quote 0x28
|
||||
#define sc_Tilde 0x29
|
||||
#define sc_BackSlash 0x2b
|
||||
|
||||
#define sc_OpenBracket 0x1a
|
||||
#define sc_CloseBracket 0x1b
|
||||
|
||||
#define sc_1 0x02
|
||||
#define sc_2 0x03
|
||||
#define sc_3 0x04
|
||||
#define sc_4 0x05
|
||||
#define sc_5 0x06
|
||||
#define sc_6 0x07
|
||||
#define sc_7 0x08
|
||||
#define sc_8 0x09
|
||||
#define sc_9 0x0a
|
||||
#define sc_0 0x0b
|
||||
#define sc_Minus 0x0c
|
||||
#define sc_Equals 0x0d
|
||||
#define sc_Plus 0x0d
|
||||
|
||||
#define sc_kpad_1 0x4f
|
||||
#define sc_kpad_2 0x50
|
||||
#define sc_kpad_3 0x51
|
||||
#define sc_kpad_4 0x4b
|
||||
#define sc_kpad_5 0x4c
|
||||
#define sc_kpad_6 0x4d
|
||||
#define sc_kpad_7 0x47
|
||||
#define sc_kpad_8 0x48
|
||||
#define sc_kpad_9 0x49
|
||||
#define sc_kpad_0 0x52
|
||||
#define sc_kpad_Minus 0x4a
|
||||
#define sc_kpad_Plus 0x4e
|
||||
#define sc_kpad_Period 0x53
|
||||
|
||||
#define sc_A 0x1e
|
||||
#define sc_B 0x30
|
||||
#define sc_C 0x2e
|
||||
#define sc_D 0x20
|
||||
#define sc_E 0x12
|
||||
#define sc_F 0x21
|
||||
#define sc_G 0x22
|
||||
#define sc_H 0x23
|
||||
#define sc_I 0x17
|
||||
#define sc_J 0x24
|
||||
#define sc_K 0x25
|
||||
#define sc_L 0x26
|
||||
#define sc_M 0x32
|
||||
#define sc_N 0x31
|
||||
#define sc_O 0x18
|
||||
#define sc_P 0x19
|
||||
#define sc_Q 0x10
|
||||
#define sc_R 0x13
|
||||
#define sc_S 0x1f
|
||||
#define sc_T 0x14
|
||||
#define sc_U 0x16
|
||||
#define sc_V 0x2f
|
||||
#define sc_W 0x11
|
||||
#define sc_X 0x2d
|
||||
#define sc_Y 0x15
|
||||
#define sc_Z 0x2c
|
||||
|
||||
// Extended scan codes
|
||||
|
||||
#define sc_UpArrow 0xc8 //0x5a
|
||||
#define sc_DownArrow 0xd0 //0x6a
|
||||
#define sc_LeftArrow 0xcb //0x6b
|
||||
#define sc_RightArrow 0xcd //0x6c
|
||||
#define sc_Insert 0xd2 //0x5e
|
||||
#define sc_Delete 0xd3 //0x5f
|
||||
#define sc_Home 0xc7 //0x61
|
||||
#define sc_End 0xcf //0x62
|
||||
#define sc_PgUp 0xc9 //0x63
|
||||
#define sc_PgDn 0xd1 //0x64
|
||||
#define sc_RightAlt 0xb8 //0x65
|
||||
#define sc_RightControl 0x9d //0x66
|
||||
#define sc_kpad_Slash 0xb5 //0x67
|
||||
#define sc_kpad_Enter 0x9c //0x68
|
||||
#define sc_PrintScreen 0xb7 //0x69
|
||||
#define sc_LastScanCode 0x6e
|
||||
|
||||
// Ascii scan codes
|
||||
|
||||
#define asc_Enter 13
|
||||
#define asc_Escape 27
|
||||
#define asc_BackSpace 8
|
||||
#define asc_Tab 9
|
||||
#define asc_Space 32
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
typedef struct {
|
||||
char *textbuf;
|
||||
uint32_t textlength;
|
||||
char *ltextptr; // pointer to start of the last token fetched (use this for line numbers)
|
||||
char *textptr;
|
||||
char *eof;
|
||||
char *filename;
|
||||
int32_t linenum;
|
||||
int32_t *lineoffs;
|
||||
} scriptfile;
|
||||
|
||||
char *scriptfile_gettoken(scriptfile *sf);
|
||||
int32_t scriptfile_getnumber(scriptfile *sf, int32_t *num);
|
||||
int32_t scriptfile_getdouble(scriptfile *sf, double *num);
|
||||
int32_t scriptfile_getstring(scriptfile *sf, char **st);
|
||||
int32_t scriptfile_getsymbol(scriptfile *sf, int32_t *num);
|
||||
int32_t scriptfile_getlinum(scriptfile *sf, char *ptr);
|
||||
int32_t scriptfile_getbraces(scriptfile *sf, char **braceend);
|
||||
|
||||
scriptfile *scriptfile_fromfile(const char *fn);
|
||||
scriptfile *scriptfile_fromstring(const char *string);
|
||||
void scriptfile_close(scriptfile *sf);
|
||||
int32_t scriptfile_eof(scriptfile *sf);
|
||||
|
||||
int32_t scriptfile_getsymbolvalue(char *name, int32_t *val);
|
||||
int32_t scriptfile_addsymbolvalue(char *name, int32_t val);
|
||||
void scriptfile_clearsymbols(void);
|
|
@ -1,51 +0,0 @@
|
|||
#ifndef __SDL_INC_H
|
||||
#define __SDL_INC_H
|
||||
|
||||
#if defined(SDL_FRAMEWORK)
|
||||
# include <SDL/SDL.h>
|
||||
#else
|
||||
# include "SDL.h"
|
||||
#endif
|
||||
|
||||
/* =================================================================
|
||||
Minimum required SDL versions:
|
||||
=================================================================== */
|
||||
|
||||
#define SDL_MIN_X 1
|
||||
#define SDL_MIN_Y 2
|
||||
#define SDL_MIN_Z 10
|
||||
|
||||
#define SDL_REQUIREDVERSION (SDL_VERSIONNUM(SDL_MIN_X,SDL_MIN_Y,SDL_MIN_Z))
|
||||
|
||||
#define SDL_MIXER_MIN_X 1
|
||||
#define SDL_MIXER_MIN_Y 2
|
||||
#define SDL_MIXER_MIN_Z 7
|
||||
#define MIX_REQUIREDVERSION (SDL_VERSIONNUM(SDL_MIXER_MIN_X,SDL_MIXER_MIN_Y,SDL_MIXER_MIN_Z))
|
||||
|
||||
#if !(SDL_VERSION_ATLEAST(SDL_MIN_X,SDL_MIN_Y,SDL_MIN_Z))
|
||||
#error SDL version found is too old
|
||||
#endif
|
||||
|
||||
#if defined(_NEED_SDLMIXER)
|
||||
# if defined(SDL_FRAMEWORK)
|
||||
# include <SDL_mixer/SDL_mixer.h>
|
||||
# else
|
||||
# include "SDL_mixer.h"
|
||||
# endif
|
||||
/* starting with 1.2.1, SDL_mixer provides MIX_xxx version
|
||||
macros. the new SDL_MIXER_xxx version macros start with
|
||||
1.2.6 but they keep backwards compatibility. 1.2.0 does
|
||||
not even have any version macros, so let's reject it */
|
||||
#if !defined(MIX_MAJOR_VERSION) || !defined(MIX_MINOR_VERSION) || !defined(MIX_PATCHLEVEL)
|
||||
#error SDL_mixer version found is too old
|
||||
#endif
|
||||
#ifndef MIX_COMPILEDVERSION
|
||||
#define MIX_COMPILEDVERSION (SDL_VERSIONNUM(MIX_MAJOR_VERSION,MIX_MINOR_VERSION,MIX_PATCHLEVEL))
|
||||
#endif
|
||||
#if MIX_COMPILEDVERSION < MIX_REQUIREDVERSION
|
||||
#error SDL_mixer version found is too old
|
||||
#endif /* end of bad version error */
|
||||
#endif /* end of SDL_mixer checks */
|
||||
|
||||
#endif /* __SDL_INC_H */
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
// SDL interface layer
|
||||
// for the Build Engine
|
||||
// by Jonathon Fowler (jonof@edgenetwk.com)
|
||||
|
||||
#ifndef __build_interface_layer__
|
||||
#define __build_interface_layer__ SDL
|
||||
|
||||
#include "baselayer.h"
|
||||
|
||||
struct sdlappicon {
|
||||
int32_t width,height;
|
||||
uint32_t *pixels;
|
||||
uint8_t *mask;
|
||||
};
|
||||
|
||||
#else
|
||||
#if (__build_interface_layer__ != SDL)
|
||||
#error "Already using the " __build_interface_layer__ ". Can't now use SDL."
|
||||
#endif
|
||||
#endif // __build_interface_layer__
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
// resource ids
|
||||
#define WIN_STARTWIN 1000
|
||||
#define WIN_STARTWINPAGE_CONFIG 2000
|
||||
#define WIN_STARTWIN_BITMAP 100 // banner bitmap
|
||||
#define WIN_STARTWIN_TABCTL 101
|
||||
#define WIN_STARTWIN_CANCEL IDCANCEL
|
||||
#define WIN_STARTWIN_START IDOK
|
||||
|
||||
#define WIN_STARTWIN_MESSAGES 104 // output list box
|
||||
|
||||
#define RSRC_ICON 100
|
||||
#define RSRC_BMP 200
|
||||
|
||||
// config page
|
||||
#define IDCFULLSCREEN 100
|
||||
#define IDC2DVMODE 101
|
||||
#define IDC3DVMODE 102
|
||||
#define IDCALWAYSSHOW 103
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
// Windows DIB/DirectDraw interface layer
|
||||
// for the Build Engine
|
||||
// by Jonathon Fowler (jonof@edgenetwk.com)
|
||||
|
||||
#ifndef __build_interface_layer__
|
||||
#define __build_interface_layer__ WIN
|
||||
|
||||
extern int32_t backgroundidle; // set to 1 to tell winlayer to go to idle priority when inactive
|
||||
extern uint32_t maxrefreshfreq;
|
||||
|
||||
extern int32_t glusecds;
|
||||
|
||||
extern char di_disabled;
|
||||
|
||||
int32_t win_gethwnd(void);
|
||||
int32_t win_gethinstance(void);
|
||||
|
||||
void win_allowtaskswitching(int32_t onf);
|
||||
int32_t win_checkinstance(void);
|
||||
|
||||
#include "baselayer.h"
|
||||
|
||||
#else
|
||||
#if (__build_interface_layer__ != WIN)
|
||||
#error "Already using the " __build_interface_layer__ ". Can't now use Windows."
|
||||
#endif
|
||||
#endif // __build_interface_layer__
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 26 KiB |
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 3.1 KiB |
|
@ -1,192 +0,0 @@
|
|||
#include "sdlayer.h"
|
||||
|
||||
static unsigned int sdlappicon_pixels[] = {
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff654848, 0xffad8484,
|
||||
0xffb18888, 0xffbb8f8f, 0xff936d6d, 0xff130303, 0xff987373, 0xff936d6d,
|
||||
0xff100000, 0xff815f5f, 0xffaa8181, 0xff362020, 0xffa98080, 0xff5c3f3f,
|
||||
0xff715252, 0xffb78b8b, 0xff130202, 0xff100000, 0xff2f1a1a, 0xffa07a7a,
|
||||
0xffb78c8c, 0xffbd9090, 0xff856262, 0xff140303, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff432a2a, 0xff825f5f, 0xff190808, 0xff4c3131, 0xffd5a2a2, 0xff2c1717,
|
||||
0xff7e5b5b, 0xff543939, 0xff100000, 0xff674848, 0xff6e4f4f, 0xff100000,
|
||||
0xffb58989, 0xff1c0a0a, 0xff513535, 0xff7f5d5d, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xffa97f7f, 0xff271414, 0xff220f0f, 0xffbb8d8d, 0xff442b2b,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff432a2a, 0xffba8e8e, 0xffb88d8d, 0xffc19494,
|
||||
0xff987171, 0xff110101, 0xff7e5b5b, 0xff533939, 0xff100000, 0xff694949,
|
||||
0xff6e4f4f, 0xff100000, 0xffb08585, 0xff1c0a0a, 0xff513535, 0xff7b5a5a,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xffa67c7c, 0xff261212, 0xff100000,
|
||||
0xff956e6e, 0xff704f4f, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff4c3232, 0xff896565,
|
||||
0xff261212, 0xff503535, 0xffd4a2a2, 0xff351e1e, 0xff755454, 0xff835f5f,
|
||||
0xff261111, 0xff936c6c, 0xff715050, 0xff160505, 0xffb28686, 0xff241111,
|
||||
0xff573a3a, 0xff836060, 0xff251111, 0xff674949, 0xff140303, 0xffa77e7e,
|
||||
0xff392222, 0xff3a2222, 0xffbf9191, 0xff3b2424, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff725252, 0xffb78a8a, 0xffc19292, 0xffba8c8c, 0xff866161, 0xff110101,
|
||||
0xff2c1818, 0xffb28585, 0xffc49393, 0xffab8080, 0xff261313, 0xff3f2727,
|
||||
0xffb18686, 0xff644545, 0xff7c5a5a, 0xffb98c8c, 0xffc09191, 0xffba8c8c,
|
||||
0xff341e1e, 0xffa77e7e, 0xffbf9090, 0xffba8d8d, 0xff745353, 0xff110101,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff272159, 0xff383793, 0xff3e3da3, 0xff2e286b,
|
||||
0xff2e296e, 0xff2a2157, 0xff100001, 0xff37358e, 0xff140611, 0xff353286,
|
||||
0xff3d3ca0, 0xff3f3c9f, 0xff180a1a, 0xff323080, 0xff353285, 0xff261e51,
|
||||
0xff322c75, 0xff100000, 0xff322e7b, 0xff1f153a, 0xff333284, 0xff3b3a9d,
|
||||
0xff403fa8, 0xff13040b, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff2e296d, 0xff251c4b,
|
||||
0xff1a0d25, 0xff110104, 0xff353284, 0xff5453db, 0xff1a0d22, 0xff3e3da6,
|
||||
0xff231a47, 0xff332f7d, 0xff150714, 0xff2c225b, 0xff1f1333, 0xff2b2461,
|
||||
0xff281f54, 0xff2a235d, 0xff5454df, 0xff251a44, 0xff38358f, 0xff211841,
|
||||
0xff332f7e, 0xff1c0f29, 0xff140611, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff2f296f, 0xff3e3ca0, 0xff332e7d, 0xff100000, 0xff363287, 0xff2d2667,
|
||||
0xff3f3ca0, 0xff4746bc, 0xff241b4a, 0xff2a235f, 0xff1e1436, 0xff3d3b9e,
|
||||
0xff1f1231, 0xff2a225d, 0xff271f52, 0xff2a2461, 0xff30296e, 0xff4441af,
|
||||
0xff4443b2, 0xff231944, 0xff3e3ea5, 0xff3c3998, 0xff1a0e25, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff302a73, 0xff2e2768, 0xff241b48, 0xff1e1232,
|
||||
0xff39358f, 0xff190d24, 0xff35307f, 0xff5150d4, 0xff22173f, 0xff4746b9,
|
||||
0xff2a2159, 0xff4947bd, 0xff261d4d, 0xff35307f, 0xff352f7d, 0xff2d2667,
|
||||
0xff261c4c, 0xff292158, 0xff5555df, 0xff231a47, 0xff38358f, 0xff251b49,
|
||||
0xff261c4c, 0xff110205, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff221842, 0xff2f286c,
|
||||
0xff2f286b, 0xff221840, 0xff383b78, 0xff292c43, 0xff2a2c43, 0xff4650a1,
|
||||
0xff252633, 0xff424a92, 0xff4650a3, 0xff3d4587, 0xff252634, 0xff404990,
|
||||
0xff40498f, 0xff363c6e, 0xff2f3458, 0xff252633, 0xff4851a4, 0xff1a0e26,
|
||||
0xff2d2666, 0xff2f286b, 0xff2e276a, 0xff110206, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff446281, 0xff527ea5,
|
||||
0xff4f799e, 0xff537fa6, 0xff517ca3, 0xff5a88b3, 0xff45698a, 0xff537fa7,
|
||||
0xff4e779b, 0xff5480a8, 0xff5581a9, 0xff5683ac, 0xff5987b1, 0xff5887b0,
|
||||
0xff547fa7, 0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff241d34, 0xff251f3c, 0xff1c101d, 0xff14080c,
|
||||
0xff4d5c85, 0xff546a96, 0xff4b5f87, 0xff36475f, 0xff5b6f86, 0xff507096,
|
||||
0xff405683, 0xff394d6e, 0xff51657c, 0xff556f92, 0xff405785, 0xff394e72,
|
||||
0xff435d86, 0xff466094, 0xff466095, 0xff261c33, 0xff211b3a, 0xff221d3b,
|
||||
0xff150913, 0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff170b1a, 0xff505cb1, 0xff363d88,
|
||||
0xff241e3f, 0xff31305e, 0xff45498c, 0xff424381, 0xff3c3c7e, 0xff2a295d,
|
||||
0xff6b72a4, 0xff2c2d76, 0xff2e2f7e, 0xff252565, 0xff6771a5, 0xff2c2d78,
|
||||
0xff2f3180, 0xff292970, 0xff424999, 0xff313188, 0xff2d2d7b, 0xff414a9c,
|
||||
0xff343490, 0xff2f2e7f, 0xff150b1c, 0xff100000, 0xff100103, 0xff150714,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff32305e,
|
||||
0xff3a3f98, 0xff394095, 0xff1e163c, 0xff3f3c77, 0xff323388, 0xff434991,
|
||||
0xff303082, 0xff39438f, 0xff313385, 0xff323481, 0xff3e4598, 0xff2d2e7d,
|
||||
0xff454ba0, 0xff2c2c7a, 0xff3b429e, 0xff2c2c79, 0xff4249ac, 0xff323289,
|
||||
0xff191532, 0xff4c51a2, 0xff393998, 0xff211e48, 0xff100104, 0xff100000,
|
||||
0xff180b1f, 0xff251c4a, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff4751a7, 0xff3b3b9e, 0xff424ea6, 0xff1f173f, 0xff3e4293,
|
||||
0xff363694, 0xff3b4598, 0xff353592, 0xff424793, 0xff373796, 0xff3b3f8f,
|
||||
0xff393a9b, 0xff393a89, 0xff4244a1, 0xff2d2f7a, 0xff27225c, 0xff272460,
|
||||
0xff4a50b1, 0xff3e3ea5, 0xff383b95, 0xff4b53c0, 0xff4343ae, 0xff3a3c98,
|
||||
0xff100206, 0xff100000, 0xff2a225b, 0xff1d112e, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff1a0e22, 0xff545bc6, 0xff3e42a0, 0xff464db5,
|
||||
0xff231b47, 0xff4f58b7, 0xff3e3ea3, 0xff4e53ab, 0xff393998, 0xff4045a8,
|
||||
0xff4040a7, 0xff3d4798, 0xff4141ab, 0xff3d459a, 0xff4242ad, 0xff3a4094,
|
||||
0xff4444b0, 0xff3c439c, 0xff4445b1, 0xff2d2c76, 0xff1d1736, 0xff4c54bf,
|
||||
0xff36358e, 0xff11030a, 0xff0f0000, 0xff100000, 0xff4547ab, 0xff1b0f29,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff3a3671, 0xff494bb6,
|
||||
0xff4c52a4, 0xff5052b1, 0xff2b2663, 0xff4b52c0, 0xff4445b1, 0xff4344af,
|
||||
0xff2d2a70, 0xff4d58be, 0xff3e3ea2, 0xff4149a6, 0xff4040a7, 0xff464da6,
|
||||
0xff4444b1, 0xff454ca2, 0xff4444b0, 0xff414ca1, 0xff4444b3, 0xff343585,
|
||||
0xff323473, 0xff4a4cc3, 0xff3f45a1, 0xff1e182d, 0xff100000, 0xff190e26,
|
||||
0xff758bf0, 0xff21173f, 0xff100000, 0xff100000, 0xff100000, 0xff100001,
|
||||
0xff5052af, 0xff4545b8, 0xff4e51bd, 0xff4444b4, 0xff36378f, 0xff525ac3,
|
||||
0xff333284, 0xff12050e, 0xff170915, 0xff4c52c6, 0xff4343b2, 0xff5053c2,
|
||||
0xff3a3a9c, 0xff4045aa, 0xff4848be, 0xff484abf, 0xff4242b0, 0xff3f45a6,
|
||||
0xff4545b7, 0xff4343b2, 0xff474cab, 0xff4545b9, 0xff4646bd, 0xff1f1a45,
|
||||
0xff160918, 0xff5e65c0, 0xffc4d6f6, 0xff4244a4, 0xff100103, 0xff100000,
|
||||
0xff100000, 0xff1a0e23, 0xff575cd5, 0xff4140aa, 0xff34307b, 0xff4949c3,
|
||||
0xff3d439f, 0xff4b4ec4, 0xff2b2666, 0xff100000, 0xff13040a, 0xff313279,
|
||||
0xff3f3fa9, 0xff3e41a5, 0xff333681, 0xff333183, 0xff4041ad, 0xff4248ae,
|
||||
0xff4751b6, 0xff5467ca, 0xff556bcc, 0xff5870d1, 0xff7385d6, 0xff7b87d3,
|
||||
0xff9096d5, 0xff969fd7, 0xffb6bef0, 0xffebeff9, 0xfffafafa, 0xffadc5f7,
|
||||
0xff5567c8, 0xff2e2768, 0xff100000, 0xff373872, 0xff5154d4, 0xff332e7a,
|
||||
0xff33326d, 0xff4d4dcf, 0xff474fa7, 0xff4444b4, 0xff2d2761, 0xff2a2751,
|
||||
0xff3a4186, 0xff4b52bb, 0xff535ed5, 0xff5762df, 0xff5666e6, 0xff5a66ef,
|
||||
0xff5b6bee, 0xff5b73d9, 0xff5062b6, 0xff444f9c, 0xff3d4685, 0xff373b71,
|
||||
0xff373769, 0xff433b67, 0xff433c66, 0xff433e70, 0xff7179d1, 0xffccd9f6,
|
||||
0xffd1dbf4, 0xff6166bd, 0xff201639, 0xff110205, 0xff100001, 0xff525abb,
|
||||
0xff5050d7, 0xff231a45, 0xff3c3a63, 0xff3d3da4, 0xff3e46a1, 0xff404ba1,
|
||||
0xff3f47a2, 0xff3f42a7, 0xff4545b7, 0xff4c4ccb, 0xff5050d7, 0xff4e4fd1,
|
||||
0xff393792, 0xff251c4d, 0xff160a1b, 0xff100103, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff1a0f29, 0xff6d87f4, 0xff5b67d8, 0xff150712, 0xff100000, 0xff100000,
|
||||
0xff1c1227, 0xff5b66de, 0xff4646bf, 0xff261f4e, 0xff3c4389, 0xff3c4599,
|
||||
0xff2f317c, 0xff2d2d7a, 0xff303081, 0xff34348f, 0xff383898, 0xff3b3b9e,
|
||||
0xff2a2a64, 0xff150817, 0xff0f0000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff100103, 0xff5863e1, 0xff2e286a, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff38386d, 0xff4143aa, 0xff3f499e, 0xff374089,
|
||||
0xff2b2b73, 0xff2b2b75, 0xff2a2a73, 0xff2b2b74, 0xff2d2d7b, 0xff303081,
|
||||
0xff2c2e75, 0xff150f1c, 0xff0f0000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff4c4bc6,
|
||||
0xff150815, 0xff100000, 0xff100000, 0xff100000, 0xff3a438e, 0xff353f84,
|
||||
0xff262766, 0xff262665, 0xff262666, 0xff272769, 0xff272769, 0xff28286d,
|
||||
0xff292970, 0xff272769, 0xff120a0f, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100001, 0xff3a358f, 0xff0f0000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff170e10, 0xff16060e, 0xff13050e, 0xff19060e, 0xff19070e, 0xff110103,
|
||||
0xff100002, 0xff100002, 0xff100002, 0xff100001, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff13050e, 0xff28215b, 0xff100000, 0xff100000,
|
||||
0xff100000, 0xff100000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000,};
|
||||
|
||||
static unsigned char sdlappicon_mask[] = {
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255,};
|
||||
|
||||
struct sdlappicon sdlappicon = {
|
||||
32,32, // width,height
|
||||
sdlappicon_pixels,
|
||||
sdlappicon_mask
|
||||
};
|
Binary file not shown.
Before Width: | Height: | Size: 2.9 KiB |
File diff suppressed because it is too large
Load diff
Binary file not shown.
Before Width: | Height: | Size: 26 KiB |
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
Before Width: | Height: | Size: 3.1 KiB |
|
@ -1,192 +0,0 @@
|
|||
#include "sdlayer.h"
|
||||
|
||||
static unsigned int sdlappicon_pixels[] = {
|
||||
0xff415f7a, 0xff364a5c, 0xff364a5c, 0xff607486, 0xff667a8c, 0xff667a8c,
|
||||
0xff667a8c, 0xff667a8c, 0xff667a8c, 0xff667a8c, 0xff667a8c, 0xff667a8c,
|
||||
0xff667a8c, 0xff667a8c, 0xff667a8c, 0xff667a8c, 0xff667a8c, 0xff667a8c,
|
||||
0xff667a8c, 0xff667a8c, 0xff667a8c, 0xff667a8c, 0xff667a8c, 0xff667a8c,
|
||||
0xff667a8c, 0xff667a8c, 0xff667a8c, 0xff667a8c, 0xff607486, 0xff364a5c,
|
||||
0xff364a5c, 0xff415f7a, 0xff364a5c, 0xff202020, 0xff202020, 0xff747474,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff747474, 0xff202020, 0xff202020, 0xff364a5c, 0xff364a5c, 0xff334d66,
|
||||
0xff334d66, 0xff747474, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff747474, 0xff334d66, 0xff334d66, 0xff364a5c,
|
||||
0xff364a5c, 0xff334d66, 0xff334d66, 0xff747474, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff747474, 0xff334d66,
|
||||
0xff334d66, 0xff364a5c, 0xff364a5c, 0xff202020, 0xff202020, 0xff5c5c5c,
|
||||
0xff404040, 0xff808080, 0xff646464, 0xff686868, 0xff686868, 0xff686868,
|
||||
0xff686868, 0xff686868, 0xff686868, 0xff686868, 0xff686868, 0xff686868,
|
||||
0xff686868, 0xff686868, 0xff686868, 0xff686868, 0xff686868, 0xff686868,
|
||||
0xff686868, 0xff686868, 0xff686868, 0xff646464, 0xff7c7c7c, 0xff404040,
|
||||
0xff5c5c5c, 0xff202020, 0xff202020, 0xff364a5c, 0xff364a5c, 0xff202020,
|
||||
0xff202020, 0xff6c6c6c, 0xff686868, 0xff808080, 0xff686868, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff6c6c6c, 0xff6a6a6a, 0xff727272, 0xff6c6c6c,
|
||||
0xff6c6c6c, 0xff767676, 0xff626262, 0xff6c6c6c, 0xff808080, 0xff6c6c6c,
|
||||
0xff686868, 0xff747474, 0xff808080, 0xff808080, 0xff808080, 0xff707070,
|
||||
0xff787878, 0xff686868, 0xff6c6c6c, 0xff202020, 0xff202020, 0xff364a5c,
|
||||
0xff364a5c, 0xff202020, 0xff202020, 0xff747474, 0xff808080, 0xff808080,
|
||||
0xff686868, 0xff808080, 0xff808080, 0xff808080, 0xff6c6c6c, 0xff6a6a6a,
|
||||
0xff727272, 0xff6a6a6a, 0xff6a6a6a, 0xff808080, 0xff6c6c6c, 0xff6c6c6c,
|
||||
0xff808080, 0xff6c6c6c, 0xff7c7c7c, 0xff6c6c6c, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff707070, 0xff787878, 0xff808080, 0xff747474, 0xff202020,
|
||||
0xff202020, 0xff364a5c, 0xff364a5c, 0xff202020, 0xff202020, 0xff747474,
|
||||
0xff808080, 0xff808080, 0xff686868, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff767676, 0xff6c6c6c, 0xff7c7c7c, 0xff707070, 0xff707070, 0xff767676,
|
||||
0xff6c6c6c, 0xff767676, 0xff6c6c6c, 0xff767676, 0xff6c6c6c, 0xff7e7e7e,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff707070, 0xff787878, 0xff808080,
|
||||
0xff747474, 0xff202020, 0xff202020, 0xff364a5c, 0xff364a5c, 0xff202020,
|
||||
0xff202020, 0xff747474, 0xff808080, 0xff808080, 0xff646464, 0xff686868,
|
||||
0xff686868, 0xff686868, 0xff686868, 0xff686868, 0xff686868, 0xff686868,
|
||||
0xff686868, 0xff686868, 0xff686868, 0xff686868, 0xff686868, 0xff686868,
|
||||
0xff686868, 0xff686868, 0xff686868, 0xff686868, 0xff686868, 0xff646464,
|
||||
0xff787878, 0xff808080, 0xff747474, 0xff202020, 0xff202020, 0xff364a5c,
|
||||
0xff364a5c, 0xff202020, 0xff202020, 0xff747474, 0xff808080, 0xff808080,
|
||||
0xff686868, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff707070, 0xff787878, 0xff808080, 0xff747474, 0xff202020,
|
||||
0xff202020, 0xff364a5c, 0xff364a5c, 0xff202020, 0xff202020, 0xff747474,
|
||||
0xff808080, 0xff808080, 0xff686868, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff707070, 0xff787878, 0xff808080,
|
||||
0xff747474, 0xff202020, 0xff202020, 0xff364a5c, 0xff364a5c, 0xff202020,
|
||||
0xff202020, 0xff747474, 0xff808080, 0xff808080, 0xff686868, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff707070,
|
||||
0xff787878, 0xff808080, 0xff747474, 0xff202020, 0xff202020, 0xff364a5c,
|
||||
0xff364a5c, 0xff202020, 0xff202020, 0xff747474, 0xff808080, 0xff808080,
|
||||
0xff646464, 0xff686868, 0xff686868, 0xff686868, 0xff686868, 0xff686868,
|
||||
0xff686868, 0xff686868, 0xff686868, 0xff686868, 0xff686868, 0xff686868,
|
||||
0xff686868, 0xff686868, 0xff686868, 0xff686868, 0xff686868, 0xff686868,
|
||||
0xff686868, 0xff646464, 0xff787878, 0xff808080, 0xff747474, 0xff202020,
|
||||
0xff202020, 0xff364a5c, 0xff364a5c, 0xff202020, 0xff202020, 0xff747474,
|
||||
0xff808080, 0xff808080, 0xff686868, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff707070, 0xff787878, 0xff808080,
|
||||
0xff747474, 0xff202020, 0xff202020, 0xff364a5c, 0xff364a5c, 0xff202020,
|
||||
0xff202020, 0xff747474, 0xff808080, 0xff808080, 0xff686868, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff707070,
|
||||
0xff787878, 0xff808080, 0xff747474, 0xff202020, 0xff202020, 0xff364a5c,
|
||||
0xff364a5c, 0xff202020, 0xff202020, 0xff747474, 0xff808080, 0xff808080,
|
||||
0xff686868, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff707070, 0xff787878, 0xff808080, 0xff747474, 0xff202020,
|
||||
0xff202020, 0xff364a5c, 0xff364a5c, 0xff202020, 0xff202020, 0xff747474,
|
||||
0xff808080, 0xff808080, 0xff6c6c6c, 0xff686868, 0xff686868, 0xff686868,
|
||||
0xff686868, 0xff686868, 0xff686868, 0xff686868, 0xff686868, 0xff686868,
|
||||
0xff686868, 0xff686868, 0xff686868, 0xff686868, 0xff686868, 0xff686868,
|
||||
0xff686868, 0xff686868, 0xff686868, 0xff686868, 0xff787878, 0xff808080,
|
||||
0xff747474, 0xff202020, 0xff202020, 0xff364a5c, 0xff364a5c, 0xff202020,
|
||||
0xff202020, 0xff747474, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff747474, 0xff202020, 0xff202020, 0xff364a5c,
|
||||
0xff364a5c, 0xff202020, 0xff202020, 0xff666666, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff808080, 0xff808080, 0xff666666, 0xff202020,
|
||||
0xff202020, 0xff364a5c, 0xff364a5c, 0xff202020, 0xff202020, 0xff3c3c3c,
|
||||
0xff666666, 0xff747474, 0xff747474, 0xff747474, 0xff747474, 0xff747474,
|
||||
0xff747474, 0xff747474, 0xff747474, 0xff747474, 0xff747474, 0xff747474,
|
||||
0xff747474, 0xff747474, 0xff747474, 0xff747474, 0xff747474, 0xff747474,
|
||||
0xff747474, 0xff747474, 0xff747474, 0xff747474, 0xff747474, 0xff666666,
|
||||
0xff3c3c3c, 0xff202020, 0xff202020, 0xff364a5c, 0xff364a5c, 0xff202020,
|
||||
0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020,
|
||||
0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020,
|
||||
0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020,
|
||||
0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020,
|
||||
0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff364a5c,
|
||||
0xff364a5c, 0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020,
|
||||
0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020,
|
||||
0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020,
|
||||
0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020,
|
||||
0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020,
|
||||
0xff202020, 0xff364a5c, 0xff364a5c, 0xff202020, 0xff202020, 0xff202020,
|
||||
0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff302424, 0xff3e3e3e,
|
||||
0xff484848, 0xff444444, 0xff444444, 0xff464646, 0xff4c4c4c, 0xff484848,
|
||||
0xff484848, 0xff4a4a4a, 0xff4c4c4c, 0xff4c4c4c, 0xff4c4c4c, 0xff4c4c4c,
|
||||
0xff4a4a4a, 0xff404040, 0xff343434, 0xff343434, 0xff343434, 0xff343434,
|
||||
0xff2c2c2c, 0xff202020, 0xff202020, 0xff364a5c, 0xff364a5c, 0xff202020,
|
||||
0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020,
|
||||
0xff3c3c3c, 0xff727272, 0xff707070, 0xff565656, 0xff505050, 0xff525252,
|
||||
0xff6a6a6a, 0xff787878, 0xff767676, 0xff747474, 0xff7a7a7a, 0xff7c7c7c,
|
||||
0xff787878, 0xff787878, 0xff7a7a7a, 0xff727272, 0xff505050, 0xff484848,
|
||||
0xff484848, 0xff484848, 0xff464646, 0xff202020, 0xff202020, 0xff364a5c,
|
||||
0xff364a5c, 0xff202020, 0xff202020, 0xff202020, 0xff202020, 0xff202020,
|
||||
0xff202020, 0xff202020, 0xff444444, 0xff6c6c6c, 0xff6c6c6c, 0xff303030,
|
||||
0xff202020, 0xff202020, 0xff545454, 0xff787878, 0xff747474, 0xff747474,
|
||||
0xff787878, 0xff7c7c7c, 0xff808080, 0xff808080, 0xff7a7a7a, 0xff747474,
|
||||
0xff505050, 0xff484848, 0xff484848, 0xff484848, 0xff484848, 0xff202020,
|
||||
0xff202020, 0xff364a5c, 0xff364a5c, 0xff282828, 0xff606060, 0xff686868,
|
||||
0xff747474, 0xff4e4e4e, 0xff565656, 0xff202020, 0xff444444, 0xff686868,
|
||||
0xff6c6c6c, 0xff303030, 0xff202020, 0xff202020, 0xff545454, 0xff767676,
|
||||
0xff767676, 0xff767676, 0xff7c7c7c, 0xff787878, 0xff7c7c7c, 0xff7c7c7c,
|
||||
0xff7e7e7e, 0xff767676, 0xff505050, 0xff484848, 0xff484848, 0xff484848,
|
||||
0xff484848, 0xff202020, 0xff202020, 0xff364a5c, 0xff364a5c, 0xff606060,
|
||||
0xffa8a8a8, 0xff7e7e7e, 0xffa8a8a8, 0xff6c6c6c, 0xff7c7c7c, 0xff202020,
|
||||
0xff444444, 0xff6a6a6a, 0xff6c6c6c, 0xff303030, 0xff202020, 0xff202020,
|
||||
0xff545454, 0xff747474, 0xff787878, 0xff787878, 0xff7e7e7e, 0xff7c7c7c,
|
||||
0xff787878, 0xff787878, 0xff828282, 0xff7c7c7c, 0xff505050, 0xff484848,
|
||||
0xff484848, 0xff484848, 0xff484848, 0xff202020, 0xff202020, 0xff364a5c,
|
||||
0xff364a5c, 0xff7c7c7c, 0xff808080, 0xff404040, 0xffa8a8a8, 0xffa0a0a0,
|
||||
0xff7c7c7c, 0xff202020, 0xff464646, 0xff767676, 0xff727272, 0xff303030,
|
||||
0xff202020, 0xff202020, 0xff545454, 0xff767676, 0xff7a7a7a, 0xff787878,
|
||||
0xff7e7e7e, 0xff7c7c7c, 0xff787878, 0xff7c7c7c, 0xff8c8c8c, 0xff7e7e7e,
|
||||
0xff505050, 0xff484848, 0xff484848, 0xff484848, 0xff484848, 0xff222222,
|
||||
0xff25303a, 0xff364a5c, 0xff364a5c, 0xff606060, 0xffa8a8a8, 0xff7e7e7e,
|
||||
0xffa8a8a8, 0xff6c6c6c, 0xff7c7c7c, 0xff202020, 0xff484848, 0xff787878,
|
||||
0xff727272, 0xff303030, 0xff202020, 0xff202020, 0xff585858, 0xff808080,
|
||||
0xff808080, 0xff808080, 0xff888888, 0xff868686, 0xff7e7e7e, 0xff7a7a7a,
|
||||
0xff848484, 0xff747474, 0xff505050, 0xff484848, 0xff484848, 0xff484848,
|
||||
0xff484848, 0xff252b30, 0xff2a4054, 0xff385168, 0xff3a5874, 0xff282c30,
|
||||
0xff606060, 0xff686868, 0xff747474, 0xff4e4e4e, 0xff565656, 0xff202020,
|
||||
0xff484848, 0xff787878, 0xff707070, 0xff303030, 0xff202020, 0xff202020,
|
||||
0xff585858, 0xff7c7c7c, 0xff7a7a7a, 0xff787878, 0xff828282, 0xff808080,
|
||||
0xff808080, 0xff7c7c7c, 0xff828282, 0xff747474, 0xff505050, 0xff484848,
|
||||
0xff484848, 0xff484848, 0xff484848, 0xff242424, 0xff26394c, 0xff364a5c,
|
||||
0xff4c7498, 0xff334d66, 0xff202428, 0xff202020, 0xff202020, 0xff202020,
|
||||
0xff202020, 0xff202428, 0xff4c5660, 0xff747474, 0xff707070, 0xff585858,
|
||||
0xff585858, 0xff5c5c5c, 0xff747474, 0xff7c7c7c, 0xff707070, 0xff787878,
|
||||
0xff7c7c7c, 0xff787878, 0xff7c7c7c, 0xff868686, 0xff828282, 0xff787878,
|
||||
0xff505050, 0xff484848, 0xff484848, 0xff484848, 0xff464646, 0xff202020,
|
||||
0xff202020, 0xff364a5c, 0xff4c7498, 0xff4c7498, 0xff3a5874, 0xff364a5c,
|
||||
0xff364a5c, 0xff364a5c, 0xff364a5c, 0xff3a5874, 0xff55738e, 0xff5a6e80,
|
||||
0xff5e7284, 0xff5e7284, 0xff64788a, 0xff687c8e, 0xff6c8092, 0xff667a8c,
|
||||
0xff627688, 0xff627688, 0xff627688, 0xff627688, 0xff64788a, 0xff6a7e90,
|
||||
0xff667a8c, 0xff627688, 0xff4e6274, 0xff4a5e70, 0xff4a5e70, 0xff4a5e70,
|
||||
0xff44586a, 0xff364a5c, 0xff364a5c, 0xff415f7a,};
|
||||
|
||||
static unsigned char sdlappicon_mask[] = {
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255,};
|
||||
|
||||
struct sdlappicon sdlappicon = {
|
||||
32,32, // width,height
|
||||
sdlappicon_pixels,
|
||||
sdlappicon_mask
|
||||
};
|
Binary file not shown.
Before Width: | Height: | Size: 2.9 KiB |
|
@ -1,189 +0,0 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#include "baselayer.h"
|
||||
|
||||
@interface StartupWinController : NSWindowController
|
||||
{
|
||||
IBOutlet NSButton *alwaysShowButton;
|
||||
IBOutlet NSButton *fullscreenButton;
|
||||
IBOutlet NSTextView *messagesView;
|
||||
IBOutlet NSTabView *tabView;
|
||||
IBOutlet NSComboBox *videoModeCbox;
|
||||
|
||||
IBOutlet NSButton *cancelButton;
|
||||
IBOutlet NSButton *startButton;
|
||||
}
|
||||
|
||||
- (IBAction)alwaysShowClicked:(id)sender;
|
||||
- (IBAction)fullscreenClicked:(id)sender;
|
||||
|
||||
- (IBAction)cancel:(id)sender;
|
||||
- (IBAction)start:(id)sender;
|
||||
|
||||
- (void)setupRunMode;
|
||||
- (void)setupMessagesMode;
|
||||
- (void)putsMessage:(NSString *)str;
|
||||
- (void)setTitle:(NSString *)str;
|
||||
@end
|
||||
|
||||
@implementation StartupWinController
|
||||
|
||||
- (IBAction)alwaysShowClicked:(id)sender
|
||||
{
|
||||
}
|
||||
|
||||
- (IBAction)fullscreenClicked:(id)sender
|
||||
{
|
||||
// XXX: recalculate the video modes list to take into account the fullscreen status
|
||||
}
|
||||
|
||||
- (IBAction)cancel:(id)sender
|
||||
{
|
||||
[NSApp abortModal];
|
||||
}
|
||||
|
||||
- (IBAction)start:(id)sender
|
||||
{
|
||||
// XXX: write the states of the form controls to their respective homes
|
||||
[NSApp stopModal];
|
||||
}
|
||||
|
||||
- (void)setupRunMode
|
||||
{
|
||||
// XXX: populate the lists and set everything up to represent the current options
|
||||
|
||||
// enable all the controls on the Configuration page
|
||||
NSEnumerator *enumerator = [[[[tabView tabViewItemAtIndex:0] view] subviews] objectEnumerator];
|
||||
NSControl *control;
|
||||
while (control = [enumerator nextObject])
|
||||
[control setEnabled:true];
|
||||
|
||||
[cancelButton setEnabled:true];
|
||||
[startButton setEnabled:true];
|
||||
|
||||
[tabView selectTabViewItemAtIndex:0];
|
||||
}
|
||||
|
||||
- (void)setupMessagesMode
|
||||
{
|
||||
[tabView selectTabViewItemAtIndex:1];
|
||||
|
||||
// disable all the controls on the Configuration page except "always show", so the
|
||||
// user can enable it if they want to while waiting for something else to happen
|
||||
NSEnumerator *enumerator = [[[[tabView tabViewItemAtIndex:0] view] subviews] objectEnumerator];
|
||||
NSControl *control;
|
||||
while (control = [enumerator nextObject]) {
|
||||
if (control == alwaysShowButton) continue;
|
||||
[control setEnabled:false];
|
||||
}
|
||||
|
||||
[cancelButton setEnabled:false];
|
||||
[startButton setEnabled:false];
|
||||
}
|
||||
|
||||
- (void)putsMessage:(NSString *)str
|
||||
{
|
||||
NSRange end;
|
||||
NSTextStorage *text = [messagesView textStorage];
|
||||
BOOL shouldAutoScroll;
|
||||
|
||||
shouldAutoScroll = ((int)NSMaxY([messagesView bounds]) == (int)NSMaxY([messagesView visibleRect]));
|
||||
|
||||
end.location = [text length];
|
||||
end.length = 0;
|
||||
|
||||
[text beginEditing];
|
||||
[messagesView replaceCharactersInRange:end withString:str];
|
||||
[text endEditing];
|
||||
|
||||
if (shouldAutoScroll) {
|
||||
end.location = [text length];
|
||||
end.length = 0;
|
||||
[messagesView scrollRangeToVisible:end];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setTitle:(NSString *)str
|
||||
{
|
||||
[[self window] setTitle:str];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
static StartupWinController *startwin = nil;
|
||||
|
||||
int startwin_open(void)
|
||||
{
|
||||
if (startwin != nil) return 1;
|
||||
|
||||
startwin = [[StartupWinController alloc] initWithWindowNibName:@"startwin.editor"];
|
||||
if (startwin == nil) return -1;
|
||||
|
||||
[startwin showWindow:nil];
|
||||
[startwin setupMessagesMode];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int startwin_close(void)
|
||||
{
|
||||
if (startwin == nil) return 1;
|
||||
|
||||
[startwin close];
|
||||
startwin = nil;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int startwin_puts(const char *s)
|
||||
{
|
||||
NSString *ns;
|
||||
|
||||
if (!s) return -1;
|
||||
if (startwin == nil) return 1;
|
||||
|
||||
ns = [[NSString alloc] initWithCString:s];
|
||||
[startwin putsMessage:ns];
|
||||
[ns release];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int startwin_settitle(const char *s)
|
||||
{
|
||||
NSString *ns;
|
||||
|
||||
if (!s) return -1;
|
||||
if (startwin == nil) return 1;
|
||||
|
||||
ns = [[NSString alloc] initWithCString:s];
|
||||
[startwin setTitle:ns];
|
||||
[ns release];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int startwin_idle(void *v)
|
||||
{
|
||||
if (startwin) [[startwin window] displayIfNeeded];
|
||||
return 0;
|
||||
}
|
||||
|
||||
int startwin_run(void)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if (startwin == nil) return 0;
|
||||
|
||||
[startwin setupRunMode];
|
||||
|
||||
switch ([NSApp runModalForWindow:[startwin window]]) {
|
||||
case NSRunStoppedResponse: retval = 1; break;
|
||||
case NSRunAbortedResponse: retval = 0; break;
|
||||
default: retval = -1;
|
||||
}
|
||||
|
||||
[startwin setupMessagesMode];
|
||||
|
||||
return retval;
|
||||
}
|
|
@ -1,299 +0,0 @@
|
|||
// A.ASM replacement using C
|
||||
// Mainly by Ken Silverman, with things melded with my port by
|
||||
// Jonathon Fowler (jonof@edgenetwork.org)
|
||||
//
|
||||
// "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman
|
||||
// Ken Silverman's official web site: "http://www.advsys.net/ken"
|
||||
// See the included license file "BUILDLIC.TXT" for license info.
|
||||
|
||||
#include "a.h"
|
||||
|
||||
#ifdef ENGINE_USING_A_C
|
||||
|
||||
int32_t krecip(int32_t num); // from engine.c
|
||||
|
||||
#define BITSOFPRECISION 3
|
||||
#define BITSOFPRECISIONPOW 8
|
||||
|
||||
extern intptr_t asm1, asm2, asm3, asm4;
|
||||
extern int32_t fpuasm, globalx3, globaly3;
|
||||
extern void *reciptable;
|
||||
|
||||
static int32_t bpl, transmode = 0;
|
||||
static int32_t glogx, glogy, gbxinc, gbyinc, gpinc;
|
||||
static char *gbuf, *gpal, *ghlinepal, *gtrans;
|
||||
|
||||
//Global variable functions
|
||||
void setvlinebpl(int32_t dabpl) { bpl = dabpl; }
|
||||
void fixtransluscence(intptr_t datransoff) { gtrans = (char *)datransoff; }
|
||||
void settransnormal(void) { transmode = 0; }
|
||||
void settransreverse(void) { transmode = 1; }
|
||||
|
||||
|
||||
//Ceiling/floor horizontal line functions
|
||||
void sethlinesizes(int32_t logx, int32_t logy, intptr_t bufplc)
|
||||
{ glogx = logx; glogy = logy; gbuf = (char *)bufplc; }
|
||||
void setpalookupaddress(char *paladdr) { ghlinepal = paladdr; }
|
||||
void setuphlineasm4(int32_t bxinc, int32_t byinc) { gbxinc = bxinc; gbyinc = byinc; }
|
||||
void hlineasm4(int32_t cnt, int32_t skiploadincs, int32_t paloffs, uint32_t by, uint32_t bx, intptr_t p)
|
||||
{
|
||||
char *palptr;
|
||||
|
||||
palptr = (char *)&ghlinepal[paloffs];
|
||||
if (!skiploadincs) { gbxinc = asm1; gbyinc = asm2; }
|
||||
for (; cnt>=0; cnt--)
|
||||
{
|
||||
*((char *)p) = palptr[gbuf[((bx>>(32-glogx))<<glogy)+(by>>(32-glogy))]];
|
||||
bx -= gbxinc;
|
||||
by -= gbyinc;
|
||||
p--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Sloped ceiling/floor vertical line functions
|
||||
void setupslopevlin(int32_t logylogx, intptr_t bufplc, int32_t pinc)
|
||||
{
|
||||
glogx = (logylogx&255); glogy = (logylogx>>8);
|
||||
gbuf = (char *)bufplc; gpinc = pinc;
|
||||
}
|
||||
void slopevlin(intptr_t p, int32_t i, intptr_t slopaloffs, int32_t cnt, int32_t bx, int32_t by)
|
||||
{
|
||||
intptr_t *slopalptr;
|
||||
int32_t bz, bzinc;
|
||||
uint32_t u, v;
|
||||
|
||||
bz = asm3; bzinc = (asm1>>3);
|
||||
slopalptr = (intptr_t *)slopaloffs;
|
||||
for (; cnt>0; cnt--)
|
||||
{
|
||||
i = krecip(bz>>6); bz += bzinc;
|
||||
u = bx+globalx3*i;
|
||||
v = by+globaly3*i;
|
||||
(*(char *)p) = *(char *)(((intptr_t)slopalptr[0])+gbuf[((u>>(32-glogx))<<glogy)+(v>>(32-glogy))]);
|
||||
slopalptr--;
|
||||
p += gpinc;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Wall,face sprite/wall sprite vertical line functions
|
||||
void setupvlineasm(int32_t neglogy) { glogy = neglogy; }
|
||||
void vlineasm1(int32_t vinc, intptr_t paloffs, int32_t cnt, uint32_t vplc, intptr_t bufplc, intptr_t p)
|
||||
{
|
||||
gbuf = (char *)bufplc;
|
||||
gpal = (char *)paloffs;
|
||||
for (; cnt>=0; cnt--)
|
||||
{
|
||||
*((char *)p) = gpal[gbuf[vplc>>glogy]];
|
||||
p += bpl;
|
||||
vplc += vinc;
|
||||
}
|
||||
}
|
||||
|
||||
void setupmvlineasm(int32_t neglogy) { glogy = neglogy; }
|
||||
void mvlineasm1(int32_t vinc, intptr_t paloffs, int32_t cnt, uint32_t vplc, intptr_t bufplc, intptr_t p)
|
||||
{
|
||||
char ch;
|
||||
|
||||
gbuf = (char *)bufplc;
|
||||
gpal = (char *)paloffs;
|
||||
for (; cnt>=0; cnt--)
|
||||
{
|
||||
ch = gbuf[vplc>>glogy]; if (ch != 255) *((char *)p) = gpal[ch];
|
||||
p += bpl;
|
||||
vplc += vinc;
|
||||
}
|
||||
}
|
||||
|
||||
void setuptvlineasm(int32_t neglogy) { glogy = neglogy; }
|
||||
void tvlineasm1(int32_t vinc, intptr_t paloffs, int32_t cnt, uint32_t vplc, intptr_t bufplc, intptr_t p)
|
||||
{
|
||||
char ch;
|
||||
|
||||
gbuf = (char *)bufplc;
|
||||
gpal = (char *)paloffs;
|
||||
if (transmode)
|
||||
{
|
||||
for (; cnt>=0; cnt--)
|
||||
{
|
||||
ch = gbuf[vplc>>glogy];
|
||||
if (ch != 255) *((char *)p) = gtrans[(*((char *)p))+(gpal[ch]<<8)];
|
||||
p += bpl;
|
||||
vplc += vinc;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (; cnt>=0; cnt--)
|
||||
{
|
||||
ch = gbuf[vplc>>glogy];
|
||||
if (ch != 255) *((char *)p) = gtrans[((*((char *)p))<<8)+gpal[ch]];
|
||||
p += bpl;
|
||||
vplc += vinc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Floor sprite horizontal line functions
|
||||
void msethlineshift(int32_t logx, int32_t logy) { glogx = logx; glogy = logy; }
|
||||
void mhline(intptr_t bufplc, uint32_t bx, int32_t cntup16, int32_t junk, uint32_t by, intptr_t p)
|
||||
{
|
||||
char ch;
|
||||
|
||||
gbuf = (char *)bufplc;
|
||||
gpal = (char *)asm3;
|
||||
for (cntup16>>=16; cntup16>0; cntup16--)
|
||||
{
|
||||
ch = gbuf[((bx>>(32-glogx))<<glogy)+(by>>(32-glogy))];
|
||||
if (ch != 255) *((char *)p) = gpal[ch];
|
||||
bx += asm1;
|
||||
by += asm2;
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
||||
void tsethlineshift(int32_t logx, int32_t logy) { glogx = logx; glogy = logy; }
|
||||
void thline(intptr_t bufplc, uint32_t bx, int32_t cntup16, int32_t junk, uint32_t by, intptr_t p)
|
||||
{
|
||||
char ch;
|
||||
|
||||
gbuf = (char *)bufplc;
|
||||
gpal = (char *)asm3;
|
||||
if (transmode)
|
||||
{
|
||||
for (cntup16>>=16; cntup16>0; cntup16--)
|
||||
{
|
||||
ch = gbuf[((bx>>(32-glogx))<<glogy)+(by>>(32-glogy))];
|
||||
if (ch != 255) *((char *)p) = gtrans[(*((char *)p))+(gpal[ch]<<8)];
|
||||
bx += asm1;
|
||||
by += asm2;
|
||||
p++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (cntup16>>=16; cntup16>0; cntup16--)
|
||||
{
|
||||
ch = gbuf[((bx>>(32-glogx))<<glogy)+(by>>(32-glogy))];
|
||||
if (ch != 255) *((char *)p) = gtrans[((*((char *)p))<<8)+gpal[ch]];
|
||||
bx += asm1;
|
||||
by += asm2;
|
||||
p++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Rotatesprite vertical line functions
|
||||
void setupspritevline(intptr_t paloffs, int32_t bxinc, int32_t byinc, int32_t ysiz)
|
||||
{
|
||||
gpal = (char *)paloffs;
|
||||
gbxinc = bxinc;
|
||||
gbyinc = byinc;
|
||||
glogy = ysiz;
|
||||
}
|
||||
void spritevline(int32_t bx, int32_t by, int32_t cnt, intptr_t bufplc, intptr_t p)
|
||||
{
|
||||
gbuf = (char *)bufplc;
|
||||
for (; cnt>1; cnt--)
|
||||
{
|
||||
(*(char *)p) = gpal[gbuf[(bx>>16)*glogy+(by>>16)]];
|
||||
bx += gbxinc;
|
||||
by += gbyinc;
|
||||
p += bpl;
|
||||
}
|
||||
}
|
||||
|
||||
//Rotatesprite vertical line functions
|
||||
void msetupspritevline(intptr_t paloffs, int32_t bxinc, int32_t byinc, int32_t ysiz)
|
||||
{
|
||||
gpal = (char *)paloffs;
|
||||
gbxinc = bxinc;
|
||||
gbyinc = byinc;
|
||||
glogy = ysiz;
|
||||
}
|
||||
void mspritevline(int32_t bx, int32_t by, int32_t cnt, intptr_t bufplc, intptr_t p)
|
||||
{
|
||||
char ch;
|
||||
|
||||
gbuf = (char *)bufplc;
|
||||
for (; cnt>1; cnt--)
|
||||
{
|
||||
ch = gbuf[(bx>>16)*glogy+(by>>16)];
|
||||
if (ch != 255)(*(char *)p) = gpal[ch];
|
||||
bx += gbxinc;
|
||||
by += gbyinc;
|
||||
p += bpl;
|
||||
}
|
||||
}
|
||||
|
||||
void tsetupspritevline(intptr_t paloffs, int32_t bxinc, int32_t byinc, int32_t ysiz)
|
||||
{
|
||||
gpal = (char *)paloffs;
|
||||
gbxinc = bxinc;
|
||||
gbyinc = byinc;
|
||||
glogy = ysiz;
|
||||
}
|
||||
void tspritevline(int32_t bx, int32_t by, int32_t cnt, intptr_t bufplc, intptr_t p)
|
||||
{
|
||||
char ch;
|
||||
|
||||
gbuf = (char *)bufplc;
|
||||
if (transmode)
|
||||
{
|
||||
for (; cnt>1; cnt--)
|
||||
{
|
||||
ch = gbuf[(bx>>16)*glogy+(by>>16)];
|
||||
if (ch != 255) *((char *)p) = gtrans[(*((char *)p))+(gpal[ch]<<8)];
|
||||
bx += gbxinc;
|
||||
by += gbyinc;
|
||||
p += bpl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (; cnt>1; cnt--)
|
||||
{
|
||||
ch = gbuf[(bx>>16)*glogy+(by>>16)];
|
||||
if (ch != 255) *((char *)p) = gtrans[((*((char *)p))<<8)+gpal[ch]];
|
||||
bx += gbxinc;
|
||||
by += gbyinc;
|
||||
p += bpl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void setupdrawslab(int32_t dabpl, intptr_t pal)
|
||||
{ bpl = dabpl; gpal = (char *)pal; }
|
||||
|
||||
void drawslab(int32_t dx, int32_t v, int32_t dy, int32_t vi, intptr_t vptr, intptr_t p)
|
||||
{
|
||||
int32_t x;
|
||||
|
||||
while (dy > 0)
|
||||
{
|
||||
for (x=0; x<dx; x++) *(char *)(p+x) = gpal[(int32_t)(*(char *)((v>>16)+vptr))];
|
||||
p += bpl; v += vi; dy--;
|
||||
}
|
||||
}
|
||||
|
||||
void stretchhline(intptr_t p0, int32_t u, int32_t cnt, int32_t uinc, intptr_t rptr, intptr_t p)
|
||||
{
|
||||
p0 = p-(cnt<<2);
|
||||
do
|
||||
{
|
||||
p--;
|
||||
*(char *)p = *(char *)((u>>16)+rptr); u -= uinc;
|
||||
}
|
||||
while (p > p0);
|
||||
}
|
||||
|
||||
|
||||
void mmxoverlay() { }
|
||||
|
||||
#endif
|
||||
/*
|
||||
* vim:ts=4:
|
||||
*/
|
||||
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,365 +0,0 @@
|
|||
#include "compat.h"
|
||||
#include "osd.h"
|
||||
#include "build.h"
|
||||
#include "baselayer.h"
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
#include "winlayer.h"
|
||||
#endif
|
||||
|
||||
#include "polymost.h"
|
||||
|
||||
// input
|
||||
char inputdevices=0;
|
||||
char keystatus[256], keyfifo[KEYFIFOSIZ], keyfifoplc, keyfifoend;
|
||||
char keyasciififo[KEYFIFOSIZ], keyasciififoplc, keyasciififoend;
|
||||
char remap[256];
|
||||
int32_t remapinit=0;
|
||||
char key_names[256][24];
|
||||
volatile int32_t mousex=0,mousey=0,mouseb=0;
|
||||
int32_t *joyaxis = NULL, joyb=0, *joyhat = NULL;
|
||||
char joyisgamepad=0, joynumaxes=0, joynumbuttons=0, joynumhats=0;
|
||||
int32_t joyaxespresent=0;
|
||||
|
||||
void(*keypresscallback)(int32_t,int32_t) = 0;
|
||||
void(*mousepresscallback)(int32_t,int32_t) = 0;
|
||||
void(*joypresscallback)(int32_t,int32_t) = 0;
|
||||
void (*after_handleevents_hook)(void) = 0;
|
||||
|
||||
extern int16_t brightness;
|
||||
|
||||
//
|
||||
// set{key|mouse|joy}presscallback() -- sets a callback which gets notified when keys are pressed
|
||||
//
|
||||
void setkeypresscallback(void (*callback)(int32_t, int32_t)) { keypresscallback = callback; }
|
||||
void setmousepresscallback(void (*callback)(int32_t, int32_t)) { mousepresscallback = callback; }
|
||||
void setjoypresscallback(void (*callback)(int32_t, int32_t)) { joypresscallback = callback; }
|
||||
|
||||
char scantoasc[128] =
|
||||
{
|
||||
0,0,'1','2','3','4','5','6','7','8','9','0','-','=',0,0,
|
||||
'q','w','e','r','t','y','u','i','o','p','[',']',0,0,'a','s',
|
||||
'd','f','g','h','j','k','l',';',39,'`',0,92,'z','x','c','v',
|
||||
'b','n','m',',','.','/',0,'*',0,32,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,'7','8','9','-','4','5','6','+','1',
|
||||
'2','3','0','.',0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
};
|
||||
|
||||
int32_t defaultres[][2] =
|
||||
{
|
||||
{1920, 1440}, {1920, 1200}, {1920, 1080}, {1600, 1200}, {1600, 900}, {1366, 768}, {1280, 1024},
|
||||
{1280, 960}, {1152, 864}, {1024, 768}, {1024, 600}, {800, 600}, {640, 480}, {640, 400},
|
||||
{512, 384}, {480, 360}, {400, 300}, {320, 240}, {320, 200}, {0, 0}
|
||||
};
|
||||
|
||||
|
||||
void SetKey(int32_t key, int32_t state)
|
||||
{
|
||||
keystatus[remap[key]] = state;
|
||||
|
||||
if (state)
|
||||
{
|
||||
keyfifo[keyfifoend] = remap[key];
|
||||
keyfifo[(keyfifoend+1)&(KEYFIFOSIZ-1)] = state;
|
||||
keyfifoend = ((keyfifoend+2)&(KEYFIFOSIZ-1));
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// bgetchar, bflushchars -- character-based input functions
|
||||
//
|
||||
char bgetchar(void)
|
||||
{
|
||||
if (keyasciififoplc == keyasciififoend)
|
||||
return 0;
|
||||
|
||||
{
|
||||
char c = keyasciififo[keyasciififoplc];
|
||||
keyasciififoplc = ((keyasciififoplc+1)&(KEYFIFOSIZ-1));
|
||||
return c;
|
||||
}
|
||||
}
|
||||
|
||||
void bflushchars(void)
|
||||
{
|
||||
Bmemset(&keyasciififo,0,sizeof(keyasciififo));
|
||||
keyasciififoplc = keyasciififoend = 0;
|
||||
}
|
||||
|
||||
const char *getkeyname(int32_t num)
|
||||
{
|
||||
return ((unsigned)num >= 256) ? NULL : key_names[num];
|
||||
}
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
struct glinfo_t glinfo =
|
||||
{
|
||||
"Unknown", // vendor
|
||||
"Unknown", // renderer
|
||||
"0.0.0", // version
|
||||
"", // extensions
|
||||
|
||||
1.0, // max anisotropy
|
||||
0, // brga texture format
|
||||
0, // clamp-to-edge support
|
||||
0, // texture compression
|
||||
0, // non-power-of-two textures
|
||||
0, // multisampling
|
||||
0, // nvidia multisampling hint
|
||||
0, // ARBfp
|
||||
0, // depth textures
|
||||
0, // shadow comparison
|
||||
0, // Frame Buffer Objects
|
||||
0, // rectangle textures
|
||||
0, // multitexturing
|
||||
0, // env_combine
|
||||
0, // Vertex Buffer Objects
|
||||
0, // VSync support
|
||||
0, // Shader Model 4 support
|
||||
0, // Occlusion Queries
|
||||
0, // GLSL
|
||||
0, // GL info dumped
|
||||
};
|
||||
#endif
|
||||
|
||||
char *Bstrtolower(char *str)
|
||||
{
|
||||
if (!str) return NULL;
|
||||
|
||||
{
|
||||
int32_t i = 0, len = Bstrlen(str);
|
||||
|
||||
if (len <= 0) return str;
|
||||
|
||||
do
|
||||
{
|
||||
*(str+i) = Btolower(*(str+i));
|
||||
i++;
|
||||
}
|
||||
while (--len);
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
int32_t flushlogwindow = 1;
|
||||
|
||||
static void onvideomodechange(int32_t newmode) { UNREFERENCED_PARAMETER(newmode); }
|
||||
void (*baselayer_onvideomodechange)(int32_t) = onvideomodechange;
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
static int32_t osdfunc_setrendermode(const osdfuncparm_t *parm)
|
||||
{
|
||||
int32_t m;
|
||||
char *p;
|
||||
|
||||
const char *modestrs[] =
|
||||
{
|
||||
"classic software", "",
|
||||
"", "polygonal OpenGL", "great justice (Polymer)"
|
||||
};
|
||||
|
||||
if (parm->numparms != 1) return OSDCMD_SHOWHELP;
|
||||
m = Bstrtol(parm->parms[0], &p, 10);
|
||||
|
||||
if (m < 0 || m > 4) return OSDCMD_SHOWHELP;
|
||||
|
||||
setrendermode(m);
|
||||
OSD_Printf("Rendering method changed to %s\n", modestrs[ getrendermode()]);
|
||||
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
#if defined(USE_OPENGL)
|
||||
#ifdef DEBUGGINGAIDS
|
||||
static int32_t osdcmd_hicsetpalettetint(const osdfuncparm_t *parm)
|
||||
{
|
||||
int32_t pal, cols[3], eff;
|
||||
|
||||
if (parm->numparms != 5) return OSDCMD_SHOWHELP;
|
||||
|
||||
pal = Batol(parm->parms[0]);
|
||||
cols[0] = Batol(parm->parms[1]);
|
||||
cols[1] = Batol(parm->parms[2]);
|
||||
cols[2] = Batol(parm->parms[3]);
|
||||
eff = Batol(parm->parms[4]);
|
||||
|
||||
hicsetpalettetint(pal,cols[0],cols[1],cols[2],eff);
|
||||
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
int32_t osdcmd_glinfo(const osdfuncparm_t *parm)
|
||||
{
|
||||
char *s,*t,*u,i;
|
||||
|
||||
UNREFERENCED_PARAMETER(parm);
|
||||
|
||||
if (bpp == 8)
|
||||
{
|
||||
initprintf("glinfo: Not in OpenGL mode.\n");
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
initprintf("OpenGL Information:\n"
|
||||
" Version: %s\n"
|
||||
" Vendor: %s\n"
|
||||
" Renderer: %s\n",
|
||||
glinfo.version,
|
||||
glinfo.vendor,
|
||||
glinfo.renderer);
|
||||
|
||||
if (!glinfo.dumped)
|
||||
return OSDCMD_OK;
|
||||
|
||||
initprintf(" Maximum anisotropy: %.1f%s\n"
|
||||
" BGRA textures: %s\n"
|
||||
" Non-power-of-2 textures: %s\n"
|
||||
" Texure compression: %s\n"
|
||||
" Clamp-to-edge: %s\n"
|
||||
" Multisampling: %s\n"
|
||||
" Nvidia multisample hint: %s\n"
|
||||
" ARBfp fragment programs: %s\n"
|
||||
" Depth textures: %s\n"
|
||||
" Shadow textures: %s\n"
|
||||
" Frame Buffer Objects: %s\n"
|
||||
" Rectangle textures: %s\n"
|
||||
" Multitexturing: %s\n"
|
||||
" env_combine: %s\n"
|
||||
" Vertex Buffer Objects: %s\n"
|
||||
" Shader Model 4: %s\n"
|
||||
" Occlusion queries: %s\n"
|
||||
" GLSL: %s\n"
|
||||
" Extensions:\n",
|
||||
glinfo.maxanisotropy, glinfo.maxanisotropy>1.0?"":" (no anisotropic filtering)",
|
||||
glinfo.bgra ? "supported": "not supported",
|
||||
glinfo.texnpot ? "supported": "not supported",
|
||||
glinfo.texcompr ? "supported": "not supported",
|
||||
glinfo.clamptoedge ? "supported": "not supported",
|
||||
glinfo.multisample ? "supported": "not supported",
|
||||
glinfo.nvmultisamplehint ? "supported": "not supported",
|
||||
glinfo.arbfp ? "supported": "not supported",
|
||||
glinfo.depthtex ? "supported": "not supported",
|
||||
glinfo.shadow ? "supported": "not supported",
|
||||
glinfo.fbos ? "supported": "not supported",
|
||||
glinfo.rect ? "supported": "not supported",
|
||||
glinfo.multitex ? "supported": "not supported",
|
||||
glinfo.envcombine ? "supported": "not supported",
|
||||
glinfo.vbos ? "supported": "not supported",
|
||||
glinfo.sm4 ? "supported": "not supported",
|
||||
glinfo.occlusionqueries ? "supported": "not supported",
|
||||
glinfo.glsl ? "supported": "not supported"
|
||||
);
|
||||
|
||||
s = Bstrdup(glinfo.extensions);
|
||||
if (!s) initprintf("%s", glinfo.extensions);
|
||||
else
|
||||
{
|
||||
i = 0; t = u = s;
|
||||
while (*t)
|
||||
{
|
||||
if (*t == ' ')
|
||||
{
|
||||
if (i&1)
|
||||
{
|
||||
*t = 0;
|
||||
initprintf(" %s\n",u);
|
||||
u = t+1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
t++;
|
||||
}
|
||||
if (i&1) initprintf(" %s\n",u);
|
||||
Bfree(s);
|
||||
}
|
||||
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static int32_t osdcmd_cvar_set_baselayer(const osdfuncparm_t *parm)
|
||||
{
|
||||
int32_t r = osdcmd_cvar_set(parm);
|
||||
|
||||
if (r != OSDCMD_OK) return r;
|
||||
|
||||
/*
|
||||
if (!Bstrcasecmp(parm->name, "r_scrcaptureformat"))
|
||||
{
|
||||
const char *fmts[] = {"TGA", "PCX"};
|
||||
if (showval) { OSD_Printf("r_scrcaptureformat is %s\n", fmts[captureformat]); }
|
||||
else
|
||||
{
|
||||
int32_t j;
|
||||
for (j=0; j<2; j++)
|
||||
if (!Bstrcasecmp(parm->parms[0], fmts[j])) break;
|
||||
if (j == 2) return OSDCMD_SHOWHELP;
|
||||
captureformat = j;
|
||||
}
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
else */
|
||||
|
||||
if (!Bstrcasecmp(parm->name, "vid_gamma") || !Bstrcasecmp(parm->name, "vid_brightness") || !Bstrcasecmp(parm->name, "vid_contrast"))
|
||||
{
|
||||
setbrightness(GAMMA_CALC,0,0);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
int32_t baselayer_init(void)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
cvar_t cvars_engine[] =
|
||||
{
|
||||
{ "r_usenewaspect","r_usenewaspect: enable/disable new screen aspect ratio determination code",(void *) &r_usenewaspect, CVAR_BOOL, 0, 1 },
|
||||
{ "r_screenaspect","r_screenaspect: if using the new aspect code and in fullscreen, screen aspect ratio in the form XXYY, e.g. 1609 for 16:9",(void *) &r_screenxy, CVAR_UINT, 100, 9999 },
|
||||
{ "r_novoxmips","r_novoxmips: turn off/on the use of mipmaps when rendering 8-bit voxels",(void *) &novoxmips, CVAR_BOOL, 0, 1 },
|
||||
{ "r_voxels","r_voxels: enable/disable automatic sprite->voxel rendering",(void *) &usevoxels, CVAR_BOOL, 0, 1 },
|
||||
/* { "r_scrcaptureformat","r_scrcaptureformat: sets the output format for screenshots (TGA or PCX)",osdcmd_vars, CVAR_FUNCPTR, 0, 0 },*/
|
||||
{ "vid_gamma","vid_gamma <gamma>: adjusts gamma ramp",(void *) &vid_gamma, CVAR_DOUBLE|CVAR_FUNCPTR, 0, 10 },
|
||||
{ "vid_contrast","vid_contrast <gamma>: adjusts gamma ramp",(void *) &vid_contrast, CVAR_DOUBLE|CVAR_FUNCPTR, 0, 10 },
|
||||
{ "vid_brightness","vid_brightness <gamma>: adjusts gamma ramp",(void *) &vid_brightness, CVAR_DOUBLE|CVAR_FUNCPTR, 0, 10 },
|
||||
{ "debug1","debug counter",(void *) &debug1, CVAR_FLOAT, -100000, 100000 },
|
||||
{ "debug2","debug counter",(void *) &debug2, CVAR_FLOAT, -100000, 100000 },
|
||||
};
|
||||
|
||||
for (i=0; i<sizeof(cvars_engine)/sizeof(cvars_engine[0]); i++)
|
||||
{
|
||||
if (OSD_RegisterCvar(&cvars_engine[i]))
|
||||
continue;
|
||||
|
||||
OSD_RegisterFunction(cvars_engine[i].name, cvars_engine[i].helpstr,
|
||||
(cvars_engine[i].type & CVAR_FUNCPTR) ? osdcmd_cvar_set_baselayer : osdcmd_cvar_set);
|
||||
}
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
OSD_RegisterFunction("setrendermode","setrendermode <number>: sets the engine's rendering mode.\n"
|
||||
"Mode numbers are:\n"
|
||||
" 0 - Classic Build software\n"
|
||||
#ifdef USE_OPENGL
|
||||
" 3 - Polygonal OpenGL\n"
|
||||
" 4 - Great justice renderer (Polymer)\n"
|
||||
#endif
|
||||
,
|
||||
osdfunc_setrendermode);
|
||||
#ifdef USE_OPENGL
|
||||
# ifdef DEBUGGINGAIDS
|
||||
OSD_RegisterFunction("hicsetpalettetint","hicsetpalettetint: sets palette tinting values",osdcmd_hicsetpalettetint);
|
||||
# endif
|
||||
OSD_RegisterFunction("glinfo","glinfo: shows OpenGL information about the current OpenGL mode",osdcmd_glinfo);
|
||||
#endif
|
||||
polymost_initosdfuncs();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,846 +0,0 @@
|
|||
/*
|
||||
* Playing-field leveller for Build
|
||||
* by Jonathon Fowler
|
||||
*
|
||||
* A note about this:
|
||||
* 1. There is some kind of problem somewhere in the functions below because
|
||||
* compiling with __compat_h_macrodef__ disabled makes stupid things happen.
|
||||
* 2. The functions below, aside from the ones which aren't trivial, were never
|
||||
* really intended to be used for anything except tracking anr removing ties
|
||||
* to the standard C library from games. Using the Bxx versions of functions
|
||||
* means we can redefine those names to link up with different runtime library
|
||||
* names.
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define _WIN32_IE 0x0400
|
||||
#define _WIN32_WINNT 0x0501
|
||||
#include <windows.h>
|
||||
#include <shlobj.h>
|
||||
#include <direct.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
// #include <sys/stat.h>
|
||||
#include <limits.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
|
||||
# include <CoreFoundation/CoreFoundation.h>
|
||||
# include <CoreServices/CoreServices.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <dirent.h>
|
||||
#endif
|
||||
|
||||
#include "compat.h"
|
||||
#include "baselayer.h"
|
||||
|
||||
#ifndef __compat_h_macrodef__
|
||||
|
||||
int32_t Brand(void)
|
||||
{
|
||||
return rand();
|
||||
}
|
||||
|
||||
void *Bmalloc(bsize_t size)
|
||||
{
|
||||
#ifdef NEDMALLOC
|
||||
return nedmalloc(size);
|
||||
#else
|
||||
return malloc(size);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Bfree(void *ptr)
|
||||
{
|
||||
#ifdef NEDMALLOC
|
||||
nedfree(ptr);
|
||||
#else
|
||||
free(ptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
int32_t Bopen(const char *pathname, int32_t flags, uint32_t mode)
|
||||
{
|
||||
int32_t n=0,o=0;
|
||||
|
||||
if (flags&BO_BINARY) n|=O_BINARY; else n|=O_TEXT;
|
||||
if ((flags&BO_RDWR)==BO_RDWR) n|=O_RDWR;
|
||||
else if ((flags&BO_RDWR)==BO_WRONLY) n|=O_WRONLY;
|
||||
else if ((flags&BO_RDWR)==BO_RDONLY) n|=O_RDONLY;
|
||||
if (flags&BO_APPEND) n|=O_APPEND;
|
||||
if (flags&BO_CREAT) n|=O_CREAT;
|
||||
if (flags&BO_TRUNC) n|=O_TRUNC;
|
||||
if (mode&BS_IREAD) o|=S_IREAD;
|
||||
if (mode&BS_IWRITE) o|=S_IWRITE;
|
||||
if (mode&BS_IEXEC) o|=S_IEXEC;
|
||||
|
||||
return open(pathname,n,o);
|
||||
}
|
||||
|
||||
int32_t Bclose(int32_t fd)
|
||||
{
|
||||
return close(fd);
|
||||
}
|
||||
|
||||
bssize_t Bwrite(int32_t fd, const void *buf, bsize_t count)
|
||||
{
|
||||
return write(fd,buf,count);
|
||||
}
|
||||
|
||||
bssize_t Bread(int32_t fd, void *buf, bsize_t count)
|
||||
{
|
||||
return read(fd,buf,count);
|
||||
}
|
||||
|
||||
int32_t Blseek(int32_t fildes, int32_t offset, int32_t whence)
|
||||
{
|
||||
switch (whence)
|
||||
{
|
||||
case BSEEK_SET:
|
||||
whence=SEEK_SET; break;
|
||||
case BSEEK_CUR:
|
||||
whence=SEEK_CUR; break;
|
||||
case BSEEK_END:
|
||||
whence=SEEK_END; break;
|
||||
}
|
||||
return lseek(fildes,offset,whence);
|
||||
}
|
||||
|
||||
BFILE *Bfopen(const char *path, const char *mode)
|
||||
{
|
||||
return (BFILE *)fopen(path,mode);
|
||||
}
|
||||
|
||||
int32_t Bfclose(BFILE *stream)
|
||||
{
|
||||
return fclose((FILE *)stream);
|
||||
}
|
||||
|
||||
void Brewind(BFILE *stream)
|
||||
{
|
||||
rewind((FILE *)stream);
|
||||
}
|
||||
|
||||
int32_t Bfgetc(BFILE *stream)
|
||||
{
|
||||
return fgetc((FILE *)stream);
|
||||
}
|
||||
|
||||
char *Bfgets(char *s, int32_t size, BFILE *stream)
|
||||
{
|
||||
return fgets(s,size,(FILE *)stream);
|
||||
}
|
||||
|
||||
int32_t Bfputc(int32_t c, BFILE *stream)
|
||||
{
|
||||
return fputc(c,(FILE *)stream);
|
||||
}
|
||||
|
||||
int32_t Bfputs(const char *s, BFILE *stream)
|
||||
{
|
||||
return fputs(s,(FILE *)stream);
|
||||
}
|
||||
|
||||
bsize_t Bfread(void *ptr, bsize_t size, bsize_t nmemb, BFILE *stream)
|
||||
{
|
||||
return fread(ptr,size,nmemb,(FILE *)stream);
|
||||
}
|
||||
|
||||
bsize_t Bfwrite(const void *ptr, bsize_t size, bsize_t nmemb, BFILE *stream)
|
||||
{
|
||||
return fwrite(ptr,size,nmemb,(FILE *)stream);
|
||||
}
|
||||
|
||||
|
||||
char *Bstrdup(const char *s)
|
||||
{
|
||||
#ifdef NEDMALLOC
|
||||
return nedstrdup(s);
|
||||
#else
|
||||
return strdup(s);
|
||||
#endif
|
||||
}
|
||||
|
||||
char *Bstrcpy(char *dest, const char *src)
|
||||
{
|
||||
return strcpy(dest,src);
|
||||
}
|
||||
|
||||
char *Bstrncpy(char *dest, const char *src, bsize_t n)
|
||||
{
|
||||
return Bstrncpy(dest,src,n);
|
||||
}
|
||||
|
||||
int32_t Bstrcmp(const char *s1, const char *s2)
|
||||
{
|
||||
return strcmp(s1,s2);
|
||||
}
|
||||
|
||||
int32_t Bstrncmp(const char *s1, const char *s2, bsize_t n)
|
||||
{
|
||||
return strncmp(s1,s2,n);
|
||||
}
|
||||
|
||||
int32_t Bstrcasecmp(const char *s1, const char *s2)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
return _stricmp(s1,s2);
|
||||
#else
|
||||
return strcasecmp(s1,s2);
|
||||
#endif
|
||||
}
|
||||
|
||||
int32_t Bstrncasecmp(const char *s1, const char *s2, bsize_t n)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
return _strnicmp(s1,s2,n);
|
||||
#else
|
||||
return strncasecmp(s1,s2,n);
|
||||
#endif
|
||||
}
|
||||
|
||||
char *Bstrcat(char *dest, const char *src)
|
||||
{
|
||||
return strcat(dest,src);
|
||||
}
|
||||
|
||||
char *Bstrncat(char *dest, const char *src, bsize_t n)
|
||||
{
|
||||
return strncat(dest,src,n);
|
||||
}
|
||||
|
||||
bsize_t Bstrlen(const char *s)
|
||||
{
|
||||
return strlen(s);
|
||||
}
|
||||
|
||||
char *Bstrchr(const char *s, int32_t c)
|
||||
{
|
||||
return strchr(s,c);
|
||||
}
|
||||
|
||||
char *Bstrrchr(const char *s, int32_t c)
|
||||
{
|
||||
return strrchr(s,c);
|
||||
}
|
||||
|
||||
int32_t Batoi(const char *nptr)
|
||||
{
|
||||
return atoi(nptr);
|
||||
}
|
||||
|
||||
int32_t Batol(const char *nptr)
|
||||
{
|
||||
return atol(nptr);
|
||||
}
|
||||
|
||||
int32_t int32_t Bstrtol(const char *nptr, char **endptr, int32_t base)
|
||||
{
|
||||
return strtol(nptr,endptr,base);
|
||||
}
|
||||
|
||||
uint32_t int32_t Bstrtoul(const char *nptr, char **endptr, int32_t base)
|
||||
{
|
||||
return strtoul(nptr,endptr,base);
|
||||
}
|
||||
|
||||
void *Bmemcpy(void *dest, const void *src, bsize_t n)
|
||||
{
|
||||
return memcpy(dest,src,n);
|
||||
}
|
||||
|
||||
void *Bmemmove(void *dest, const void *src, bsize_t n)
|
||||
{
|
||||
return memmove(dest,src,n);
|
||||
}
|
||||
|
||||
void *Bmemchr(const void *s, int32_t c, bsize_t n)
|
||||
{
|
||||
return memchr(s,c,n);
|
||||
}
|
||||
|
||||
void *Bmemset(void *s, int32_t c, bsize_t n)
|
||||
{
|
||||
return memset(s,c,n);
|
||||
}
|
||||
|
||||
int32_t Bprintf(const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int32_t r;
|
||||
|
||||
va_start(ap,format);
|
||||
#ifdef _MSC_VER
|
||||
r = _vprintf(format,ap);
|
||||
#else
|
||||
r = vprintf(format,ap);
|
||||
#endif
|
||||
va_end(ap);
|
||||
return r;
|
||||
}
|
||||
|
||||
int32_t Bsprintf(char *str, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int32_t r;
|
||||
|
||||
va_start(ap,format);
|
||||
#ifdef _MSC_VER
|
||||
r = _vsprintf(str,format,ap);
|
||||
#else
|
||||
r = vsprintf(str,format,ap);
|
||||
#endif
|
||||
va_end(ap);
|
||||
return r;
|
||||
}
|
||||
|
||||
int32_t Bsnprintf(char *str, bsize_t size, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int32_t r;
|
||||
|
||||
va_start(ap,format);
|
||||
#ifdef _MSC_VER
|
||||
r = _vsnprintf(str,size,format,ap);
|
||||
#else
|
||||
r = vsnprintf(str,size,format,ap);
|
||||
#endif
|
||||
va_end(ap);
|
||||
return r;
|
||||
}
|
||||
|
||||
int32_t Bvsnprintf(char *str, bsize_t size, const char *format, va_list ap)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
return _vsnprintf(str,size,format,ap);
|
||||
#else
|
||||
return vsnprintf(str,size,format,ap);
|
||||
#endif
|
||||
}
|
||||
|
||||
char *Bgetenv(const char *name)
|
||||
{
|
||||
return getenv(name);
|
||||
}
|
||||
|
||||
char *Bgetcwd(char *buf, bsize_t size)
|
||||
{
|
||||
return getcwd(buf,size);
|
||||
}
|
||||
|
||||
#endif // __compat_h_macrodef__
|
||||
|
||||
|
||||
//
|
||||
// Stuff which must be a function
|
||||
//
|
||||
|
||||
char *Bgethomedir(void)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
FARPROC aSHGetSpecialFolderPathA;
|
||||
TCHAR appdata[MAX_PATH];
|
||||
int32_t loaded = 0;
|
||||
HMODULE hShell32 = GetModuleHandle("shell32.dll");
|
||||
|
||||
if (hShell32 == NULL)
|
||||
{
|
||||
hShell32 = LoadLibrary("shell32.dll");
|
||||
loaded = 1;
|
||||
}
|
||||
|
||||
if (hShell32 == NULL)
|
||||
return NULL;
|
||||
|
||||
aSHGetSpecialFolderPathA = GetProcAddress(hShell32, "SHGetSpecialFolderPathA");
|
||||
if (aSHGetSpecialFolderPathA != NULL)
|
||||
if (SUCCEEDED(aSHGetSpecialFolderPathA(NULL, appdata, CSIDL_APPDATA, FALSE)))
|
||||
{
|
||||
if (loaded)
|
||||
FreeLibrary(hShell32);
|
||||
return Bstrdup(appdata);
|
||||
}
|
||||
|
||||
if (loaded)
|
||||
FreeLibrary(hShell32);
|
||||
return NULL;
|
||||
#elif defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
|
||||
FSRef ref;
|
||||
CFStringRef str;
|
||||
CFURLRef base;
|
||||
char *s;
|
||||
|
||||
if (FSFindFolder(kUserDomain, kVolumeRootFolderType, kDontCreateFolder, &ref) < 0) return NULL;
|
||||
base = CFURLCreateFromFSRef(NULL, &ref);
|
||||
if (!base) return NULL;
|
||||
str = CFURLCopyFileSystemPath(base, kCFURLPOSIXPathStyle);
|
||||
CFRelease(base);
|
||||
if (!str) return NULL;
|
||||
s = (char *)CFStringGetCStringPtr(str,CFStringGetSystemEncoding());
|
||||
if (s) s = Bstrdup(s);
|
||||
CFRelease(str);
|
||||
return s;
|
||||
#else
|
||||
char *e = getenv("HOME");
|
||||
if (!e) return NULL;
|
||||
return Bstrdup(e);
|
||||
#endif
|
||||
}
|
||||
|
||||
char *Bgetsupportdir(int32_t global)
|
||||
{
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3_
|
||||
UNREFERENCED_PARAMETER(global);
|
||||
return Bgethomedir();
|
||||
#else
|
||||
FSRef ref;
|
||||
CFStringRef str;
|
||||
CFURLRef base;
|
||||
char *s;
|
||||
|
||||
if (FSFindFolder(global ? kLocalDomain : kUserDomain,
|
||||
kApplicationSupportFolderType,
|
||||
kDontCreateFolder, &ref) < 0) return NULL;
|
||||
base = CFURLCreateFromFSRef(NULL, &ref);
|
||||
if (!base) return NULL;
|
||||
str = CFURLCopyFileSystemPath(base, kCFURLPOSIXPathStyle);
|
||||
CFRelease(base);
|
||||
if (!str) return NULL;
|
||||
s = (char *)CFStringGetCStringPtr(str,CFStringGetSystemEncoding());
|
||||
if (s) s = Bstrdup(s);
|
||||
CFRelease(str);
|
||||
return s;
|
||||
#endif
|
||||
}
|
||||
|
||||
int32_t Bcorrectfilename(char *filename, int32_t removefn)
|
||||
{
|
||||
char *fn;
|
||||
char *tokarr[64], *first, *next = NULL, *token;
|
||||
int32_t i, ntok = 0, leadslash = 0, trailslash = 0;
|
||||
|
||||
fn = Bstrdup(filename);
|
||||
if (!fn) return -1;
|
||||
|
||||
for (first=fn; *first; first++)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (*first == '\\') *first = '/';
|
||||
#endif
|
||||
}
|
||||
leadslash = (*fn == '/');
|
||||
trailslash = (first>fn && first[-1] == '/');
|
||||
|
||||
first = fn;
|
||||
do
|
||||
{
|
||||
token = Bstrtoken(first, "/", &next, 1);
|
||||
first = NULL;
|
||||
if (!token) break;
|
||||
else if (token[0] == 0) continue;
|
||||
else if (token[0] == '.' && token[1] == 0) continue;
|
||||
else if (token[0] == '.' && token[1] == '.' && token[2] == 0) ntok = max(0,ntok-1);
|
||||
else tokarr[ntok++] = token;
|
||||
}
|
||||
while (1);
|
||||
|
||||
if (!trailslash && removefn) { ntok = max(0,ntok-1); trailslash = 1; }
|
||||
if (ntok == 0 && trailslash && leadslash) trailslash = 0;
|
||||
|
||||
first = filename;
|
||||
if (leadslash) *(first++) = '/';
|
||||
for (i=0; i<ntok; i++)
|
||||
{
|
||||
if (i>0) *(first++) = '/';
|
||||
for (token=tokarr[i]; *token; token++)
|
||||
*(first++) = *token;
|
||||
}
|
||||
if (trailslash) *(first++) = '/';
|
||||
*(first++) = 0;
|
||||
|
||||
Bfree(fn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t Bcanonicalisefilename(char *filename, int32_t removefn)
|
||||
{
|
||||
char cwd[BMAX_PATH], fn[BMAX_PATH], *p;
|
||||
char *fnp = filename;
|
||||
#ifdef _WIN32
|
||||
int32_t drv = 0;
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
{
|
||||
if (filename[0] && filename[1] == ':')
|
||||
{
|
||||
// filename is prefixed with a drive
|
||||
drv = toupper(filename[0])-'A' + 1;
|
||||
fnp += 2;
|
||||
}
|
||||
if (!_getdcwd(drv, cwd, sizeof(cwd))) return -1;
|
||||
for (p=cwd; *p; p++) if (*p == '\\') *p = '/';
|
||||
}
|
||||
#else
|
||||
if (!getcwd(cwd,sizeof(cwd))) return -1;
|
||||
#endif
|
||||
p = strrchr(cwd,'/'); if (!p || p[1]) strcat(cwd, "/");
|
||||
|
||||
strcpy(fn, fnp);
|
||||
#ifdef _WIN32
|
||||
for (p=fn; *p; p++) if (*p == '\\') *p = '/';
|
||||
#endif
|
||||
|
||||
if (fn[0] != '/')
|
||||
{
|
||||
// we are dealing with a path relative to the current directory
|
||||
strcpy(filename, cwd);
|
||||
strcat(filename, fn);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef _WIN32
|
||||
filename[0] = cwd[0];
|
||||
filename[1] = ':';
|
||||
filename[2] = 0;
|
||||
#else
|
||||
filename[0] = 0;
|
||||
#endif
|
||||
strcat(filename, fn);
|
||||
}
|
||||
fnp = filename;
|
||||
#ifdef _WIN32
|
||||
fnp += 2; // skip the drive
|
||||
#endif
|
||||
UNREFERENCED_PARAMETER(removefn); // change the call below to use removefn instead of 1?
|
||||
return Bcorrectfilename(fnp,1);
|
||||
}
|
||||
|
||||
char *Bgetsystemdrives(void)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
char *str, *p;
|
||||
DWORD drv, mask;
|
||||
int32_t number=0;
|
||||
|
||||
drv = GetLogicalDrives();
|
||||
if (drv == 0) return NULL;
|
||||
|
||||
for (mask=1; mask<0x8000000l; mask<<=1)
|
||||
{
|
||||
if ((drv&mask) == 0) continue;
|
||||
number++;
|
||||
}
|
||||
|
||||
str = p = (char *)Bmalloc(1 + (3*number));
|
||||
if (!str) return NULL;
|
||||
|
||||
number = 0;
|
||||
for (mask=1; mask<0x8000000l; mask<<=1, number++)
|
||||
{
|
||||
if ((drv&mask) == 0) continue;
|
||||
*(p++) = 'A' + number;
|
||||
*(p++) = ':';
|
||||
*(p++) = 0;
|
||||
}
|
||||
*(p++) = 0;
|
||||
|
||||
return str;
|
||||
#else
|
||||
// Perhaps have Unix OS's put /, /home/user, and /mnt/* in the "drives" list?
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int32_t Bfilelength(int32_t fd)
|
||||
{
|
||||
struct stat st;
|
||||
if (fstat(fd, &st) < 0) return -1;
|
||||
return(int32_t)(st.st_size);
|
||||
}
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
int32_t dir;
|
||||
struct _finddata_t fid;
|
||||
#else
|
||||
DIR *dir;
|
||||
#endif
|
||||
struct Bdirent info;
|
||||
int32_t status;
|
||||
char name[1];
|
||||
} BDIR_real;
|
||||
|
||||
BDIR *Bopendir(const char *name)
|
||||
{
|
||||
BDIR_real *dirr;
|
||||
#ifdef _MSC_VER
|
||||
char *t,*tt;
|
||||
t = (char *)Bmalloc(strlen(name)+1+4);
|
||||
if (!t) return NULL;
|
||||
#endif
|
||||
|
||||
dirr = (BDIR_real *)Bmalloc(sizeof(BDIR_real) + strlen(name));
|
||||
if (!dirr)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
Bfree(t);
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
strcpy(t,name);
|
||||
tt = t+strlen(name)-1;
|
||||
while (*tt == ' ' && tt>t) tt--;
|
||||
if (*tt != '/' && *tt != '\\') *(++tt) = '/';
|
||||
*(++tt) = '*';
|
||||
*(++tt) = '.';
|
||||
*(++tt) = '*';
|
||||
*(++tt) = 0;
|
||||
|
||||
dirr->dir = _findfirst(t,&dirr->fid);
|
||||
Bfree(t);
|
||||
if (dirr->dir == -1)
|
||||
{
|
||||
Bfree(dirr);
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
dirr->dir = opendir(name);
|
||||
if (dirr->dir == NULL)
|
||||
{
|
||||
Bfree(dirr);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
dirr->status = 0;
|
||||
strcpy(dirr->name, name);
|
||||
|
||||
return (BDIR *)dirr;
|
||||
}
|
||||
|
||||
struct Bdirent *Breaddir(BDIR *dir)
|
||||
{
|
||||
BDIR_real *dirr = (BDIR_real *)dir;
|
||||
struct dirent *de;
|
||||
struct stat st;
|
||||
char *fn;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
if (dirr->status > 0)
|
||||
{
|
||||
if (_findnext(dirr->dir,&dirr->fid) != 0)
|
||||
{
|
||||
dirr->status = -1;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
dirr->info.namlen = strlen(dirr->fid.name);
|
||||
dirr->info.name = dirr->fid.name;
|
||||
dirr->status++;
|
||||
#else
|
||||
de = readdir(dirr->dir);
|
||||
if (de == NULL)
|
||||
{
|
||||
dirr->status = -1;
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
dirr->status++;
|
||||
}
|
||||
//# if defined(__WATCOMC__) || defined(__linux) || defined(__BEOS__) || defined(__QNX__) || defined(SKYOS)
|
||||
dirr->info.namlen = strlen(de->d_name);
|
||||
//# else
|
||||
// dirr->info.namlen = de->d_namlen;
|
||||
//# endif
|
||||
dirr->info.name = de->d_name;
|
||||
#endif
|
||||
dirr->info.mode = 0;
|
||||
dirr->info.size = 0;
|
||||
dirr->info.mtime = 0;
|
||||
|
||||
fn = (char *)Bmalloc(strlen(dirr->name) + 1 + dirr->info.namlen + 1);
|
||||
if (fn)
|
||||
{
|
||||
Bsprintf(fn,"%s/%s",dirr->name,dirr->info.name);
|
||||
if (!Bstat(fn, &st))
|
||||
{
|
||||
dirr->info.mode = st.st_mode;
|
||||
dirr->info.size = st.st_size;
|
||||
dirr->info.mtime = st.st_mtime;
|
||||
}
|
||||
Bfree(fn);
|
||||
}
|
||||
|
||||
return &dirr->info;
|
||||
}
|
||||
|
||||
int32_t Bclosedir(BDIR *dir)
|
||||
{
|
||||
BDIR_real *dirr = (BDIR_real *)dir;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
_findclose(dirr->dir);
|
||||
#else
|
||||
closedir(dirr->dir);
|
||||
#endif
|
||||
Bfree(dirr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
char *Bstrtoken(char *s, const char *delim, char **ptrptr, int32_t chop)
|
||||
{
|
||||
char *p, *start;
|
||||
|
||||
if (!ptrptr) return NULL;
|
||||
|
||||
if (s) p = s;
|
||||
else p = *ptrptr;
|
||||
|
||||
if (!p) return NULL;
|
||||
|
||||
while (*p != 0 && strchr(delim, *p)) p++;
|
||||
if (*p == 0)
|
||||
{
|
||||
*ptrptr = NULL;
|
||||
return NULL;
|
||||
}
|
||||
start = p;
|
||||
while (*p != 0 && !strchr(delim, *p)) p++;
|
||||
if (*p == 0) *ptrptr = NULL;
|
||||
else
|
||||
{
|
||||
if (chop) *(p++) = 0;
|
||||
*ptrptr = p;
|
||||
}
|
||||
|
||||
return start;
|
||||
}
|
||||
|
||||
|
||||
//Brute-force case-insensitive, slash-insensitive, * and ? wildcard matcher
|
||||
//Given: string i and string j. string j can have wildcards
|
||||
//Returns: 1:matches, 0:doesn't match
|
||||
int32_t Bwildmatch(const char *i, const char *j)
|
||||
{
|
||||
const char *k;
|
||||
char c0, c1;
|
||||
|
||||
if (!*j) return(1);
|
||||
do
|
||||
{
|
||||
if (*j == '*')
|
||||
{
|
||||
for (k=i,j++; *k; k++) if (Bwildmatch(k,j)) return(1);
|
||||
continue;
|
||||
}
|
||||
if (!*i) return(0);
|
||||
if (*j == '?') { i++; j++; continue; }
|
||||
c0 = *i; if ((c0 >= 'a') && (c0 <= 'z')) c0 -= 32;
|
||||
c1 = *j; if ((c1 >= 'a') && (c1 <= 'z')) c1 -= 32;
|
||||
#ifdef _WIN32
|
||||
if (c0 == '/') c0 = '\\';
|
||||
if (c1 == '/') c1 = '\\';
|
||||
#endif
|
||||
if (c0 != c1) return(0);
|
||||
i++; j++;
|
||||
}
|
||||
while (*j);
|
||||
return(!*i);
|
||||
}
|
||||
|
||||
#if !defined(_WIN32)
|
||||
char *Bstrlwr(char *s)
|
||||
{
|
||||
char *t = s;
|
||||
if (!s) return s;
|
||||
while (*t) { *t = Btolower(*t); t++; }
|
||||
return s;
|
||||
}
|
||||
|
||||
char *Bstrupr(char *s)
|
||||
{
|
||||
char *t = s;
|
||||
if (!s) return s;
|
||||
while (*t) { *t = Btoupper(*t); t++; }
|
||||
return s;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// Bgetsysmemsize() -- gets the amount of system memory in the machine
|
||||
//
|
||||
uint32_t Bgetsysmemsize(void)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
uint32_t siz = UINT_MAX;
|
||||
HMODULE lib = LoadLibrary("KERNEL32.DLL");
|
||||
|
||||
if (lib)
|
||||
{
|
||||
BOOL (WINAPI *aGlobalMemoryStatusEx)(LPMEMORYSTATUSEX) =
|
||||
(void *)GetProcAddress(lib, "GlobalMemoryStatusEx");
|
||||
|
||||
if (aGlobalMemoryStatusEx)
|
||||
{
|
||||
//WinNT
|
||||
MEMORYSTATUSEX memst;
|
||||
memst.dwLength = sizeof(MEMORYSTATUSEX);
|
||||
if (aGlobalMemoryStatusEx(&memst))
|
||||
siz = (uint32_t)min(UINT_MAX, memst.ullTotalPhys);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Yeah, there's enough Win9x hatred here that a perfectly good workaround
|
||||
// has been replaced by an error message. Oh well, we don't support 9x anyway.
|
||||
initprintf("Bgetsysmemsize(): error determining system memory size!\n");
|
||||
}
|
||||
|
||||
FreeLibrary(lib);
|
||||
}
|
||||
|
||||
return siz;
|
||||
#elif (defined(_SC_PAGE_SIZE) || defined(_SC_PAGESIZE)) && defined(_SC_PHYS_PAGES)
|
||||
uint32_t siz = UINT_MAX;
|
||||
int64_t scpagesiz, scphyspages;
|
||||
|
||||
#ifdef _SC_PAGE_SIZE
|
||||
scpagesiz = sysconf(_SC_PAGE_SIZE);
|
||||
#else
|
||||
scpagesiz = sysconf(_SC_PAGESIZE);
|
||||
#endif
|
||||
scphyspages = sysconf(_SC_PHYS_PAGES);
|
||||
if (scpagesiz >= 0 && scphyspages >= 0)
|
||||
siz = (uint32_t)min(UINT_MAX, (int64_t)scpagesiz * (int64_t)scphyspages);
|
||||
|
||||
//initprintf("Bgetsysmemsize(): %d pages of %d bytes, %d bytes of system memory\n",
|
||||
// scphyspages, scpagesiz, siz);
|
||||
|
||||
return siz;
|
||||
#else
|
||||
return UINT_MAX;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,556 +0,0 @@
|
|||
// Evil and Nasty Configuration File Reader for KenBuild
|
||||
// by Jonathon Fowler
|
||||
|
||||
#include "compat.h"
|
||||
#include "build.h"
|
||||
#include "editor.h"
|
||||
#include "osd.h"
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
#include "winlayer.h"
|
||||
#endif
|
||||
#include "baselayer.h"
|
||||
|
||||
static int32_t vesares[13][2] = {{320,200},{360,200},{320,240},{360,240},{320,400},
|
||||
{360,400},{640,350},{640,400},{640,480},{800,600},
|
||||
{1024,768},{1280,1024},{1600,1200}
|
||||
};
|
||||
|
||||
static int32_t readconfig(BFILE *fp, const char *key, char *value, uint32_t len)
|
||||
{
|
||||
char buf[1000], *k, *v, *eq;
|
||||
int32_t x=0;
|
||||
|
||||
if (len < 1) return 0;
|
||||
|
||||
Brewind(fp);
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (!Bfgets(buf, 1000, fp)) return 0;
|
||||
|
||||
if (buf[0] == ';') continue;
|
||||
|
||||
eq = Bstrchr(buf, '=');
|
||||
if (!eq) continue;
|
||||
|
||||
k = buf;
|
||||
v = eq+1;
|
||||
|
||||
while (*k == ' ' || *k == '\t') k++;
|
||||
*(eq--) = 0;
|
||||
while ((*eq == ' ' || *eq == '\t') && eq>=k) *(eq--) = 0;
|
||||
|
||||
if (Bstrcasecmp(k, key)) continue;
|
||||
|
||||
while (*v == ' ' || *k == '\t') v++;
|
||||
eq = v + Bstrlen(v)-1;
|
||||
|
||||
while ((*eq == ' ' || *eq == '\t' || *eq == '\r' || *eq == '\n') && eq>=v) *(eq--) = 0;
|
||||
|
||||
value[--len] = 0;
|
||||
do value[x] = v[x]; while (v[x++] != 0 && len-- > 0);
|
||||
|
||||
return x-1;
|
||||
}
|
||||
}
|
||||
|
||||
extern int16_t brightness;
|
||||
extern int32_t vsync;
|
||||
extern char game_executable[BMAX_PATH];
|
||||
extern int32_t fullscreen;
|
||||
extern char default_buildkeys[NUMBUILDKEYS];
|
||||
static char *const keys = default_buildkeys;
|
||||
extern char remap[256];
|
||||
extern int32_t remapinit;
|
||||
extern double msens;
|
||||
extern int32_t editorgridextent, grid, autogrid;
|
||||
static int32_t default_grid=3;
|
||||
extern int32_t graphicsmode;
|
||||
extern int32_t AmbienceToggle, MixRate;
|
||||
extern int32_t ParentalLock;
|
||||
|
||||
/*
|
||||
* SETUP.DAT
|
||||
* 0 = video mode (0:chained 1:vesa 2:screen buffered 3/4/5:tseng/paradise/s3 6:red-blue)
|
||||
* 1 = sound (0:none)
|
||||
* 2 = music (0:none)
|
||||
* 3 = input (0:keyboard 1:+mouse)
|
||||
* 4 = multiplayer (0:single 1-4:com 5-11:ipx)
|
||||
* 5&0xf0 = com speed
|
||||
* 5&0x0f = com irq
|
||||
* 6&0xf0 = chained y-res
|
||||
* 6&0x0f = chained x-res or vesa mode
|
||||
* 7&0xf0 = sound samplerate
|
||||
* 7&0x01 = sound quality
|
||||
* 7&0x02 = 8/16 bit
|
||||
* 7&0x04 = mono/stereo
|
||||
*
|
||||
* bytes 8 to 26 are key settings:
|
||||
* 0 = Forward (0xc8)
|
||||
* 1 = Backward (0xd0)
|
||||
* 2 = Turn left (0xcb)
|
||||
* 3 = Turn right (0xcd)
|
||||
* 4 = Run (0x2a)
|
||||
* 5 = Strafe (0x9d)
|
||||
* 6 = Fire (0x1d)
|
||||
* 7 = Use (0x39)
|
||||
* 8 = Stand high (0x1e)
|
||||
* 9 = Stand low (0x2c)
|
||||
* 10 = Look up (0xd1)
|
||||
* 11 = Look down (0xc9)
|
||||
* 12 = Strafe left (0x33)
|
||||
* 13 = Strafe right (0x34)
|
||||
* 14 = 2D/3D switch (0x9c)
|
||||
* 15 = View cycle (0x1c)
|
||||
* 16 = 2D Zoom in (0xd)
|
||||
* 17 = 2D Zoom out (0xc)
|
||||
* 18 = Chat (0xf)
|
||||
*/
|
||||
|
||||
int32_t loadsetup(const char *fn)
|
||||
{
|
||||
BFILE *fp;
|
||||
#define VL 1024
|
||||
char val[VL];
|
||||
int32_t i;
|
||||
|
||||
if ((fp = Bfopen(fn, "rt")) == NULL) return -1;
|
||||
|
||||
if (readconfig(fp, "forcesetup", val, VL) > 0) { if (Batoi(val) != 0) forcesetup = 1; else forcesetup = 0; }
|
||||
if (readconfig(fp, "fullscreen", val, VL) > 0) { if (Batoi(val) != 0) fullscreen = 1; else fullscreen = 0; }
|
||||
if (readconfig(fp, "resolution", val, VL) > 0)
|
||||
{
|
||||
i = Batoi(val) & 0x0f;
|
||||
if ((unsigned)i<13) { xdimgame = xdim2d = vesares[i][0]; ydimgame = ydim2d = vesares[i][1]; }
|
||||
}
|
||||
if (readconfig(fp, "2dresolution", val, VL) > 0)
|
||||
{
|
||||
i = Batoi(val) & 0x0f;
|
||||
if ((unsigned)i<13) { xdim2d = vesares[i][0]; ydim2d = vesares[i][1]; }
|
||||
}
|
||||
if (readconfig(fp, "xdim2d", val, VL) > 0) xdim2d = Batoi(val);
|
||||
if (readconfig(fp, "ydim2d", val, VL) > 0) ydim2d = Batoi(val);
|
||||
if (readconfig(fp, "xdim3d", val, VL) > 0) xdimgame = Batoi(val);
|
||||
if (readconfig(fp, "ydim3d", val, VL) > 0) ydimgame = Batoi(val);
|
||||
// if (readconfig(fp, "samplerate", val, VL) > 0) option[7] = (Batoi(val) & 0x0f) << 4;
|
||||
// if (readconfig(fp, "music", val, VL) > 0) { if (Batoi(val) != 0) option[2] = 1; else option[2] = 0; }
|
||||
// if (readconfig(fp, "mouse", val, VL) > 0) { if (Batoi(val) != 0) option[3] = 1; else option[3] = 0; }
|
||||
if (readconfig(fp, "bpp", val, VL) > 0) bppgame = Batoi(val);
|
||||
if (readconfig(fp, "vsync", val, VL) > 0) vsync = Batoi(val)?1:0;
|
||||
if (readconfig(fp, "editorgridextent", val, VL) > 0) editorgridextent = max(min(262144,Batoi(val)),32768);
|
||||
if (readconfig(fp, "grid", val, VL) > 0)
|
||||
{
|
||||
grid = Batoi(val);
|
||||
default_grid = grid;
|
||||
autogrid = (grid==9);
|
||||
grid = min(max(0, grid), 8);
|
||||
}
|
||||
#ifdef POLYMER
|
||||
if (readconfig(fp, "rendmode", val, VL) > 0) { i = Batoi(val); glrendmode = i; }
|
||||
#endif
|
||||
if (readconfig(fp, "vid_gamma", val, VL) > 0) vid_gamma = Bstrtod(val, NULL);
|
||||
if (readconfig(fp, "vid_brightness", val, VL) > 0) vid_brightness = Bstrtod(val, NULL);
|
||||
if (readconfig(fp, "vid_contrast", val, VL) > 0) vid_contrast = Bstrtod(val, NULL);
|
||||
#ifdef RENDERTYPEWIN
|
||||
if (readconfig(fp, "maxrefreshfreq", val, VL) > 0) maxrefreshfreq = Batoi(val);
|
||||
#endif
|
||||
#ifdef USE_OPENGL
|
||||
if (readconfig(fp, "usemodels", val, VL) > 0) usemodels = Batoi(val)?1:0;
|
||||
if (readconfig(fp, "usehightile", val, VL) > 0) usehightile = Batoi(val)?1:0;
|
||||
|
||||
glusetexcache = -1;
|
||||
if (readconfig(fp, "glusetexcache", val, VL) > 0)
|
||||
{
|
||||
glusetexcache = clamp(Batoi(val), 0, 2);
|
||||
}
|
||||
if (readconfig(fp, "gltexfiltermode", val, VL) > 0)
|
||||
{
|
||||
gltexfiltermode = Batoi(val);
|
||||
}
|
||||
if (readconfig(fp, "glanisotropy", val, VL) > 0)
|
||||
{
|
||||
glanisotropy = Batoi(val);
|
||||
}
|
||||
if (readconfig(fp, "r_downsize", val, VL) > 0)
|
||||
{
|
||||
r_downsize = Batoi(val);
|
||||
r_downsize = clamp(r_downsize, 0, 5);
|
||||
r_downsizevar = r_downsize;
|
||||
}
|
||||
if (readconfig(fp, "r_texcompr", val, VL) > 0)
|
||||
{
|
||||
glusetexcompr = !!Batoi(val);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (readconfig(fp, "gameexecutable", val, VL) > 0)
|
||||
Bstrcpy(game_executable, val);
|
||||
|
||||
// option[0] = 1; // vesa all the way...
|
||||
// option[1] = 1; // sound all the way...
|
||||
// option[4] = 0; // no multiplayer
|
||||
// option[5] = 0;
|
||||
|
||||
#if 1
|
||||
if (readconfig(fp, "keyforward", val, VL) > 0) keys[0] = Bstrtol(val, NULL, 16);
|
||||
if (readconfig(fp, "keybackward", val, VL) > 0) keys[1] = Bstrtol(val, NULL, 16);
|
||||
if (readconfig(fp, "keyturnleft", val, VL) > 0) keys[2] = Bstrtol(val, NULL, 16);
|
||||
if (readconfig(fp, "keyturnright", val, VL) > 0) keys[3] = Bstrtol(val, NULL, 16);
|
||||
if (readconfig(fp, "keyrun", val, VL) > 0) keys[4] = Bstrtol(val, NULL, 16);
|
||||
if (readconfig(fp, "keystrafe", val, VL) > 0) keys[5] = Bstrtol(val, NULL, 16);
|
||||
if (readconfig(fp, "keyfire", val, VL) > 0) keys[6] = Bstrtol(val, NULL, 16);
|
||||
if (readconfig(fp, "keyuse", val, VL) > 0) keys[7] = Bstrtol(val, NULL, 16);
|
||||
if (readconfig(fp, "keystandhigh", val, VL) > 0) keys[8] = Bstrtol(val, NULL, 16);
|
||||
if (readconfig(fp, "keystandlow", val, VL) > 0) keys[9] = Bstrtol(val, NULL, 16);
|
||||
if (readconfig(fp, "keylookup", val, VL) > 0) keys[10] = Bstrtol(val, NULL, 16);
|
||||
if (readconfig(fp, "keylookdown", val, VL) > 0) keys[11] = Bstrtol(val, NULL, 16);
|
||||
if (readconfig(fp, "keystrafeleft", val, VL) > 0) keys[12] = Bstrtol(val, NULL, 16);
|
||||
if (readconfig(fp, "keystraferight", val, VL) > 0) keys[13] = Bstrtol(val, NULL, 16);
|
||||
if (readconfig(fp, "key2dmode", val, VL) > 0) keys[14] = Bstrtol(val, NULL, 16);
|
||||
if (readconfig(fp, "keyviewcycle", val, VL) > 0) keys[15] = Bstrtol(val, NULL, 16);
|
||||
if (readconfig(fp, "key2dzoomin", val, VL) > 0) keys[16] = Bstrtol(val, NULL, 16);
|
||||
if (readconfig(fp, "key2dzoomout", val, VL) > 0) keys[17] = Bstrtol(val, NULL, 16);
|
||||
if (readconfig(fp, "keychat", val, VL) > 0) keys[18] = Bstrtol(val, NULL, 16);
|
||||
#endif
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
if (readconfig(fp, "windowpositioning", val, VL) > 0) windowpos = Batoi(val);
|
||||
windowx = -1;
|
||||
if (readconfig(fp, "windowposx", val, VL) > 0) windowx = Batoi(val);
|
||||
windowy = -1;
|
||||
if (readconfig(fp, "windowposy", val, VL) > 0) windowy = Batoi(val);
|
||||
#endif
|
||||
|
||||
if (readconfig(fp, "keyconsole", val, VL) > 0) { keys[19] = Bstrtol(val, NULL, 16); OSD_CaptureKey(keys[19]); }
|
||||
|
||||
if (readconfig(fp, "mousesensitivity", val, VL) > 0) msens = Bstrtod(val, NULL);
|
||||
|
||||
if (readconfig(fp, "mousenavigation", val, VL) > 0) unrealedlook = !!Batoi(val);
|
||||
|
||||
if (readconfig(fp, "mousenavigationaccel", val, VL) > 0) pk_uedaccel = Batoi(val);
|
||||
|
||||
if (readconfig(fp, "quickmapcycling", val, VL) > 0) quickmapcycling = !!Batoi(val);
|
||||
|
||||
if (readconfig(fp, "sideview_reversehorizrot", val, VL) > 0) sideview_reversehrot = !!Batoi(val);
|
||||
if (readconfig(fp, "revertCTRL", val, VL) > 0) revertCTRL = !!Batoi(val);
|
||||
|
||||
if (readconfig(fp, "scrollamount", val, VL) > 0) scrollamount = Batoi(val);
|
||||
|
||||
if (readconfig(fp, "turnaccel", val, VL) > 0) pk_turnaccel = Batoi(val);
|
||||
|
||||
if (readconfig(fp, "turndecel", val, VL) > 0) pk_turndecel = Batoi(val);
|
||||
|
||||
// if (readconfig(fp, "autosave", val, VL) > 0) autosave = Batoi(val)*60;
|
||||
if (readconfig(fp, "autosavesec", val, VL) > 0) autosave = max(0, Batoi(val));
|
||||
if (readconfig(fp, "autocorruptchecksec", val, VL) > 0) autocorruptcheck = max(0, Batoi(val));
|
||||
|
||||
if (readconfig(fp, "showheightindicators", val, VL) > 0)
|
||||
showheightindicators = min(max(Batoi(val),0),2);
|
||||
if (readconfig(fp, "showambiencesounds", val, VL) > 0)
|
||||
showambiencesounds = min(max(Batoi(val),0),2);
|
||||
|
||||
if (readconfig(fp, "graphicsmode", val, VL) > 0)
|
||||
graphicsmode = min(max(Batoi(val),0),2);
|
||||
|
||||
if (readconfig(fp, "samplerate", val, VL) > 0) MixRate = min(max(8000, Batoi(val)), 48000);
|
||||
if (readconfig(fp, "ambiencetoggle", val, VL) > 0) AmbienceToggle = !!Batoi(val);
|
||||
if (readconfig(fp, "parlock", val, VL) > 0) ParentalLock = !!Batoi(val);
|
||||
|
||||
if (readconfig(fp, "osdtryscript", val, VL) > 0) m32_osd_tryscript = !!Batoi(val);
|
||||
|
||||
for (i=0; i<256; i++)
|
||||
remap[i]=i;
|
||||
|
||||
remapinit=1;
|
||||
if (readconfig(fp, "remap", val, VL) > 0)
|
||||
{
|
||||
char *p=val; int32_t v1,v2;
|
||||
while (*p)
|
||||
{
|
||||
if (!sscanf(p,"%x",&v1))break;
|
||||
if ((p=strchr(p,'-'))==0)break; p++;
|
||||
if (!sscanf(p,"%x",&v2))break;
|
||||
remap[v1]=v2;
|
||||
initprintf("Remap %X key to %X\n",v1,v2);
|
||||
if ((p=strchr(p,','))==0)break; p++;
|
||||
}
|
||||
}
|
||||
|
||||
// load m32script history
|
||||
for (i=0; i<SCRIPTHISTSIZ; i++)
|
||||
{
|
||||
Bsprintf(val, "hist%d", i);
|
||||
if (readconfig(fp, val, val, VL) <= 0)
|
||||
break;
|
||||
|
||||
scripthist[i] = Bstrdup(val);
|
||||
}
|
||||
|
||||
scripthistend = i;
|
||||
|
||||
// copy script history into OSD history
|
||||
for (i=0; i<min(scripthistend, OSD_HISTORYDEPTH); i++)
|
||||
{
|
||||
Bstrncpy(osdhistorybuf[i], scripthist[scripthistend-1-i], OSD_EDITLENGTH+1);
|
||||
osdhistorybuf[i][OSD_EDITLENGTH] = 0;
|
||||
osdhistorysize++;
|
||||
osdhistorytotal++;
|
||||
}
|
||||
|
||||
scripthistend %= SCRIPTHISTSIZ;
|
||||
|
||||
Bfclose(fp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t writesetup(const char *fn)
|
||||
{
|
||||
BFILE *fp;
|
||||
int32_t i,j,first=1;
|
||||
|
||||
fp = Bfopen(fn,"wt");
|
||||
if (!fp) return -1;
|
||||
|
||||
Bfprintf(fp,
|
||||
"; Always show configuration options on startup\n"
|
||||
"; 0 - No\n"
|
||||
"; 1 - Yes\n"
|
||||
"forcesetup = %d\n"
|
||||
"\n"
|
||||
"; Video mode selection\n"
|
||||
"; 0 - Windowed\n"
|
||||
"; 1 - Fullscreen\n"
|
||||
"fullscreen = %d\n"
|
||||
"\n"
|
||||
"; Video resolution\n"
|
||||
"xdim2d = %d\n"
|
||||
"ydim2d = %d\n"
|
||||
"xdim3d = %d\n"
|
||||
"ydim3d = %d\n"
|
||||
"\n"
|
||||
"; 3D-mode colour depth\n"
|
||||
"bpp = %d\n"
|
||||
"\n"
|
||||
"vsync = %d\n"
|
||||
"\n"
|
||||
#ifdef POLYMER
|
||||
"; Rendering mode\n"
|
||||
"rendmode = %d\n"
|
||||
"\n"
|
||||
#endif
|
||||
"; Grid limits\n"
|
||||
"editorgridextent = %d\n"
|
||||
"; Startup grid size (0-8, 9 is automatic)\n"
|
||||
"grid = %d\n"
|
||||
"\n"
|
||||
#ifdef USE_OPENGL
|
||||
"; OpenGL mode options\n"
|
||||
"usemodels = %d\n"
|
||||
"usehightile = %d\n"
|
||||
"; glusetexcache: 0:no, 1:yes, 2:compressed\n"
|
||||
"glusetexcache = %d\n"
|
||||
"gltexfiltermode = %d\n"
|
||||
"glanisotropy = %d\n"
|
||||
"r_downsize = %d\n"
|
||||
"r_texcompr = %d\n"
|
||||
"\n"
|
||||
#endif
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
"; Maximum OpenGL mode refresh rate (Windows only, in Hertz)\n"
|
||||
"maxrefreshfreq = %d\n"
|
||||
"\n"
|
||||
"; Window positioning, 0 = center, 1 = memory\n"
|
||||
"windowpositioning = %d\n"
|
||||
"windowposx = %d\n"
|
||||
"windowposy = %d\n"
|
||||
"\n"
|
||||
#endif
|
||||
"; 3D mode brightness setting\n"
|
||||
"vid_gamma = %g\n"
|
||||
"vid_brightness = %g\n"
|
||||
"vid_contrast = %g\n"
|
||||
"\n"
|
||||
"; Game executable used for map testing\n"
|
||||
"gameexecutable = %s\n"
|
||||
"\n"
|
||||
#if 0
|
||||
"; Sound sample frequency\n"
|
||||
"; 0 - 6 KHz\n"
|
||||
"; 1 - 8 KHz\n"
|
||||
"; 2 - 11.025 KHz\n"
|
||||
"; 3 - 16 KHz\n"
|
||||
"; 4 - 22.05 KHz\n"
|
||||
"; 5 - 32 KHz\n"
|
||||
"; 6 - 44.1 KHz\n"
|
||||
"samplerate = %d\n"
|
||||
"\n"
|
||||
"; Music playback\n"
|
||||
"; 0 - Off\n"
|
||||
"; 1 - On\n"
|
||||
"music = %d\n"
|
||||
"\n"
|
||||
#endif
|
||||
"; Mouse sensitivity\n"
|
||||
"mousesensitivity = %g\n"
|
||||
"\n"
|
||||
"; Mouse navigation\n"
|
||||
"; 0 - No\n"
|
||||
"; 1 - Yes\n"
|
||||
"mousenavigation = %d\n"
|
||||
"\n"
|
||||
"; Mouse navigation acceleration\n"
|
||||
"mousenavigationaccel = %d\n"
|
||||
"\n"
|
||||
"; Quick map cycling (SHIFT)+CTRL+X\n"
|
||||
"; 0 - No\n"
|
||||
"; 1 - Yes\n"
|
||||
"quickmapcycling = %d\n"
|
||||
"\n"
|
||||
"; Reverse meaning of Q and W keys in side view mode\n"
|
||||
"sideview_reversehorizrot = %d\n"
|
||||
"\n"
|
||||
"; Revert CTRL for tile selction\n"
|
||||
"; 0 - WHEEL:scrolling, CTRL+WHEEL:zooming\n"
|
||||
"; 1 - CTRL+WHEEL:scrolling, WHEEL:zooming\n"
|
||||
"revertCTRL = %d\n"
|
||||
"\n"
|
||||
"; Scroll amount for WHEEL in the tile selection\n"
|
||||
"scrollamount = %d\n"
|
||||
"\n"
|
||||
"; Turning acceleration+declaration\n"
|
||||
"turnaccel = %d\n"
|
||||
"\n"
|
||||
"; Turning deceleration\n"
|
||||
"turndecel = %d\n"
|
||||
"\n"
|
||||
"; Autosave map interval (seconds)\n"
|
||||
"autosavesec = %d\n"
|
||||
"\n"
|
||||
"; Auto corruption check interval (seconds)\n"
|
||||
"autocorruptchecksec = %d\n"
|
||||
"\n"
|
||||
"; Height indicators (0:none, 1:only 2-sided&different, 2:all)\n"
|
||||
"showheightindicators = %d\n"
|
||||
"\n"
|
||||
"; Ambience sound circles (0:none, 1:only in current sector, 2:all)\n"
|
||||
"showambiencesounds = %d\n"
|
||||
"\n"
|
||||
"; 2D mode display type (0:classic, 1:textured, 2:textured/animated)\n"
|
||||
"graphicsmode = %d\n"
|
||||
"\n"
|
||||
"; Sample rate in Hz\n"
|
||||
"samplerate = %d\n"
|
||||
"; Ambient sounds in 3D mode (0:off, 1:on)\n"
|
||||
"ambiencetoggle = %d\n"
|
||||
"parlock = %d\n"
|
||||
"\n"
|
||||
"; Try executing m32script on invalid command in the OSD? This makes\n"
|
||||
"; typing m32script commands into the OSD directly possible.\n"
|
||||
"osdtryscript = %d\n"
|
||||
"\n"
|
||||
#if 1
|
||||
"; Key Settings\n"
|
||||
"; Here's a map of all the keyboard scan codes: NOTE: values are listed in hex!\n"
|
||||
"; +---------------------------------------------------------------------------------------------+\n"
|
||||
"; | 01 3B 3C 3D 3E 3F 40 41 42 43 44 57 58 46 |\n"
|
||||
"; |ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 SCROLL |\n"
|
||||
"; | |\n"
|
||||
"; |29 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E D2 C7 C9 45 B5 37 4A |\n"
|
||||
"; | ` '1' '2' '3' '4' '5' '6' '7' '8' '9' '0' - = BACK INS HOME PGUP NUMLK KP/ KP* KP- |\n"
|
||||
"; | |\n"
|
||||
"; | 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 2B D3 CF D1 47 48 49 4E |\n"
|
||||
"; |TAB Q W E R T Y U I O P [ ] \\ DEL END PGDN KP7 KP8 KP9 KP+ |\n"
|
||||
"; | |\n"
|
||||
"; | 3A 1E 1F 20 21 22 23 24 25 26 27 28 1C 4B 4C 4D |\n"
|
||||
"; |CAPS A S D F G H J K L ; ' ENTER KP4 KP5 KP6 9C |\n"
|
||||
"; | KPENTER|\n"
|
||||
"; | 2A 2C 2D 2E 2F 30 31 32 33 34 35 36 C8 4F 50 51 |\n"
|
||||
"; |LSHIFT Z X C V B N M , . / RSHIFT UP KP1 KP2 KP3 |\n"
|
||||
"; | |\n"
|
||||
"; | 1D 38 39 B8 9D CB D0 CD 52 53 |\n"
|
||||
"; |LCTRL LALT SPACE RALT RCTRL LEFT DOWN RIGHT KP0 KP. |\n"
|
||||
"; +---------------------------------------------------------------------------------------------+\n"
|
||||
"\n"
|
||||
"keyforward = %X\n"
|
||||
"keybackward = %X\n"
|
||||
"keyturnleft = %X\n"
|
||||
"keyturnright = %X\n"
|
||||
"keyrun = %X\n"
|
||||
"keystrafe = %X\n"
|
||||
"keyfire = %X\n"
|
||||
"keyuse = %X\n"
|
||||
"keystandhigh = %X\n"
|
||||
"keystandlow = %X\n"
|
||||
"keylookup = %X\n"
|
||||
"keylookdown = %X\n"
|
||||
"keystrafeleft = %X\n"
|
||||
"keystraferight = %X\n"
|
||||
"key2dmode = %X\n"
|
||||
"keyviewcycle = %X\n"
|
||||
"key2dzoomin = %X\n"
|
||||
"key2dzoomout = %X\n"
|
||||
"keychat = %X\n"
|
||||
#endif
|
||||
// "; Console key scancode, in hex\n"
|
||||
"keyconsole = %X\n"
|
||||
"; example: make KP0 function as KP5 (counters inability\n"
|
||||
"; inability to pan using Shift-KP5-KP8/2 in 3D mode)\n"
|
||||
"; remap = 52-4C\n"
|
||||
"remap = ",
|
||||
|
||||
forcesetup, fullscreen, xdim2d, ydim2d, xdimgame, ydimgame, bppgame, vsync,
|
||||
#ifdef POLYMER
|
||||
glrendmode,
|
||||
#endif
|
||||
editorgridextent, min(max(0, default_grid), 9),
|
||||
#ifdef USE_OPENGL
|
||||
usemodels, usehightile,
|
||||
glusetexcache, gltexfiltermode, glanisotropy,r_downsize,glusetexcompr,
|
||||
#endif
|
||||
#ifdef RENDERTYPEWIN
|
||||
maxrefreshfreq, windowpos, windowx, windowy,
|
||||
#endif
|
||||
vid_gamma_3d>=0?vid_gamma_3d:vid_gamma,
|
||||
vid_brightness_3d>=0?vid_brightness_3d:vid_brightness,
|
||||
vid_contrast_3d>=0?vid_contrast_3d:vid_contrast,
|
||||
game_executable,
|
||||
#if 0
|
||||
option[7]>>4, option[2],
|
||||
#endif
|
||||
msens, unrealedlook, pk_uedaccel, quickmapcycling,
|
||||
sideview_reversehrot,
|
||||
revertCTRL,scrollamount,pk_turnaccel,pk_turndecel,autosave,autocorruptcheck,
|
||||
showheightindicators,showambiencesounds,graphicsmode,
|
||||
MixRate,AmbienceToggle,ParentalLock, !!m32_osd_tryscript,
|
||||
#if 1
|
||||
keys[0], keys[1], keys[2], keys[3], keys[4], keys[5],
|
||||
keys[6], keys[7], keys[8], keys[9], keys[10], keys[11],
|
||||
keys[12], keys[13], keys[14], keys[15], keys[16], keys[17],
|
||||
keys[18],
|
||||
#endif
|
||||
keys[19]
|
||||
);
|
||||
|
||||
for (i=0; i<256; i++)
|
||||
if (remap[i]!=i)
|
||||
{
|
||||
Bfprintf(fp,first?"%02X-%02X":",%02X-%02X",i,remap[i]);
|
||||
first=0;
|
||||
}
|
||||
Bfprintf(fp,"\n\n");
|
||||
|
||||
// save m32script history
|
||||
first = 1;
|
||||
for (i=scripthistend, j=0; first || i!=scripthistend; i=(i+1)%SCRIPTHISTSIZ, first=0)
|
||||
{
|
||||
if (scripthist[i])
|
||||
Bfprintf(fp, "hist%d = %s\n", j++, scripthist[i]);
|
||||
}
|
||||
|
||||
Bfclose(fp);
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
#include "crc32.h"
|
||||
|
||||
uint32_t crc32table[256];
|
||||
|
||||
void initcrc32table(void)
|
||||
{
|
||||
uint32_t i,j,k;
|
||||
|
||||
// algorithm and polynomial same as that used by infozip's zip
|
||||
for (i=0; i<256; i++)
|
||||
{
|
||||
j = i;
|
||||
for (k=8; k; k--)
|
||||
j = (j&1) ? (0xedb88320L ^(j>>1)) : (j>>1);
|
||||
crc32table[i] = j;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t crc32once(uint8_t *blk, uint32_t len)
|
||||
{
|
||||
uint32_t crc;
|
||||
|
||||
crc32init(&crc);
|
||||
crc32block(&crc, blk, len);
|
||||
return crc32finish(&crc);
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,182 +0,0 @@
|
|||
#include <dlfcn.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define __dynamicgtkfoo__
|
||||
#include "dynamicgtk.h"
|
||||
|
||||
static void *handle = NULL;
|
||||
struct _dynamicgtksyms dynamicgtksyms;
|
||||
|
||||
#define GETDLSYM(x) { \
|
||||
dynamicgtksyms.x = dlsym(handle, (failsym = (const char *)#x)); \
|
||||
if (!dynamicgtksyms.x ) { err = 1; break; } \
|
||||
}
|
||||
|
||||
int32_t dynamicgtk_init(void)
|
||||
{
|
||||
int32_t err = 0;
|
||||
const char *failsym = NULL;
|
||||
|
||||
if (handle) return 1;
|
||||
|
||||
handle = dlopen("libgtk-x11-2.0.so.0", RTLD_NOW|RTLD_GLOBAL);
|
||||
if (!handle) return -1;
|
||||
|
||||
memset(&dynamicgtksyms, 0, sizeof(dynamicgtksyms));
|
||||
|
||||
do
|
||||
{
|
||||
GETDLSYM(g_free)
|
||||
GETDLSYM(g_object_get_data)
|
||||
GETDLSYM(g_object_set_data)
|
||||
GETDLSYM(g_object_set_data_full)
|
||||
GETDLSYM(g_object_unref)
|
||||
GETDLSYM(g_signal_connect_data)
|
||||
GETDLSYM(g_signal_handlers_block_matched)
|
||||
GETDLSYM(g_signal_handlers_unblock_matched)
|
||||
GETDLSYM(g_type_check_instance_cast)
|
||||
GETDLSYM(gdk_pixbuf_from_pixdata)
|
||||
GETDLSYM(gdk_pixbuf_new_from_data)
|
||||
GETDLSYM(gtk_accel_group_new)
|
||||
GETDLSYM(gtk_alignment_new)
|
||||
GETDLSYM(gtk_box_get_type)
|
||||
GETDLSYM(gtk_box_pack_start)
|
||||
GETDLSYM(gtk_button_box_get_type)
|
||||
GETDLSYM(gtk_button_box_set_layout)
|
||||
GETDLSYM(gtk_button_new)
|
||||
GETDLSYM(gtk_cell_layout_get_type)
|
||||
GETDLSYM(gtk_cell_layout_pack_start)
|
||||
GETDLSYM(gtk_cell_layout_set_attributes)
|
||||
GETDLSYM(gtk_cell_renderer_text_new)
|
||||
GETDLSYM(gtk_check_button_new_with_mnemonic)
|
||||
GETDLSYM(gtk_combo_box_get_active)
|
||||
GETDLSYM(gtk_combo_box_get_active_iter)
|
||||
GETDLSYM(gtk_combo_box_get_active_text)
|
||||
GETDLSYM(gtk_combo_box_get_model)
|
||||
GETDLSYM(gtk_combo_box_get_type)
|
||||
GETDLSYM(gtk_combo_box_new_text)
|
||||
GETDLSYM(gtk_combo_box_new_with_model)
|
||||
GETDLSYM(gtk_combo_box_set_active)
|
||||
GETDLSYM(gtk_combo_box_set_active_iter)
|
||||
GETDLSYM(gtk_container_add)
|
||||
GETDLSYM(gtk_container_foreach)
|
||||
GETDLSYM(gtk_container_get_type)
|
||||
GETDLSYM(gtk_container_set_border_width)
|
||||
GETDLSYM(gtk_dialog_get_type)
|
||||
GETDLSYM(gtk_dialog_run)
|
||||
GETDLSYM(gtk_hbox_new)
|
||||
GETDLSYM(gtk_hbutton_box_new)
|
||||
GETDLSYM(gtk_image_new_from_pixbuf)
|
||||
GETDLSYM(gtk_image_new_from_stock)
|
||||
GETDLSYM(gtk_init_check)
|
||||
GETDLSYM(gtk_label_get_type)
|
||||
GETDLSYM(gtk_label_new)
|
||||
GETDLSYM(gtk_label_new_with_mnemonic)
|
||||
GETDLSYM(gtk_label_set_mnemonic_widget)
|
||||
GETDLSYM(gtk_list_store_append)
|
||||
GETDLSYM(gtk_list_store_clear)
|
||||
GETDLSYM(gtk_list_store_get_type)
|
||||
GETDLSYM(gtk_list_store_new)
|
||||
GETDLSYM(gtk_list_store_set)
|
||||
GETDLSYM(gtk_main)
|
||||
GETDLSYM(gtk_main_iteration_do)
|
||||
GETDLSYM(gtk_main_quit)
|
||||
GETDLSYM(gtk_message_dialog_new)
|
||||
GETDLSYM(gtk_misc_get_type)
|
||||
GETDLSYM(gtk_misc_set_alignment)
|
||||
GETDLSYM(gtk_notebook_get_nth_page)
|
||||
GETDLSYM(gtk_notebook_get_type)
|
||||
GETDLSYM(gtk_notebook_new)
|
||||
GETDLSYM(gtk_notebook_set_current_page)
|
||||
GETDLSYM(gtk_notebook_set_tab_label)
|
||||
GETDLSYM(gtk_object_get_type)
|
||||
GETDLSYM(gtk_scrolled_window_get_type)
|
||||
GETDLSYM(gtk_scrolled_window_new)
|
||||
GETDLSYM(gtk_scrolled_window_set_policy)
|
||||
GETDLSYM(gtk_scrolled_window_set_shadow_type)
|
||||
GETDLSYM(gtk_table_get_type)
|
||||
GETDLSYM(gtk_table_new)
|
||||
GETDLSYM(gtk_table_attach)
|
||||
GETDLSYM(gtk_text_buffer_backspace)
|
||||
GETDLSYM(gtk_text_buffer_create_mark)
|
||||
GETDLSYM(gtk_text_buffer_delete_mark)
|
||||
GETDLSYM(gtk_text_buffer_get_end_iter)
|
||||
GETDLSYM(gtk_text_buffer_insert)
|
||||
// FIXME: should I put a #if !GTK_CHECK_VERSION(2,6,0)
|
||||
// around these three, or should I not care?
|
||||
GETDLSYM(gtk_text_iter_backward_cursor_position)
|
||||
GETDLSYM(gtk_text_iter_equal)
|
||||
GETDLSYM(gtk_text_buffer_delete_interactive)
|
||||
//
|
||||
GETDLSYM(gtk_text_view_get_buffer)
|
||||
GETDLSYM(gtk_text_view_get_type)
|
||||
GETDLSYM(gtk_text_view_new)
|
||||
GETDLSYM(gtk_text_view_scroll_to_mark)
|
||||
GETDLSYM(gtk_text_view_set_cursor_visible)
|
||||
GETDLSYM(gtk_text_view_set_editable)
|
||||
GETDLSYM(gtk_text_view_set_left_margin)
|
||||
GETDLSYM(gtk_text_view_set_right_margin)
|
||||
GETDLSYM(gtk_text_view_set_wrap_mode)
|
||||
GETDLSYM(gtk_toggle_button_get_active)
|
||||
GETDLSYM(gtk_toggle_button_get_type)
|
||||
GETDLSYM(gtk_toggle_button_set_active)
|
||||
GETDLSYM(gtk_tree_model_get)
|
||||
GETDLSYM(gtk_tree_model_get_iter)
|
||||
GETDLSYM(gtk_tree_model_get_path)
|
||||
GETDLSYM(gtk_tree_model_get_type)
|
||||
GETDLSYM(gtk_tree_path_get_indices)
|
||||
GETDLSYM(gtk_tree_path_new_from_indices)
|
||||
GETDLSYM(gtk_tree_selection_get_selected)
|
||||
GETDLSYM(gtk_tree_selection_select_iter)
|
||||
GETDLSYM(gtk_tree_selection_set_mode)
|
||||
GETDLSYM(gtk_tree_sortable_get_type)
|
||||
GETDLSYM(gtk_tree_sortable_set_sort_column_id)
|
||||
GETDLSYM(gtk_tree_sortable_set_sort_func)
|
||||
GETDLSYM(gtk_tree_view_append_column)
|
||||
GETDLSYM(gtk_tree_view_column_new_with_attributes)
|
||||
GETDLSYM(gtk_tree_view_column_set_expand)
|
||||
GETDLSYM(gtk_tree_view_column_set_min_width)
|
||||
GETDLSYM(gtk_tree_view_get_model)
|
||||
GETDLSYM(gtk_tree_view_get_selection)
|
||||
GETDLSYM(gtk_tree_view_get_type)
|
||||
GETDLSYM(gtk_tree_view_new_with_model)
|
||||
GETDLSYM(gtk_tree_view_set_enable_search)
|
||||
GETDLSYM(gtk_tree_view_set_headers_visible)
|
||||
GETDLSYM(gtk_vbox_new)
|
||||
GETDLSYM(gtk_widget_add_accelerator)
|
||||
GETDLSYM(gtk_widget_destroy)
|
||||
GETDLSYM(gtk_widget_ref)
|
||||
GETDLSYM(gtk_widget_set_sensitive)
|
||||
GETDLSYM(gtk_widget_set_size_request)
|
||||
GETDLSYM(gtk_widget_show_all)
|
||||
GETDLSYM(gtk_widget_unref)
|
||||
GETDLSYM(gtk_window_add_accel_group)
|
||||
GETDLSYM(gtk_window_get_type)
|
||||
GETDLSYM(gtk_window_new)
|
||||
GETDLSYM(gtk_window_set_default_icon)
|
||||
GETDLSYM(gtk_window_set_position)
|
||||
GETDLSYM(gtk_window_set_resizable)
|
||||
GETDLSYM(gtk_window_set_title)
|
||||
GETDLSYM(gtk_window_set_type_hint)
|
||||
GETDLSYM(gtk_window_set_default)
|
||||
GETDLSYM(g_utf8_collate)
|
||||
}
|
||||
while (0);
|
||||
|
||||
if (err)
|
||||
{
|
||||
//printf("Failed fetching symbol %s from GTK lib\n", failsym);
|
||||
dlclose(handle);
|
||||
handle = NULL;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void dynamicgtk_uninit(void)
|
||||
{
|
||||
if (handle) dlclose(handle);
|
||||
handle = NULL;
|
||||
memset(&dynamicgtksyms, 0, sizeof(dynamicgtksyms));
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,120 +0,0 @@
|
|||
#ifndef ENGINE_PRIV_H
|
||||
#define ENGINE_PRIV_H
|
||||
|
||||
#define MAXCLIPNUM 1024
|
||||
#define MAXPERMS 512
|
||||
#define MAXTILEFILES 256
|
||||
#define MAXYSAVES ((MAXXDIM*MAXSPRITES)>>7)
|
||||
#define MAXNODESPERLINE 42 //Warning: This depends on MAXYSAVES & MAXYDIM!
|
||||
#define MAXCLIPDIST 1024
|
||||
|
||||
extern uint8_t **basepaltableptr;
|
||||
extern uint8_t basepalcount;
|
||||
extern uint8_t curbasepal;
|
||||
|
||||
extern char pow2char[8];
|
||||
extern int32_t pow2int[32];
|
||||
|
||||
extern int16_t thesector[MAXWALLSB], thewall[MAXWALLSB];
|
||||
extern int16_t bunchfirst[MAXWALLSB], bunchlast[MAXWALLSB];
|
||||
extern int16_t maskwall[MAXWALLSB], maskwallcnt;
|
||||
extern spritetype *tspriteptr[MAXSPRITESONSCREEN + 1];
|
||||
extern int32_t xdimen, xdimenrecip, halfxdimen, xdimenscale, xdimscale, ydimen;
|
||||
extern intptr_t frameoffset;
|
||||
extern int32_t globalposx, globalposy, globalposz, globalhoriz;
|
||||
extern int16_t globalang, globalcursectnum;
|
||||
extern int32_t globalpal, cosglobalang, singlobalang;
|
||||
extern int32_t cosviewingrangeglobalang, sinviewingrangeglobalang;
|
||||
extern int32_t globalvisibility;
|
||||
extern int32_t xyaspect;
|
||||
extern intptr_t asm1, asm2, asm3, asm4;
|
||||
extern int32_t globalshade;
|
||||
extern int16_t globalpicnum;
|
||||
extern int32_t globalx1, globaly2;
|
||||
extern int32_t globalorientation;
|
||||
|
||||
extern int16_t searchit;
|
||||
extern int32_t searchx, searchy;
|
||||
extern int16_t searchsector, searchwall, searchstat;
|
||||
extern int16_t searchbottomwall;
|
||||
|
||||
extern char inpreparemirror;
|
||||
|
||||
extern int32_t curbrightness, gammabrightness;
|
||||
extern char britable[16][256];
|
||||
extern char picsiz[MAXTILES];
|
||||
extern int32_t lastx[MAXYDIM];
|
||||
extern char *transluc;
|
||||
extern int16_t sectorborder[256], sectorbordercnt;
|
||||
extern int32_t qsetmode;
|
||||
extern int32_t hitallsprites;
|
||||
|
||||
extern int32_t xb1[MAXWALLSB];
|
||||
extern int32_t rx1[MAXWALLSB], ry1[MAXWALLSB];
|
||||
extern int16_t p2[MAXWALLSB];
|
||||
extern int16_t numscans, numhits, numbunches;
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
extern palette_t palookupfog[MAXPALOOKUPS];
|
||||
#endif
|
||||
|
||||
// int32_t wallmost(int16_t *mostbuf, int32_t w, int32_t sectnum, char dastat);
|
||||
int32_t wallfront(int32_t l1, int32_t l2);
|
||||
int32_t animateoffs(int16_t tilenum, int16_t fakevar);
|
||||
|
||||
extern int32_t indrawroomsandmasks;
|
||||
|
||||
|
||||
#if defined(_MSC_VER) && !defined(NOASM)
|
||||
|
||||
static inline void setgotpic(int32_t a)
|
||||
{
|
||||
_asm {
|
||||
push ebx
|
||||
mov eax, a
|
||||
mov ebx, eax
|
||||
cmp byte ptr walock[eax], 200
|
||||
jae skipit
|
||||
mov byte ptr walock[eax], 199
|
||||
skipit:
|
||||
shr eax, 3
|
||||
and ebx, 7
|
||||
mov dl, byte ptr gotpic[eax]
|
||||
mov bl, byte ptr pow2char[ebx]
|
||||
or dl, bl
|
||||
mov byte ptr gotpic[eax], dl
|
||||
pop ebx
|
||||
}
|
||||
}
|
||||
|
||||
#elif defined(__GNUC__) && defined(__i386__) && !defined(NOASM) // _MSC_VER
|
||||
|
||||
#define setgotpic(a) \
|
||||
({ int32_t __a=(a); \
|
||||
__asm__ __volatile__ ( \
|
||||
"movl %%eax, %%ebx\n\t" \
|
||||
"cmpb $200, "ASMSYM("walock")"(%%eax)\n\t" \
|
||||
"jae 0f\n\t" \
|
||||
"movb $199, "ASMSYM("walock")"(%%eax)\n\t" \
|
||||
"0:\n\t" \
|
||||
"shrl $3, %%eax\n\t" \
|
||||
"andl $7, %%ebx\n\t" \
|
||||
"movb "ASMSYM("gotpic")"(%%eax), %%dl\n\t" \
|
||||
"movb "ASMSYM("pow2char")"(%%ebx), %%bl\n\t" \
|
||||
"orb %%bl, %%dl\n\t" \
|
||||
"movb %%dl, "ASMSYM("gotpic")"(%%eax)" \
|
||||
: "=a" (__a) : "a" (__a) \
|
||||
: "ebx", "edx", "memory", "cc"); \
|
||||
__a; })
|
||||
|
||||
#else // __GNUC__ && __i386__
|
||||
|
||||
static inline void setgotpic(int32_t tilenume)
|
||||
{
|
||||
if (walock[tilenume] < 200) walock[tilenume] = 199;
|
||||
gotpic[tilenume>>3] |= pow2char[tilenume&7];
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* ENGINE_PRIV_H */
|
File diff suppressed because it is too large
Load diff
|
@ -1,89 +0,0 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "dynamicgtk.h"
|
||||
|
||||
#include "baselayer.h"
|
||||
#include "build.h"
|
||||
|
||||
int32_t gtkenabled = 0;
|
||||
|
||||
static GdkPixbuf *appicon = NULL;
|
||||
|
||||
int32_t gtkbuild_msgbox(char *name, char *msg)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
if (!gtkenabled) return -1;
|
||||
|
||||
dialog = gtk_message_dialog_new(NULL,
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_INFO,
|
||||
GTK_BUTTONS_OK,
|
||||
"%s", msg);
|
||||
gtk_window_set_title(GTK_WINDOW(dialog), name);
|
||||
gtk_dialog_run(GTK_DIALOG(dialog));
|
||||
gtk_widget_destroy(dialog);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t gtkbuild_ynbox(char *name, char *msg)
|
||||
{
|
||||
int32_t r;
|
||||
GtkWidget *dialog;
|
||||
|
||||
if (!gtkenabled) return -1;
|
||||
|
||||
dialog = gtk_message_dialog_new(NULL,
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_INFO,
|
||||
GTK_BUTTONS_YES_NO,
|
||||
"%s", msg);
|
||||
gtk_window_set_title(GTK_WINDOW(dialog), name);
|
||||
r = gtk_dialog_run(GTK_DIALOG(dialog));
|
||||
gtk_widget_destroy(dialog);
|
||||
|
||||
if (r == GTK_RESPONSE_YES) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef RENDERTYPESDL
|
||||
#include "sdlayer.h"
|
||||
extern struct sdlappicon sdlappicon;
|
||||
#endif
|
||||
void gtkbuild_init(int32_t *argc, char ***argv)
|
||||
{
|
||||
#ifndef LINKED_GTK
|
||||
gtkenabled = dynamicgtk_init();
|
||||
if (gtkenabled < 0)
|
||||
{
|
||||
gtkenabled = 0;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
gtkenabled = gtk_init_check(argc, argv);
|
||||
if (!gtkenabled) return;
|
||||
#ifdef RENDERTYPESDL
|
||||
appicon = gdk_pixbuf_new_from_data((const guchar *)sdlappicon.pixels,
|
||||
GDK_COLORSPACE_RGB, TRUE, 8, sdlappicon.width, sdlappicon.height,
|
||||
sdlappicon.width*4, NULL, NULL);
|
||||
#endif
|
||||
if (appicon) gtk_window_set_default_icon(appicon);
|
||||
}
|
||||
|
||||
void gtkbuild_exit(int32_t r)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(r);
|
||||
if (gtkenabled)
|
||||
{
|
||||
if (appicon) g_object_unref((gpointer)appicon);
|
||||
}
|
||||
#ifndef LINKED_GTK
|
||||
dynamicgtk_uninit();
|
||||
#endif
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue