mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-04-22 14:50:53 +00:00
git-svn-id: https://svn.eduke32.com/eduke32@584 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
75cca4cd5c
commit
31a901b7eb
115 changed files with 9572 additions and 8102 deletions
|
@ -8,89 +8,89 @@
|
|||
|
||||
#if defined(__WATCOMC__) && !defined(NOASM)
|
||||
|
||||
extern long mmxoverlay();
|
||||
extern int mmxoverlay();
|
||||
#pragma aux mmxoverlay modify [eax ebx ecx edx];
|
||||
extern long sethlinesizes(long,long,long);
|
||||
extern int sethlinesizes(int,int,int);
|
||||
#pragma aux sethlinesizes parm [eax][ebx][ecx];
|
||||
extern long setpalookupaddress(char *);
|
||||
extern int setpalookupaddress(char *);
|
||||
#pragma aux setpalookupaddress parm [eax];
|
||||
extern long setuphlineasm4(long,long);
|
||||
extern int setuphlineasm4(int,int);
|
||||
#pragma aux setuphlineasm4 parm [eax][ebx];
|
||||
extern long hlineasm4(long,long,long,long,long,long);
|
||||
extern int hlineasm4(int,int,int,int,int,int);
|
||||
#pragma aux hlineasm4 parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern long setuprhlineasm4(long,long,long,long,long,long);
|
||||
extern int setuprhlineasm4(int,int,int,int,int,int);
|
||||
#pragma aux setuprhlineasm4 parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern long rhlineasm4(long,long,long,long,long,long);
|
||||
extern int rhlineasm4(int,int,int,int,int,int);
|
||||
#pragma aux rhlineasm4 parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern long setuprmhlineasm4(long,long,long,long,long,long);
|
||||
extern int setuprmhlineasm4(int,int,int,int,int,int);
|
||||
#pragma aux setuprmhlineasm4 parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern long rmhlineasm4(long,long,long,long,long,long);
|
||||
extern int rmhlineasm4(int,int,int,int,int,int);
|
||||
#pragma aux rmhlineasm4 parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern long setupqrhlineasm4(long,long,long,long,long,long);
|
||||
extern int setupqrhlineasm4(int,int,int,int,int,int);
|
||||
#pragma aux setupqrhlineasm4 parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern long qrhlineasm4(long,long,long,long,long,long);
|
||||
extern int qrhlineasm4(int,int,int,int,int,int);
|
||||
#pragma aux qrhlineasm4 parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern long setvlinebpl(long);
|
||||
extern int setvlinebpl(int);
|
||||
#pragma aux setvlinebpl parm [eax];
|
||||
extern long fixtransluscence(long);
|
||||
extern int fixtransluscence(int);
|
||||
#pragma aux fixtransluscence parm [eax];
|
||||
extern long prevlineasm1(long,long,long,long,long,long);
|
||||
extern int prevlineasm1(int,int,int,int,int,int);
|
||||
#pragma aux prevlineasm1 parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern long vlineasm1(long,long,long,long,long,long);
|
||||
extern int vlineasm1(int,int,int,int,int,int);
|
||||
#pragma aux vlineasm1 parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern long setuptvlineasm(long);
|
||||
extern int setuptvlineasm(int);
|
||||
#pragma aux setuptvlineasm parm [eax];
|
||||
extern long tvlineasm1(long,long,long,long,long,long);
|
||||
extern int tvlineasm1(int,int,int,int,int,int);
|
||||
#pragma aux tvlineasm1 parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern long setuptvlineasm2(long,long,long);
|
||||
extern int setuptvlineasm2(int,int,int);
|
||||
#pragma aux setuptvlineasm2 parm [eax][ebx][ecx];
|
||||
extern long tvlineasm2(long,long,long,long,long,long);
|
||||
extern int tvlineasm2(int,int,int,int,int,int);
|
||||
#pragma aux tvlineasm2 parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern long mvlineasm1(long,long,long,long,long,long);
|
||||
extern int mvlineasm1(int,int,int,int,int,int);
|
||||
#pragma aux mvlineasm1 parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern long setupvlineasm(long);
|
||||
extern int setupvlineasm(int);
|
||||
#pragma aux setupvlineasm parm [eax];
|
||||
extern long vlineasm4(long,long);
|
||||
extern int vlineasm4(int,int);
|
||||
#pragma aux vlineasm4 parm [ecx][edi] modify [eax ebx ecx edx esi edi];
|
||||
extern long setupmvlineasm(long);
|
||||
extern int setupmvlineasm(int);
|
||||
#pragma aux setupmvlineasm parm [eax];
|
||||
extern long mvlineasm4(long,long);
|
||||
extern int mvlineasm4(int,int);
|
||||
#pragma aux mvlineasm4 parm [ecx][edi] modify [eax ebx ecx edx esi edi];
|
||||
extern void setupspritevline(long,long,long,long,long,long);
|
||||
extern void setupspritevline(int,int,int,int,int,int);
|
||||
#pragma aux setupspritevline parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern void spritevline(long,long,long,long,long,long);
|
||||
extern void spritevline(int,int,int,int,int,int);
|
||||
#pragma aux spritevline parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern void msetupspritevline(long,long,long,long,long,long);
|
||||
extern void msetupspritevline(int,int,int,int,int,int);
|
||||
#pragma aux msetupspritevline parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern void mspritevline(long,long,long,long,long,long);
|
||||
extern void mspritevline(int,int,int,int,int,int);
|
||||
#pragma aux mspritevline parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern void tsetupspritevline(long,long,long,long,long,long);
|
||||
extern void tsetupspritevline(int,int,int,int,int,int);
|
||||
#pragma aux tsetupspritevline parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern void tspritevline(long,long,long,long,long,long);
|
||||
extern void tspritevline(int,int,int,int,int,int);
|
||||
#pragma aux tspritevline parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern long mhline(long,long,long,long,long,long);
|
||||
extern int mhline(int,int,int,int,int,int);
|
||||
#pragma aux mhline parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern long mhlineskipmodify(long,long,long,long,long,long);
|
||||
extern int mhlineskipmodify(int,int,int,int,int,int);
|
||||
#pragma aux mhlineskipmodify parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern long msethlineshift(long,long);
|
||||
extern int msethlineshift(int,int);
|
||||
#pragma aux msethlineshift parm [eax][ebx];
|
||||
extern long thline(long,long,long,long,long,long);
|
||||
extern int thline(int,int,int,int,int,int);
|
||||
#pragma aux thline parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern long thlineskipmodify(long,long,long,long,long,long);
|
||||
extern int thlineskipmodify(int,int,int,int,int,int);
|
||||
#pragma aux thlineskipmodify parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern long tsethlineshift(long,long);
|
||||
extern int tsethlineshift(int,int);
|
||||
#pragma aux tsethlineshift parm [eax][ebx];
|
||||
extern long setupslopevlin(long,long,long);
|
||||
extern int setupslopevlin(int,int,int);
|
||||
#pragma aux setupslopevlin parm [eax][ebx][ecx] modify [edx];
|
||||
extern long slopevlin(long,long,long,long,long,long);
|
||||
extern int slopevlin(int,int,int,int,int,int);
|
||||
#pragma aux slopevlin parm [eax][ebx][ecx][edx][esi][edi];
|
||||
extern long settransnormal();
|
||||
extern int settransnormal();
|
||||
#pragma aux settransnormal parm;
|
||||
extern long settransreverse();
|
||||
extern int settransreverse();
|
||||
#pragma aux settransreverse parm;
|
||||
extern long setupdrawslab(long,long);
|
||||
extern int setupdrawslab(int,int);
|
||||
#pragma aux setupdrawslab parm [eax][ebx];
|
||||
extern long drawslab(long,long,long,long,long,long);
|
||||
extern int drawslab(int,int,int,int,int,int);
|
||||
#pragma aux drawslab parm [eax][ebx][ecx][edx][esi][edi];
|
||||
|
||||
#elif defined(__GNUC__) && defined(__i386__) && !defined(NOASM) // __WATCOMC__
|
||||
|
@ -99,140 +99,140 @@ extern long drawslab(long,long,long,long,long,long);
|
|||
#define __cdecl
|
||||
#endif
|
||||
|
||||
extern long __cdecl mmxoverlay();
|
||||
extern long __cdecl sethlinesizes(long,long,long);
|
||||
extern long __cdecl setpalookupaddress(char *);
|
||||
extern long __cdecl setuphlineasm4(long,long);
|
||||
extern long __cdecl hlineasm4(long,long,long,long,long,long);
|
||||
extern long __cdecl setuprhlineasm4(long,long,long,long,long,long);
|
||||
extern long __cdecl rhlineasm4(long,long,long,long,long,long);
|
||||
extern long __cdecl setuprmhlineasm4(long,long,long,long,long,long);
|
||||
extern long __cdecl rmhlineasm4(long,long,long,long,long,long);
|
||||
extern long __cdecl setupqrhlineasm4(long,long,long,long,long,long);
|
||||
extern long __cdecl qrhlineasm4(long,long,long,long,long,long);
|
||||
extern long __cdecl setvlinebpl(long);
|
||||
extern long __cdecl fixtransluscence(long);
|
||||
extern long __cdecl prevlineasm1(long,long,long,long,long,long);
|
||||
extern long __cdecl vlineasm1(long,long,long,long,long,long);
|
||||
extern long __cdecl setuptvlineasm(long);
|
||||
extern long __cdecl tvlineasm1(long,long,long,long,long,long);
|
||||
extern long __cdecl setuptvlineasm2(long,long,long);
|
||||
extern long __cdecl tvlineasm2(long,long,long,long,long,long);
|
||||
extern long __cdecl mvlineasm1(long,long,long,long,long,long);
|
||||
extern long __cdecl setupvlineasm(long);
|
||||
extern long __cdecl vlineasm4(long,long);
|
||||
extern long __cdecl setupmvlineasm(long);
|
||||
extern long __cdecl mvlineasm4(long,long);
|
||||
extern long __cdecl setupspritevline(long,long,long,long,long,long);
|
||||
extern long __cdecl spritevline(long,long,long,long,long,long);
|
||||
extern long __cdecl msetupspritevline(long,long,long,long,long,long);
|
||||
extern long __cdecl mspritevline(long,long,long,long,long,long);
|
||||
extern long __cdecl tsetupspritevline(long,long,long,long,long,long);
|
||||
extern long __cdecl tspritevline(long,long,long,long,long,long);
|
||||
extern long __cdecl mhline(long,long,long,long,long,long);
|
||||
extern long __cdecl mhlineskipmodify(long,long,long,long,long,long);
|
||||
extern long __cdecl msethlineshift(long,long);
|
||||
extern long __cdecl thline(long,long,long,long,long,long);
|
||||
extern long __cdecl thlineskipmodify(long,long,long,long,long,long);
|
||||
extern long __cdecl tsethlineshift(long,long);
|
||||
extern long __cdecl setupslopevlin(long,long,long);
|
||||
extern long __cdecl slopevlin(long,long,long,long,long,long);
|
||||
extern long __cdecl settransnormal();
|
||||
extern long __cdecl settransreverse();
|
||||
extern long __cdecl setupdrawslab(long,long);
|
||||
extern long __cdecl drawslab(long,long,long,long,long,long);
|
||||
extern void __cdecl stretchhline(long,long,long,long,long,long);
|
||||
extern int __cdecl mmxoverlay();
|
||||
extern int __cdecl sethlinesizes(int,int,int);
|
||||
extern int __cdecl setpalookupaddress(char *);
|
||||
extern int __cdecl setuphlineasm4(int,int);
|
||||
extern int __cdecl hlineasm4(int,int,int,int,int,int);
|
||||
extern int __cdecl setuprhlineasm4(int,int,int,int,int,int);
|
||||
extern int __cdecl rhlineasm4(int,int,int,int,int,int);
|
||||
extern int __cdecl setuprmhlineasm4(int,int,int,int,int,int);
|
||||
extern int __cdecl rmhlineasm4(int,int,int,int,int,int);
|
||||
extern int __cdecl setupqrhlineasm4(int,int,int,int,int,int);
|
||||
extern int __cdecl qrhlineasm4(int,int,int,int,int,int);
|
||||
extern int __cdecl setvlinebpl(int);
|
||||
extern int __cdecl fixtransluscence(int);
|
||||
extern int __cdecl prevlineasm1(int,int,int,int,int,int);
|
||||
extern int __cdecl vlineasm1(int,int,int,int,int,int);
|
||||
extern int __cdecl setuptvlineasm(int);
|
||||
extern int __cdecl tvlineasm1(int,int,int,int,int,int);
|
||||
extern int __cdecl setuptvlineasm2(int,int,int);
|
||||
extern int __cdecl tvlineasm2(int,int,int,int,int,int);
|
||||
extern int __cdecl mvlineasm1(int,int,int,int,int,int);
|
||||
extern int __cdecl setupvlineasm(int);
|
||||
extern int __cdecl vlineasm4(int,int);
|
||||
extern int __cdecl setupmvlineasm(int);
|
||||
extern int __cdecl mvlineasm4(int,int);
|
||||
extern int __cdecl setupspritevline(int,int,int,int,int,int);
|
||||
extern int __cdecl spritevline(int,int,int,int,int,int);
|
||||
extern int __cdecl msetupspritevline(int,int,int,int,int,int);
|
||||
extern int __cdecl mspritevline(int,int,int,int,int,int);
|
||||
extern int __cdecl tsetupspritevline(int,int,int,int,int,int);
|
||||
extern int __cdecl tspritevline(int,int,int,int,int,int);
|
||||
extern int __cdecl mhline(int,int,int,int,int,int);
|
||||
extern int __cdecl mhlineskipmodify(int,int,int,int,int,int);
|
||||
extern int __cdecl msethlineshift(int,int);
|
||||
extern int __cdecl thline(int,int,int,int,int,int);
|
||||
extern int __cdecl thlineskipmodify(int,int,int,int,int,int);
|
||||
extern int __cdecl tsethlineshift(int,int);
|
||||
extern int __cdecl setupslopevlin(int,int,int);
|
||||
extern int __cdecl slopevlin(int,int,int,int,int,int);
|
||||
extern int __cdecl settransnormal();
|
||||
extern int __cdecl settransreverse();
|
||||
extern int __cdecl setupdrawslab(int,int);
|
||||
extern int __cdecl drawslab(int,int,int,int,int,int);
|
||||
extern void __cdecl stretchhline(int,int,int,int,int,int);
|
||||
|
||||
#elif defined(_MSC_VER) && !defined(NOASM) // __GNUC__ && __i386__
|
||||
|
||||
extern long _cdecl mmxoverlay();
|
||||
extern long _cdecl sethlinesizes(long,long,long);
|
||||
extern long _cdecl setpalookupaddress(char *);
|
||||
extern long _cdecl setuphlineasm4(long,long);
|
||||
extern long _cdecl hlineasm4(long,long,long,long,long,long);
|
||||
extern long _cdecl setuprhlineasm4(long,long,long,long,long,long);
|
||||
extern long _cdecl rhlineasm4(long,long,long,long,long,long);
|
||||
extern long _cdecl setuprmhlineasm4(long,long,long,long,long,long);
|
||||
extern long _cdecl rmhlineasm4(long,long,long,long,long,long);
|
||||
extern long _cdecl setupqrhlineasm4(long,long,long,long,long,long);
|
||||
extern long _cdecl qrhlineasm4(long,long,long,long,long,long);
|
||||
extern long _cdecl setvlinebpl(long);
|
||||
extern long _cdecl fixtransluscence(long);
|
||||
extern long _cdecl prevlineasm1(long,long,long,long,long,long);
|
||||
extern long _cdecl vlineasm1(long,long,long,long,long,long);
|
||||
extern long _cdecl setuptvlineasm(long);
|
||||
extern long _cdecl tvlineasm1(long,long,long,long,long,long);
|
||||
extern long _cdecl setuptvlineasm2(long,long,long);
|
||||
extern long _cdecl tvlineasm2(long,long,long,long,long,long);
|
||||
extern long _cdecl mvlineasm1(long,long,long,long,long,long);
|
||||
extern long _cdecl setupvlineasm(long);
|
||||
extern long _cdecl vlineasm4(long,long);
|
||||
extern long _cdecl setupmvlineasm(long);
|
||||
extern long _cdecl mvlineasm4(long,long);
|
||||
extern long _cdecl setupspritevline(long,long,long,long,long,long);
|
||||
extern long _cdecl spritevline(long,long,long,long,long,long);
|
||||
extern long _cdecl msetupspritevline(long,long,long,long,long,long);
|
||||
extern long _cdecl mspritevline(long,long,long,long,long,long);
|
||||
extern long _cdecl tsetupspritevline(long,long,long,long,long,long);
|
||||
extern long _cdecl tspritevline(long,long,long,long,long,long);
|
||||
extern long _cdecl mhline(long,long,long,long,long,long);
|
||||
extern long _cdecl mhlineskipmodify(long,long,long,long,long,long);
|
||||
extern long _cdecl msethlineshift(long,long);
|
||||
extern long _cdecl thline(long,long,long,long,long,long);
|
||||
extern long _cdecl thlineskipmodify(long,long,long,long,long,long);
|
||||
extern long _cdecl tsethlineshift(long,long);
|
||||
extern long _cdecl setupslopevlin(long,long,long);
|
||||
extern long _cdecl slopevlin(long,long,long,long,long,long);
|
||||
extern long _cdecl settransnormal();
|
||||
extern long _cdecl settransreverse();
|
||||
extern long _cdecl setupdrawslab(long,long);
|
||||
extern long _cdecl drawslab(long,long,long,long,long,long);
|
||||
extern void _cdecl stretchhline(long,long,long,long,long,long);
|
||||
extern int _cdecl mmxoverlay();
|
||||
extern int _cdecl sethlinesizes(int,int,int);
|
||||
extern int _cdecl setpalookupaddress(char *);
|
||||
extern int _cdecl setuphlineasm4(int,int);
|
||||
extern int _cdecl hlineasm4(int,int,int,int,int,int);
|
||||
extern int _cdecl setuprhlineasm4(int,int,int,int,int,int);
|
||||
extern int _cdecl rhlineasm4(int,int,int,int,int,int);
|
||||
extern int _cdecl setuprmhlineasm4(int,int,int,int,int,int);
|
||||
extern int _cdecl rmhlineasm4(int,int,int,int,int,int);
|
||||
extern int _cdecl setupqrhlineasm4(int,int,int,int,int,int);
|
||||
extern int _cdecl qrhlineasm4(int,int,int,int,int,int);
|
||||
extern int _cdecl setvlinebpl(int);
|
||||
extern int _cdecl fixtransluscence(int);
|
||||
extern int _cdecl prevlineasm1(int,int,int,int,int,int);
|
||||
extern int _cdecl vlineasm1(int,int,int,int,int,int);
|
||||
extern int _cdecl setuptvlineasm(int);
|
||||
extern int _cdecl tvlineasm1(int,int,int,int,int,int);
|
||||
extern int _cdecl setuptvlineasm2(int,int,int);
|
||||
extern int _cdecl tvlineasm2(int,int,int,int,int,int);
|
||||
extern int _cdecl mvlineasm1(int,int,int,int,int,int);
|
||||
extern int _cdecl setupvlineasm(int);
|
||||
extern int _cdecl vlineasm4(int,int);
|
||||
extern int _cdecl setupmvlineasm(int);
|
||||
extern int _cdecl mvlineasm4(int,int);
|
||||
extern int _cdecl setupspritevline(int,int,int,int,int,int);
|
||||
extern int _cdecl spritevline(int,int,int,int,int,int);
|
||||
extern int _cdecl msetupspritevline(int,int,int,int,int,int);
|
||||
extern int _cdecl mspritevline(int,int,int,int,int,int);
|
||||
extern int _cdecl tsetupspritevline(int,int,int,int,int,int);
|
||||
extern int _cdecl tspritevline(int,int,int,int,int,int);
|
||||
extern int _cdecl mhline(int,int,int,int,int,int);
|
||||
extern int _cdecl mhlineskipmodify(int,int,int,int,int,int);
|
||||
extern int _cdecl msethlineshift(int,int);
|
||||
extern int _cdecl thline(int,int,int,int,int,int);
|
||||
extern int _cdecl thlineskipmodify(int,int,int,int,int,int);
|
||||
extern int _cdecl tsethlineshift(int,int);
|
||||
extern int _cdecl setupslopevlin(int,int,int);
|
||||
extern int _cdecl slopevlin(int,int,int,int,int,int);
|
||||
extern int _cdecl settransnormal();
|
||||
extern int _cdecl settransreverse();
|
||||
extern int _cdecl setupdrawslab(int,int);
|
||||
extern int _cdecl drawslab(int,int,int,int,int,int);
|
||||
extern void _cdecl stretchhline(int,int,int,int,int,int);
|
||||
|
||||
#else // _MSC_VER
|
||||
|
||||
#define ENGINE_USING_A_C
|
||||
|
||||
void setvlinebpl(long dabpl);
|
||||
void fixtransluscence(long datransoff);
|
||||
void setvlinebpl(int dabpl);
|
||||
void fixtransluscence(int datransoff);
|
||||
void settransnormal(void);
|
||||
void settransreverse(void);
|
||||
|
||||
void sethlinesizes(long logx, long logy, long bufplc);
|
||||
void sethlinesizes(int logx, int logy, int bufplc);
|
||||
void setpalookupaddress(char *paladdr);
|
||||
void setuphlineasm4(long bxinc, long byinc);
|
||||
void hlineasm4(long cnt, long skiploadincs, long paloffs, unsigned long by, unsigned long bx, long p);
|
||||
void setuphlineasm4(int bxinc, int byinc);
|
||||
void hlineasm4(int cnt, int skiploadincs, int paloffs, unsigned int by, unsigned int bx, int p);
|
||||
|
||||
void setupslopevlin(long logylogx, long bufplc, long pinc);
|
||||
void slopevlin(long p, long i, long slopaloffs, long cnt, long bx, long by);
|
||||
void setupslopevlin(int logylogx, int bufplc, int pinc);
|
||||
void slopevlin(int p, int i, int slopaloffs, int cnt, int bx, int by);
|
||||
|
||||
void setupvlineasm(long neglogy);
|
||||
void vlineasm1(long vinc, long paloffs, long cnt, unsigned long vplc, long bufplc, long p);
|
||||
void setupvlineasm(int neglogy);
|
||||
void vlineasm1(int vinc, int paloffs, int cnt, unsigned int vplc, int bufplc, int p);
|
||||
|
||||
void setupmvlineasm(long neglogy);
|
||||
void mvlineasm1(long vinc, long paloffs, long cnt, unsigned long vplc, long bufplc, long p);
|
||||
void setupmvlineasm(int neglogy);
|
||||
void mvlineasm1(int vinc, int paloffs, int cnt, unsigned int vplc, int bufplc, int p);
|
||||
|
||||
void setuptvlineasm(long neglogy);
|
||||
void tvlineasm1(long vinc, long paloffs, long cnt, unsigned long vplc, long bufplc, long p);
|
||||
void setuptvlineasm(int neglogy);
|
||||
void tvlineasm1(int vinc, int paloffs, int cnt, unsigned int vplc, int bufplc, int p);
|
||||
|
||||
void msethlineshift(long logx, long logy);
|
||||
void mhline(long bufplc, unsigned long bx, long cntup16, long junk, unsigned long by, long p);
|
||||
void msethlineshift(int logx, int logy);
|
||||
void mhline(int bufplc, unsigned int bx, int cntup16, int junk, unsigned int by, int p);
|
||||
|
||||
void tsethlineshift(long logx, long logy);
|
||||
void thline(long bufplc, unsigned long bx, long cntup16, long junk, unsigned long by, long p);
|
||||
void tsethlineshift(int logx, int logy);
|
||||
void thline(int bufplc, unsigned int bx, int cntup16, int junk, unsigned int by, int p);
|
||||
|
||||
void setupspritevline(long paloffs, long bxinc, long byinc, long ysiz);
|
||||
void spritevline(long bx, long by, long cnt, long bufplc, long p);
|
||||
void setupspritevline(int paloffs, int bxinc, int byinc, int ysiz);
|
||||
void spritevline(int bx, int by, int cnt, int bufplc, int p);
|
||||
|
||||
void msetupspritevline(long paloffs, long bxinc, long byinc, long ysiz);
|
||||
void mspritevline(long bx, long by, long cnt, long bufplc, long p);
|
||||
void msetupspritevline(int paloffs, int bxinc, int byinc, int ysiz);
|
||||
void mspritevline(int bx, int by, int cnt, int bufplc, int p);
|
||||
|
||||
void tsetupspritevline(long paloffs, long bxinc, long byinc, long ysiz);
|
||||
void tspritevline(long bx, long by, long cnt, long bufplc, long p);
|
||||
void tsetupspritevline(int paloffs, int bxinc, int byinc, int ysiz);
|
||||
void tspritevline(int bx, int by, int cnt, int bufplc, int p);
|
||||
|
||||
void setupdrawslab (long dabpl, long pal);
|
||||
void drawslab (long dx, long v, long dy, long vi, long vptr, long p);
|
||||
void stretchhline (long p0, long u, long cnt, long uinc, long rptr, long p);
|
||||
void setupdrawslab (int dabpl, int pal);
|
||||
void drawslab (int dx, int v, int dy, int vi, int vptr, int p);
|
||||
void stretchhline (int p0, int u, int cnt, int uinc, int rptr, int p);
|
||||
|
||||
void mmxoverlay();
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ extern int startwin_settitle(const char *);
|
|||
extern int startwin_idle(void *);
|
||||
|
||||
// video
|
||||
extern long xres, yres, bpp, fullscreen, bytesperline, imageSize, frameplace;
|
||||
extern int xres, yres, bpp, fullscreen, bytesperline, imageSize, frameplace;
|
||||
extern char offscreenrendering;
|
||||
|
||||
extern void (*baselayer_onvideomodechange)(int);
|
||||
|
@ -61,12 +61,12 @@ extern char keystatus[256], keyfifo[KEYFIFOSIZ], keyfifoplc, keyfifoend;
|
|||
extern unsigned char keyasciififo[KEYFIFOSIZ], keyasciififoplc, keyasciififoend;
|
||||
|
||||
// mouse
|
||||
extern long mousex, mousey, mouseb;
|
||||
extern int mousex, mousey, mouseb;
|
||||
|
||||
// joystick
|
||||
extern long *joyaxis, *joyhat, joyb;
|
||||
extern int *joyaxis, *joyhat, joyb;
|
||||
extern char joyisgamepad, joynumaxes, joynumbuttons, joynumhats;
|
||||
extern long joyaxespresent;
|
||||
extern int joyaxespresent;
|
||||
|
||||
|
||||
|
||||
|
@ -79,15 +79,15 @@ void debugprintf(const char *,...);
|
|||
int handleevents(void);
|
||||
extern inline void idle(void);
|
||||
|
||||
typedef void (*KeyPressCallback)(long,long);
|
||||
typedef void (*MousePressCallback)(long,long);
|
||||
typedef void (*JoyPressCallback)(long,long);
|
||||
typedef void (*KeyPressCallback)(int,int);
|
||||
typedef void (*MousePressCallback)(int,int);
|
||||
typedef void (*JoyPressCallback)(int,int);
|
||||
int initinput(void);
|
||||
void uninitinput(void);
|
||||
void releaseallbuttons(void);
|
||||
void setkeypresscallback(void (*callback)(long,long));
|
||||
void setmousepresscallback(void (*callback)(long,long));
|
||||
void setjoypresscallback(void (*callback)(long,long));
|
||||
void setkeypresscallback(void (*callback)(int,int));
|
||||
void setmousepresscallback(void (*callback)(int,int));
|
||||
void setjoypresscallback(void (*callback)(int,int));
|
||||
const unsigned char *getkeyname(int num);
|
||||
const unsigned char *getjoyname(int what, int num); // what: 0=axis, 1=button, 2=hat
|
||||
|
||||
|
@ -98,15 +98,15 @@ void bflushchars(void);
|
|||
int initmouse(void);
|
||||
void uninitmouse(void);
|
||||
void grabmouse(char a);
|
||||
void readmousexy(long *x, long *y);
|
||||
void readmousebstatus(long *b);
|
||||
void readmousexy(int *x, int *y);
|
||||
void readmousebstatus(int *b);
|
||||
void setjoydeadzone(int axis, unsigned short dead, unsigned short satur);
|
||||
void getjoydeadzone(int axis, unsigned short *dead, unsigned short *satur);
|
||||
|
||||
int inittimer(int);
|
||||
void uninittimer(void);
|
||||
void sampletimer(void);
|
||||
unsigned long getticks(void);
|
||||
unsigned int getticks(void);
|
||||
int gettimerfreq(void);
|
||||
void (*installusertimercallback(void (*callback)(void)))(void);
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ extern "C" {
|
|||
typedef struct BPACK
|
||||
{
|
||||
short wallptr, wallnum;
|
||||
long ceilingz, floorz;
|
||||
int ceilingz, floorz;
|
||||
short ceilingstat, floorstat;
|
||||
short ceilingpicnum, ceilingheinum;
|
||||
signed char ceilingshade;
|
||||
|
@ -113,7 +113,7 @@ typedef struct BPACK
|
|||
//32 bytes
|
||||
typedef struct BPACK
|
||||
{
|
||||
long x, y;
|
||||
int x, y;
|
||||
short point2, nextwall, nextsector, cstat;
|
||||
short picnum, overpicnum;
|
||||
signed char shade;
|
||||
|
@ -139,7 +139,7 @@ typedef struct BPACK
|
|||
//44 bytes
|
||||
typedef struct BPACK
|
||||
{
|
||||
long x, y, z;
|
||||
int x, y, z;
|
||||
short cstat, picnum;
|
||||
signed char shade;
|
||||
char pal, clipdist, filler;
|
||||
|
@ -151,11 +151,11 @@ typedef struct BPACK
|
|||
} spritetype;
|
||||
|
||||
typedef struct BPACK {
|
||||
unsigned long mdanimtims;
|
||||
unsigned int mdanimtims;
|
||||
short mdanimcur;
|
||||
short angoff;
|
||||
short pitch, roll;
|
||||
long xoff, yoff, zoff;
|
||||
int xoff, yoff, zoff;
|
||||
unsigned char flags;
|
||||
char filler[3];
|
||||
} spriteexttype;
|
||||
|
@ -170,41 +170,41 @@ typedef struct BPACK {
|
|||
#define SPREXT_NOMDANIM 2
|
||||
EXTERN spriteexttype *spriteext;
|
||||
EXTERN spritesmoothtype *spritesmooth;
|
||||
EXTERN long guniqhudid;
|
||||
EXTERN int guniqhudid;
|
||||
|
||||
EXTERN sectortype *sector;
|
||||
EXTERN walltype *wall;
|
||||
EXTERN spritetype *sprite;
|
||||
|
||||
EXTERN long spritesortcnt;
|
||||
EXTERN int spritesortcnt;
|
||||
EXTERN spritetype *tsprite;
|
||||
|
||||
EXTERN long xdim, ydim, ylookup[MAXYDIM+1], numpages;
|
||||
EXTERN long yxaspect, viewingrange;
|
||||
EXTERN int xdim, ydim, ylookup[MAXYDIM+1], numpages;
|
||||
EXTERN int yxaspect, viewingrange;
|
||||
|
||||
#define MAXVALIDMODES 256
|
||||
EXTERN long validmodecnt;
|
||||
EXTERN int validmodecnt;
|
||||
struct validmode_t {
|
||||
long xdim,ydim;
|
||||
int xdim,ydim;
|
||||
char bpp;
|
||||
char fs; // bit 0 = fullscreen flag
|
||||
char filler[2];
|
||||
long extra; // internal use
|
||||
int extra; // internal use
|
||||
};
|
||||
EXTERN struct validmode_t validmode[MAXVALIDMODES];
|
||||
|
||||
EXTERN short numsectors, numwalls;
|
||||
EXTERN /*volatile*/ long totalclock;
|
||||
EXTERN long numframes, randomseed;
|
||||
EXTERN /*volatile*/ int totalclock;
|
||||
EXTERN int numframes, randomseed;
|
||||
EXTERN short sintable[2048];
|
||||
EXTERN char palette[768];
|
||||
EXTERN short numpalookups;
|
||||
EXTERN char *palookup[MAXPALOOKUPS];
|
||||
EXTERN char parallaxtype, showinvisibility;
|
||||
EXTERN long parallaxyoffs, parallaxyscale;
|
||||
EXTERN long visibility, parallaxvisibility;
|
||||
EXTERN int parallaxyoffs, parallaxyscale;
|
||||
EXTERN int visibility, parallaxvisibility;
|
||||
|
||||
EXTERN long windowx1, windowy1, windowx2, windowy2;
|
||||
EXTERN int windowx1, windowy1, windowx2, windowy2;
|
||||
EXTERN short startumost[MAXXDIM], startdmost[MAXXDIM];
|
||||
|
||||
EXTERN short pskyoff[MAXPSKYTILES], pskybits;
|
||||
|
@ -216,8 +216,8 @@ EXTERN short nextspritesect[MAXSPRITES], nextspritestat[MAXSPRITES];
|
|||
EXTERN short tilesizx[MAXTILES], tilesizy[MAXTILES];
|
||||
EXTERN char picsiz[MAXTILES];
|
||||
EXTERN char walock[MAXTILES];
|
||||
EXTERN long pow2long[32];
|
||||
EXTERN long numtiles, picanm[MAXTILES], waloff[MAXTILES];
|
||||
EXTERN int pow2long[32];
|
||||
EXTERN int numtiles, picanm[MAXTILES], waloff[MAXTILES];
|
||||
|
||||
EXTERN int windowpos, windowx, windowy;
|
||||
|
||||
|
@ -245,7 +245,7 @@ EXTERN char gotsector[(MAXSECTORS+7)>>3];
|
|||
|
||||
EXTERN char captureformat;
|
||||
extern char vgapalette[5*256];
|
||||
extern unsigned long drawlinepat;
|
||||
extern unsigned int drawlinepat;
|
||||
|
||||
extern void faketimerhandler(void);
|
||||
|
||||
|
@ -256,14 +256,14 @@ typedef struct {
|
|||
extern palette_t curpalette[256], curpalettefaded[256], palfadergb;
|
||||
extern char palfadedelta;
|
||||
|
||||
extern long dommxoverlay, novoxmips;
|
||||
extern int dommxoverlay, novoxmips;
|
||||
|
||||
#ifdef SUPERBUILD
|
||||
extern long tiletovox[MAXTILES];
|
||||
extern long usevoxels, voxscale[MAXVOXELS];
|
||||
extern int tiletovox[MAXTILES];
|
||||
extern int usevoxels, voxscale[MAXVOXELS];
|
||||
#endif
|
||||
#ifdef POLYMOST
|
||||
extern long usemodels, usehightile;
|
||||
extern int usemodels, usehightile;
|
||||
#endif
|
||||
|
||||
extern char *engineerrstr;
|
||||
|
@ -375,79 +375,79 @@ int preinitengine(void); // a partial setup of the engine used for launch win
|
|||
int initengine(void);
|
||||
void uninitengine(void);
|
||||
void initspritelists(void);
|
||||
long loadboard(char *filename, char fromwhere, long *daposx, long *daposy, long *daposz, short *daang, short *dacursectnum);
|
||||
long loadmaphack(char *filename);
|
||||
long saveboard(char *filename, long *daposx, long *daposy, long *daposz, short *daang, short *dacursectnum);
|
||||
long loadpics(char *filename, long askedsize);
|
||||
int loadboard(char *filename, char fromwhere, int *daposx, int *daposy, int *daposz, short *daang, short *dacursectnum);
|
||||
int loadmaphack(char *filename);
|
||||
int saveboard(char *filename, int *daposx, int *daposy, int *daposz, short *daang, short *dacursectnum);
|
||||
int loadpics(char *filename, int askedsize);
|
||||
void loadtile(short tilenume);
|
||||
long qloadkvx(long voxindex, char *filename);
|
||||
long allocatepermanenttile(short tilenume, long xsiz, long ysiz);
|
||||
void copytilepiece(long tilenume1, long sx1, long sy1, long xsiz, long ysiz, long tilenume2, long sx2, long sy2);
|
||||
void makepalookup(long palnum, char *remapbuf, signed char r, signed char g, signed char b, char dastat);
|
||||
int qloadkvx(int voxindex, char *filename);
|
||||
int allocatepermanenttile(short tilenume, int xsiz, int ysiz);
|
||||
void copytilepiece(int tilenume1, int sx1, int sy1, int xsiz, int ysiz, int tilenume2, int sx2, int sy2);
|
||||
void makepalookup(int palnum, char *remapbuf, signed char r, signed char g, signed char b, char dastat);
|
||||
void setvgapalette(void);
|
||||
void setbrightness(char dabrightness, char *dapal, char noapply);
|
||||
void setpalettefade(char r, char g, char b, char offset);
|
||||
void squarerotatetile(short tilenume);
|
||||
|
||||
long setgamemode(char davidoption, long daxdim, long daydim, long dabpp);
|
||||
int setgamemode(char davidoption, int daxdim, int daydim, int dabpp);
|
||||
void nextpage(void);
|
||||
void setview(long x1, long y1, long x2, long y2);
|
||||
void setaspect(long daxrange, long daaspect);
|
||||
void setview(int x1, int y1, int x2, int y2);
|
||||
void setaspect(int daxrange, int daaspect);
|
||||
void flushperms(void);
|
||||
|
||||
void plotpixel(long x, long y, char col);
|
||||
char getpixel(long x, long y);
|
||||
void setviewtotile(short tilenume, long xsiz, long ysiz);
|
||||
void plotpixel(int x, int y, char col);
|
||||
char getpixel(int x, int y);
|
||||
void setviewtotile(short tilenume, int xsiz, int ysiz);
|
||||
void setviewback(void);
|
||||
void preparemirror(long dax, long day, long daz, short daang, long dahoriz, short dawall, short dasector, long *tposx, long *tposy, short *tang);
|
||||
void preparemirror(int dax, int day, int daz, short daang, int dahoriz, short dawall, short dasector, int *tposx, int *tposy, short *tang);
|
||||
void completemirror(void);
|
||||
|
||||
void drawrooms(long daposx, long daposy, long daposz, short daang, long dahoriz, short dacursectnum);
|
||||
void drawrooms(int daposx, int daposy, int daposz, short daang, int dahoriz, short dacursectnum);
|
||||
void drawmasks(void);
|
||||
void clearview(long dacol);
|
||||
void clearallviews(long dacol);
|
||||
void drawmapview(long dax, long day, long zoome, short ang);
|
||||
void 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);
|
||||
void drawline256(long x1, long y1, long x2, long y2, char col);
|
||||
void printext16(long xpos, long ypos, short col, short backcol, char *name, char fontsize);
|
||||
void printext256(long xpos, long ypos, short col, short backcol, char *name, char fontsize);
|
||||
void clearview(int dacol);
|
||||
void clearallviews(int dacol);
|
||||
void drawmapview(int dax, int day, int zoome, short ang);
|
||||
void rotatesprite(int sx, int sy, int z, short a, short picnum, signed char dashade, char dapalnum, char dastat, int cx1, int cy1, int cx2, int cy2);
|
||||
void drawline256(int x1, int y1, int x2, int y2, char col);
|
||||
void printext16(int xpos, int ypos, short col, short backcol, char *name, char fontsize);
|
||||
void printext256(int xpos, int ypos, short col, short backcol, char *name, char fontsize);
|
||||
|
||||
long clipmove(long *x, long *y, long *z, short *sectnum, long xvect, long yvect, long walldist, long ceildist, long flordist, unsigned long cliptype);
|
||||
long clipinsidebox(long x, long y, short wallnum, long walldist);
|
||||
long clipinsideboxline(long x, long y, long x1, long y1, long x2, long y2, long walldist);
|
||||
long pushmove(long *x, long *y, long *z, short *sectnum, long walldist, long ceildist, long flordist, unsigned long cliptype);
|
||||
void getzrange(long x, long y, long z, short sectnum, long *ceilz, long *ceilhit, long *florz, long *florhit, long walldist, unsigned long cliptype);
|
||||
long hitscan(long xs, long ys, long zs, short sectnum, long vx, long vy, long vz, short *hitsect, short *hitwall, short *hitsprite, long *hitx, long *hity, long *hitz, unsigned long cliptype);
|
||||
long neartag(long xs, long ys, long zs, short sectnum, short ange, short *neartagsector, short *neartagwall, short *neartagsprite, long *neartaghitdist, long neartagrange, char tagsearch);
|
||||
long cansee(long x1, long y1, long z1, short sect1, long x2, long y2, long z2, short sect2);
|
||||
void updatesector(long x, long y, short *sectnum);
|
||||
void updatesectorz(long x, long y, long z, short *sectnum);
|
||||
long inside(long x, long y, short sectnum);
|
||||
void dragpoint(short pointhighlight, long dax, long day);
|
||||
int clipmove(int *x, int *y, int *z, short *sectnum, int xvect, int yvect, int walldist, int ceildist, int flordist, unsigned int cliptype);
|
||||
int clipinsidebox(int x, int y, short wallnum, int walldist);
|
||||
int clipinsideboxline(int x, int y, int x1, int y1, int x2, int y2, int walldist);
|
||||
int pushmove(int *x, int *y, int *z, short *sectnum, int walldist, int ceildist, int flordist, unsigned int cliptype);
|
||||
void getzrange(int x, int y, int z, short sectnum, int *ceilz, int *ceilhit, int *florz, int *florhit, int walldist, unsigned int cliptype);
|
||||
int hitscan(int xs, int ys, int zs, short sectnum, int vx, int vy, int vz, short *hitsect, short *hitwall, short *hitsprite, int *hitx, int *hity, int *hitz, unsigned int cliptype);
|
||||
int neartag(int xs, int ys, int zs, short sectnum, short ange, short *neartagsector, short *neartagwall, short *neartagsprite, int *neartaghitdist, int neartagrange, char tagsearch);
|
||||
int cansee(int x1, int y1, int z1, short sect1, int x2, int y2, int z2, short sect2);
|
||||
void updatesector(int x, int y, short *sectnum);
|
||||
void updatesectorz(int x, int y, int z, short *sectnum);
|
||||
int inside(int x, int y, short sectnum);
|
||||
void dragpoint(short pointhighlight, int dax, int day);
|
||||
void setfirstwall(short sectnum, short newfirstwall);
|
||||
|
||||
void getmousevalues(long *mousx, long *mousy, long *bstatus);
|
||||
long krand(void);
|
||||
long ksqrt(long num);
|
||||
long getangle(long xvect, long yvect);
|
||||
void rotatepoint(long xpivot, long ypivot, long x, long y, short daang, long *x2, long *y2);
|
||||
long lastwall(short point);
|
||||
long nextsectorneighborz(short sectnum, long thez, short topbottom, short direction);
|
||||
long getceilzofslope(short sectnum, long dax, long day);
|
||||
long getflorzofslope(short sectnum, long dax, long day);
|
||||
void getzsofslope(short sectnum, long dax, long day, long *ceilz, long *florz);
|
||||
void alignceilslope(short dasect, long x, long y, long z);
|
||||
void alignflorslope(short dasect, long x, long y, long z);
|
||||
long sectorofwall(short theline);
|
||||
long loopnumofsector(short sectnum, short wallnum);
|
||||
void getmousevalues(int *mousx, int *mousy, int *bstatus);
|
||||
int krand(void);
|
||||
int ksqrt(int num);
|
||||
int getangle(int xvect, int yvect);
|
||||
void rotatepoint(int xpivot, int ypivot, int x, int y, short daang, int *x2, int *y2);
|
||||
int lastwall(short point);
|
||||
int nextsectorneighborz(short sectnum, int thez, short topbottom, short direction);
|
||||
int getceilzofslope(short sectnum, int dax, int day);
|
||||
int getflorzofslope(short sectnum, int dax, int day);
|
||||
void getzsofslope(short sectnum, int dax, int day, int *ceilz, int *florz);
|
||||
void alignceilslope(short dasect, int x, int y, int z);
|
||||
void alignflorslope(short dasect, int x, int y, int z);
|
||||
int sectorofwall(short theline);
|
||||
int loopnumofsector(short sectnum, short wallnum);
|
||||
|
||||
long insertsprite(short sectnum, short statnum);
|
||||
long deletesprite(short spritenum);
|
||||
long changespritesect(short spritenum, short newsectnum);
|
||||
long changespritestat(short spritenum, short newstatnum);
|
||||
long setsprite(short spritenum, long newx, long newy, long newz);
|
||||
int insertsprite(short sectnum, short statnum);
|
||||
int deletesprite(short spritenum);
|
||||
int changespritesect(short spritenum, short newsectnum);
|
||||
int changespritestat(short spritenum, short newstatnum);
|
||||
int setsprite(short spritenum, int newx, int newy, int newz);
|
||||
|
||||
long screencapture(char *filename, char inverseit);
|
||||
int screencapture(char *filename, char inverseit);
|
||||
|
||||
// PLAG: line utility functions
|
||||
typedef struct s_equation {
|
||||
|
@ -456,24 +456,24 @@ typedef struct s_equation {
|
|||
typedef struct s_point2d {
|
||||
float x, y;
|
||||
} _point2d;
|
||||
_equation equation(long x1, long y1, long x2, long y2);
|
||||
_equation equation(int x1, int y1, int x2, int y2);
|
||||
int sameside(_equation* eq, _point2d* p1, _point2d* p2);
|
||||
int wallvisible(short wallnum);
|
||||
|
||||
#define STATUS2DSIZ 144
|
||||
void qsetmode640350(void);
|
||||
void qsetmode640480(void);
|
||||
void qsetmodeany(long,long);
|
||||
void qsetmodeany(int,int);
|
||||
void clear2dscreen(void);
|
||||
void draw2dgrid(long posxe, long posye, short ange, long zoome, short gride);
|
||||
void draw2dscreen(long posxe, long posye, short ange, long zoome, short gride);
|
||||
void drawline16(long x1, long y1, long x2, long y2, char col);
|
||||
void drawcircle16(long x1, long y1, long r, char col);
|
||||
void draw2dgrid(int posxe, int posye, short ange, int zoome, short gride);
|
||||
void draw2dscreen(int posxe, int posye, short ange, int zoome, short gride);
|
||||
void drawline16(int x1, int y1, int x2, int y2, char col);
|
||||
void drawcircle16(int x1, int y1, int r, char col);
|
||||
|
||||
int setrendermode(int renderer);
|
||||
int getrendermode(void);
|
||||
|
||||
void setrollangle(long rolla);
|
||||
void setrollangle(int rolla);
|
||||
|
||||
// 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
|
||||
|
@ -486,42 +486,42 @@ void setrollangle(long rolla);
|
|||
// bit 6: 33% translucence, using clamping
|
||||
// bit 7: 67% translucence, using clamping
|
||||
// clamping is for sprites, repeating is for walls
|
||||
void invalidatetile(short tilenume, long pal, long how);
|
||||
void invalidatetile(short tilenume, int pal, int how);
|
||||
|
||||
long animateoffs(short tilenum, short fakevar);
|
||||
int animateoffs(short tilenum, short fakevar);
|
||||
|
||||
void setpolymost2dview(void); // sets up GL for 2D drawing
|
||||
|
||||
long polymost_drawtilescreen(long tilex, long tiley, long wallnum, long dimen, int tilezoom);
|
||||
int polymost_drawtilescreen(int tilex, int tiley, int wallnum, int dimen, int tilezoom);
|
||||
void polymost_glreset(void);
|
||||
void polymost_precache(long dapicnum, long dapalnum, long datype);
|
||||
void polymost_precache(int dapicnum, int dapalnum, int datype);
|
||||
|
||||
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||
extern long glanisotropy;
|
||||
extern long glusetexcompr;
|
||||
extern long gltexfiltermode;
|
||||
extern long glredbluemode;
|
||||
extern long glusetexcache, glusetexcachecompression;
|
||||
extern long glmultisample, glnvmultisamplehint;
|
||||
extern long glwidescreen, glprojectionhacks;
|
||||
extern int glanisotropy;
|
||||
extern int glusetexcompr;
|
||||
extern int gltexfiltermode;
|
||||
extern int glredbluemode;
|
||||
extern int glusetexcache, glusetexcachecompression;
|
||||
extern int glmultisample, glnvmultisamplehint;
|
||||
extern int glwidescreen, glprojectionhacks;
|
||||
void gltexapplyprops (void);
|
||||
|
||||
extern long r_depthpeeling, r_peelscount;
|
||||
extern long r_detailmapping;
|
||||
extern long r_glowmapping;
|
||||
extern long r_vertexarrays;
|
||||
extern long r_vbos;
|
||||
extern long r_vbocount;
|
||||
extern long r_animsmoothing;
|
||||
extern int r_depthpeeling, r_peelscount;
|
||||
extern int r_detailmapping;
|
||||
extern int r_glowmapping;
|
||||
extern int r_vertexarrays;
|
||||
extern int r_vbos;
|
||||
extern int r_vbocount;
|
||||
extern int r_animsmoothing;
|
||||
#endif
|
||||
|
||||
void hicinit(void);
|
||||
// effect bitset: 1 = greyscale, 2 = invert
|
||||
void hicsetpalettetint(long palnum, unsigned char r, unsigned char g, unsigned char b, unsigned char effect);
|
||||
void hicsetpalettetint(int palnum, unsigned char r, unsigned char g, unsigned char b, unsigned char effect);
|
||||
// flags bitset: 1 = don't compress
|
||||
int hicsetsubsttex(long picnum, long palnum, char *filen, float alphacut, float xscale, float yscale, char flags);
|
||||
int hicsetskybox(long picnum, long palnum, char *faces[6]);
|
||||
int hicclearsubst(long picnum, long palnum);
|
||||
int hicsetsubsttex(int picnum, int palnum, char *filen, float alphacut, float xscale, float yscale, char flags);
|
||||
int hicsetskybox(int picnum, int palnum, char *faces[6]);
|
||||
int hicclearsubst(int picnum, int palnum);
|
||||
|
||||
int md_loadmodel(const char *fn);
|
||||
int md_setmisc(int modelid, float scale, int shadeoff, float zadd);
|
||||
|
@ -535,8 +535,8 @@ int md_undefinemodel(int modelid);
|
|||
|
||||
int loaddefinitionsfile(char *fn);
|
||||
|
||||
extern long mapversion; // if loadboard() fails with -2 return, try loadoldboard(). if it fails with -2, board is dodgy
|
||||
long loadoldboard(char *filename, char fromwhere, long *daposx, long *daposy, long *daposz, short *daang, short *dacursectnum);
|
||||
extern int mapversion; // if loadboard() fails with -2 return, try loadoldboard(). if it fails with -2, board is dodgy
|
||||
int loadoldboard(char *filename, char fromwhere, int *daposx, int *daposy, int *daposz, short *daang, short *dacursectnum);
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma pack()
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
void initcache(long dacachestart, long dacachesize);
|
||||
void allocache(long *newhandle, long newbytes, char *newlockptr);
|
||||
void suckcache(long *suckptr);
|
||||
void initcache(int dacachestart, int dacachesize);
|
||||
void allocache(int *newhandle, int newbytes, char *newlockptr);
|
||||
void suckcache(int *suckptr);
|
||||
void agecache(void);
|
||||
|
||||
extern int pathsearchmode; // 0 = gamefs mode (default), 1 = localfs mode (editor's mode)
|
||||
|
@ -18,15 +18,15 @@ int findfrompath(const char *fn, char **where);
|
|||
int openfrompath(const char *fn, int flags, int mode);
|
||||
BFILE *fopenfrompath(const char *fn, const char *mode);
|
||||
|
||||
long initgroupfile(char *filename);
|
||||
void uninitsinglegroupfile(long grphandle);
|
||||
int initgroupfile(char *filename);
|
||||
void uninitsinglegroupfile(int grphandle);
|
||||
void uninitgroupfile(void);
|
||||
long kopen4load(char *filename, char searchfirst); // searchfirst: 0 = anywhere, 1 = first group, 2 = any group
|
||||
long kread(long handle, void *buffer, long leng);
|
||||
long klseek(long handle, long offset, long whence);
|
||||
long kfilelength(long handle);
|
||||
long ktell(long handle);
|
||||
void kclose(long handle);
|
||||
int kopen4load(char *filename, char searchfirst); // searchfirst: 0 = anywhere, 1 = first group, 2 = any group
|
||||
int kread(int handle, void *buffer, int leng);
|
||||
int klseek(int handle, int offset, int whence);
|
||||
int kfilelength(int handle);
|
||||
int ktell(int handle);
|
||||
void kclose(int handle);
|
||||
|
||||
enum {
|
||||
CACHE1D_FIND_FILE = 1,
|
||||
|
@ -50,9 +50,9 @@ typedef struct _CACHE1D_FIND_REC {
|
|||
void klistfree(CACHE1D_FIND_REC *rec);
|
||||
CACHE1D_FIND_REC *klistpath(const char *path, const char *mask, int type);
|
||||
|
||||
int kdfread(void *buffer, bsize_t dasizeof, bsize_t count, long fil);
|
||||
int kdfread(void *buffer, bsize_t dasizeof, bsize_t count, int fil);
|
||||
int dfread(void *buffer, bsize_t dasizeof, bsize_t count, BFILE *fil);
|
||||
void kdfwrite(void *buffer, bsize_t dasizeof, bsize_t count, long fil);
|
||||
void kdfwrite(void *buffer, bsize_t dasizeof, bsize_t count, int fil);
|
||||
void dfwrite(void *buffer, bsize_t dasizeof, bsize_t count, BFILE *fil);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
# define longlong(x) x##i64
|
||||
#else
|
||||
# define longlong(x) x##ll
|
||||
typedef long long int64;
|
||||
typedef long long int int64;
|
||||
typedef unsigned long long uint64;
|
||||
#endif
|
||||
|
||||
|
@ -178,7 +178,7 @@ extern "C" {
|
|||
# endif
|
||||
#elif defined B_ENDIAN_C_INLINE
|
||||
static inline unsigned short B_SWAP16(unsigned short s) { return (s>>8)|(s<<8); }
|
||||
static inline unsigned long B_SWAP32(unsigned long l) { return ((l>>8)&0xff00)|((l&0xff00)<<8)|(l<<24)|(l>>24); }
|
||||
static inline unsigned int B_SWAP32(unsigned int l) { return ((l>>8)&0xff00)|((l&0xff00)<<8)|(l<<24)|(l>>24); }
|
||||
static inline uint64 B_SWAP64(uint64 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
|
||||
|
||||
|
@ -298,8 +298,8 @@ int Bclosedir(BDIR *dir);
|
|||
# define bssize_t ssize_t
|
||||
#else
|
||||
typedef void BFILE;
|
||||
typedef unsigned long bsize_t;
|
||||
typedef signed long bssize_t;
|
||||
typedef unsigned int bsize_t;
|
||||
typedef signed int bssize_t;
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -415,9 +415,9 @@ bsize_t Bstrlen(const char *s);
|
|||
char *Bstrchr(const char *s, int c);
|
||||
char *Bstrrchr(const char *s, int c);
|
||||
int Batoi(const char *nptr);
|
||||
long Batol(const char *nptr);
|
||||
long int Bstrtol(const char *nptr, char **endptr, int base);
|
||||
unsigned long int Bstrtoul(const char *nptr, char **endptr, int base);
|
||||
int Batol(const char *nptr);
|
||||
int int Bstrtol(const char *nptr, char **endptr, int base);
|
||||
unsigned int int Bstrtoul(const char *nptr, char **endptr, int 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, int c, bsize_t n);
|
||||
|
@ -437,9 +437,9 @@ unsigned int Bgetsysmemsize(void);
|
|||
int Bcorrectfilename(char *filename, int removefn);
|
||||
int Bcanonicalisefilename(char *filename, int removefn);
|
||||
char *Bgetsystemdrives(void);
|
||||
long Bfilelength(int fd);
|
||||
int Bfilelength(int fd);
|
||||
char *Bstrtoken(char *s, char *delim, char **ptrptr, int chop);
|
||||
long Bwildmatch (const char *i, const char *j);
|
||||
int Bwildmatch (const char *i, const char *j);
|
||||
|
||||
#if !defined(_WIN32)
|
||||
char *Bstrlwr(char *);
|
||||
|
|
|
@ -7,11 +7,11 @@ extern "C" {
|
|||
|
||||
void initcrc32table(void);
|
||||
|
||||
unsigned long crc32once(unsigned char *blk, unsigned long len);
|
||||
unsigned int crc32once(unsigned char *blk, unsigned int len);
|
||||
|
||||
void crc32init(unsigned long *crcvar);
|
||||
void crc32block(unsigned long *crcvar, unsigned char *blk, unsigned long len);
|
||||
unsigned long crc32finish(unsigned long *crcvar);
|
||||
void crc32init(unsigned int *crcvar);
|
||||
void crc32block(unsigned int *crcvar, unsigned char *blk, unsigned int len);
|
||||
unsigned int crc32finish(unsigned int *crcvar);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -11,9 +11,9 @@ extern "C" {
|
|||
|
||||
#define NUMBUILDKEYS 20
|
||||
|
||||
extern long qsetmode;
|
||||
extern int qsetmode;
|
||||
extern short searchsector, searchwall, searchstat;
|
||||
extern long zmode, kensplayerheight;
|
||||
extern int zmode, kensplayerheight;
|
||||
extern short defaultspritecstat;
|
||||
|
||||
extern short temppicnum, tempcstat, templotag, temphitag, tempextra;
|
||||
|
@ -22,7 +22,7 @@ extern unsigned char somethingintab;
|
|||
|
||||
extern unsigned char buildkeys[NUMBUILDKEYS];
|
||||
|
||||
extern long ydim16, xdimgame, ydimgame, bppgame, xdim2d, ydim2d, forcesetup;
|
||||
extern int ydim16, xdimgame, ydimgame, bppgame, xdim2d, ydim2d, forcesetup;
|
||||
|
||||
|
||||
extern int ExtInit(void);
|
||||
|
@ -55,13 +55,13 @@ int writesetup(const char *fn); // from config.c
|
|||
void editinput(void);
|
||||
void clearmidstatbar16(void);
|
||||
|
||||
long getnumber256(char namestart[80], long num, long maxnumber, char sign);
|
||||
long getnumber16(char namestart[80], long num, long maxnumber, char sign);
|
||||
int getnumber256(char namestart[80], int num, int maxnumber, char sign);
|
||||
int getnumber16(char namestart[80], int num, int maxnumber, char sign);
|
||||
void printmessage256(char name[82]);
|
||||
void printmessage16(char name[82]);
|
||||
|
||||
void getpoint(long searchxe, long searchye, long *x, long *y);
|
||||
long getpointhighlight(long xplc, long yplc);
|
||||
void getpoint(int searchxe, int searchye, int *x, int *y);
|
||||
int getpointhighlight(int xplc, int yplc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
//High-level (easy) picture loading function:
|
||||
extern void kpzload (const char *, long *, long *, long *, long *);
|
||||
extern void kpzload (const char *, int *, int *, int *, int *);
|
||||
//Low-level PNG/JPG functions:
|
||||
extern void kpgetdim (const char *, long, long *, long *);
|
||||
extern long kprender (const char *, long, long, long, long, long, long, long);
|
||||
extern void kpgetdim (const char *, int, int *, int *);
|
||||
extern int kprender (const char *, int, int, int, int, int, int, int);
|
||||
|
||||
//ZIP functions:
|
||||
extern long kzaddstack (const char *);
|
||||
extern int kzaddstack (const char *);
|
||||
extern void kzuninit ();
|
||||
extern long kzopen (const char *);
|
||||
extern long kzread (void *, long);
|
||||
extern long kzfilelength ();
|
||||
extern long kzseek (long, long);
|
||||
extern long kztell ();
|
||||
extern long kzgetc ();
|
||||
extern long kzeof ();
|
||||
extern int kzopen (const char *);
|
||||
extern int kzread (void *, int);
|
||||
extern int kzfilelength ();
|
||||
extern int kzseek (int, int);
|
||||
extern int kztell ();
|
||||
extern int kzgetc ();
|
||||
extern int kzeof ();
|
||||
extern void kzclose ();
|
||||
|
||||
extern void kzfindfilestart (const char *); //pass wildcard string
|
||||
extern long kzfindfile (char *); //you alloc buf, returns 1:found,0:~found
|
||||
extern int kzfindfile (char *); //you alloc buf, returns 1:found,0:~found
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
long lzwcompress (unsigned char *ucompbuf, long ucompleng, unsigned char *compbuf);
|
||||
long lzwuncompress (unsigned char *compbuf, long compleng, unsigned char *ucompbuf, long ucompleng);
|
||||
int lzwcompress (unsigned char *ucompbuf, int ucompleng, unsigned char *compbuf);
|
||||
int lzwuncompress (unsigned char *compbuf, int compleng, unsigned char *ucompbuf, int ucompleng);
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
|
||||
/* MD4 context. */
|
||||
typedef struct {
|
||||
unsigned long state[4]; /* state (ABCD) */
|
||||
unsigned long count[2]; /* number of bits, modulo 2^64 (lsb first) */
|
||||
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;
|
||||
|
||||
|
|
|
@ -5,30 +5,30 @@
|
|||
|
||||
#define MAXMULTIPLAYERS 16
|
||||
|
||||
extern long myconnectindex, numplayers;
|
||||
extern long connecthead, connectpoint2[MAXMULTIPLAYERS];
|
||||
extern int myconnectindex, numplayers;
|
||||
extern int connecthead, connectpoint2[MAXMULTIPLAYERS];
|
||||
extern char syncstate;
|
||||
extern int natfree; //Addfaz NatFree
|
||||
|
||||
long initmultiplayersparms(long argc, char **argv);
|
||||
long initmultiplayerscycle(void);
|
||||
int initmultiplayersparms(int argc, char **argv);
|
||||
int initmultiplayerscycle(void);
|
||||
|
||||
void initmultiplayers(long argc, char **argv, char damultioption, char dacomrateoption, char dapriority);
|
||||
void setpackettimeout(long datimeoutcount, long daresendagaincount);
|
||||
void initmultiplayers(int argc, char **argv, char damultioption, char dacomrateoption, char dapriority);
|
||||
void setpackettimeout(int datimeoutcount, int daresendagaincount);
|
||||
void uninitmultiplayers(void);
|
||||
void sendlogon(void);
|
||||
void sendlogoff(void);
|
||||
long getoutputcirclesize(void);
|
||||
int getoutputcirclesize(void);
|
||||
void setsocket(short newsocket);
|
||||
void sendpacket(long other, char *bufptr, long messleng);
|
||||
long getpacket(long *other, char *bufptr);
|
||||
void sendpacket(int other, char *bufptr, int messleng);
|
||||
int getpacket(int *other, char *bufptr);
|
||||
void flushpackets(void);
|
||||
void genericmultifunction(long other, char *bufptr, long messleng, long command);
|
||||
long isvalidipaddress(char *st);
|
||||
void genericmultifunction(int other, char *bufptr, int messleng, int command);
|
||||
int isvalidipaddress(char *st);
|
||||
|
||||
void nfIncCP(void); //Addfaz NatFree
|
||||
int nfCheckHF (long other); //Addfaz NatFree
|
||||
int nfCheckCP(long other); //Addfaz NatFree
|
||||
int nfCheckHF (int other); //Addfaz NatFree
|
||||
int nfCheckCP(int other); //Addfaz NatFree
|
||||
|
||||
#endif // __mmulti_h__
|
||||
|
||||
|
|
|
@ -88,10 +88,10 @@ extern int updatesectors;
|
|||
int polymer_init(void);
|
||||
void polymer_glinit(void);
|
||||
void polymer_loadboard(void);
|
||||
void polymer_drawrooms(long daposx, long daposy, long daposz, short daang, long dahoriz, short dacursectnum, int root);
|
||||
void polymer_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);
|
||||
void polymer_drawmaskwall(long damaskwallcnt);
|
||||
void polymer_drawsprite(long snum);
|
||||
void polymer_drawrooms(int daposx, int daposy, int daposz, short daang, int dahoriz, short dacursectnum, int root);
|
||||
void polymer_rotatesprite(int sx, int sy, int z, short a, short picnum, signed char dashade, char dapalnum, char dastat, int cx1, int cy1, int cx2, int cy2);
|
||||
void polymer_drawmaskwall(int damaskwallcnt);
|
||||
void polymer_drawsprite(int snum);
|
||||
// SECTORS
|
||||
int polymer_initsector(short sectnum);
|
||||
int polymer_updatesector(short sectnum);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# include "glbuild.h"
|
||||
|
||||
struct hicskybox_t {
|
||||
long ignore;
|
||||
int ignore;
|
||||
char *face[6];
|
||||
};
|
||||
|
||||
|
@ -32,7 +32,7 @@ typedef struct pthtyp_t
|
|||
struct pthtyp_t *ofb; // only fullbright
|
||||
} pthtyp;
|
||||
|
||||
pthtyp * gltexcache (long dapicnum, long dapalnum, long dameth);
|
||||
pthtyp * gltexcache (int dapicnum, int dapalnum, int dameth);
|
||||
|
||||
extern palette_t hictinting[MAXPALOOKUPS];
|
||||
extern float gtang;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -6,7 +6,7 @@ typedef struct {
|
|||
char *eof;
|
||||
char *filename;
|
||||
int linenum;
|
||||
long *lineoffs;
|
||||
int *lineoffs;
|
||||
} scriptfile;
|
||||
|
||||
char *scriptfile_gettoken(scriptfile *sf);
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
typedef struct {
|
||||
unsigned long samplerate; // sample rate of the sound
|
||||
unsigned int samplerate; // sample rate of the sound
|
||||
unsigned short channels; // number of channels
|
||||
unsigned short bitspersample; // bits per sample
|
||||
unsigned short format; // 0 = pcm
|
||||
unsigned long soundlength; // bytes required for sound storage
|
||||
unsigned int soundlength; // bytes required for sound storage
|
||||
} SoundInfo;
|
||||
|
||||
|
||||
|
|
|
@ -1,159 +1,159 @@
|
|||
#ifdef USE_C_FUNCTION_PRAGMAS
|
||||
long sqr(long a);
|
||||
long scale(long a, long d, long c);
|
||||
long mulscale(long a, long d, long c);
|
||||
long mulscale1(long a, long d);
|
||||
long mulscale2(long a, long d);
|
||||
long mulscale3(long a, long d);
|
||||
long mulscale4(long a, long d);
|
||||
long mulscale5(long a, long d);
|
||||
long mulscale6(long a, long d);
|
||||
long mulscale7(long a, long d);
|
||||
long mulscale8(long a, long d);
|
||||
long mulscale9(long a, long d);
|
||||
long mulscale10(long a, long d);
|
||||
long mulscale11(long a, long d);
|
||||
long mulscale12(long a, long d);
|
||||
long mulscale13(long a, long d);
|
||||
long mulscale14(long a, long d);
|
||||
long mulscale15(long a, long d);
|
||||
long mulscale16(long a, long d);
|
||||
long mulscale17(long a, long d);
|
||||
long mulscale18(long a, long d);
|
||||
long mulscale19(long a, long d);
|
||||
long mulscale20(long a, long d);
|
||||
long mulscale21(long a, long d);
|
||||
long mulscale22(long a, long d);
|
||||
long mulscale23(long a, long d);
|
||||
long mulscale24(long a, long d);
|
||||
long mulscale25(long a, long d);
|
||||
long mulscale26(long a, long d);
|
||||
long mulscale27(long a, long d);
|
||||
long mulscale28(long a, long d);
|
||||
long mulscale29(long a, long d);
|
||||
long mulscale30(long a, long d);
|
||||
long mulscale31(long a, long d);
|
||||
long mulscale32(long a, long d);
|
||||
long dmulscale(long a, long d, long S, long D, long c);
|
||||
long dmulscale1(long a, long d, long S, long D);
|
||||
long dmulscale2(long a, long d, long S, long D);
|
||||
long dmulscale3(long a, long d, long S, long D);
|
||||
long dmulscale4(long a, long d, long S, long D);
|
||||
long dmulscale5(long a, long d, long S, long D);
|
||||
long dmulscale6(long a, long d, long S, long D);
|
||||
long dmulscale7(long a, long d, long S, long D);
|
||||
long dmulscale8(long a, long d, long S, long D);
|
||||
long dmulscale9(long a, long d, long S, long D);
|
||||
long dmulscale10(long a, long d, long S, long D);
|
||||
long dmulscale11(long a, long d, long S, long D);
|
||||
long dmulscale12(long a, long d, long S, long D);
|
||||
long dmulscale13(long a, long d, long S, long D);
|
||||
long dmulscale14(long a, long d, long S, long D);
|
||||
long dmulscale15(long a, long d, long S, long D);
|
||||
long dmulscale16(long a, long d, long S, long D);
|
||||
long dmulscale17(long a, long d, long S, long D);
|
||||
long dmulscale18(long a, long d, long S, long D);
|
||||
long dmulscale19(long a, long d, long S, long D);
|
||||
long dmulscale20(long a, long d, long S, long D);
|
||||
long dmulscale21(long a, long d, long S, long D);
|
||||
long dmulscale22(long a, long d, long S, long D);
|
||||
long dmulscale23(long a, long d, long S, long D);
|
||||
long dmulscale24(long a, long d, long S, long D);
|
||||
long dmulscale25(long a, long d, long S, long D);
|
||||
long dmulscale26(long a, long d, long S, long D);
|
||||
long dmulscale27(long a, long d, long S, long D);
|
||||
long dmulscale28(long a, long d, long S, long D);
|
||||
long dmulscale29(long a, long d, long S, long D);
|
||||
long dmulscale30(long a, long d, long S, long D);
|
||||
long dmulscale31(long a, long d, long S, long D);
|
||||
long dmulscale32(long a, long d, long S, long D);
|
||||
long tmulscale1(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale2(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale3(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale4(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale5(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale6(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale7(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale8(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale9(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale10(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale11(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale12(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale13(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale14(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale15(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale16(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale17(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale18(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale19(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale20(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale21(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale22(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale23(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale24(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale25(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale26(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale27(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale28(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale29(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale30(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale31(long a, long d, long b, long c, long S, long D);
|
||||
long tmulscale32(long a, long d, long b, long c, long S, long D);
|
||||
long divscale(long a, long b, long c);
|
||||
long divscale1(long a, long b);
|
||||
long divscale2(long a, long b);
|
||||
long divscale3(long a, long b);
|
||||
long divscale4(long a, long b);
|
||||
long divscale5(long a, long b);
|
||||
long divscale6(long a, long b);
|
||||
long divscale7(long a, long b);
|
||||
long divscale8(long a, long b);
|
||||
long divscale9(long a, long b);
|
||||
long divscale10(long a, long b);
|
||||
long divscale11(long a, long b);
|
||||
long divscale12(long a, long b);
|
||||
long divscale13(long a, long b);
|
||||
long divscale14(long a, long b);
|
||||
long divscale15(long a, long b);
|
||||
long divscale16(long a, long b);
|
||||
long divscale17(long a, long b);
|
||||
long divscale18(long a, long b);
|
||||
long divscale19(long a, long b);
|
||||
long divscale20(long a, long b);
|
||||
long divscale21(long a, long b);
|
||||
long divscale22(long a, long b);
|
||||
long divscale23(long a, long b);
|
||||
long divscale24(long a, long b);
|
||||
long divscale25(long a, long b);
|
||||
long divscale26(long a, long b);
|
||||
long divscale27(long a, long b);
|
||||
long divscale28(long a, long b);
|
||||
long divscale29(long a, long b);
|
||||
long divscale30(long a, long b);
|
||||
long divscale31(long a, long b);
|
||||
long divscale32(long d, long b);
|
||||
long readpixel(void *D);
|
||||
void drawpixel(void *D, long a);
|
||||
void drawpixels(void *D, long a);
|
||||
void drawpixelses(void *D, long a);
|
||||
void clearbuf(void* D, long c, long a);
|
||||
void copybuf(void *S, void *D, long c);
|
||||
long mul3(long a);
|
||||
long mul5(long a);
|
||||
long mul9(long a);
|
||||
long divmod(long a, long b);
|
||||
long moddiv(long a, long b);
|
||||
long klabs(long a);
|
||||
long ksgn(long b);
|
||||
long umin(long a, long b);
|
||||
long umax(long a, long b);
|
||||
long kmin(long a, long b);
|
||||
long kmax(long a, long b);
|
||||
int sqr(int a);
|
||||
int scale(int a, int d, int c);
|
||||
int mulscale(int a, int d, int c);
|
||||
int mulscale1(int a, int d);
|
||||
int mulscale2(int a, int d);
|
||||
int mulscale3(int a, int d);
|
||||
int mulscale4(int a, int d);
|
||||
int mulscale5(int a, int d);
|
||||
int mulscale6(int a, int d);
|
||||
int mulscale7(int a, int d);
|
||||
int mulscale8(int a, int d);
|
||||
int mulscale9(int a, int d);
|
||||
int mulscale10(int a, int d);
|
||||
int mulscale11(int a, int d);
|
||||
int mulscale12(int a, int d);
|
||||
int mulscale13(int a, int d);
|
||||
int mulscale14(int a, int d);
|
||||
int mulscale15(int a, int d);
|
||||
int mulscale16(int a, int d);
|
||||
int mulscale17(int a, int d);
|
||||
int mulscale18(int a, int d);
|
||||
int mulscale19(int a, int d);
|
||||
int mulscale20(int a, int d);
|
||||
int mulscale21(int a, int d);
|
||||
int mulscale22(int a, int d);
|
||||
int mulscale23(int a, int d);
|
||||
int mulscale24(int a, int d);
|
||||
int mulscale25(int a, int d);
|
||||
int mulscale26(int a, int d);
|
||||
int mulscale27(int a, int d);
|
||||
int mulscale28(int a, int d);
|
||||
int mulscale29(int a, int d);
|
||||
int mulscale30(int a, int d);
|
||||
int mulscale31(int a, int d);
|
||||
int mulscale32(int a, int d);
|
||||
int dmulscale(int a, int d, int S, int D, int c);
|
||||
int dmulscale1(int a, int d, int S, int D);
|
||||
int dmulscale2(int a, int d, int S, int D);
|
||||
int dmulscale3(int a, int d, int S, int D);
|
||||
int dmulscale4(int a, int d, int S, int D);
|
||||
int dmulscale5(int a, int d, int S, int D);
|
||||
int dmulscale6(int a, int d, int S, int D);
|
||||
int dmulscale7(int a, int d, int S, int D);
|
||||
int dmulscale8(int a, int d, int S, int D);
|
||||
int dmulscale9(int a, int d, int S, int D);
|
||||
int dmulscale10(int a, int d, int S, int D);
|
||||
int dmulscale11(int a, int d, int S, int D);
|
||||
int dmulscale12(int a, int d, int S, int D);
|
||||
int dmulscale13(int a, int d, int S, int D);
|
||||
int dmulscale14(int a, int d, int S, int D);
|
||||
int dmulscale15(int a, int d, int S, int D);
|
||||
int dmulscale16(int a, int d, int S, int D);
|
||||
int dmulscale17(int a, int d, int S, int D);
|
||||
int dmulscale18(int a, int d, int S, int D);
|
||||
int dmulscale19(int a, int d, int S, int D);
|
||||
int dmulscale20(int a, int d, int S, int D);
|
||||
int dmulscale21(int a, int d, int S, int D);
|
||||
int dmulscale22(int a, int d, int S, int D);
|
||||
int dmulscale23(int a, int d, int S, int D);
|
||||
int dmulscale24(int a, int d, int S, int D);
|
||||
int dmulscale25(int a, int d, int S, int D);
|
||||
int dmulscale26(int a, int d, int S, int D);
|
||||
int dmulscale27(int a, int d, int S, int D);
|
||||
int dmulscale28(int a, int d, int S, int D);
|
||||
int dmulscale29(int a, int d, int S, int D);
|
||||
int dmulscale30(int a, int d, int S, int D);
|
||||
int dmulscale31(int a, int d, int S, int D);
|
||||
int dmulscale32(int a, int d, int S, int D);
|
||||
int tmulscale1(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale2(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale3(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale4(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale5(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale6(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale7(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale8(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale9(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale10(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale11(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale12(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale13(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale14(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale15(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale16(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale17(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale18(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale19(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale20(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale21(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale22(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale23(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale24(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale25(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale26(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale27(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale28(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale29(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale30(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale31(int a, int d, int b, int c, int S, int D);
|
||||
int tmulscale32(int a, int d, int b, int c, int S, int D);
|
||||
int divscale(int a, int b, int c);
|
||||
int divscale1(int a, int b);
|
||||
int divscale2(int a, int b);
|
||||
int divscale3(int a, int b);
|
||||
int divscale4(int a, int b);
|
||||
int divscale5(int a, int b);
|
||||
int divscale6(int a, int b);
|
||||
int divscale7(int a, int b);
|
||||
int divscale8(int a, int b);
|
||||
int divscale9(int a, int b);
|
||||
int divscale10(int a, int b);
|
||||
int divscale11(int a, int b);
|
||||
int divscale12(int a, int b);
|
||||
int divscale13(int a, int b);
|
||||
int divscale14(int a, int b);
|
||||
int divscale15(int a, int b);
|
||||
int divscale16(int a, int b);
|
||||
int divscale17(int a, int b);
|
||||
int divscale18(int a, int b);
|
||||
int divscale19(int a, int b);
|
||||
int divscale20(int a, int b);
|
||||
int divscale21(int a, int b);
|
||||
int divscale22(int a, int b);
|
||||
int divscale23(int a, int b);
|
||||
int divscale24(int a, int b);
|
||||
int divscale25(int a, int b);
|
||||
int divscale26(int a, int b);
|
||||
int divscale27(int a, int b);
|
||||
int divscale28(int a, int b);
|
||||
int divscale29(int a, int b);
|
||||
int divscale30(int a, int b);
|
||||
int divscale31(int a, int b);
|
||||
int divscale32(int d, int b);
|
||||
int readpixel(void *D);
|
||||
void drawpixel(void *D, int a);
|
||||
void drawpixels(void *D, int a);
|
||||
void drawpixelses(void *D, int a);
|
||||
void clearbuf(void* D, int c, int a);
|
||||
void copybuf(void *S, void *D, int c);
|
||||
int mul3(int a);
|
||||
int mul5(int a);
|
||||
int mul9(int a);
|
||||
int divmod(int a, int b);
|
||||
int moddiv(int a, int b);
|
||||
int klabs(int a);
|
||||
int ksgn(int b);
|
||||
int umin(int a, int b);
|
||||
int umax(int a, int b);
|
||||
int kmin(int a, int b);
|
||||
int kmax(int a, int b);
|
||||
void swapchar(void *a, void *b);
|
||||
void swapshort(void *a, void *b);
|
||||
void swaplong(void *a, void *b);
|
||||
void swapbuf4(void *a, void *b, long c);
|
||||
void swapbuf4(void *a, void *b, int c);
|
||||
void swap64bit(void *a, void *b);
|
||||
void swapchar2(void *a, void *b, long S);
|
||||
void swapchar2(void *a, void *b, int S);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@ extern unsigned maxrefreshfreq;
|
|||
|
||||
extern int glusecds;
|
||||
|
||||
long win_gethwnd(void);
|
||||
long win_gethinstance(void);
|
||||
int win_gethwnd(void);
|
||||
int win_gethinstance(void);
|
||||
|
||||
void win_allowtaskswitching(int onf);
|
||||
int win_checkinstance(void);
|
||||
|
|
|
@ -10,31 +10,31 @@
|
|||
|
||||
#ifdef ENGINE_USING_A_C
|
||||
|
||||
long krecip(long num); // from engine.c
|
||||
int krecip(int num); // from engine.c
|
||||
|
||||
#define BITSOFPRECISION 3
|
||||
#define BITSOFPRECISIONPOW 8
|
||||
|
||||
extern long asm1, asm2, asm3, asm4, fpuasm, globalx3, globaly3;
|
||||
extern int asm1, asm2, asm3, asm4, fpuasm, globalx3, globaly3;
|
||||
extern void *reciptable;
|
||||
|
||||
static long bpl, transmode = 0;
|
||||
static long glogx, glogy, gbxinc, gbyinc, gpinc;
|
||||
static int bpl, transmode = 0;
|
||||
static int glogx, glogy, gbxinc, gbyinc, gpinc;
|
||||
static char *gbuf, *gpal, *ghlinepal, *gtrans;
|
||||
|
||||
//Global variable functions
|
||||
void setvlinebpl(long dabpl) { bpl = dabpl; }
|
||||
void fixtransluscence(long datransoff) { gtrans = (char *)datransoff; }
|
||||
void setvlinebpl(int dabpl) { bpl = dabpl; }
|
||||
void fixtransluscence(int datransoff) { gtrans = (char *)datransoff; }
|
||||
void settransnormal(void) { transmode = 0; }
|
||||
void settransreverse(void) { transmode = 1; }
|
||||
|
||||
|
||||
//Ceiling/floor horizontal line functions
|
||||
void sethlinesizes(long logx, long logy, long bufplc)
|
||||
void sethlinesizes(int logx, int logy, int bufplc)
|
||||
{ glogx = logx; glogy = logy; gbuf = (char *)bufplc; }
|
||||
void setpalookupaddress(char *paladdr) { ghlinepal = paladdr; }
|
||||
void setuphlineasm4(long bxinc, long byinc) { gbxinc = bxinc; gbyinc = byinc; }
|
||||
void hlineasm4(long cnt, long skiploadincs, long paloffs, unsigned long by, unsigned long bx, long p)
|
||||
void setuphlineasm4(int bxinc, int byinc) { gbxinc = bxinc; gbyinc = byinc; }
|
||||
void hlineasm4(int cnt, int skiploadincs, int paloffs, unsigned int by, unsigned int bx, int p)
|
||||
{
|
||||
char *palptr;
|
||||
|
||||
|
@ -51,18 +51,18 @@ void hlineasm4(long cnt, long skiploadincs, long paloffs, unsigned long by, unsi
|
|||
|
||||
|
||||
//Sloped ceiling/floor vertical line functions
|
||||
void setupslopevlin(long logylogx, long bufplc, long pinc)
|
||||
void setupslopevlin(int logylogx, int bufplc, int pinc)
|
||||
{
|
||||
glogx = (logylogx&255); glogy = (logylogx>>8);
|
||||
gbuf = (char *)bufplc; gpinc = pinc;
|
||||
}
|
||||
void slopevlin(long p, long i, long slopaloffs, long cnt, long bx, long by)
|
||||
void slopevlin(int p, int i, int slopaloffs, int cnt, int bx, int by)
|
||||
{
|
||||
long *slopalptr, bz, bzinc;
|
||||
unsigned long u, v;
|
||||
int *slopalptr, bz, bzinc;
|
||||
unsigned int u, v;
|
||||
|
||||
bz = asm3; bzinc = (asm1>>3);
|
||||
slopalptr = (long *)slopaloffs;
|
||||
slopalptr = (int *)slopaloffs;
|
||||
for (;cnt>0;cnt--)
|
||||
{
|
||||
i = krecip(bz>>6); bz += bzinc;
|
||||
|
@ -76,8 +76,8 @@ void slopevlin(long p, long i, long slopaloffs, long cnt, long bx, long by)
|
|||
|
||||
|
||||
//Wall,face sprite/wall sprite vertical line functions
|
||||
void setupvlineasm(long neglogy) { glogy = neglogy; }
|
||||
void vlineasm1(long vinc, long paloffs, long cnt, unsigned long vplc, long bufplc, long p)
|
||||
void setupvlineasm(int neglogy) { glogy = neglogy; }
|
||||
void vlineasm1(int vinc, int paloffs, int cnt, unsigned int vplc, int bufplc, int p)
|
||||
{
|
||||
gbuf = (char *)bufplc;
|
||||
gpal = (char *)paloffs;
|
||||
|
@ -89,8 +89,8 @@ void vlineasm1(long vinc, long paloffs, long cnt, unsigned long vplc, long bufpl
|
|||
}
|
||||
}
|
||||
|
||||
void setupmvlineasm(long neglogy) { glogy = neglogy; }
|
||||
void mvlineasm1(long vinc, long paloffs, long cnt, unsigned long vplc, long bufplc, long p)
|
||||
void setupmvlineasm(int neglogy) { glogy = neglogy; }
|
||||
void mvlineasm1(int vinc, int paloffs, int cnt, unsigned int vplc, int bufplc, int p)
|
||||
{
|
||||
char ch;
|
||||
|
||||
|
@ -104,8 +104,8 @@ void mvlineasm1(long vinc, long paloffs, long cnt, unsigned long vplc, long bufp
|
|||
}
|
||||
}
|
||||
|
||||
void setuptvlineasm(long neglogy) { glogy = neglogy; }
|
||||
void tvlineasm1(long vinc, long paloffs, long cnt, unsigned long vplc, long bufplc, long p)
|
||||
void setuptvlineasm(int neglogy) { glogy = neglogy; }
|
||||
void tvlineasm1(int vinc, int paloffs, int cnt, unsigned int vplc, int bufplc, int p)
|
||||
{
|
||||
char ch;
|
||||
|
||||
|
@ -134,8 +134,8 @@ void tvlineasm1(long vinc, long paloffs, long cnt, unsigned long vplc, long bufp
|
|||
}
|
||||
|
||||
//Floor sprite horizontal line functions
|
||||
void msethlineshift(long logx, long logy) { glogx = logx; glogy = logy; }
|
||||
void mhline(long bufplc, unsigned long bx, long cntup16, long junk, unsigned long by, long p)
|
||||
void msethlineshift(int logx, int logy) { glogx = logx; glogy = logy; }
|
||||
void mhline(int bufplc, unsigned int bx, int cntup16, int junk, unsigned int by, int p)
|
||||
{
|
||||
char ch;
|
||||
|
||||
|
@ -151,8 +151,8 @@ void mhline(long bufplc, unsigned long bx, long cntup16, long junk, unsigned lon
|
|||
}
|
||||
}
|
||||
|
||||
void tsethlineshift(long logx, long logy) { glogx = logx; glogy = logy; }
|
||||
void thline(long bufplc, unsigned long bx, long cntup16, long junk, unsigned long by, long p)
|
||||
void tsethlineshift(int logx, int logy) { glogx = logx; glogy = logy; }
|
||||
void thline(int bufplc, unsigned int bx, int cntup16, int junk, unsigned int by, int p)
|
||||
{
|
||||
char ch;
|
||||
|
||||
|
@ -184,14 +184,14 @@ void thline(long bufplc, unsigned long bx, long cntup16, long junk, unsigned lon
|
|||
|
||||
|
||||
//Rotatesprite vertical line functions
|
||||
void setupspritevline(long paloffs, long bxinc, long byinc, long ysiz)
|
||||
void setupspritevline(int paloffs, int bxinc, int byinc, int ysiz)
|
||||
{
|
||||
gpal = (char *)paloffs;
|
||||
gbxinc = bxinc;
|
||||
gbyinc = byinc;
|
||||
glogy = ysiz;
|
||||
}
|
||||
void spritevline(long bx, long by, long cnt, long bufplc, long p)
|
||||
void spritevline(int bx, int by, int cnt, int bufplc, int p)
|
||||
{
|
||||
gbuf = (char *)bufplc;
|
||||
for (;cnt>1;cnt--)
|
||||
|
@ -204,14 +204,14 @@ void spritevline(long bx, long by, long cnt, long bufplc, long p)
|
|||
}
|
||||
|
||||
//Rotatesprite vertical line functions
|
||||
void msetupspritevline(long paloffs, long bxinc, long byinc, long ysiz)
|
||||
void msetupspritevline(int paloffs, int bxinc, int byinc, int ysiz)
|
||||
{
|
||||
gpal = (char *)paloffs;
|
||||
gbxinc = bxinc;
|
||||
gbyinc = byinc;
|
||||
glogy = ysiz;
|
||||
}
|
||||
void mspritevline(long bx, long by, long cnt, long bufplc, long p)
|
||||
void mspritevline(int bx, int by, int cnt, int bufplc, int p)
|
||||
{
|
||||
char ch;
|
||||
|
||||
|
@ -219,21 +219,21 @@ void mspritevline(long bx, long by, long cnt, long bufplc, long p)
|
|||
for (;cnt>1;cnt--)
|
||||
{
|
||||
ch = gbuf[(bx>>16)*glogy+(by>>16)];
|
||||
if (ch != 255) (*(char *)p) = gpal[ch];
|
||||
if (ch != 255)(*(char *)p) = gpal[ch];
|
||||
bx += gbxinc;
|
||||
by += gbyinc;
|
||||
p += bpl;
|
||||
}
|
||||
}
|
||||
|
||||
void tsetupspritevline(long paloffs, long bxinc, long byinc, long ysiz)
|
||||
void tsetupspritevline(int paloffs, int bxinc, int byinc, int ysiz)
|
||||
{
|
||||
gpal = (char *)paloffs;
|
||||
gbxinc = bxinc;
|
||||
gbyinc = byinc;
|
||||
glogy = ysiz;
|
||||
}
|
||||
void tspritevline(long bx, long by, long cnt, long bufplc, long p)
|
||||
void tspritevline(int bx, int by, int cnt, int bufplc, int p)
|
||||
{
|
||||
char ch;
|
||||
|
||||
|
@ -262,28 +262,29 @@ void tspritevline(long bx, long by, long cnt, long bufplc, long p)
|
|||
}
|
||||
}
|
||||
|
||||
void setupdrawslab (long dabpl, long pal)
|
||||
void setupdrawslab(int dabpl, int pal)
|
||||
{ bpl = dabpl; gpal = (char *)pal; }
|
||||
|
||||
void drawslab (long dx, long v, long dy, long vi, long vptr, long p)
|
||||
void drawslab(int dx, int v, int dy, int vi, int vptr, int p)
|
||||
{
|
||||
long x;
|
||||
int x;
|
||||
|
||||
while (dy > 0)
|
||||
{
|
||||
for (x=0;x<dx;x++) *(char *)(p+x) = gpal[(long)(*(char *)((v>>16)+vptr))];
|
||||
for (x=0;x<dx;x++) *(char *)(p+x) = gpal[(int)(*(char *)((v>>16)+vptr))];
|
||||
p += bpl; v += vi; dy--;
|
||||
}
|
||||
}
|
||||
|
||||
void stretchhline (long p0, long u, long cnt, long uinc, long rptr, long p)
|
||||
void stretchhline(int p0, int u, int cnt, int uinc, int rptr, int p)
|
||||
{
|
||||
p0 = p-(cnt<<2);
|
||||
do
|
||||
{
|
||||
p--;
|
||||
*(char *)p = *(char *)((u>>16)+rptr); u -= uinc;
|
||||
} while (p > p0);
|
||||
}
|
||||
while (p > p0);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -8,28 +8,29 @@
|
|||
#endif
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
struct glinfo glinfo = {
|
||||
"Unknown", // vendor
|
||||
"Unknown", // renderer
|
||||
"0.0.0", // version
|
||||
"", // extensions
|
||||
struct glinfo 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
|
||||
};
|
||||
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
|
||||
};
|
||||
#endif
|
||||
|
||||
static void onvideomodechange(int newmode) { }
|
||||
|
@ -40,10 +41,11 @@ static int osdfunc_setrendermode(const osdfuncparm_t *parm)
|
|||
int m;
|
||||
char *p;
|
||||
|
||||
char *modestrs[] = {
|
||||
"classic software", "polygonal flat-shaded software",
|
||||
"polygonal textured software", "polygonal OpenGL", "great justice"
|
||||
};
|
||||
char *modestrs[] =
|
||||
{
|
||||
"classic software", "polygonal flat-shaded software",
|
||||
"polygonal textured software", "polygonal OpenGL", "great justice"
|
||||
};
|
||||
|
||||
if (parm->numparms != 1) return OSDCMD_SHOWHELP;
|
||||
m = Bstrtol(parm->parms[0], &p, 10);
|
||||
|
@ -51,7 +53,7 @@ static int osdfunc_setrendermode(const osdfuncparm_t *parm)
|
|||
if (m < 0 || m > 4) return OSDCMD_SHOWHELP;
|
||||
|
||||
setrendermode(m);
|
||||
OSD_Printf("Rendering method changed to %s\n", modestrs[ getrendermode() ] );
|
||||
OSD_Printf("Rendering method changed to %s\n", modestrs[ getrendermode()]);
|
||||
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
@ -60,7 +62,7 @@ static int osdfunc_setrendermode(const osdfuncparm_t *parm)
|
|||
#ifdef DEBUGGINGAIDS
|
||||
static int osdcmd_hicsetpalettetint(const osdfuncparm_t *parm)
|
||||
{
|
||||
long pal, cols[3], eff;
|
||||
int pal, cols[3], eff;
|
||||
char *p;
|
||||
|
||||
if (parm->numparms != 5) return OSDCMD_SHOWHELP;
|
||||
|
@ -81,7 +83,8 @@ static int osdcmd_glinfo(const osdfuncparm_t *parm)
|
|||
{
|
||||
char *s,*t,*u,i;
|
||||
|
||||
if (bpp == 8) {
|
||||
if (bpp == 8)
|
||||
{
|
||||
OSD_Printf("glinfo: Not in OpenGL mode.\n");
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
@ -128,11 +131,15 @@ static int osdcmd_glinfo(const osdfuncparm_t *parm)
|
|||
|
||||
s = Bstrdup(glinfo.extensions);
|
||||
if (!s) OSD_Printf(glinfo.extensions);
|
||||
else {
|
||||
else
|
||||
{
|
||||
i = 0; t = u = s;
|
||||
while (*t) {
|
||||
if (*t == ' ') {
|
||||
if (i&1) {
|
||||
while (*t)
|
||||
{
|
||||
if (*t == ' ')
|
||||
{
|
||||
if (i&1)
|
||||
{
|
||||
*t = 0;
|
||||
OSD_Printf(" %s\n",u);
|
||||
u = t+1;
|
||||
|
@ -153,24 +160,28 @@ static int osdcmd_vars(const osdfuncparm_t *parm)
|
|||
{
|
||||
int showval = (parm->numparms < 1);
|
||||
|
||||
if (!Bstrcasecmp(parm->name, "screencaptureformat")) {
|
||||
if (!Bstrcasecmp(parm->name, "screencaptureformat"))
|
||||
{
|
||||
const char *fmts[] = {"TGA", "PCX"};
|
||||
if (showval) { OSD_Printf("captureformat is %s\n", fmts[captureformat]); }
|
||||
else {
|
||||
else
|
||||
{
|
||||
int j;
|
||||
for (j=0; j<2; j++)
|
||||
if (!Bstrcasecmp(parm->parms[0], fmts[j])) break;
|
||||
if (!Bstrcasecmp(parm->parms[0], fmts[j])) break;
|
||||
if (j == 2) return OSDCMD_SHOWHELP;
|
||||
captureformat = j;
|
||||
}
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
#ifdef SUPERBUILD
|
||||
else if (!Bstrcasecmp(parm->name, "novoxmips")) {
|
||||
else if (!Bstrcasecmp(parm->name, "novoxmips"))
|
||||
{
|
||||
if (showval) { OSD_Printf("novoxmips is %d\n", novoxmips); }
|
||||
else { novoxmips = (atoi(parm->parms[0]) != 0); }
|
||||
}
|
||||
else if (!Bstrcasecmp(parm->name, "usevoxels")) {
|
||||
else if (!Bstrcasecmp(parm->name, "usevoxels"))
|
||||
{
|
||||
if (showval) { OSD_Printf("usevoxels is %d\n", usevoxels); }
|
||||
else { usevoxels = (atoi(parm->parms[0]) != 0); }
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -95,7 +95,8 @@ bssize_t Bread(int fd, void *buf, bsize_t count)
|
|||
|
||||
int Blseek(int fildes, int offset, int whence)
|
||||
{
|
||||
switch (whence) {
|
||||
switch (whence)
|
||||
{
|
||||
case BSEEK_SET:
|
||||
whence=SEEK_SET; break;
|
||||
case BSEEK_CUR:
|
||||
|
@ -225,17 +226,17 @@ int Batoi(const char *nptr)
|
|||
return atoi(nptr);
|
||||
}
|
||||
|
||||
long Batol(const char *nptr)
|
||||
int Batol(const char *nptr)
|
||||
{
|
||||
return atol(nptr);
|
||||
}
|
||||
|
||||
long int Bstrtol(const char *nptr, char **endptr, int base)
|
||||
int int Bstrtol(const char *nptr, char **endptr, int base)
|
||||
{
|
||||
return strtol(nptr,endptr,base);
|
||||
}
|
||||
|
||||
unsigned long int Bstrtoul(const char *nptr, char **endptr, int base)
|
||||
unsigned int int Bstrtoul(const char *nptr, char **endptr, int base)
|
||||
{
|
||||
return strtoul(nptr,endptr,base);
|
||||
}
|
||||
|
@ -396,7 +397,8 @@ int Bcorrectfilename(char *filename, int removefn)
|
|||
fn = strdup(filename);
|
||||
if (!fn) return -1;
|
||||
|
||||
for (first=fn; *first; first++) {
|
||||
for (first=fn; *first; first++)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (*first == '\\') *first = '/';
|
||||
#endif
|
||||
|
@ -405,7 +407,8 @@ int Bcorrectfilename(char *filename, int removefn)
|
|||
trailslash = (first>fn && first[-1] == '/');
|
||||
|
||||
first = fn;
|
||||
do {
|
||||
do
|
||||
{
|
||||
token = Bstrtoken(first, "/", &next, 1);
|
||||
first = NULL;
|
||||
if (!token) break;
|
||||
|
@ -413,14 +416,16 @@ int Bcorrectfilename(char *filename, int removefn)
|
|||
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);
|
||||
}
|
||||
while (1);
|
||||
|
||||
if (!trailslash && removefn) { ntok = max(0,ntok-1); trailslash = 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++) {
|
||||
for (i=0; i<ntok; i++)
|
||||
{
|
||||
if (i>0) *(first++) = '/';
|
||||
for (token=tokarr[i]; *token; token++)
|
||||
*(first++) = *token;
|
||||
|
@ -442,7 +447,8 @@ int Bcanonicalisefilename(char *filename, int removefn)
|
|||
|
||||
#ifdef _WIN32
|
||||
{
|
||||
if (filename[0] && filename[1] == ':') {
|
||||
if (filename[0] && filename[1] == ':')
|
||||
{
|
||||
// filename is prefixed with a drive
|
||||
drv = toupper(filename[0])-'A' + 1;
|
||||
fnp += 2;
|
||||
|
@ -460,11 +466,14 @@ int Bcanonicalisefilename(char *filename, int removefn)
|
|||
for (p=fn; *p; p++) if (*p == '\\') *p = '/';
|
||||
#endif
|
||||
|
||||
if (fn[0] != '/') {
|
||||
if (fn[0] != '/')
|
||||
{
|
||||
// we are dealing with a path relative to the current directory
|
||||
strcpy(filename, cwd);
|
||||
strcat(filename, fn);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef _WIN32
|
||||
filename[0] = cwd[0];
|
||||
filename[1] = ':';
|
||||
|
@ -492,7 +501,8 @@ char *Bgetsystemdrives(void)
|
|||
drv = GetLogicalDrives();
|
||||
if (drv == 0) return NULL;
|
||||
|
||||
for (mask=1; mask<0x8000000l; mask<<=1) {
|
||||
for (mask=1; mask<0x8000000l; mask<<=1)
|
||||
{
|
||||
if ((drv&mask) == 0) continue;
|
||||
number++;
|
||||
}
|
||||
|
@ -501,7 +511,8 @@ char *Bgetsystemdrives(void)
|
|||
if (!str) return NULL;
|
||||
|
||||
number = 0;
|
||||
for (mask=1; mask<0x8000000l; mask<<=1, number++) {
|
||||
for (mask=1; mask<0x8000000l; mask<<=1, number++)
|
||||
{
|
||||
if ((drv&mask) == 0) continue;
|
||||
*(p++) = 'A' + number;
|
||||
*(p++) = ':';
|
||||
|
@ -517,17 +528,18 @@ char *Bgetsystemdrives(void)
|
|||
}
|
||||
|
||||
|
||||
long Bfilelength(int fd)
|
||||
int Bfilelength(int fd)
|
||||
{
|
||||
struct stat st;
|
||||
if (fstat(fd, &st) < 0) return -1;
|
||||
return(long)(st.st_size);
|
||||
return(int)(st.st_size);
|
||||
}
|
||||
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
long dir;
|
||||
int dir;
|
||||
struct _finddata_t fid;
|
||||
#else
|
||||
DIR *dir;
|
||||
|
@ -547,7 +559,8 @@ BDIR* Bopendir(const char *name)
|
|||
#endif
|
||||
|
||||
dirr = (BDIR_real*)malloc(sizeof(BDIR_real) + strlen(name));
|
||||
if (!dirr) {
|
||||
if (!dirr)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
free(t);
|
||||
#endif
|
||||
|
@ -566,13 +579,15 @@ BDIR* Bopendir(const char *name)
|
|||
|
||||
dirr->dir = _findfirst(t,&dirr->fid);
|
||||
free(t);
|
||||
if (dirr->dir == -1) {
|
||||
if (dirr->dir == -1)
|
||||
{
|
||||
free(dirr);
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
dirr->dir = opendir(name);
|
||||
if (dirr->dir == NULL) {
|
||||
if (dirr->dir == NULL)
|
||||
{
|
||||
free(dirr);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -592,8 +607,10 @@ struct Bdirent* Breaddir(BDIR *dir)
|
|||
char *fn;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
if (dirr->status > 0) {
|
||||
if (_findnext(dirr->dir,&dirr->fid) != 0) {
|
||||
if (dirr->status > 0)
|
||||
{
|
||||
if (_findnext(dirr->dir,&dirr->fid) != 0)
|
||||
{
|
||||
dirr->status = -1;
|
||||
return NULL;
|
||||
}
|
||||
|
@ -603,10 +620,13 @@ struct Bdirent* Breaddir(BDIR *dir)
|
|||
dirr->status++;
|
||||
#else
|
||||
de = readdir(dirr->dir);
|
||||
if (de == NULL) {
|
||||
if (de == NULL)
|
||||
{
|
||||
dirr->status = -1;
|
||||
return NULL;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
dirr->status++;
|
||||
}
|
||||
//# if defined(__WATCOMC__) || defined(__linux) || defined(__BEOS__) || defined(__QNX__) || defined(SKYOS)
|
||||
|
@ -621,9 +641,11 @@ struct Bdirent* Breaddir(BDIR *dir)
|
|||
dirr->info.mtime = 0;
|
||||
|
||||
fn = (char *)malloc(strlen(dirr->name) + 1 + dirr->info.namlen + 1);
|
||||
if (fn) {
|
||||
if (fn)
|
||||
{
|
||||
sprintf(fn,"%s/%s",dirr->name,dirr->info.name);
|
||||
if (!stat(fn, &st)) {
|
||||
if (!stat(fn, &st))
|
||||
{
|
||||
dirr->info.mode = st.st_mode;
|
||||
dirr->info.size = st.st_size;
|
||||
dirr->info.mtime = st.st_mtime;
|
||||
|
@ -661,14 +683,16 @@ char *Bstrtoken(char *s, char *delim, char **ptrptr, int chop)
|
|||
if (!p) return NULL;
|
||||
|
||||
while (*p != 0 && strchr(delim, *p)) p++;
|
||||
if (*p == 0) {
|
||||
if (*p == 0)
|
||||
{
|
||||
*ptrptr = NULL;
|
||||
return NULL;
|
||||
}
|
||||
start = p;
|
||||
while (*p != 0 && !strchr(delim, *p)) p++;
|
||||
if (*p == 0) *ptrptr = NULL;
|
||||
else {
|
||||
else
|
||||
{
|
||||
if (chop) *(p++) = 0;
|
||||
*ptrptr = p;
|
||||
}
|
||||
|
@ -680,7 +704,7 @@ char *Bstrtoken(char *s, char *delim, char **ptrptr, int chop)
|
|||
//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
|
||||
long Bwildmatch (const char *i, const char *j)
|
||||
int Bwildmatch(const char *i, const char *j)
|
||||
{
|
||||
const char *k;
|
||||
char c0, c1;
|
||||
|
@ -694,7 +718,7 @@ long Bwildmatch (const char *i, const char *j)
|
|||
continue;
|
||||
}
|
||||
if (!*i) return(0);
|
||||
if (*j == '?') { i++; j++; continue; }
|
||||
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
|
||||
|
@ -703,7 +727,8 @@ long Bwildmatch (const char *i, const char *j)
|
|||
#endif
|
||||
if (c0 != c1) return(0);
|
||||
i++; j++;
|
||||
} while (*j);
|
||||
}
|
||||
while (*j);
|
||||
return(!*i);
|
||||
}
|
||||
|
||||
|
@ -712,7 +737,7 @@ char *Bstrlwr(char *s)
|
|||
{
|
||||
char *t = s;
|
||||
if (!s) return s;
|
||||
while (*t) { *t = Btolower(*t); t++; }
|
||||
while (*t) { *t = Btolower(*t); t++; }
|
||||
return s;
|
||||
}
|
||||
|
||||
|
@ -720,7 +745,7 @@ char *Bstrupr(char *s)
|
|||
{
|
||||
char *t = s;
|
||||
if (!s) return s;
|
||||
while (*t) { *t = Btoupper(*t); t++; }
|
||||
while (*t) { *t = Btoupper(*t); t++; }
|
||||
return s;
|
||||
}
|
||||
#endif
|
||||
|
@ -737,7 +762,7 @@ unsigned int Bgetsysmemsize(void)
|
|||
return (unsigned int)memst.dwTotalPhys;
|
||||
#elif (defined(_SC_PAGE_SIZE) || defined(_SC_PAGESIZE)) && defined(_SC_PHYS_PAGES)
|
||||
unsigned int siz = 0x7fffffff;
|
||||
long scpagesiz, scphyspages;
|
||||
int scpagesiz, scphyspages;
|
||||
|
||||
#ifdef _SC_PAGE_SIZE
|
||||
scpagesiz = sysconf(_SC_PAGE_SIZE);
|
||||
|
|
|
@ -11,10 +11,10 @@
|
|||
#endif
|
||||
#include "baselayer.h"
|
||||
|
||||
static long 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 int 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 int readconfig(BFILE *fp, const char *key, char *value, unsigned len)
|
||||
{
|
||||
|
@ -25,7 +25,8 @@ static int readconfig(BFILE *fp, const char *key, char *value, unsigned len)
|
|||
|
||||
Brewind(fp);
|
||||
|
||||
while (1) {
|
||||
while (1)
|
||||
{
|
||||
if (!Bfgets(buf, 1000, fp)) return 0;
|
||||
|
||||
if (buf[0] == ';') continue;
|
||||
|
@ -55,11 +56,11 @@ static int readconfig(BFILE *fp, const char *key, char *value, unsigned len)
|
|||
}
|
||||
|
||||
extern short brightness;
|
||||
extern long fullscreen;
|
||||
extern int fullscreen;
|
||||
extern char option[8];
|
||||
extern char keys[NUMBUILDKEYS];
|
||||
extern double msens;
|
||||
extern long editorgridextent;
|
||||
extern int editorgridextent;
|
||||
|
||||
/*
|
||||
* SETUP.DAT
|
||||
|
@ -108,13 +109,15 @@ int loadsetup(const char *fn)
|
|||
|
||||
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) {
|
||||
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) {
|
||||
if (readconfig(fp, "2dresolution", val, VL) > 0)
|
||||
{
|
||||
i = Batoi(val) & 0x0f;
|
||||
if ((unsigned)i<13) { xdim2d = vesares[i][0]; ydim2d = vesares[i][1]; }
|
||||
}
|
||||
|
@ -123,11 +126,11 @@ if (readconfig(fp, "fullscreen", val, VL) > 0) { if (Batoi(val) != 0) fullscreen
|
|||
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, "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, "editorgridextent", val, VL) > 0) editorgridextent = max(min(524288,Batoi(val)),65536);
|
||||
if (readconfig(fp, "renderer", val, VL) > 0) { i = Batoi(val); setrendermode(i); }
|
||||
if (readconfig(fp, "renderer", val, VL) > 0) { i = Batoi(val); setrendermode(i); }
|
||||
if (readconfig(fp, "brightness", val, VL) > 0) brightness = min(max(Batoi(val),0),15);
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
|
@ -135,18 +138,22 @@ if (readconfig(fp, "renderer", val, VL) > 0) { i = Batoi(val); setrendermode(i);
|
|||
#endif
|
||||
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||
glusetexcache = glusetexcachecompression = -1;
|
||||
if (readconfig(fp, "glusetexcache", val, VL) > 0) {
|
||||
if (readconfig(fp, "glusetexcache", val, VL) > 0)
|
||||
{
|
||||
if (Batoi(val) != 0) glusetexcache = 1;
|
||||
else glusetexcache = 0;
|
||||
}
|
||||
if (readconfig(fp, "glusetexcachecompression", val, VL) > 0) {
|
||||
if (readconfig(fp, "glusetexcachecompression", val, VL) > 0)
|
||||
{
|
||||
if (Batoi(val) != 0) glusetexcachecompression = 1;
|
||||
else glusetexcachecompression = 0;
|
||||
}
|
||||
if (readconfig(fp, "gltexfiltermode", val, VL) > 0) {
|
||||
if (readconfig(fp, "gltexfiltermode", val, VL) > 0)
|
||||
{
|
||||
gltexfiltermode = Batoi(val);
|
||||
}
|
||||
if (readconfig(fp, "glanisotropy", val, VL) > 0) {
|
||||
if (readconfig(fp, "glanisotropy", val, VL) > 0)
|
||||
{
|
||||
glanisotropy = Batoi(val);
|
||||
}
|
||||
#endif
|
||||
|
@ -184,9 +191,9 @@ if (readconfig(fp, "renderer", val, VL) > 0) { i = Batoi(val); setrendermode(i);
|
|||
if (readconfig(fp, "windowposx", val, VL) > 0) windowx = Batoi(val);
|
||||
windowy = -1;
|
||||
if (readconfig(fp, "windowposy", val, VL) > 0) windowy = Batoi(val);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (readconfig(fp, "keyconsole", val, VL) > 0) { keys[19] = Bstrtol(val, NULL, 16); OSD_CaptureKey(keys[19]); }
|
||||
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);
|
||||
Bfclose(fp);
|
||||
|
@ -205,31 +212,31 @@ int writesetup(const char *fn)
|
|||
"; Always show configuration options on startup\n"
|
||||
"; 0 - No\n"
|
||||
"; 1 - Yes\n"
|
||||
"forcesetup = %ld\n"
|
||||
"forcesetup = %d\n"
|
||||
"\n"
|
||||
"; Video mode selection\n"
|
||||
"; 0 - Windowed\n"
|
||||
"; 1 - Fullscreen\n"
|
||||
"fullscreen = %ld\n"
|
||||
"fullscreen = %d\n"
|
||||
"\n"
|
||||
"; Video resolution\n"
|
||||
"xdim2d = %ld\n"
|
||||
"ydim2d = %ld\n"
|
||||
"xdim3d = %ld\n"
|
||||
"ydim3d = %ld\n"
|
||||
"xdim2d = %d\n"
|
||||
"ydim2d = %d\n"
|
||||
"xdim3d = %d\n"
|
||||
"ydim3d = %d\n"
|
||||
"\n"
|
||||
"; 3D-mode colour depth\n"
|
||||
"bpp = %ld\n"
|
||||
"bpp = %d\n"
|
||||
"\n"
|
||||
"; Grid limits\n"
|
||||
"editorgridextent = %ld\n"
|
||||
"editorgridextent = %d\n"
|
||||
"\n"
|
||||
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||
"; OpenGL mode options\n"
|
||||
"glusetexcache = %ld\n"
|
||||
"glusetexcachecompression = %ld\n"
|
||||
"gltexfiltermode = %ld\n"
|
||||
"glanisotropy = %ld\n"
|
||||
"glusetexcache = %d\n"
|
||||
"glusetexcachecompression = %d\n"
|
||||
"gltexfiltermode = %d\n"
|
||||
"glanisotropy = %d\n"
|
||||
"\n"
|
||||
#endif
|
||||
|
||||
|
@ -248,7 +255,7 @@ int writesetup(const char *fn)
|
|||
"; 15 - highest\n"
|
||||
"brightness = %d\n"
|
||||
"\n"
|
||||
#if 0
|
||||
#if 0
|
||||
"; Sound sample frequency\n"
|
||||
"; 0 - 6 KHz\n"
|
||||
"; 1 - 8 KHz\n"
|
||||
|
@ -264,7 +271,7 @@ int writesetup(const char *fn)
|
|||
"; 1 - On\n"
|
||||
"music = %d\n"
|
||||
"\n"
|
||||
#endif
|
||||
#endif
|
||||
"; Enable mouse\n"
|
||||
"; 0 - No\n"
|
||||
"; 1 - Yes\n"
|
||||
|
@ -273,7 +280,7 @@ int writesetup(const char *fn)
|
|||
"; Mouse sensitivity\n"
|
||||
"mousesensitivity = %g\n"
|
||||
"\n"
|
||||
#if 1
|
||||
#if 1
|
||||
"; Key Settings\n"
|
||||
"; Here's a map of all the keyboard scan codes: NOTE: values are listed in hex!\n"
|
||||
"; +---------------------------------------------------------------------------------------------+\n"
|
||||
|
@ -328,17 +335,17 @@ int writesetup(const char *fn)
|
|||
#ifdef RENDERTYPEWIN
|
||||
maxrefreshfreq, windowpos, windowx, windowy,
|
||||
#endif
|
||||
brightness,
|
||||
brightness,
|
||||
#if 0
|
||||
option[7]>>4, option[2],
|
||||
#endif
|
||||
#endif
|
||||
option[3], msens,
|
||||
#if 1
|
||||
#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
|
||||
#endif
|
||||
keys[19]
|
||||
);
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/*
|
||||
// this table of numbers is borrowed from the InfoZip source.
|
||||
static unsigned long crc32table[256] = {
|
||||
static unsigned int crc32table[256] = {
|
||||
0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
|
||||
0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
|
||||
0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
|
||||
|
@ -58,45 +58,46 @@ static unsigned long crc32table[256] = {
|
|||
};
|
||||
*/
|
||||
|
||||
static unsigned long crc32table[256];
|
||||
static unsigned int crc32table[256];
|
||||
|
||||
void initcrc32table(void)
|
||||
{
|
||||
unsigned long i,j,k;
|
||||
unsigned int i,j,k;
|
||||
|
||||
// algorithm and polynomial same as that used by infozip's zip
|
||||
for (i=0; i<256; i++) {
|
||||
for (i=0; i<256; i++)
|
||||
{
|
||||
j = i;
|
||||
for (k=8; k; k--)
|
||||
j = (j&1) ? (0xedb88320L ^ (j>>1)) : (j>>1);
|
||||
j = (j&1) ? (0xedb88320L ^(j>>1)) : (j>>1);
|
||||
crc32table[i] = j;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
unsigned long crc32once(unsigned char *blk, unsigned long len)
|
||||
unsigned int crc32once(unsigned char *blk, unsigned int len)
|
||||
{
|
||||
unsigned long crc;
|
||||
unsigned int crc;
|
||||
|
||||
crc32init(&crc);
|
||||
crc32block(&crc, blk, len);
|
||||
return crc32finish(&crc);
|
||||
}
|
||||
|
||||
void crc32init(unsigned long *crcvar)
|
||||
void crc32init(unsigned int *crcvar)
|
||||
{
|
||||
if (!crcvar) return;
|
||||
*crcvar = 0xffffffffl;
|
||||
}
|
||||
|
||||
void crc32block(unsigned long *crcvar, unsigned char *blk, unsigned long len)
|
||||
void crc32block(unsigned int *crcvar, unsigned char *blk, unsigned int len)
|
||||
{
|
||||
unsigned long crc = *crcvar;
|
||||
while (len--) crc = crc32table[(crc ^ *(blk++)) & 0xffl] ^ (crc >> 8);
|
||||
unsigned int crc = *crcvar;
|
||||
while (len--) crc = crc32table[(crc ^ *(blk++)) & 0xffl] ^(crc >> 8);
|
||||
*crcvar = crc;
|
||||
}
|
||||
|
||||
unsigned long crc32finish(unsigned long *crcvar)
|
||||
unsigned int crc32finish(unsigned int *crcvar)
|
||||
{
|
||||
*crcvar = *crcvar ^ 0xffffffffl;
|
||||
return *crcvar;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -25,7 +25,8 @@ int dynamicgtk_init(void)
|
|||
|
||||
memset(&dynamicgtksyms, 0, sizeof(dynamicgtksyms));
|
||||
|
||||
do {
|
||||
do
|
||||
{
|
||||
GETDLSYM(g_free)
|
||||
GETDLSYM(g_object_get_data)
|
||||
GETDLSYM(g_object_set_data)
|
||||
|
@ -146,9 +147,11 @@ int dynamicgtk_init(void)
|
|||
GETDLSYM(gtk_window_set_title)
|
||||
GETDLSYM(gtk_window_set_type_hint)
|
||||
GETDLSYM(g_utf8_collate)
|
||||
} while (0);
|
||||
}
|
||||
while (0);
|
||||
|
||||
if (err) {
|
||||
if (err)
|
||||
{
|
||||
//printf("Failed fetching symbol %s from GTK lib\n", failsym);
|
||||
dlclose(handle);
|
||||
handle = NULL;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -15,90 +15,90 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
void (APIENTRY * bglClearColor)( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha );
|
||||
void (APIENTRY * bglClear)( GLbitfield mask );
|
||||
void (APIENTRY * bglColorMask)( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha );
|
||||
void (APIENTRY * bglAlphaFunc)( GLenum func, GLclampf ref );
|
||||
void (APIENTRY * bglBlendFunc)( GLenum sfactor, GLenum dfactor );
|
||||
void (APIENTRY * bglCullFace)( GLenum mode );
|
||||
void (APIENTRY * bglFrontFace)( GLenum mode );
|
||||
void (APIENTRY * bglPolygonOffset)( GLfloat factor, GLfloat units );
|
||||
void (APIENTRY * bglPolygonMode)( GLenum face, GLenum mode );
|
||||
void (APIENTRY * bglEnable)( GLenum cap );
|
||||
void (APIENTRY * bglDisable)( GLenum cap );
|
||||
void (APIENTRY * bglGetDoublev)( GLenum pname, GLdouble *params );
|
||||
void (APIENTRY * bglGetFloatv)( GLenum pname, GLfloat *params );
|
||||
void (APIENTRY * bglGetIntegerv)( GLenum pname, GLint *params );
|
||||
void (APIENTRY * bglPushAttrib)( GLbitfield mask );
|
||||
void (APIENTRY * bglPopAttrib)( void );
|
||||
GLenum (APIENTRY * bglGetError)( void );
|
||||
const GLubyte* (APIENTRY * bglGetString)( GLenum name );
|
||||
void (APIENTRY * bglHint)( GLenum target, GLenum mode );
|
||||
void (APIENTRY * bglDrawBuffer)(GLenum mode);
|
||||
void (APIENTRY * bglReadBuffer)(GLenum mode);
|
||||
void (APIENTRY * bglScissor)(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (APIENTRY * bglClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
void (APIENTRY * bglClear)(GLbitfield mask);
|
||||
void (APIENTRY * bglColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
||||
void (APIENTRY * bglAlphaFunc)(GLenum func, GLclampf ref);
|
||||
void (APIENTRY * bglBlendFunc)(GLenum sfactor, GLenum dfactor);
|
||||
void (APIENTRY * bglCullFace)(GLenum mode);
|
||||
void (APIENTRY * bglFrontFace)(GLenum mode);
|
||||
void (APIENTRY * bglPolygonOffset)(GLfloat factor, GLfloat units);
|
||||
void (APIENTRY * bglPolygonMode)(GLenum face, GLenum mode);
|
||||
void (APIENTRY * bglEnable)(GLenum cap);
|
||||
void (APIENTRY * bglDisable)(GLenum cap);
|
||||
void (APIENTRY * bglGetDoublev)(GLenum pname, GLdouble *params);
|
||||
void (APIENTRY * bglGetFloatv)(GLenum pname, GLfloat *params);
|
||||
void (APIENTRY * bglGetIntegerv)(GLenum pname, GLint *params);
|
||||
void (APIENTRY * bglPushAttrib)(GLbitfield mask);
|
||||
void (APIENTRY * bglPopAttrib)(void);
|
||||
GLenum(APIENTRY * bglGetError)(void);
|
||||
const GLubyte*(APIENTRY * bglGetString)(GLenum name);
|
||||
void (APIENTRY * bglHint)(GLenum target, GLenum mode);
|
||||
void (APIENTRY * bglDrawBuffer)(GLenum mode);
|
||||
void (APIENTRY * bglReadBuffer)(GLenum mode);
|
||||
void (APIENTRY * bglScissor)(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
// Depth
|
||||
void (APIENTRY * bglDepthFunc)( GLenum func );
|
||||
void (APIENTRY * bglDepthMask)( GLboolean flag );
|
||||
void (APIENTRY * bglDepthRange)( GLclampd near_val, GLclampd far_val );
|
||||
void (APIENTRY * bglDepthFunc)(GLenum func);
|
||||
void (APIENTRY * bglDepthMask)(GLboolean flag);
|
||||
void (APIENTRY * bglDepthRange)(GLclampd near_val, GLclampd far_val);
|
||||
|
||||
// Matrix
|
||||
void (APIENTRY * bglMatrixMode)( GLenum mode );
|
||||
void (APIENTRY * bglOrtho)( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val );
|
||||
void (APIENTRY * bglFrustum)( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val );
|
||||
void (APIENTRY * bglViewport)( GLint x, GLint y, GLsizei width, GLsizei height );
|
||||
void (APIENTRY * bglPushMatrix)( void );
|
||||
void (APIENTRY * bglPopMatrix)( void );
|
||||
void (APIENTRY * bglLoadIdentity)( void );
|
||||
void (APIENTRY * bglLoadMatrixf)( const GLfloat *m );
|
||||
void (APIENTRY * bglLoadMatrixd)( const GLdouble *m );
|
||||
void (APIENTRY * bglMultMatrixf)( const GLfloat *m );
|
||||
void (APIENTRY * bglMultMatrixd)( const GLdouble *m );
|
||||
void (APIENTRY * bglMatrixMode)(GLenum mode);
|
||||
void (APIENTRY * bglOrtho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val);
|
||||
void (APIENTRY * bglFrustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val);
|
||||
void (APIENTRY * bglViewport)(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (APIENTRY * bglPushMatrix)(void);
|
||||
void (APIENTRY * bglPopMatrix)(void);
|
||||
void (APIENTRY * bglLoadIdentity)(void);
|
||||
void (APIENTRY * bglLoadMatrixf)(const GLfloat *m);
|
||||
void (APIENTRY * bglLoadMatrixd)(const GLdouble *m);
|
||||
void (APIENTRY * bglMultMatrixf)(const GLfloat *m);
|
||||
void (APIENTRY * bglMultMatrixd)(const GLdouble *m);
|
||||
void (APIENTRY * bglRotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
|
||||
void (APIENTRY * bglScalef)(GLfloat x, GLfloat y, GLfloat z);
|
||||
void (APIENTRY * bglTranslatef)(GLfloat x, GLfloat y, GLfloat z);
|
||||
|
||||
// Drawing
|
||||
void (APIENTRY * bglBegin)( GLenum mode );
|
||||
void (APIENTRY * bglEnd)( void );
|
||||
void (APIENTRY * bglVertex2f)( GLfloat x, GLfloat y );
|
||||
void (APIENTRY * bglVertex2i)( GLint x, GLint y );
|
||||
void (APIENTRY * bglVertex3f)( GLfloat x, GLfloat y, GLfloat z );
|
||||
void (APIENTRY * bglVertex3d)( GLdouble x, GLdouble y, GLdouble z );
|
||||
void (APIENTRY * bglVertex3fv)( const GLfloat *v );
|
||||
void (APIENTRY * bglVertex3dv)( const GLdouble *v );
|
||||
void (APIENTRY * bglColor4f)( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha );
|
||||
void (APIENTRY * bglColor4ub)( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
|
||||
void (APIENTRY * bglTexCoord2d)( GLdouble s, GLdouble t );
|
||||
void (APIENTRY * bglTexCoord2f)( GLfloat s, GLfloat t );
|
||||
void (APIENTRY * bglBegin)(GLenum mode);
|
||||
void (APIENTRY * bglEnd)(void);
|
||||
void (APIENTRY * bglVertex2f)(GLfloat x, GLfloat y);
|
||||
void (APIENTRY * bglVertex2i)(GLint x, GLint y);
|
||||
void (APIENTRY * bglVertex3f)(GLfloat x, GLfloat y, GLfloat z);
|
||||
void (APIENTRY * bglVertex3d)(GLdouble x, GLdouble y, GLdouble z);
|
||||
void (APIENTRY * bglVertex3fv)(const GLfloat *v);
|
||||
void (APIENTRY * bglVertex3dv)(const GLdouble *v);
|
||||
void (APIENTRY * bglColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
void (APIENTRY * bglColor4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
|
||||
void (APIENTRY * bglTexCoord2d)(GLdouble s, GLdouble t);
|
||||
void (APIENTRY * bglTexCoord2f)(GLfloat s, GLfloat t);
|
||||
|
||||
// Lighting
|
||||
void (APIENTRY * bglShadeModel)( GLenum mode );
|
||||
void (APIENTRY * bglShadeModel)(GLenum mode);
|
||||
|
||||
// Raster funcs
|
||||
void (APIENTRY * bglReadPixels)( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels );
|
||||
void (APIENTRY * bglReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
|
||||
|
||||
// Texture mapping
|
||||
void (APIENTRY * bglTexEnvf)( GLenum target, GLenum pname, GLfloat param );
|
||||
void (APIENTRY * bglGenTextures)( GLsizei n, GLuint *textures ); // 1.1
|
||||
void (APIENTRY * bglDeleteTextures)( GLsizei n, const GLuint *textures); // 1.1
|
||||
void (APIENTRY * bglBindTexture)( GLenum target, GLuint texture ); // 1.1
|
||||
void (APIENTRY * bglTexImage2D)( GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels );
|
||||
void (APIENTRY * bglCopyTexImage2D)( GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border );
|
||||
void (APIENTRY * bglCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (APIENTRY * bglTexSubImage2D)( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ); // 1.1
|
||||
void (APIENTRY * bglTexParameterf)( GLenum target, GLenum pname, GLfloat param );
|
||||
void (APIENTRY * bglTexParameteri)( GLenum target, GLenum pname, GLint param );
|
||||
void (APIENTRY * bglGetTexLevelParameteriv)( GLenum target, GLint level, GLenum pname, GLint *params );
|
||||
void (APIENTRY * bglTexEnvf)(GLenum target, GLenum pname, GLfloat param);
|
||||
void (APIENTRY * bglGenTextures)(GLsizei n, GLuint *textures); // 1.1
|
||||
void (APIENTRY * bglDeleteTextures)(GLsizei n, const GLuint *textures); // 1.1
|
||||
void (APIENTRY * bglBindTexture)(GLenum target, GLuint texture); // 1.1
|
||||
void (APIENTRY * bglTexImage2D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void (APIENTRY * bglCopyTexImage2D)(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
void (APIENTRY * bglCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (APIENTRY * bglTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); // 1.1
|
||||
void (APIENTRY * bglTexParameterf)(GLenum target, GLenum pname, GLfloat param);
|
||||
void (APIENTRY * bglTexParameteri)(GLenum target, GLenum pname, GLint param);
|
||||
void (APIENTRY * bglGetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
void (APIENTRY * bglCompressedTexImage2DARB)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
|
||||
void (APIENTRY * bglGetCompressedTexImageARB)(GLenum, GLint, GLvoid *);
|
||||
void (APIENTRY * bglTexGenfv)(GLenum coord, GLenum pname, const GLfloat *params);
|
||||
|
||||
// Fog
|
||||
void (APIENTRY * bglFogf)( GLenum pname, GLfloat param );
|
||||
void (APIENTRY * bglFogi)( GLenum pname, GLint param );
|
||||
void (APIENTRY * bglFogfv)( GLenum pname, const GLfloat *params );
|
||||
void (APIENTRY * bglFogf)(GLenum pname, GLfloat param);
|
||||
void (APIENTRY * bglFogi)(GLenum pname, GLint param);
|
||||
void (APIENTRY * bglFogfv)(GLenum pname, const GLfloat *params);
|
||||
|
||||
// Display Lists
|
||||
void (APIENTRY * bglNewList)(GLuint list, GLenum mode);
|
||||
|
@ -128,46 +128,46 @@ void (APIENTRY * bglDeleteProgramsARB)(GLsizei n, const GLuint *programs);
|
|||
// Multitexturing
|
||||
void (APIENTRY * bglActiveTextureARB)(GLenum texture);
|
||||
void (APIENTRY * bglClientActiveTextureARB)(GLenum texture);
|
||||
void (APIENTRY * bglMultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t );
|
||||
void (APIENTRY * bglMultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t );
|
||||
void (APIENTRY * bglMultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t);
|
||||
void (APIENTRY * bglMultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t);
|
||||
|
||||
// Frame Buffer Objects
|
||||
void (APIENTRY * bglGenFramebuffersEXT)(GLsizei n, GLuint *framebuffers);
|
||||
void (APIENTRY * bglBindFramebufferEXT)(GLenum target, GLuint framebuffer);
|
||||
void (APIENTRY * bglFramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
GLenum (APIENTRY * bglCheckFramebufferStatusEXT)(GLenum target);
|
||||
void (APIENTRY * bglDeleteFramebuffersEXT)(GLsizei n, const GLuint *framebuffers);
|
||||
|
||||
// Vertex Buffer Objects
|
||||
void (APIENTRY * bglGenBuffersARB)(GLsizei n, GLuint * buffers);
|
||||
void (APIENTRY * bglBindBufferARB)(GLenum target, GLuint buffer);
|
||||
void (APIENTRY * bglDeleteBuffersARB)(GLsizei n, const GLuint * buffers);
|
||||
void (APIENTRY * bglBufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage);
|
||||
void* (APIENTRY * bglMapBufferARB)(GLenum target, GLenum access);
|
||||
GLboolean (APIENTRY * bglUnmapBufferARB)(GLenum target);
|
||||
void (APIENTRY * bglBindFramebufferEXT)(GLenum target, GLuint framebuffer);
|
||||
void (APIENTRY * bglFramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
GLenum(APIENTRY * bglCheckFramebufferStatusEXT)(GLenum target);
|
||||
void (APIENTRY * bglDeleteFramebuffersEXT)(GLsizei n, const GLuint *framebuffers);
|
||||
|
||||
// Vertex Buffer Objects
|
||||
void (APIENTRY * bglGenBuffersARB)(GLsizei n, GLuint * buffers);
|
||||
void (APIENTRY * bglBindBufferARB)(GLenum target, GLuint buffer);
|
||||
void (APIENTRY * bglDeleteBuffersARB)(GLsizei n, const GLuint * buffers);
|
||||
void (APIENTRY * bglBufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage);
|
||||
void* (APIENTRY * bglMapBufferARB)(GLenum target, GLenum access);
|
||||
GLboolean(APIENTRY * bglUnmapBufferARB)(GLenum target);
|
||||
|
||||
// GLU
|
||||
void (APIENTRY * bgluTessBeginContour) (GLUtesselator* tess);
|
||||
void (APIENTRY * bgluTessBeginPolygon) (GLUtesselator* tess, GLvoid* data);
|
||||
void (APIENTRY * bgluTessCallback) (GLUtesselator* tess, GLenum which, void (PR_CALLBACK CallBackFunc)());
|
||||
void (APIENTRY * bgluTessEndContour) (GLUtesselator* tess);
|
||||
void (APIENTRY * bgluTessEndPolygon) (GLUtesselator* tess);
|
||||
void (APIENTRY * bgluTessNormal) (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
|
||||
void (APIENTRY * bgluTessProperty) (GLUtesselator* tess, GLenum which, GLdouble data);
|
||||
void (APIENTRY * bgluTessVertex) (GLUtesselator* tess, GLdouble *location, GLvoid* data);
|
||||
GLUtesselator* (APIENTRY * bgluNewTess) (void);
|
||||
void (APIENTRY * bgluTessBeginContour)(GLUtesselator* tess);
|
||||
void (APIENTRY * bgluTessBeginPolygon)(GLUtesselator* tess, GLvoid* data);
|
||||
void (APIENTRY * bgluTessCallback)(GLUtesselator* tess, GLenum which, void (PR_CALLBACK CallBackFunc)());
|
||||
void (APIENTRY * bgluTessEndContour)(GLUtesselator* tess);
|
||||
void (APIENTRY * bgluTessEndPolygon)(GLUtesselator* tess);
|
||||
void (APIENTRY * bgluTessNormal)(GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
|
||||
void (APIENTRY * bgluTessProperty)(GLUtesselator* tess, GLenum which, GLdouble data);
|
||||
void (APIENTRY * bgluTessVertex)(GLUtesselator* tess, GLdouble *location, GLvoid* data);
|
||||
GLUtesselator*(APIENTRY * bgluNewTess)(void);
|
||||
|
||||
void (APIENTRY * bgluPerspective) (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
|
||||
void (APIENTRY * bgluPerspective)(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
|
||||
|
||||
const GLubyte * (APIENTRY * bgluErrorString) (GLenum error);
|
||||
const GLubyte * (APIENTRY * bgluErrorString)(GLenum error);
|
||||
|
||||
GLint (APIENTRY * bgluProject)(GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
|
||||
GLint(APIENTRY * bgluProject)(GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
// Windows
|
||||
HGLRC (WINAPI * bwglCreateContext)(HDC);
|
||||
HGLRC(WINAPI * bwglCreateContext)(HDC);
|
||||
BOOL (WINAPI * bwglDeleteContext)(HGLRC);
|
||||
PROC (WINAPI * bwglGetProcAddress)(LPCSTR);
|
||||
PROC(WINAPI * bwglGetProcAddress)(LPCSTR);
|
||||
BOOL (WINAPI * bwglMakeCurrent)(HDC,HGLRC);
|
||||
|
||||
BOOL (WINAPI * bwglSwapBuffers)(HDC);
|
||||
|
@ -196,7 +196,8 @@ static void * getproc_(const char *s, int *err, int fatal, int extension)
|
|||
#else
|
||||
#error Need a dynamic loader for this platform...
|
||||
#endif
|
||||
if (!t && fatal) {
|
||||
if (!t && fatal)
|
||||
{
|
||||
initprintf("Failed to find %s in %s\n", s, gldriver);
|
||||
*err = 1;
|
||||
}
|
||||
|
@ -216,7 +217,8 @@ int loadgldriver(const char *driver)
|
|||
if (hGLDLL) return 0;
|
||||
#endif
|
||||
|
||||
if (!driver) {
|
||||
if (!driver)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
driver = "OPENGL32.DLL";
|
||||
#elif defined __APPLE__
|
||||
|
@ -268,9 +270,9 @@ int loadgldriver(const char *driver)
|
|||
bglGetError = GETPROC("glGetError");
|
||||
bglGetString = GETPROC("glGetString");
|
||||
bglHint = GETPROC("glHint");
|
||||
bglDrawBuffer = GETPROC("glDrawBuffer");
|
||||
bglReadBuffer = GETPROC("glDrawBuffer");
|
||||
bglScissor = GETPROC("glScissor");
|
||||
bglDrawBuffer = GETPROC("glDrawBuffer");
|
||||
bglReadBuffer = GETPROC("glDrawBuffer");
|
||||
bglScissor = GETPROC("glScissor");
|
||||
|
||||
// Depth
|
||||
bglDepthFunc = GETPROC("glDepthFunc");
|
||||
|
@ -350,7 +352,7 @@ int loadgldriver(const char *driver)
|
|||
bglClearStencil = GETPROC("glClearStencil");
|
||||
bglStencilOp = GETPROC("glStencilOp");
|
||||
bglStencilFunc = GETPROC("glStencilFunc");
|
||||
|
||||
|
||||
loadglextensions();
|
||||
loadglulibrary(getenv("BUILD_GLULIB"));
|
||||
|
||||
|
@ -382,26 +384,26 @@ int loadglextensions(void)
|
|||
|
||||
// Frame Buffer Objects
|
||||
bglGenFramebuffersEXT = GETPROCEXTSOFT("glGenFramebuffersEXT");
|
||||
bglBindFramebufferEXT = GETPROCEXTSOFT("glBindFramebufferEXT");
|
||||
bglFramebufferTexture2DEXT = GETPROCEXTSOFT("glFramebufferTexture2DEXT");
|
||||
bglCheckFramebufferStatusEXT = GETPROCEXTSOFT("glCheckFramebufferStatusEXT");
|
||||
bglDeleteFramebuffersEXT = GETPROCEXTSOFT("glDeleteFramebuffersEXT");
|
||||
|
||||
// Vertex Buffer Objects
|
||||
bglGenBuffersARB = GETPROCEXTSOFT("glGenBuffersARB");
|
||||
bglBindBufferARB = GETPROCEXTSOFT("glBindBufferARB");
|
||||
bglDeleteBuffersARB = GETPROCEXTSOFT("glDeleteBuffersARB");
|
||||
bglBindFramebufferEXT = GETPROCEXTSOFT("glBindFramebufferEXT");
|
||||
bglFramebufferTexture2DEXT = GETPROCEXTSOFT("glFramebufferTexture2DEXT");
|
||||
bglCheckFramebufferStatusEXT = GETPROCEXTSOFT("glCheckFramebufferStatusEXT");
|
||||
bglDeleteFramebuffersEXT = GETPROCEXTSOFT("glDeleteFramebuffersEXT");
|
||||
|
||||
// Vertex Buffer Objects
|
||||
bglGenBuffersARB = GETPROCEXTSOFT("glGenBuffersARB");
|
||||
bglBindBufferARB = GETPROCEXTSOFT("glBindBufferARB");
|
||||
bglDeleteBuffersARB = GETPROCEXTSOFT("glDeleteBuffersARB");
|
||||
bglBufferDataARB = GETPROCEXTSOFT("glBufferDataARB");
|
||||
bglMapBufferARB = GETPROCEXTSOFT("glMapBufferARB");
|
||||
bglUnmapBufferARB = GETPROCEXTSOFT("glUnmapBufferARB");
|
||||
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int unloadgldriver(void)
|
||||
{
|
||||
unloadglulibrary();
|
||||
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
if (!hGLDLL) return 0;
|
||||
#endif
|
||||
|
@ -433,9 +435,9 @@ int unloadgldriver(void)
|
|||
bglGetError = NULL;
|
||||
bglGetString = NULL;
|
||||
bglHint = NULL;
|
||||
bglDrawBuffer = NULL;
|
||||
bglReadBuffer = NULL;
|
||||
bglScissor = NULL;
|
||||
bglDrawBuffer = NULL;
|
||||
bglReadBuffer = NULL;
|
||||
bglScissor = NULL;
|
||||
|
||||
// Depth
|
||||
bglDepthFunc = NULL;
|
||||
|
@ -529,15 +531,15 @@ int unloadgldriver(void)
|
|||
|
||||
// Frame Buffer Objects
|
||||
bglGenFramebuffersEXT = NULL;
|
||||
bglBindFramebufferEXT = NULL;
|
||||
bglFramebufferTexture2DEXT = NULL;
|
||||
bglCheckFramebufferStatusEXT = NULL;
|
||||
bglDeleteFramebuffersEXT = NULL;
|
||||
|
||||
// Vertex Buffer Objects
|
||||
bglGenBuffersARB = NULL;
|
||||
bglBindBufferARB = NULL;
|
||||
bglDeleteBuffersARB = NULL;
|
||||
bglBindFramebufferEXT = NULL;
|
||||
bglFramebufferTexture2DEXT = NULL;
|
||||
bglCheckFramebufferStatusEXT = NULL;
|
||||
bglDeleteFramebuffersEXT = NULL;
|
||||
|
||||
// Vertex Buffer Objects
|
||||
bglGenBuffersARB = NULL;
|
||||
bglBindBufferARB = NULL;
|
||||
bglDeleteBuffersARB = NULL;
|
||||
bglBufferDataARB = NULL;
|
||||
bglMapBufferARB = NULL;
|
||||
bglUnmapBufferARB = NULL;
|
||||
|
@ -566,7 +568,8 @@ static void * glugetproc_(const char *s, int *err, int fatal)
|
|||
#else
|
||||
t = (void*)dlsym(gluhandle,s);
|
||||
#endif
|
||||
if (!t && fatal) {
|
||||
if (!t && fatal)
|
||||
{
|
||||
initprintf("Failed to find %s in %s\n", s, glulibrary);
|
||||
*err = 1;
|
||||
}
|
||||
|
@ -584,7 +587,8 @@ int loadglulibrary(const char *driver)
|
|||
if (hGLUDLL) return 0;
|
||||
#endif
|
||||
|
||||
if (!driver) {
|
||||
if (!driver)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
driver = "GLU32.DLL";
|
||||
#elif defined __APPLE__
|
||||
|
@ -657,7 +661,7 @@ int unloadglulibrary(void)
|
|||
bgluErrorString = NULL;
|
||||
|
||||
bgluProject = NULL;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -67,7 +67,8 @@ void gtkbuild_init(int *argc, char ***argv)
|
|||
{
|
||||
#ifndef LINKED_GTK
|
||||
gtkenabled = dynamicgtk_init();
|
||||
if (gtkenabled < 0) {
|
||||
if (gtkenabled < 0)
|
||||
{
|
||||
gtkenabled = 0;
|
||||
return;
|
||||
}
|
||||
|
@ -84,7 +85,8 @@ void gtkbuild_init(int *argc, char ***argv)
|
|||
|
||||
void gtkbuild_exit(int r)
|
||||
{
|
||||
if (gtkenabled) {
|
||||
if (gtkenabled)
|
||||
{
|
||||
if (appicon) g_object_unref((gpointer)appicon);
|
||||
}
|
||||
#ifndef LINKED_GTK
|
||||
|
|
|
@ -11,7 +11,7 @@ palette_t hictinting[MAXPALOOKUPS];
|
|||
|
||||
//moved into polymost.h
|
||||
/*struct hicskybox_t {
|
||||
long ignore;
|
||||
int ignore;
|
||||
char *face[6];
|
||||
};
|
||||
|
||||
|
@ -28,19 +28,25 @@ static char hicfirstinit = 0;
|
|||
//
|
||||
// find the index into hicreplc[] which contains the replacement tile particulars
|
||||
//
|
||||
static hicreplctyp * hicfindsubst(long picnum, long palnum, long skybox)
|
||||
static hicreplctyp * hicfindsubst(int picnum, int palnum, int skybox)
|
||||
{
|
||||
hicreplctyp *hr;
|
||||
|
||||
if (!hicfirstinit) return NULL;
|
||||
if ((unsigned long)picnum >= (unsigned long)MAXTILES) return NULL;
|
||||
if ((unsigned int)picnum >= (unsigned int)MAXTILES) return NULL;
|
||||
|
||||
do {
|
||||
for (hr = hicreplc[picnum]; hr; hr = hr->next) {
|
||||
if (hr->palnum == palnum) {
|
||||
if (skybox) {
|
||||
do
|
||||
{
|
||||
for (hr = hicreplc[picnum]; hr; hr = hr->next)
|
||||
{
|
||||
if (hr->palnum == palnum)
|
||||
{
|
||||
if (skybox)
|
||||
{
|
||||
if (hr->skybox && !hr->skybox->ignore) return hr;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!hr->ignore) return hr;
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +54,8 @@ static hicreplctyp * hicfindsubst(long picnum, long palnum, long skybox)
|
|||
|
||||
if (!palnum || palnum >= (MAXPALOOKUPS - RESERVEDPALS)) break;
|
||||
palnum = 0;
|
||||
} while (1);
|
||||
}
|
||||
while (1);
|
||||
|
||||
return NULL; // no replacement found
|
||||
}
|
||||
|
@ -60,22 +67,28 @@ static hicreplctyp * hicfindsubst(long picnum, long palnum, long skybox)
|
|||
//
|
||||
void hicinit(void)
|
||||
{
|
||||
long i,j;
|
||||
int i,j;
|
||||
hicreplctyp *hr, *next;
|
||||
|
||||
for (i=0;i<MAXPALOOKUPS;i++) { // all tints should be 100%
|
||||
for (i=0;i<MAXPALOOKUPS;i++) // all tints should be 100%
|
||||
{
|
||||
hictinting[i].r = hictinting[i].g = hictinting[i].b = 0xff;
|
||||
hictinting[i].f = 0;
|
||||
}
|
||||
|
||||
if (hicfirstinit)
|
||||
for (i=MAXTILES-1;i>=0;i--) {
|
||||
for (hr=hicreplc[i]; hr; ) {
|
||||
for (i=MAXTILES-1;i>=0;i--)
|
||||
{
|
||||
for (hr=hicreplc[i]; hr;)
|
||||
{
|
||||
next = hr->next;
|
||||
|
||||
if (hr->skybox) {
|
||||
for (j=5;j>=0;j--) {
|
||||
if (hr->skybox->face[j]) {
|
||||
if (hr->skybox)
|
||||
{
|
||||
for (j=5;j>=0;j--)
|
||||
{
|
||||
if (hr->skybox->face[j])
|
||||
{
|
||||
free(hr->skybox->face[j]);
|
||||
}
|
||||
}
|
||||
|
@ -99,9 +112,9 @@ void hicinit(void)
|
|||
// palette shifts on true-colour textures and only true-colour textures.
|
||||
// effect bitset: 1 = greyscale, 2 = invert
|
||||
//
|
||||
void hicsetpalettetint(long palnum, unsigned char r, unsigned char g, unsigned char b, unsigned char effect)
|
||||
void hicsetpalettetint(int palnum, unsigned char r, unsigned char g, unsigned char b, unsigned char effect)
|
||||
{
|
||||
if ((unsigned long)palnum >= (unsigned long)MAXPALOOKUPS) return;
|
||||
if ((unsigned int)palnum >= (unsigned int)MAXPALOOKUPS) return;
|
||||
if (!hicfirstinit) hicinit();
|
||||
|
||||
hictinting[palnum].r = r;
|
||||
|
@ -115,31 +128,35 @@ void hicsetpalettetint(long palnum, unsigned char r, unsigned char g, unsigned c
|
|||
// hicsetsubsttex(picnum,pal,filen,alphacut)
|
||||
// Specifies a replacement graphic file for an ART tile.
|
||||
//
|
||||
int hicsetsubsttex(long picnum, long palnum, char *filen, float alphacut, float xscale, float yscale, char flags)
|
||||
int hicsetsubsttex(int picnum, int palnum, char *filen, float alphacut, float xscale, float yscale, char flags)
|
||||
{
|
||||
hicreplctyp *hr, *hrn;
|
||||
|
||||
if ((unsigned long)picnum >= (unsigned long)MAXTILES) return -1;
|
||||
if ((unsigned long)palnum >= (unsigned long)MAXPALOOKUPS) return -1;
|
||||
if ((unsigned int)picnum >= (unsigned int)MAXTILES) return -1;
|
||||
if ((unsigned int)palnum >= (unsigned int)MAXPALOOKUPS) return -1;
|
||||
if (!hicfirstinit) hicinit();
|
||||
|
||||
for (hr = hicreplc[picnum]; hr; hr = hr->next) {
|
||||
for (hr = hicreplc[picnum]; hr; hr = hr->next)
|
||||
{
|
||||
if (hr->palnum == palnum)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!hr) {
|
||||
if (!hr)
|
||||
{
|
||||
// no replacement yet defined
|
||||
hrn = (hicreplctyp *)calloc(1,sizeof(hicreplctyp));
|
||||
if (!hrn) return -1;
|
||||
hrn->palnum = palnum;
|
||||
} else hrn = hr;
|
||||
}
|
||||
else hrn = hr;
|
||||
|
||||
// store into hicreplc the details for this replacement
|
||||
if (hrn->filename) free(hrn->filename);
|
||||
|
||||
hrn->filename = strdup(filen);
|
||||
if (!hrn->filename) {
|
||||
if (!hrn->filename)
|
||||
{
|
||||
if (hrn->skybox) return -1; // don't free the base structure if there's a skybox defined
|
||||
if (hr == NULL) free(hrn); // not yet a link in the chain
|
||||
return -1;
|
||||
|
@ -149,7 +166,8 @@ int hicsetsubsttex(long picnum, long palnum, char *filen, float alphacut, float
|
|||
hrn->xscale = xscale;
|
||||
hrn->yscale = yscale;
|
||||
hrn->flags = flags;
|
||||
if (hr == NULL) {
|
||||
if (hr == NULL)
|
||||
{
|
||||
hrn->next = hicreplc[picnum];
|
||||
hicreplc[picnum] = hrn;
|
||||
}
|
||||
|
@ -164,46 +182,56 @@ int hicsetsubsttex(long picnum, long palnum, char *filen, float alphacut, float
|
|||
// hicsetskybox(picnum,pal,faces[6])
|
||||
// Specifies a graphic files making up a skybox.
|
||||
//
|
||||
int hicsetskybox(long picnum, long palnum, char *faces[6])
|
||||
int hicsetskybox(int picnum, int palnum, char *faces[6])
|
||||
{
|
||||
hicreplctyp *hr, *hrn;
|
||||
long j;
|
||||
int j;
|
||||
|
||||
if ((unsigned long)picnum >= (unsigned long)MAXTILES) return -1;
|
||||
if ((unsigned long)palnum >= (unsigned long)MAXPALOOKUPS) return -1;
|
||||
if ((unsigned int)picnum >= (unsigned int)MAXTILES) return -1;
|
||||
if ((unsigned int)palnum >= (unsigned int)MAXPALOOKUPS) return -1;
|
||||
for (j=5;j>=0;j--) if (!faces[j]) return -1;
|
||||
if (!hicfirstinit) hicinit();
|
||||
|
||||
for (hr = hicreplc[picnum]; hr; hr = hr->next) {
|
||||
for (hr = hicreplc[picnum]; hr; hr = hr->next)
|
||||
{
|
||||
if (hr->palnum == palnum)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!hr) {
|
||||
if (!hr)
|
||||
{
|
||||
// no replacement yet defined
|
||||
hrn = (hicreplctyp *)calloc(1,sizeof(hicreplctyp));
|
||||
if (!hrn) return -1;
|
||||
|
||||
hrn->palnum = palnum;
|
||||
} else hrn = hr;
|
||||
}
|
||||
else hrn = hr;
|
||||
|
||||
if (!hrn->skybox) {
|
||||
if (!hrn->skybox)
|
||||
{
|
||||
hrn->skybox = (struct hicskybox_t *)calloc(1,sizeof(struct hicskybox_t));
|
||||
if (!hrn->skybox) {
|
||||
if (!hrn->skybox)
|
||||
{
|
||||
if (hr == NULL) free(hrn); // not yet a link in the chain
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
for (j=5;j>=0;j--) {
|
||||
}
|
||||
else
|
||||
{
|
||||
for (j=5;j>=0;j--)
|
||||
{
|
||||
if (hrn->skybox->face[j])
|
||||
free(hrn->skybox->face[j]);
|
||||
}
|
||||
}
|
||||
|
||||
// store each face's filename
|
||||
for (j=0;j<6;j++) {
|
||||
for (j=0;j<6;j++)
|
||||
{
|
||||
hrn->skybox->face[j] = strdup(faces[j]);
|
||||
if (!hrn->skybox->face[j]) {
|
||||
if (!hrn->skybox->face[j])
|
||||
{
|
||||
for (--j; j>=0; --j) // free any previous faces
|
||||
free(hrn->skybox->face[j]);
|
||||
free(hrn->skybox);
|
||||
|
@ -213,7 +241,8 @@ int hicsetskybox(long picnum, long palnum, char *faces[6])
|
|||
}
|
||||
}
|
||||
hrn->skybox->ignore = 0;
|
||||
if (hr == NULL) {
|
||||
if (hr == NULL)
|
||||
{
|
||||
hrn->next = hicreplc[picnum];
|
||||
hicreplc[picnum] = hrn;
|
||||
}
|
||||
|
@ -226,15 +255,16 @@ int hicsetskybox(long picnum, long palnum, char *faces[6])
|
|||
// hicclearsubst(picnum,pal)
|
||||
// Clears a replacement for an ART tile, including skybox faces.
|
||||
//
|
||||
int hicclearsubst(long picnum, long palnum)
|
||||
int hicclearsubst(int picnum, int palnum)
|
||||
{
|
||||
hicreplctyp *hr, *hrn = NULL;
|
||||
|
||||
if ((unsigned long)picnum >= (unsigned long)MAXTILES) return -1;
|
||||
if ((unsigned long)palnum >= (unsigned long)MAXPALOOKUPS) return -1;
|
||||
if ((unsigned int)picnum >= (unsigned int)MAXTILES) return -1;
|
||||
if ((unsigned int)palnum >= (unsigned int)MAXPALOOKUPS) return -1;
|
||||
if (!hicfirstinit) return 0;
|
||||
|
||||
for (hr = hicreplc[picnum]; hr; hrn = hr, hr = hr->next) {
|
||||
for (hr = hicreplc[picnum]; hr; hrn = hr, hr = hr->next)
|
||||
{
|
||||
if (hr->palnum == palnum)
|
||||
break;
|
||||
}
|
||||
|
@ -242,7 +272,8 @@ int hicclearsubst(long picnum, long palnum)
|
|||
if (!hr) return 0;
|
||||
|
||||
if (hr->filename) free(hr->filename);
|
||||
if (hr->skybox) {
|
||||
if (hr->skybox)
|
||||
{
|
||||
int i;
|
||||
for (i=5;i>=0;i--)
|
||||
if (hr->skybox->face[i])
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -81,12 +81,12 @@
|
|||
*/
|
||||
|
||||
unsigned int
|
||||
lzf_compress (const void *const in_data, unsigned int in_len,
|
||||
void *out_data, unsigned int out_len
|
||||
lzf_compress(const void *const in_data, unsigned int in_len,
|
||||
void *out_data, unsigned int out_len
|
||||
#if LZF_STATE_ARG
|
||||
, LZF_STATE *htab
|
||||
, LZF_STATE *htab
|
||||
#endif
|
||||
)
|
||||
)
|
||||
{
|
||||
#if !LZF_STATE_ARG
|
||||
LZF_STATE htab;
|
||||
|
@ -98,13 +98,13 @@ lzf_compress (const void *const in_data, unsigned int in_len,
|
|||
u8 *out_end = op + out_len;
|
||||
const u8 *ref;
|
||||
|
||||
unsigned int hval = FRST (ip);
|
||||
unsigned long off;
|
||||
unsigned int hval = FRST(ip);
|
||||
unsigned int off;
|
||||
int lit = 0;
|
||||
|
||||
#if INIT_HTAB
|
||||
# if USE_MEMCPY
|
||||
memset (htab, 0, sizeof (htab));
|
||||
memset(htab, 0, sizeof(htab));
|
||||
# else
|
||||
for (hslot = htab; hslot < htab + HSIZE; hslot++)
|
||||
*hslot++ = ip;
|
||||
|
@ -115,8 +115,8 @@ lzf_compress (const void *const in_data, unsigned int in_len,
|
|||
{
|
||||
if (ip < in_end - 2)
|
||||
{
|
||||
hval = NEXT (hval, ip);
|
||||
hslot = htab + IDX (hval);
|
||||
hval = NEXT(hval, ip);
|
||||
hslot = htab + IDX(hval);
|
||||
ref = *hslot; *hslot = ip;
|
||||
|
||||
if (1
|
||||
|
@ -166,7 +166,7 @@ lzf_compress (const void *const in_data, unsigned int in_len,
|
|||
}
|
||||
else
|
||||
{
|
||||
*op++ = (off >> 8) + ( 7 << 5);
|
||||
*op++ = (off >> 8) + (7 << 5);
|
||||
*op++ = len - 7;
|
||||
}
|
||||
|
||||
|
@ -177,22 +177,22 @@ lzf_compress (const void *const in_data, unsigned int in_len,
|
|||
#if VERY_FAST && !ULTRA_FAST
|
||||
--ip;
|
||||
#endif
|
||||
hval = FRST (ip);
|
||||
hval = FRST(ip);
|
||||
|
||||
hval = NEXT (hval, ip);
|
||||
htab[IDX (hval)] = ip;
|
||||
hval = NEXT(hval, ip);
|
||||
htab[IDX(hval)] = ip;
|
||||
ip++;
|
||||
|
||||
#if VERY_FAST && !ULTRA_FAST
|
||||
hval = NEXT (hval, ip);
|
||||
htab[IDX (hval)] = ip;
|
||||
hval = NEXT(hval, ip);
|
||||
htab[IDX(hval)] = ip;
|
||||
ip++;
|
||||
#endif
|
||||
#else
|
||||
do
|
||||
{
|
||||
hval = NEXT (hval, ip);
|
||||
htab[IDX (hval)] = ip;
|
||||
hval = NEXT(hval, ip);
|
||||
htab[IDX(hval)] = ip;
|
||||
ip++;
|
||||
}
|
||||
while (len--);
|
||||
|
@ -214,7 +214,7 @@ lzf_compress (const void *const in_data, unsigned int in_len,
|
|||
|
||||
*op++ = MAX_LIT - 1;
|
||||
#if USE_MEMCPY
|
||||
memcpy (op, ip - MAX_LIT, MAX_LIT);
|
||||
memcpy(op, ip - MAX_LIT, MAX_LIT);
|
||||
op += MAX_LIT;
|
||||
lit = 0;
|
||||
#else
|
||||
|
|
|
@ -46,8 +46,8 @@
|
|||
#endif
|
||||
|
||||
unsigned int
|
||||
lzf_decompress (const void *const in_data, unsigned int in_len,
|
||||
void *out_data, unsigned int out_len)
|
||||
lzf_decompress(const void *const in_data, unsigned int in_len,
|
||||
void *out_data, unsigned int out_len)
|
||||
{
|
||||
u8 const *ip = (const u8 *)in_data;
|
||||
u8 *op = (u8 *)out_data;
|
||||
|
@ -64,12 +64,12 @@ lzf_decompress (const void *const in_data, unsigned int in_len,
|
|||
|
||||
if (op + ctrl > out_end)
|
||||
{
|
||||
SET_ERRNO (E2BIG);
|
||||
SET_ERRNO(E2BIG);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if USE_MEMCPY
|
||||
memcpy (op, ip, ctrl);
|
||||
memcpy(op, ip, ctrl);
|
||||
op += ctrl;
|
||||
ip += ctrl;
|
||||
#else
|
||||
|
@ -91,13 +91,13 @@ lzf_decompress (const void *const in_data, unsigned int in_len,
|
|||
|
||||
if (op + len + 2 > out_end)
|
||||
{
|
||||
SET_ERRNO (E2BIG);
|
||||
SET_ERRNO(E2BIG);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ref < (u8 *)out_data)
|
||||
{
|
||||
SET_ERRNO (EINVAL);
|
||||
SET_ERRNO(EINVAL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
//--------------------------------------------------------------------------------------------------
|
||||
#if defined(__POWERPC__)
|
||||
static unsigned long LSWAPIB (unsigned long a) { return(((a>>8)&0xff00)+((a&0xff00)<<8)+(a<<24)+(a>>24)); }
|
||||
static unsigned short SSWAPIB (unsigned short a) { return((a>>8)+(a<<8)); }
|
||||
static unsigned int LSWAPIB(unsigned int a) { return(((a>>8)&0xff00)+((a&0xff00)<<8)+(a<<24)+(a>>24)); }
|
||||
static unsigned short SSWAPIB(unsigned short a) { return((a>>8)+(a<<8)); }
|
||||
#else
|
||||
#define LSWAPIB(a) (a)
|
||||
#define SSWAPIB(a) (a)
|
||||
#endif
|
||||
|
||||
#define USENEW 1
|
||||
long lzwcompress (unsigned char *ucompbuf, long ucompleng, unsigned char *compbuf)
|
||||
int lzwcompress(unsigned char *ucompbuf, int ucompleng, unsigned char *compbuf)
|
||||
{
|
||||
long i, j, numnodes, *lptr, bitcnt, nbits, oneupnbits, hmask, *child;
|
||||
long *sibly;
|
||||
int i, j, numnodes, *lptr, bitcnt, nbits, oneupnbits, hmask, *child;
|
||||
int *sibly;
|
||||
#if USENEW
|
||||
long *sibry;
|
||||
int *sibry;
|
||||
#endif
|
||||
unsigned char *nodev, *cptr, *eptr;
|
||||
|
||||
nodev = (unsigned char *)malloc((ucompleng+256)*sizeof(char)); if (!nodev) return(0);
|
||||
child = (long *)malloc((ucompleng+256)*sizeof(long)); if (!child) { free(nodev); return(0); }
|
||||
sibly = (long *)malloc((ucompleng+256)*sizeof(long)); if (!sibly) { free(child); free(nodev); return(0); }
|
||||
child = (int *)malloc((ucompleng+256)*sizeof(int)); if (!child) { free(nodev); return(0); }
|
||||
sibly = (int *)malloc((ucompleng+256)*sizeof(int)); if (!sibly) { free(child); free(nodev); return(0); }
|
||||
#if USENEW
|
||||
sibry = (long *)malloc((ucompleng+256)*sizeof(long)); if (!sibry) { free(sibly); free(child); free(nodev); return(0); }
|
||||
sibry = (int *)malloc((ucompleng+256)*sizeof(int)); if (!sibry) { free(sibly); free(child); free(nodev); return(0); }
|
||||
#endif
|
||||
|
||||
for (i=255;i>=0;i--) { nodev[i] = i; child[i] = -1; }
|
||||
|
@ -35,18 +35,18 @@ child = (long *)malloc((ucompleng+256)*sizeof(long)); if (!child) { free(nodev);
|
|||
for (i=cptr[0];i>=0;i=j)
|
||||
{
|
||||
cptr++; if (cptr >= eptr) goto lzwcompbreak2b;
|
||||
j = child[i]; if (j < 0) { child[i] = numnodes; break; }
|
||||
j = child[i]; if (j < 0) { child[i] = numnodes; break; }
|
||||
#if USENEW
|
||||
//This is about 2x faster when ucompbuf is more random, 5% slower when very compressible
|
||||
while (cptr[0] != nodev[j])
|
||||
{
|
||||
if (cptr[0] < nodev[j])
|
||||
{ if (sibly[j] < 0) { sibly[j] = numnodes; goto lzwcompbreak2a; } j = sibly[j]; }
|
||||
{ if (sibly[j] < 0) { sibly[j] = numnodes; goto lzwcompbreak2a; } j = sibly[j]; }
|
||||
else { if (sibry[j] < 0) { sibry[j] = numnodes; goto lzwcompbreak2a; } j = sibry[j]; }
|
||||
}
|
||||
#else
|
||||
for (;nodev[j]!=cptr[0];j=sibly[j])
|
||||
if (sibly[j] < 0) { sibly[j] = numnodes; goto lzwcompbreak2a; }
|
||||
if (sibly[j] < 0) { sibly[j] = numnodes; goto lzwcompbreak2a; }
|
||||
#endif
|
||||
}
|
||||
lzwcompbreak2a:
|
||||
|
@ -57,11 +57,12 @@ lzwcompbreak2b:
|
|||
sibry[numnodes] = -1;
|
||||
#endif
|
||||
|
||||
lptr = (long *)&compbuf[bitcnt>>3]; lptr[0] |= LSWAPIB(i<<(bitcnt&7));
|
||||
lptr = (int *)&compbuf[bitcnt>>3]; lptr[0] |= LSWAPIB(i<<(bitcnt&7));
|
||||
bitcnt += nbits; if ((i&hmask) > ((numnodes-1)&hmask)) bitcnt--;
|
||||
|
||||
numnodes++; if (numnodes > oneupnbits) { nbits++; oneupnbits <<= 1; hmask = ((oneupnbits>>1)-1); }
|
||||
} while ((cptr < eptr) && (bitcnt < (ucompleng<<3)));
|
||||
numnodes++; if (numnodes > oneupnbits) { nbits++; oneupnbits <<= 1; hmask = ((oneupnbits>>1)-1); }
|
||||
}
|
||||
while ((cptr < eptr) && (bitcnt < (ucompleng<<3)));
|
||||
|
||||
#if USENEW
|
||||
free(sibry);
|
||||
|
@ -69,50 +70,52 @@ lzwcompbreak2b:
|
|||
free(sibly);
|
||||
free(child); free(nodev);
|
||||
|
||||
lptr = (long *)compbuf;
|
||||
if (((bitcnt+7)>>3) < ucompleng) { lptr[0] = LSWAPIB(numnodes); return((bitcnt+7)>>3); }
|
||||
lptr = (int *)compbuf;
|
||||
if (((bitcnt+7)>>3) < ucompleng) { lptr[0] = LSWAPIB(numnodes); return((bitcnt+7)>>3); }
|
||||
memcpy(compbuf,ucompbuf,ucompleng); return(ucompleng);
|
||||
}
|
||||
|
||||
long lzwuncompress (unsigned char *compbuf, long compleng, unsigned char *ucompbuf, long ucompleng)
|
||||
int lzwuncompress(unsigned char *compbuf, int compleng, unsigned char *ucompbuf, int ucompleng)
|
||||
{
|
||||
long i, dat, leng, bitcnt, *lptr, numnodes, totnodes, nbits, oneupnbits, hmask, *prefix;
|
||||
int i, dat, leng, bitcnt, *lptr, numnodes, totnodes, nbits, oneupnbits, hmask, *prefix;
|
||||
unsigned char ch, *ucptr, *suffix;
|
||||
long ucomp = (long)ucompbuf;
|
||||
int ucomp = (int)ucompbuf;
|
||||
|
||||
if (compleng >= ucompleng) { memcpy(ucompbuf,compbuf,ucompleng); return ucompleng; }
|
||||
|
||||
totnodes = LSWAPIB(((long *)compbuf)[0]); if (totnodes <= 0 || totnodes >= ucompleng+256) return 0;
|
||||
totnodes = LSWAPIB(((int *)compbuf)[0]); if (totnodes <= 0 || totnodes >= ucompleng+256) return 0;
|
||||
|
||||
prefix = (long *)malloc(totnodes*sizeof(long)); if (!prefix) return 0;
|
||||
suffix = (unsigned char *)malloc(totnodes*sizeof(char)); if (!suffix) { free(prefix); return 0; }
|
||||
prefix = (int *)malloc(totnodes*sizeof(int)); if (!prefix) return 0;
|
||||
suffix = (unsigned char *)malloc(totnodes*sizeof(char)); if (!suffix) { free(prefix); return 0; }
|
||||
|
||||
numnodes = 256; bitcnt = (4<<3); nbits = 8; oneupnbits = (1<<8); hmask = ((oneupnbits>>1)-1);
|
||||
do
|
||||
{
|
||||
lptr = (long *)&compbuf[bitcnt>>3]; dat = ((LSWAPIB(lptr[0])>>(bitcnt&7))&(oneupnbits-1));
|
||||
lptr = (int *)&compbuf[bitcnt>>3]; dat = ((LSWAPIB(lptr[0])>>(bitcnt&7))&(oneupnbits-1));
|
||||
bitcnt += nbits; if ((dat&hmask) > ((numnodes-1)&hmask)) { dat &= hmask; bitcnt--; }
|
||||
|
||||
prefix[numnodes] = dat;
|
||||
|
||||
ucompbuf++;
|
||||
for (leng=0;dat>=256;dat=prefix[dat]) {
|
||||
if ((long)ucompbuf+leng-ucomp > ucompleng) goto bail;
|
||||
for (leng=0;dat>=256;dat=prefix[dat])
|
||||
{
|
||||
if ((int)ucompbuf+leng-ucomp > ucompleng) goto bail;
|
||||
ucompbuf[leng++] = suffix[dat];
|
||||
}
|
||||
|
||||
ucptr = &ucompbuf[leng-1];
|
||||
for (i=(leng>>1)-1;i>=0;i--) { ch = ucompbuf[i]; ucompbuf[i] = ucptr[-i]; ucptr[-i] = ch; }
|
||||
for (i=(leng>>1)-1;i>=0;i--) { ch = ucompbuf[i]; ucompbuf[i] = ucptr[-i]; ucptr[-i] = ch; }
|
||||
ucompbuf[-1] = dat; ucompbuf += leng;
|
||||
|
||||
suffix[numnodes-1] = suffix[numnodes] = dat;
|
||||
|
||||
numnodes++; if (numnodes > oneupnbits) { nbits++; oneupnbits <<= 1; hmask = ((oneupnbits>>1)-1); }
|
||||
} while (numnodes < totnodes);
|
||||
}
|
||||
while (numnodes < totnodes);
|
||||
|
||||
bail:
|
||||
free(suffix); free(prefix);
|
||||
|
||||
return (long)ucompbuf-ucomp;
|
||||
return (int)ucompbuf-ucomp;
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
typedef unsigned char * POINTER;
|
||||
typedef unsigned short UINT2;
|
||||
typedef unsigned long UINT4;
|
||||
typedef unsigned int UINT4;
|
||||
|
||||
#include "md4.h"
|
||||
#include "compat.h"
|
||||
|
@ -46,17 +46,18 @@ typedef unsigned long UINT4;
|
|||
#define S33 11
|
||||
#define S34 15
|
||||
|
||||
static void MD4Transform (UINT4 [4], unsigned char [64]);
|
||||
static void Encode (unsigned char *, UINT4 *, unsigned int);
|
||||
static void Decode (UINT4 *, unsigned char *, unsigned int);
|
||||
static void MD4Transform(UINT4 [4], unsigned char [64]);
|
||||
static void Encode(unsigned char *, UINT4 *, unsigned int);
|
||||
static void Decode(UINT4 *, unsigned char *, unsigned int);
|
||||
#define MD4_memcpy memcpy
|
||||
#define MD4_memset memset
|
||||
|
||||
static unsigned char PADDING[64] = {
|
||||
0x80, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
static unsigned char PADDING[64] =
|
||||
{
|
||||
0x80, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
/* F, G and H are basic MD4 functions.
|
||||
*/
|
||||
|
@ -94,7 +95,7 @@ void md4once(unsigned char *block, unsigned int len, unsigned char digest[16])
|
|||
|
||||
/* MD4 initialization. Begins an MD4 operation, writing a new context.
|
||||
*/
|
||||
void md4init (MD4_CTX *context)
|
||||
void md4init(MD4_CTX *context)
|
||||
{
|
||||
context->count[0] = context->count[1] = 0;
|
||||
|
||||
|
@ -110,7 +111,7 @@ void md4init (MD4_CTX *context)
|
|||
operation, processing another message block, and updating the
|
||||
context.
|
||||
*/
|
||||
void md4block (MD4_CTX *context, unsigned char *input, unsigned int inputLen)
|
||||
void md4block(MD4_CTX *context, unsigned char *input, unsigned int inputLen)
|
||||
{
|
||||
unsigned int i, index, partLen;
|
||||
|
||||
|
@ -126,13 +127,14 @@ void md4block (MD4_CTX *context, unsigned char *input, unsigned int inputLen)
|
|||
|
||||
/* Transform as many times as possible.
|
||||
*/
|
||||
if (inputLen >= partLen) {
|
||||
if (inputLen >= partLen)
|
||||
{
|
||||
MD4_memcpy
|
||||
((POINTER)&context->buffer[index], (POINTER)input, partLen);
|
||||
MD4Transform (context->state, context->buffer);
|
||||
MD4Transform(context->state, context->buffer);
|
||||
|
||||
for (i = partLen; i + 63 < inputLen; i += 64)
|
||||
MD4Transform (context->state, &input[i]);
|
||||
MD4Transform(context->state, &input[i]);
|
||||
|
||||
index = 0;
|
||||
}
|
||||
|
@ -148,91 +150,91 @@ void md4block (MD4_CTX *context, unsigned char *input, unsigned int inputLen)
|
|||
/* MD4 finalization. Ends an MD4 message-digest operation, writing the
|
||||
the message digest and zeroizing the context.
|
||||
*/
|
||||
void md4finish (unsigned char digest[16], MD4_CTX *context)
|
||||
void md4finish(unsigned char digest[16], MD4_CTX *context)
|
||||
{
|
||||
unsigned char bits[8];
|
||||
unsigned int index, padLen;
|
||||
|
||||
/* Save number of bits */
|
||||
Encode (bits, context->count, 8);
|
||||
Encode(bits, context->count, 8);
|
||||
|
||||
/* Pad out to 56 mod 64.
|
||||
*/
|
||||
index = (unsigned int)((context->count[0] >> 3) & 0x3f);
|
||||
padLen = (index < 56) ? (56 - index) : (120 - index);
|
||||
md4block (context, PADDING, padLen);
|
||||
md4block(context, PADDING, padLen);
|
||||
|
||||
/* Append length (before padding) */
|
||||
md4block (context, bits, 8);
|
||||
md4block(context, bits, 8);
|
||||
/* Store state in digest */
|
||||
Encode (digest, context->state, 16);
|
||||
Encode(digest, context->state, 16);
|
||||
|
||||
/* Zeroize sensitive information.
|
||||
*/
|
||||
MD4_memset ((POINTER)context, 0, sizeof (*context));
|
||||
MD4_memset((POINTER)context, 0, sizeof(*context));
|
||||
}
|
||||
|
||||
/* MD4 basic transformation. Transforms state based on block.
|
||||
*/
|
||||
static void MD4Transform (UINT4 state[4], unsigned char block[64])
|
||||
static void MD4Transform(UINT4 state[4], unsigned char block[64])
|
||||
{
|
||||
UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
|
||||
|
||||
Decode (x, block, 64);
|
||||
Decode(x, block, 64);
|
||||
|
||||
/* Round 1 */
|
||||
FF (a, b, c, d, x[ 0], S11); /* 1 */
|
||||
FF (d, a, b, c, x[ 1], S12); /* 2 */
|
||||
FF (c, d, a, b, x[ 2], S13); /* 3 */
|
||||
FF (b, c, d, a, x[ 3], S14); /* 4 */
|
||||
FF (a, b, c, d, x[ 4], S11); /* 5 */
|
||||
FF (d, a, b, c, x[ 5], S12); /* 6 */
|
||||
FF (c, d, a, b, x[ 6], S13); /* 7 */
|
||||
FF (b, c, d, a, x[ 7], S14); /* 8 */
|
||||
FF (a, b, c, d, x[ 8], S11); /* 9 */
|
||||
FF (d, a, b, c, x[ 9], S12); /* 10 */
|
||||
FF (c, d, a, b, x[10], S13); /* 11 */
|
||||
FF (b, c, d, a, x[11], S14); /* 12 */
|
||||
FF (a, b, c, d, x[12], S11); /* 13 */
|
||||
FF (d, a, b, c, x[13], S12); /* 14 */
|
||||
FF (c, d, a, b, x[14], S13); /* 15 */
|
||||
FF (b, c, d, a, x[15], S14); /* 16 */
|
||||
FF(a, b, c, d, x[ 0], S11); /* 1 */
|
||||
FF(d, a, b, c, x[ 1], S12); /* 2 */
|
||||
FF(c, d, a, b, x[ 2], S13); /* 3 */
|
||||
FF(b, c, d, a, x[ 3], S14); /* 4 */
|
||||
FF(a, b, c, d, x[ 4], S11); /* 5 */
|
||||
FF(d, a, b, c, x[ 5], S12); /* 6 */
|
||||
FF(c, d, a, b, x[ 6], S13); /* 7 */
|
||||
FF(b, c, d, a, x[ 7], S14); /* 8 */
|
||||
FF(a, b, c, d, x[ 8], S11); /* 9 */
|
||||
FF(d, a, b, c, x[ 9], S12); /* 10 */
|
||||
FF(c, d, a, b, x[10], S13); /* 11 */
|
||||
FF(b, c, d, a, x[11], S14); /* 12 */
|
||||
FF(a, b, c, d, x[12], S11); /* 13 */
|
||||
FF(d, a, b, c, x[13], S12); /* 14 */
|
||||
FF(c, d, a, b, x[14], S13); /* 15 */
|
||||
FF(b, c, d, a, x[15], S14); /* 16 */
|
||||
|
||||
/* Round 2 */
|
||||
GG (a, b, c, d, x[ 0], S21); /* 17 */
|
||||
GG (d, a, b, c, x[ 4], S22); /* 18 */
|
||||
GG (c, d, a, b, x[ 8], S23); /* 19 */
|
||||
GG (b, c, d, a, x[12], S24); /* 20 */
|
||||
GG (a, b, c, d, x[ 1], S21); /* 21 */
|
||||
GG (d, a, b, c, x[ 5], S22); /* 22 */
|
||||
GG (c, d, a, b, x[ 9], S23); /* 23 */
|
||||
GG (b, c, d, a, x[13], S24); /* 24 */
|
||||
GG (a, b, c, d, x[ 2], S21); /* 25 */
|
||||
GG (d, a, b, c, x[ 6], S22); /* 26 */
|
||||
GG (c, d, a, b, x[10], S23); /* 27 */
|
||||
GG (b, c, d, a, x[14], S24); /* 28 */
|
||||
GG (a, b, c, d, x[ 3], S21); /* 29 */
|
||||
GG (d, a, b, c, x[ 7], S22); /* 30 */
|
||||
GG (c, d, a, b, x[11], S23); /* 31 */
|
||||
GG (b, c, d, a, x[15], S24); /* 32 */
|
||||
GG(a, b, c, d, x[ 0], S21); /* 17 */
|
||||
GG(d, a, b, c, x[ 4], S22); /* 18 */
|
||||
GG(c, d, a, b, x[ 8], S23); /* 19 */
|
||||
GG(b, c, d, a, x[12], S24); /* 20 */
|
||||
GG(a, b, c, d, x[ 1], S21); /* 21 */
|
||||
GG(d, a, b, c, x[ 5], S22); /* 22 */
|
||||
GG(c, d, a, b, x[ 9], S23); /* 23 */
|
||||
GG(b, c, d, a, x[13], S24); /* 24 */
|
||||
GG(a, b, c, d, x[ 2], S21); /* 25 */
|
||||
GG(d, a, b, c, x[ 6], S22); /* 26 */
|
||||
GG(c, d, a, b, x[10], S23); /* 27 */
|
||||
GG(b, c, d, a, x[14], S24); /* 28 */
|
||||
GG(a, b, c, d, x[ 3], S21); /* 29 */
|
||||
GG(d, a, b, c, x[ 7], S22); /* 30 */
|
||||
GG(c, d, a, b, x[11], S23); /* 31 */
|
||||
GG(b, c, d, a, x[15], S24); /* 32 */
|
||||
|
||||
/* Round 3 */
|
||||
HH (a, b, c, d, x[ 0], S31); /* 33 */
|
||||
HH (d, a, b, c, x[ 8], S32); /* 34 */
|
||||
HH (c, d, a, b, x[ 4], S33); /* 35 */
|
||||
HH (b, c, d, a, x[12], S34); /* 36 */
|
||||
HH (a, b, c, d, x[ 2], S31); /* 37 */
|
||||
HH (d, a, b, c, x[10], S32); /* 38 */
|
||||
HH (c, d, a, b, x[ 6], S33); /* 39 */
|
||||
HH (b, c, d, a, x[14], S34); /* 40 */
|
||||
HH (a, b, c, d, x[ 1], S31); /* 41 */
|
||||
HH (d, a, b, c, x[ 9], S32); /* 42 */
|
||||
HH (c, d, a, b, x[ 5], S33); /* 43 */
|
||||
HH (b, c, d, a, x[13], S34); /* 44 */
|
||||
HH (a, b, c, d, x[ 3], S31); /* 45 */
|
||||
HH (d, a, b, c, x[11], S32); /* 46 */
|
||||
HH (c, d, a, b, x[ 7], S33); /* 47 */
|
||||
HH (b, c, d, a, x[15], S34); /* 48 */
|
||||
HH(a, b, c, d, x[ 0], S31); /* 33 */
|
||||
HH(d, a, b, c, x[ 8], S32); /* 34 */
|
||||
HH(c, d, a, b, x[ 4], S33); /* 35 */
|
||||
HH(b, c, d, a, x[12], S34); /* 36 */
|
||||
HH(a, b, c, d, x[ 2], S31); /* 37 */
|
||||
HH(d, a, b, c, x[10], S32); /* 38 */
|
||||
HH(c, d, a, b, x[ 6], S33); /* 39 */
|
||||
HH(b, c, d, a, x[14], S34); /* 40 */
|
||||
HH(a, b, c, d, x[ 1], S31); /* 41 */
|
||||
HH(d, a, b, c, x[ 9], S32); /* 42 */
|
||||
HH(c, d, a, b, x[ 5], S33); /* 43 */
|
||||
HH(b, c, d, a, x[13], S34); /* 44 */
|
||||
HH(a, b, c, d, x[ 3], S31); /* 45 */
|
||||
HH(d, a, b, c, x[11], S32); /* 46 */
|
||||
HH(c, d, a, b, x[ 7], S33); /* 47 */
|
||||
HH(b, c, d, a, x[15], S34); /* 48 */
|
||||
|
||||
state[0] += a;
|
||||
state[1] += b;
|
||||
|
@ -241,17 +243,18 @@ static void MD4Transform (UINT4 state[4], unsigned char block[64])
|
|||
|
||||
/* Zeroize sensitive information.
|
||||
*/
|
||||
MD4_memset ((POINTER)x, 0, sizeof (x));
|
||||
MD4_memset((POINTER)x, 0, sizeof(x));
|
||||
}
|
||||
|
||||
/* Encodes input (UINT4) into output (unsigned char). Assumes len is
|
||||
a multiple of 4.
|
||||
*/
|
||||
static void Encode (unsigned char *output, UINT4 *input, unsigned int len)
|
||||
static void Encode(unsigned char *output, UINT4 *input, unsigned int len)
|
||||
{
|
||||
unsigned int i, j;
|
||||
|
||||
for (i = 0, j = 0; j < len; i++, j += 4) {
|
||||
for (i = 0, j = 0; j < len; i++, j += 4)
|
||||
{
|
||||
output[j] = (unsigned char)(input[i] & 0xff);
|
||||
output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
|
||||
output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
|
||||
|
@ -262,7 +265,7 @@ static void Encode (unsigned char *output, UINT4 *input, unsigned int len)
|
|||
/* Decodes input (unsigned char) into output (UINT4). Assumes len is
|
||||
a multiple of 4.
|
||||
*/
|
||||
static void Decode (UINT4 *output, unsigned char *input, unsigned int len)
|
||||
static void Decode(UINT4 *output, unsigned char *input, unsigned int len)
|
||||
{
|
||||
unsigned int i, j;
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -29,10 +29,10 @@
|
|||
|
||||
#include "compat.h"
|
||||
#include <sys/time.h>
|
||||
static long GetTickCount(void)
|
||||
static int GetTickCount(void)
|
||||
{
|
||||
struct timeval tv;
|
||||
long ti;
|
||||
int ti;
|
||||
if (gettimeofday(&tv,NULL) < 0) return 0;
|
||||
// tv is sec.usec, GTC gives msec
|
||||
ti = tv.tv_sec * 1000;
|
||||
|
@ -59,27 +59,27 @@ static long GetTickCount(void)
|
|||
int packetrate = PAKRATE;
|
||||
#define SIMMIS 0 //Release:0 Test:100 Packets per 256 missed.
|
||||
#define SIMLAG 0 //Release:0 Test: 10 Packets to delay receipt
|
||||
static long simlagcnt[MAXPLAYERS];
|
||||
static int simlagcnt[MAXPLAYERS];
|
||||
static char simlagfif[MAXPLAYERS][SIMLAG+1][MAXPAKSIZ+2];
|
||||
#if ((SIMMIS != 0) || (SIMLAG != 0))
|
||||
#pragma message("\n\nWARNING! INTENTIONAL PACKET LOSS SIMULATION IS ENABLED!\nREMEMBER TO CHANGE SIMMIS&SIMLAG to 0 before RELEASE!\n\n")
|
||||
#endif
|
||||
|
||||
long myconnectindex, numplayers;
|
||||
long connecthead, connectpoint2[MAXPLAYERS];
|
||||
int myconnectindex, numplayers;
|
||||
int connecthead, connectpoint2[MAXPLAYERS];
|
||||
|
||||
static long tims, lastsendtims[MAXPLAYERS];
|
||||
static int tims, lastsendtims[MAXPLAYERS];
|
||||
static char pakbuf[MAXPAKSIZ];
|
||||
|
||||
#define FIFSIZ 512 //16384/40 = 6min:49sec
|
||||
static long ipak[MAXPLAYERS][FIFSIZ], icnt0[MAXPLAYERS];
|
||||
static long opak[MAXPLAYERS][FIFSIZ], ocnt0[MAXPLAYERS], ocnt1[MAXPLAYERS];
|
||||
static char pakmem[4194304]; static long pakmemi = 1;
|
||||
static int ipak[MAXPLAYERS][FIFSIZ], icnt0[MAXPLAYERS];
|
||||
static int opak[MAXPLAYERS][FIFSIZ], ocnt0[MAXPLAYERS], ocnt1[MAXPLAYERS];
|
||||
static char pakmem[4194304]; static int pakmemi = 1;
|
||||
|
||||
#define NETPORT 0x5bd9
|
||||
static SOCKET mysock;
|
||||
static long myip, myport = NETPORT, otherip[MAXPLAYERS], otherport[MAXPLAYERS];
|
||||
static long snatchip = 0, snatchport = 0, danetmode = 255, netready = 0;
|
||||
static int myip, myport = NETPORT, otherip[MAXPLAYERS], otherport[MAXPLAYERS];
|
||||
static int snatchip = 0, snatchport = 0, danetmode = 255, netready = 0;
|
||||
|
||||
#ifdef _WIN32
|
||||
int wsainitialized = 0;
|
||||
|
@ -92,7 +92,7 @@ int nfFinished = 0; //Flag that determines NatFree has found all players and set
|
|||
int HeardFrom[MAXPLAYERS]; //For connecthead
|
||||
int HeardFrom2[MAXPLAYERS]; //For others
|
||||
|
||||
int nfCheckCP (long other) //Check if target player is our current NatFree Player
|
||||
int nfCheckCP(int other) //Check if target player is our current NatFree Player
|
||||
{
|
||||
if (!natfree || nfFinished)
|
||||
return 1;
|
||||
|
@ -102,7 +102,7 @@ int nfCheckCP (long other) //Check if target player is our current NatFree Playe
|
|||
return 0;
|
||||
}
|
||||
|
||||
int nfCheckHF (long other) //function to check if we've heard from a player
|
||||
int nfCheckHF(int other) //function to check if we've heard from a player
|
||||
{
|
||||
if (HeardFrom[other] == 1)
|
||||
return 1;
|
||||
|
@ -110,7 +110,7 @@ int nfCheckHF (long other) //function to check if we've heard from a player
|
|||
return 0;
|
||||
}
|
||||
|
||||
void nfIncCP () //function to handle currentplayer increment
|
||||
void nfIncCP() //function to handle currentplayer increment
|
||||
{
|
||||
if (natfree && !nfFinished)
|
||||
{
|
||||
|
@ -126,7 +126,7 @@ void nfIncCP () //function to handle currentplayer increment
|
|||
}
|
||||
/*Addfaz NatFree End*/
|
||||
|
||||
void netuninit ()
|
||||
void netuninit()
|
||||
{
|
||||
if (mysock != (SOCKET)INVALID_HANDLE_VALUE) closesocket(mysock);
|
||||
#ifdef _WIN32
|
||||
|
@ -135,41 +135,41 @@ void netuninit ()
|
|||
#endif
|
||||
}
|
||||
|
||||
static int set_socket_blockmode(SOCKET socket, int onOrOff)
|
||||
static int set_socket_blockmode(SOCKET socket, int onOrOff)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
unsigned long flags;
|
||||
#ifdef _WIN32
|
||||
unsigned int flags;
|
||||
#else
|
||||
signed long flags;
|
||||
#endif
|
||||
int rc = 0;
|
||||
|
||||
/* set socket to be (non-)blocking. */
|
||||
|
||||
#ifdef _WIN32
|
||||
flags = (onOrOff) ? 0 : 1;
|
||||
rc = (ioctlsocket(socket, FIONBIO, &flags) == 0);
|
||||
#else
|
||||
flags = fcntl(socket, F_GETFL, 0);
|
||||
if (flags != -1)
|
||||
{
|
||||
if (onOrOff)
|
||||
flags &= ~O_NONBLOCK;
|
||||
else
|
||||
flags |= O_NONBLOCK;
|
||||
rc = (fcntl(socket, F_SETFL, flags) == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
return(rc);
|
||||
}
|
||||
signed int flags;
|
||||
#endif
|
||||
int rc = 0;
|
||||
|
||||
long netinit (long portnum)
|
||||
/* set socket to be (non-)blocking. */
|
||||
|
||||
#ifdef _WIN32
|
||||
flags = (onOrOff) ? 0 : 1;
|
||||
rc = (ioctlsocket(socket, FIONBIO, &flags) == 0);
|
||||
#else
|
||||
flags = fcntl(socket, F_GETFL, 0);
|
||||
if (flags != -1)
|
||||
{
|
||||
if (onOrOff)
|
||||
flags &= ~O_NONBLOCK;
|
||||
else
|
||||
flags |= O_NONBLOCK;
|
||||
rc = (fcntl(socket, F_SETFL, flags) == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
return(rc);
|
||||
}
|
||||
|
||||
int netinit(int portnum)
|
||||
{
|
||||
LPHOSTENT lpHostEnt;
|
||||
char hostnam[256];
|
||||
struct sockaddr_in ip;
|
||||
long i;
|
||||
int i;
|
||||
|
||||
#ifdef _WIN32
|
||||
if (wsainitialized == 0)
|
||||
|
@ -185,7 +185,7 @@ long netinit (long portnum)
|
|||
#ifdef __BEOS__
|
||||
i = 1; if (setsockopt(mysock,SOL_SOCKET,SO_NONBLOCK,&i,sizeof(i)) < 0) return(0);
|
||||
#else
|
||||
// i = 1; if (ioctlsocket(mysock,FIONBIO,(unsigned long *)&i) == SOCKET_ERROR) return(0);
|
||||
// i = 1; if (ioctlsocket(mysock,FIONBIO,(unsigned int *)&i) == SOCKET_ERROR) return(0);
|
||||
if (!set_socket_blockmode(mysock,0)) return(0);
|
||||
#endif
|
||||
|
||||
|
@ -198,7 +198,7 @@ long netinit (long portnum)
|
|||
if (gethostname(hostnam,sizeof(hostnam)) != SOCKET_ERROR)
|
||||
if ((lpHostEnt = gethostbyname(hostnam)))
|
||||
{
|
||||
myip = ip.sin_addr.s_addr = *(long *)lpHostEnt->h_addr;
|
||||
myip = ip.sin_addr.s_addr = *(int *)lpHostEnt->h_addr;
|
||||
printf("mmulti: This machine's IP is %s\n", inet_ntoa(ip.sin_addr));
|
||||
}
|
||||
return(1);
|
||||
|
@ -206,7 +206,7 @@ long netinit (long portnum)
|
|||
return(0);
|
||||
}
|
||||
|
||||
long netsend (long other, char *dabuf, long bufsiz) //0:buffer full... can't send
|
||||
int netsend(int other, char *dabuf, int bufsiz) //0:buffer full... can't send
|
||||
{
|
||||
struct sockaddr_in ip;
|
||||
|
||||
|
@ -234,10 +234,10 @@ long netsend (long other, char *dabuf, long bufsiz) //0:buffer full... can't sen
|
|||
return(sendto(mysock,dabuf,bufsiz,0,(struct sockaddr *)&ip,sizeof(struct sockaddr_in)) != SOCKET_ERROR);
|
||||
}
|
||||
|
||||
long netread (long *other, char *dabuf, long bufsiz) //0:no packets in buffer
|
||||
int netread(int *other, char *dabuf, int bufsiz) //0:no packets in buffer
|
||||
{
|
||||
struct sockaddr_in ip;
|
||||
long i;
|
||||
int i;
|
||||
|
||||
i = sizeof(ip);
|
||||
|
||||
|
@ -246,12 +246,12 @@ long netread (long *other, char *dabuf, long bufsiz) //0:no packets in buffer
|
|||
if ((rand()&255) < SIMMIS) return(0);
|
||||
#endif
|
||||
|
||||
snatchip = (long)ip.sin_addr.s_addr; snatchport = (long)ip.sin_port;
|
||||
snatchip = (int)ip.sin_addr.s_addr; snatchport = (int)ip.sin_port;
|
||||
|
||||
(*other) = myconnectindex;
|
||||
for (i=0;i<MAXPLAYERS;i++)
|
||||
if ((otherip[i] == snatchip) && (otherport[i] == snatchport))
|
||||
{ (*other) = i; break; }
|
||||
{(*other) = i; break; }
|
||||
|
||||
/*Addfaz NatFree Start*/
|
||||
if (natfree && !nfFinished)
|
||||
|
@ -294,9 +294,9 @@ long netread (long *other, char *dabuf, long bufsiz) //0:no packets in buffer
|
|||
return(1);
|
||||
}
|
||||
|
||||
long isvalidipaddress (char *st)
|
||||
int isvalidipaddress(char *st)
|
||||
{
|
||||
long i, bcnt, num;
|
||||
int i, bcnt, num;
|
||||
|
||||
bcnt = 0; num = 0;
|
||||
for (i=0;st[i];i++)
|
||||
|
@ -309,13 +309,13 @@ long isvalidipaddress (char *st)
|
|||
for (i++;st[i];i++)
|
||||
{
|
||||
if ((st[i] >= '0') && (st[i] <= '9'))
|
||||
{ num = num*10+st[i]-'0'; if (num >= 65536) return(0); }
|
||||
{ num = num*10+st[i]-'0'; if (num >= 65536) return(0); }
|
||||
else return(0);
|
||||
}
|
||||
return(1);
|
||||
}
|
||||
if ((st[i] >= '0') && (st[i] <= '9'))
|
||||
{ num = num*10+st[i]-'0'; if (num >= 256) return(0); }
|
||||
{ num = num*10+st[i]-'0'; if (num >= 256) return(0); }
|
||||
|
||||
}
|
||||
return(bcnt == 3);
|
||||
|
@ -323,19 +323,19 @@ long isvalidipaddress (char *st)
|
|||
|
||||
//---------------------------------- Obsolete variables&functions ----------------------------------
|
||||
char syncstate = 0;
|
||||
void setpackettimeout (long datimeoutcount, long daresendagaincount) {}
|
||||
void genericmultifunction (long other, char *bufptr, long messleng, long command) {}
|
||||
long getoutputcirclesize () { return(0); }
|
||||
void setsocket (long newsocket) { }
|
||||
void flushpackets () {}
|
||||
void sendlogon () {}
|
||||
void sendlogoff () {}
|
||||
void setpackettimeout(int datimeoutcount, int daresendagaincount) {}
|
||||
void genericmultifunction(int other, char *bufptr, int messleng, int command) {}
|
||||
int getoutputcirclesize() { return(0); }
|
||||
void setsocket(int newsocket) { }
|
||||
void flushpackets() {}
|
||||
void sendlogon() {}
|
||||
void sendlogoff() {}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
static long crctab16[256];
|
||||
static void initcrc16 ()
|
||||
static int crctab16[256];
|
||||
static void initcrc16()
|
||||
{
|
||||
long i, j, k, a;
|
||||
int i, j, k, a;
|
||||
for (j=0;j<256;j++)
|
||||
{
|
||||
for (i=7,k=(j<<8),a=0;i>=0;i--,k=((k<<1)&65535))
|
||||
|
@ -347,21 +347,21 @@ static void initcrc16 ()
|
|||
}
|
||||
}
|
||||
#define updatecrc16(crc,dat) crc = (((crc<<8)&65535)^crctab16[((((unsigned short)crc)>>8)&65535)^dat])
|
||||
static unsigned short getcrc16 (char *buffer, long bufleng)
|
||||
static unsigned short getcrc16(char *buffer, int bufleng)
|
||||
{
|
||||
long i, j;
|
||||
int i, j;
|
||||
|
||||
j = 0;
|
||||
for (i=bufleng-1;i>=0;i--) updatecrc16(j,buffer[i]);
|
||||
return((unsigned short)(j&65535));
|
||||
}
|
||||
|
||||
void uninitmultiplayers () { netuninit(); }
|
||||
void uninitmultiplayers() { netuninit(); }
|
||||
|
||||
long getpacket(long *, char *);
|
||||
int getpacket(int *, char *);
|
||||
static void initmultiplayers_reset(void)
|
||||
{
|
||||
long i;
|
||||
int i;
|
||||
|
||||
initcrc16();
|
||||
memset(icnt0,0,sizeof(icnt0));
|
||||
|
@ -393,23 +393,25 @@ static void initmultiplayers_reset(void)
|
|||
// 192.168.1.2 game /n1 192.168.1.100 game /n1 192.168.1.100 192.168.1.4
|
||||
// 192.168.1.100 game 192.168.1.2 /n1 game 192.168.1.2 /n1 192.168.1.4
|
||||
// 192.168.1.4 game 192.168.1.2 192.168.1.100 /n1
|
||||
long initmultiplayersparms(long argc, char **argv)
|
||||
int initmultiplayersparms(int argc, char **argv)
|
||||
{
|
||||
long i, j, daindex, portnum = NETPORT;
|
||||
int i, j, daindex, portnum = NETPORT;
|
||||
char *st;
|
||||
|
||||
initmultiplayers_reset();
|
||||
danetmode = 255; daindex = 0;
|
||||
|
||||
// go looking for the port, if specified
|
||||
for (i=0;i<argc;i++) {
|
||||
for (i=0;i<argc;i++)
|
||||
{
|
||||
if (argv[i][0] != '-' && argv[i][0] != '/') continue;
|
||||
if ((argv[i][1] == 'p' || argv[i][1] == 'P') && argv[i][2]) {
|
||||
if ((argv[i][1] == 'p' || argv[i][1] == 'P') && argv[i][2])
|
||||
{
|
||||
char *p;
|
||||
j = strtol(argv[i]+2, &p, 10);
|
||||
if (!(*p) && j > 1024 && j<65535) portnum = j;
|
||||
|
||||
printf("mmulti: Using port %ld\n", portnum);
|
||||
printf("mmulti: Using port %d\n", portnum);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -425,7 +427,8 @@ long initmultiplayersparms(long argc, char **argv)
|
|||
// { foundnet = 1; continue; }
|
||||
//if (!foundnet) continue;
|
||||
|
||||
if ((argv[i][0] == '-') || (argv[i][0] == '/')) {
|
||||
if ((argv[i][0] == '-') || (argv[i][0] == '/'))
|
||||
{
|
||||
if ((argv[i][1] == 'N') || (argv[i][1] == 'n') || (argv[i][1] == 'I') || (argv[i][1] == 'i'))
|
||||
{
|
||||
numplayers = 2;
|
||||
|
@ -436,7 +439,7 @@ long initmultiplayersparms(long argc, char **argv)
|
|||
{
|
||||
numplayers = (argv[i][4]-'0');
|
||||
if ((argv[i][5] >= '0') && (argv[i][5] <= '9')) numplayers = numplayers*10+(argv[i][5]-'0');
|
||||
printf("mmulti: %ld-player game\n", numplayers);
|
||||
printf("mmulti: %d-player game\n", numplayers);
|
||||
}
|
||||
printf("mmulti: Master-slave mode\n");
|
||||
}
|
||||
|
@ -455,12 +458,13 @@ long initmultiplayersparms(long argc, char **argv)
|
|||
if (isvalidipaddress(st))
|
||||
{
|
||||
if ((danetmode == 1) && (daindex == myconnectindex)) daindex++;
|
||||
for (j=0;st[j];j++) {
|
||||
for (j=0;st[j];j++)
|
||||
{
|
||||
if (st[j] == ':')
|
||||
{ otherport[daindex] = htons((unsigned short)atol(&st[j+1])); st[j] = 0; break; }
|
||||
{ otherport[daindex] = htons((unsigned short)atol(&st[j+1])); st[j] = 0; break; }
|
||||
}
|
||||
otherip[daindex] = inet_addr(st);
|
||||
printf("mmulti: Player %ld at %s:%d\n",daindex,st,ntohs(otherport[daindex]));
|
||||
printf("mmulti: Player %d at %s:%d\n",daindex,st,ntohs(otherport[daindex]));
|
||||
daindex++;
|
||||
}
|
||||
else
|
||||
|
@ -470,25 +474,26 @@ long initmultiplayersparms(long argc, char **argv)
|
|||
|
||||
for (j=0;st[j];j++)
|
||||
if (st[j] == ':')
|
||||
{ pt = htons((unsigned short)atol(&st[j+1])); st[j] = 0; break; }
|
||||
{ pt = htons((unsigned short)atol(&st[j+1])); st[j] = 0; break; }
|
||||
if ((lph = gethostbyname(st)))
|
||||
{
|
||||
if ((danetmode == 1) && (daindex == myconnectindex)) daindex++;
|
||||
otherip[daindex] = *(long *)lph->h_addr;
|
||||
otherip[daindex] = *(int *)lph->h_addr;
|
||||
otherport[daindex] = pt;
|
||||
printf("mmulti: Player %ld at %s:%d (%s)\n",daindex,
|
||||
printf("mmulti: Player %d at %s:%d (%s)\n",daindex,
|
||||
inet_ntoa(*(struct in_addr *)lph->h_addr),ntohs(pt),argv[i]);
|
||||
daindex++;
|
||||
} else printf("mmulti: Failed resolving %s\n",argv[i]);
|
||||
}
|
||||
else printf("mmulti: Failed resolving %s\n",argv[i]);
|
||||
}
|
||||
free(st);
|
||||
}
|
||||
if ((danetmode == 255) && (daindex)) { numplayers = 2; danetmode = 0; } //an IP w/o /n# defaults to /n0
|
||||
if ((danetmode == 255) && (daindex)) { numplayers = 2; danetmode = 0; } //an IP w/o /n# defaults to /n0
|
||||
if ((numplayers >= 2) && (daindex) && (!danetmode)) myconnectindex = 1;
|
||||
if (daindex > numplayers) numplayers = daindex;
|
||||
|
||||
//for(i=0;i<numplayers;i++)
|
||||
// printf("Player %d: %d.%d.%d.%d:%d\n",i,otherip[i]&255,(otherip[i]>>8)&255,(otherip[i]>>16)&255,((unsigned long)otherip[i])>>24,ntohs(otherport[i]));
|
||||
// printf("Player %d: %d.%d.%d.%d:%d\n",i,otherip[i]&255,(otherip[i]>>8)&255,(otherip[i]>>16)&255,((unsigned int)otherip[i])>>24,ntohs(otherport[i]));
|
||||
|
||||
connecthead = 0;
|
||||
for (i=0;i<numplayers-1;i++) connectpoint2[i] = i+1;
|
||||
|
@ -498,13 +503,13 @@ if ((danetmode == 255) && (daindex)) { numplayers = 2; danetmode = 0; } //an IP
|
|||
return (numplayers >= 2);
|
||||
}
|
||||
|
||||
long initmultiplayerscycle(void)
|
||||
int initmultiplayerscycle(void)
|
||||
{
|
||||
long i, k;
|
||||
extern long totalclock;
|
||||
int i, k;
|
||||
extern int totalclock;
|
||||
|
||||
idle();
|
||||
|
||||
|
||||
getpacket(&i,0);
|
||||
|
||||
tims = GetTickCount();
|
||||
|
@ -512,7 +517,8 @@ long initmultiplayerscycle(void)
|
|||
{
|
||||
for (i=numplayers-1;i>0;i--)
|
||||
if (!otherip[i]) break;
|
||||
if (!i) {
|
||||
if (!i)
|
||||
{
|
||||
nfIncCP(); //Addfaz NatFree
|
||||
netready = 1; //Player 0 is ready
|
||||
return 0;
|
||||
|
@ -527,11 +533,11 @@ long initmultiplayerscycle(void)
|
|||
lastsendtims[connecthead] = tims;
|
||||
|
||||
// short crc16ofs; //offset of crc16
|
||||
// long icnt0; //-1 (special packet for MMULTI.C's player collection)
|
||||
// int icnt0; //-1 (special packet for MMULTI.C's player collection)
|
||||
// ...
|
||||
// unsigned short crc16; //CRC16 of everything except crc16
|
||||
k = 2;
|
||||
*(long *)&pakbuf[k] = -1; k += 4;
|
||||
*(int *)&pakbuf[k] = -1; k += 4;
|
||||
pakbuf[k++] = 0xaa;
|
||||
*(unsigned short *)&pakbuf[0] = (unsigned short)k;
|
||||
*(unsigned short *)&pakbuf[k] = getcrc16(pakbuf,k); k += 2;
|
||||
|
@ -542,9 +548,9 @@ long initmultiplayerscycle(void)
|
|||
return 1;
|
||||
}
|
||||
|
||||
void initmultiplayers (long argc, char **argv, char damultioption, char dacomrateoption, char dapriority)
|
||||
void initmultiplayers(int argc, char **argv, char damultioption, char dacomrateoption, char dapriority)
|
||||
{
|
||||
long i, j, k, otims;
|
||||
int i, j, k, otims;
|
||||
|
||||
if (initmultiplayersparms(argc,argv))
|
||||
{
|
||||
|
@ -552,7 +558,7 @@ void initmultiplayers (long argc, char **argv, char damultioption, char dacomrat
|
|||
//Console code seems to crash Win98 upon quitting game
|
||||
//it's not necessary and it's not portable anyway
|
||||
char tbuf[1024];
|
||||
unsigned long u;
|
||||
unsigned int u;
|
||||
HANDLE hconsout;
|
||||
AllocConsole();
|
||||
SetConsoleTitle("Multiplayer status...");
|
||||
|
@ -570,7 +576,7 @@ void initmultiplayers (long argc, char **argv, char damultioption, char dacomrat
|
|||
{
|
||||
if (i == myconnectindex) { strcat(tbuf,"<me> "); continue; }
|
||||
if (!otherip[i]) { strcat(tbuf,"?.?.?.?:? "); continue; }
|
||||
sprintf(&tbuf[strlen(tbuf)],"%d.%d.%d.%d:%04x ",otherip[i]&255,(otherip[i]>>8)&255,(otherip[i]>>16)&255,(((unsigned long)otherip[i])>>24),otherport[i]);
|
||||
sprintf(&tbuf[strlen(tbuf)],"%d.%d.%d.%d:%04x ",otherip[i]&255,(otherip[i]>>8)&255,(otherip[i]>>16)&255,(((unsigned int)otherip[i])>>24),otherport[i]);
|
||||
}
|
||||
WriteConsole(hconsout,tbuf,strlen(tbuf),&u,0);
|
||||
}
|
||||
|
@ -583,19 +589,19 @@ void initmultiplayers (long argc, char **argv, char damultioption, char dacomrat
|
|||
netready = 1;
|
||||
}
|
||||
|
||||
void dosendpackets (long other) //Host to send intially, client to send to others once heard from host.
|
||||
void dosendpackets(int other) //Host to send intially, client to send to others once heard from host.
|
||||
{
|
||||
long i, j, k;
|
||||
int i, j, k;
|
||||
|
||||
if (!otherip[other]) return;
|
||||
|
||||
//Packet format:
|
||||
// short crc16ofs; //offset of crc16
|
||||
// long icnt0; //earliest unacked packet
|
||||
// int icnt0; //earliest unacked packet
|
||||
// char ibits[32]; //ack status of packets icnt0<=i<icnt0+256
|
||||
// while (short leng) //leng: !=0 for packet, 0 for no more packets
|
||||
// {
|
||||
// long ocnt; //index of following packet data
|
||||
// int ocnt; //index of following packet data
|
||||
// char pak[leng]; //actual packet data :)
|
||||
// }
|
||||
// unsigned short crc16; //CRC16 of everything except crc16
|
||||
|
@ -607,7 +613,7 @@ void dosendpackets (long other) //Host to send intially, client to send to other
|
|||
lastsendtims[other] = tims;
|
||||
|
||||
k = 2;
|
||||
*(long *)&pakbuf[k] = icnt0[other]; k += 4;
|
||||
*(int *)&pakbuf[k] = icnt0[other]; k += 4;
|
||||
memset(&pakbuf[k],0,32);
|
||||
for (i=icnt0[other];i<icnt0[other]+256;i++)
|
||||
if (ipak[other][i&(FIFSIZ-1)])
|
||||
|
@ -618,10 +624,10 @@ void dosendpackets (long other) //Host to send intially, client to send to other
|
|||
for (i=ocnt0[other];i<ocnt1[other];i++)
|
||||
{
|
||||
j = *(short *)&pakmem[opak[other][i&(FIFSIZ-1)]]; if (!j) continue; //packet already acked
|
||||
if (k+6+j+4 > (long)sizeof(pakbuf)) break;
|
||||
if (k+6+j+4 > (int)sizeof(pakbuf)) break;
|
||||
|
||||
*(unsigned short *)&pakbuf[k] = (unsigned short)j; k += 2;
|
||||
*(long *)&pakbuf[k] = i; k += 4;
|
||||
*(int *)&pakbuf[k] = i; k += 4;
|
||||
memcpy(&pakbuf[k],&pakmem[opak[other][i&(FIFSIZ-1)]+2],j); k += j;
|
||||
}
|
||||
*(unsigned short *)&pakbuf[k] = 0; k += 2;
|
||||
|
@ -636,13 +642,13 @@ void dosendpackets (long other) //Host to send intially, client to send to other
|
|||
/*Addfaz NatFree End*/
|
||||
}
|
||||
|
||||
void sendpacket (long other, char *bufptr, long messleng)
|
||||
void sendpacket(int other, char *bufptr, int messleng)
|
||||
{
|
||||
long i, j;
|
||||
int i, j;
|
||||
|
||||
if (numplayers < 2) return;
|
||||
|
||||
if (pakmemi+messleng+2 > (long)sizeof(pakmem)) pakmemi = 1;
|
||||
if (pakmemi+messleng+2 > (int)sizeof(pakmem)) pakmemi = 1;
|
||||
opak[other][ocnt1[other]&(FIFSIZ-1)] = pakmemi;
|
||||
*(short *)&pakmem[pakmemi] = messleng;
|
||||
memcpy(&pakmem[pakmemi+2],bufptr,messleng); pakmemi += messleng+2;
|
||||
|
@ -655,9 +661,9 @@ void sendpacket (long other, char *bufptr, long messleng)
|
|||
|
||||
//passing bufptr == 0 enables receive&sending raw packets but does not return any received packets
|
||||
//(used as hack for player collection)
|
||||
long getpacket (long *retother, char *bufptr)
|
||||
int getpacket(int *retother, char *bufptr)
|
||||
{
|
||||
long i, j, k, ic0, crc16ofs, messleng, other;
|
||||
int i, j, k, ic0, crc16ofs, messleng, other;
|
||||
|
||||
if (numplayers < 2) return(0);
|
||||
|
||||
|
@ -674,22 +680,22 @@ long getpacket (long *retother, char *bufptr)
|
|||
{
|
||||
//Packet format:
|
||||
// short crc16ofs; //offset of crc16
|
||||
// long icnt0; //earliest unacked packet
|
||||
// int icnt0; //earliest unacked packet
|
||||
// char ibits[32]; //ack status of packets icnt0<=i<icnt0+256
|
||||
// while (short leng) //leng: !=0 for packet, 0 for no more packets
|
||||
// {
|
||||
// long ocnt; //index of following packet data
|
||||
// int ocnt; //index of following packet data
|
||||
// char pak[leng]; //actual packet data :)
|
||||
// }
|
||||
// unsigned short crc16; //CRC16 of everything except crc16
|
||||
k = 0;
|
||||
crc16ofs = (long)(*(unsigned short *)&pakbuf[k]); k += 2;
|
||||
crc16ofs = (int)(*(unsigned short *)&pakbuf[k]); k += 2;
|
||||
|
||||
//printf("Recv: "); for(i=0;i<crc16ofs+2;i++) printf("%02x ",pakbuf[i]); printf("\n");
|
||||
|
||||
if ((crc16ofs+2 <= (long)sizeof(pakbuf)) && (getcrc16(pakbuf,crc16ofs) == (*(unsigned short *)&pakbuf[crc16ofs])))
|
||||
if ((crc16ofs+2 <= (int)sizeof(pakbuf)) && (getcrc16(pakbuf,crc16ofs) == (*(unsigned short *)&pakbuf[crc16ofs])))
|
||||
{
|
||||
ic0 = *(long *)&pakbuf[k]; k += 4;
|
||||
ic0 = *(int *)&pakbuf[k]; k += 4;
|
||||
if (ic0 == -1)
|
||||
{
|
||||
//Slave sends 0xaa to Master at initmultiplayers() and waits for 0xab response
|
||||
|
@ -704,11 +710,11 @@ long getpacket (long *retother, char *bufptr)
|
|||
otherport[other] = snatchport;
|
||||
|
||||
// short crc16ofs; //offset of crc16
|
||||
// long icnt0; //-1 (special packet for MMULTI.C's player collection)
|
||||
// int icnt0; //-1 (special packet for MMULTI.C's player collection)
|
||||
// ...
|
||||
// unsigned short crc16; //CRC16 of everything except crc16
|
||||
k = 2;
|
||||
*(long *)&pakbuf[k] = -1; k += 4;
|
||||
*(int *)&pakbuf[k] = -1; k += 4;
|
||||
pakbuf[k++] = 0xab;
|
||||
pakbuf[k++] = (char)other;
|
||||
pakbuf[k++] = (char)numplayers;
|
||||
|
@ -731,11 +737,11 @@ long getpacket (long *retother, char *bufptr)
|
|||
}
|
||||
else if ((pakbuf[k] == 0xab) && (myconnectindex != connecthead))
|
||||
{
|
||||
if (((unsigned long)pakbuf[k+1] < (unsigned long)pakbuf[k+2]) &&
|
||||
((unsigned long)pakbuf[k+2] < (unsigned long)MAXPLAYERS))
|
||||
if (((unsigned int)pakbuf[k+1] < (unsigned int)pakbuf[k+2]) &&
|
||||
((unsigned int)pakbuf[k+2] < (unsigned int)MAXPLAYERS))
|
||||
{
|
||||
myconnectindex = (long)pakbuf[k+1];
|
||||
numplayers = (long)pakbuf[k+2];
|
||||
myconnectindex = (int)pakbuf[k+1];
|
||||
numplayers = (int)pakbuf[k+2];
|
||||
|
||||
connecthead = 0;
|
||||
for (i=0;i<numplayers-1;i++) connectpoint2[i] = i+1;
|
||||
|
@ -765,19 +771,19 @@ long getpacket (long *retother, char *bufptr)
|
|||
opak[other][i&(FIFSIZ-1)] = 0;
|
||||
k += 32;
|
||||
|
||||
messleng = (long)(*(unsigned short *)&pakbuf[k]); k += 2;
|
||||
messleng = (int)(*(unsigned short *)&pakbuf[k]); k += 2;
|
||||
while (messleng)
|
||||
{
|
||||
j = *(long *)&pakbuf[k]; k += 4;
|
||||
j = *(int *)&pakbuf[k]; k += 4;
|
||||
if ((j >= icnt0[other]) && (!ipak[other][j&(FIFSIZ-1)]))
|
||||
{
|
||||
if (pakmemi+messleng+2 > (long)sizeof(pakmem)) pakmemi = 1;
|
||||
if (pakmemi+messleng+2 > (int)sizeof(pakmem)) pakmemi = 1;
|
||||
ipak[other][j&(FIFSIZ-1)] = pakmemi;
|
||||
*(short *)&pakmem[pakmemi] = messleng;
|
||||
memcpy(&pakmem[pakmemi+2],&pakbuf[k],messleng); pakmemi += messleng+2;
|
||||
}
|
||||
k += messleng;
|
||||
messleng = (long)(*(unsigned short *)&pakbuf[k]); k += 2;
|
||||
messleng = (int)(*(unsigned short *)&pakbuf[k]); k += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -829,7 +835,8 @@ int getexternaladdress(char *buffer)
|
|||
{
|
||||
WSADATA ws;
|
||||
|
||||
if (WSAStartup(0x101,&ws) == SOCKET_ERROR) {
|
||||
if (WSAStartup(0x101,&ws) == SOCKET_ERROR)
|
||||
{
|
||||
initprintf("mmulti: Winsock error in getexternaladdress() (%d)\n",errno);
|
||||
return(0);
|
||||
}
|
||||
|
@ -837,7 +844,8 @@ int getexternaladdress(char *buffer)
|
|||
}
|
||||
#endif
|
||||
|
||||
if ((h=gethostbyname(host)) == NULL) {
|
||||
if ((h=gethostbyname(host)) == NULL)
|
||||
{
|
||||
initprintf("mmulti: gethostbyname() error in getexternaladdress() (%d)\n",h_errno);
|
||||
return(0);
|
||||
}
|
||||
|
@ -850,19 +858,22 @@ int getexternaladdress(char *buffer)
|
|||
|
||||
|
||||
mysock = socket(PF_INET, SOCK_STREAM, 0);
|
||||
|
||||
if (mysock == INVALID_SOCKET) {
|
||||
|
||||
if (mysock == INVALID_SOCKET)
|
||||
{
|
||||
initprintf("mmulti: socket() error in getexternaladdress() (%d)\n",errno);
|
||||
return(0);
|
||||
}
|
||||
|
||||
if (connect(mysock, (struct sockaddr *)&dest_addr, sizeof(struct sockaddr)) == SOCKET_ERROR) {
|
||||
if (connect(mysock, (struct sockaddr *)&dest_addr, sizeof(struct sockaddr)) == SOCKET_ERROR)
|
||||
{
|
||||
initprintf("mmulti: connect() error in getexternaladdress() (%d)\n",errno);
|
||||
return(0);
|
||||
}
|
||||
|
||||
bytes_sent = send(mysock, req, strlen(req), 0);
|
||||
if (bytes_sent == SOCKET_ERROR) {
|
||||
if (bytes_sent == SOCKET_ERROR)
|
||||
{
|
||||
initprintf("mmulti: send() error in getexternaladdress() (%d)\n",errno);
|
||||
return(0);
|
||||
}
|
||||
|
@ -903,7 +914,8 @@ int getversionfromwebsite(char *buffer) // FIXME: this probably belongs in game
|
|||
{
|
||||
WSADATA ws;
|
||||
|
||||
if (WSAStartup(0x101,&ws) == SOCKET_ERROR) {
|
||||
if (WSAStartup(0x101,&ws) == SOCKET_ERROR)
|
||||
{
|
||||
initprintf("update: Winsock error in getversionfromwebsite() (%d)\n",errno);
|
||||
return(0);
|
||||
}
|
||||
|
@ -911,7 +923,8 @@ int getversionfromwebsite(char *buffer) // FIXME: this probably belongs in game
|
|||
}
|
||||
#endif
|
||||
|
||||
if ((h=gethostbyname(host)) == NULL) {
|
||||
if ((h=gethostbyname(host)) == NULL)
|
||||
{
|
||||
initprintf("update: gethostbyname() error in getversionfromwebsite() (%d)\n",h_errno);
|
||||
return(0);
|
||||
}
|
||||
|
@ -924,19 +937,22 @@ int getversionfromwebsite(char *buffer) // FIXME: this probably belongs in game
|
|||
|
||||
|
||||
mysock = socket(PF_INET, SOCK_STREAM, 0);
|
||||
|
||||
if (mysock == INVALID_SOCKET) {
|
||||
|
||||
if (mysock == INVALID_SOCKET)
|
||||
{
|
||||
initprintf("update: socket() error in getversionfromwebsite() (%d)\n",errno);
|
||||
return(0);
|
||||
}
|
||||
|
||||
if (connect(mysock, (struct sockaddr *)&dest_addr, sizeof(struct sockaddr)) == SOCKET_ERROR) {
|
||||
if (connect(mysock, (struct sockaddr *)&dest_addr, sizeof(struct sockaddr)) == SOCKET_ERROR)
|
||||
{
|
||||
initprintf("update: connect() error in getversionfromwebsite() (%d)\n",errno);
|
||||
return(0);
|
||||
}
|
||||
|
||||
bytes_sent = send(mysock, req, strlen(req), 0);
|
||||
if (bytes_sent == SOCKET_ERROR) {
|
||||
if (bytes_sent == SOCKET_ERROR)
|
||||
{
|
||||
initprintf("update: send() error in getversionfromwebsite() (%d)\n",errno);
|
||||
return(0);
|
||||
}
|
||||
|
@ -944,14 +960,15 @@ int getversionfromwebsite(char *buffer) // FIXME: this probably belongs in game
|
|||
// initprintf("sent %d bytes\n",bytes_sent);
|
||||
recv(mysock, (char *)&tempbuf, sizeof(tempbuf), 0);
|
||||
closesocket(mysock);
|
||||
|
||||
|
||||
memcpy(&otherbuf,&tempbuf,sizeof(otherbuf));
|
||||
|
||||
|
||||
strtok(otherbuf," ");
|
||||
if (atol(strtok(NULL," ")) == 200)
|
||||
{
|
||||
{
|
||||
for (i=0;(unsigned)i<strlen(tempbuf);i++) // HACK: all of this needs to die a fiery death; we just skip to the content
|
||||
{ // instead of actually parsing any of the http headers
|
||||
{
|
||||
// instead of actually parsing any of the http headers
|
||||
if (i > 4)
|
||||
if (tempbuf[i-1] == '\n' && tempbuf[i-2] == '\r' && tempbuf[i-3] == '\n' && tempbuf[i-4] == '\r')
|
||||
{
|
||||
|
@ -960,11 +977,11 @@ int getversionfromwebsite(char *buffer) // FIXME: this probably belongs in game
|
|||
ver[j] = tempbuf[i];
|
||||
i++, j++;
|
||||
}
|
||||
ver[j] = '\0';
|
||||
ver[j] = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (j)
|
||||
{
|
||||
strcpy(buffer,ver);
|
||||
|
|
|
@ -9,32 +9,32 @@
|
|||
#include "mmulti.h"
|
||||
|
||||
|
||||
long myconnectindex, numplayers;
|
||||
long connecthead, connectpoint2[MAXMULTIPLAYERS];
|
||||
int myconnectindex, numplayers;
|
||||
int connecthead, connectpoint2[MAXMULTIPLAYERS];
|
||||
char syncstate = 0;
|
||||
|
||||
long isvalidipaddress (char *st)
|
||||
int isvalidipaddress(char *st)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
long initmultiplayersparms(long argc, char **argv)
|
||||
int initmultiplayersparms(int argc, char **argv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
long initmultiplayerscycle(void)
|
||||
int initmultiplayerscycle(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void initmultiplayers(long argc, char **argv, char damultioption, char dacomrateoption, char dapriority)
|
||||
void initmultiplayers(int argc, char **argv, char damultioption, char dacomrateoption, char dapriority)
|
||||
{
|
||||
numplayers = 1; myconnectindex = 0;
|
||||
connecthead = 0; connectpoint2[0] = -1;
|
||||
}
|
||||
|
||||
void setpackettimeout(long datimeoutcount, long daresendagaincount)
|
||||
void setpackettimeout(int datimeoutcount, int daresendagaincount)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ void sendlogoff(void)
|
|||
{
|
||||
}
|
||||
|
||||
long getoutputcirclesize(void)
|
||||
int getoutputcirclesize(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -59,11 +59,11 @@ void setsocket(short newsocket)
|
|||
{
|
||||
}
|
||||
|
||||
void sendpacket(long other, char *bufptr, long messleng)
|
||||
void sendpacket(int other, char *bufptr, int messleng)
|
||||
{
|
||||
}
|
||||
|
||||
long getpacket (long *other, char *bufptr)
|
||||
int getpacket(int *other, char *bufptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ void flushpackets(void)
|
|||
{
|
||||
}
|
||||
|
||||
void genericmultifunction(long other, char *bufptr, long messleng, long command)
|
||||
void genericmultifunction(int other, char *bufptr, int messleng, int command)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
#include "baselayer.h"
|
||||
|
||||
|
||||
typedef struct _symbol {
|
||||
typedef struct _symbol
|
||||
{
|
||||
const char *name;
|
||||
struct _symbol *next;
|
||||
|
||||
|
@ -61,7 +62,7 @@ static BFILE *osdlog=NULL; // log filehandle
|
|||
static char osdinited=0; // text buffer initialised?
|
||||
static int osdkey=0x29; // tilde shows the osd
|
||||
static int keytime=0;
|
||||
static long osdscrtime = 0;
|
||||
static int osdscrtime = 0;
|
||||
|
||||
// command prompt editing
|
||||
#define EDITLENGTH 512
|
||||
|
@ -114,7 +115,8 @@ static void _internal_drawosdchar(int x, int y, char ch, int shade, int pal)
|
|||
|
||||
st[0] = ch;
|
||||
|
||||
if (white<0) {
|
||||
if (white<0)
|
||||
{
|
||||
// find the palette index closest to white
|
||||
k=0;
|
||||
for (i=0;i<256;i++)
|
||||
|
@ -136,7 +138,8 @@ static void _internal_drawosdstr(int x, int y, char *ch, int len, int shade, int
|
|||
memcpy(st,ch,len);
|
||||
st[len]=0;
|
||||
|
||||
if (white<0) {
|
||||
if (white<0)
|
||||
{
|
||||
// find the palette index closest to white
|
||||
k=0;
|
||||
for (i=0;i<256;i++)
|
||||
|
@ -156,7 +159,8 @@ static void _internal_drawosdcursor(int x, int y, int type, int lastkeypress)
|
|||
|
||||
if (type) st[0] = '#';
|
||||
|
||||
if (white<0) {
|
||||
if (white<0)
|
||||
{
|
||||
// find the palette index closest to white
|
||||
k=0;
|
||||
for (i=0;i<256;i++)
|
||||
|
@ -198,9 +202,11 @@ static int _internal_osdfunc_vars(const osdfuncparm_t *parm)
|
|||
{
|
||||
int showval = (parm->numparms < 1);
|
||||
|
||||
if (!Bstrcasecmp(parm->name, "osdrows")) {
|
||||
if (!Bstrcasecmp(parm->name, "osdrows"))
|
||||
{
|
||||
if (showval) { OSD_Printf("osdrows is %d\n", osdrows); return OSDCMD_OK; }
|
||||
else {
|
||||
else
|
||||
{
|
||||
osdrows = atoi(parm->parms[0]);
|
||||
if (osdrows < 1) osdrows = 1;
|
||||
else if (osdrows > osdmaxrows) osdrows = osdmaxrows;
|
||||
|
@ -228,9 +234,12 @@ static int _internal_osdfunc_help(const osdfuncparm_t *parm)
|
|||
|
||||
if (parm->numparms != 1) return OSDCMD_SHOWHELP;
|
||||
symb = findexactsymbol(parm->parms[0]);
|
||||
if (!symb) {
|
||||
if (!symb)
|
||||
{
|
||||
OSD_Printf("Help Error: \"%s\" is not a defined variable or function\n", parm->parms[0]);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
OSD_Printf("%s\n", symb->help);
|
||||
}
|
||||
|
||||
|
@ -254,7 +263,8 @@ void OSD_Cleanup(void)
|
|||
{
|
||||
symbol_t *s;
|
||||
|
||||
for (; symbols; symbols=s) {
|
||||
for (; symbols; symbols=s)
|
||||
{
|
||||
s=symbols->next;
|
||||
Bfree(symbols);
|
||||
}
|
||||
|
@ -372,23 +382,28 @@ int OSD_HandleKey(int sc, int press)
|
|||
|
||||
if (!osdinited) return sc;
|
||||
|
||||
if (sc == osdkey) {
|
||||
if (press) {
|
||||
if (sc == osdkey)
|
||||
{
|
||||
if (press)
|
||||
{
|
||||
osdscroll = -osdscroll;
|
||||
if (osdrowscur == -1)
|
||||
osdscroll = 1;
|
||||
else if (osdrowscur == osdrows)
|
||||
osdscroll = -1;
|
||||
osdrowscur += osdscroll;
|
||||
osdrowscur += osdscroll;
|
||||
OSD_CaptureInput(osdscroll == 1);
|
||||
osdscrtime = getticks();
|
||||
}
|
||||
return 0;//sc;
|
||||
} else if (!osdinput) {
|
||||
}
|
||||
else if (!osdinput)
|
||||
{
|
||||
return sc;
|
||||
}
|
||||
|
||||
if (!press) {
|
||||
if (!press)
|
||||
{
|
||||
if (sc == 42 || sc == 54) // shift
|
||||
osdeditshift = 0;
|
||||
if (sc == 29 || sc == 157) // control
|
||||
|
@ -400,22 +415,36 @@ int OSD_HandleKey(int sc, int press)
|
|||
|
||||
if (sc != 15) lastmatch = NULL; // tab
|
||||
|
||||
while ( (ch = bgetchar()) ) {
|
||||
if (ch == 1) { // control a. jump to beginning of line
|
||||
} else if (ch == 2) { // control b, move one character left
|
||||
} else if (ch == 5) { // control e, jump to end of line
|
||||
} else if (ch == 6) { // control f, move one character right
|
||||
} else if (ch == 8 || ch == 127) { // control h, backspace
|
||||
while ((ch = bgetchar()))
|
||||
{
|
||||
if (ch == 1) // control a. jump to beginning of line
|
||||
{
|
||||
}
|
||||
else if (ch == 2) // control b, move one character left
|
||||
{
|
||||
}
|
||||
else if (ch == 5) // control e, jump to end of line
|
||||
{
|
||||
}
|
||||
else if (ch == 6) // control f, move one character right
|
||||
{
|
||||
}
|
||||
else if (ch == 8 || ch == 127) // control h, backspace
|
||||
{
|
||||
if (!osdeditcursor || !osdeditlen) return 0;
|
||||
if (!osdovertype) {
|
||||
if (!osdovertype)
|
||||
{
|
||||
if (osdeditcursor < osdeditlen)
|
||||
Bmemmove(osdeditbuf+osdeditcursor-1, osdeditbuf+osdeditcursor, osdeditlen-osdeditcursor);
|
||||
osdeditlen--;
|
||||
}
|
||||
osdeditcursor--;
|
||||
if (osdeditcursor<osdeditwinstart) osdeditwinstart--,osdeditwinend--;
|
||||
} else if (ch == 9) { // tab
|
||||
if (!lastmatch) {
|
||||
}
|
||||
else if (ch == 9) // tab
|
||||
{
|
||||
if (!lastmatch)
|
||||
{
|
||||
for (i=osdeditcursor;i>0;i--) if (osdeditbuf[i-1] == ' ') break;
|
||||
for (j=0;osdeditbuf[i] != ' ' && i < osdeditlen;j++,i++)
|
||||
osdedittmp[j] = osdeditbuf[i];
|
||||
|
@ -424,7 +453,7 @@ int OSD_HandleKey(int sc, int press)
|
|||
if (j > 0)
|
||||
{
|
||||
tabc = findsymbol(osdedittmp, NULL);
|
||||
|
||||
|
||||
if (tabc)
|
||||
{
|
||||
if (tabc->next)
|
||||
|
@ -438,19 +467,22 @@ int OSD_HandleKey(int sc, int press)
|
|||
{
|
||||
OSD_Printf(" %s\n", symb->name);
|
||||
lastmatch = symb;
|
||||
symb=findsymbol(osdedittmp, lastmatch->next);
|
||||
symb=findsymbol(osdedittmp, lastmatch->next);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
tabc = findsymbol(osdedittmp, lastmatch->next);
|
||||
if (!tabc && lastmatch)
|
||||
tabc = findsymbol(osdedittmp, NULL); // wrap
|
||||
}
|
||||
|
||||
if (tabc) {
|
||||
if (tabc)
|
||||
{
|
||||
for (i=osdeditcursor;i>0;i--) if (osdeditbuf[i-1] == ' ') break;
|
||||
osdeditlen = i;
|
||||
for (j=0;tabc->name[j] && osdeditlen <= EDITLENGTH;i++,j++,osdeditlen++)
|
||||
|
@ -458,19 +490,27 @@ int OSD_HandleKey(int sc, int press)
|
|||
osdeditcursor = osdeditlen;
|
||||
osdeditwinend = osdeditcursor;
|
||||
osdeditwinstart = osdeditwinend-editlinewidth;
|
||||
if (osdeditwinstart<0) {
|
||||
if (osdeditwinstart<0)
|
||||
{
|
||||
osdeditwinstart=0;
|
||||
osdeditwinend = editlinewidth;
|
||||
}
|
||||
|
||||
lastmatch = tabc;
|
||||
}
|
||||
} else if (ch == 11) { // control k, delete all to end of line
|
||||
} else if (ch == 12) { // control l, clear screen
|
||||
}
|
||||
else if (ch == 11) // control k, delete all to end of line
|
||||
{
|
||||
}
|
||||
else if (ch == 12) // control l, clear screen
|
||||
{
|
||||
Bmemset(osdtext,0,sizeof(osdtext));
|
||||
osdlines = 1;
|
||||
} else if (ch == 13) { // control m, enter
|
||||
if (osdeditlen>0) {
|
||||
}
|
||||
else if (ch == 13) // control m, enter
|
||||
{
|
||||
if (osdeditlen>0)
|
||||
{
|
||||
osdeditbuf[osdeditlen] = 0;
|
||||
Bmemmove(osdhistorybuf[1], osdhistorybuf[0], HISTORYDEPTH*(EDITLENGTH+1));
|
||||
Bmemmove(osdhistorybuf[0], osdeditbuf, EDITLENGTH+1);
|
||||
|
@ -487,10 +527,17 @@ int OSD_HandleKey(int sc, int press)
|
|||
osdeditcursor=0;
|
||||
osdeditwinstart=0;
|
||||
osdeditwinend=editlinewidth;
|
||||
} else if (ch == 16) { // control p, previous (ie. up arrow)
|
||||
} else if (ch == 20) { // control t, swap previous two chars
|
||||
} else if (ch == 21) { // control u, delete all to beginning
|
||||
if (osdeditcursor>0 && osdeditlen) {
|
||||
}
|
||||
else if (ch == 16) // control p, previous (ie. up arrow)
|
||||
{
|
||||
}
|
||||
else if (ch == 20) // control t, swap previous two chars
|
||||
{
|
||||
}
|
||||
else if (ch == 21) // control u, delete all to beginning
|
||||
{
|
||||
if (osdeditcursor>0 && osdeditlen)
|
||||
{
|
||||
if (osdeditcursor<osdeditlen)
|
||||
Bmemmove(osdeditbuf, osdeditbuf+osdeditcursor, osdeditlen-osdeditcursor);
|
||||
osdeditlen-=osdeditcursor;
|
||||
|
@ -498,8 +545,11 @@ int OSD_HandleKey(int sc, int press)
|
|||
osdeditwinstart = 0;
|
||||
osdeditwinend = editlinewidth;
|
||||
}
|
||||
} else if (ch == 23) { // control w, delete one word back
|
||||
if (osdeditcursor>0 && osdeditlen>0) {
|
||||
}
|
||||
else if (ch == 23) // control w, delete one word back
|
||||
{
|
||||
if (osdeditcursor>0 && osdeditlen>0)
|
||||
{
|
||||
i=osdeditcursor;
|
||||
while (i>0 && osdeditbuf[i-1]==32) i--;
|
||||
while (i>0 && osdeditbuf[i-1]!=32) i--;
|
||||
|
@ -507,20 +557,26 @@ int OSD_HandleKey(int sc, int press)
|
|||
Bmemmove(osdeditbuf+i, osdeditbuf+osdeditcursor, osdeditlen-osdeditcursor);
|
||||
osdeditlen -= (osdeditcursor-i);
|
||||
osdeditcursor = i;
|
||||
if (osdeditcursor < osdeditwinstart) {
|
||||
if (osdeditcursor < osdeditwinstart)
|
||||
{
|
||||
osdeditwinstart=osdeditcursor;
|
||||
osdeditwinend=osdeditwinstart+editlinewidth;
|
||||
}
|
||||
}
|
||||
} else if (ch >= 32) { // text char
|
||||
}
|
||||
else if (ch >= 32) // text char
|
||||
{
|
||||
if (!osdovertype && osdeditlen == EDITLENGTH) // buffer full, can't insert another char
|
||||
return 0;
|
||||
|
||||
if (!osdovertype) {
|
||||
if (!osdovertype)
|
||||
{
|
||||
if (osdeditcursor < osdeditlen)
|
||||
Bmemmove(osdeditbuf+osdeditcursor+1, osdeditbuf+osdeditcursor, osdeditlen-osdeditcursor);
|
||||
osdeditlen++;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
if (osdeditcursor == osdeditlen)
|
||||
osdeditlen++;
|
||||
}
|
||||
|
@ -530,124 +586,183 @@ int OSD_HandleKey(int sc, int press)
|
|||
}
|
||||
}
|
||||
|
||||
if (sc == 15) { // tab
|
||||
} else if (sc == 1) { // escape
|
||||
// OSD_ShowDisplay(0);
|
||||
osdscroll = -1;
|
||||
osdrowscur += osdscroll;
|
||||
OSD_CaptureInput(0);
|
||||
osdscrtime = getticks();
|
||||
} else if (sc == 201) { // page up
|
||||
if (sc == 15) // tab
|
||||
{
|
||||
}
|
||||
else if (sc == 1) // escape
|
||||
{
|
||||
// OSD_ShowDisplay(0);
|
||||
osdscroll = -1;
|
||||
osdrowscur += osdscroll;
|
||||
OSD_CaptureInput(0);
|
||||
osdscrtime = getticks();
|
||||
}
|
||||
else if (sc == 201) // page up
|
||||
{
|
||||
if (osdhead < osdlines-1)
|
||||
osdhead++;
|
||||
} else if (sc == 209) { // page down
|
||||
}
|
||||
else if (sc == 209) // page down
|
||||
{
|
||||
if (osdhead > 0)
|
||||
osdhead--;
|
||||
} else if (sc == 199) { // home
|
||||
if (osdeditcontrol) {
|
||||
}
|
||||
else if (sc == 199) // home
|
||||
{
|
||||
if (osdeditcontrol)
|
||||
{
|
||||
osdhead = osdlines-1;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
osdeditcursor = 0;
|
||||
osdeditwinstart = osdeditcursor;
|
||||
osdeditwinend = osdeditwinstart+editlinewidth;
|
||||
}
|
||||
} else if (sc == 207) { // end
|
||||
if (osdeditcontrol) {
|
||||
}
|
||||
else if (sc == 207) // end
|
||||
{
|
||||
if (osdeditcontrol)
|
||||
{
|
||||
osdhead = 0;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
osdeditcursor = osdeditlen;
|
||||
osdeditwinend = osdeditcursor;
|
||||
osdeditwinstart = osdeditwinend-editlinewidth;
|
||||
if (osdeditwinstart<0) {
|
||||
if (osdeditwinstart<0)
|
||||
{
|
||||
osdeditwinstart=0;
|
||||
osdeditwinend = editlinewidth;
|
||||
}
|
||||
}
|
||||
} else if (sc == 210) { // insert
|
||||
}
|
||||
else if (sc == 210) // insert
|
||||
{
|
||||
osdovertype ^= 1;
|
||||
} else if (sc == 203) { // left
|
||||
if (osdeditcursor>0) {
|
||||
if (osdeditcontrol) {
|
||||
while (osdeditcursor>0) {
|
||||
}
|
||||
else if (sc == 203) // left
|
||||
{
|
||||
if (osdeditcursor>0)
|
||||
{
|
||||
if (osdeditcontrol)
|
||||
{
|
||||
while (osdeditcursor>0)
|
||||
{
|
||||
if (osdeditbuf[osdeditcursor-1] != 32) break;
|
||||
osdeditcursor--;
|
||||
}
|
||||
while (osdeditcursor>0) {
|
||||
while (osdeditcursor>0)
|
||||
{
|
||||
if (osdeditbuf[osdeditcursor-1] == 32) break;
|
||||
osdeditcursor--;
|
||||
}
|
||||
} else osdeditcursor--;
|
||||
}
|
||||
else osdeditcursor--;
|
||||
}
|
||||
if (osdeditcursor<osdeditwinstart)
|
||||
osdeditwinend-=(osdeditwinstart-osdeditcursor),
|
||||
osdeditwinstart-=(osdeditwinstart-osdeditcursor);
|
||||
} else if (sc == 205) { // right
|
||||
if (osdeditcursor<osdeditlen) {
|
||||
if (osdeditcontrol) {
|
||||
while (osdeditcursor<osdeditlen) {
|
||||
}
|
||||
else if (sc == 205) // right
|
||||
{
|
||||
if (osdeditcursor<osdeditlen)
|
||||
{
|
||||
if (osdeditcontrol)
|
||||
{
|
||||
while (osdeditcursor<osdeditlen)
|
||||
{
|
||||
if (osdeditbuf[osdeditcursor] == 32) break;
|
||||
osdeditcursor++;
|
||||
}
|
||||
while (osdeditcursor<osdeditlen) {
|
||||
while (osdeditcursor<osdeditlen)
|
||||
{
|
||||
if (osdeditbuf[osdeditcursor] != 32) break;
|
||||
osdeditcursor++;
|
||||
}
|
||||
} else osdeditcursor++;
|
||||
}
|
||||
else osdeditcursor++;
|
||||
}
|
||||
if (osdeditcursor>=osdeditwinend)
|
||||
osdeditwinstart+=(osdeditcursor-osdeditwinend),
|
||||
osdeditwinend+=(osdeditcursor-osdeditwinend);
|
||||
} else if (sc == 200) { // up
|
||||
if (osdhistorypos < osdhistorysize-1) {
|
||||
}
|
||||
else if (sc == 200) // up
|
||||
{
|
||||
if (osdhistorypos < osdhistorysize-1)
|
||||
{
|
||||
osdhistorypos++;
|
||||
memcpy(osdeditbuf, osdhistorybuf[osdhistorypos], EDITLENGTH+1);
|
||||
osdeditlen = osdeditcursor = 0;
|
||||
while (osdeditbuf[osdeditcursor]) osdeditlen++, osdeditcursor++;
|
||||
if (osdeditcursor<osdeditwinstart) {
|
||||
if (osdeditcursor<osdeditwinstart)
|
||||
{
|
||||
osdeditwinend = osdeditcursor;
|
||||
osdeditwinstart = osdeditwinend-editlinewidth;
|
||||
|
||||
if (osdeditwinstart<0)
|
||||
osdeditwinend-=osdeditwinstart,
|
||||
osdeditwinstart=0;
|
||||
} else if (osdeditcursor>=osdeditwinend)
|
||||
}
|
||||
else if (osdeditcursor>=osdeditwinend)
|
||||
osdeditwinstart+=(osdeditcursor-osdeditwinend),
|
||||
osdeditwinend+=(osdeditcursor-osdeditwinend);
|
||||
}
|
||||
} else if (sc == 208) { // down
|
||||
if (osdhistorypos >= 0) {
|
||||
if (osdhistorypos == 0) {
|
||||
}
|
||||
else if (sc == 208) // down
|
||||
{
|
||||
if (osdhistorypos >= 0)
|
||||
{
|
||||
if (osdhistorypos == 0)
|
||||
{
|
||||
osdeditlen=0;
|
||||
osdeditcursor=0;
|
||||
osdeditwinstart=0;
|
||||
osdeditwinend=editlinewidth;
|
||||
osdhistorypos = -1;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
osdhistorypos--;
|
||||
memcpy(osdeditbuf, osdhistorybuf[osdhistorypos], EDITLENGTH+1);
|
||||
osdeditlen = osdeditcursor = 0;
|
||||
while (osdeditbuf[osdeditcursor]) osdeditlen++, osdeditcursor++;
|
||||
if (osdeditcursor<osdeditwinstart) {
|
||||
if (osdeditcursor<osdeditwinstart)
|
||||
{
|
||||
osdeditwinend = osdeditcursor;
|
||||
osdeditwinstart = osdeditwinend-editlinewidth;
|
||||
|
||||
if (osdeditwinstart<0)
|
||||
osdeditwinend-=osdeditwinstart,
|
||||
osdeditwinstart=0;
|
||||
} else if (osdeditcursor>=osdeditwinend)
|
||||
}
|
||||
else if (osdeditcursor>=osdeditwinend)
|
||||
osdeditwinstart+=(osdeditcursor-osdeditwinend),
|
||||
osdeditwinend+=(osdeditcursor-osdeditwinend);
|
||||
}
|
||||
}
|
||||
} else if (sc == 42 || sc == 54) { // shift
|
||||
}
|
||||
else if (sc == 42 || sc == 54) // shift
|
||||
{
|
||||
osdeditshift = 1;
|
||||
} else if (sc == 29 || sc == 157) { // control
|
||||
}
|
||||
else if (sc == 29 || sc == 157) // control
|
||||
{
|
||||
osdeditcontrol = 1;
|
||||
} else if (sc == 58) { // capslock
|
||||
}
|
||||
else if (sc == 58) // capslock
|
||||
{
|
||||
osdeditcaps ^= 1;
|
||||
} else if (sc == 28 || sc == 156) { // enter
|
||||
} else if (sc == 14) { // backspace
|
||||
} else if (sc == 211) { // delete
|
||||
}
|
||||
else if (sc == 28 || sc == 156) // enter
|
||||
{
|
||||
}
|
||||
else if (sc == 14) // backspace
|
||||
{
|
||||
}
|
||||
else if (sc == 211) // delete
|
||||
{
|
||||
if (osdeditcursor == osdeditlen || !osdeditlen) return 0;
|
||||
if (osdeditcursor <= osdeditlen-1) Bmemmove(osdeditbuf+osdeditcursor, osdeditbuf+osdeditcursor+1, osdeditlen-osdeditcursor-1);
|
||||
osdeditlen--;
|
||||
|
@ -675,7 +790,8 @@ void OSD_ResizeDisplay(int w, int h)
|
|||
k = min(newcols, osdcols);
|
||||
|
||||
memset(newtext, 32, TEXTSIZE);
|
||||
for (i=0;i<j;i++) {
|
||||
for (i=0;i<j;i++)
|
||||
{
|
||||
memcpy(newtext+newcols*i, osdtext+osdcols*i, k);
|
||||
}
|
||||
|
||||
|
@ -738,7 +854,7 @@ void OSD_Draw(void)
|
|||
else
|
||||
{
|
||||
int j;
|
||||
|
||||
|
||||
if ((osdrowscur < osdrows && osdscroll == 1) || osdrowscur < -1)
|
||||
{
|
||||
j = (getticks()-osdscrtime);
|
||||
|
@ -763,21 +879,22 @@ void OSD_Draw(void)
|
|||
}
|
||||
osdscrtime = getticks();
|
||||
}
|
||||
|
||||
|
||||
if (!osdvisible || !osdrowscur) return;
|
||||
|
||||
topoffs = osdhead * osdcols;
|
||||
row = osdrowscur-1;
|
||||
lines = min( osdlines-osdhead, osdrowscur );
|
||||
lines = min(osdlines-osdhead, osdrowscur);
|
||||
|
||||
begindrawing();
|
||||
|
||||
clearbackground(osdcols,osdrowscur+1);
|
||||
|
||||
|
||||
if (osdversionstring[0])
|
||||
drawosdstr(osdcols-osdversionstringlen,osdrowscur,osdversionstring,osdversionstringlen,osdversionstringshade,osdversionstringpal);
|
||||
|
||||
for (; lines>0; lines--, row--) {
|
||||
|
||||
for (; lines>0; lines--, row--)
|
||||
{
|
||||
drawosdstr(0,row,osdtext+topoffs,osdcols,osdtextshade,osdtextpal);
|
||||
topoffs+=osdcols;
|
||||
}
|
||||
|
@ -791,7 +908,7 @@ void OSD_Draw(void)
|
|||
drawosdchar(3+x,osdrowscur,osdeditbuf[osdeditwinstart+x],osdeditshade,osdeditpal);
|
||||
|
||||
drawosdcursor(3+osdeditcursor-osdeditwinstart,osdrowscur,osdovertype,keytime);
|
||||
|
||||
|
||||
enddrawing();
|
||||
}
|
||||
|
||||
|
@ -822,14 +939,19 @@ void OSD_Printf(const char *fmt, ...)
|
|||
|
||||
if (osdlog) Bfputs(tmpstr, osdlog);
|
||||
|
||||
for (chp = tmpstr; *chp; chp++) {
|
||||
for (chp = tmpstr; *chp; chp++)
|
||||
{
|
||||
if (*chp == '\r') osdpos=0;
|
||||
else if (*chp == '\n') {
|
||||
else if (*chp == '\n')
|
||||
{
|
||||
osdpos=0;
|
||||
linefeed();
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
osdtext[osdpos++] = *chp;
|
||||
if (osdpos == osdcols) {
|
||||
if (osdpos == osdcols)
|
||||
{
|
||||
osdpos = 0;
|
||||
linefeed();
|
||||
}
|
||||
|
@ -850,7 +972,8 @@ void OSD_DispatchQueued(void)
|
|||
cmd=osdexeccount-1;
|
||||
osdexeccount=0;
|
||||
|
||||
for (; cmd>=0; cmd--) {
|
||||
for (; cmd>=0; cmd--)
|
||||
{
|
||||
OSD_Dispatch((const char *)osdhistorybuf[cmd]);
|
||||
}
|
||||
}
|
||||
|
@ -879,27 +1002,35 @@ static char *strtoken(char *s, char **ptrptr, int *restart)
|
|||
|
||||
// a semicolon is an end of statement delimiter like a \0 is, so we signal
|
||||
// the caller to 'restart' for the rest of the string pointed at by *ptrptr
|
||||
if (*p == ';') {
|
||||
if (*p == ';')
|
||||
{
|
||||
*restart = 1;
|
||||
*ptrptr = p+1;
|
||||
return NULL;
|
||||
}
|
||||
// or if we hit the end of the input, signal all done by nulling *ptrptr
|
||||
else if (*p == 0) {
|
||||
else if (*p == 0)
|
||||
{
|
||||
*ptrptr = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (*p == '\"') {
|
||||
if (*p == '\"')
|
||||
{
|
||||
// quoted string
|
||||
start = ++p;
|
||||
p2 = p;
|
||||
while (*p != 0) {
|
||||
if (*p == '\"') {
|
||||
while (*p != 0)
|
||||
{
|
||||
if (*p == '\"')
|
||||
{
|
||||
p++;
|
||||
break;
|
||||
} else if (*p == '\\') {
|
||||
switch (*(++p)) {
|
||||
}
|
||||
else if (*p == '\\')
|
||||
{
|
||||
switch (*(++p))
|
||||
{
|
||||
case 'n':
|
||||
*p2 = '\n'; break;
|
||||
case 'r':
|
||||
|
@ -907,30 +1038,37 @@ static char *strtoken(char *s, char **ptrptr, int *restart)
|
|||
default:
|
||||
*p2 = *p; break;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
*p2 = *p;
|
||||
}
|
||||
p2++, p++;
|
||||
}
|
||||
*p2 = 0;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
start = p;
|
||||
while (*p != 0 && *p != ';' && *p != ' ') p++;
|
||||
}
|
||||
|
||||
// if we hit the end of input, signal all done by nulling *ptrptr
|
||||
if (*p == 0) {
|
||||
if (*p == 0)
|
||||
{
|
||||
*ptrptr = NULL;
|
||||
}
|
||||
// or if we came upon a semicolon, signal caller to restart with the
|
||||
// string at *ptrptr
|
||||
else if (*p == ';') {
|
||||
else if (*p == ';')
|
||||
{
|
||||
*p = 0;
|
||||
*ptrptr = p+1;
|
||||
*restart = 1;
|
||||
}
|
||||
// otherwise, clip off the token and carry on
|
||||
else {
|
||||
else
|
||||
{
|
||||
*(p++) = 0;
|
||||
*ptrptr = p;
|
||||
}
|
||||
|
@ -951,31 +1089,36 @@ int OSD_Dispatch(const char *cmd)
|
|||
workbuf = state = Bstrdup(cmd);
|
||||
if (!workbuf) return -1;
|
||||
|
||||
do {
|
||||
do
|
||||
{
|
||||
numparms = 0;
|
||||
Bmemset(parms, 0, sizeof(parms));
|
||||
wp = strtoken(state, &wtp, &restart);
|
||||
if (!wp) {
|
||||
if (!wp)
|
||||
{
|
||||
state = wtp;
|
||||
continue;
|
||||
}
|
||||
|
||||
symb = findexactsymbol(wp);
|
||||
if (!symb) {
|
||||
if (!symb)
|
||||
{
|
||||
OSD_Printf("Error: \"%s\" is not defined\n", wp);
|
||||
free(workbuf);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ofp.name = wp;
|
||||
while (wtp && !restart) {
|
||||
while (wtp && !restart)
|
||||
{
|
||||
wp = strtoken(NULL, &wtp, &restart);
|
||||
if (wp && numparms < MAXPARMS) parms[numparms++] = wp;
|
||||
}
|
||||
ofp.numparms = numparms;
|
||||
ofp.parms = (const char **)parms;
|
||||
ofp.raw = cmd;
|
||||
switch (symb->func(&ofp)) {
|
||||
switch (symb->func(&ofp))
|
||||
{
|
||||
case OSDCMD_OK:
|
||||
break;
|
||||
case OSDCMD_SHOWHELP:
|
||||
|
@ -983,7 +1126,8 @@ int OSD_Dispatch(const char *cmd)
|
|||
}
|
||||
|
||||
state = wtp;
|
||||
} while (wtp && restart);
|
||||
}
|
||||
while (wtp && restart);
|
||||
|
||||
free(workbuf);
|
||||
|
||||
|
@ -1001,44 +1145,52 @@ int OSD_RegisterFunction(const char *name, const char *help, int (*func)(const o
|
|||
|
||||
if (!osdinited) OSD_Init();
|
||||
|
||||
if (!name) {
|
||||
if (!name)
|
||||
{
|
||||
Bprintf("OSD_RegisterFunction(): may not register a function with a null name\n");
|
||||
return -1;
|
||||
}
|
||||
if (!name[0]) {
|
||||
if (!name[0])
|
||||
{
|
||||
Bprintf("OSD_RegisterFunction(): may not register a function with no name\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// check for illegal characters in name
|
||||
for (cp = name; *cp; cp++) {
|
||||
if ((cp == name) && (*cp >= '0') && (*cp <= '9')) {
|
||||
for (cp = name; *cp; cp++)
|
||||
{
|
||||
if ((cp == name) && (*cp >= '0') && (*cp <= '9'))
|
||||
{
|
||||
Bprintf("OSD_RegisterFunction(): first character of function name \"%s\" must not be a numeral\n", name);
|
||||
return -1;
|
||||
}
|
||||
if ((*cp < '0') ||
|
||||
(*cp > '9' && *cp < 'A') ||
|
||||
(*cp > 'Z' && *cp < 'a' && *cp != '_') ||
|
||||
(*cp > 'z')) {
|
||||
(*cp > 'z'))
|
||||
{
|
||||
Bprintf("OSD_RegisterFunction(): illegal character in function name \"%s\"\n", name);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!help) help = "(no description for this function)";
|
||||
if (!func) {
|
||||
if (!func)
|
||||
{
|
||||
Bprintf("OSD_RegisterFunction(): may not register a null function\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
symb = findexactsymbol(name);
|
||||
if (symb) {
|
||||
if (symb)
|
||||
{
|
||||
Bprintf("OSD_RegisterFunction(): \"%s\" is already defined\n", name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
symb = addnewsymbol(name);
|
||||
if (!symb) {
|
||||
if (!symb)
|
||||
{
|
||||
Bprintf("OSD_RegisterFunction(): Failed registering function \"%s\"\n", name);
|
||||
return -1;
|
||||
}
|
||||
|
@ -1076,16 +1228,23 @@ static symbol_t *addnewsymbol(const char *name)
|
|||
Bmemset(newsymb, 0, sizeof(symbol_t));
|
||||
|
||||
// link it to the main chain
|
||||
if (!symbols) {
|
||||
if (!symbols)
|
||||
{
|
||||
symbols = newsymb;
|
||||
} else {
|
||||
if (Bstrcasecmp(name, symbols->name) <= 0) {
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Bstrcasecmp(name, symbols->name) <= 0)
|
||||
{
|
||||
t = symbols;
|
||||
symbols = newsymb;
|
||||
symbols->next = t;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
s = symbols;
|
||||
while (s->next) {
|
||||
while (s->next)
|
||||
{
|
||||
if (Bstrcasecmp(s->next->name, name) > 0) break;
|
||||
s=s->next;
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ void polymer_loadboard(void)
|
|||
|
||||
if (pr_verbosity >= 1) OSD_Printf("PR : Board loaded.\n");
|
||||
}
|
||||
void polymer_drawrooms(long daposx, long daposy, long daposz, short daang, long dahoriz, short dacursectnum, int root)
|
||||
void polymer_drawrooms(int daposx, int daposy, int daposz, short daang, int dahoriz, short dacursectnum, int root)
|
||||
{
|
||||
int i, j;
|
||||
float ang, horizang, tiltang;
|
||||
|
@ -253,16 +253,16 @@ void polymer_drawrooms(long daposx, long daposy, long daposz, sho
|
|||
if (pr_verbosity >= 3) OSD_Printf("PR : Rooms drawn.\n");
|
||||
}
|
||||
|
||||
void polymer_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)
|
||||
void polymer_rotatesprite(int sx, int sy, int z, short a, short picnum, signed char dashade, char dapalnum, char dastat, int cx1, int cy1, int cx2, int cy2)
|
||||
{
|
||||
}
|
||||
|
||||
void polymer_drawmaskwall(long damaskwallcnt)
|
||||
void polymer_drawmaskwall(int damaskwallcnt)
|
||||
{
|
||||
OSD_Printf("PR : Masked wall %i...\n", damaskwallcnt);
|
||||
}
|
||||
|
||||
void polymer_drawsprite(long snum)
|
||||
void polymer_drawsprite(int snum)
|
||||
{
|
||||
OSD_Printf("PR : Sprite %i...\n", snum);
|
||||
}
|
||||
|
@ -310,10 +310,10 @@ int polymer_updatesector(short sectnum)
|
|||
sectortype *sec;
|
||||
walltype *wal;
|
||||
int i, j;
|
||||
long ceilz, florz;
|
||||
long tex, tey;
|
||||
int ceilz, florz;
|
||||
int tex, tey;
|
||||
float secangcos, secangsin, scalecoef;
|
||||
long ang;
|
||||
int ang;
|
||||
short curstat, curpicnum;
|
||||
char curxpanning, curypanning;
|
||||
GLfloat* curbuffer;
|
||||
|
@ -431,7 +431,8 @@ int polymer_updatesector(short sectnum)
|
|||
|
||||
pth = gltexcache(curpicnum,curxpanning,0);
|
||||
|
||||
if (pth && (pth->flags & 2) && (pth->palnum != curxpanning)) {
|
||||
if (pth && (pth->flags & 2) && (pth->palnum != curxpanning))
|
||||
{
|
||||
curbuffer[0] *= (float)hictinting[curxpanning].r / 255.0;
|
||||
curbuffer[1] *= (float)hictinting[curxpanning].g / 255.0;
|
||||
curbuffer[2] *= (float)hictinting[curxpanning].b / 255.0;
|
||||
|
@ -464,7 +465,8 @@ int polymer_updatesector(short sectnum)
|
|||
|
||||
|
||||
void PR_CALLBACK polymer_tesscombine(GLdouble v[3], GLdouble *data[4], GLfloat weight[4], GLdouble **out)
|
||||
{ // This callback is called by the tesselator when it detects an intersection between contours (HELLO ROTATING SPOTLIGHT IN E1L1).
|
||||
{
|
||||
// This callback is called by the tesselator when it detects an intersection between contours (HELLO ROTATING SPOTLIGHT IN E1L1).
|
||||
GLdouble* ptr;
|
||||
|
||||
tempvertice[0] = v[0];
|
||||
|
@ -479,13 +481,15 @@ void PR_CALLBACK polymer_tesscombine(GLdouble v[3], GLdouble *data[4], GLfloa
|
|||
|
||||
|
||||
void PR_CALLBACK polymer_tesserror(GLenum error)
|
||||
{ // This callback is called by the tesselator whenever it raises an error.
|
||||
{
|
||||
// This callback is called by the tesselator whenever it raises an error.
|
||||
if (pr_verbosity >= 1) OSD_Printf("PR : Tesselation error number %i reported : %s.\n", error, bgluErrorString(errno));
|
||||
}
|
||||
|
||||
|
||||
void PR_CALLBACK polymer_tessedgeflag(GLenum error)
|
||||
{ // Passing an edgeflag callback forces the tesselator to output a triangle list
|
||||
{
|
||||
// Passing an edgeflag callback forces the tesselator to output a triangle list
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -506,7 +510,8 @@ void PR_CALLBACK polymer_tessvertex(void* vertex, void* sector)
|
|||
s->curindice++;
|
||||
}
|
||||
int polymer_buildfloor(short sectnum)
|
||||
{ // This function tesselates the floor/ceiling of a sector and stores the triangles in a display list.
|
||||
{
|
||||
// This function tesselates the floor/ceiling of a sector and stores the triangles in a display list.
|
||||
_prsector* s;
|
||||
sectortype *sec;
|
||||
int i;
|
||||
|
@ -571,7 +576,7 @@ void polymer_drawsector(short sectnum)
|
|||
walltype *wal;
|
||||
_prsector* s;
|
||||
int i;
|
||||
long zdiff;
|
||||
int zdiff;
|
||||
|
||||
if (pr_verbosity >= 3) OSD_Printf("PR : Drawing sector %i...\n", sectnum);
|
||||
|
||||
|
@ -655,7 +660,7 @@ void polymer_updatewall(short wallnum)
|
|||
_prwall *w;
|
||||
_prsector *s, *ns;
|
||||
pthtyp* pth;
|
||||
long xref, yref, xdif, ydif;
|
||||
int xref, yref, xdif, ydif;
|
||||
float ypancoef, dist;
|
||||
int i;
|
||||
|
||||
|
@ -699,7 +704,8 @@ void polymer_updatewall(short wallnum)
|
|||
else
|
||||
w->wallfbglpic = 0;
|
||||
|
||||
if (pth && (pth->flags & 2) && (pth->palnum != wal->pal)) {
|
||||
if (pth && (pth->flags & 2) && (pth->palnum != wal->pal))
|
||||
{
|
||||
w->wallcolor[0] *= (float)hictinting[wal->pal].r / 255.0;
|
||||
w->wallcolor[1] *= (float)hictinting[wal->pal].g / 255.0;
|
||||
w->wallcolor[2] *= (float)hictinting[wal->pal].b / 255.0;
|
||||
|
@ -780,7 +786,8 @@ void polymer_updatewall(short wallnum)
|
|||
else
|
||||
w->wallfbglpic = 0;
|
||||
|
||||
if (pth && (pth->flags & 2) && (pth->palnum != wal->pal)) {
|
||||
if (pth && (pth->flags & 2) && (pth->palnum != wal->pal))
|
||||
{
|
||||
w->wallcolor[0] *= (float)hictinting[wal->pal].r / 255.0;
|
||||
w->wallcolor[1] *= (float)hictinting[wal->pal].g / 255.0;
|
||||
w->wallcolor[2] *= (float)hictinting[wal->pal].b / 255.0;
|
||||
|
@ -853,7 +860,8 @@ void polymer_updatewall(short wallnum)
|
|||
|
||||
memcpy(w->overcolor, w->wallcolor, sizeof(GLfloat) * 4);
|
||||
|
||||
if (pth && (pth->flags & 2) && (pth->palnum != wal->pal)) {
|
||||
if (pth && (pth->flags & 2) && (pth->palnum != wal->pal))
|
||||
{
|
||||
w->overcolor[0] *= (float)hictinting[wal->pal].r / 255.0;
|
||||
w->overcolor[1] *= (float)hictinting[wal->pal].g / 255.0;
|
||||
w->overcolor[2] *= (float)hictinting[wal->pal].b / 255.0;
|
||||
|
@ -972,7 +980,8 @@ void polymer_extractfrustum(GLdouble* modelview, GLdouble* projec
|
|||
}
|
||||
i = 0;
|
||||
while (i < 5)
|
||||
{ // frustum plane norms
|
||||
{
|
||||
// frustum plane norms
|
||||
frustumnorms[i] = sqrt((frustum[(i * 4) + 0] * frustum[(i * 4) + 0]) +
|
||||
(frustum[(i * 4) + 1] * frustum[(i * 4) + 1]) +
|
||||
(frustum[(i * 4) + 2] * frustum[(i * 4) + 2]));
|
||||
|
@ -1030,7 +1039,8 @@ void polymer_drawroom(short sectnum)
|
|||
}
|
||||
|
||||
int polymer_checkportal(short wallnum)
|
||||
{ // Returns 1 if the wall is in the current portal and sets the current portal to the wall, returns 0 otherwise
|
||||
{
|
||||
// Returns 1 if the wall is in the current portal and sets the current portal to the wall, returns 0 otherwise
|
||||
GLint wallportal[4], newportal[4];
|
||||
int mask, portalpointcount;
|
||||
|
||||
|
@ -1041,7 +1051,8 @@ int polymer_checkportal(short wallnum)
|
|||
if (mask == 0)
|
||||
return (0); // not visible
|
||||
if (mask > 1)
|
||||
{ // only some points visible, clip the polygon to the viewport
|
||||
{
|
||||
// only some points visible, clip the polygon to the viewport
|
||||
portalpointcount = polymer_cliptofrustum(wallnum, mask);
|
||||
polymer_getportal(portalpoints, portalpointcount, wallportal);
|
||||
}
|
||||
|
@ -1052,10 +1063,10 @@ int polymer_checkportal(short wallnum)
|
|||
return (0); // the wall is totally outside the current portal
|
||||
|
||||
// we need to find the intersection of the current portal and the wall portal
|
||||
newportal[0] = portal[0] + (klabs(wallportal[0] - portal[0]) + (wallportal[0] - portal[0])) / 2;
|
||||
newportal[0] = portal[0] + (klabs(wallportal[0] - portal[0]) + (wallportal[0] - portal[0])) / 2;
|
||||
newportal[1] = portal[1] + (klabs(wallportal[1] - portal[1]) + (wallportal[1] - portal[1])) / 2;
|
||||
newportal[2] = portal[2] + ((wallportal[2] - portal[2]) - klabs(wallportal[2] - portal[2])) / 2;
|
||||
newportal[3] = portal[3] + ((wallportal[3] - portal[3]) - klabs(wallportal[3] - portal[3])) / 2;
|
||||
newportal[2] = portal[2] + ((wallportal[2] - portal[2]) - klabs(wallportal[2] - portal[2])) / 2;
|
||||
newportal[3] = portal[3] + ((wallportal[3] - portal[3]) - klabs(wallportal[3] - portal[3])) / 2;
|
||||
|
||||
// update the view portal
|
||||
if (pr_verbosity >= 3) OSD_Printf("PR : Updating portal...\n");
|
||||
|
@ -1128,12 +1139,14 @@ void polymer_lineplaneintersection(GLfloat *point1, GLfloat *poin
|
|||
}
|
||||
|
||||
int polymer_cliptofrustum(short wallnum, int mask)
|
||||
{ // sutherland-hofnman polygon clipping algorithm against all planes of the frustum
|
||||
{
|
||||
// sutherland-hofnman polygon clipping algorithm against all planes of the frustum
|
||||
GLfloat intersect[3];
|
||||
int i, j, k, l, m, result, exitpoint;
|
||||
|
||||
if (portalpoints == NULL)
|
||||
{ // one-time initialization
|
||||
{
|
||||
// one-time initialization
|
||||
portalpoints = calloc(4, sizeof(GLfloat) * 3);
|
||||
distances = calloc(4, sizeof(float));
|
||||
maxportalpointcount = 4;
|
||||
|
@ -1143,7 +1156,8 @@ int polymer_cliptofrustum(short wallnum, int mask)
|
|||
memcpy(portalpoints, prwalls[wallnum]->portal, sizeof(GLfloat) * 3 * 4);
|
||||
i = 0;
|
||||
while (i < 4)
|
||||
{ // frustum planes
|
||||
{
|
||||
// frustum planes
|
||||
j = k = 0;
|
||||
m = -1;
|
||||
while (j < result)
|
||||
|
@ -1157,7 +1171,8 @@ int polymer_cliptofrustum(short wallnum, int mask)
|
|||
}
|
||||
|
||||
if ((k) && (m != -1))
|
||||
{ // divide and conquer while we may
|
||||
{
|
||||
// divide and conquer while we may
|
||||
j = m;
|
||||
while ((j != m) || (k))
|
||||
{
|
||||
|
@ -1166,21 +1181,24 @@ int polymer_cliptofrustum(short wallnum, int mask)
|
|||
k = 0;
|
||||
if (pr_verbosity >= 3) OSD_Printf("PR : Clipping against frustum plane %d starting with point %d...\n", i, m);
|
||||
}
|
||||
|
||||
|
||||
l = j + 1; // L is next point
|
||||
if (l == result)
|
||||
l = 0;
|
||||
|
||||
|
||||
if ((distances[j] >= 0) && (distances[l] < 0))
|
||||
{ // case 1 : line exits the plane -> compute intersection
|
||||
{
|
||||
// case 1 : line exits the plane -> compute intersection
|
||||
polymer_lineplaneintersection(&portalpoints[j * 3], &portalpoints[l * 3], distances[j], distances[l], intersect);
|
||||
exitpoint = l;
|
||||
if (pr_verbosity >= 3) OSD_Printf("PR : %d: EXIT\n", j);
|
||||
}
|
||||
else if ((distances[j] < 0) && (distances[l] < 0))
|
||||
{ // case 2 : line is totally outside the plane
|
||||
{
|
||||
// case 2 : line is totally outside the plane
|
||||
if (j != exitpoint)
|
||||
{ // if we didn't just exit we need to delete this point forever
|
||||
{
|
||||
// if we didn't just exit we need to delete this point forever
|
||||
result--;
|
||||
if (j != result)
|
||||
{
|
||||
|
@ -1190,7 +1208,7 @@ int polymer_cliptofrustum(short wallnum, int mask)
|
|||
{
|
||||
m--;
|
||||
}
|
||||
l--;
|
||||
l--;
|
||||
}
|
||||
if (l == result)
|
||||
l = 0;
|
||||
|
@ -1200,9 +1218,11 @@ int polymer_cliptofrustum(short wallnum, int mask)
|
|||
if (pr_verbosity >= 3) OSD_Printf("PR : %d: IN\n", j);
|
||||
}
|
||||
else if ((distances[j] < 0) && (distances[l] >= 0))
|
||||
{ // case 3 : we're going back into the plane -> replace current point with intersection
|
||||
{
|
||||
// case 3 : we're going back into the plane -> replace current point with intersection
|
||||
if (j == exitpoint)
|
||||
{ // if we just exited a point is created
|
||||
{
|
||||
// if we just exited a point is created
|
||||
if (result == maxportalpointcount)
|
||||
{
|
||||
portalpoints = realloc(portalpoints, sizeof(GLfloat) * 3 * (maxportalpointcount + 1));
|
||||
|
@ -1232,7 +1252,7 @@ int polymer_cliptofrustum(short wallnum, int mask)
|
|||
j = l; // L
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (pr_verbosity >= 3) OSD_Printf("PR : Plane %d finished, result : %d.\n", i, result);
|
||||
|
||||
i++;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -10,7 +10,7 @@
|
|||
//#include "pragmas.h"
|
||||
#include "compat.h"
|
||||
|
||||
long dmval;
|
||||
int dmval;
|
||||
|
||||
#if defined(__GNUC__) && defined(__i386__) && !defined(NOASM) // NOASM
|
||||
|
||||
|
@ -21,9 +21,9 @@ long dmval;
|
|||
#define ASM __asm__ __volatile__
|
||||
|
||||
|
||||
long boundmulscale(long a, long b, long c)
|
||||
int boundmulscale(int a, int b, int c)
|
||||
{
|
||||
ASM (
|
||||
ASM(
|
||||
"imull %%ebx\n\t"
|
||||
"movl %%edx, %%ebx\n\t" // mov ebx, edx
|
||||
"shrdl %%cl, %%edx, %%eax\n\t" // mov eax, edx, cl
|
||||
|
@ -39,7 +39,7 @@ long boundmulscale(long a, long b, long c)
|
|||
"sarl $31, %%eax\n\t" // sar eax, 31
|
||||
"xorl $0x7fffffff, %%eax\n\t" // xor eax, 0x7fffffff
|
||||
"1:" // skipboundit:
|
||||
: "+a" (a), "+b" (b), "+c" (c) // input eax ebx ecx
|
||||
: "+a"(a), "+b"(b), "+c"(c) // input eax ebx ecx
|
||||
:
|
||||
: "edx", "cc"
|
||||
);
|
||||
|
@ -47,9 +47,9 @@ long boundmulscale(long a, long b, long c)
|
|||
}
|
||||
|
||||
|
||||
void clearbufbyte(void *D, long c, long a)
|
||||
void clearbufbyte(void *D, int c, int a)
|
||||
{
|
||||
ASM (
|
||||
ASM(
|
||||
"cmpl $4, %%ecx\n\t"
|
||||
"jae 1f\n\t"
|
||||
"testb $1, %%cl\n\t"
|
||||
|
@ -83,14 +83,14 @@ void clearbufbyte(void *D, long c, long a)
|
|||
"jz 5f\n\t" // jz endit
|
||||
"stosb\n\t"
|
||||
"5:" // endit
|
||||
: "+D" (D), "+c" (c), "+a" (a) :
|
||||
: "+D"(D), "+c"(c), "+a"(a) :
|
||||
: "ebx", "memory", "cc"
|
||||
);
|
||||
}
|
||||
|
||||
void copybufbyte(void *S, void *D, long c)
|
||||
void copybufbyte(void *S, void *D, int c)
|
||||
{
|
||||
ASM (
|
||||
ASM(
|
||||
"cmpl $4, %%ecx\n\t" // cmp ecx, 4
|
||||
"jae 1f\n\t"
|
||||
"testb $1, %%cl\n\t" // test cl, 1
|
||||
|
@ -124,14 +124,14 @@ void copybufbyte(void *S, void *D, long c)
|
|||
"jz 5f\n\t"
|
||||
"movsb\n\t"
|
||||
"5:" // endit:
|
||||
: "+c" (c), "+S" (S), "+D" (D) :
|
||||
: "+c"(c), "+S"(S), "+D"(D) :
|
||||
: "ebx", "memory", "cc"
|
||||
);
|
||||
}
|
||||
|
||||
void copybufreverse(void *S, void *D, long c)
|
||||
void copybufreverse(void *S, void *D, int c)
|
||||
{
|
||||
ASM (
|
||||
ASM(
|
||||
"shrl $1, %%ecx\n\t"
|
||||
"jnc 0f\n\t" // jnc skipit1
|
||||
"movb (%%esi), %%al\n\t"
|
||||
|
@ -158,7 +158,7 @@ void copybufreverse(void *S, void *D, long c)
|
|||
"decl %%ecx\n\t"
|
||||
"jnz 2b\n\t" // jnz begloop
|
||||
"3:"
|
||||
: "+S" (S), "+D" (D), "+c" (c) :
|
||||
: "+S"(S), "+D"(D), "+c"(c) :
|
||||
: "eax", "memory", "cc"
|
||||
);
|
||||
}
|
||||
|
@ -181,35 +181,38 @@ void copybufreverse(void *S, void *D, long c)
|
|||
// Generic C version
|
||||
//
|
||||
|
||||
void qinterpolatedown16(long bufptr, long num, long val, long add)
|
||||
{ // gee, I wonder who could have provided this...
|
||||
long i, *lptr = (long *)bufptr;
|
||||
void qinterpolatedown16(int bufptr, int num, int val, int add)
|
||||
{
|
||||
// gee, I wonder who could have provided this...
|
||||
int i, *lptr = (int *)bufptr;
|
||||
for (i=0;i<num;i++) { lptr[i] = (val>>16); val += add; }
|
||||
}
|
||||
|
||||
void qinterpolatedown16short(long bufptr, long num, long val, long add)
|
||||
{ // ...maybe the same person who provided this too?
|
||||
long i; short *sptr = (short *)bufptr;
|
||||
void qinterpolatedown16short(int bufptr, int num, int val, int add)
|
||||
{
|
||||
// ...maybe the same person who provided this too?
|
||||
int i; short *sptr = (short *)bufptr;
|
||||
for (i=0;i<num;i++) { sptr[i] = (short)(val>>16); val += add; }
|
||||
}
|
||||
|
||||
void clearbuf(void *d, long c, long a)
|
||||
void clearbuf(void *d, int c, int a)
|
||||
{
|
||||
long *p = (long*)d;
|
||||
int *p = (int*)d;
|
||||
while ((c--) > 0) *(p++) = a;
|
||||
}
|
||||
|
||||
void copybuf(void *s, void *d, long c)
|
||||
void copybuf(void *s, void *d, int c)
|
||||
{
|
||||
long *p = (long*)s, *q = (long*)d;
|
||||
int *p = (int*)s, *q = (int*)d;
|
||||
while ((c--) > 0) *(q++) = *(p++);
|
||||
}
|
||||
|
||||
void swapbuf4(void *a, void *b, long c)
|
||||
void swapbuf4(void *a, void *b, int c)
|
||||
{
|
||||
long *p = (long*)a, *q = (long*)b;
|
||||
long x, y;
|
||||
while ((c--) > 0) {
|
||||
int *p = (int*)a, *q = (int*)b;
|
||||
int x, y;
|
||||
while ((c--) > 0)
|
||||
{
|
||||
x = *q;
|
||||
y = *p;
|
||||
*(q++) = y;
|
||||
|
@ -217,25 +220,27 @@ void swapbuf4(void *a, void *b, long c)
|
|||
}
|
||||
}
|
||||
|
||||
void clearbufbyte(void *D, long c, long a)
|
||||
{ // Cringe City
|
||||
void clearbufbyte(void *D, int c, int a)
|
||||
{
|
||||
// Cringe City
|
||||
char *p = (char*)D;
|
||||
long m[4] = { 0xffl,0xff00l,0xff0000l,0xff000000l };
|
||||
long n[4] = { 0,8,16,24 };
|
||||
long z=0;
|
||||
while ((c--) > 0) {
|
||||
int m[4] = { 0xffl,0xff00l,0xff0000l,0xff000000l };
|
||||
int n[4] = { 0,8,16,24 };
|
||||
int z=0;
|
||||
while ((c--) > 0)
|
||||
{
|
||||
*(p++) = (char)((a & m[z])>>n[z]);
|
||||
z=(z+1)&3;
|
||||
}
|
||||
}
|
||||
|
||||
void copybufbyte(void *S, void *D, long c)
|
||||
void copybufbyte(void *S, void *D, int c)
|
||||
{
|
||||
char *p = (char*)S, *q = (char*)D;
|
||||
while ((c--) > 0) *(q++) = *(p++);
|
||||
}
|
||||
|
||||
void copybufreverse(void *S, void *D, long c)
|
||||
void copybufreverse(void *S, void *D, int c)
|
||||
{
|
||||
char *p = (char*)S, *q = (char*)D;
|
||||
while ((c--) > 0) *(q++) = *(p--);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* See the included license file "BUILDLIC.TXT" for license info.
|
||||
*/
|
||||
|
||||
#include "compat.h"
|
||||
#include "compat.h"
|
||||
#include "scriptfile.h"
|
||||
#include "baselayer.h"
|
||||
#include "compat.h"
|
||||
|
@ -54,7 +54,8 @@ int scriptfile_getnumber(scriptfile *sf, int *num)
|
|||
|
||||
sf->ltextptr = sf->textptr;
|
||||
(*num) = strtol((const char *)sf->textptr,&sf->textptr,0);
|
||||
if (!ISWS(*sf->textptr) && *sf->textptr) {
|
||||
if (!ISWS(*sf->textptr) && *sf->textptr)
|
||||
{
|
||||
char *p = sf->textptr;
|
||||
skipovertoken(sf);
|
||||
initprintf("Error on line %s:%d: expecting int, got \"%s\"\n",sf->filename,scriptfile_getlinum(sf,sf->ltextptr),p);
|
||||
|
@ -73,23 +74,31 @@ static double parsedouble(char *ptr, char **end)
|
|||
p = ptr;
|
||||
if (*p == '-') negative = 1, p++;
|
||||
else if (*p == '+') p++;
|
||||
for (;; p++) {
|
||||
if (*p >= '0' && *p <= '9') {
|
||||
for (;; p++)
|
||||
{
|
||||
if (*p >= '0' && *p <= '9')
|
||||
{
|
||||
dig = *p - '0';
|
||||
if (beforedecimal) num = num * 10.0 + dig;
|
||||
else if (exposgn) expo = expo*10 + dig;
|
||||
else {
|
||||
else
|
||||
{
|
||||
num += (double)dig * decpl;
|
||||
decpl /= 10.0;
|
||||
}
|
||||
} else if (*p == '.') {
|
||||
}
|
||||
else if (*p == '.')
|
||||
{
|
||||
if (beforedecimal) beforedecimal = 0;
|
||||
else break;
|
||||
} else if ((*p == 'E') || (*p == 'e')) {
|
||||
}
|
||||
else if ((*p == 'E') || (*p == 'e'))
|
||||
{
|
||||
exposgn = 1;
|
||||
if (p[1] == '-') { exposgn = -1; p++; }
|
||||
else if (p[1] == '+') p++;
|
||||
} else break;
|
||||
}
|
||||
else break;
|
||||
}
|
||||
|
||||
if (end) *end = p;
|
||||
|
@ -112,7 +121,8 @@ int scriptfile_getdouble(scriptfile *sf, double *num)
|
|||
//(*num) = strtod((const char *)sf->textptr,&sf->textptr);
|
||||
(*num) = parsedouble(sf->textptr, &sf->textptr);
|
||||
|
||||
if (!ISWS(*sf->textptr) && *sf->textptr) {
|
||||
if (!ISWS(*sf->textptr) && *sf->textptr)
|
||||
{
|
||||
char *p = sf->textptr;
|
||||
skipovertoken(sf);
|
||||
initprintf("Error on line %s:%d: expecting float, got \"%s\"\n",sf->filename,scriptfile_getlinum(sf,sf->ltextptr),p);
|
||||
|
@ -130,7 +140,8 @@ int scriptfile_getsymbol(scriptfile *sf, int *num)
|
|||
if (!t) return -1;
|
||||
|
||||
v = Bstrtol(t, &e, 10);
|
||||
if (*e) {
|
||||
if (*e)
|
||||
{
|
||||
// looks like a string, so find it in the symbol table
|
||||
if (scriptfile_getsymbolvalue(t, num)) return 0;
|
||||
initprintf("Error on line %s:%d: expecting symbol, got \"%s\"\n",sf->filename,scriptfile_getlinum(sf,sf->ltextptr),t);
|
||||
|
@ -153,7 +164,8 @@ int scriptfile_getbraces(scriptfile *sf, char **braceend)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (sf->textptr[0] != '{') {
|
||||
if (sf->textptr[0] != '{')
|
||||
{
|
||||
initprintf("Error on line %s:%d: expecting '{'\n",sf->filename,scriptfile_getlinum(sf,sf->textptr));
|
||||
return -1;
|
||||
}
|
||||
|
@ -162,7 +174,7 @@ int scriptfile_getbraces(scriptfile *sf, char **braceend)
|
|||
{
|
||||
if (sf->textptr >= sf->eof) return(0);
|
||||
if (sf->textptr[0] == '{') bracecnt++;
|
||||
if (sf->textptr[0] == '}') { bracecnt--; if (!bracecnt) break; }
|
||||
if (sf->textptr[0] == '}') { bracecnt--; if (!bracecnt) break; }
|
||||
sf->textptr++;
|
||||
}
|
||||
(*braceend) = sf->textptr;
|
||||
|
@ -171,13 +183,13 @@ int scriptfile_getbraces(scriptfile *sf, char **braceend)
|
|||
}
|
||||
|
||||
|
||||
int scriptfile_getlinum (scriptfile *sf, char *ptr)
|
||||
int scriptfile_getlinum(scriptfile *sf, char *ptr)
|
||||
{
|
||||
int i, stp, ind;
|
||||
|
||||
//for(i=0;i<sf->linenum;i++) if (sf->lineoffs[i] >= ind) return(i+1); //brute force algo
|
||||
|
||||
ind = ((long)ptr) - ((long)sf->textbuf);
|
||||
ind = ((int)ptr) - ((int)sf->textbuf);
|
||||
|
||||
for (stp=1;stp+stp<sf->linenum;stp+=stp); //stp = highest power of 2 less than sf->linenum
|
||||
for (i=0;stp;stp>>=1)
|
||||
|
@ -185,9 +197,9 @@ int scriptfile_getlinum (scriptfile *sf, char *ptr)
|
|||
return(i+1); //i = index to highest lineoffs which is less than ind; convert to 1-based line numbers
|
||||
}
|
||||
|
||||
void scriptfile_preparse (scriptfile *sf, char *tx, long flen)
|
||||
void scriptfile_preparse(scriptfile *sf, char *tx, int flen)
|
||||
{
|
||||
long i, cr, numcr, nflen, ws, cs, inquote;
|
||||
int i, cr, numcr, nflen, ws, cs, inquote;
|
||||
|
||||
//Count number of lines
|
||||
numcr = 1;
|
||||
|
@ -200,7 +212,7 @@ void scriptfile_preparse (scriptfile *sf, char *tx, long flen)
|
|||
}
|
||||
|
||||
sf->linenum = numcr;
|
||||
sf->lineoffs = (long *)malloc(sf->linenum*sizeof(long));
|
||||
sf->lineoffs = (int *)malloc(sf->linenum*sizeof(int));
|
||||
|
||||
//Preprocess file for comments (// and /*...*/, and convert all whitespace to single spaces)
|
||||
nflen = 0; ws = 0; cs = 0; numcr = 0; inquote = 0;
|
||||
|
@ -218,13 +230,13 @@ void scriptfile_preparse (scriptfile *sf, char *tx, long flen)
|
|||
ws = 1; continue; //strip CR/LF
|
||||
}
|
||||
|
||||
if ((!inquote) && ((tx[i] == ' ') || (tx[i] == '\t'))) { ws = 1; continue; } //strip Space/Tab
|
||||
if ((!inquote) && ((tx[i] == ' ') || (tx[i] == '\t'))) { ws = 1; continue; } //strip Space/Tab
|
||||
if ((tx[i] == '/') && (tx[i+1] == '/') && (!cs)) cs = 1;
|
||||
if ((tx[i] == '/') && (tx[i+1] == '*') && (!cs)) { ws = 1; cs = 2; }
|
||||
if ((tx[i] == '/') && (tx[i+1] == '*') && (!cs)) { ws = 1; cs = 2; }
|
||||
if ((tx[i] == '*') && (tx[i+1] == '/') && (cs == 2)) { cs = 0; i++; continue; }
|
||||
if (cs) continue;
|
||||
|
||||
if (ws) { tx[nflen++] = 0; ws = 0; }
|
||||
if (ws) { tx[nflen++] = 0; ws = 0; }
|
||||
|
||||
//quotes inside strings: \"
|
||||
if ((tx[i] == '\\') && (tx[i+1] == '\"')) { i++; tx[nflen++] = '\"'; continue; }
|
||||
|
@ -260,13 +272,15 @@ scriptfile *scriptfile_fromfile(char *fn)
|
|||
|
||||
flen = kfilelength(fp);
|
||||
tx = (char *) malloc(flen + 2);
|
||||
if (!tx) {
|
||||
if (!tx)
|
||||
{
|
||||
kclose(fp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sf = (scriptfile*) malloc(sizeof(scriptfile));
|
||||
if (!sf) {
|
||||
if (!sf)
|
||||
{
|
||||
kclose(fp);
|
||||
free(tx);
|
||||
return NULL;
|
||||
|
@ -297,7 +311,8 @@ scriptfile *scriptfile_fromstring(char *string)
|
|||
if (!tx) return NULL;
|
||||
|
||||
sf = (scriptfile*) malloc(sizeof(scriptfile));
|
||||
if (!sf) {
|
||||
if (!sf)
|
||||
{
|
||||
free(tx);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -355,8 +370,10 @@ int scriptfile_getsymbolvalue(char *name, int *val)
|
|||
char *scanner = symbtab;
|
||||
|
||||
if (!symbtab) return 0;
|
||||
while (scanner - symbtab < symbtablength) {
|
||||
if (!Bstrcasecmp(name, scanner)) {
|
||||
while (scanner - symbtab < symbtablength)
|
||||
{
|
||||
if (!Bstrcasecmp(name, scanner))
|
||||
{
|
||||
*val = *(int*)(scanner + strlen(scanner) + 1);
|
||||
return 1;
|
||||
}
|
||||
|
@ -373,10 +390,13 @@ int scriptfile_addsymbolvalue(char *name, int val)
|
|||
char *sp;
|
||||
// if (scriptfile_getsymbolvalue(name, &x)) return -1; // already exists
|
||||
|
||||
if (symbtab) {
|
||||
if (symbtab)
|
||||
{
|
||||
char *scanner = symbtab;
|
||||
while (scanner - symbtab < symbtablength) {
|
||||
if (!Bstrcasecmp(name, scanner)) {
|
||||
while (scanner - symbtab < symbtablength)
|
||||
{
|
||||
if (!Bstrcasecmp(name, scanner))
|
||||
{
|
||||
*(int*)(scanner + strlen(scanner) + 1) = val;
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -41,24 +41,24 @@ int startwin_settitle(const char *s) { s=s; return 0; }
|
|||
|
||||
// fix for mousewheel
|
||||
#define MWHEELTICKS 10
|
||||
static unsigned long mwheelup, mwheeldown;
|
||||
static unsigned int mwheelup, mwheeldown;
|
||||
|
||||
int _buildargc = 1;
|
||||
const char **_buildargv = NULL;
|
||||
extern long app_main(long argc, const char *argv[]);
|
||||
extern int app_main(int argc, const char *argv[]);
|
||||
|
||||
char quitevent=0, appactive=1;
|
||||
|
||||
// video
|
||||
static SDL_Surface *sdl_surface;
|
||||
long xres=-1, yres=-1, bpp=0, fullscreen=0, bytesperline, imageSize;
|
||||
long frameplace=0, lockcount=0;
|
||||
int xres=-1, yres=-1, bpp=0, fullscreen=0, bytesperline, imageSize;
|
||||
int frameplace=0, lockcount=0;
|
||||
char modechange=1;
|
||||
char offscreenrendering=0;
|
||||
char videomodereset = 0;
|
||||
char nofog=0;
|
||||
static unsigned short sysgamma[3][256];
|
||||
extern long curbrightness, gammabrightness;
|
||||
extern int curbrightness, gammabrightness;
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
// OpenGL stuff
|
||||
|
@ -70,15 +70,15 @@ char inputdevices=0;
|
|||
char keystatus[256], keyfifo[KEYFIFOSIZ], keyfifoplc, keyfifoend;
|
||||
unsigned char keyasciififo[KEYFIFOSIZ], keyasciififoplc, keyasciififoend;
|
||||
static unsigned char keynames[256][24];
|
||||
long mousex=0,mousey=0,mouseb=0;
|
||||
long *joyaxis = NULL, joyb=0, *joyhat = NULL;
|
||||
int mousex=0,mousey=0,mouseb=0;
|
||||
int *joyaxis = NULL, joyb=0, *joyhat = NULL;
|
||||
char joyisgamepad=0, joynumaxes=0, joynumbuttons=0, joynumhats=0;
|
||||
long joyaxespresent=0;
|
||||
int joyaxespresent=0;
|
||||
|
||||
|
||||
void(*keypresscallback)(long,long) = 0;
|
||||
void(*mousepresscallback)(long,long) = 0;
|
||||
void(*joypresscallback)(long,long) = 0;
|
||||
void(*keypresscallback)(int,int) = 0;
|
||||
void(*mousepresscallback)(int,int) = 0;
|
||||
void(*joypresscallback)(int,int) = 0;
|
||||
|
||||
static unsigned char keytranslation[SDLK_LAST];
|
||||
static int buildkeytranslationtable(void);
|
||||
|
@ -321,7 +321,7 @@ void debugprintf(const char *f, ...)
|
|||
//
|
||||
|
||||
static char mouseacquired=0,moustat=0;
|
||||
static long joyblast=0;
|
||||
static int joyblast=0;
|
||||
static SDL_Joystick *joydev = NULL;
|
||||
|
||||
//
|
||||
|
@ -366,8 +366,8 @@ int initinput(void)
|
|||
initprintf("Joystick 1 has %d axes, %d buttons, and %d hat(s).\n",
|
||||
joynumaxes,joynumbuttons,joynumhats);
|
||||
|
||||
joyaxis = (long *)Bcalloc(joynumaxes, sizeof(long));
|
||||
joyhat = (long *)Bcalloc(joynumhats, sizeof(long));
|
||||
joyaxis = (int *)Bcalloc(joynumaxes, sizeof(int));
|
||||
joyhat = (int *)Bcalloc(joynumhats, sizeof(int));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -446,9 +446,9 @@ void bflushchars(void)
|
|||
//
|
||||
// set{key|mouse|joy}presscallback() -- sets a callback which gets notified when keys are pressed
|
||||
//
|
||||
void setkeypresscallback(void(*callback)(long, long)) { keypresscallback = callback; }
|
||||
void setmousepresscallback(void(*callback)(long, long)) { mousepresscallback = callback; }
|
||||
void setjoypresscallback(void(*callback)(long, long)) { joypresscallback = callback; }
|
||||
void setkeypresscallback(void(*callback)(int, int)) { keypresscallback = callback; }
|
||||
void setmousepresscallback(void(*callback)(int, int)) { mousepresscallback = callback; }
|
||||
void setjoypresscallback(void(*callback)(int, int)) { joypresscallback = callback; }
|
||||
|
||||
//
|
||||
// initmouse() -- init mouse input
|
||||
|
@ -503,7 +503,7 @@ void grabmouse(char a)
|
|||
//
|
||||
// readmousexy() -- return mouse motion information
|
||||
//
|
||||
void readmousexy(long *x, long *y)
|
||||
void readmousexy(int *x, int *y)
|
||||
{
|
||||
if (!mouseacquired || !appactive || !moustat) { *x = *y = 0; return; }
|
||||
*x = mousex;
|
||||
|
@ -514,7 +514,7 @@ void readmousexy(long *x, long *y)
|
|||
//
|
||||
// readmousebstatus() -- return mouse button information
|
||||
//
|
||||
void readmousebstatus(long *b)
|
||||
void readmousebstatus(int *b)
|
||||
{
|
||||
if (!mouseacquired || !appactive || !moustat) *b = 0;
|
||||
else *b = mouseb;
|
||||
|
@ -593,12 +593,12 @@ void uninittimer(void)
|
|||
void sampletimer(void)
|
||||
{
|
||||
Uint32 i;
|
||||
long n;
|
||||
int n;
|
||||
|
||||
if (!timerfreq) return;
|
||||
|
||||
i = SDL_GetTicks();
|
||||
n = (long)(i * timerticspersec / timerfreq) - timerlastsample;
|
||||
n = (int)(i * timerticspersec / timerfreq) - timerlastsample;
|
||||
if (n>0)
|
||||
{
|
||||
totalclock += n;
|
||||
|
@ -611,9 +611,9 @@ void sampletimer(void)
|
|||
//
|
||||
// getticks() -- returns the sdl ticks count
|
||||
//
|
||||
unsigned long getticks(void)
|
||||
unsigned int getticks(void)
|
||||
{
|
||||
return (unsigned long)SDL_GetTicks();
|
||||
return (unsigned int)SDL_GetTicks();
|
||||
}
|
||||
|
||||
|
||||
|
@ -670,19 +670,19 @@ static char modeschecked=0;
|
|||
void getvalidmodes(void)
|
||||
{
|
||||
static int cdepths[] =
|
||||
{
|
||||
8,
|
||||
{
|
||||
8,
|
||||
#ifdef USE_OPENGL
|
||||
16,24,32,
|
||||
16,24,32,
|
||||
#endif
|
||||
0
|
||||
};
|
||||
0
|
||||
};
|
||||
static int defaultres[][2] =
|
||||
{
|
||||
{1280,1024}
|
||||
,{1280,960},{1152,864},{1024,768},{800,600},{640,480},
|
||||
{640,400},{512,384},{480,360},{400,300},{320,240},{320,200},{0,0}
|
||||
};
|
||||
{
|
||||
{1280,1024}
|
||||
,{1280,960},{1152,864},{1024,768},{800,600},{640,480},
|
||||
{640,400},{512,384},{480,360},{400,300},{320,240},{320,200},{0,0}
|
||||
};
|
||||
SDL_Rect **modes;
|
||||
SDL_PixelFormat pf = { NULL, 8, 1, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0 };
|
||||
int i, j, maxx=0, maxy=0;
|
||||
|
@ -804,7 +804,8 @@ int checkvideomode(int *x, int *y, int c, int fs, int forced)
|
|||
dx = klabs(validmode[i].xdim - *x);
|
||||
dy = klabs(validmode[i].ydim - *y);
|
||||
if (!(dx | dy))
|
||||
{ // perfect match
|
||||
{
|
||||
// perfect match
|
||||
nearest = i;
|
||||
break;
|
||||
}
|
||||
|
@ -880,24 +881,25 @@ int setvideomode(int x, int y, int c, int fs)
|
|||
SDL_GLattr attr;
|
||||
int value;
|
||||
}
|
||||
attributes[] = {
|
||||
attributes[] =
|
||||
{
|
||||
#if 0
|
||||
{ SDL_GL_RED_SIZE, 8 },
|
||||
{ SDL_GL_GREEN_SIZE, 8 },
|
||||
{ SDL_GL_BLUE_SIZE, 8 },
|
||||
{ SDL_GL_ALPHA_SIZE, 8 },
|
||||
{ SDL_GL_BUFFER_SIZE, c },
|
||||
{ SDL_GL_STENCIL_SIZE, 0 },
|
||||
{ SDL_GL_ACCUM_RED_SIZE, 0 },
|
||||
{ SDL_GL_ACCUM_GREEN_SIZE, 0 },
|
||||
{ SDL_GL_ACCUM_BLUE_SIZE, 0 },
|
||||
{ SDL_GL_ACCUM_ALPHA_SIZE, 0 },
|
||||
{ SDL_GL_DEPTH_SIZE, 24 },
|
||||
{ SDL_GL_RED_SIZE, 8 },
|
||||
{ SDL_GL_GREEN_SIZE, 8 },
|
||||
{ SDL_GL_BLUE_SIZE, 8 },
|
||||
{ SDL_GL_ALPHA_SIZE, 8 },
|
||||
{ SDL_GL_BUFFER_SIZE, c },
|
||||
{ SDL_GL_STENCIL_SIZE, 0 },
|
||||
{ SDL_GL_ACCUM_RED_SIZE, 0 },
|
||||
{ SDL_GL_ACCUM_GREEN_SIZE, 0 },
|
||||
{ SDL_GL_ACCUM_BLUE_SIZE, 0 },
|
||||
{ SDL_GL_ACCUM_ALPHA_SIZE, 0 },
|
||||
{ SDL_GL_DEPTH_SIZE, 24 },
|
||||
#endif
|
||||
{ SDL_GL_DOUBLEBUFFER, 1 },
|
||||
{ SDL_GL_MULTISAMPLEBUFFERS, glmultisample > 0 },
|
||||
{ SDL_GL_MULTISAMPLESAMPLES, glmultisample },
|
||||
};
|
||||
{ SDL_GL_DOUBLEBUFFER, 1 },
|
||||
{ SDL_GL_MULTISAMPLEBUFFERS, glmultisample > 0 },
|
||||
{ SDL_GL_MULTISAMPLESAMPLES, glmultisample },
|
||||
};
|
||||
|
||||
if (nogl) return -1;
|
||||
|
||||
|
@ -1138,7 +1140,7 @@ void resetvideomode(void)
|
|||
//
|
||||
void begindrawing(void)
|
||||
{
|
||||
long i,j;
|
||||
int i,j;
|
||||
|
||||
if (bpp > 8)
|
||||
{
|
||||
|
@ -1157,7 +1159,7 @@ void begindrawing(void)
|
|||
if (offscreenrendering) return;
|
||||
|
||||
if (SDL_MUSTLOCK(sdl_surface)) SDL_LockSurface(sdl_surface);
|
||||
frameplace = (long)sdl_surface->pixels;
|
||||
frameplace = (int)sdl_surface->pixels;
|
||||
|
||||
if (sdl_surface->pitch != bytesperline || modechange)
|
||||
{
|
||||
|
@ -1184,7 +1186,7 @@ void enddrawing(void)
|
|||
}
|
||||
|
||||
if (!frameplace) return;
|
||||
if (lockcount > 1) { lockcount--; return; }
|
||||
if (lockcount > 1) { lockcount--; return; }
|
||||
if (!offscreenrendering) frameplace = 0;
|
||||
if (lockcount == 0) return;
|
||||
lockcount = 0;
|
||||
|
@ -1200,7 +1202,7 @@ if (lockcount > 1) { lockcount--; return; }
|
|||
//
|
||||
void showframe(int w)
|
||||
{
|
||||
long i,j;
|
||||
int i,j;
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
if (bpp > 8)
|
||||
|
@ -1243,7 +1245,7 @@ void showframe(int w)
|
|||
|
||||
if (lockcount)
|
||||
{
|
||||
printf("Frame still locked %ld times when showframe() called.\n", lockcount);
|
||||
printf("Frame still locked %d times when showframe() called.\n", lockcount);
|
||||
while (lockcount) enddrawing();
|
||||
}
|
||||
|
||||
|
@ -1451,8 +1453,8 @@ int handleevents(void)
|
|||
case SDL_MOUSEMOTION:
|
||||
if (appactive)
|
||||
{
|
||||
mousex += ev.motion.xrel;
|
||||
mousey += ev.motion.yrel;
|
||||
mousex += ev.motion.xrel;
|
||||
mousey += ev.motion.yrel;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1463,24 +1465,25 @@ int handleevents(void)
|
|||
|
||||
case SDL_JOYHATMOTION:
|
||||
{
|
||||
int hatvals[16] = {
|
||||
-1, // centre
|
||||
0, // up 1
|
||||
9000, // right 2
|
||||
4500, // up+right 3
|
||||
18000, // down 4
|
||||
-1, // down+up!! 5
|
||||
13500, // down+right 6
|
||||
-1, // down+right+up!! 7
|
||||
27000, // left 8
|
||||
27500, // left+up 9
|
||||
-1, // left+right!! 10
|
||||
-1, // left+right+up!! 11
|
||||
22500, // left+down 12
|
||||
-1, // left+down+up!! 13
|
||||
-1, // left+down+right!! 14
|
||||
-1, // left+down+right+up!! 15
|
||||
};
|
||||
int hatvals[16] =
|
||||
{
|
||||
-1, // centre
|
||||
0, // up 1
|
||||
9000, // right 2
|
||||
4500, // up+right 3
|
||||
18000, // down 4
|
||||
-1, // down+up!! 5
|
||||
13500, // down+right 6
|
||||
-1, // down+right+up!! 7
|
||||
27000, // left 8
|
||||
27500, // left+up 9
|
||||
-1, // left+right!! 10
|
||||
-1, // left+right+up!! 11
|
||||
22500, // left+down 12
|
||||
-1, // left+down+up!! 13
|
||||
-1, // left+down+right!! 14
|
||||
-1, // left+down+right+up!! 15
|
||||
};
|
||||
if (appactive && ev.jhat.hat < joynumhats)
|
||||
joyhat[ ev.jhat.hat ] = hatvals[ ev.jhat.value & 15 ];
|
||||
break;
|
||||
|
@ -1680,26 +1683,29 @@ static int buildkeytranslationtable(void)
|
|||
void makeasmwriteable(void)
|
||||
{
|
||||
#ifndef ENGINE_USING_A_C
|
||||
extern int dep_begin, dep_end;
|
||||
extern int dep_begin, dep_end;
|
||||
# if defined _WIN32
|
||||
DWORD oldprot;
|
||||
if (!VirtualProtect((LPVOID)&dep_begin, (SIZE_T)&dep_end - (SIZE_T)&dep_begin, PAGE_EXECUTE_READWRITE, &oldprot)) {
|
||||
initprint("Error making code writeable\n");
|
||||
return;
|
||||
}
|
||||
DWORD oldprot;
|
||||
if (!VirtualProtect((LPVOID)&dep_begin, (SIZE_T)&dep_end - (SIZE_T)&dep_begin, PAGE_EXECUTE_READWRITE, &oldprot))
|
||||
{
|
||||
initprint("Error making code writeable\n");
|
||||
return;
|
||||
}
|
||||
# elif defined __linux || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__
|
||||
int pagesize;
|
||||
size_t dep_begin_page;
|
||||
pagesize = sysconf(_SC_PAGE_SIZE);
|
||||
if (pagesize == -1) {
|
||||
initprintf("Error getting system page size\n");
|
||||
return;
|
||||
}
|
||||
dep_begin_page = ((size_t)&dep_begin) & ~(pagesize-1);
|
||||
if (mprotect((const void *)dep_begin_page, (size_t)&dep_end - dep_begin_page, PROT_READ|PROT_WRITE) < 0) {
|
||||
initprintf("Error making code writeable (errno=%d)\n", errno);
|
||||
return;
|
||||
}
|
||||
int pagesize;
|
||||
size_t dep_begin_page;
|
||||
pagesize = sysconf(_SC_PAGE_SIZE);
|
||||
if (pagesize == -1)
|
||||
{
|
||||
initprintf("Error getting system page size\n");
|
||||
return;
|
||||
}
|
||||
dep_begin_page = ((size_t)&dep_begin) & ~(pagesize-1);
|
||||
if (mprotect((const void *)dep_begin_page, (size_t)&dep_end - dep_begin_page, PROT_READ|PROT_WRITE) < 0)
|
||||
{
|
||||
initprintf("Error making code writeable (errno=%d)\n", errno);
|
||||
return;
|
||||
}
|
||||
# else
|
||||
# error Don't know how to unprotect the self-modifying assembly on this platform!
|
||||
# endif
|
||||
|
|
|
@ -3,177 +3,178 @@
|
|||
// Font created by Ken Silverman
|
||||
// Generated by BIN2C.EXE by Jonathon Fowler
|
||||
|
||||
char smalltextfont[2048] = {
|
||||
// 2048 bytes
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x24,
|
||||
0x3C, 0x18, 0x00, 0x00, 0x00, 0x18, 0x24, 0x3C, 0x24, 0x18, 0x00, 0x00,
|
||||
0x00, 0x28, 0x3C, 0x3C, 0x38, 0x10, 0x00, 0x00, 0x00, 0x10, 0x38, 0x3C,
|
||||
0x38, 0x10, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x3C, 0x00, 0x00,
|
||||
0x00, 0x18, 0x18, 0x3C, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x28, 0x38, 0x38, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x1C, 0x14, 0x14, 0x30, 0x00, 0x00,
|
||||
0x00, 0x24, 0x18, 0x3C, 0x18, 0x24, 0x00, 0x00, 0x00, 0x20, 0x30, 0x38,
|
||||
0x30, 0x20, 0x00, 0x00, 0x00, 0x08, 0x18, 0x38, 0x18, 0x08, 0x00, 0x00,
|
||||
0x00, 0x10, 0x38, 0x10, 0x38, 0x10, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28,
|
||||
0x00, 0x28, 0x00, 0x00, 0x00, 0x1C, 0x34, 0x34, 0x14, 0x14, 0x00, 0x00,
|
||||
0x00, 0x1C, 0x30, 0x28, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x38, 0x38, 0x00, 0x00, 0x00, 0x10, 0x38, 0x10, 0x38, 0x38, 0x00, 0x00,
|
||||
0x00, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10,
|
||||
0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x08, 0x3C, 0x08, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x10, 0x3C, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x28, 0x28, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x3C, 0x28, 0x3C, 0x28, 0x00, 0x00,
|
||||
0x00, 0x18, 0x30, 0x10, 0x18, 0x30, 0x00, 0x00, 0x00, 0x28, 0x08, 0x10,
|
||||
0x20, 0x28, 0x00, 0x00, 0x00, 0x10, 0x28, 0x10, 0x30, 0x38, 0x00, 0x00,
|
||||
0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x20, 0x20,
|
||||
0x20, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x08, 0x08, 0x10, 0x00, 0x00,
|
||||
0x00, 0x00, 0x28, 0x10, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38,
|
||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00,
|
||||
0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x10, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x10, 0x20, 0x00, 0x00,
|
||||
0x00, 0x38, 0x28, 0x28, 0x28, 0x38, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10,
|
||||
0x10, 0x10, 0x00, 0x00, 0x00, 0x38, 0x08, 0x38, 0x20, 0x38, 0x00, 0x00,
|
||||
0x00, 0x38, 0x08, 0x38, 0x08, 0x38, 0x00, 0x00, 0x00, 0x28, 0x28, 0x38,
|
||||
0x08, 0x08, 0x00, 0x00, 0x00, 0x38, 0x20, 0x38, 0x08, 0x38, 0x00, 0x00,
|
||||
0x00, 0x38, 0x20, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x38, 0x08, 0x08,
|
||||
0x08, 0x08, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x28, 0x38, 0x00, 0x00,
|
||||
0x00, 0x38, 0x28, 0x38, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x20, 0x00, 0x00,
|
||||
0x00, 0x08, 0x10, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00,
|
||||
0x38, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08, 0x10, 0x20, 0x00, 0x00,
|
||||
0x00, 0x30, 0x08, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38,
|
||||
0x30, 0x38, 0x00, 0x00, 0x00, 0x10, 0x28, 0x38, 0x28, 0x28, 0x00, 0x00,
|
||||
0x00, 0x30, 0x28, 0x30, 0x28, 0x30, 0x00, 0x00, 0x00, 0x18, 0x20, 0x20,
|
||||
0x20, 0x18, 0x00, 0x00, 0x00, 0x30, 0x28, 0x28, 0x28, 0x30, 0x00, 0x00,
|
||||
0x00, 0x38, 0x20, 0x30, 0x20, 0x38, 0x00, 0x00, 0x00, 0x38, 0x20, 0x30,
|
||||
0x20, 0x20, 0x00, 0x00, 0x00, 0x38, 0x20, 0x28, 0x28, 0x38, 0x00, 0x00,
|
||||
0x00, 0x28, 0x28, 0x38, 0x28, 0x28, 0x00, 0x00, 0x00, 0x38, 0x10, 0x10,
|
||||
0x10, 0x38, 0x00, 0x00, 0x00, 0x38, 0x08, 0x08, 0x28, 0x18, 0x00, 0x00,
|
||||
0x00, 0x28, 0x28, 0x30, 0x28, 0x28, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20,
|
||||
0x20, 0x38, 0x00, 0x00, 0x00, 0x28, 0x38, 0x38, 0x28, 0x28, 0x00, 0x00,
|
||||
0x00, 0x28, 0x38, 0x38, 0x38, 0x28, 0x00, 0x00, 0x00, 0x38, 0x28, 0x28,
|
||||
0x28, 0x38, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x20, 0x20, 0x00, 0x00,
|
||||
0x00, 0x38, 0x28, 0x28, 0x38, 0x18, 0x00, 0x00, 0x00, 0x38, 0x28, 0x30,
|
||||
0x28, 0x28, 0x00, 0x00, 0x00, 0x38, 0x20, 0x38, 0x08, 0x38, 0x00, 0x00,
|
||||
0x00, 0x38, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28,
|
||||
0x28, 0x38, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28, 0x10, 0x10, 0x00, 0x00,
|
||||
0x00, 0x28, 0x28, 0x38, 0x38, 0x28, 0x00, 0x00, 0x00, 0x28, 0x28, 0x10,
|
||||
0x28, 0x28, 0x00, 0x00, 0x00, 0x28, 0x28, 0x38, 0x10, 0x10, 0x00, 0x00,
|
||||
0x00, 0x38, 0x08, 0x10, 0x20, 0x38, 0x00, 0x00, 0x00, 0x30, 0x20, 0x20,
|
||||
0x20, 0x30, 0x00, 0x00, 0x00, 0x20, 0x10, 0x10, 0x08, 0x08, 0x00, 0x00,
|
||||
0x00, 0x18, 0x08, 0x08, 0x08, 0x18, 0x00, 0x00, 0x00, 0x10, 0x28, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00,
|
||||
0x00, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
|
||||
0x28, 0x18, 0x00, 0x00, 0x00, 0x20, 0x20, 0x38, 0x28, 0x38, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x38, 0x20, 0x38, 0x00, 0x00, 0x00, 0x08, 0x08, 0x38,
|
||||
0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x18, 0x00, 0x00,
|
||||
0x00, 0x08, 0x10, 0x38, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x18, 0x28,
|
||||
0x18, 0x08, 0x30, 0x00, 0x00, 0x20, 0x20, 0x38, 0x28, 0x28, 0x00, 0x00,
|
||||
0x00, 0x00, 0x10, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
|
||||
0x10, 0x10, 0x20, 0x00, 0x00, 0x20, 0x20, 0x28, 0x30, 0x28, 0x00, 0x00,
|
||||
0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x20, 0x38,
|
||||
0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x28, 0x28, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
|
||||
0x28, 0x38, 0x20, 0x00, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x08, 0x00,
|
||||
0x00, 0x00, 0x00, 0x38, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
|
||||
0x10, 0x30, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x10, 0x10, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x28, 0x28, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28,
|
||||
0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x28, 0x10, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28,
|
||||
0x28, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x18, 0x00, 0x00,
|
||||
0x00, 0x18, 0x10, 0x20, 0x10, 0x18, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00,
|
||||
0x10, 0x10, 0x00, 0x00, 0x00, 0x30, 0x10, 0x08, 0x10, 0x30, 0x00, 0x00,
|
||||
0x00, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x28,
|
||||
0x38, 0x00, 0x00, 0x00, 0x00, 0x18, 0x20, 0x20, 0x20, 0x18, 0x30, 0x00,
|
||||
0x00, 0x28, 0x00, 0x28, 0x28, 0x18, 0x00, 0x00, 0x00, 0x18, 0x00, 0x18,
|
||||
0x38, 0x18, 0x00, 0x00, 0x00, 0x38, 0x00, 0x18, 0x28, 0x18, 0x00, 0x00,
|
||||
0x00, 0x28, 0x00, 0x18, 0x28, 0x18, 0x00, 0x00, 0x00, 0x30, 0x00, 0x18,
|
||||
0x28, 0x18, 0x00, 0x00, 0x00, 0x00, 0x10, 0x18, 0x28, 0x18, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x38, 0x20, 0x38, 0x10, 0x00, 0x00, 0x38, 0x00, 0x18,
|
||||
0x38, 0x18, 0x00, 0x00, 0x00, 0x28, 0x00, 0x18, 0x38, 0x18, 0x00, 0x00,
|
||||
0x00, 0x30, 0x00, 0x18, 0x38, 0x18, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00,
|
||||
0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x10, 0x10, 0x00, 0x00,
|
||||
0x00, 0x00, 0x30, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x28, 0x10, 0x28,
|
||||
0x38, 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x38, 0x28, 0x00, 0x00,
|
||||
0x00, 0x18, 0x00, 0x38, 0x30, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C,
|
||||
0x28, 0x1C, 0x00, 0x00, 0x00, 0x1C, 0x28, 0x3C, 0x28, 0x2C, 0x00, 0x00,
|
||||
0x00, 0x38, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x28, 0x00, 0x38,
|
||||
0x28, 0x38, 0x00, 0x00, 0x00, 0x30, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00,
|
||||
0x00, 0x38, 0x00, 0x28, 0x28, 0x18, 0x00, 0x00, 0x00, 0x30, 0x00, 0x28,
|
||||
0x28, 0x18, 0x00, 0x00, 0x00, 0x28, 0x00, 0x28, 0x28, 0x18, 0x30, 0x00,
|
||||
0x00, 0x28, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x28, 0x00, 0x28,
|
||||
0x28, 0x38, 0x00, 0x00, 0x00, 0x10, 0x38, 0x20, 0x38, 0x10, 0x00, 0x00,
|
||||
0x00, 0x18, 0x14, 0x30, 0x10, 0x3C, 0x00, 0x00, 0x00, 0x28, 0x10, 0x38,
|
||||
0x38, 0x10, 0x00, 0x00, 0x00, 0x30, 0x28, 0x3C, 0x28, 0x2C, 0x00, 0x00,
|
||||
0x00, 0x18, 0x10, 0x38, 0x10, 0x30, 0x00, 0x00, 0x00, 0x18, 0x00, 0x18,
|
||||
0x28, 0x18, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x10, 0x10, 0x00, 0x00,
|
||||
0x00, 0x18, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x18, 0x00, 0x28,
|
||||
0x28, 0x18, 0x00, 0x00, 0x00, 0x30, 0x00, 0x30, 0x28, 0x28, 0x00, 0x00,
|
||||
0x00, 0x38, 0x00, 0x28, 0x38, 0x28, 0x00, 0x00, 0x00, 0x18, 0x28, 0x18,
|
||||
0x00, 0x38, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x00, 0x38, 0x00, 0x00,
|
||||
0x00, 0x10, 0x00, 0x10, 0x20, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C,
|
||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x00, 0x00, 0x00,
|
||||
0x00, 0x20, 0x28, 0x10, 0x38, 0x18, 0x00, 0x00, 0x00, 0x20, 0x28, 0x18,
|
||||
0x38, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x10, 0x10, 0x00, 0x00,
|
||||
0x00, 0x00, 0x14, 0x28, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x14,
|
||||
0x28, 0x00, 0x00, 0x00, 0x00, 0x08, 0x20, 0x08, 0x20, 0x08, 0x20, 0x00,
|
||||
0x00, 0x14, 0x28, 0x14, 0x28, 0x14, 0x28, 0x00, 0x00, 0x34, 0x1C, 0x34,
|
||||
0x1C, 0x34, 0x1C, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00,
|
||||
0x00, 0x10, 0x10, 0x30, 0x10, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x30,
|
||||
0x30, 0x10, 0x10, 0x00, 0x00, 0x18, 0x18, 0x38, 0x18, 0x18, 0x18, 0x00,
|
||||
0x00, 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x30,
|
||||
0x30, 0x10, 0x10, 0x00, 0x00, 0x18, 0x18, 0x38, 0x38, 0x18, 0x18, 0x00,
|
||||
0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x38,
|
||||
0x38, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x38, 0x38, 0x00, 0x00, 0x00,
|
||||
0x00, 0x18, 0x18, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x30,
|
||||
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x10, 0x10, 0x00,
|
||||
0x00, 0x10, 0x10, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x3C,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x10, 0x10, 0x10, 0x00,
|
||||
0x00, 0x10, 0x10, 0x1C, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x3C,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x3C, 0x10, 0x10, 0x10, 0x00,
|
||||
0x00, 0x10, 0x10, 0x1C, 0x1C, 0x10, 0x10, 0x00, 0x00, 0x18, 0x18, 0x1C,
|
||||
0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x1C, 0x1C, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x1C, 0x1C, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x3C,
|
||||
0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x3C, 0x18, 0x18, 0x00,
|
||||
0x00, 0x18, 0x18, 0x1C, 0x1C, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x3C,
|
||||
0x3C, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00,
|
||||
0x00, 0x10, 0x10, 0x3C, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x3C,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x3C, 0x10, 0x10, 0x00,
|
||||
0x00, 0x00, 0x00, 0x3C, 0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x1C,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x1C, 0x1C, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x1C, 0x1C, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C,
|
||||
0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x3C, 0x18, 0x18, 0x18, 0x00,
|
||||
0x00, 0x10, 0x10, 0x3C, 0x3C, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x30,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x10, 0x10, 0x10, 0x00,
|
||||
0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x3C, 0x3C, 0x3C, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x00,
|
||||
0x00, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x00, 0x00, 0x3C, 0x3C, 0x3C,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x28, 0x34, 0x00, 0x00,
|
||||
0x00, 0x30, 0x28, 0x30, 0x28, 0x30, 0x20, 0x00, 0x00, 0x38, 0x28, 0x20,
|
||||
0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x18, 0x18, 0x00, 0x00,
|
||||
0x00, 0x38, 0x20, 0x10, 0x20, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C,
|
||||
0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x28, 0x28, 0x30, 0x20, 0x00, 0x00,
|
||||
0x00, 0x00, 0x14, 0x28, 0x08, 0x08, 0x00, 0x00, 0x00, 0x38, 0x10, 0x28,
|
||||
0x10, 0x38, 0x00, 0x00, 0x00, 0x10, 0x28, 0x38, 0x28, 0x10, 0x00, 0x00,
|
||||
0x00, 0x18, 0x24, 0x24, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x18, 0x10, 0x18,
|
||||
0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, 0x00,
|
||||
0x00, 0x04, 0x18, 0x3C, 0x18, 0x20, 0x00, 0x00, 0x00, 0x18, 0x20, 0x30,
|
||||
0x20, 0x18, 0x00, 0x00, 0x00, 0x10, 0x28, 0x28, 0x28, 0x28, 0x00, 0x00,
|
||||
0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x00, 0x00, 0x10, 0x38, 0x10,
|
||||
0x00, 0x38, 0x00, 0x00, 0x00, 0x10, 0x08, 0x10, 0x00, 0x38, 0x00, 0x00,
|
||||
0x00, 0x10, 0x20, 0x10, 0x00, 0x38, 0x00, 0x00, 0x00, 0x10, 0x28, 0x20,
|
||||
0x20, 0x20, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x28, 0x10, 0x00, 0x00,
|
||||
0x00, 0x10, 0x00, 0x38, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38,
|
||||
0x30, 0x00, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x10, 0x10, 0x30, 0x10, 0x00, 0x00,
|
||||
0x00, 0x30, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x38,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
char smalltextfont[2048] =
|
||||
{
|
||||
// 2048 bytes
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x24,
|
||||
0x3C, 0x18, 0x00, 0x00, 0x00, 0x18, 0x24, 0x3C, 0x24, 0x18, 0x00, 0x00,
|
||||
0x00, 0x28, 0x3C, 0x3C, 0x38, 0x10, 0x00, 0x00, 0x00, 0x10, 0x38, 0x3C,
|
||||
0x38, 0x10, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x3C, 0x00, 0x00,
|
||||
0x00, 0x18, 0x18, 0x3C, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x28, 0x38, 0x38, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x1C, 0x14, 0x14, 0x30, 0x00, 0x00,
|
||||
0x00, 0x24, 0x18, 0x3C, 0x18, 0x24, 0x00, 0x00, 0x00, 0x20, 0x30, 0x38,
|
||||
0x30, 0x20, 0x00, 0x00, 0x00, 0x08, 0x18, 0x38, 0x18, 0x08, 0x00, 0x00,
|
||||
0x00, 0x10, 0x38, 0x10, 0x38, 0x10, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28,
|
||||
0x00, 0x28, 0x00, 0x00, 0x00, 0x1C, 0x34, 0x34, 0x14, 0x14, 0x00, 0x00,
|
||||
0x00, 0x1C, 0x30, 0x28, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x38, 0x38, 0x00, 0x00, 0x00, 0x10, 0x38, 0x10, 0x38, 0x38, 0x00, 0x00,
|
||||
0x00, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10,
|
||||
0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x08, 0x3C, 0x08, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x10, 0x3C, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x28, 0x28, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x3C, 0x28, 0x3C, 0x28, 0x00, 0x00,
|
||||
0x00, 0x18, 0x30, 0x10, 0x18, 0x30, 0x00, 0x00, 0x00, 0x28, 0x08, 0x10,
|
||||
0x20, 0x28, 0x00, 0x00, 0x00, 0x10, 0x28, 0x10, 0x30, 0x38, 0x00, 0x00,
|
||||
0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x20, 0x20,
|
||||
0x20, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x08, 0x08, 0x10, 0x00, 0x00,
|
||||
0x00, 0x00, 0x28, 0x10, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38,
|
||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00,
|
||||
0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x10, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x10, 0x20, 0x00, 0x00,
|
||||
0x00, 0x38, 0x28, 0x28, 0x28, 0x38, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10,
|
||||
0x10, 0x10, 0x00, 0x00, 0x00, 0x38, 0x08, 0x38, 0x20, 0x38, 0x00, 0x00,
|
||||
0x00, 0x38, 0x08, 0x38, 0x08, 0x38, 0x00, 0x00, 0x00, 0x28, 0x28, 0x38,
|
||||
0x08, 0x08, 0x00, 0x00, 0x00, 0x38, 0x20, 0x38, 0x08, 0x38, 0x00, 0x00,
|
||||
0x00, 0x38, 0x20, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x38, 0x08, 0x08,
|
||||
0x08, 0x08, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x28, 0x38, 0x00, 0x00,
|
||||
0x00, 0x38, 0x28, 0x38, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x20, 0x00, 0x00,
|
||||
0x00, 0x08, 0x10, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00,
|
||||
0x38, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08, 0x10, 0x20, 0x00, 0x00,
|
||||
0x00, 0x30, 0x08, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38,
|
||||
0x30, 0x38, 0x00, 0x00, 0x00, 0x10, 0x28, 0x38, 0x28, 0x28, 0x00, 0x00,
|
||||
0x00, 0x30, 0x28, 0x30, 0x28, 0x30, 0x00, 0x00, 0x00, 0x18, 0x20, 0x20,
|
||||
0x20, 0x18, 0x00, 0x00, 0x00, 0x30, 0x28, 0x28, 0x28, 0x30, 0x00, 0x00,
|
||||
0x00, 0x38, 0x20, 0x30, 0x20, 0x38, 0x00, 0x00, 0x00, 0x38, 0x20, 0x30,
|
||||
0x20, 0x20, 0x00, 0x00, 0x00, 0x38, 0x20, 0x28, 0x28, 0x38, 0x00, 0x00,
|
||||
0x00, 0x28, 0x28, 0x38, 0x28, 0x28, 0x00, 0x00, 0x00, 0x38, 0x10, 0x10,
|
||||
0x10, 0x38, 0x00, 0x00, 0x00, 0x38, 0x08, 0x08, 0x28, 0x18, 0x00, 0x00,
|
||||
0x00, 0x28, 0x28, 0x30, 0x28, 0x28, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20,
|
||||
0x20, 0x38, 0x00, 0x00, 0x00, 0x28, 0x38, 0x38, 0x28, 0x28, 0x00, 0x00,
|
||||
0x00, 0x28, 0x38, 0x38, 0x38, 0x28, 0x00, 0x00, 0x00, 0x38, 0x28, 0x28,
|
||||
0x28, 0x38, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x20, 0x20, 0x00, 0x00,
|
||||
0x00, 0x38, 0x28, 0x28, 0x38, 0x18, 0x00, 0x00, 0x00, 0x38, 0x28, 0x30,
|
||||
0x28, 0x28, 0x00, 0x00, 0x00, 0x38, 0x20, 0x38, 0x08, 0x38, 0x00, 0x00,
|
||||
0x00, 0x38, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28,
|
||||
0x28, 0x38, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28, 0x10, 0x10, 0x00, 0x00,
|
||||
0x00, 0x28, 0x28, 0x38, 0x38, 0x28, 0x00, 0x00, 0x00, 0x28, 0x28, 0x10,
|
||||
0x28, 0x28, 0x00, 0x00, 0x00, 0x28, 0x28, 0x38, 0x10, 0x10, 0x00, 0x00,
|
||||
0x00, 0x38, 0x08, 0x10, 0x20, 0x38, 0x00, 0x00, 0x00, 0x30, 0x20, 0x20,
|
||||
0x20, 0x30, 0x00, 0x00, 0x00, 0x20, 0x10, 0x10, 0x08, 0x08, 0x00, 0x00,
|
||||
0x00, 0x18, 0x08, 0x08, 0x08, 0x18, 0x00, 0x00, 0x00, 0x10, 0x28, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00,
|
||||
0x00, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
|
||||
0x28, 0x18, 0x00, 0x00, 0x00, 0x20, 0x20, 0x38, 0x28, 0x38, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x38, 0x20, 0x38, 0x00, 0x00, 0x00, 0x08, 0x08, 0x38,
|
||||
0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x18, 0x00, 0x00,
|
||||
0x00, 0x08, 0x10, 0x38, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x18, 0x28,
|
||||
0x18, 0x08, 0x30, 0x00, 0x00, 0x20, 0x20, 0x38, 0x28, 0x28, 0x00, 0x00,
|
||||
0x00, 0x00, 0x10, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
|
||||
0x10, 0x10, 0x20, 0x00, 0x00, 0x20, 0x20, 0x28, 0x30, 0x28, 0x00, 0x00,
|
||||
0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x20, 0x38,
|
||||
0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x28, 0x28, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
|
||||
0x28, 0x38, 0x20, 0x00, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x08, 0x00,
|
||||
0x00, 0x00, 0x00, 0x38, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
|
||||
0x10, 0x30, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x10, 0x10, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x28, 0x28, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28,
|
||||
0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x28, 0x10, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28,
|
||||
0x28, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x18, 0x00, 0x00,
|
||||
0x00, 0x18, 0x10, 0x20, 0x10, 0x18, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00,
|
||||
0x10, 0x10, 0x00, 0x00, 0x00, 0x30, 0x10, 0x08, 0x10, 0x30, 0x00, 0x00,
|
||||
0x00, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x28,
|
||||
0x38, 0x00, 0x00, 0x00, 0x00, 0x18, 0x20, 0x20, 0x20, 0x18, 0x30, 0x00,
|
||||
0x00, 0x28, 0x00, 0x28, 0x28, 0x18, 0x00, 0x00, 0x00, 0x18, 0x00, 0x18,
|
||||
0x38, 0x18, 0x00, 0x00, 0x00, 0x38, 0x00, 0x18, 0x28, 0x18, 0x00, 0x00,
|
||||
0x00, 0x28, 0x00, 0x18, 0x28, 0x18, 0x00, 0x00, 0x00, 0x30, 0x00, 0x18,
|
||||
0x28, 0x18, 0x00, 0x00, 0x00, 0x00, 0x10, 0x18, 0x28, 0x18, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x38, 0x20, 0x38, 0x10, 0x00, 0x00, 0x38, 0x00, 0x18,
|
||||
0x38, 0x18, 0x00, 0x00, 0x00, 0x28, 0x00, 0x18, 0x38, 0x18, 0x00, 0x00,
|
||||
0x00, 0x30, 0x00, 0x18, 0x38, 0x18, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00,
|
||||
0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x10, 0x10, 0x00, 0x00,
|
||||
0x00, 0x00, 0x30, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x28, 0x10, 0x28,
|
||||
0x38, 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x38, 0x28, 0x00, 0x00,
|
||||
0x00, 0x18, 0x00, 0x38, 0x30, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C,
|
||||
0x28, 0x1C, 0x00, 0x00, 0x00, 0x1C, 0x28, 0x3C, 0x28, 0x2C, 0x00, 0x00,
|
||||
0x00, 0x38, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x28, 0x00, 0x38,
|
||||
0x28, 0x38, 0x00, 0x00, 0x00, 0x30, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00,
|
||||
0x00, 0x38, 0x00, 0x28, 0x28, 0x18, 0x00, 0x00, 0x00, 0x30, 0x00, 0x28,
|
||||
0x28, 0x18, 0x00, 0x00, 0x00, 0x28, 0x00, 0x28, 0x28, 0x18, 0x30, 0x00,
|
||||
0x00, 0x28, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x28, 0x00, 0x28,
|
||||
0x28, 0x38, 0x00, 0x00, 0x00, 0x10, 0x38, 0x20, 0x38, 0x10, 0x00, 0x00,
|
||||
0x00, 0x18, 0x14, 0x30, 0x10, 0x3C, 0x00, 0x00, 0x00, 0x28, 0x10, 0x38,
|
||||
0x38, 0x10, 0x00, 0x00, 0x00, 0x30, 0x28, 0x3C, 0x28, 0x2C, 0x00, 0x00,
|
||||
0x00, 0x18, 0x10, 0x38, 0x10, 0x30, 0x00, 0x00, 0x00, 0x18, 0x00, 0x18,
|
||||
0x28, 0x18, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x10, 0x10, 0x00, 0x00,
|
||||
0x00, 0x18, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x18, 0x00, 0x28,
|
||||
0x28, 0x18, 0x00, 0x00, 0x00, 0x30, 0x00, 0x30, 0x28, 0x28, 0x00, 0x00,
|
||||
0x00, 0x38, 0x00, 0x28, 0x38, 0x28, 0x00, 0x00, 0x00, 0x18, 0x28, 0x18,
|
||||
0x00, 0x38, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x00, 0x38, 0x00, 0x00,
|
||||
0x00, 0x10, 0x00, 0x10, 0x20, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C,
|
||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x00, 0x00, 0x00,
|
||||
0x00, 0x20, 0x28, 0x10, 0x38, 0x18, 0x00, 0x00, 0x00, 0x20, 0x28, 0x18,
|
||||
0x38, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x10, 0x10, 0x00, 0x00,
|
||||
0x00, 0x00, 0x14, 0x28, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x14,
|
||||
0x28, 0x00, 0x00, 0x00, 0x00, 0x08, 0x20, 0x08, 0x20, 0x08, 0x20, 0x00,
|
||||
0x00, 0x14, 0x28, 0x14, 0x28, 0x14, 0x28, 0x00, 0x00, 0x34, 0x1C, 0x34,
|
||||
0x1C, 0x34, 0x1C, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00,
|
||||
0x00, 0x10, 0x10, 0x30, 0x10, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x30,
|
||||
0x30, 0x10, 0x10, 0x00, 0x00, 0x18, 0x18, 0x38, 0x18, 0x18, 0x18, 0x00,
|
||||
0x00, 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x30,
|
||||
0x30, 0x10, 0x10, 0x00, 0x00, 0x18, 0x18, 0x38, 0x38, 0x18, 0x18, 0x00,
|
||||
0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x38,
|
||||
0x38, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x38, 0x38, 0x00, 0x00, 0x00,
|
||||
0x00, 0x18, 0x18, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x30,
|
||||
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x10, 0x10, 0x00,
|
||||
0x00, 0x10, 0x10, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x3C,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x10, 0x10, 0x10, 0x00,
|
||||
0x00, 0x10, 0x10, 0x1C, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x3C,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x3C, 0x10, 0x10, 0x10, 0x00,
|
||||
0x00, 0x10, 0x10, 0x1C, 0x1C, 0x10, 0x10, 0x00, 0x00, 0x18, 0x18, 0x1C,
|
||||
0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x1C, 0x1C, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x1C, 0x1C, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x3C,
|
||||
0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x3C, 0x18, 0x18, 0x00,
|
||||
0x00, 0x18, 0x18, 0x1C, 0x1C, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x3C,
|
||||
0x3C, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00,
|
||||
0x00, 0x10, 0x10, 0x3C, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x3C,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x3C, 0x10, 0x10, 0x00,
|
||||
0x00, 0x00, 0x00, 0x3C, 0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x1C,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x1C, 0x1C, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x1C, 0x1C, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C,
|
||||
0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x3C, 0x18, 0x18, 0x18, 0x00,
|
||||
0x00, 0x10, 0x10, 0x3C, 0x3C, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x30,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x10, 0x10, 0x10, 0x00,
|
||||
0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x3C, 0x3C, 0x3C, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x00,
|
||||
0x00, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x00, 0x00, 0x3C, 0x3C, 0x3C,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x28, 0x34, 0x00, 0x00,
|
||||
0x00, 0x30, 0x28, 0x30, 0x28, 0x30, 0x20, 0x00, 0x00, 0x38, 0x28, 0x20,
|
||||
0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x18, 0x18, 0x00, 0x00,
|
||||
0x00, 0x38, 0x20, 0x10, 0x20, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C,
|
||||
0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x28, 0x28, 0x30, 0x20, 0x00, 0x00,
|
||||
0x00, 0x00, 0x14, 0x28, 0x08, 0x08, 0x00, 0x00, 0x00, 0x38, 0x10, 0x28,
|
||||
0x10, 0x38, 0x00, 0x00, 0x00, 0x10, 0x28, 0x38, 0x28, 0x10, 0x00, 0x00,
|
||||
0x00, 0x18, 0x24, 0x24, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x18, 0x10, 0x18,
|
||||
0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, 0x00,
|
||||
0x00, 0x04, 0x18, 0x3C, 0x18, 0x20, 0x00, 0x00, 0x00, 0x18, 0x20, 0x30,
|
||||
0x20, 0x18, 0x00, 0x00, 0x00, 0x10, 0x28, 0x28, 0x28, 0x28, 0x00, 0x00,
|
||||
0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x00, 0x00, 0x10, 0x38, 0x10,
|
||||
0x00, 0x38, 0x00, 0x00, 0x00, 0x10, 0x08, 0x10, 0x00, 0x38, 0x00, 0x00,
|
||||
0x00, 0x10, 0x20, 0x10, 0x00, 0x38, 0x00, 0x00, 0x00, 0x10, 0x28, 0x20,
|
||||
0x20, 0x20, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x28, 0x10, 0x00, 0x00,
|
||||
0x00, 0x10, 0x00, 0x38, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38,
|
||||
0x30, 0x00, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x10, 0x10, 0x30, 0x10, 0x00, 0x00,
|
||||
0x00, 0x30, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x38,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
|
|
@ -61,7 +61,7 @@ static int F_CALLBACKAPI f_tell(unsigned int handle)
|
|||
}
|
||||
|
||||
|
||||
void initsb(char dadigistat, char damusistat, long dasamplerate, char danumspeakers, char dabytespersample, char daintspersec, char daquality)
|
||||
void initsb(char dadigistat, char damusistat, int dasamplerate, char danumspeakers, char dabytespersample, char daintspersec, char daquality)
|
||||
{
|
||||
char *s;
|
||||
int i,j;
|
||||
|
@ -78,7 +78,8 @@ void initsb(char dadigistat, char damusistat, long dasamplerate, char danumspeak
|
|||
printOSD(" Linked version: %.02f\n", FMOD_VERSION);
|
||||
printOSD(" DLL version: %.02f\n", FSOUND_GetVersion());
|
||||
|
||||
if (FSOUND_GetVersion() < FMOD_VERSION) {
|
||||
if (FSOUND_GetVersion() < FMOD_VERSION)
|
||||
{
|
||||
printOSD(" ... Failure: FMOD DLL too old! Sound disabled.\n");
|
||||
return;
|
||||
}
|
||||
|
@ -87,14 +88,18 @@ void initsb(char dadigistat, char damusistat, long dasamplerate, char danumspeak
|
|||
|
||||
//FSOUND_SetOutput(FSOUND_OUTPUT_ASIO);
|
||||
|
||||
if (FSOUND_Init(dasamplerate, NUMCHANNELS, 0)) {
|
||||
if (FSOUND_Init(dasamplerate, NUMCHANNELS, 0))
|
||||
{
|
||||
printOSD(" ... Success\n");
|
||||
fmod_inited = 1;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
printOSD(" ... Failure: %s\n", FMOD_ErrorString(FSOUND_GetError()));
|
||||
}
|
||||
|
||||
switch (FSOUND_GetOutput()) {
|
||||
switch (FSOUND_GetOutput())
|
||||
{
|
||||
case FSOUND_OUTPUT_NOSOUND:
|
||||
s = "No Sound"; break;
|
||||
case FSOUND_OUTPUT_WINMM:
|
||||
|
@ -129,19 +134,20 @@ void initsb(char dadigistat, char damusistat, long dasamplerate, char danumspeak
|
|||
|
||||
void uninitsb(void)
|
||||
{
|
||||
if (fmod_inited) {
|
||||
if (fmod_inited)
|
||||
{
|
||||
FSOUND_Close();
|
||||
fmod_inited = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void setears(long daposx, long daposy, long daxvect, long dayvect)
|
||||
void setears(int daposx, int daposy, int daxvect, int dayvect)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void wsayfollow(char *dafilename, long dafreq, long davol, long *daxplc, long *dayplc, char followstat)
|
||||
void wsayfollow(char *dafilename, int dafreq, int davol, int *daxplc, int *dayplc, char followstat)
|
||||
{
|
||||
/*
|
||||
dafilename:
|
||||
|
@ -164,13 +170,14 @@ void wsayfollow(char *dafilename, long dafreq, long davol, long *daxplc, long *d
|
|||
1 = position follows an object
|
||||
*/
|
||||
unsigned char ch1, ch2;
|
||||
long i, wavnum, bad, oldest=0, free=-1, ox, oy, x, y, vo;
|
||||
int i, wavnum, bad, oldest=0, free=-1, ox, oy, x, y, vo;
|
||||
unsigned int oldestpos=0;
|
||||
int chan;
|
||||
|
||||
if (fmod_inited == 0) return;
|
||||
|
||||
for (wavnum=numwaves-1;wavnum>=0;wavnum--) {
|
||||
for (wavnum=numwaves-1;wavnum>=0;wavnum--)
|
||||
{
|
||||
bad = 0;
|
||||
|
||||
i = 0;
|
||||
|
@ -178,25 +185,29 @@ void wsayfollow(char *dafilename, long dafreq, long davol, long *daxplc, long *d
|
|||
{
|
||||
ch1 = dafilename[i]; if ((ch1 >= 97) && (ch1 <= 123)) ch1 -= 32;
|
||||
ch2 = instname[wavnum][i]; if ((ch2 >= 97) && (ch2 <= 123)) ch2 -= 32;
|
||||
if (ch1 != ch2) {bad = 1; break;}
|
||||
if (ch1 != ch2) {bad = 1; break;}
|
||||
i++;
|
||||
}
|
||||
if (bad != 0) continue;
|
||||
|
||||
for (i=0; i<NUMCHANNELS; i++) {
|
||||
if (!FSOUND_IsPlaying(channels[i])) {
|
||||
for (i=0; i<NUMCHANNELS; i++)
|
||||
{
|
||||
if (!FSOUND_IsPlaying(channels[i]))
|
||||
{
|
||||
free = i;
|
||||
break;
|
||||
}
|
||||
if (i==0) continue;
|
||||
|
||||
if (FSOUND_GetCurrentPosition(channels[i]) > oldestpos) {
|
||||
if (FSOUND_GetCurrentPosition(channels[i]) > oldestpos)
|
||||
{
|
||||
oldest = i;
|
||||
oldestpos = FSOUND_GetCurrentPosition(channels[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (free < 0) {
|
||||
if (free < 0)
|
||||
{
|
||||
FSOUND_StopSound(channels[oldest]);
|
||||
free = oldest;
|
||||
}
|
||||
|
@ -214,10 +225,10 @@ void wsayfollow(char *dafilename, long dafreq, long davol, long *daxplc, long *d
|
|||
}
|
||||
|
||||
|
||||
void wsay(char *dafilename, long dafreq, long volume1, long volume2)
|
||||
void wsay(char *dafilename, int dafreq, int volume1, int volume2)
|
||||
{
|
||||
unsigned char ch1, ch2;
|
||||
long i, j, bad, free=-1, oldest=0;
|
||||
int i, j, bad, free=-1, oldest=0;
|
||||
unsigned int oldestpos=0;
|
||||
int chan;
|
||||
|
||||
|
@ -233,25 +244,29 @@ void wsay(char *dafilename, long dafreq, long volume1, long volume2)
|
|||
{
|
||||
ch1 = dafilename[j]; if ((ch1 >= 97) && (ch1 <= 123)) ch1 -= 32;
|
||||
ch2 = instname[i][j]; if ((ch2 >= 97) && (ch2 <= 123)) ch2 -= 32;
|
||||
if (ch1 != ch2) {bad = 1; break;}
|
||||
if (ch1 != ch2) {bad = 1; break;}
|
||||
j++;
|
||||
}
|
||||
if (bad == 0)
|
||||
{
|
||||
for (j=0; j<NUMCHANNELS; j++) {
|
||||
if (!FSOUND_IsPlaying(channels[j])) {
|
||||
for (j=0; j<NUMCHANNELS; j++)
|
||||
{
|
||||
if (!FSOUND_IsPlaying(channels[j]))
|
||||
{
|
||||
free = j;
|
||||
break;
|
||||
}
|
||||
if (j==0) continue;
|
||||
|
||||
if (FSOUND_GetCurrentPosition(channels[j]) > oldestpos) {
|
||||
if (FSOUND_GetCurrentPosition(channels[j]) > oldestpos)
|
||||
{
|
||||
oldest = j;
|
||||
oldestpos = FSOUND_GetCurrentPosition(channels[j]);
|
||||
}
|
||||
}
|
||||
|
||||
if (free < 0) {
|
||||
if (free < 0)
|
||||
{
|
||||
FSOUND_StopSound(channels[oldest]);
|
||||
free = oldest;
|
||||
}
|
||||
|
@ -269,36 +284,42 @@ void wsay(char *dafilename, long dafreq, long volume1, long volume2)
|
|||
}
|
||||
|
||||
i--;
|
||||
} while (i >= 0);
|
||||
}
|
||||
while (i >= 0);
|
||||
}
|
||||
|
||||
|
||||
void loadwaves(void)
|
||||
{
|
||||
long fil, dawaversionum, i, tmp;
|
||||
long wavleng[MAXWAVES], repstart[MAXWAVES], repleng[MAXWAVES], finetune[MAXWAVES];
|
||||
int fil, dawaversionum, i, tmp;
|
||||
int wavleng[MAXWAVES], repstart[MAXWAVES], repleng[MAXWAVES], finetune[MAXWAVES];
|
||||
char *p;
|
||||
|
||||
fil = kopen4load("WAVES.KWV", 0);
|
||||
|
||||
if (fil != -1) {
|
||||
if (fil != -1)
|
||||
{
|
||||
kread(fil, &dawaversionum, 4); dawaversionum = B_LITTLE32(dawaversionum);
|
||||
if (dawaversionum != 0) { kclose(fil); return; }
|
||||
|
||||
kread(fil, &numwaves, 4); numwaves = B_LITTLE32(numwaves);
|
||||
for (i=0; i<numwaves; i++) {
|
||||
for (i=0; i<numwaves; i++)
|
||||
{
|
||||
kread(fil, &instname[i][0], 16);
|
||||
kread(fil, &wavleng[i], 4); wavleng[i] = B_LITTLE32(wavleng[i]);
|
||||
kread(fil, &repstart[i], 4); repstart[i] = B_LITTLE32(repstart[i]);
|
||||
kread(fil, &repleng[i], 4); repleng[i] = B_LITTLE32(repleng[i]);
|
||||
kread(fil, &finetune[i], 4); finetune[i] = B_LITTLE32(finetune[i]);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
dawaversionum = 0;
|
||||
numwaves = 0;
|
||||
}
|
||||
|
||||
for (i=numwaves; i<MAXWAVES; i++) {
|
||||
for (i=numwaves; i<MAXWAVES; i++)
|
||||
{
|
||||
memset(&instname[i][0], 0, 16);
|
||||
wavleng[i] = 0;
|
||||
repstart[i] = 0;
|
||||
|
@ -309,7 +330,8 @@ void loadwaves(void)
|
|||
|
||||
if (fil == -1) return;
|
||||
|
||||
for (i=0; i<numwaves; i++) {
|
||||
for (i=0; i<numwaves; i++)
|
||||
{
|
||||
if (repleng[i]) tmp = FSOUND_LOOP_NORMAL;
|
||||
else tmp = FSOUND_LOOP_OFF;
|
||||
samples[i] = FSOUND_Sample_Alloc(FSOUND_FREE, wavleng[i], tmp, 11025, 255, 128, 1);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
void initsb(char dadigistat, char damusistat, long dasamplerate, char danumspeakers, char dabytespersample, char daintspersec, char daquality)
|
||||
void initsb(char dadigistat, char damusistat, int dasamplerate, char danumspeakers, char dabytespersample, char daintspersec, char daquality)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -6,15 +6,15 @@ void uninitsb(void)
|
|||
{
|
||||
}
|
||||
|
||||
void setears(long daposx, long daposy, long daxvect, long dayvect)
|
||||
void setears(int daposx, int daposy, int daxvect, int dayvect)
|
||||
{
|
||||
}
|
||||
|
||||
void wsayfollow(char *dafilename, long dafreq, long davol, long *daxplc, long *dayplc, char followstat)
|
||||
void wsayfollow(char *dafilename, int dafreq, int davol, int *daxplc, int *dayplc, char followstat)
|
||||
{
|
||||
}
|
||||
|
||||
void wsay(char *dafilename, long dafreq, long volume1, long volume2)
|
||||
void wsay(char *dafilename, int dafreq, int volume1, int volume2)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
#define TAB_CONFIG 0
|
||||
#define TAB_MESSAGES 1
|
||||
|
||||
static struct {
|
||||
static struct
|
||||
{
|
||||
int fullscreen;
|
||||
int xdim2d, ydim2d;
|
||||
int xdim3d, ydim3d, bpp3d;
|
||||
|
@ -83,10 +84,12 @@ static void PopulateForm(void)
|
|||
mode2d = checkvideomode(&settings.xdim2d, &settings.ydim2d, 8, settings.fullscreen, 1);
|
||||
mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, settings.bpp3d, settings.fullscreen, 1);
|
||||
if (mode2d < 0) mode2d = 0;
|
||||
if (mode3d < 0) {
|
||||
if (mode3d < 0)
|
||||
{
|
||||
int i, cd[] = { 32, 24, 16, 15, 8, 0 };
|
||||
for (i=0; cd[i]; ) { if (cd[i] >= settings.bpp3d) i++; else break; }
|
||||
for ( ; cd[i]; i++) {
|
||||
for (i=0; cd[i];) { if (cd[i] >= settings.bpp3d) i++; else break; }
|
||||
for (; cd[i]; i++)
|
||||
{
|
||||
mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, cd[i], settings.fullscreen, 1);
|
||||
if (mode3d < 0) continue;
|
||||
settings.bpp3d = cd[i];
|
||||
|
@ -104,14 +107,16 @@ static void PopulateForm(void)
|
|||
gtk_list_store_clear(modes2d);
|
||||
gtk_list_store_clear(modes3d);
|
||||
|
||||
for (i=0; i<validmodecnt; i++) {
|
||||
for (i=0; i<validmodecnt; i++)
|
||||
{
|
||||
if (validmode[i].fs != settings.fullscreen) continue;
|
||||
|
||||
// all modes get added to the 3D mode list
|
||||
Bsprintf(buf, "%ld x %ld %dbpp", validmode[i].xdim, validmode[i].ydim, validmode[i].bpp);
|
||||
Bsprintf(buf, "%d x %d %dbpp", validmode[i].xdim, validmode[i].ydim, validmode[i].bpp);
|
||||
gtk_list_store_append(modes3d, &iter);
|
||||
gtk_list_store_set(modes3d, &iter, 0,buf, 1,i, -1);
|
||||
if (i == mode3d) {
|
||||
if (i == mode3d)
|
||||
{
|
||||
g_signal_handlers_block_by_func(box3d, on_vmode3dcombo_changed, NULL);
|
||||
gtk_combo_box_set_active_iter(box3d, &iter);
|
||||
g_signal_handlers_unblock_by_func(box3d, on_vmode3dcombo_changed, NULL);
|
||||
|
@ -119,10 +124,11 @@ static void PopulateForm(void)
|
|||
|
||||
// only 8-bit modes get used for 2D
|
||||
if (validmode[i].bpp != 8) continue;
|
||||
Bsprintf(buf, "%ld x %ld", validmode[i].xdim, validmode[i].ydim);
|
||||
Bsprintf(buf, "%d x %d", validmode[i].xdim, validmode[i].ydim);
|
||||
gtk_list_store_append(modes2d, &iter);
|
||||
gtk_list_store_set(modes2d, &iter, 0,buf, 1,i, -1);
|
||||
if (i == mode2d) {
|
||||
if (i == mode2d)
|
||||
{
|
||||
g_signal_handlers_block_by_func(box2d, on_vmode2dcombo_changed, NULL);
|
||||
gtk_combo_box_set_active_iter(box2d, &iter);
|
||||
g_signal_handlers_unblock_by_func(box2d, on_vmode2dcombo_changed, NULL);
|
||||
|
@ -219,19 +225,19 @@ static GtkWidget *create_window(void)
|
|||
GtkWidget *startbuttonlabel;
|
||||
GtkAccelGroup *accel_group;
|
||||
|
||||
accel_group = gtk_accel_group_new ();
|
||||
accel_group = gtk_accel_group_new();
|
||||
|
||||
// Basic window
|
||||
startwin = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title (GTK_WINDOW (startwin), apptitle); // NOTE: use global app title
|
||||
gtk_window_set_position (GTK_WINDOW (startwin), GTK_WIN_POS_CENTER);
|
||||
gtk_window_set_resizable (GTK_WINDOW (startwin), FALSE);
|
||||
gtk_window_set_type_hint (GTK_WINDOW (startwin), GDK_WINDOW_TYPE_HINT_DIALOG);
|
||||
startwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title(GTK_WINDOW(startwin), apptitle); // NOTE: use global app title
|
||||
gtk_window_set_position(GTK_WINDOW(startwin), GTK_WIN_POS_CENTER);
|
||||
gtk_window_set_resizable(GTK_WINDOW(startwin), FALSE);
|
||||
gtk_window_set_type_hint(GTK_WINDOW(startwin), GDK_WINDOW_TYPE_HINT_DIALOG);
|
||||
|
||||
// Horizontal layout of banner and controls
|
||||
hlayout = gtk_hbox_new (FALSE, 0);
|
||||
gtk_widget_show (hlayout);
|
||||
gtk_container_add (GTK_CONTAINER (startwin), hlayout);
|
||||
hlayout = gtk_hbox_new(FALSE, 0);
|
||||
gtk_widget_show(hlayout);
|
||||
gtk_container_add(GTK_CONTAINER(startwin), hlayout);
|
||||
|
||||
// Banner
|
||||
{
|
||||
|
@ -239,248 +245,248 @@ static GtkWidget *create_window(void)
|
|||
banner = gtk_image_new_from_pixbuf(pixbuf);
|
||||
g_object_unref((gpointer)pixbuf);
|
||||
}
|
||||
gtk_widget_show (banner);
|
||||
gtk_box_pack_start (GTK_BOX (hlayout), banner, FALSE, FALSE, 0);
|
||||
gtk_misc_set_alignment (GTK_MISC (banner), 0.5, 0);
|
||||
gtk_widget_show(banner);
|
||||
gtk_box_pack_start(GTK_BOX(hlayout), banner, FALSE, FALSE, 0);
|
||||
gtk_misc_set_alignment(GTK_MISC(banner), 0.5, 0);
|
||||
|
||||
// Vertical layout of tab control and start+cancel buttons
|
||||
vlayout = gtk_vbox_new (FALSE, 0);
|
||||
gtk_widget_show (vlayout);
|
||||
gtk_box_pack_start (GTK_BOX (hlayout), vlayout, TRUE, TRUE, 0);
|
||||
vlayout = gtk_vbox_new(FALSE, 0);
|
||||
gtk_widget_show(vlayout);
|
||||
gtk_box_pack_start(GTK_BOX(hlayout), vlayout, TRUE, TRUE, 0);
|
||||
|
||||
// Tab control
|
||||
tabs = gtk_notebook_new ();
|
||||
gtk_widget_show (tabs);
|
||||
gtk_box_pack_start (GTK_BOX (vlayout), tabs, TRUE, TRUE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (tabs), 4);
|
||||
tabs = gtk_notebook_new();
|
||||
gtk_widget_show(tabs);
|
||||
gtk_box_pack_start(GTK_BOX(vlayout), tabs, TRUE, TRUE, 0);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(tabs), 4);
|
||||
|
||||
// Vertical layout of config page main body
|
||||
configvlayout = gtk_vbox_new (FALSE, 0);
|
||||
gtk_widget_show (configvlayout);
|
||||
gtk_container_add (GTK_CONTAINER (tabs), configvlayout);
|
||||
configvlayout = gtk_vbox_new(FALSE, 0);
|
||||
gtk_widget_show(configvlayout);
|
||||
gtk_container_add(GTK_CONTAINER(tabs), configvlayout);
|
||||
|
||||
// Fixed-position layout of config page controls
|
||||
configlayout = gtk_fixed_new ();
|
||||
gtk_widget_show (configlayout);
|
||||
gtk_box_pack_start (GTK_BOX (configvlayout), configlayout, TRUE, TRUE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (configlayout), 6);
|
||||
configlayout = gtk_fixed_new();
|
||||
gtk_widget_show(configlayout);
|
||||
gtk_box_pack_start(GTK_BOX(configvlayout), configlayout, TRUE, TRUE, 0);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(configlayout), 6);
|
||||
|
||||
// 2D video mode label
|
||||
vmode2dlabel = gtk_label_new_with_mnemonic ("_2D Video mode:");
|
||||
gtk_widget_show (vmode2dlabel);
|
||||
gtk_fixed_put (GTK_FIXED (configlayout), vmode2dlabel, 0, 0);
|
||||
gtk_widget_set_size_request (vmode2dlabel, 88, 29);
|
||||
gtk_misc_set_alignment (GTK_MISC (vmode2dlabel), 0, 0.5);
|
||||
vmode2dlabel = gtk_label_new_with_mnemonic("_2D Video mode:");
|
||||
gtk_widget_show(vmode2dlabel);
|
||||
gtk_fixed_put(GTK_FIXED(configlayout), vmode2dlabel, 0, 0);
|
||||
gtk_widget_set_size_request(vmode2dlabel, 88, 29);
|
||||
gtk_misc_set_alignment(GTK_MISC(vmode2dlabel), 0, 0.5);
|
||||
|
||||
// 3D video mode label
|
||||
vmode3dlabel = gtk_label_new_with_mnemonic ("_3D Video mode:");
|
||||
gtk_widget_show (vmode3dlabel);
|
||||
gtk_fixed_put (GTK_FIXED (configlayout), vmode3dlabel, 0, 32);
|
||||
gtk_widget_set_size_request (vmode3dlabel, 88, 29);
|
||||
gtk_misc_set_alignment (GTK_MISC (vmode3dlabel), 0, 0.5);
|
||||
vmode3dlabel = gtk_label_new_with_mnemonic("_3D Video mode:");
|
||||
gtk_widget_show(vmode3dlabel);
|
||||
gtk_fixed_put(GTK_FIXED(configlayout), vmode3dlabel, 0, 32);
|
||||
gtk_widget_set_size_request(vmode3dlabel, 88, 29);
|
||||
gtk_misc_set_alignment(GTK_MISC(vmode3dlabel), 0, 0.5);
|
||||
|
||||
// 2D video mode combo
|
||||
{
|
||||
GtkListStore *list = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
|
||||
GtkCellRenderer *cell;
|
||||
|
||||
vmode2dcombo = gtk_combo_box_new_with_model (GTK_TREE_MODEL(list));
|
||||
vmode2dcombo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(list));
|
||||
g_object_unref(G_OBJECT(list));
|
||||
|
||||
cell = gtk_cell_renderer_text_new();
|
||||
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(vmode2dcombo), cell, FALSE);
|
||||
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(vmode2dcombo), cell, "text", 0, NULL);
|
||||
}
|
||||
gtk_widget_show (vmode2dcombo);
|
||||
gtk_fixed_put (GTK_FIXED (configlayout), vmode2dcombo, 96, 0);
|
||||
gtk_widget_set_size_request (vmode2dcombo, 150, 29);
|
||||
gtk_widget_add_accelerator (vmode2dcombo, "grab_focus", accel_group,
|
||||
GDK_2, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
gtk_widget_show(vmode2dcombo);
|
||||
gtk_fixed_put(GTK_FIXED(configlayout), vmode2dcombo, 96, 0);
|
||||
gtk_widget_set_size_request(vmode2dcombo, 150, 29);
|
||||
gtk_widget_add_accelerator(vmode2dcombo, "grab_focus", accel_group,
|
||||
GDK_2, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
|
||||
// 3D video mode combo
|
||||
{
|
||||
GtkListStore *list = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
|
||||
GtkCellRenderer *cell;
|
||||
|
||||
vmode3dcombo = gtk_combo_box_new_with_model (GTK_TREE_MODEL(list));
|
||||
vmode3dcombo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(list));
|
||||
g_object_unref(G_OBJECT(list));
|
||||
|
||||
cell = gtk_cell_renderer_text_new();
|
||||
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(vmode3dcombo), cell, FALSE);
|
||||
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(vmode3dcombo), cell, "text", 0, NULL);
|
||||
}
|
||||
gtk_widget_show (vmode3dcombo);
|
||||
gtk_fixed_put (GTK_FIXED (configlayout), vmode3dcombo, 96, 32);
|
||||
gtk_widget_set_size_request (vmode3dcombo, 150, 29);
|
||||
gtk_widget_add_accelerator (vmode3dcombo, "grab_focus", accel_group,
|
||||
GDK_3, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
gtk_widget_show(vmode3dcombo);
|
||||
gtk_fixed_put(GTK_FIXED(configlayout), vmode3dcombo, 96, 32);
|
||||
gtk_widget_set_size_request(vmode3dcombo, 150, 29);
|
||||
gtk_widget_add_accelerator(vmode3dcombo, "grab_focus", accel_group,
|
||||
GDK_3, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
|
||||
// Fullscreen checkbox
|
||||
fullscreencheck = gtk_check_button_new_with_mnemonic ("_Fullscreen");
|
||||
gtk_widget_show (fullscreencheck);
|
||||
gtk_fixed_put (GTK_FIXED (configlayout), fullscreencheck, 248, 0);
|
||||
gtk_widget_set_size_request (fullscreencheck, 85, 29);
|
||||
gtk_widget_add_accelerator (fullscreencheck, "grab_focus", accel_group,
|
||||
GDK_F, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
fullscreencheck = gtk_check_button_new_with_mnemonic("_Fullscreen");
|
||||
gtk_widget_show(fullscreencheck);
|
||||
gtk_fixed_put(GTK_FIXED(configlayout), fullscreencheck, 248, 0);
|
||||
gtk_widget_set_size_request(fullscreencheck, 85, 29);
|
||||
gtk_widget_add_accelerator(fullscreencheck, "grab_focus", accel_group,
|
||||
GDK_F, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
|
||||
// Always show config checkbox
|
||||
alwaysshowcheck = gtk_check_button_new_with_mnemonic ("_Always show configuration on start");
|
||||
gtk_widget_show (alwaysshowcheck);
|
||||
gtk_box_pack_start (GTK_BOX (configvlayout), alwaysshowcheck, FALSE, FALSE, 0);
|
||||
gtk_widget_add_accelerator (alwaysshowcheck, "grab_focus", accel_group,
|
||||
GDK_A, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
alwaysshowcheck = gtk_check_button_new_with_mnemonic("_Always show configuration on start");
|
||||
gtk_widget_show(alwaysshowcheck);
|
||||
gtk_box_pack_start(GTK_BOX(configvlayout), alwaysshowcheck, FALSE, FALSE, 0);
|
||||
gtk_widget_add_accelerator(alwaysshowcheck, "grab_focus", accel_group,
|
||||
GDK_A, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
|
||||
// Configuration tab
|
||||
configtab = gtk_label_new ("Configuration");
|
||||
gtk_widget_show (configtab);
|
||||
gtk_notebook_set_tab_label (GTK_NOTEBOOK (tabs), gtk_notebook_get_nth_page (GTK_NOTEBOOK (tabs), 0), configtab);
|
||||
configtab = gtk_label_new("Configuration");
|
||||
gtk_widget_show(configtab);
|
||||
gtk_notebook_set_tab_label(GTK_NOTEBOOK(tabs), gtk_notebook_get_nth_page(GTK_NOTEBOOK(tabs), 0), configtab);
|
||||
|
||||
// Messages scrollable area
|
||||
messagesscroll = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_widget_show (messagesscroll);
|
||||
gtk_container_add (GTK_CONTAINER (tabs), messagesscroll);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (messagesscroll), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
|
||||
messagesscroll = gtk_scrolled_window_new(NULL, NULL);
|
||||
gtk_widget_show(messagesscroll);
|
||||
gtk_container_add(GTK_CONTAINER(tabs), messagesscroll);
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(messagesscroll), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
|
||||
|
||||
// Messages text area
|
||||
messagestext = gtk_text_view_new ();
|
||||
gtk_widget_show (messagestext);
|
||||
gtk_container_add (GTK_CONTAINER (messagesscroll), messagestext);
|
||||
gtk_text_view_set_editable (GTK_TEXT_VIEW (messagestext), FALSE);
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (messagestext), GTK_WRAP_WORD);
|
||||
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (messagestext), FALSE);
|
||||
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (messagestext), 2);
|
||||
gtk_text_view_set_right_margin (GTK_TEXT_VIEW (messagestext), 2);
|
||||
messagestext = gtk_text_view_new();
|
||||
gtk_widget_show(messagestext);
|
||||
gtk_container_add(GTK_CONTAINER(messagesscroll), messagestext);
|
||||
gtk_text_view_set_editable(GTK_TEXT_VIEW(messagestext), FALSE);
|
||||
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(messagestext), GTK_WRAP_WORD);
|
||||
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(messagestext), FALSE);
|
||||
gtk_text_view_set_left_margin(GTK_TEXT_VIEW(messagestext), 2);
|
||||
gtk_text_view_set_right_margin(GTK_TEXT_VIEW(messagestext), 2);
|
||||
|
||||
// Messages tab
|
||||
messagestab = gtk_label_new ("Messages");
|
||||
gtk_widget_show (messagestab);
|
||||
gtk_notebook_set_tab_label (GTK_NOTEBOOK (tabs), gtk_notebook_get_nth_page (GTK_NOTEBOOK (tabs), 1), messagestab);
|
||||
messagestab = gtk_label_new("Messages");
|
||||
gtk_widget_show(messagestab);
|
||||
gtk_notebook_set_tab_label(GTK_NOTEBOOK(tabs), gtk_notebook_get_nth_page(GTK_NOTEBOOK(tabs), 1), messagestab);
|
||||
|
||||
// Dialogue box buttons layout
|
||||
buttons = gtk_hbutton_box_new ();
|
||||
gtk_widget_show (buttons);
|
||||
gtk_box_pack_start (GTK_BOX (vlayout), buttons, FALSE, TRUE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (buttons), 3);
|
||||
gtk_button_box_set_layout (GTK_BUTTON_BOX (buttons), GTK_BUTTONBOX_END);
|
||||
buttons = gtk_hbutton_box_new();
|
||||
gtk_widget_show(buttons);
|
||||
gtk_box_pack_start(GTK_BOX(vlayout), buttons, FALSE, TRUE, 0);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(buttons), 3);
|
||||
gtk_button_box_set_layout(GTK_BUTTON_BOX(buttons), GTK_BUTTONBOX_END);
|
||||
|
||||
// Cancel button
|
||||
cancelbutton = gtk_button_new ();
|
||||
gtk_widget_show (cancelbutton);
|
||||
gtk_container_add (GTK_CONTAINER (buttons), cancelbutton);
|
||||
GTK_WIDGET_SET_FLAGS (cancelbutton, GTK_CAN_DEFAULT);
|
||||
gtk_widget_add_accelerator (cancelbutton, "grab_focus", accel_group,
|
||||
GDK_C, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
gtk_widget_add_accelerator (cancelbutton, "clicked", accel_group,
|
||||
GDK_Escape, 0,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
cancelbutton = gtk_button_new();
|
||||
gtk_widget_show(cancelbutton);
|
||||
gtk_container_add(GTK_CONTAINER(buttons), cancelbutton);
|
||||
GTK_WIDGET_SET_FLAGS(cancelbutton, GTK_CAN_DEFAULT);
|
||||
gtk_widget_add_accelerator(cancelbutton, "grab_focus", accel_group,
|
||||
GDK_C, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
gtk_widget_add_accelerator(cancelbutton, "clicked", accel_group,
|
||||
GDK_Escape, 0,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
|
||||
cancelbuttonalign = gtk_alignment_new (0.5, 0.5, 0, 0);
|
||||
gtk_widget_show (cancelbuttonalign);
|
||||
gtk_container_add (GTK_CONTAINER (cancelbutton), cancelbuttonalign);
|
||||
cancelbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0);
|
||||
gtk_widget_show(cancelbuttonalign);
|
||||
gtk_container_add(GTK_CONTAINER(cancelbutton), cancelbuttonalign);
|
||||
|
||||
cancelbuttonlayout = gtk_hbox_new (FALSE, 2);
|
||||
gtk_widget_show (cancelbuttonlayout);
|
||||
gtk_container_add (GTK_CONTAINER (cancelbuttonalign), cancelbuttonlayout);
|
||||
cancelbuttonlayout = gtk_hbox_new(FALSE, 2);
|
||||
gtk_widget_show(cancelbuttonlayout);
|
||||
gtk_container_add(GTK_CONTAINER(cancelbuttonalign), cancelbuttonlayout);
|
||||
|
||||
cancelbuttonicon = gtk_image_new_from_stock ("gtk-cancel", GTK_ICON_SIZE_BUTTON);
|
||||
gtk_widget_show (cancelbuttonicon);
|
||||
gtk_box_pack_start (GTK_BOX (cancelbuttonlayout), cancelbuttonicon, FALSE, FALSE, 0);
|
||||
cancelbuttonicon = gtk_image_new_from_stock("gtk-cancel", GTK_ICON_SIZE_BUTTON);
|
||||
gtk_widget_show(cancelbuttonicon);
|
||||
gtk_box_pack_start(GTK_BOX(cancelbuttonlayout), cancelbuttonicon, FALSE, FALSE, 0);
|
||||
|
||||
cancelbuttonlabel = gtk_label_new_with_mnemonic ("_Cancel");
|
||||
gtk_widget_show (cancelbuttonlabel);
|
||||
gtk_box_pack_start (GTK_BOX (cancelbuttonlayout), cancelbuttonlabel, FALSE, FALSE, 0);
|
||||
cancelbuttonlabel = gtk_label_new_with_mnemonic("_Cancel");
|
||||
gtk_widget_show(cancelbuttonlabel);
|
||||
gtk_box_pack_start(GTK_BOX(cancelbuttonlayout), cancelbuttonlabel, FALSE, FALSE, 0);
|
||||
|
||||
// Start button
|
||||
startbutton = gtk_button_new ();
|
||||
gtk_widget_show (startbutton);
|
||||
gtk_container_add (GTK_CONTAINER (buttons), startbutton);
|
||||
GTK_WIDGET_SET_FLAGS (startbutton, GTK_CAN_DEFAULT);
|
||||
gtk_widget_add_accelerator (startbutton, "grab_focus", accel_group,
|
||||
GDK_S, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
gtk_widget_add_accelerator (startbutton, "clicked", accel_group,
|
||||
GDK_Return, 0,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
startbutton = gtk_button_new();
|
||||
gtk_widget_show(startbutton);
|
||||
gtk_container_add(GTK_CONTAINER(buttons), startbutton);
|
||||
GTK_WIDGET_SET_FLAGS(startbutton, GTK_CAN_DEFAULT);
|
||||
gtk_widget_add_accelerator(startbutton, "grab_focus", accel_group,
|
||||
GDK_S, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
gtk_widget_add_accelerator(startbutton, "clicked", accel_group,
|
||||
GDK_Return, 0,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
|
||||
startbuttonalign = gtk_alignment_new (0.5, 0.5, 0, 0);
|
||||
gtk_widget_show (startbuttonalign);
|
||||
gtk_container_add (GTK_CONTAINER (startbutton), startbuttonalign);
|
||||
startbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0);
|
||||
gtk_widget_show(startbuttonalign);
|
||||
gtk_container_add(GTK_CONTAINER(startbutton), startbuttonalign);
|
||||
|
||||
startbuttonlayout = gtk_hbox_new (FALSE, 2);
|
||||
gtk_widget_show (startbuttonlayout);
|
||||
gtk_container_add (GTK_CONTAINER (startbuttonalign), startbuttonlayout);
|
||||
startbuttonlayout = gtk_hbox_new(FALSE, 2);
|
||||
gtk_widget_show(startbuttonlayout);
|
||||
gtk_container_add(GTK_CONTAINER(startbuttonalign), startbuttonlayout);
|
||||
|
||||
startbuttonicon = gtk_image_new_from_stock ("gtk-execute", GTK_ICON_SIZE_BUTTON);
|
||||
gtk_widget_show (startbuttonicon);
|
||||
gtk_box_pack_start (GTK_BOX (startbuttonlayout), startbuttonicon, FALSE, FALSE, 0);
|
||||
startbuttonicon = gtk_image_new_from_stock("gtk-execute", GTK_ICON_SIZE_BUTTON);
|
||||
gtk_widget_show(startbuttonicon);
|
||||
gtk_box_pack_start(GTK_BOX(startbuttonlayout), startbuttonicon, FALSE, FALSE, 0);
|
||||
|
||||
startbuttonlabel = gtk_label_new_with_mnemonic ("_Start");
|
||||
gtk_widget_show (startbuttonlabel);
|
||||
gtk_box_pack_start (GTK_BOX (startbuttonlayout), startbuttonlabel, FALSE, FALSE, 0);
|
||||
startbuttonlabel = gtk_label_new_with_mnemonic("_Start");
|
||||
gtk_widget_show(startbuttonlabel);
|
||||
gtk_box_pack_start(GTK_BOX(startbuttonlayout), startbuttonlabel, FALSE, FALSE, 0);
|
||||
|
||||
// Wire up the signals
|
||||
g_signal_connect ((gpointer) startwin, "delete_event",
|
||||
G_CALLBACK (on_startwin_delete_event),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) vmode2dcombo, "changed",
|
||||
G_CALLBACK (on_vmode2dcombo_changed),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) vmode3dcombo, "changed",
|
||||
G_CALLBACK (on_vmode3dcombo_changed),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) fullscreencheck, "toggled",
|
||||
G_CALLBACK (on_fullscreencheck_toggled),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) alwaysshowcheck, "toggled",
|
||||
G_CALLBACK (on_alwaysshowcheck_toggled),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) cancelbutton, "clicked",
|
||||
G_CALLBACK (on_cancelbutton_clicked),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) startbutton, "clicked",
|
||||
G_CALLBACK (on_startbutton_clicked),
|
||||
NULL);
|
||||
g_signal_connect((gpointer) startwin, "delete_event",
|
||||
G_CALLBACK(on_startwin_delete_event),
|
||||
NULL);
|
||||
g_signal_connect((gpointer) vmode2dcombo, "changed",
|
||||
G_CALLBACK(on_vmode2dcombo_changed),
|
||||
NULL);
|
||||
g_signal_connect((gpointer) vmode3dcombo, "changed",
|
||||
G_CALLBACK(on_vmode3dcombo_changed),
|
||||
NULL);
|
||||
g_signal_connect((gpointer) fullscreencheck, "toggled",
|
||||
G_CALLBACK(on_fullscreencheck_toggled),
|
||||
NULL);
|
||||
g_signal_connect((gpointer) alwaysshowcheck, "toggled",
|
||||
G_CALLBACK(on_alwaysshowcheck_toggled),
|
||||
NULL);
|
||||
g_signal_connect((gpointer) cancelbutton, "clicked",
|
||||
G_CALLBACK(on_cancelbutton_clicked),
|
||||
NULL);
|
||||
g_signal_connect((gpointer) startbutton, "clicked",
|
||||
G_CALLBACK(on_startbutton_clicked),
|
||||
NULL);
|
||||
|
||||
// Associate labels with their controls
|
||||
gtk_label_set_mnemonic_widget (GTK_LABEL (vmode2dlabel), vmode2dcombo);
|
||||
gtk_label_set_mnemonic_widget (GTK_LABEL (vmode3dlabel), vmode3dcombo);
|
||||
gtk_label_set_mnemonic_widget(GTK_LABEL(vmode2dlabel), vmode2dcombo);
|
||||
gtk_label_set_mnemonic_widget(GTK_LABEL(vmode3dlabel), vmode3dcombo);
|
||||
|
||||
/* Store pointers to all widgets, for use by lookup_widget(). */
|
||||
GLADE_HOOKUP_OBJECT_NO_REF (startwin, startwin, "startwin");
|
||||
GLADE_HOOKUP_OBJECT (startwin, hlayout, "hlayout");
|
||||
GLADE_HOOKUP_OBJECT (startwin, banner, "banner");
|
||||
GLADE_HOOKUP_OBJECT (startwin, vlayout, "vlayout");
|
||||
GLADE_HOOKUP_OBJECT (startwin, tabs, "tabs");
|
||||
GLADE_HOOKUP_OBJECT (startwin, configvlayout, "configvlayout");
|
||||
GLADE_HOOKUP_OBJECT (startwin, configlayout, "configlayout");
|
||||
GLADE_HOOKUP_OBJECT (startwin, vmode2dlabel, "vmode2dlabel");
|
||||
GLADE_HOOKUP_OBJECT (startwin, vmode3dlabel, "vmode3dlabel");
|
||||
GLADE_HOOKUP_OBJECT (startwin, vmode2dcombo, "vmode2dcombo");
|
||||
GLADE_HOOKUP_OBJECT (startwin, vmode3dcombo, "vmode3dcombo");
|
||||
GLADE_HOOKUP_OBJECT (startwin, fullscreencheck, "fullscreencheck");
|
||||
GLADE_HOOKUP_OBJECT (startwin, alwaysshowcheck, "alwaysshowcheck");
|
||||
GLADE_HOOKUP_OBJECT (startwin, configtab, "configtab");
|
||||
GLADE_HOOKUP_OBJECT (startwin, messagesscroll, "messagesscroll");
|
||||
GLADE_HOOKUP_OBJECT (startwin, messagestext, "messagestext");
|
||||
GLADE_HOOKUP_OBJECT (startwin, messagestab, "messagestab");
|
||||
GLADE_HOOKUP_OBJECT (startwin, buttons, "buttons");
|
||||
GLADE_HOOKUP_OBJECT (startwin, cancelbutton, "cancelbutton");
|
||||
GLADE_HOOKUP_OBJECT (startwin, cancelbuttonalign, "cancelbuttonalign");
|
||||
GLADE_HOOKUP_OBJECT (startwin, cancelbuttonlayout, "cancelbuttonlayout");
|
||||
GLADE_HOOKUP_OBJECT (startwin, cancelbuttonicon, "cancelbuttonicon");
|
||||
GLADE_HOOKUP_OBJECT (startwin, cancelbuttonlabel, "cancelbuttonlabel");
|
||||
GLADE_HOOKUP_OBJECT (startwin, startbutton, "startbutton");
|
||||
GLADE_HOOKUP_OBJECT (startwin, startbuttonalign, "startbuttonalign");
|
||||
GLADE_HOOKUP_OBJECT (startwin, startbuttonlayout, "startbuttonlayout");
|
||||
GLADE_HOOKUP_OBJECT (startwin, startbuttonicon, "startbuttonicon");
|
||||
GLADE_HOOKUP_OBJECT (startwin, startbuttonlabel, "startbuttonlabel");
|
||||
GLADE_HOOKUP_OBJECT_NO_REF(startwin, startwin, "startwin");
|
||||
GLADE_HOOKUP_OBJECT(startwin, hlayout, "hlayout");
|
||||
GLADE_HOOKUP_OBJECT(startwin, banner, "banner");
|
||||
GLADE_HOOKUP_OBJECT(startwin, vlayout, "vlayout");
|
||||
GLADE_HOOKUP_OBJECT(startwin, tabs, "tabs");
|
||||
GLADE_HOOKUP_OBJECT(startwin, configvlayout, "configvlayout");
|
||||
GLADE_HOOKUP_OBJECT(startwin, configlayout, "configlayout");
|
||||
GLADE_HOOKUP_OBJECT(startwin, vmode2dlabel, "vmode2dlabel");
|
||||
GLADE_HOOKUP_OBJECT(startwin, vmode3dlabel, "vmode3dlabel");
|
||||
GLADE_HOOKUP_OBJECT(startwin, vmode2dcombo, "vmode2dcombo");
|
||||
GLADE_HOOKUP_OBJECT(startwin, vmode3dcombo, "vmode3dcombo");
|
||||
GLADE_HOOKUP_OBJECT(startwin, fullscreencheck, "fullscreencheck");
|
||||
GLADE_HOOKUP_OBJECT(startwin, alwaysshowcheck, "alwaysshowcheck");
|
||||
GLADE_HOOKUP_OBJECT(startwin, configtab, "configtab");
|
||||
GLADE_HOOKUP_OBJECT(startwin, messagesscroll, "messagesscroll");
|
||||
GLADE_HOOKUP_OBJECT(startwin, messagestext, "messagestext");
|
||||
GLADE_HOOKUP_OBJECT(startwin, messagestab, "messagestab");
|
||||
GLADE_HOOKUP_OBJECT(startwin, buttons, "buttons");
|
||||
GLADE_HOOKUP_OBJECT(startwin, cancelbutton, "cancelbutton");
|
||||
GLADE_HOOKUP_OBJECT(startwin, cancelbuttonalign, "cancelbuttonalign");
|
||||
GLADE_HOOKUP_OBJECT(startwin, cancelbuttonlayout, "cancelbuttonlayout");
|
||||
GLADE_HOOKUP_OBJECT(startwin, cancelbuttonicon, "cancelbuttonicon");
|
||||
GLADE_HOOKUP_OBJECT(startwin, cancelbuttonlabel, "cancelbuttonlabel");
|
||||
GLADE_HOOKUP_OBJECT(startwin, startbutton, "startbutton");
|
||||
GLADE_HOOKUP_OBJECT(startwin, startbuttonalign, "startbuttonalign");
|
||||
GLADE_HOOKUP_OBJECT(startwin, startbuttonlayout, "startbuttonlayout");
|
||||
GLADE_HOOKUP_OBJECT(startwin, startbuttonicon, "startbuttonicon");
|
||||
GLADE_HOOKUP_OBJECT(startwin, startbuttonlabel, "startbuttonlabel");
|
||||
|
||||
gtk_window_add_accel_group (GTK_WINDOW (startwin), accel_group);
|
||||
gtk_window_add_accel_group(GTK_WINDOW(startwin), accel_group);
|
||||
|
||||
return startwin;
|
||||
}
|
||||
|
@ -493,7 +499,8 @@ int startwin_open(void)
|
|||
if (startwin) return 1;
|
||||
|
||||
startwin = create_window();
|
||||
if (startwin) {
|
||||
if (startwin)
|
||||
{
|
||||
SetPage(TAB_MESSAGES);
|
||||
gtk_widget_show(startwin);
|
||||
gtk_main_iteration_do(FALSE);
|
||||
|
@ -506,7 +513,7 @@ int startwin_close(void)
|
|||
{
|
||||
if (!gtkenabled) return 0;
|
||||
if (!startwin) return 1;
|
||||
gtk_widget_destroy (startwin);
|
||||
gtk_widget_destroy(startwin);
|
||||
startwin = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
@ -525,8 +532,10 @@ int startwin_puts(const char *str)
|
|||
textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview));
|
||||
|
||||
gtk_text_buffer_get_end_iter(textbuffer, &enditer);
|
||||
for (aptr = bptr = str; *aptr != 0; ) {
|
||||
switch (*bptr) {
|
||||
for (aptr = bptr = str; *aptr != 0;)
|
||||
{
|
||||
switch (*bptr)
|
||||
{
|
||||
case '\b':
|
||||
if (bptr > aptr)
|
||||
gtk_text_buffer_insert(textbuffer, &enditer, (const gchar *)aptr, (gint)(bptr-aptr)-1);
|
||||
|
@ -566,7 +575,7 @@ int startwin_settitle(const char *title)
|
|||
{
|
||||
if (!gtkenabled) return 0;
|
||||
if (!startwin) return 1;
|
||||
gtk_window_set_title (GTK_WINDOW (startwin), title);
|
||||
gtk_window_set_title(GTK_WINDOW(startwin), title);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -574,7 +583,7 @@ int startwin_idle(void *s)
|
|||
{
|
||||
if (!gtkenabled) return 0;
|
||||
//if (!startwin) return 1;
|
||||
gtk_main_iteration_do (FALSE);
|
||||
gtk_main_iteration_do(FALSE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -597,7 +606,8 @@ int startwin_run(void)
|
|||
gtk_main();
|
||||
|
||||
SetPage(TAB_MESSAGES);
|
||||
if (retval) {
|
||||
if (retval)
|
||||
{
|
||||
fullscreen = settings.fullscreen;
|
||||
xdim2d = settings.xdim2d;
|
||||
ydim2d = settings.ydim2d;
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
#define TAB_CONFIG 0
|
||||
#define TAB_MESSAGES 1
|
||||
|
||||
static struct {
|
||||
static struct
|
||||
{
|
||||
int fullscreen;
|
||||
int xdim2d, ydim2d;
|
||||
int xdim3d, ydim3d, bpp3d;
|
||||
|
@ -43,10 +44,12 @@ static void PopulateForm(void)
|
|||
mode2d = checkvideomode(&settings.xdim2d, &settings.ydim2d, 8, settings.fullscreen, 1);
|
||||
mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, settings.bpp3d, settings.fullscreen, 1);
|
||||
if (mode2d < 0) mode2d = 0;
|
||||
if (mode3d < 0) {
|
||||
if (mode3d < 0)
|
||||
{
|
||||
int cd[] = { 32, 24, 16, 15, 8, 0 };
|
||||
for (i=0; cd[i]; ) { if (cd[i] >= settings.bpp3d) i++; else break; }
|
||||
for ( ; cd[i]; i++) {
|
||||
for (i=0; cd[i];) { if (cd[i] >= settings.bpp3d) i++; else break; }
|
||||
for (; cd[i]; i++)
|
||||
{
|
||||
mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, cd[i], settings.fullscreen, 1);
|
||||
if (mode3d < 0) continue;
|
||||
settings.bpp3d = cd[i];
|
||||
|
@ -59,18 +62,19 @@ static void PopulateForm(void)
|
|||
|
||||
ComboBox_ResetContent(hwnd2d);
|
||||
ComboBox_ResetContent(hwnd3d);
|
||||
for (i=0; i<validmodecnt; i++) {
|
||||
for (i=0; i<validmodecnt; i++)
|
||||
{
|
||||
if (validmode[i].fs != settings.fullscreen) continue;
|
||||
|
||||
// all modes get added to the 3D mode list
|
||||
Bsprintf(buf, "%ld x %ld %dbpp", validmode[i].xdim, validmode[i].ydim, validmode[i].bpp);
|
||||
Bsprintf(buf, "%d x %d %dbpp", validmode[i].xdim, validmode[i].ydim, validmode[i].bpp);
|
||||
j = ComboBox_AddString(hwnd3d, buf);
|
||||
ComboBox_SetItemData(hwnd3d, j, i);
|
||||
if (i == mode3d) ComboBox_SetCurSel(hwnd3d, j);
|
||||
|
||||
// only 8-bit modes get used for 2D
|
||||
if (validmode[i].bpp != 8) continue;
|
||||
Bsprintf(buf, "%ld x %ld", validmode[i].xdim, validmode[i].ydim);
|
||||
Bsprintf(buf, "%d x %d", validmode[i].xdim, validmode[i].ydim);
|
||||
j = ComboBox_AddString(hwnd2d, buf);
|
||||
ComboBox_SetItemData(hwnd2d, j, i);
|
||||
if (i == mode2d) ComboBox_SetCurSel(hwnd2d, j);
|
||||
|
@ -79,30 +83,36 @@ static void PopulateForm(void)
|
|||
|
||||
static INT_PTR CALLBACK ConfigPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (uMsg) {
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam)) {
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDCFULLSCREEN:
|
||||
settings.fullscreen = !settings.fullscreen;
|
||||
PopulateForm();
|
||||
return TRUE;
|
||||
case IDC2DVMODE:
|
||||
if (HIWORD(wParam) == CBN_SELCHANGE) {
|
||||
if (HIWORD(wParam) == CBN_SELCHANGE)
|
||||
{
|
||||
int i;
|
||||
i = ComboBox_GetCurSel((HWND)lParam);
|
||||
if (i != CB_ERR) i = ComboBox_GetItemData((HWND)lParam, i);
|
||||
if (i != CB_ERR) {
|
||||
if (i != CB_ERR)
|
||||
{
|
||||
settings.xdim2d = validmode[i].xdim;
|
||||
settings.ydim2d = validmode[i].ydim;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
case IDC3DVMODE:
|
||||
if (HIWORD(wParam) == CBN_SELCHANGE) {
|
||||
if (HIWORD(wParam) == CBN_SELCHANGE)
|
||||
{
|
||||
int i;
|
||||
i = ComboBox_GetCurSel((HWND)lParam);
|
||||
if (i != CB_ERR) i = ComboBox_GetItemData((HWND)lParam, i);
|
||||
if (i != CB_ERR) {
|
||||
if (i != CB_ERR)
|
||||
{
|
||||
settings.xdim3d = validmode[i].xdim;
|
||||
settings.ydim3d = validmode[i].ydim;
|
||||
settings.bpp3d = validmode[i].bpp;
|
||||
|
@ -152,8 +162,10 @@ static INT_PTR CALLBACK startup_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
|
|||
static HBITMAP hbmp = NULL;
|
||||
HDC hdc;
|
||||
|
||||
switch (uMsg) {
|
||||
case WM_INITDIALOG: {
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
HWND hwnd;
|
||||
RECT r, rdlg, chrome, rtab, rcancel, rstart;
|
||||
int xoffset = 0, yoffset = 0;
|
||||
|
@ -253,18 +265,22 @@ static INT_PTR CALLBACK startup_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
case WM_NOTIFY: {
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
LPNMHDR nmhdr = (LPNMHDR)lParam;
|
||||
int cur;
|
||||
if (nmhdr->idFrom != WIN_STARTWIN_TABCTL) break;
|
||||
cur = (int)SendMessage(nmhdr->hwndFrom, TCM_GETCURSEL,0,0);
|
||||
switch (nmhdr->code) {
|
||||
case TCN_SELCHANGING: {
|
||||
switch (nmhdr->code)
|
||||
{
|
||||
case TCN_SELCHANGING:
|
||||
{
|
||||
if (cur < 0 || !pages[cur]) break;
|
||||
ShowWindow(pages[cur],SW_HIDE);
|
||||
return TRUE;
|
||||
}
|
||||
case TCN_SELCHANGE: {
|
||||
case TCN_SELCHANGE:
|
||||
{
|
||||
if (cur < 0 || !pages[cur]) break;
|
||||
ShowWindow(pages[cur],SW_SHOW);
|
||||
return TRUE;
|
||||
|
@ -279,12 +295,14 @@ static INT_PTR CALLBACK startup_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
|
|||
return TRUE;
|
||||
|
||||
case WM_DESTROY:
|
||||
if (hbmp) {
|
||||
if (hbmp)
|
||||
{
|
||||
DeleteObject(hbmp);
|
||||
hbmp = NULL;
|
||||
}
|
||||
|
||||
if (pages[TAB_CONFIG]) {
|
||||
if (pages[TAB_CONFIG])
|
||||
{
|
||||
DestroyWindow(pages[TAB_CONFIG]);
|
||||
pages[TAB_CONFIG] = NULL;
|
||||
}
|
||||
|
@ -293,7 +311,8 @@ static INT_PTR CALLBACK startup_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
|
|||
return TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam)) {
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case WIN_STARTWIN_CANCEL:
|
||||
if (mode == TAB_CONFIG) done = 0;
|
||||
else quitevent++;
|
||||
|
@ -324,7 +343,8 @@ int startwin_open(void)
|
|||
icc.dwICC = ICC_TAB_CLASSES;
|
||||
InitCommonControlsEx(&icc);
|
||||
startupdlg = CreateDialog((HINSTANCE)win_gethinstance(), MAKEINTRESOURCE(WIN_STARTWIN), NULL, startup_dlgproc);
|
||||
if (startupdlg) {
|
||||
if (startupdlg)
|
||||
{
|
||||
SetPage(TAB_MESSAGES);
|
||||
EnableConfig(0);
|
||||
return 0;
|
||||
|
@ -361,25 +381,33 @@ int startwin_puts(const char *buf)
|
|||
SendMessage(edctl, EM_SETSEL, (WPARAM)curlen, (LPARAM)curlen);
|
||||
linesbefore = SendMessage(edctl, EM_GETLINECOUNT, 0,0);
|
||||
p = buf;
|
||||
while (*p) {
|
||||
if (newline) {
|
||||
while (*p)
|
||||
{
|
||||
if (newline)
|
||||
{
|
||||
SendMessage(edctl, EM_REPLACESEL, 0, (LPARAM)"\r\n");
|
||||
newline = 0;
|
||||
}
|
||||
q = p;
|
||||
while (*q && *q != '\n') q++;
|
||||
memcpy(workbuf, p, q-p);
|
||||
if (*q == '\n') {
|
||||
if (!q[1]) {
|
||||
if (*q == '\n')
|
||||
{
|
||||
if (!q[1])
|
||||
{
|
||||
newline = 1;
|
||||
workbuf[q-p] = 0;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
workbuf[q-p] = '\r';
|
||||
workbuf[q-p+1] = '\n';
|
||||
workbuf[q-p+2] = 0;
|
||||
}
|
||||
p = q+1;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
workbuf[q-p] = 0;
|
||||
p = q;
|
||||
}
|
||||
|
@ -424,8 +452,10 @@ int startwin_run(void)
|
|||
settings.forcesetup = forcesetup;
|
||||
PopulateForm();
|
||||
|
||||
while (done < 0) {
|
||||
switch (GetMessage(&msg, NULL, 0,0)) {
|
||||
while (done < 0)
|
||||
{
|
||||
switch (GetMessage(&msg, NULL, 0,0))
|
||||
{
|
||||
case 0:
|
||||
done = 1; break;
|
||||
case -1:
|
||||
|
@ -440,7 +470,8 @@ int startwin_run(void)
|
|||
|
||||
SetPage(TAB_MESSAGES);
|
||||
EnableConfig(0);
|
||||
if (done) {
|
||||
if (done)
|
||||
{
|
||||
fullscreen = settings.fullscreen;
|
||||
xdim2d = settings.xdim2d;
|
||||
ydim2d = settings.ydim2d;
|
||||
|
|
|
@ -3,177 +3,178 @@
|
|||
// Extracted from a Matrox Millenium
|
||||
// Generated by BIN2C.EXE by Jonathon Fowler
|
||||
|
||||
char textfont[2048] = {
|
||||
// 2048 bytes
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x81, 0xA5, 0x81,
|
||||
0xBD, 0x99, 0x81, 0x7E, 0x7E, 0xFF, 0xDB, 0xFF, 0xC3, 0xE7, 0xFF, 0x7E,
|
||||
0x6C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38, 0x10, 0x00, 0x10, 0x38, 0x7C, 0xFE,
|
||||
0x7C, 0x38, 0x10, 0x00, 0x38, 0x7C, 0x38, 0xFE, 0xFE, 0x7C, 0x38, 0x7C,
|
||||
0x10, 0x10, 0x38, 0x7C, 0xFE, 0x7C, 0x38, 0x7C, 0x00, 0x00, 0x18, 0x3C,
|
||||
0x3C, 0x18, 0x00, 0x00, 0xFF, 0xFF, 0xE7, 0xC3, 0xC3, 0xE7, 0xFF, 0xFF,
|
||||
0x00, 0x3C, 0x66, 0x42, 0x42, 0x66, 0x3C, 0x00, 0xFF, 0xC3, 0x99, 0xBD,
|
||||
0xBD, 0x99, 0xC3, 0xFF, 0x0F, 0x07, 0x0F, 0x7D, 0xCC, 0xCC, 0xCC, 0x78,
|
||||
0x3C, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x18, 0x3F, 0x33, 0x3F, 0x30,
|
||||
0x30, 0x70, 0xF0, 0xE0, 0x7F, 0x63, 0x7F, 0x63, 0x63, 0x67, 0xE6, 0xC0,
|
||||
0x99, 0x5A, 0x3C, 0xE7, 0xE7, 0x3C, 0x5A, 0x99, 0x80, 0xE0, 0xF8, 0xFE,
|
||||
0xF8, 0xE0, 0x80, 0x00, 0x02, 0x0E, 0x3E, 0xFE, 0x3E, 0x0E, 0x02, 0x00,
|
||||
0x18, 0x3C, 0x7E, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x66, 0x66, 0x66, 0x66,
|
||||
0x66, 0x00, 0x66, 0x00, 0x7F, 0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x00,
|
||||
0x3E, 0x63, 0x38, 0x6C, 0x6C, 0x38, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00,
|
||||
0x7E, 0x7E, 0x7E, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x7E, 0x3C, 0x18, 0xFF,
|
||||
0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18,
|
||||
0x7E, 0x3C, 0x18, 0x00, 0x00, 0x18, 0x0C, 0xFE, 0x0C, 0x18, 0x00, 0x00,
|
||||
0x00, 0x30, 0x60, 0xFE, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0,
|
||||
0xC0, 0xFE, 0x00, 0x00, 0x00, 0x24, 0x66, 0xFF, 0x66, 0x24, 0x00, 0x00,
|
||||
0x00, 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7E,
|
||||
0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x30, 0x78, 0x78, 0x30, 0x30, 0x00, 0x30, 0x00, 0x6C, 0x6C, 0x6C, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00,
|
||||
0x30, 0x7C, 0xC0, 0x78, 0x0C, 0xF8, 0x30, 0x00, 0x00, 0xC6, 0xCC, 0x18,
|
||||
0x30, 0x66, 0xC6, 0x00, 0x38, 0x6C, 0x38, 0x76, 0xDC, 0xCC, 0x76, 0x00,
|
||||
0x60, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x60,
|
||||
0x60, 0x30, 0x18, 0x00, 0x60, 0x30, 0x18, 0x18, 0x18, 0x30, 0x60, 0x00,
|
||||
0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00, 0x00, 0x30, 0x30, 0xFC,
|
||||
0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x60,
|
||||
0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x30, 0x30, 0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00,
|
||||
0x7C, 0xC6, 0xCE, 0xDE, 0xF6, 0xE6, 0x7C, 0x00, 0x30, 0x70, 0x30, 0x30,
|
||||
0x30, 0x30, 0xFC, 0x00, 0x78, 0xCC, 0x0C, 0x38, 0x60, 0xCC, 0xFC, 0x00,
|
||||
0x78, 0xCC, 0x0C, 0x38, 0x0C, 0xCC, 0x78, 0x00, 0x1C, 0x3C, 0x6C, 0xCC,
|
||||
0xFE, 0x0C, 0x1E, 0x00, 0xFC, 0xC0, 0xF8, 0x0C, 0x0C, 0xCC, 0x78, 0x00,
|
||||
0x38, 0x60, 0xC0, 0xF8, 0xCC, 0xCC, 0x78, 0x00, 0xFC, 0xCC, 0x0C, 0x18,
|
||||
0x30, 0x30, 0x30, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0xCC, 0xCC, 0x78, 0x00,
|
||||
0x78, 0xCC, 0xCC, 0x7C, 0x0C, 0x18, 0x70, 0x00, 0x00, 0x30, 0x30, 0x00,
|
||||
0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x60,
|
||||
0x18, 0x30, 0x60, 0xC0, 0x60, 0x30, 0x18, 0x00, 0x00, 0x00, 0xFC, 0x00,
|
||||
0x00, 0xFC, 0x00, 0x00, 0x60, 0x30, 0x18, 0x0C, 0x18, 0x30, 0x60, 0x00,
|
||||
0x78, 0xCC, 0x0C, 0x18, 0x30, 0x00, 0x30, 0x00, 0x7C, 0xC6, 0xDE, 0xDE,
|
||||
0xDE, 0xC0, 0x78, 0x00, 0x30, 0x78, 0xCC, 0xCC, 0xFC, 0xCC, 0xCC, 0x00,
|
||||
0xFC, 0x66, 0x66, 0x7C, 0x66, 0x66, 0xFC, 0x00, 0x3C, 0x66, 0xC0, 0xC0,
|
||||
0xC0, 0x66, 0x3C, 0x00, 0xF8, 0x6C, 0x66, 0x66, 0x66, 0x6C, 0xF8, 0x00,
|
||||
0xFE, 0x62, 0x68, 0x78, 0x68, 0x62, 0xFE, 0x00, 0xFE, 0x62, 0x68, 0x78,
|
||||
0x68, 0x60, 0xF0, 0x00, 0x3C, 0x66, 0xC0, 0xC0, 0xCE, 0x66, 0x3E, 0x00,
|
||||
0xCC, 0xCC, 0xCC, 0xFC, 0xCC, 0xCC, 0xCC, 0x00, 0x78, 0x30, 0x30, 0x30,
|
||||
0x30, 0x30, 0x78, 0x00, 0x1E, 0x0C, 0x0C, 0x0C, 0xCC, 0xCC, 0x78, 0x00,
|
||||
0xE6, 0x66, 0x6C, 0x78, 0x6C, 0x66, 0xE6, 0x00, 0xF0, 0x60, 0x60, 0x60,
|
||||
0x62, 0x66, 0xFE, 0x00, 0xC6, 0xEE, 0xFE, 0xFE, 0xD6, 0xC6, 0xC6, 0x00,
|
||||
0xC6, 0xE6, 0xF6, 0xDE, 0xCE, 0xC6, 0xC6, 0x00, 0x38, 0x6C, 0xC6, 0xC6,
|
||||
0xC6, 0x6C, 0x38, 0x00, 0xFC, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xF0, 0x00,
|
||||
0x78, 0xCC, 0xCC, 0xCC, 0xDC, 0x78, 0x1C, 0x00, 0xFC, 0x66, 0x66, 0x7C,
|
||||
0x6C, 0x66, 0xE6, 0x00, 0x78, 0xCC, 0xE0, 0x70, 0x1C, 0xCC, 0x78, 0x00,
|
||||
0xFC, 0xB4, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00, 0xCC, 0xCC, 0xCC, 0xCC,
|
||||
0xCC, 0xCC, 0xFC, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x00,
|
||||
0xC6, 0xC6, 0xC6, 0xD6, 0xFE, 0xEE, 0xC6, 0x00, 0xC6, 0xC6, 0x6C, 0x38,
|
||||
0x38, 0x6C, 0xC6, 0x00, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x30, 0x78, 0x00,
|
||||
0xFE, 0xC6, 0x8C, 0x18, 0x32, 0x66, 0xFE, 0x00, 0x78, 0x60, 0x60, 0x60,
|
||||
0x60, 0x60, 0x78, 0x00, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x02, 0x00,
|
||||
0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x00, 0x10, 0x38, 0x6C, 0xC6,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
|
||||
0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0C,
|
||||
0x7C, 0xCC, 0x76, 0x00, 0xE0, 0x60, 0x60, 0x7C, 0x66, 0x66, 0xDC, 0x00,
|
||||
0x00, 0x00, 0x78, 0xCC, 0xC0, 0xCC, 0x78, 0x00, 0x1C, 0x0C, 0x0C, 0x7C,
|
||||
0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00,
|
||||
0x38, 0x6C, 0x60, 0xF0, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x76, 0xCC,
|
||||
0xCC, 0x7C, 0x0C, 0xF8, 0xE0, 0x60, 0x6C, 0x76, 0x66, 0x66, 0xE6, 0x00,
|
||||
0x30, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00, 0x0C, 0x00, 0x0C, 0x0C,
|
||||
0x0C, 0xCC, 0xCC, 0x78, 0xE0, 0x60, 0x66, 0x6C, 0x78, 0x6C, 0xE6, 0x00,
|
||||
0x70, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00, 0x00, 0x00, 0xCC, 0xFE,
|
||||
0xFE, 0xD6, 0xC6, 0x00, 0x00, 0x00, 0xF8, 0xCC, 0xCC, 0xCC, 0xCC, 0x00,
|
||||
0x00, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0x00, 0xDC, 0x66,
|
||||
0x66, 0x7C, 0x60, 0xF0, 0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0x1E,
|
||||
0x00, 0x00, 0xDC, 0x76, 0x66, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x7C, 0xC0,
|
||||
0x78, 0x0C, 0xF8, 0x00, 0x10, 0x30, 0x7C, 0x30, 0x30, 0x34, 0x18, 0x00,
|
||||
0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0xCC, 0xCC,
|
||||
0xCC, 0x78, 0x30, 0x00, 0x00, 0x00, 0xC6, 0xD6, 0xFE, 0xFE, 0x6C, 0x00,
|
||||
0x00, 0x00, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0xCC, 0xCC,
|
||||
0xCC, 0x7C, 0x0C, 0xF8, 0x00, 0x00, 0xFC, 0x98, 0x30, 0x64, 0xFC, 0x00,
|
||||
0x1C, 0x30, 0x30, 0xE0, 0x30, 0x30, 0x1C, 0x00, 0x18, 0x18, 0x18, 0x00,
|
||||
0x18, 0x18, 0x18, 0x00, 0xE0, 0x30, 0x30, 0x1C, 0x30, 0x30, 0xE0, 0x00,
|
||||
0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C,
|
||||
0xC6, 0xC6, 0xFE, 0x00, 0x78, 0xCC, 0xC0, 0xCC, 0x78, 0x18, 0x0C, 0x78,
|
||||
0x00, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0x7E, 0x00, 0x1C, 0x00, 0x78, 0xCC,
|
||||
0xFC, 0xC0, 0x78, 0x00, 0x7E, 0xC3, 0x3C, 0x06, 0x3E, 0x66, 0x3F, 0x00,
|
||||
0xCC, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x7E, 0x00, 0xE0, 0x00, 0x78, 0x0C,
|
||||
0x7C, 0xCC, 0x7E, 0x00, 0x30, 0x30, 0x78, 0x0C, 0x7C, 0xCC, 0x7E, 0x00,
|
||||
0x00, 0x00, 0x78, 0xC0, 0xC0, 0x78, 0x0C, 0x38, 0x7E, 0xC3, 0x3C, 0x66,
|
||||
0x7E, 0x60, 0x3C, 0x00, 0xCC, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00,
|
||||
0xE0, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00, 0xCC, 0x00, 0x70, 0x30,
|
||||
0x30, 0x30, 0x78, 0x00, 0x7C, 0xC6, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00,
|
||||
0xE0, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00, 0xC6, 0x38, 0x6C, 0xC6,
|
||||
0xFE, 0xC6, 0xC6, 0x00, 0x30, 0x30, 0x00, 0x78, 0xCC, 0xFC, 0xCC, 0x00,
|
||||
0x1C, 0x00, 0xFC, 0x60, 0x78, 0x60, 0xFC, 0x00, 0x00, 0x00, 0x7F, 0x0C,
|
||||
0x7F, 0xCC, 0x7F, 0x00, 0x3E, 0x6C, 0xCC, 0xFE, 0xCC, 0xCC, 0xCE, 0x00,
|
||||
0x78, 0xCC, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0xCC, 0x00, 0x78,
|
||||
0xCC, 0xCC, 0x78, 0x00, 0x00, 0xE0, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00,
|
||||
0x78, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0x7E, 0x00, 0x00, 0xE0, 0x00, 0xCC,
|
||||
0xCC, 0xCC, 0x7E, 0x00, 0x00, 0xCC, 0x00, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8,
|
||||
0xC3, 0x18, 0x3C, 0x66, 0x66, 0x3C, 0x18, 0x00, 0xCC, 0x00, 0xCC, 0xCC,
|
||||
0xCC, 0xCC, 0x78, 0x00, 0x18, 0x18, 0x7E, 0xC0, 0xC0, 0x7E, 0x18, 0x18,
|
||||
0x38, 0x6C, 0x64, 0xF0, 0x60, 0xE6, 0xFC, 0x00, 0xCC, 0xCC, 0x78, 0xFC,
|
||||
0x30, 0xFC, 0x30, 0x30, 0xF8, 0xCC, 0xCC, 0xFA, 0xC6, 0xCF, 0xC6, 0xC7,
|
||||
0x0E, 0x1B, 0x18, 0x3C, 0x18, 0x18, 0xD8, 0x70, 0x1C, 0x00, 0x78, 0x0C,
|
||||
0x7C, 0xCC, 0x7E, 0x00, 0x38, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00,
|
||||
0x00, 0x1C, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0x1C, 0x00, 0xCC,
|
||||
0xCC, 0xCC, 0x7E, 0x00, 0x00, 0xF8, 0x00, 0xF8, 0xCC, 0xCC, 0xCC, 0x00,
|
||||
0xFC, 0x00, 0xCC, 0xEC, 0xFC, 0xDC, 0xCC, 0x00, 0x3C, 0x6C, 0x6C, 0x3E,
|
||||
0x00, 0x7E, 0x00, 0x00, 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x7C, 0x00, 0x00,
|
||||
0x30, 0x00, 0x30, 0x60, 0xC0, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00, 0xFC,
|
||||
0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x0C, 0x0C, 0x00, 0x00,
|
||||
0xC3, 0xC6, 0xCC, 0xDE, 0x33, 0x66, 0xCC, 0x0F, 0xC3, 0xC6, 0xCC, 0xDB,
|
||||
0x37, 0x6F, 0xCF, 0x03, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00,
|
||||
0x00, 0x33, 0x66, 0xCC, 0x66, 0x33, 0x00, 0x00, 0x00, 0xCC, 0x66, 0x33,
|
||||
0x66, 0xCC, 0x00, 0x00, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88,
|
||||
0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0xDB, 0x77, 0xDB, 0xEE,
|
||||
0xDB, 0x77, 0xDB, 0xEE, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
|
||||
0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18,
|
||||
0xF8, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 0xF6, 0x36, 0x36, 0x36,
|
||||
0x00, 0x00, 0x00, 0x00, 0xFE, 0x36, 0x36, 0x36, 0x00, 0x00, 0xF8, 0x18,
|
||||
0xF8, 0x18, 0x18, 0x18, 0x36, 0x36, 0xF6, 0x06, 0xF6, 0x36, 0x36, 0x36,
|
||||
0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0xFE, 0x06,
|
||||
0xF6, 0x36, 0x36, 0x36, 0x36, 0x36, 0xF6, 0x06, 0xFE, 0x00, 0x00, 0x00,
|
||||
0x36, 0x36, 0x36, 0x36, 0xFE, 0x00, 0x00, 0x00, 0x18, 0x18, 0xF8, 0x18,
|
||||
0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x18, 0x18, 0x18,
|
||||
0x18, 0x18, 0x18, 0x18, 0x1F, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18,
|
||||
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x18, 0x18,
|
||||
0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
|
||||
0xFF, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18,
|
||||
0x18, 0x18, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
|
||||
0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x3F, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x3F, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0xF7, 0x00,
|
||||
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xF7, 0x36, 0x36, 0x36,
|
||||
0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x00, 0x00, 0xFF, 0x00,
|
||||
0xFF, 0x00, 0x00, 0x00, 0x36, 0x36, 0xF7, 0x00, 0xF7, 0x36, 0x36, 0x36,
|
||||
0x18, 0x18, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36,
|
||||
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x18, 0x18, 0x18,
|
||||
0x00, 0x00, 0x00, 0x00, 0xFF, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
|
||||
0x3F, 0x00, 0x00, 0x00, 0x18, 0x18, 0x1F, 0x18, 0x1F, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
|
||||
0x3F, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xFF, 0x36, 0x36, 0x36,
|
||||
0x18, 0x18, 0xFF, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
|
||||
0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x18, 0x18, 0x18,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
|
||||
0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xDC, 0xC8, 0xDC, 0x76, 0x00,
|
||||
0x00, 0x78, 0xCC, 0xF8, 0xCC, 0xF8, 0xC0, 0xC0, 0x00, 0xFC, 0xCC, 0xC0,
|
||||
0xC0, 0xC0, 0xC0, 0x00, 0x00, 0xFE, 0x6C, 0x6C, 0x6C, 0x6C, 0x6C, 0x00,
|
||||
0xFC, 0xCC, 0x60, 0x30, 0x60, 0xCC, 0xFC, 0x00, 0x00, 0x00, 0x7E, 0xD8,
|
||||
0xD8, 0xD8, 0x70, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x7C, 0x60, 0xC0,
|
||||
0x00, 0x76, 0xDC, 0x18, 0x18, 0x18, 0x18, 0x00, 0xFC, 0x30, 0x78, 0xCC,
|
||||
0xCC, 0x78, 0x30, 0xFC, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0x6C, 0x38, 0x00,
|
||||
0x38, 0x6C, 0xC6, 0xC6, 0x6C, 0x6C, 0xEE, 0x00, 0x1C, 0x30, 0x18, 0x7C,
|
||||
0xCC, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x7E, 0xDB, 0xDB, 0x7E, 0x00, 0x00,
|
||||
0x06, 0x0C, 0x7E, 0xDB, 0xDB, 0x7E, 0x60, 0xC0, 0x38, 0x60, 0xC0, 0xF8,
|
||||
0xC0, 0x60, 0x38, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x00,
|
||||
0x00, 0xFC, 0x00, 0xFC, 0x00, 0xFC, 0x00, 0x00, 0x30, 0x30, 0xFC, 0x30,
|
||||
0x30, 0x00, 0xFC, 0x00, 0x60, 0x30, 0x18, 0x30, 0x60, 0x00, 0xFC, 0x00,
|
||||
0x18, 0x30, 0x60, 0x30, 0x18, 0x00, 0xFC, 0x00, 0x0E, 0x1B, 0x1B, 0x18,
|
||||
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xD8, 0xD8, 0x70,
|
||||
0x30, 0x30, 0x00, 0xFC, 0x00, 0x30, 0x30, 0x00, 0x00, 0x76, 0xDC, 0x00,
|
||||
0x76, 0xDC, 0x00, 0x00, 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x18, 0x00, 0x00, 0x00, 0x0F, 0x0C, 0x0C, 0x0C, 0xEC, 0x6C, 0x3C, 0x1C,
|
||||
0x78, 0x6C, 0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x70, 0x18, 0x30, 0x60,
|
||||
0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
char textfont[2048] =
|
||||
{
|
||||
// 2048 bytes
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x81, 0xA5, 0x81,
|
||||
0xBD, 0x99, 0x81, 0x7E, 0x7E, 0xFF, 0xDB, 0xFF, 0xC3, 0xE7, 0xFF, 0x7E,
|
||||
0x6C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38, 0x10, 0x00, 0x10, 0x38, 0x7C, 0xFE,
|
||||
0x7C, 0x38, 0x10, 0x00, 0x38, 0x7C, 0x38, 0xFE, 0xFE, 0x7C, 0x38, 0x7C,
|
||||
0x10, 0x10, 0x38, 0x7C, 0xFE, 0x7C, 0x38, 0x7C, 0x00, 0x00, 0x18, 0x3C,
|
||||
0x3C, 0x18, 0x00, 0x00, 0xFF, 0xFF, 0xE7, 0xC3, 0xC3, 0xE7, 0xFF, 0xFF,
|
||||
0x00, 0x3C, 0x66, 0x42, 0x42, 0x66, 0x3C, 0x00, 0xFF, 0xC3, 0x99, 0xBD,
|
||||
0xBD, 0x99, 0xC3, 0xFF, 0x0F, 0x07, 0x0F, 0x7D, 0xCC, 0xCC, 0xCC, 0x78,
|
||||
0x3C, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x18, 0x3F, 0x33, 0x3F, 0x30,
|
||||
0x30, 0x70, 0xF0, 0xE0, 0x7F, 0x63, 0x7F, 0x63, 0x63, 0x67, 0xE6, 0xC0,
|
||||
0x99, 0x5A, 0x3C, 0xE7, 0xE7, 0x3C, 0x5A, 0x99, 0x80, 0xE0, 0xF8, 0xFE,
|
||||
0xF8, 0xE0, 0x80, 0x00, 0x02, 0x0E, 0x3E, 0xFE, 0x3E, 0x0E, 0x02, 0x00,
|
||||
0x18, 0x3C, 0x7E, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x66, 0x66, 0x66, 0x66,
|
||||
0x66, 0x00, 0x66, 0x00, 0x7F, 0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x00,
|
||||
0x3E, 0x63, 0x38, 0x6C, 0x6C, 0x38, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00,
|
||||
0x7E, 0x7E, 0x7E, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x7E, 0x3C, 0x18, 0xFF,
|
||||
0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18,
|
||||
0x7E, 0x3C, 0x18, 0x00, 0x00, 0x18, 0x0C, 0xFE, 0x0C, 0x18, 0x00, 0x00,
|
||||
0x00, 0x30, 0x60, 0xFE, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0,
|
||||
0xC0, 0xFE, 0x00, 0x00, 0x00, 0x24, 0x66, 0xFF, 0x66, 0x24, 0x00, 0x00,
|
||||
0x00, 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7E,
|
||||
0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x30, 0x78, 0x78, 0x30, 0x30, 0x00, 0x30, 0x00, 0x6C, 0x6C, 0x6C, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00,
|
||||
0x30, 0x7C, 0xC0, 0x78, 0x0C, 0xF8, 0x30, 0x00, 0x00, 0xC6, 0xCC, 0x18,
|
||||
0x30, 0x66, 0xC6, 0x00, 0x38, 0x6C, 0x38, 0x76, 0xDC, 0xCC, 0x76, 0x00,
|
||||
0x60, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x60,
|
||||
0x60, 0x30, 0x18, 0x00, 0x60, 0x30, 0x18, 0x18, 0x18, 0x30, 0x60, 0x00,
|
||||
0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00, 0x00, 0x30, 0x30, 0xFC,
|
||||
0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x60,
|
||||
0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x30, 0x30, 0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00,
|
||||
0x7C, 0xC6, 0xCE, 0xDE, 0xF6, 0xE6, 0x7C, 0x00, 0x30, 0x70, 0x30, 0x30,
|
||||
0x30, 0x30, 0xFC, 0x00, 0x78, 0xCC, 0x0C, 0x38, 0x60, 0xCC, 0xFC, 0x00,
|
||||
0x78, 0xCC, 0x0C, 0x38, 0x0C, 0xCC, 0x78, 0x00, 0x1C, 0x3C, 0x6C, 0xCC,
|
||||
0xFE, 0x0C, 0x1E, 0x00, 0xFC, 0xC0, 0xF8, 0x0C, 0x0C, 0xCC, 0x78, 0x00,
|
||||
0x38, 0x60, 0xC0, 0xF8, 0xCC, 0xCC, 0x78, 0x00, 0xFC, 0xCC, 0x0C, 0x18,
|
||||
0x30, 0x30, 0x30, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0xCC, 0xCC, 0x78, 0x00,
|
||||
0x78, 0xCC, 0xCC, 0x7C, 0x0C, 0x18, 0x70, 0x00, 0x00, 0x30, 0x30, 0x00,
|
||||
0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x60,
|
||||
0x18, 0x30, 0x60, 0xC0, 0x60, 0x30, 0x18, 0x00, 0x00, 0x00, 0xFC, 0x00,
|
||||
0x00, 0xFC, 0x00, 0x00, 0x60, 0x30, 0x18, 0x0C, 0x18, 0x30, 0x60, 0x00,
|
||||
0x78, 0xCC, 0x0C, 0x18, 0x30, 0x00, 0x30, 0x00, 0x7C, 0xC6, 0xDE, 0xDE,
|
||||
0xDE, 0xC0, 0x78, 0x00, 0x30, 0x78, 0xCC, 0xCC, 0xFC, 0xCC, 0xCC, 0x00,
|
||||
0xFC, 0x66, 0x66, 0x7C, 0x66, 0x66, 0xFC, 0x00, 0x3C, 0x66, 0xC0, 0xC0,
|
||||
0xC0, 0x66, 0x3C, 0x00, 0xF8, 0x6C, 0x66, 0x66, 0x66, 0x6C, 0xF8, 0x00,
|
||||
0xFE, 0x62, 0x68, 0x78, 0x68, 0x62, 0xFE, 0x00, 0xFE, 0x62, 0x68, 0x78,
|
||||
0x68, 0x60, 0xF0, 0x00, 0x3C, 0x66, 0xC0, 0xC0, 0xCE, 0x66, 0x3E, 0x00,
|
||||
0xCC, 0xCC, 0xCC, 0xFC, 0xCC, 0xCC, 0xCC, 0x00, 0x78, 0x30, 0x30, 0x30,
|
||||
0x30, 0x30, 0x78, 0x00, 0x1E, 0x0C, 0x0C, 0x0C, 0xCC, 0xCC, 0x78, 0x00,
|
||||
0xE6, 0x66, 0x6C, 0x78, 0x6C, 0x66, 0xE6, 0x00, 0xF0, 0x60, 0x60, 0x60,
|
||||
0x62, 0x66, 0xFE, 0x00, 0xC6, 0xEE, 0xFE, 0xFE, 0xD6, 0xC6, 0xC6, 0x00,
|
||||
0xC6, 0xE6, 0xF6, 0xDE, 0xCE, 0xC6, 0xC6, 0x00, 0x38, 0x6C, 0xC6, 0xC6,
|
||||
0xC6, 0x6C, 0x38, 0x00, 0xFC, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xF0, 0x00,
|
||||
0x78, 0xCC, 0xCC, 0xCC, 0xDC, 0x78, 0x1C, 0x00, 0xFC, 0x66, 0x66, 0x7C,
|
||||
0x6C, 0x66, 0xE6, 0x00, 0x78, 0xCC, 0xE0, 0x70, 0x1C, 0xCC, 0x78, 0x00,
|
||||
0xFC, 0xB4, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00, 0xCC, 0xCC, 0xCC, 0xCC,
|
||||
0xCC, 0xCC, 0xFC, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x00,
|
||||
0xC6, 0xC6, 0xC6, 0xD6, 0xFE, 0xEE, 0xC6, 0x00, 0xC6, 0xC6, 0x6C, 0x38,
|
||||
0x38, 0x6C, 0xC6, 0x00, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x30, 0x78, 0x00,
|
||||
0xFE, 0xC6, 0x8C, 0x18, 0x32, 0x66, 0xFE, 0x00, 0x78, 0x60, 0x60, 0x60,
|
||||
0x60, 0x60, 0x78, 0x00, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x02, 0x00,
|
||||
0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x00, 0x10, 0x38, 0x6C, 0xC6,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
|
||||
0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0C,
|
||||
0x7C, 0xCC, 0x76, 0x00, 0xE0, 0x60, 0x60, 0x7C, 0x66, 0x66, 0xDC, 0x00,
|
||||
0x00, 0x00, 0x78, 0xCC, 0xC0, 0xCC, 0x78, 0x00, 0x1C, 0x0C, 0x0C, 0x7C,
|
||||
0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00,
|
||||
0x38, 0x6C, 0x60, 0xF0, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x76, 0xCC,
|
||||
0xCC, 0x7C, 0x0C, 0xF8, 0xE0, 0x60, 0x6C, 0x76, 0x66, 0x66, 0xE6, 0x00,
|
||||
0x30, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00, 0x0C, 0x00, 0x0C, 0x0C,
|
||||
0x0C, 0xCC, 0xCC, 0x78, 0xE0, 0x60, 0x66, 0x6C, 0x78, 0x6C, 0xE6, 0x00,
|
||||
0x70, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00, 0x00, 0x00, 0xCC, 0xFE,
|
||||
0xFE, 0xD6, 0xC6, 0x00, 0x00, 0x00, 0xF8, 0xCC, 0xCC, 0xCC, 0xCC, 0x00,
|
||||
0x00, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0x00, 0xDC, 0x66,
|
||||
0x66, 0x7C, 0x60, 0xF0, 0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0x1E,
|
||||
0x00, 0x00, 0xDC, 0x76, 0x66, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x7C, 0xC0,
|
||||
0x78, 0x0C, 0xF8, 0x00, 0x10, 0x30, 0x7C, 0x30, 0x30, 0x34, 0x18, 0x00,
|
||||
0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0xCC, 0xCC,
|
||||
0xCC, 0x78, 0x30, 0x00, 0x00, 0x00, 0xC6, 0xD6, 0xFE, 0xFE, 0x6C, 0x00,
|
||||
0x00, 0x00, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0xCC, 0xCC,
|
||||
0xCC, 0x7C, 0x0C, 0xF8, 0x00, 0x00, 0xFC, 0x98, 0x30, 0x64, 0xFC, 0x00,
|
||||
0x1C, 0x30, 0x30, 0xE0, 0x30, 0x30, 0x1C, 0x00, 0x18, 0x18, 0x18, 0x00,
|
||||
0x18, 0x18, 0x18, 0x00, 0xE0, 0x30, 0x30, 0x1C, 0x30, 0x30, 0xE0, 0x00,
|
||||
0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C,
|
||||
0xC6, 0xC6, 0xFE, 0x00, 0x78, 0xCC, 0xC0, 0xCC, 0x78, 0x18, 0x0C, 0x78,
|
||||
0x00, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0x7E, 0x00, 0x1C, 0x00, 0x78, 0xCC,
|
||||
0xFC, 0xC0, 0x78, 0x00, 0x7E, 0xC3, 0x3C, 0x06, 0x3E, 0x66, 0x3F, 0x00,
|
||||
0xCC, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x7E, 0x00, 0xE0, 0x00, 0x78, 0x0C,
|
||||
0x7C, 0xCC, 0x7E, 0x00, 0x30, 0x30, 0x78, 0x0C, 0x7C, 0xCC, 0x7E, 0x00,
|
||||
0x00, 0x00, 0x78, 0xC0, 0xC0, 0x78, 0x0C, 0x38, 0x7E, 0xC3, 0x3C, 0x66,
|
||||
0x7E, 0x60, 0x3C, 0x00, 0xCC, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00,
|
||||
0xE0, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00, 0xCC, 0x00, 0x70, 0x30,
|
||||
0x30, 0x30, 0x78, 0x00, 0x7C, 0xC6, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00,
|
||||
0xE0, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00, 0xC6, 0x38, 0x6C, 0xC6,
|
||||
0xFE, 0xC6, 0xC6, 0x00, 0x30, 0x30, 0x00, 0x78, 0xCC, 0xFC, 0xCC, 0x00,
|
||||
0x1C, 0x00, 0xFC, 0x60, 0x78, 0x60, 0xFC, 0x00, 0x00, 0x00, 0x7F, 0x0C,
|
||||
0x7F, 0xCC, 0x7F, 0x00, 0x3E, 0x6C, 0xCC, 0xFE, 0xCC, 0xCC, 0xCE, 0x00,
|
||||
0x78, 0xCC, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0xCC, 0x00, 0x78,
|
||||
0xCC, 0xCC, 0x78, 0x00, 0x00, 0xE0, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00,
|
||||
0x78, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0x7E, 0x00, 0x00, 0xE0, 0x00, 0xCC,
|
||||
0xCC, 0xCC, 0x7E, 0x00, 0x00, 0xCC, 0x00, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8,
|
||||
0xC3, 0x18, 0x3C, 0x66, 0x66, 0x3C, 0x18, 0x00, 0xCC, 0x00, 0xCC, 0xCC,
|
||||
0xCC, 0xCC, 0x78, 0x00, 0x18, 0x18, 0x7E, 0xC0, 0xC0, 0x7E, 0x18, 0x18,
|
||||
0x38, 0x6C, 0x64, 0xF0, 0x60, 0xE6, 0xFC, 0x00, 0xCC, 0xCC, 0x78, 0xFC,
|
||||
0x30, 0xFC, 0x30, 0x30, 0xF8, 0xCC, 0xCC, 0xFA, 0xC6, 0xCF, 0xC6, 0xC7,
|
||||
0x0E, 0x1B, 0x18, 0x3C, 0x18, 0x18, 0xD8, 0x70, 0x1C, 0x00, 0x78, 0x0C,
|
||||
0x7C, 0xCC, 0x7E, 0x00, 0x38, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00,
|
||||
0x00, 0x1C, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0x1C, 0x00, 0xCC,
|
||||
0xCC, 0xCC, 0x7E, 0x00, 0x00, 0xF8, 0x00, 0xF8, 0xCC, 0xCC, 0xCC, 0x00,
|
||||
0xFC, 0x00, 0xCC, 0xEC, 0xFC, 0xDC, 0xCC, 0x00, 0x3C, 0x6C, 0x6C, 0x3E,
|
||||
0x00, 0x7E, 0x00, 0x00, 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x7C, 0x00, 0x00,
|
||||
0x30, 0x00, 0x30, 0x60, 0xC0, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00, 0xFC,
|
||||
0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x0C, 0x0C, 0x00, 0x00,
|
||||
0xC3, 0xC6, 0xCC, 0xDE, 0x33, 0x66, 0xCC, 0x0F, 0xC3, 0xC6, 0xCC, 0xDB,
|
||||
0x37, 0x6F, 0xCF, 0x03, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00,
|
||||
0x00, 0x33, 0x66, 0xCC, 0x66, 0x33, 0x00, 0x00, 0x00, 0xCC, 0x66, 0x33,
|
||||
0x66, 0xCC, 0x00, 0x00, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88,
|
||||
0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0xDB, 0x77, 0xDB, 0xEE,
|
||||
0xDB, 0x77, 0xDB, 0xEE, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
|
||||
0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18,
|
||||
0xF8, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 0xF6, 0x36, 0x36, 0x36,
|
||||
0x00, 0x00, 0x00, 0x00, 0xFE, 0x36, 0x36, 0x36, 0x00, 0x00, 0xF8, 0x18,
|
||||
0xF8, 0x18, 0x18, 0x18, 0x36, 0x36, 0xF6, 0x06, 0xF6, 0x36, 0x36, 0x36,
|
||||
0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0xFE, 0x06,
|
||||
0xF6, 0x36, 0x36, 0x36, 0x36, 0x36, 0xF6, 0x06, 0xFE, 0x00, 0x00, 0x00,
|
||||
0x36, 0x36, 0x36, 0x36, 0xFE, 0x00, 0x00, 0x00, 0x18, 0x18, 0xF8, 0x18,
|
||||
0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x18, 0x18, 0x18,
|
||||
0x18, 0x18, 0x18, 0x18, 0x1F, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18,
|
||||
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x18, 0x18,
|
||||
0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
|
||||
0xFF, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18,
|
||||
0x18, 0x18, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
|
||||
0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x3F, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x3F, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0xF7, 0x00,
|
||||
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xF7, 0x36, 0x36, 0x36,
|
||||
0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x00, 0x00, 0xFF, 0x00,
|
||||
0xFF, 0x00, 0x00, 0x00, 0x36, 0x36, 0xF7, 0x00, 0xF7, 0x36, 0x36, 0x36,
|
||||
0x18, 0x18, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36,
|
||||
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x18, 0x18, 0x18,
|
||||
0x00, 0x00, 0x00, 0x00, 0xFF, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
|
||||
0x3F, 0x00, 0x00, 0x00, 0x18, 0x18, 0x1F, 0x18, 0x1F, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
|
||||
0x3F, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xFF, 0x36, 0x36, 0x36,
|
||||
0x18, 0x18, 0xFF, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
|
||||
0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x18, 0x18, 0x18,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
|
||||
0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xDC, 0xC8, 0xDC, 0x76, 0x00,
|
||||
0x00, 0x78, 0xCC, 0xF8, 0xCC, 0xF8, 0xC0, 0xC0, 0x00, 0xFC, 0xCC, 0xC0,
|
||||
0xC0, 0xC0, 0xC0, 0x00, 0x00, 0xFE, 0x6C, 0x6C, 0x6C, 0x6C, 0x6C, 0x00,
|
||||
0xFC, 0xCC, 0x60, 0x30, 0x60, 0xCC, 0xFC, 0x00, 0x00, 0x00, 0x7E, 0xD8,
|
||||
0xD8, 0xD8, 0x70, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x7C, 0x60, 0xC0,
|
||||
0x00, 0x76, 0xDC, 0x18, 0x18, 0x18, 0x18, 0x00, 0xFC, 0x30, 0x78, 0xCC,
|
||||
0xCC, 0x78, 0x30, 0xFC, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0x6C, 0x38, 0x00,
|
||||
0x38, 0x6C, 0xC6, 0xC6, 0x6C, 0x6C, 0xEE, 0x00, 0x1C, 0x30, 0x18, 0x7C,
|
||||
0xCC, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x7E, 0xDB, 0xDB, 0x7E, 0x00, 0x00,
|
||||
0x06, 0x0C, 0x7E, 0xDB, 0xDB, 0x7E, 0x60, 0xC0, 0x38, 0x60, 0xC0, 0xF8,
|
||||
0xC0, 0x60, 0x38, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x00,
|
||||
0x00, 0xFC, 0x00, 0xFC, 0x00, 0xFC, 0x00, 0x00, 0x30, 0x30, 0xFC, 0x30,
|
||||
0x30, 0x00, 0xFC, 0x00, 0x60, 0x30, 0x18, 0x30, 0x60, 0x00, 0xFC, 0x00,
|
||||
0x18, 0x30, 0x60, 0x30, 0x18, 0x00, 0xFC, 0x00, 0x0E, 0x1B, 0x1B, 0x18,
|
||||
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xD8, 0xD8, 0x70,
|
||||
0x30, 0x30, 0x00, 0xFC, 0x00, 0x30, 0x30, 0x00, 0x00, 0x76, 0xDC, 0x00,
|
||||
0x76, 0xDC, 0x00, 0x00, 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x18, 0x00, 0x00, 0x00, 0x0F, 0x0C, 0x0C, 0x0C, 0xEC, 0x6C, 0x3C, 0x1C,
|
||||
0x78, 0x6C, 0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x70, 0x18, 0x30, 0x60,
|
||||
0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
|
|
@ -41,7 +41,7 @@ void main(int argc, char *argv[])
|
|||
FILE *in, *out;
|
||||
char datab1, datab2;
|
||||
int across=0, maxacross;
|
||||
long length, written=0;
|
||||
int length, written=0;
|
||||
|
||||
|
||||
// get the source file
|
||||
|
|
|
@ -11,14 +11,14 @@
|
|||
|
||||
typedef struct {
|
||||
char magic[8]; // 'Polymost'
|
||||
long xdim, ydim; // of image, unpadded
|
||||
long flags; // 1 = !2^x, 2 = has alpha, 4 = lzw compressed
|
||||
int xdim, ydim; // of image, unpadded
|
||||
int flags; // 1 = !2^x, 2 = has alpha, 4 = lzw compressed
|
||||
} texcacheheader;
|
||||
typedef struct {
|
||||
long size;
|
||||
long format;
|
||||
long xdim, ydim; // of mipmap (possibly padded)
|
||||
long border, depth;
|
||||
int size;
|
||||
int format;
|
||||
int xdim, ydim; // of mipmap (possibly padded)
|
||||
int border, depth;
|
||||
} texcachepicture;
|
||||
|
||||
int main(int argc, char **argv)
|
||||
|
|
|
@ -50,8 +50,8 @@ int writeicon(FILE *fp, struct icon *ico)
|
|||
int main(int argc, char **argv)
|
||||
{
|
||||
struct icon icon;
|
||||
long bpl, xsiz, ysiz;
|
||||
long i,j,k,c;
|
||||
int bpl, xsiz, ysiz;
|
||||
int i,j,k,c;
|
||||
unsigned char *mask, *maskp, bm, *pp;
|
||||
|
||||
if (argc<2) {
|
||||
|
@ -61,7 +61,7 @@ int main(int argc, char **argv)
|
|||
|
||||
memset(&icon, 0, sizeof(icon));
|
||||
|
||||
kpzload(argv[1], (long*)&icon.pixels, &bpl, (long*)&icon.width, (long*)&icon.height);
|
||||
kpzload(argv[1], (int*)&icon.pixels, &bpl, (int*)&icon.width, (int*)&icon.height);
|
||||
if (!icon.pixels) {
|
||||
fprintf(stderr, "Failure loading %s\n", argv[1]);
|
||||
return 1;
|
||||
|
|
|
@ -11,10 +11,10 @@
|
|||
|
||||
static char buf[65536];
|
||||
|
||||
static long numfiles, anyfiles4extraction;
|
||||
static int numfiles, anyfiles4extraction;
|
||||
static char marked4extraction[MAXFILES];
|
||||
static char filelist[MAXFILES][16];
|
||||
static long fileoffs[MAXFILES+1], fileleng[MAXFILES];
|
||||
static int fileoffs[MAXFILES+1], fileleng[MAXFILES];
|
||||
|
||||
void findfiles(const char *dafilespec)
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ void findfiles(const char *dafilespec)
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
long i, j, k, l, fil, fil2;
|
||||
int i, j, k, l, fil, fil2;
|
||||
|
||||
if (argc < 3)
|
||||
{
|
||||
|
@ -63,14 +63,14 @@ int main(int argc, char **argv)
|
|||
printf("Error: %s not a valid group file\n",argv[1]);
|
||||
return(0);
|
||||
}
|
||||
numfiles = *((long*)&buf[12]); numfiles = B_LITTLE32(numfiles);
|
||||
numfiles = *((int*)&buf[12]); numfiles = B_LITTLE32(numfiles);
|
||||
|
||||
Bread(fil,filelist,numfiles<<4);
|
||||
|
||||
j = 0;
|
||||
for(i=0;i<numfiles;i++)
|
||||
{
|
||||
k = *((long*)&filelist[i][12]); k = B_LITTLE32(k);
|
||||
k = *((int*)&filelist[i][12]); k = B_LITTLE32(k);
|
||||
filelist[i][12] = 0;
|
||||
fileoffs[i] = j;
|
||||
j += k;
|
||||
|
|
|
@ -15,9 +15,9 @@ static void jstrupr(char *s) { while (*s) { *s = Btoupper(*s); s++; } }
|
|||
|
||||
static char buf[65536]; // These limits should be abolished one day
|
||||
|
||||
static long numfiles;
|
||||
static int numfiles;
|
||||
static char filespec[MAXFILES][128], filelist[MAXFILES][16];
|
||||
static long fileleng[MAXFILES];
|
||||
static int fileleng[MAXFILES];
|
||||
|
||||
|
||||
static char *matchstr = "*.*";
|
||||
|
@ -28,7 +28,7 @@ int checkmatch(const struct Bdirent *a)
|
|||
return Bwildmatch(a->name, matchstr);
|
||||
}
|
||||
|
||||
long filesize(const char *path, const char *name)
|
||||
int filesize(const char *path, const char *name)
|
||||
{
|
||||
char p[BMAX_PATH];
|
||||
struct stat st;
|
||||
|
@ -44,7 +44,7 @@ long filesize(const char *path, const char *name)
|
|||
void findfiles(const char *dafilespec)
|
||||
{
|
||||
struct Bdirent *name;
|
||||
long daspeclen;
|
||||
int daspeclen;
|
||||
char daspec[128], *dir;
|
||||
BDIR *di;
|
||||
|
||||
|
@ -91,7 +91,7 @@ void findfiles(const char *dafilespec)
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
long i, j, k, l, fil, fil2;
|
||||
int i, j, k, l, fil, fil2;
|
||||
|
||||
if (argc < 3)
|
||||
{
|
||||
|
|
|
@ -11,9 +11,9 @@ kmd2tool.exe: kmd2tool.c; cl kmd2tool.c /Ox /G6fy /MD /link /opt:nowin98
|
|||
typedef struct { float x, y, z; } point3d;
|
||||
|
||||
typedef struct
|
||||
{ long id, vers, skinxsiz, skinysiz, framebytes; //id:"IPD2", vers:8
|
||||
long numskins, numverts, numuv, numtris, numglcmds, numframes;
|
||||
long ofsskins, ofsuv, ofstris, ofsframes, ofsglcmds, ofseof; //ofsskins: skin names (64 bytes each)
|
||||
{ int id, vers, skinxsiz, skinysiz, framebytes; //id:"IPD2", vers:8
|
||||
int numskins, numverts, numuv, numtris, numglcmds, numframes;
|
||||
int ofsskins, ofsuv, ofstris, ofsframes, ofsglcmds, ofseof; //ofsskins: skin names (64 bytes each)
|
||||
} md2typ;
|
||||
|
||||
typedef struct { point3d mul, add; } frametyp;
|
||||
|
@ -21,7 +21,7 @@ typedef struct { point3d mul, add; } frametyp;
|
|||
int main (int argc, char **argv)
|
||||
{
|
||||
FILE *fil;
|
||||
long i, leng;
|
||||
int i, leng;
|
||||
char *fbuf;
|
||||
md2typ *head;
|
||||
frametyp *fptr;
|
||||
|
|
|
@ -10,25 +10,25 @@
|
|||
|
||||
#define MAXPALOOKUPS 256
|
||||
|
||||
static long numpalookups, transratio;
|
||||
static int numpalookups, transratio;
|
||||
static char palettefilename[13], origpalookup[MAXPALOOKUPS<<8];
|
||||
static char palette[768], palookup[MAXPALOOKUPS<<8], transluc[65536];
|
||||
static char closestcol[64][64][64];
|
||||
|
||||
#define FASTPALGRIDSIZ 8
|
||||
static long rdist[129], gdist[129], bdist[129];
|
||||
static int rdist[129], gdist[129], bdist[129];
|
||||
static char colhere[((FASTPALGRIDSIZ+2)*(FASTPALGRIDSIZ+2)*(FASTPALGRIDSIZ+2))>>3];
|
||||
static char colhead[(FASTPALGRIDSIZ+2)*(FASTPALGRIDSIZ+2)*(FASTPALGRIDSIZ+2)];
|
||||
static long colnext[256];
|
||||
static int colnext[256];
|
||||
static char coldist[8] = {0,1,2,3,4,3,2,1};
|
||||
static long colscan[27];
|
||||
static int colscan[27];
|
||||
|
||||
|
||||
|
||||
char getclosestcol(long r, long g, long b)
|
||||
char getclosestcol(int r, int g, int b)
|
||||
{
|
||||
long i, j, k, dist, mindist, retcol;
|
||||
long *rlookup, *glookup, *blookup;
|
||||
int i, j, k, dist, mindist, retcol;
|
||||
int *rlookup, *glookup, *blookup;
|
||||
char *ptr;
|
||||
|
||||
if (closestcol[r][g][b] != 255) return(closestcol[r][g][b]);
|
||||
|
@ -38,9 +38,9 @@ char getclosestcol(long r, long g, long b)
|
|||
mindist = min(mindist,bdist[coldist[b&7]+64+8]);
|
||||
mindist++;
|
||||
|
||||
rlookup = (long *)&rdist[64-r];
|
||||
glookup = (long *)&gdist[64-g];
|
||||
blookup = (long *)&bdist[64-b];
|
||||
rlookup = (int *)&rdist[64-r];
|
||||
glookup = (int *)&gdist[64-g];
|
||||
blookup = (int *)&bdist[64-b];
|
||||
|
||||
retcol = -1;
|
||||
for(k=26;k>=0;k--)
|
||||
|
@ -86,7 +86,7 @@ char getclosestcol(long r, long g, long b)
|
|||
|
||||
char getpalookup(char dashade, char dacol)
|
||||
{
|
||||
long r, g, b, t;
|
||||
int r, g, b, t;
|
||||
char *ptr;
|
||||
|
||||
ptr = (char *)&palette[dacol*3];
|
||||
|
@ -97,9 +97,9 @@ char getpalookup(char dashade, char dacol)
|
|||
return(getclosestcol(r,g,b));
|
||||
}
|
||||
|
||||
char gettrans(char dat1, char dat2, long datransratio)
|
||||
char gettrans(char dat1, char dat2, int datransratio)
|
||||
{
|
||||
long r, g, b;
|
||||
int r, g, b;
|
||||
char *ptr, *ptr2;
|
||||
|
||||
ptr = (char *)&palette[dat1*3];
|
||||
|
@ -110,9 +110,9 @@ char gettrans(char dat1, char dat2, long datransratio)
|
|||
return(getclosestcol(r,g,b));
|
||||
}
|
||||
|
||||
void initfastcolorlookup(long rscale, long gscale, long bscale)
|
||||
void initfastcolorlookup(int rscale, int gscale, int bscale)
|
||||
{
|
||||
long i, j, x, y, z;
|
||||
int i, j, x, y, z;
|
||||
char *ptr;
|
||||
|
||||
j = 0;
|
||||
|
@ -149,7 +149,7 @@ int main(int argc, char **argv)
|
|||
{
|
||||
char col, ch;
|
||||
short orignumpalookups;
|
||||
long fil, i, j, rscale, gscale, bscale;
|
||||
int fil, i, j, rscale, gscale, bscale;
|
||||
char buf[65536];
|
||||
|
||||
ch = 13;
|
||||
|
@ -203,7 +203,7 @@ int main(int argc, char **argv)
|
|||
Bread(fil,palette,768);
|
||||
Bread(fil,&orignumpalookups,2); orignumpalookups = B_LITTLE16(orignumpalookups);
|
||||
orignumpalookups = min(max(orignumpalookups,1),256);
|
||||
Bread(fil,origpalookup,(long)orignumpalookups<<8);
|
||||
Bread(fil,origpalookup,(int)orignumpalookups<<8);
|
||||
Bclose(fil);
|
||||
|
||||
clearbuf(buf,65536>>2,0L);
|
||||
|
@ -217,8 +217,8 @@ int main(int argc, char **argv)
|
|||
col = getpalookup((char)i,(char)j);
|
||||
palookup[(i<<8)+j] = col;
|
||||
|
||||
drawpixel(((((i<<1)+0)*320+(j+8))>>2)+buf,(long)col);
|
||||
drawpixel(((((i<<1)+1)*320+(j+8))>>2)+buf,(long)col);
|
||||
drawpixel(((((i<<1)+0)*320+(j+8))>>2)+buf,(int)col);
|
||||
drawpixel(((((i<<1)+1)*320+(j+8))>>2)+buf,(int)col);
|
||||
}
|
||||
|
||||
for(i=0;i<256;i++)
|
||||
|
@ -235,7 +235,7 @@ int main(int argc, char **argv)
|
|||
col = gettrans((char)i,(char)j,transratio);
|
||||
transluc[(i<<8)+j] = col;
|
||||
|
||||
drawpixel((((j+132+8)*320+(i+8))>>2)+buf,(long)col);
|
||||
drawpixel((((j+132+8)*320+(i+8))>>2)+buf,(int)col);
|
||||
}
|
||||
|
||||
if (ch == 13)
|
||||
|
@ -257,7 +257,7 @@ int main(int argc, char **argv)
|
|||
{ printf("Couldn't save file %s",palettefilename); return(0); }
|
||||
Bwrite(fil,palette,768);
|
||||
s = B_LITTLE16(orignumpalookups); Bwrite(fil,&s,2);
|
||||
Bwrite(fil,origpalookup,(long)orignumpalookups<<8);
|
||||
Bwrite(fil,origpalookup,(int)orignumpalookups<<8);
|
||||
Bwrite(fil,transluc,65536);
|
||||
Bclose(fil);
|
||||
printf("Transluscent table updated\n");
|
||||
|
|
|
@ -10,11 +10,11 @@
|
|||
|
||||
#define MAXWADS 4096
|
||||
|
||||
static long artversion, localtilestart, localtileend;
|
||||
static long fil1, fil2;
|
||||
static int artversion, localtilestart, localtileend;
|
||||
static int fil1, fil2;
|
||||
static char wadata[MAXWADS][8];
|
||||
static long wadplc[MAXWADS], wadlen[MAXWADS], numwads;
|
||||
static long xoffses[1024], ylookup[256], picanm[MAXWADS];
|
||||
static int wadplc[MAXWADS], wadlen[MAXWADS], numwads;
|
||||
static int xoffses[1024], ylookup[256], picanm[MAXWADS];
|
||||
static short tilesizx[MAXWADS], tilesizy[MAXWADS];
|
||||
static char pal[768], palookup[8192];
|
||||
static char screen[65536], tempbuf[131072];
|
||||
|
@ -22,19 +22,19 @@ static char screen[65536], tempbuf[131072];
|
|||
|
||||
void loadwadheader(void)
|
||||
{
|
||||
long i, j;
|
||||
int i, j;
|
||||
|
||||
Bread(fil1,&tempbuf[0],12);
|
||||
numwads = ((long)tempbuf[4])+(((long)tempbuf[5])<<8)+(((long)tempbuf[6])<<16)+(((long)tempbuf[7])<<24);
|
||||
i = ((long)tempbuf[8])+(((long)tempbuf[9])<<8)+(((long)tempbuf[10])<<16)+(((long)tempbuf[11])<<24);
|
||||
numwads = ((int)tempbuf[4])+(((int)tempbuf[5])<<8)+(((int)tempbuf[6])<<16)+(((int)tempbuf[7])<<24);
|
||||
i = ((int)tempbuf[8])+(((int)tempbuf[9])<<8)+(((int)tempbuf[10])<<16)+(((int)tempbuf[11])<<24);
|
||||
Blseek(fil1,i,BSEEK_SET);
|
||||
Bread(fil1,&tempbuf[0],numwads*16);
|
||||
j = 0;
|
||||
for(i=0;i<numwads;i++)
|
||||
{
|
||||
wadplc[i] = ((long)tempbuf[j])+(((long)tempbuf[j+1])<<8)+(((long)tempbuf[j+2])<<16)+(((long)tempbuf[j+3])<<24);
|
||||
wadplc[i] = ((int)tempbuf[j])+(((int)tempbuf[j+1])<<8)+(((int)tempbuf[j+2])<<16)+(((int)tempbuf[j+3])<<24);
|
||||
j += 4;
|
||||
wadlen[i] = ((long)tempbuf[j])+(((long)tempbuf[j+1])<<8)+(((long)tempbuf[j+2])<<16)+(((long)tempbuf[j+3])<<24);
|
||||
wadlen[i] = ((int)tempbuf[j])+(((int)tempbuf[j+1])<<8)+(((int)tempbuf[j+2])<<16)+(((int)tempbuf[j+3])<<24);
|
||||
j += 4;
|
||||
wadata[i][0] = tempbuf[j+0]; wadata[i][1] = tempbuf[j+1];
|
||||
wadata[i][2] = tempbuf[j+2]; wadata[i][3] = tempbuf[j+3];
|
||||
|
@ -46,7 +46,7 @@ void loadwadheader(void)
|
|||
|
||||
void convpalette(void)
|
||||
{
|
||||
long i, fil3;
|
||||
int i, fil3;
|
||||
short danumshades;
|
||||
|
||||
i = 0;
|
||||
|
@ -71,7 +71,7 @@ void convpalette(void)
|
|||
|
||||
void saveart (short tilenum, short xlen, short ylen)
|
||||
{
|
||||
long i, x, p, pend;
|
||||
int i, x, p, pend;
|
||||
|
||||
pend = ylookup[ylen];
|
||||
|
||||
|
@ -91,7 +91,7 @@ void saveart (short tilenum, short xlen, short ylen)
|
|||
void savenames(void)
|
||||
{
|
||||
char buffer[160];
|
||||
long fil3, i, j;
|
||||
int fil3, i, j;
|
||||
|
||||
if ((fil3 = Bopen("names.h",BO_BINARY|BO_TRUNC|BO_CREAT|BO_WRONLY,BS_IREAD|BS_IWRITE)) == -1)
|
||||
return;
|
||||
|
@ -127,7 +127,7 @@ void showart (char *part)
|
|||
{
|
||||
char yoff, ylen;
|
||||
short xsiz, ysiz;
|
||||
long i, j, z, zx, zzx, x, y, p, pend, junk, curplc;
|
||||
int i, j, z, zx, zzx, x, y, p, pend, junk, curplc;
|
||||
|
||||
curplc = -1;
|
||||
if ((Bstrncasecmp(part,"L_START",7) == 0) || (Bstrncasecmp(part,"S_START",7) == 0) || (Bstrncasecmp(part,"P_START",7) == 0))
|
||||
|
@ -154,13 +154,13 @@ void showart (char *part)
|
|||
read(fil1,&tempbuf[0],wadlen[z]);
|
||||
curplc = wadplc[z]+wadlen[z];
|
||||
|
||||
xsiz = (long)tempbuf[0]+(((long)tempbuf[1])<<8);
|
||||
ysiz = (long)tempbuf[2]+(((long)tempbuf[3])<<8);
|
||||
xsiz = (int)tempbuf[0]+(((int)tempbuf[1])<<8);
|
||||
ysiz = (int)tempbuf[2]+(((int)tempbuf[3])<<8);
|
||||
if ((xsiz <= 0) || (ysiz <= 0) || (xsiz > 320) || (ysiz > 200)) goto skipit;
|
||||
i = 8;
|
||||
for(zx=0;zx<xsiz;zx++)
|
||||
{
|
||||
xoffses[zx] = ((long)tempbuf[i])+(((long)tempbuf[i+1])<<8)+(((long)tempbuf[i+2])<<16)+(((long)tempbuf[i+3])<<24);
|
||||
xoffses[zx] = ((int)tempbuf[i])+(((int)tempbuf[i+1])<<8)+(((int)tempbuf[i+2])<<16)+(((int)tempbuf[i+3])<<24);
|
||||
i += 4;
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,7 @@ skipit:
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
long i, j, endoffile;
|
||||
int i, j, endoffile;
|
||||
char wadfile[80];
|
||||
|
||||
printf("Wad2Art! Copyright 1995 by Ken Silverman\n");
|
||||
|
|
|
@ -25,10 +25,10 @@
|
|||
static unsigned short sqrtable[4096], shlookup[4096+256];
|
||||
|
||||
static char iwadata[MAXWADS][9];
|
||||
static long inumwads, iwadstart, iwadplc[MAXWADS], iwadlen[MAXWADS];
|
||||
static int inumwads, iwadstart, iwadplc[MAXWADS], iwadlen[MAXWADS];
|
||||
|
||||
static char pwadata[MAXWADS][9];
|
||||
static long pnumwads, pwadstart, pwadplc[MAXWADS], pwadlen[MAXWADS];
|
||||
static int pnumwads, pwadstart, pwadplc[MAXWADS], pwadlen[MAXWADS];
|
||||
|
||||
static short px[MAXPOINTS], py[MAXPOINTS];
|
||||
|
||||
|
@ -64,7 +64,7 @@ typedef struct
|
|||
static thingtype thing[MAXTHINGS];
|
||||
|
||||
static char textname[MAXTEXTS][9];
|
||||
static long textoffs[MAXTEXTS];
|
||||
static int textoffs[MAXTEXTS];
|
||||
static short textpname[MAXTEXTS];
|
||||
|
||||
static char pname[MAXPNAMES][9];
|
||||
|
@ -77,7 +77,7 @@ static short point2[MAXPOINTS], slist[MAXPOINTS], sectorofwall[MAXPOINTS];
|
|||
typedef struct
|
||||
{
|
||||
short wallptr, wallnum;
|
||||
long ceilingz, floorz;
|
||||
int ceilingz, floorz;
|
||||
short ceilingstat, floorstat;
|
||||
short ceilingpicnum, ceilingheinum;
|
||||
signed char ceilingshade;
|
||||
|
@ -91,7 +91,7 @@ typedef struct
|
|||
|
||||
typedef struct
|
||||
{
|
||||
long x, y;
|
||||
int x, y;
|
||||
short point2, nextwall, nextsector, cstat;
|
||||
short picnum, overpicnum;
|
||||
signed char shade;
|
||||
|
@ -101,7 +101,7 @@ typedef struct
|
|||
|
||||
typedef struct
|
||||
{
|
||||
long x, y, z;
|
||||
int x, y, z;
|
||||
short cstat, picnum;
|
||||
signed char shade;
|
||||
char pal, clipdist, filler;
|
||||
|
@ -123,31 +123,31 @@ static short tempshort[4096];
|
|||
//SCRIPT parsing variables:
|
||||
static char scriptname[16];
|
||||
static char filebuf[16384];
|
||||
static long filhandle, filpos, fileng;
|
||||
static int filhandle, filpos, fileng;
|
||||
|
||||
static char definemode = 0, define[16384], *defineptr[4096];
|
||||
static long defineval[16384], definecnt = 0, numdefines = 0;
|
||||
static int defineval[16384], definecnt = 0, numdefines = 0;
|
||||
|
||||
static char thingtypemode = 0;
|
||||
static long thingnum[1024], thingnum2[1024], thingoff[1024], numthings = 0;
|
||||
static int thingnum[1024], thingnum2[1024], thingoff[1024], numthings = 0;
|
||||
static short thingfield[4096];
|
||||
static char thingop[4096];
|
||||
static long thingval[4096], thingopnum = 0;
|
||||
static int thingval[4096], thingopnum = 0;
|
||||
|
||||
static char texturelookupmode = 0;
|
||||
static short texturelookup[4096];
|
||||
|
||||
static char tagtypemode = 0;
|
||||
static long tagnum[1024], tagnum2[1024], tagoff[1024], numtags = 0;
|
||||
static int tagnum[1024], tagnum2[1024], tagoff[1024], numtags = 0;
|
||||
static char tagstruct[4096], tagop[4096];
|
||||
static short tagfield[4096];
|
||||
static long tagval[4096], tagopnum = 0;
|
||||
static int tagval[4096], tagopnum = 0;
|
||||
|
||||
static char sectypemode = 0;
|
||||
static long secnum[1024], secnum2[1024], secoff[1024], numsecs = 0;
|
||||
static int secnum[1024], secnum2[1024], secoff[1024], numsecs = 0;
|
||||
static short secfield[4096];
|
||||
static char secop[4096];
|
||||
static long secval[4096], secopnum = 0;
|
||||
static int secval[4096], secopnum = 0;
|
||||
|
||||
#define THINGLISTNUM 123
|
||||
static short thinglookup[MAXTHINGTYPES];
|
||||
|
@ -177,7 +177,7 @@ static thinglisttype thinglist[THINGLISTNUM] =
|
|||
{23,""}};
|
||||
|
||||
// These three were nicked from Build's engine.c.
|
||||
static inline unsigned long ksqrtasm(unsigned long a)
|
||||
static inline unsigned int ksqrtasm(unsigned int a)
|
||||
{
|
||||
unsigned short c;
|
||||
|
||||
|
@ -190,9 +190,9 @@ static inline unsigned long ksqrtasm(unsigned long a)
|
|||
return a;
|
||||
}
|
||||
|
||||
static inline long msqrtasm(unsigned long c)
|
||||
static inline int msqrtasm(unsigned int c)
|
||||
{
|
||||
unsigned long a,b;
|
||||
unsigned int a,b;
|
||||
|
||||
a = 0x40000000l;
|
||||
b = 0x20000000l;
|
||||
|
@ -212,7 +212,7 @@ static inline long msqrtasm(unsigned long c)
|
|||
|
||||
static void initksqrt(void)
|
||||
{
|
||||
long i, j, k;
|
||||
int i, j, k;
|
||||
|
||||
j = 1; k = 0;
|
||||
for(i=0;i<4096;i++)
|
||||
|
@ -225,10 +225,10 @@ static void initksqrt(void)
|
|||
}
|
||||
|
||||
|
||||
long inside(long x, long y, short sectnum)
|
||||
int inside(int x, int y, short sectnum)
|
||||
{
|
||||
walltype *wal;
|
||||
long i, x1, y1, x2, y2;
|
||||
int i, x1, y1, x2, y2;
|
||||
char cnt;
|
||||
|
||||
cnt = 0;
|
||||
|
@ -251,17 +251,17 @@ long inside(long x, long y, short sectnum)
|
|||
return(cnt);
|
||||
}
|
||||
|
||||
long readbyte(void)
|
||||
int readbyte(void)
|
||||
{
|
||||
if (filpos >= fileng) return(-1);
|
||||
if ((filpos&16383) == 0) Bread(filhandle,filebuf,16384);
|
||||
filpos++;
|
||||
return((long)filebuf[(filpos-1)&16383]);
|
||||
return((int)filebuf[(filpos-1)&16383]);
|
||||
}
|
||||
|
||||
long readline(void)
|
||||
int readline(void)
|
||||
{
|
||||
long i, ch;
|
||||
int i, ch;
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -296,8 +296,8 @@ long readline(void)
|
|||
|
||||
void parsescript(void)
|
||||
{
|
||||
long i, j, k, l, lasti, breakout, tstart, tend, textnum, frontbackstat;
|
||||
long spritenumstat, slen;
|
||||
int i, j, k, l, lasti, breakout, tstart, tend, textnum, frontbackstat;
|
||||
int spritenumstat, slen;
|
||||
char ch;
|
||||
|
||||
clearbufbyte(FP_OFF(sectspri),MAXSECTS*8*sizeof(short),0xffffffff);
|
||||
|
@ -730,37 +730,37 @@ void parsescript(void)
|
|||
close(filhandle);
|
||||
}
|
||||
|
||||
long getspritefield(long i, long fieldnum)
|
||||
int getspritefield(int i, int fieldnum)
|
||||
{
|
||||
switch(fieldnum)
|
||||
{
|
||||
case 0: return((long)sprite[i].x);
|
||||
case 1: return((long)sprite[i].y);
|
||||
case 2: return((long)sprite[i].z);
|
||||
case 3: return((long)sprite[i].cstat);
|
||||
case 4: return((long)sprite[i].shade);
|
||||
case 5: return((long)sprite[i].pal);
|
||||
case 6: return((long)sprite[i].clipdist);
|
||||
case 7: return((long)sprite[i].xrepeat);
|
||||
case 8: return((long)sprite[i].yrepeat);
|
||||
case 9: return((long)sprite[i].xoffset);
|
||||
case 10: return((long)sprite[i].yoffset);
|
||||
case 11: return((long)sprite[i].picnum);
|
||||
case 12: return((long)sprite[i].ang);
|
||||
case 13: return((long)sprite[i].xvel);
|
||||
case 14: return((long)sprite[i].yvel);
|
||||
case 15: return((long)sprite[i].zvel);
|
||||
case 16: return((long)sprite[i].owner);
|
||||
case 17: return((long)sprite[i].sectnum);
|
||||
case 18: return((long)sprite[i].statnum);
|
||||
case 19: return((long)sprite[i].lotag);
|
||||
case 20: return((long)sprite[i].hitag);
|
||||
case 21: return((long)sprite[i].extra);
|
||||
case 0: return((int)sprite[i].x);
|
||||
case 1: return((int)sprite[i].y);
|
||||
case 2: return((int)sprite[i].z);
|
||||
case 3: return((int)sprite[i].cstat);
|
||||
case 4: return((int)sprite[i].shade);
|
||||
case 5: return((int)sprite[i].pal);
|
||||
case 6: return((int)sprite[i].clipdist);
|
||||
case 7: return((int)sprite[i].xrepeat);
|
||||
case 8: return((int)sprite[i].yrepeat);
|
||||
case 9: return((int)sprite[i].xoffset);
|
||||
case 10: return((int)sprite[i].yoffset);
|
||||
case 11: return((int)sprite[i].picnum);
|
||||
case 12: return((int)sprite[i].ang);
|
||||
case 13: return((int)sprite[i].xvel);
|
||||
case 14: return((int)sprite[i].yvel);
|
||||
case 15: return((int)sprite[i].zvel);
|
||||
case 16: return((int)sprite[i].owner);
|
||||
case 17: return((int)sprite[i].sectnum);
|
||||
case 18: return((int)sprite[i].statnum);
|
||||
case 19: return((int)sprite[i].lotag);
|
||||
case 20: return((int)sprite[i].hitag);
|
||||
case 21: return((int)sprite[i].extra);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
void setspritefield(long i, long fieldnum, long newval)
|
||||
void setspritefield(int i, int fieldnum, int newval)
|
||||
{
|
||||
switch(fieldnum)
|
||||
{
|
||||
|
@ -789,32 +789,32 @@ void setspritefield(long i, long fieldnum, long newval)
|
|||
}
|
||||
}
|
||||
|
||||
long getwallfield(long i, long fieldnum)
|
||||
int getwallfield(int i, int fieldnum)
|
||||
{
|
||||
switch(fieldnum)
|
||||
{
|
||||
case 64: return((long)wall[i].x);
|
||||
case 65: return((long)wall[i].y);
|
||||
case 66: return((long)wall[i].point2);
|
||||
case 67: return((long)wall[i].nextsector);
|
||||
case 68: return((long)wall[i].nextwall);
|
||||
case 69: return((long)wall[i].picnum);
|
||||
case 70: return((long)wall[i].overpicnum);
|
||||
case 71: return((long)wall[i].shade);
|
||||
case 72: return((long)wall[i].pal);
|
||||
case 73: return((long)wall[i].cstat);
|
||||
case 74: return((long)wall[i].xrepeat);
|
||||
case 75: return((long)wall[i].yrepeat);
|
||||
case 76: return((long)wall[i].xpanning);
|
||||
case 77: return((long)wall[i].ypanning);
|
||||
case 78: return((long)wall[i].lotag);
|
||||
case 79: return((long)wall[i].hitag);
|
||||
case 80: return((long)wall[i].extra);
|
||||
case 64: return((int)wall[i].x);
|
||||
case 65: return((int)wall[i].y);
|
||||
case 66: return((int)wall[i].point2);
|
||||
case 67: return((int)wall[i].nextsector);
|
||||
case 68: return((int)wall[i].nextwall);
|
||||
case 69: return((int)wall[i].picnum);
|
||||
case 70: return((int)wall[i].overpicnum);
|
||||
case 71: return((int)wall[i].shade);
|
||||
case 72: return((int)wall[i].pal);
|
||||
case 73: return((int)wall[i].cstat);
|
||||
case 74: return((int)wall[i].xrepeat);
|
||||
case 75: return((int)wall[i].yrepeat);
|
||||
case 76: return((int)wall[i].xpanning);
|
||||
case 77: return((int)wall[i].ypanning);
|
||||
case 78: return((int)wall[i].lotag);
|
||||
case 79: return((int)wall[i].hitag);
|
||||
case 80: return((int)wall[i].extra);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
void setwallfield(long i, long fieldnum, long newval)
|
||||
void setwallfield(int i, int fieldnum, int newval)
|
||||
{
|
||||
switch(fieldnum)
|
||||
{
|
||||
|
@ -838,37 +838,37 @@ void setwallfield(long i, long fieldnum, long newval)
|
|||
}
|
||||
}
|
||||
|
||||
long getsectorfield(long i, long fieldnum)
|
||||
int getsectorfield(int i, int fieldnum)
|
||||
{
|
||||
switch(fieldnum)
|
||||
{
|
||||
case 32: return((long)sector[i].wallptr);
|
||||
case 33: return((long)sector[i].wallnum);
|
||||
case 34: return((long)sector[i].ceilingpicnum);
|
||||
case 35: return((long)sector[i].floorpicnum);
|
||||
case 36: return((long)sector[i].ceilingheinum);
|
||||
case 37: return((long)sector[i].floorheinum);
|
||||
case 38: return((long)sector[i].ceilingz);
|
||||
case 39: return((long)sector[i].floorz);
|
||||
case 40: return((long)sector[i].ceilingshade);
|
||||
case 41: return((long)sector[i].floorshade);
|
||||
case 42: return((long)sector[i].ceilingxpanning);
|
||||
case 43: return((long)sector[i].floorxpanning);
|
||||
case 44: return((long)sector[i].ceilingypanning);
|
||||
case 45: return((long)sector[i].floorypanning);
|
||||
case 46: return((long)sector[i].ceilingstat);
|
||||
case 47: return((long)sector[i].floorstat);
|
||||
case 48: return((long)sector[i].ceilingpal);
|
||||
case 49: return((long)sector[i].floorpal);
|
||||
case 50: return((long)sector[i].visibility);
|
||||
case 51: return((long)sector[i].lotag);
|
||||
case 52: return((long)sector[i].hitag);
|
||||
case 53: return((long)sector[i].extra);
|
||||
case 32: return((int)sector[i].wallptr);
|
||||
case 33: return((int)sector[i].wallnum);
|
||||
case 34: return((int)sector[i].ceilingpicnum);
|
||||
case 35: return((int)sector[i].floorpicnum);
|
||||
case 36: return((int)sector[i].ceilingheinum);
|
||||
case 37: return((int)sector[i].floorheinum);
|
||||
case 38: return((int)sector[i].ceilingz);
|
||||
case 39: return((int)sector[i].floorz);
|
||||
case 40: return((int)sector[i].ceilingshade);
|
||||
case 41: return((int)sector[i].floorshade);
|
||||
case 42: return((int)sector[i].ceilingxpanning);
|
||||
case 43: return((int)sector[i].floorxpanning);
|
||||
case 44: return((int)sector[i].ceilingypanning);
|
||||
case 45: return((int)sector[i].floorypanning);
|
||||
case 46: return((int)sector[i].ceilingstat);
|
||||
case 47: return((int)sector[i].floorstat);
|
||||
case 48: return((int)sector[i].ceilingpal);
|
||||
case 49: return((int)sector[i].floorpal);
|
||||
case 50: return((int)sector[i].visibility);
|
||||
case 51: return((int)sector[i].lotag);
|
||||
case 52: return((int)sector[i].hitag);
|
||||
case 53: return((int)sector[i].extra);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
void setsectorfield(long i, long fieldnum, long newval)
|
||||
void setsectorfield(int i, int fieldnum, int newval)
|
||||
{
|
||||
switch(fieldnum)
|
||||
{
|
||||
|
@ -897,9 +897,9 @@ void setsectorfield(long i, long fieldnum, long newval)
|
|||
}
|
||||
}
|
||||
|
||||
long getwadindex(char *nam)
|
||||
int getwadindex(char *nam)
|
||||
{
|
||||
long i, j;
|
||||
int i, j;
|
||||
|
||||
i = 0;
|
||||
for(j=2048;j>0;j>>=1)
|
||||
|
@ -913,13 +913,13 @@ int main(int argc, char **argv)
|
|||
{
|
||||
char argstring[5][80];
|
||||
char iwadfil[80], pwadfil[80], doommap[16], buildmap[16], picstr[16];
|
||||
long w, numwads, numtexts, startnumtexts, danumtexts, numpnames;
|
||||
long x, y, z, zz, zzz, zzx, zx, cx, cy, gap, p, pp, i, j, k, l, offs;
|
||||
long dnumpoints, dnumlines, dnumsides, dnumsectors, dnumthings, good;
|
||||
long minx, maxx, miny, maxy, numsectors, numwalls, wadtype;
|
||||
long startnumwalls, l1, l2, startpoint2, dapoint2, area;
|
||||
long fil, ifil, pfil, x1, y1, x2, y2, startwall, endwall;
|
||||
long mapversion, posx, posy, posz, templong, cnt, boardwadindex;
|
||||
int w, numwads, numtexts, startnumtexts, danumtexts, numpnames;
|
||||
int x, y, z, zz, zzz, zzx, zx, cx, cy, gap, p, pp, i, j, k, l, offs;
|
||||
int dnumpoints, dnumlines, dnumsides, dnumsectors, dnumthings, good;
|
||||
int minx, maxx, miny, maxy, numsectors, numwalls, wadtype;
|
||||
int startnumwalls, l1, l2, startpoint2, dapoint2, area;
|
||||
int fil, ifil, pfil, x1, y1, x2, y2, startwall, endwall;
|
||||
int mapversion, posx, posy, posz, tempint, cnt, boardwadindex;
|
||||
short ang, cursectnum;
|
||||
|
||||
printf("Wad2Map! Copyright 1995 by Ken Silverman\n");
|
||||
|
@ -991,9 +991,9 @@ int main(int argc, char **argv)
|
|||
{
|
||||
if ((z&1023) == 0) Bread(ifil,tempbuf,16384);
|
||||
zz = ((z&1023)<<4);
|
||||
iwadplc[z] = ((long)tempbuf[zz]) + (((long)tempbuf[zz+1])<<8) + (((long)tempbuf[zz+2])<<16) + (((long)tempbuf[zz+3])<<24);
|
||||
iwadplc[z] = ((int)tempbuf[zz]) + (((int)tempbuf[zz+1])<<8) + (((int)tempbuf[zz+2])<<16) + (((int)tempbuf[zz+3])<<24);
|
||||
zz += 4;
|
||||
iwadlen[z] = ((long)tempbuf[zz]) + (((long)tempbuf[zz+1])<<8) + (((long)tempbuf[zz+2])<<16) + (((long)tempbuf[zz+3])<<24);
|
||||
iwadlen[z] = ((int)tempbuf[zz]) + (((int)tempbuf[zz+1])<<8) + (((int)tempbuf[zz+2])<<16) + (((int)tempbuf[zz+3])<<24);
|
||||
zz += 4;
|
||||
iwadata[z][0] = tempbuf[zz+0]; iwadata[z][1] = tempbuf[zz+1];
|
||||
iwadata[z][2] = tempbuf[zz+2]; iwadata[z][3] = tempbuf[zz+3];
|
||||
|
@ -1023,9 +1023,9 @@ int main(int argc, char **argv)
|
|||
{
|
||||
if ((z&1023) == 0) Bread(ifil,tempbuf,16384);
|
||||
zz = ((z&1023)<<4);
|
||||
pwadplc[z] = ((long)tempbuf[zz]) + (((long)tempbuf[zz+1])<<8) + (((long)tempbuf[zz+2])<<16) + (((long)tempbuf[zz+3])<<24);
|
||||
pwadplc[z] = ((int)tempbuf[zz]) + (((int)tempbuf[zz+1])<<8) + (((int)tempbuf[zz+2])<<16) + (((int)tempbuf[zz+3])<<24);
|
||||
zz += 4;
|
||||
pwadlen[z] = ((long)tempbuf[zz]) + (((long)tempbuf[zz+1])<<8) + (((long)tempbuf[zz+2])<<16) + (((long)tempbuf[zz+3])<<24);
|
||||
pwadlen[z] = ((int)tempbuf[zz]) + (((int)tempbuf[zz+1])<<8) + (((int)tempbuf[zz+2])<<16) + (((int)tempbuf[zz+3])<<24);
|
||||
zz += 4;
|
||||
pwadata[z][0] = tempbuf[zz+0]; pwadata[z][1] = tempbuf[zz+1];
|
||||
pwadata[z][2] = tempbuf[zz+2]; pwadata[z][3] = tempbuf[zz+3];
|
||||
|
@ -1061,7 +1061,7 @@ int main(int argc, char **argv)
|
|||
{ printf("TEXTURE1 not found!\n"); exit(0); }
|
||||
Blseek(ifil,iwadplc[w],BSEEK_SET);
|
||||
Bread(ifil,&numtexts,4);
|
||||
Bread(ifil,textoffs,numtexts*sizeof(long));
|
||||
Bread(ifil,textoffs,numtexts*sizeof(int));
|
||||
for(z=0;z<numtexts;z++)
|
||||
{
|
||||
Blseek(ifil,iwadplc[w]+textoffs[z],BSEEK_SET);
|
||||
|
@ -1071,7 +1071,7 @@ int main(int argc, char **argv)
|
|||
textname[z][4] = tempbuf[4]; textname[z][5] = tempbuf[5];
|
||||
textname[z][6] = tempbuf[6]; textname[z][7] = tempbuf[7];
|
||||
textname[z][8] = 0;
|
||||
textpname[z] = ((long)tempbuf[26]) + (((long)tempbuf[27])<<8);
|
||||
textpname[z] = ((int)tempbuf[26]) + (((int)tempbuf[27])<<8);
|
||||
}
|
||||
|
||||
if ((w = getwadindex("TEXTURE2")) >= 0)
|
||||
|
@ -1079,7 +1079,7 @@ int main(int argc, char **argv)
|
|||
Blseek(ifil,iwadplc[w],BSEEK_SET);
|
||||
startnumtexts = numtexts;
|
||||
Bread(ifil,&danumtexts,4); numtexts += danumtexts;
|
||||
Bread(ifil,&textoffs[startnumtexts],(numtexts-startnumtexts)*sizeof(long));
|
||||
Bread(ifil,&textoffs[startnumtexts],(numtexts-startnumtexts)*sizeof(int));
|
||||
for(z=startnumtexts;z<numtexts;z++)
|
||||
{
|
||||
Blseek(ifil,iwadplc[w]+textoffs[z],BSEEK_SET);
|
||||
|
@ -1089,7 +1089,7 @@ int main(int argc, char **argv)
|
|||
textname[z][4] = tempbuf[4]; textname[z][5] = tempbuf[5];
|
||||
textname[z][6] = tempbuf[6]; textname[z][7] = tempbuf[7];
|
||||
textname[z][8] = 0;
|
||||
textpname[z] = ((long)tempbuf[26]) + (((long)tempbuf[27])<<8);
|
||||
textpname[z] = ((int)tempbuf[26]) + (((int)tempbuf[27])<<8);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1312,8 +1312,8 @@ int main(int argc, char **argv)
|
|||
|
||||
for(z=0;z<numwalls;z++)
|
||||
{
|
||||
wall[z].x = (((long)wx[z]-cx)<<4);
|
||||
wall[z].y = (((long)wy[z]-cy)<<4);
|
||||
wall[z].x = (((int)wx[z]-cx)<<4);
|
||||
wall[z].y = (((int)wy[z]-cy)<<4);
|
||||
wall[z].point2 = point2[z];
|
||||
|
||||
wall[z].nextwall = -1;
|
||||
|
@ -1376,8 +1376,8 @@ int main(int argc, char **argv)
|
|||
|
||||
for(z=0;z<dnumthings;z++)
|
||||
{
|
||||
sprite[z].x = (((long)thing[z].x-cx)<<4);
|
||||
sprite[z].y = (((long)-thing[z].y-cy)<<4);
|
||||
sprite[z].x = (((int)thing[z].x-cx)<<4);
|
||||
sprite[z].y = (((int)-thing[z].y-cy)<<4);
|
||||
|
||||
sprite[z].sectnum = 0;
|
||||
for(zz=0;zz<dnumsectors;zz++)
|
||||
|
@ -1569,8 +1569,8 @@ int main(int argc, char **argv)
|
|||
for(i=0;i<dnumthings;i++)
|
||||
if (thing[i].type == 1)
|
||||
{
|
||||
posx = (((long)thing[i].x-cx)<<4);
|
||||
posy = (((long)-thing[i].y-cy)<<4);
|
||||
posx = (((int)thing[i].x-cx)<<4);
|
||||
posy = (((int)-thing[i].y-cy)<<4);
|
||||
|
||||
cursectnum = 0;
|
||||
for(zz=0;zz<dnumsectors;zz++)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -23,19 +23,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
//-------------------------------------------------------------------------
|
||||
#include "duke3d.h"
|
||||
|
||||
extern long numenvsnds;
|
||||
extern int numenvsnds;
|
||||
extern int actor_tog;
|
||||
|
||||
void updateinterpolations() //Stick at beginning of domovethings
|
||||
{
|
||||
long i=numinterpolations-1;
|
||||
int i=numinterpolations-1;
|
||||
|
||||
for (;i>=0;i--) oldipos[i] = *curipos[i];
|
||||
}
|
||||
|
||||
void setinterpolation(long *posptr)
|
||||
void setinterpolation(int *posptr)
|
||||
{
|
||||
long i;
|
||||
int i;
|
||||
|
||||
if (numinterpolations >= MAXINTERPOLATIONS) return;
|
||||
for (i=numinterpolations-1;i>=0;i--)
|
||||
|
@ -45,9 +45,9 @@ void setinterpolation(long *posptr)
|
|||
numinterpolations++;
|
||||
}
|
||||
|
||||
void stopinterpolation(long *posptr)
|
||||
void stopinterpolation(int *posptr)
|
||||
{
|
||||
long i;
|
||||
int i;
|
||||
|
||||
for (i=numinterpolations-1;i>=startofdynamicinterpolations;i--)
|
||||
if (curipos[i] == posptr)
|
||||
|
@ -59,9 +59,9 @@ void stopinterpolation(long *posptr)
|
|||
}
|
||||
}
|
||||
|
||||
void dointerpolations(long smoothratio) //Stick at beginning of drawscreen
|
||||
void dointerpolations(int smoothratio) //Stick at beginning of drawscreen
|
||||
{
|
||||
long i=numinterpolations-1, j = 0, odelta, ndelta = 0;
|
||||
int i=numinterpolations-1, j = 0, odelta, ndelta = 0;
|
||||
|
||||
for (;i>=0;i--)
|
||||
{
|
||||
|
@ -75,19 +75,19 @@ void dointerpolations(long smoothratio) //Stick at beginning of drawscreen
|
|||
|
||||
void restoreinterpolations() //Stick at end of drawscreen
|
||||
{
|
||||
long i=numinterpolations-1;
|
||||
int i=numinterpolations-1;
|
||||
|
||||
for (;i>=0;i--) *curipos[i] = bakipos[i];
|
||||
}
|
||||
|
||||
long ceilingspace(int sectnum)
|
||||
int ceilingspace(int sectnum)
|
||||
{
|
||||
if ((sector[sectnum].ceilingstat&1) && sector[sectnum].ceilingpal == 0 && (sector[sectnum].ceilingpicnum==MOONSKY1 || sector[sectnum].ceilingpicnum==BIGORBIT1))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
long floorspace(int sectnum)
|
||||
int floorspace(int sectnum)
|
||||
{
|
||||
if ((sector[sectnum].floorstat&1) && sector[sectnum].ceilingpal == 0)
|
||||
{
|
||||
|
@ -276,12 +276,12 @@ void checkavailweapon(player_struct *p)
|
|||
else p->weapon_pos = -1;
|
||||
}
|
||||
|
||||
void hitradius(int i, long r, long hp1, long hp2, long hp3, long hp4)
|
||||
void hitradius(int i, int r, int hp1, int hp2, int hp3, int hp4)
|
||||
{
|
||||
spritetype *s=&sprite[i],*sj;
|
||||
walltype *wal;
|
||||
long d, q, x1, y1;
|
||||
long sectcnt, sectend, dasect, startwall, endwall, nextsect;
|
||||
int d, q, x1, y1;
|
||||
int sectcnt, sectend, dasect, startwall, endwall, nextsect;
|
||||
int j,k,p,x,nextj;
|
||||
short sect=-1;
|
||||
char statlist[] = {0,1,6,10,12,2,5};
|
||||
|
@ -458,9 +458,9 @@ BOLT:
|
|||
}
|
||||
}
|
||||
|
||||
int movesprite(int spritenum, long xchange, long ychange, long zchange, unsigned long cliptype)
|
||||
int movesprite(int spritenum, int xchange, int ychange, int zchange, unsigned int cliptype)
|
||||
{
|
||||
long daz, oldx, oldy;
|
||||
int daz, oldx, oldy;
|
||||
int retval;
|
||||
short dasectnum, cd;
|
||||
int bg = badguy(&sprite[spritenum]);
|
||||
|
@ -525,7 +525,7 @@ int movesprite(int spritenum, long xchange, long ychange, long zchange, unsigned
|
|||
clipmove(&sprite[spritenum].x,&sprite[spritenum].y,&daz,&dasectnum,((xchange*TICSPERFRAME)<<11),((ychange*TICSPERFRAME)<<11),8L,(4<<8),(4<<8),cliptype);
|
||||
else
|
||||
retval =
|
||||
clipmove(&sprite[spritenum].x,&sprite[spritenum].y,&daz,&dasectnum,((xchange*TICSPERFRAME)<<11),((ychange*TICSPERFRAME)<<11),(long)(sprite[spritenum].clipdist<<2),(4<<8),(4<<8),cliptype);
|
||||
clipmove(&sprite[spritenum].x,&sprite[spritenum].y,&daz,&dasectnum,((xchange*TICSPERFRAME)<<11),((ychange*TICSPERFRAME)<<11),(int)(sprite[spritenum].clipdist<<2),(4<<8),(4<<8),cliptype);
|
||||
}
|
||||
|
||||
if (dasectnum >= 0)
|
||||
|
@ -541,10 +541,10 @@ int movesprite(int spritenum, long xchange, long ychange, long zchange, unsigned
|
|||
return(retval);
|
||||
}
|
||||
|
||||
int ssp(int i,unsigned long cliptype) //The set sprite function
|
||||
int ssp(int i,unsigned int cliptype) //The set sprite function
|
||||
{
|
||||
spritetype *s= &sprite[i];
|
||||
long movetype;
|
||||
int movetype;
|
||||
|
||||
movetype = movesprite(i,
|
||||
(s->xvel*(sintable[(s->ang+512)&2047]))>>14,
|
||||
|
@ -605,7 +605,7 @@ void lotsofpaper(int sp, int n)
|
|||
|
||||
void guts(int sp, int gtype, int n, int p)
|
||||
{
|
||||
long gutz,floorz;
|
||||
int gutz,floorz;
|
||||
int i,a,j,sx,sy,pal;
|
||||
spritetype *s = &sprite[sp];
|
||||
|
||||
|
@ -642,7 +642,7 @@ void guts(int sp, int gtype, int n, int p)
|
|||
|
||||
void gutsdir(int sp, int gtype, int n, int p)
|
||||
{
|
||||
long gutz,floorz;
|
||||
int gutz,floorz;
|
||||
int i,a,j,sx,sy;
|
||||
spritetype *s = &sprite[sp];
|
||||
|
||||
|
@ -706,9 +706,9 @@ static void ms(int i)
|
|||
{
|
||||
//T1,T2 and T3 are used for all the sector moving stuff!!!
|
||||
|
||||
long tx,ty;
|
||||
int tx,ty;
|
||||
spritetype *s = &sprite[i];
|
||||
long j = T2, k = T3;
|
||||
int j = T2, k = T3;
|
||||
|
||||
s->x += (s->xvel*(sintable[(s->ang+512)&2047]))>>14;
|
||||
s->y += (s->xvel*(sintable[s->ang&2047]))>>14;
|
||||
|
@ -728,7 +728,7 @@ static void ms(int i)
|
|||
|
||||
static void movefta(void)
|
||||
{
|
||||
long x, px, py, sx, sy;
|
||||
int x, px, py, sx, sy;
|
||||
int i = headspritestat[2], j, p, nexti;
|
||||
short psect, ssect;
|
||||
spritetype *s;
|
||||
|
@ -1019,7 +1019,7 @@ int otherp;
|
|||
static void moveplayers(void) //Players
|
||||
{
|
||||
int i = headspritestat[10], nexti;
|
||||
long otherx;
|
||||
int otherx;
|
||||
spritetype *s;
|
||||
player_struct *p;
|
||||
|
||||
|
@ -1154,7 +1154,7 @@ BOLT:
|
|||
static void movefx(void)
|
||||
{
|
||||
int i = headspritestat[11], j, nexti, p;
|
||||
long x, ht;
|
||||
int x, ht;
|
||||
spritetype *s;
|
||||
|
||||
while (i >= 0)
|
||||
|
@ -1254,7 +1254,7 @@ static void movefallers(void)
|
|||
{
|
||||
int i = headspritestat[12], nexti, sect, j;
|
||||
spritetype *s;
|
||||
long x;
|
||||
int x;
|
||||
|
||||
while (i >= 0)
|
||||
{
|
||||
|
@ -1350,7 +1350,7 @@ BOLT:
|
|||
static void movestandables(void)
|
||||
{
|
||||
int i = headspritestat[6], j, k, nexti, nextj, p=0, sect, switchpicnum;
|
||||
long l=0, x, *t;
|
||||
int l=0, x, *t;
|
||||
spritetype *s;
|
||||
short m;
|
||||
|
||||
|
@ -1617,7 +1617,7 @@ static void movestandables(void)
|
|||
|
||||
if (s->picnum == TRIPBOMB)
|
||||
{
|
||||
// long lTripBombControl=GetGameVar("TRIPBOMB_CONTROL", TRIPBOMB_TRIPWIRE, -1, -1);
|
||||
// int lTripBombControl=GetGameVar("TRIPBOMB_CONTROL", TRIPBOMB_TRIPWIRE, -1, -1);
|
||||
// if(lTripBombControl & TRIPBOMB_TIMER)
|
||||
if (hittype[i].temp_data[6] == 1)
|
||||
{
|
||||
|
@ -2294,11 +2294,11 @@ BOLT:
|
|||
|
||||
static void bounce(int i)
|
||||
{
|
||||
long daang, dax, day, daz, xvect, yvect, zvect;
|
||||
int daang, dax, day, daz, xvect, yvect, zvect;
|
||||
spritetype *s = &sprite[i];
|
||||
int hitsect = s->sectnum;
|
||||
long k = sector[hitsect].wallptr;
|
||||
long l = wall[k].point2;
|
||||
int k = sector[hitsect].wallptr;
|
||||
int l = wall[k].point2;
|
||||
|
||||
xvect = mulscale10(s->xvel,sintable[(s->ang+512)&2047]);
|
||||
yvect = mulscale10(s->xvel,sintable[s->ang&2047]);
|
||||
|
@ -2333,8 +2333,8 @@ static void bounce(int i)
|
|||
static void moveweapons(void)
|
||||
{
|
||||
int i = headspritestat[4], j=0, k, f, nexti, p, q;
|
||||
long dax,day,daz, x, ll;
|
||||
unsigned long qq;
|
||||
int dax,day,daz, x, ll;
|
||||
unsigned int qq;
|
||||
spritetype *s;
|
||||
|
||||
while (i >= 0)
|
||||
|
@ -3117,7 +3117,7 @@ static void movetransports(void)
|
|||
{
|
||||
int warpspriteto;
|
||||
int i = headspritestat[9], j, k, l, p, sect, sectlotag, nexti, nextj;
|
||||
long ll,onfloorz,q;
|
||||
int ll,onfloorz,q;
|
||||
|
||||
while (i >= 0)
|
||||
{
|
||||
|
@ -3459,7 +3459,7 @@ static short LocateTheLocator(int n,int sn)
|
|||
|
||||
static void moveactors(void)
|
||||
{
|
||||
long x, m, l, *t;
|
||||
int x, m, l, *t;
|
||||
int a, j, nexti, nextj, sect, p, switchpicnum, k;
|
||||
spritetype *s;
|
||||
int i = headspritestat[1];
|
||||
|
@ -4434,7 +4434,7 @@ static void moveactors(void)
|
|||
s->xvel >>= 1;
|
||||
}
|
||||
|
||||
// long lPipeBombControl=GetGameVar("PIPEBOMB_CONTROL", PIPEBOMB_REMOTE, -1, -1);
|
||||
// int lPipeBombControl=GetGameVar("PIPEBOMB_CONTROL", PIPEBOMB_REMOTE, -1, -1);
|
||||
|
||||
DETONATEB:
|
||||
|
||||
|
@ -4786,7 +4786,7 @@ BOLT:
|
|||
static void moveexplosions(void) // STATNUM 5
|
||||
{
|
||||
short i, j, nexti, sect, p;
|
||||
long l, x, *t;
|
||||
int l, x, *t;
|
||||
spritetype *s;
|
||||
int switchpicnum;
|
||||
|
||||
|
@ -5349,7 +5349,7 @@ BOLT:
|
|||
|
||||
static void moveeffectors(void) //STATNUM 3
|
||||
{
|
||||
long q=0, l, m, x, st, j, *t;
|
||||
int q=0, l, m, x, st, j, *t;
|
||||
int i = headspritestat[3], nexti, nextk, p, sh, nextj;
|
||||
short k;
|
||||
spritetype *s;
|
||||
|
@ -5373,7 +5373,7 @@ static void moveeffectors(void) //STATNUM 3
|
|||
{
|
||||
case 0:
|
||||
{
|
||||
long zchange = 0;
|
||||
int zchange = 0;
|
||||
|
||||
zchange = 0;
|
||||
|
||||
|
@ -5588,7 +5588,7 @@ static void moveeffectors(void) //STATNUM 3
|
|||
|
||||
if (s->owner == -1)
|
||||
{
|
||||
Bsprintf(tempbuf,"Could not find any locators for SE# 6 and 14 with a hitag of %ld.\n",t[3]);
|
||||
Bsprintf(tempbuf,"Could not find any locators for SE# 6 and 14 with a hitag of %d.\n",t[3]);
|
||||
gameexit(tempbuf);
|
||||
}
|
||||
|
||||
|
@ -6901,23 +6901,23 @@ static void moveeffectors(void) //STATNUM 3
|
|||
if (t[0] == 0) break;
|
||||
|
||||
if (s->ang == 1536)
|
||||
l = (long) &sc->ceilingz;
|
||||
l = (int) &sc->ceilingz;
|
||||
else
|
||||
l = (long) &sc->floorz;
|
||||
l = (int) &sc->floorz;
|
||||
|
||||
if (t[0] == 1) //Decide if the s->sectnum should go up or down
|
||||
{
|
||||
s->zvel = ksgn(s->z-*(long *)l) * (SP<<4);
|
||||
s->zvel = ksgn(s->z-*(int *)l) * (SP<<4);
|
||||
t[0]++;
|
||||
}
|
||||
|
||||
if (sc->extra == 0)
|
||||
{
|
||||
*(long *)l += s->zvel;
|
||||
*(int *)l += s->zvel;
|
||||
|
||||
if (klabs(*(long *)l-s->z) < 1024)
|
||||
if (klabs(*(int *)l-s->z) < 1024)
|
||||
{
|
||||
*(long *)l = s->z;
|
||||
*(int *)l = s->z;
|
||||
KILLIT(i); //All done
|
||||
}
|
||||
}
|
||||
|
@ -7150,7 +7150,7 @@ static void moveeffectors(void) //STATNUM 3
|
|||
{
|
||||
if (cansee(s->x,s->y,s->z,SECT,g_player[p].ps->posx,g_player[p].ps->posy,g_player[p].ps->posz,g_player[p].ps->cursectnum))
|
||||
{
|
||||
if (x < (long)((unsigned)sh))
|
||||
if (x < (int)((unsigned)sh))
|
||||
{
|
||||
ud.camerasprite = i;
|
||||
t[0] = 999;
|
||||
|
@ -7270,7 +7270,7 @@ static void moveeffectors(void) //STATNUM 3
|
|||
break;
|
||||
case 29:
|
||||
s->hitag += 64;
|
||||
l = mulscale12((long)s->yvel,sintable[s->hitag&2047]);
|
||||
l = mulscale12((int)s->yvel,sintable[s->hitag&2047]);
|
||||
sc->floorz = s->z + l;
|
||||
break;
|
||||
case 31: // True Drop Floor
|
||||
|
@ -7596,7 +7596,7 @@ void moveobjects(void)
|
|||
while (i >= 0)
|
||||
{
|
||||
int p, j = nextspritestat[i];
|
||||
OnEvent(EVENT_GAME,i, findplayer(&sprite[i],(long *)&p), p);
|
||||
OnEvent(EVENT_GAME,i, findplayer(&sprite[i],(int *)&p), p);
|
||||
i = j;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "animlib.h"
|
||||
#include "mouse.h"
|
||||
|
||||
void endanimsounds(long fr)
|
||||
void endanimsounds(int fr)
|
||||
{
|
||||
switch (ud.volume_number)
|
||||
{
|
||||
|
@ -91,7 +91,7 @@ void endanimsounds(long fr)
|
|||
}
|
||||
}
|
||||
|
||||
void logoanimsounds(long fr)
|
||||
void logoanimsounds(int fr)
|
||||
{
|
||||
switch (fr)
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ void logoanimsounds(long fr)
|
|||
}
|
||||
}
|
||||
|
||||
void intro4animsounds(long fr)
|
||||
void intro4animsounds(int fr)
|
||||
{
|
||||
switch (fr)
|
||||
{
|
||||
|
@ -121,7 +121,7 @@ void intro4animsounds(long fr)
|
|||
}
|
||||
}
|
||||
|
||||
void first4animsounds(long fr)
|
||||
void first4animsounds(int fr)
|
||||
{
|
||||
switch (fr)
|
||||
{
|
||||
|
@ -140,7 +140,7 @@ void first4animsounds(long fr)
|
|||
}
|
||||
}
|
||||
|
||||
void intro42animsounds(long fr)
|
||||
void intro42animsounds(int fr)
|
||||
{
|
||||
switch (fr)
|
||||
{
|
||||
|
@ -150,7 +150,7 @@ void intro42animsounds(long fr)
|
|||
}
|
||||
}
|
||||
|
||||
void endanimvol41(long fr)
|
||||
void endanimvol41(int fr)
|
||||
{
|
||||
switch (fr)
|
||||
{
|
||||
|
@ -163,7 +163,7 @@ void endanimvol41(long fr)
|
|||
}
|
||||
}
|
||||
|
||||
void endanimvol42(long fr)
|
||||
void endanimvol42(int fr)
|
||||
{
|
||||
switch (fr)
|
||||
{
|
||||
|
@ -182,7 +182,7 @@ void endanimvol42(long fr)
|
|||
}
|
||||
}
|
||||
|
||||
void endanimvol43(long fr)
|
||||
void endanimvol43(int fr)
|
||||
{
|
||||
switch (fr)
|
||||
{
|
||||
|
@ -203,7 +203,7 @@ void playanm(const char *fn,char t)
|
|||
{
|
||||
char *animbuf;
|
||||
unsigned char *palptr;
|
||||
long i, j, length=0, numframes=0;
|
||||
int i, j, length=0, numframes=0;
|
||||
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||
int ogltexfiltermode=gltexfiltermode;
|
||||
#endif
|
||||
|
@ -226,7 +226,7 @@ void playanm(const char *fn,char t)
|
|||
|
||||
walock[TILE_ANIM] = 219+t;
|
||||
|
||||
allocache((long *)&animbuf,length,&walock[TILE_ANIM]);
|
||||
allocache((int *)&animbuf,length,&walock[TILE_ANIM]);
|
||||
|
||||
tilesizx[TILE_ANIM] = 200;
|
||||
tilesizy[TILE_ANIM] = 320;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -389,13 +389,13 @@ void CONFIG_SetupMouse(void)
|
|||
|
||||
for (i=0;i<MAXMOUSEBUTTONS;i++)
|
||||
{
|
||||
Bsprintf(str,"MouseButton%ld",i);
|
||||
Bsprintf(str,"MouseButton%d",i);
|
||||
temp[0] = 0;
|
||||
if (!SCRIPT_GetString(ud.config.scripthandle,"Controls", str,temp))
|
||||
if (CONFIG_FunctionNameToNum(temp) != -1 || (!temp[0] && CONFIG_FunctionNameToNum(temp) != -1))
|
||||
ud.config.MouseFunctions[i][0] = CONFIG_FunctionNameToNum(temp);
|
||||
|
||||
Bsprintf(str,"MouseButtonClicked%ld",i);
|
||||
Bsprintf(str,"MouseButtonClicked%d",i);
|
||||
temp[0] = 0;
|
||||
if (!SCRIPT_GetString(ud.config.scripthandle,"Controls", str,temp))
|
||||
if (CONFIG_FunctionNameToNum(temp) != -1 || (!temp[0] && CONFIG_FunctionNameToNum(temp) != -1))
|
||||
|
@ -405,25 +405,25 @@ void CONFIG_SetupMouse(void)
|
|||
// map over the axes
|
||||
for (i=0;i<MAXMOUSEAXES;i++)
|
||||
{
|
||||
Bsprintf(str,"MouseAnalogAxes%ld",i);
|
||||
Bsprintf(str,"MouseAnalogAxes%d",i);
|
||||
temp[0] = 0;
|
||||
if (!SCRIPT_GetString(ud.config.scripthandle, "Controls", str,temp))
|
||||
if (CONFIG_AnalogNameToNum(temp) != -1 || (!temp[0] && CONFIG_FunctionNameToNum(temp) != -1))
|
||||
ud.config.MouseAnalogueAxes[i] = CONFIG_AnalogNameToNum(temp);
|
||||
|
||||
Bsprintf(str,"MouseDigitalAxes%ld_0",i);
|
||||
Bsprintf(str,"MouseDigitalAxes%d_0",i);
|
||||
temp[0] = 0;
|
||||
if (!SCRIPT_GetString(ud.config.scripthandle, "Controls", str,temp))
|
||||
if (CONFIG_FunctionNameToNum(temp) != -1 || (!temp[0] && CONFIG_FunctionNameToNum(temp) != -1))
|
||||
ud.config.MouseDigitalFunctions[i][0] = CONFIG_FunctionNameToNum(temp);
|
||||
|
||||
Bsprintf(str,"MouseDigitalAxes%ld_1",i);
|
||||
Bsprintf(str,"MouseDigitalAxes%d_1",i);
|
||||
temp[0] = 0;
|
||||
if (!SCRIPT_GetString(ud.config.scripthandle, "Controls", str,temp))
|
||||
if (CONFIG_FunctionNameToNum(temp) != -1 || (!temp[0] && CONFIG_FunctionNameToNum(temp) != -1))
|
||||
ud.config.MouseDigitalFunctions[i][1] = CONFIG_FunctionNameToNum(temp);
|
||||
|
||||
Bsprintf(str,"MouseAnalogScale%ld",i);
|
||||
Bsprintf(str,"MouseAnalogScale%d",i);
|
||||
scale = ud.config.MouseAnalogueScale[i];
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls", str,&scale);
|
||||
ud.config.MouseAnalogueScale[i] = scale;
|
||||
|
@ -466,13 +466,13 @@ void CONFIG_SetupJoystick(void)
|
|||
|
||||
for (i=0;i<MAXJOYBUTTONS;i++)
|
||||
{
|
||||
Bsprintf(str,"JoystickButton%ld",i);
|
||||
Bsprintf(str,"JoystickButton%d",i);
|
||||
temp[0] = 0;
|
||||
if (!SCRIPT_GetString(ud.config.scripthandle,"Controls", str,temp))
|
||||
if (CONFIG_FunctionNameToNum(temp) != -1 || (!temp[0] && CONFIG_FunctionNameToNum(temp) != -1))
|
||||
ud.config.JoystickFunctions[i][0] = CONFIG_FunctionNameToNum(temp);
|
||||
|
||||
Bsprintf(str,"JoystickButtonClicked%ld",i);
|
||||
Bsprintf(str,"JoystickButtonClicked%d",i);
|
||||
temp[0] = 0;
|
||||
if (!SCRIPT_GetString(ud.config.scripthandle,"Controls", str,temp))
|
||||
if (CONFIG_FunctionNameToNum(temp) != -1 || (!temp[0] && CONFIG_FunctionNameToNum(temp) != -1))
|
||||
|
@ -482,35 +482,35 @@ void CONFIG_SetupJoystick(void)
|
|||
// map over the axes
|
||||
for (i=0;i<MAXJOYAXES;i++)
|
||||
{
|
||||
Bsprintf(str,"JoystickAnalogAxes%ld",i);
|
||||
Bsprintf(str,"JoystickAnalogAxes%d",i);
|
||||
temp[0] = 0;
|
||||
if (!SCRIPT_GetString(ud.config.scripthandle, "Controls", str,temp))
|
||||
if (CONFIG_AnalogNameToNum(temp) != -1 || (!temp[0] && CONFIG_FunctionNameToNum(temp) != -1))
|
||||
ud.config.JoystickAnalogueAxes[i] = CONFIG_AnalogNameToNum(temp);
|
||||
|
||||
Bsprintf(str,"JoystickDigitalAxes%ld_0",i);
|
||||
Bsprintf(str,"JoystickDigitalAxes%d_0",i);
|
||||
temp[0] = 0;
|
||||
if (!SCRIPT_GetString(ud.config.scripthandle, "Controls", str,temp))
|
||||
if (CONFIG_FunctionNameToNum(temp) != -1 || (!temp[0] && CONFIG_FunctionNameToNum(temp) != -1))
|
||||
ud.config.JoystickDigitalFunctions[i][0] = CONFIG_FunctionNameToNum(temp);
|
||||
|
||||
Bsprintf(str,"JoystickDigitalAxes%ld_1",i);
|
||||
Bsprintf(str,"JoystickDigitalAxes%d_1",i);
|
||||
temp[0] = 0;
|
||||
if (!SCRIPT_GetString(ud.config.scripthandle, "Controls", str,temp))
|
||||
if (CONFIG_FunctionNameToNum(temp) != -1 || (!temp[0] && CONFIG_FunctionNameToNum(temp) != -1))
|
||||
ud.config.JoystickDigitalFunctions[i][1] = CONFIG_FunctionNameToNum(temp);
|
||||
|
||||
Bsprintf(str,"JoystickAnalogScale%ld",i);
|
||||
Bsprintf(str,"JoystickAnalogScale%d",i);
|
||||
scale = ud.config.JoystickAnalogueScale[i];
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls", str,&scale);
|
||||
ud.config.JoystickAnalogueScale[i] = scale;
|
||||
|
||||
Bsprintf(str,"JoystickAnalogDead%ld",i);
|
||||
Bsprintf(str,"JoystickAnalogDead%d",i);
|
||||
scale = ud.config.JoystickAnalogueDead[i];
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls", str,&scale);
|
||||
ud.config.JoystickAnalogueDead[i] = scale;
|
||||
|
||||
Bsprintf(str,"JoystickAnalogSaturate%ld",i);
|
||||
Bsprintf(str,"JoystickAnalogSaturate%d",i);
|
||||
scale = ud.config.JoystickAnalogueSaturate[i];
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Controls", str,&scale);
|
||||
ud.config.JoystickAnalogueSaturate[i] = scale;
|
||||
|
@ -675,7 +675,7 @@ int32 CONFIG_ReadSetup(void)
|
|||
if (!CommandWeaponChoice)
|
||||
for (i=0;i<10;i++)
|
||||
{
|
||||
Bsprintf(buf,"WeaponChoice%ld",i);
|
||||
Bsprintf(buf,"WeaponChoice%d",i);
|
||||
dummy = -1;
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", buf, &dummy);
|
||||
if (dummy >= 0) g_player[0].wchoice[i] = dummy;
|
||||
|
@ -746,7 +746,7 @@ void CONFIG_WriteSetup(void)
|
|||
if (ud.config.scripthandle < 0)
|
||||
ud.config.scripthandle = SCRIPT_Init(setupfilename);
|
||||
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","AimingFlag",(long) myaimmode,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","AimingFlag",(int) myaimmode,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","AutoAim",ud.config.AutoAim,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","MouseAimingFlipped",ud.mouseflip,false,false);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","MouseAiming",ud.mouseaiming,false,false);
|
||||
|
@ -855,32 +855,32 @@ void CONFIG_WriteSetup(void)
|
|||
|
||||
for (dummy=0;dummy<10;dummy++)
|
||||
{
|
||||
Bsprintf(buf,"WeaponChoice%ld",dummy);
|
||||
Bsprintf(buf,"WeaponChoice%d",dummy);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Misc",buf,g_player[myconnectindex].wchoice[dummy],false,false);
|
||||
}
|
||||
|
||||
for (dummy=0;dummy<MAXMOUSEBUTTONS;dummy++)
|
||||
{
|
||||
Bsprintf(buf,"MouseButton%ld",dummy);
|
||||
Bsprintf(buf,"MouseButton%d",dummy);
|
||||
SCRIPT_PutString(ud.config.scripthandle,"Controls", buf, CONFIG_FunctionNumToName(ud.config.MouseFunctions[dummy][0]));
|
||||
|
||||
if (dummy >= (MAXMOUSEBUTTONS-2)) continue;
|
||||
|
||||
Bsprintf(buf,"MouseButtonClicked%ld",dummy);
|
||||
Bsprintf(buf,"MouseButtonClicked%d",dummy);
|
||||
SCRIPT_PutString(ud.config.scripthandle,"Controls", buf, CONFIG_FunctionNumToName(ud.config.MouseFunctions[dummy][1]));
|
||||
}
|
||||
for (dummy=0;dummy<MAXMOUSEAXES;dummy++)
|
||||
{
|
||||
Bsprintf(buf,"MouseAnalogAxes%ld",dummy);
|
||||
Bsprintf(buf,"MouseAnalogAxes%d",dummy);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Controls", buf, CONFIG_AnalogNumToName(ud.config.MouseAnalogueAxes[dummy]));
|
||||
|
||||
Bsprintf(buf,"MouseDigitalAxes%ld_0",dummy);
|
||||
Bsprintf(buf,"MouseDigitalAxes%d_0",dummy);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Controls", buf, CONFIG_FunctionNumToName(ud.config.MouseDigitalFunctions[dummy][0]));
|
||||
|
||||
Bsprintf(buf,"MouseDigitalAxes%ld_1",dummy);
|
||||
Bsprintf(buf,"MouseDigitalAxes%d_1",dummy);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Controls", buf, CONFIG_FunctionNumToName(ud.config.MouseDigitalFunctions[dummy][1]));
|
||||
|
||||
Bsprintf(buf,"MouseAnalogScale%ld",dummy);
|
||||
Bsprintf(buf,"MouseAnalogScale%d",dummy);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls", buf, ud.config.MouseAnalogueScale[dummy], false, false);
|
||||
}
|
||||
dummy = CONTROL_GetMouseSensitivity();
|
||||
|
@ -888,30 +888,30 @@ void CONFIG_WriteSetup(void)
|
|||
|
||||
for (dummy=0;dummy<MAXJOYBUTTONS;dummy++)
|
||||
{
|
||||
Bsprintf(buf,"JoystickButton%ld",dummy);
|
||||
Bsprintf(buf,"JoystickButton%d",dummy);
|
||||
SCRIPT_PutString(ud.config.scripthandle,"Controls", buf, CONFIG_FunctionNumToName(ud.config.JoystickFunctions[dummy][0]));
|
||||
|
||||
Bsprintf(buf,"JoystickButtonClicked%ld",dummy);
|
||||
Bsprintf(buf,"JoystickButtonClicked%d",dummy);
|
||||
SCRIPT_PutString(ud.config.scripthandle,"Controls", buf, CONFIG_FunctionNumToName(ud.config.JoystickFunctions[dummy][1]));
|
||||
}
|
||||
for (dummy=0;dummy<MAXJOYAXES;dummy++)
|
||||
{
|
||||
Bsprintf(buf,"JoystickAnalogAxes%ld",dummy);
|
||||
Bsprintf(buf,"JoystickAnalogAxes%d",dummy);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Controls", buf, CONFIG_AnalogNumToName(ud.config.JoystickAnalogueAxes[dummy]));
|
||||
|
||||
Bsprintf(buf,"JoystickDigitalAxes%ld_0",dummy);
|
||||
Bsprintf(buf,"JoystickDigitalAxes%d_0",dummy);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Controls", buf, CONFIG_FunctionNumToName(ud.config.JoystickDigitalFunctions[dummy][0]));
|
||||
|
||||
Bsprintf(buf,"JoystickDigitalAxes%ld_1",dummy);
|
||||
Bsprintf(buf,"JoystickDigitalAxes%d_1",dummy);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Controls", buf, CONFIG_FunctionNumToName(ud.config.JoystickDigitalFunctions[dummy][1]));
|
||||
|
||||
Bsprintf(buf,"JoystickAnalogScale%ld",dummy);
|
||||
Bsprintf(buf,"JoystickAnalogScale%d",dummy);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls", buf, ud.config.JoystickAnalogueScale[dummy], false, false);
|
||||
|
||||
Bsprintf(buf,"JoystickAnalogDead%ld",dummy);
|
||||
Bsprintf(buf,"JoystickAnalogDead%d",dummy);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls", buf, ud.config.JoystickAnalogueDead[dummy], false, false);
|
||||
|
||||
Bsprintf(buf,"JoystickAnalogSaturate%ld",dummy);
|
||||
Bsprintf(buf,"JoystickAnalogSaturate%d",dummy);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Controls", buf, ud.config.JoystickAnalogueSaturate[dummy], false, false);
|
||||
}
|
||||
|
||||
|
|
|
@ -292,13 +292,13 @@ enum USRHOOKS_Errors {
|
|||
typedef struct {
|
||||
signed char avel, horz;
|
||||
short fvel, svel;
|
||||
unsigned long bits, extbits;
|
||||
unsigned int bits, extbits;
|
||||
} input;
|
||||
|
||||
#define sync dsync // JBF 20040604: sync is a function on some platforms
|
||||
extern input recsync[RECSYNCBUFSIZ];
|
||||
|
||||
extern long movefifosendplc;
|
||||
extern int movefifosendplc;
|
||||
|
||||
typedef struct {
|
||||
short i;
|
||||
|
@ -313,14 +313,14 @@ typedef struct {
|
|||
char *filename;
|
||||
short ps,pe,vo;
|
||||
char pr,m;
|
||||
long soundsiz;
|
||||
int soundsiz;
|
||||
} sound_t;
|
||||
|
||||
extern sound_t g_sounds[MAXSOUNDS];
|
||||
|
||||
typedef struct {
|
||||
short wallnum;
|
||||
long tag;
|
||||
int tag;
|
||||
} animwalltype;
|
||||
|
||||
extern animwalltype animwall[MAXANIMWALLS];
|
||||
|
@ -330,13 +330,13 @@ extern int probey;
|
|||
|
||||
extern char typebuflen,typebuf[141];
|
||||
extern char MusicPtr[72000*2];
|
||||
extern long msx[2048],msy[2048];
|
||||
extern int msx[2048],msy[2048];
|
||||
extern short cyclers[MAXCYCLERS][6],numcyclers;
|
||||
extern char myname[32];
|
||||
|
||||
struct savehead {
|
||||
char name[19];
|
||||
int32 numplr,volnum,levnum,plrskl;
|
||||
int numplr,volnum,levnum,plrskl;
|
||||
char boardfn[BMAX_PATH];
|
||||
};
|
||||
|
||||
|
@ -344,62 +344,62 @@ typedef struct {
|
|||
//
|
||||
// Sound variables
|
||||
//
|
||||
int32 FXDevice;
|
||||
int32 MusicDevice;
|
||||
int32 FXVolume;
|
||||
int32 MusicVolume;
|
||||
int32 SoundToggle;
|
||||
int32 MusicToggle;
|
||||
int32 VoiceToggle;
|
||||
int32 AmbienceToggle;
|
||||
int FXDevice;
|
||||
int MusicDevice;
|
||||
int FXVolume;
|
||||
int MusicVolume;
|
||||
int SoundToggle;
|
||||
int MusicToggle;
|
||||
int VoiceToggle;
|
||||
int AmbienceToggle;
|
||||
|
||||
int32 NumVoices;
|
||||
int32 NumChannels;
|
||||
int32 NumBits;
|
||||
int32 MixRate;
|
||||
int NumVoices;
|
||||
int NumChannels;
|
||||
int NumBits;
|
||||
int MixRate;
|
||||
|
||||
int32 ReverseStereo;
|
||||
int ReverseStereo;
|
||||
|
||||
int32 UseJoystick;
|
||||
int32 UseMouse;
|
||||
int32 RunMode;
|
||||
int32 AutoAim;
|
||||
int32 ShowOpponentWeapons;
|
||||
int32 MouseFilter,MouseBias;
|
||||
int32 SmoothInput;
|
||||
int UseJoystick;
|
||||
int UseMouse;
|
||||
int RunMode;
|
||||
int AutoAim;
|
||||
int ShowOpponentWeapons;
|
||||
int MouseFilter,MouseBias;
|
||||
int SmoothInput;
|
||||
|
||||
// JBF 20031211: Store the input settings because
|
||||
// (currently) jmact can't regurgitate them
|
||||
byte KeyboardKeys[NUMGAMEFUNCTIONS][2];
|
||||
int32 MouseFunctions[MAXMOUSEBUTTONS][2];
|
||||
int32 MouseDigitalFunctions[MAXMOUSEAXES][2];
|
||||
int32 MouseAnalogueAxes[MAXMOUSEAXES];
|
||||
int32 MouseAnalogueScale[MAXMOUSEAXES];
|
||||
int32 JoystickFunctions[MAXJOYBUTTONS][2];
|
||||
int32 JoystickDigitalFunctions[MAXJOYAXES][2];
|
||||
int32 JoystickAnalogueAxes[MAXJOYAXES];
|
||||
int32 JoystickAnalogueScale[MAXJOYAXES];
|
||||
int32 JoystickAnalogueDead[MAXJOYAXES];
|
||||
int32 JoystickAnalogueSaturate[MAXJOYAXES];
|
||||
int MouseFunctions[MAXMOUSEBUTTONS][2];
|
||||
int MouseDigitalFunctions[MAXMOUSEAXES][2];
|
||||
int MouseAnalogueAxes[MAXMOUSEAXES];
|
||||
int MouseAnalogueScale[MAXMOUSEAXES];
|
||||
int JoystickFunctions[MAXJOYBUTTONS][2];
|
||||
int JoystickDigitalFunctions[MAXJOYAXES][2];
|
||||
int JoystickAnalogueAxes[MAXJOYAXES];
|
||||
int JoystickAnalogueScale[MAXJOYAXES];
|
||||
int JoystickAnalogueDead[MAXJOYAXES];
|
||||
int JoystickAnalogueSaturate[MAXJOYAXES];
|
||||
|
||||
//
|
||||
// Screen variables
|
||||
//
|
||||
|
||||
int32 ScreenMode;
|
||||
int ScreenMode;
|
||||
|
||||
int32 ScreenWidth;
|
||||
int32 ScreenHeight;
|
||||
int32 ScreenBPP;
|
||||
int ScreenWidth;
|
||||
int ScreenHeight;
|
||||
int ScreenBPP;
|
||||
|
||||
int32 ForceSetup;
|
||||
int ForceSetup;
|
||||
|
||||
int32 scripthandle;
|
||||
int32 setupread;
|
||||
int scripthandle;
|
||||
int setupread;
|
||||
|
||||
int32 CheckForUpdates;
|
||||
int32 LastUpdateCheck;
|
||||
int32 useprecache;
|
||||
int CheckForUpdates;
|
||||
int LastUpdateCheck;
|
||||
int useprecache;
|
||||
} config_t;
|
||||
|
||||
typedef struct {
|
||||
|
@ -415,45 +415,45 @@ typedef struct {
|
|||
short last_level,secretlevel;
|
||||
|
||||
short cameraang, camerasect, camerahoriz;
|
||||
long camerax,cameray,cameraz;
|
||||
int camerax,cameray,cameraz;
|
||||
|
||||
long const_visibility,uw_framerate;
|
||||
long camera_time,folfvel,folavel,folx,foly,fola;
|
||||
long reccnt;
|
||||
int const_visibility,uw_framerate;
|
||||
int camera_time,folfvel,folavel,folx,foly,fola;
|
||||
int reccnt;
|
||||
|
||||
int32 runkey_mode,statusbarscale,mouseaiming,weaponswitch,drawweapon; // JBF 20031125
|
||||
int32 democams,color,msgdisptime,statusbarmode;
|
||||
int32 m_noexits,noexits,autovote,automsg,idplayers;
|
||||
int32 team, viewbob, weaponsway;
|
||||
int runkey_mode,statusbarscale,mouseaiming,weaponswitch,drawweapon; // JBF 20031125
|
||||
int democams,color,msgdisptime,statusbarmode;
|
||||
int m_noexits,noexits,autovote,automsg,idplayers;
|
||||
int team, viewbob, weaponsway;
|
||||
|
||||
int32 entered_name,screen_tilting,shadows,fta_on,executions,auto_run;
|
||||
int32 coords,tickrate,levelstats,m_coop,coop,screen_size,lockout,crosshair;
|
||||
int32 playerai,angleinterpolation,deathmsgs;
|
||||
int entered_name,screen_tilting,shadows,fta_on,executions,auto_run;
|
||||
int coords,tickrate,levelstats,m_coop,coop,screen_size,lockout,crosshair;
|
||||
int playerai,angleinterpolation,deathmsgs;
|
||||
|
||||
int32 respawn_monsters,respawn_items,respawn_inventory,recstat,monsters_off,brightness;
|
||||
int32 m_respawn_items,m_respawn_monsters,m_respawn_inventory,m_recstat,m_monsters_off,detail;
|
||||
int32 m_ffire,ffire,m_player_skill,m_level_number,m_volume_number,multimode;
|
||||
int32 player_skill,level_number,volume_number,m_marker,marker,mouseflip;
|
||||
int respawn_monsters,respawn_items,respawn_inventory,recstat,monsters_off,brightness;
|
||||
int m_respawn_items,m_respawn_monsters,m_respawn_inventory,m_recstat,m_monsters_off,detail;
|
||||
int m_ffire,ffire,m_player_skill,m_level_number,m_volume_number,multimode;
|
||||
int player_skill,level_number,volume_number,m_marker,marker,mouseflip;
|
||||
config_t config;
|
||||
} user_defs;
|
||||
|
||||
typedef struct {
|
||||
long ox,oy,oz;
|
||||
int ox,oy,oz;
|
||||
short oa,os;
|
||||
} playerspawn_t;
|
||||
|
||||
extern char numplayersprites;
|
||||
|
||||
extern long fricxv,fricyv;
|
||||
extern int fricxv,fricyv;
|
||||
|
||||
typedef struct {
|
||||
long zoom,exitx,exity,loogiex[64],loogiey[64],numloogs,loogcnt;
|
||||
long posx, posy, posz, horiz, ohoriz, ohorizoff, invdisptime;
|
||||
long bobposx,bobposy,oposx,oposy,oposz,pyoff,opyoff;
|
||||
long posxv,posyv,poszv,last_pissed_time,truefz,truecz;
|
||||
long player_par,visibility;
|
||||
long bobcounter,weapon_sway;
|
||||
long pals_time,randomflamex,crack_time;
|
||||
int zoom,exitx,exity,loogiex[64],loogiey[64],numloogs,loogcnt;
|
||||
int posx, posy, posz, horiz, ohoriz, ohorizoff, invdisptime;
|
||||
int bobposx,bobposy,oposx,oposy,oposz,pyoff,opyoff;
|
||||
int posxv,posyv,poszv,last_pissed_time,truefz,truecz;
|
||||
int player_par,visibility;
|
||||
int bobcounter,weapon_sway;
|
||||
int pals_time,randomflamex,crack_time;
|
||||
|
||||
char aim_mode,auto_aim,weaponswitch;
|
||||
|
||||
|
@ -472,7 +472,7 @@ typedef struct {
|
|||
short heat_amount,actorsqu,timebeforeexit,customexitsound;
|
||||
|
||||
short weaprecs[16],weapreccnt;
|
||||
unsigned long interface_toggle_flag;
|
||||
unsigned int interface_toggle_flag;
|
||||
|
||||
short orotscrnang,rotscrnang,dead_flag,show_empty_weapon; // JBF 20031220: added orotscrnang
|
||||
short scuba_amount,jetpack_amount,steroids_amount,shield_amount;
|
||||
|
@ -496,18 +496,18 @@ typedef struct {
|
|||
char /*fire_flag,*/pals[3];
|
||||
char return_to_center, reloading;
|
||||
|
||||
long max_secret_rooms,secret_rooms,max_actors_killed,actors_killed;
|
||||
long runspeed, movement_lock, team;
|
||||
long max_player_health, max_shield_amount, max_ammo_amount[MAX_WEAPONS];
|
||||
int max_secret_rooms,secret_rooms,max_actors_killed,actors_killed;
|
||||
int runspeed, movement_lock, team;
|
||||
int max_player_health, max_shield_amount, max_ammo_amount[MAX_WEAPONS];
|
||||
short sbs, sound_pitch;
|
||||
} player_struct;
|
||||
|
||||
extern char tempbuf[2048], packbuf[576];
|
||||
|
||||
extern long gc;
|
||||
extern int gc;
|
||||
|
||||
extern long impact_damage,respawnactortime,respawnitemtime;
|
||||
extern long start_armour_amount;
|
||||
extern int impact_damage,respawnactortime,respawnitemtime;
|
||||
extern int start_armour_amount;
|
||||
|
||||
#define MOVFIFOSIZ 256
|
||||
|
||||
|
@ -515,7 +515,7 @@ extern short spriteq[1024],spriteqloc,spriteqamount;
|
|||
extern user_defs ud;
|
||||
extern short int moustat;
|
||||
extern short int global_random;
|
||||
extern long scaredfallz;
|
||||
extern int scaredfallz;
|
||||
extern char buf[1024]; //My own generic input buffer
|
||||
|
||||
#define MAXQUOTELEN 128
|
||||
|
@ -525,11 +525,11 @@ extern char ready2send;
|
|||
|
||||
// JBF 20040531: adding 16 extra to the script so we have some leeway
|
||||
// to (hopefully) safely abort when hitting the limit
|
||||
extern long *script,*scriptptr,*insptr,*labelcode,labelcnt,defaultlabelcnt,*labeltype;
|
||||
extern int *script,*scriptptr,*insptr,*labelcode,labelcnt,defaultlabelcnt,*labeltype;
|
||||
extern int g_ScriptSize;
|
||||
extern char *label;
|
||||
extern long *actorscrptr[MAXTILES],*parsing_actor;
|
||||
extern long *actorLoadEventScrptr[MAXTILES];
|
||||
extern int *actorscrptr[MAXTILES],*parsing_actor;
|
||||
extern int *actorLoadEventScrptr[MAXTILES];
|
||||
extern char actortype[MAXTILES];
|
||||
extern char *music_pointer;
|
||||
|
||||
|
@ -546,9 +546,9 @@ typedef struct {
|
|||
// extern char gotz;
|
||||
|
||||
typedef struct {
|
||||
/* long x;
|
||||
long y;
|
||||
long z; */
|
||||
/* int x;
|
||||
int y;
|
||||
int z; */
|
||||
short ang, oldang, angdir, angdif;
|
||||
} spriteinterpolate;
|
||||
|
||||
|
@ -560,8 +560,8 @@ typedef struct {
|
|||
short picnum,ang,extra,owner,movflag;
|
||||
short tempang,actorstayput,dispicnum;
|
||||
short timetosleep;
|
||||
long floorz,ceilingz,lastvx,lastvy,bposx,bposy,bposz;
|
||||
long temp_data[10];
|
||||
int floorz,ceilingz,lastvx,lastvy,bposx,bposy,bposz;
|
||||
int temp_data[10];
|
||||
int flags;
|
||||
proj_struct projectile;
|
||||
} actordata_t;
|
||||
|
@ -570,27 +570,27 @@ extern actordata_t hittype[MAXSPRITES];
|
|||
|
||||
extern input loc;
|
||||
extern input recsync[RECSYNCBUFSIZ];
|
||||
extern long avgfvel, avgsvel, avgavel, avghorz, avgbits, avgextbits;
|
||||
extern int avgfvel, avgsvel, avgavel, avghorz, avgbits, avgextbits;
|
||||
|
||||
extern long numplayers, myconnectindex;
|
||||
extern long connecthead, connectpoint2[MAXPLAYERS]; //Player linked list variables (indeces, not connection numbers)
|
||||
extern int numplayers, myconnectindex;
|
||||
extern int connecthead, connectpoint2[MAXPLAYERS]; //Player linked list variables (indeces, not connection numbers)
|
||||
extern short screenpeek;
|
||||
|
||||
extern int current_menu;
|
||||
extern long tempwallptr,animatecnt;
|
||||
extern long lockclock,frameplace;
|
||||
extern int tempwallptr,animatecnt;
|
||||
extern int lockclock,frameplace;
|
||||
extern char display_mirror,loadfromgrouponly,rtsplaying;
|
||||
|
||||
extern long groupfile;
|
||||
extern long ototalclock;
|
||||
extern int groupfile;
|
||||
extern int ototalclock;
|
||||
|
||||
extern long *animateptr[MAXANIMATES], animategoal[MAXANIMATES];
|
||||
extern long animatevel[MAXANIMATES];
|
||||
// extern long oanimateval[MAXANIMATES];
|
||||
extern int *animateptr[MAXANIMATES], animategoal[MAXANIMATES];
|
||||
extern int animatevel[MAXANIMATES];
|
||||
// extern int oanimateval[MAXANIMATES];
|
||||
extern short neartagsector, neartagwall, neartagsprite;
|
||||
extern long neartaghitdist;
|
||||
extern int neartaghitdist;
|
||||
extern short animatesect[MAXANIMATES];
|
||||
extern long movefifoplc, vel,svel,angvel,horiz;
|
||||
extern int movefifoplc, vel,svel,angvel,horiz;
|
||||
|
||||
extern short mirrorwall[64], mirrorsector[64], mirrorcnt;
|
||||
|
||||
|
@ -638,20 +638,20 @@ extern int lastsavedpos;
|
|||
extern int restorepalette;
|
||||
extern int packetrate;
|
||||
|
||||
extern long cachecount;
|
||||
extern int cachecount;
|
||||
extern char boardfilename[BMAX_PATH],waterpal[768],slimepal[768],titlepal[768],drealms[768],endingpal[768],animpal[768];
|
||||
extern char cachedebug,earthquaketime;
|
||||
extern int networkmode;
|
||||
extern char lumplockbyte[11];
|
||||
|
||||
//DUKE3D.H - replace the end "my's" with this
|
||||
extern long myx, omyx, myxvel, myy, omyy, myyvel, myz, omyz, myzvel;
|
||||
extern int myx, omyx, myxvel, myy, omyy, myyvel, myz, omyz, myzvel;
|
||||
extern short myhoriz, omyhoriz, myhorizoff, omyhorizoff, globalskillsound;
|
||||
extern short myang, omyang, mycursectnum, myjumpingcounter;
|
||||
extern char myjumpingtoggle, myonground, myhardlanding,myreturntocenter;
|
||||
extern long fakemovefifoplc;
|
||||
extern long myxbak[MOVEFIFOSIZ], myybak[MOVEFIFOSIZ], myzbak[MOVEFIFOSIZ];
|
||||
extern long myhorizbak[MOVEFIFOSIZ];
|
||||
extern int fakemovefifoplc;
|
||||
extern int myxbak[MOVEFIFOSIZ], myybak[MOVEFIFOSIZ], myzbak[MOVEFIFOSIZ];
|
||||
extern int myhorizbak[MOVEFIFOSIZ];
|
||||
extern short myangbak[MOVEFIFOSIZ];
|
||||
|
||||
extern short weaponsandammosprites[15];
|
||||
|
@ -667,7 +667,7 @@ typedef struct {
|
|||
} STATUSBARTYPE;
|
||||
|
||||
extern STATUSBARTYPE sbar;
|
||||
extern long cameradist, cameraclock, dukefriction,show_shareware;
|
||||
extern int cameradist, cameraclock, dukefriction,show_shareware;
|
||||
extern int networkmode, movesperpacket;
|
||||
extern int gamequit;
|
||||
|
||||
|
@ -675,22 +675,22 @@ extern char pus,pub;
|
|||
extern int camerashitable,freezerhurtowner,lasermode;
|
||||
extern char syncstat;
|
||||
extern signed char multiwho, multipos, multiwhat, multiflag;
|
||||
extern long syncvaltail, syncvaltottail;
|
||||
extern long numfreezebounces,rpgblastradius,pipebombblastradius,tripbombblastradius,shrinkerblastradius,morterblastradius,bouncemineblastradius,seenineblastradius;
|
||||
extern int syncvaltail, syncvaltottail;
|
||||
extern int numfreezebounces,rpgblastradius,pipebombblastradius,tripbombblastradius,shrinkerblastradius,morterblastradius,bouncemineblastradius,seenineblastradius;
|
||||
extern int everyothertime;
|
||||
extern long mymaxlag, otherminlag, bufferjitter;
|
||||
extern int mymaxlag, otherminlag, bufferjitter;
|
||||
|
||||
extern long numinterpolations, startofdynamicinterpolations;
|
||||
extern long oldipos[MAXINTERPOLATIONS];
|
||||
extern long bakipos[MAXINTERPOLATIONS];
|
||||
extern long *curipos[MAXINTERPOLATIONS];
|
||||
extern int numinterpolations, startofdynamicinterpolations;
|
||||
extern int oldipos[MAXINTERPOLATIONS];
|
||||
extern int bakipos[MAXINTERPOLATIONS];
|
||||
extern int *curipos[MAXINTERPOLATIONS];
|
||||
|
||||
extern short numclouds,clouds[128],cloudx[128],cloudy[128];
|
||||
extern long cloudtotalclock,totalmemory;
|
||||
extern int cloudtotalclock,totalmemory;
|
||||
|
||||
extern long stereomode, stereowidth, stereopixelwidth;
|
||||
extern int stereomode, stereowidth, stereopixelwidth;
|
||||
|
||||
extern long myaimmode, myaimstat, omyaimstat;
|
||||
extern int myaimmode, myaimstat, omyaimstat;
|
||||
|
||||
#define IFISGLMODE if (getrendermode() >= 3)
|
||||
#define IFISSOFTMODE if (getrendermode() < 3)
|
||||
|
@ -805,12 +805,12 @@ enum gamevarflags {
|
|||
};
|
||||
|
||||
typedef struct {
|
||||
long lValue;
|
||||
int lValue;
|
||||
char *szLabel;
|
||||
unsigned long dwFlags;
|
||||
unsigned int dwFlags;
|
||||
|
||||
long *plValues; // array of values when 'per-player', or 'per-actor'
|
||||
long lDefault;
|
||||
int *plValues; // array of values when 'per-player', or 'per-actor'
|
||||
int lDefault;
|
||||
char bReset;
|
||||
} gamevar_t;
|
||||
|
||||
|
@ -848,23 +848,23 @@ extern char g_szBuf[1024];
|
|||
#define NAM_GRENADE_LIFETIME 120
|
||||
#define NAM_GRENADE_LIFETIME_VAR 30
|
||||
|
||||
extern long *aplWeaponClip[MAX_WEAPONS]; // number of items in clip
|
||||
extern long *aplWeaponReload[MAX_WEAPONS]; // delay to reload (include fire)
|
||||
extern long *aplWeaponFireDelay[MAX_WEAPONS]; // delay to fire
|
||||
extern long *aplWeaponHoldDelay[MAX_WEAPONS]; // delay after release fire button to fire (0 for none)
|
||||
extern long *aplWeaponTotalTime[MAX_WEAPONS]; // The total time the weapon is cycling before next fire.
|
||||
extern long *aplWeaponFlags[MAX_WEAPONS]; // Flags for weapon
|
||||
extern long *aplWeaponShoots[MAX_WEAPONS]; // what the weapon shoots
|
||||
extern long *aplWeaponSpawnTime[MAX_WEAPONS]; // the frame at which to spawn an item
|
||||
extern long *aplWeaponSpawn[MAX_WEAPONS]; // the item to spawn
|
||||
extern long *aplWeaponShotsPerBurst[MAX_WEAPONS]; // number of shots per 'burst' (one ammo per 'burst'
|
||||
extern long *aplWeaponWorksLike[MAX_WEAPONS]; // What original the weapon works like
|
||||
extern long *aplWeaponInitialSound[MAX_WEAPONS]; // Sound made when initialy firing. zero for no sound
|
||||
extern long *aplWeaponFireSound[MAX_WEAPONS]; // Sound made when firing (each time for automatic)
|
||||
extern long *aplWeaponSound2Time[MAX_WEAPONS]; // Alternate sound time
|
||||
extern long *aplWeaponSound2Sound[MAX_WEAPONS]; // Alternate sound sound ID
|
||||
extern long *aplWeaponReloadSound1[MAX_WEAPONS]; // Sound of magazine being removed
|
||||
extern long *aplWeaponReloadSound2[MAX_WEAPONS]; // Sound of magazine being inserted
|
||||
extern int *aplWeaponClip[MAX_WEAPONS]; // number of items in clip
|
||||
extern int *aplWeaponReload[MAX_WEAPONS]; // delay to reload (include fire)
|
||||
extern int *aplWeaponFireDelay[MAX_WEAPONS]; // delay to fire
|
||||
extern int *aplWeaponHoldDelay[MAX_WEAPONS]; // delay after release fire button to fire (0 for none)
|
||||
extern int *aplWeaponTotalTime[MAX_WEAPONS]; // The total time the weapon is cycling before next fire.
|
||||
extern int *aplWeaponFlags[MAX_WEAPONS]; // Flags for weapon
|
||||
extern int *aplWeaponShoots[MAX_WEAPONS]; // what the weapon shoots
|
||||
extern int *aplWeaponSpawnTime[MAX_WEAPONS]; // the frame at which to spawn an item
|
||||
extern int *aplWeaponSpawn[MAX_WEAPONS]; // the item to spawn
|
||||
extern int *aplWeaponShotsPerBurst[MAX_WEAPONS]; // number of shots per 'burst' (one ammo per 'burst'
|
||||
extern int *aplWeaponWorksLike[MAX_WEAPONS]; // What original the weapon works like
|
||||
extern int *aplWeaponInitialSound[MAX_WEAPONS]; // Sound made when initialy firing. zero for no sound
|
||||
extern int *aplWeaponFireSound[MAX_WEAPONS]; // Sound made when firing (each time for automatic)
|
||||
extern int *aplWeaponSound2Time[MAX_WEAPONS]; // Alternate sound time
|
||||
extern int *aplWeaponSound2Sound[MAX_WEAPONS]; // Alternate sound sound ID
|
||||
extern int *aplWeaponReloadSound1[MAX_WEAPONS]; // Sound of magazine being removed
|
||||
extern int *aplWeaponReloadSound2[MAX_WEAPONS]; // Sound of magazine being inserted
|
||||
|
||||
extern short timer;
|
||||
|
||||
|
@ -952,7 +952,7 @@ extern char setupfilename[BMAX_PATH];
|
|||
|
||||
typedef struct {
|
||||
char *name, *filename, *musicfn;
|
||||
long partime, designertime;
|
||||
int partime, designertime;
|
||||
} map_t;
|
||||
|
||||
extern map_t map[MAXVOLUMES*MAXLEVELS];
|
||||
|
@ -961,14 +961,14 @@ typedef struct {
|
|||
player_struct *ps;
|
||||
input *sync;
|
||||
|
||||
long movefifoend;
|
||||
long syncvalhead;
|
||||
long myminlag;
|
||||
int movefifoend;
|
||||
int syncvalhead;
|
||||
int myminlag;
|
||||
|
||||
int frags[MAXPLAYERS];
|
||||
int32 pcolor;
|
||||
int32 pteam;
|
||||
int32 wchoice[MAX_WEAPONS];
|
||||
int pcolor;
|
||||
int pteam;
|
||||
int wchoice[MAX_WEAPONS];
|
||||
|
||||
char syncval[MOVEFIFOSIZ];
|
||||
char user_name[32];
|
||||
|
|
|
@ -33,13 +33,13 @@ extern void MusicShutdown(void);
|
|||
extern void intomenusounds(void);
|
||||
extern void playmusic(const char *fn);
|
||||
extern int loadsound(unsigned num);
|
||||
extern int xyzsound(int num,int i,long x,long y,long z);
|
||||
extern int xyzsound(int num,int i,int x,int y,int z);
|
||||
extern void sound(int num);
|
||||
extern int spritesound(unsigned int num,int i);
|
||||
extern void stopsound(int num);
|
||||
extern void stopenvsound(int num,int i);
|
||||
extern void pan3dsound(void);
|
||||
extern void testcallback(unsigned long num);
|
||||
extern void testcallback(unsigned int num);
|
||||
extern void clearsoundlocks(void);
|
||||
extern int callsound(int sn,int whatsprite);
|
||||
extern int check_activator_motion(int lotag);
|
||||
|
@ -47,13 +47,13 @@ extern int isadoorwall(int dapic);
|
|||
extern int isanunderoperator(int lotag);
|
||||
extern int isanearoperator(int lotag);
|
||||
extern int checkcursectnums(int sect);
|
||||
extern long ldist(spritetype *s1,spritetype *s2);
|
||||
extern long dist(spritetype *s1,spritetype *s2);
|
||||
extern int findplayer(spritetype *s,long *d);
|
||||
extern int findotherplayer(int p,long *d);
|
||||
extern int ldist(spritetype *s1,spritetype *s2);
|
||||
extern int dist(spritetype *s1,spritetype *s2);
|
||||
extern int findplayer(spritetype *s,int *d);
|
||||
extern int findotherplayer(int p,int *d);
|
||||
extern void doanimations(void);
|
||||
extern int getanimationgoal(long *animptr);
|
||||
extern int setanimation(int animsect,long *animptr,long thegoal,long thevel);
|
||||
extern int getanimationgoal(int *animptr);
|
||||
extern int setanimation(int animsect,int *animptr,int thegoal,int thevel);
|
||||
extern void animatecamsprite(void);
|
||||
extern void animatewalls(void);
|
||||
extern int activatewarpelevators(int s,int d);
|
||||
|
@ -62,9 +62,9 @@ extern void operaterespawns(int low);
|
|||
extern void operateactivators(int low,int snum);
|
||||
extern void operatemasterswitches(int low);
|
||||
extern void operateforcefields(int s,int low);
|
||||
extern int checkhitswitch(int snum,long w,int switchtype);
|
||||
extern int checkhitswitch(int snum,int w,int switchtype);
|
||||
extern void activatebysector(int sect,int j);
|
||||
extern void checkhitwall(int spr,int dawallnum,long x,long y,long z,int atwith);
|
||||
extern void checkhitwall(int spr,int dawallnum,int x,int y,int z,int atwith);
|
||||
extern void checkplayerhurt(player_struct *p,int j);
|
||||
extern int checkhitceiling(int sn);
|
||||
extern void checkhitsprite(int i,int sn);
|
||||
|
@ -94,8 +94,8 @@ extern int enterlevel(int g);
|
|||
extern void backtomenu(void);
|
||||
extern void setpal(player_struct *p);
|
||||
extern void quickkill(player_struct *p);
|
||||
extern long hits(int i);
|
||||
extern long hitasprite(int i,short *hitsp);
|
||||
extern int hits(int i);
|
||||
extern int hitasprite(int i,short *hitsp);
|
||||
extern int shoot(int i,int atwith);
|
||||
extern void displaymasks(int snum);
|
||||
extern void displayweapon(int snum);
|
||||
|
@ -103,45 +103,45 @@ extern void getinput(int snum);
|
|||
extern void checkweapons(player_struct *p);
|
||||
extern void processinput(int snum);
|
||||
extern void cmenu(int cm);
|
||||
extern void savetemp(const char *fn,long daptr,long dasiz);
|
||||
extern void savetemp(const char *fn,int daptr,int dasiz);
|
||||
// extern int loadpheader(char spot,int32 *vn,int32 *ln,int32 *psk,int32 *numplr);
|
||||
extern int loadplayer(int spot);
|
||||
extern int saveplayer(int spot);
|
||||
extern inline int menutext(int x,int y,int s,int p,const char *t);
|
||||
extern void menus(void);
|
||||
extern void palto(int r,int g,int b,long e);
|
||||
extern void palto(int r,int g,int b,int e);
|
||||
extern void playanm(const char *fn,char);
|
||||
extern int getincangle(int a,int na);
|
||||
extern void getglobalz(int iActor);
|
||||
extern void makeitfall(int iActor);
|
||||
extern void loadefs(const char *fn);
|
||||
extern int furthestangle(int iActor,int angs);
|
||||
extern void execute(int iActor,int iPlayer,long lDist);
|
||||
extern void overwritesprite(long thex,long they,int tilenum,int shade,int stat,int dapalnum);
|
||||
extern void execute(int iActor,int iPlayer,int lDist);
|
||||
extern void overwritesprite(int thex,int they,int tilenum,int shade,int stat,int dapalnum);
|
||||
extern inline int gametext(int x,int y,const char *t,int s,int dabits);
|
||||
extern inline int gametextpal(int x,int y,const char *t,int s,int p);
|
||||
extern inline int minitext(int x,int y,const char *t,int p,int sb);
|
||||
extern void gamenumber(long x,long y,long n,int s);
|
||||
extern void gamenumber(int x,int y,int n,int s);
|
||||
extern void Shutdown(void);
|
||||
extern void getpackets(void);
|
||||
extern void check_fta_sounds(int i);
|
||||
extern inline int inventory(spritetype *s);
|
||||
extern inline int badguy(spritetype *s);
|
||||
extern int badguypic(int pn);
|
||||
extern void myos(long x,long y,int tilenum,int shade,int orientation);
|
||||
extern void myospal(long x,long y,int tilenum,int shade,int orientation,int p);
|
||||
extern void myos(int x,int y,int tilenum,int shade,int orientation);
|
||||
extern void myospal(int x,int y,int tilenum,int shade,int orientation,int p);
|
||||
extern void displayfragbar(void);
|
||||
extern void FTA(int q,player_struct *p);
|
||||
extern void gameexit(const char *t);
|
||||
extern inline int strget(int x,int y,char *t,int dalen,int c);
|
||||
extern void displayrest(long smoothratio);
|
||||
extern void updatesectorz(long x,long y,long z,short *sectnum);
|
||||
extern void displayrest(int smoothratio);
|
||||
extern void updatesectorz(int x,int y,int z,short *sectnum);
|
||||
extern void drawbackground(void);
|
||||
extern void displayrooms(int snum,long smoothratio);
|
||||
extern int EGS(int whatsect,long s_x,long s_y,long s_z,int s_pn,int s_s,int s_xr,int s_yr,int s_a,int s_ve,long s_zv,int s_ow,int s_ss);
|
||||
extern void displayrooms(int snum,int smoothratio);
|
||||
extern int EGS(int whatsect,int s_x,int s_y,int s_z,int s_pn,int s_s,int s_xr,int s_yr,int s_a,int s_ve,int s_zv,int s_ow,int s_ss);
|
||||
extern int wallswitchcheck(int i);
|
||||
extern int spawn(int j,int pn);
|
||||
extern void animatesprites(long x,long y,int a,long smoothratio);
|
||||
extern void animatesprites(int x,int y,int a,int smoothratio);
|
||||
extern int main(int argc,char **argv);
|
||||
extern void opendemowrite(void);
|
||||
extern void closedemowrite(void);
|
||||
|
@ -150,7 +150,7 @@ extern void lotsofglass(int i,int wallnum,int n);
|
|||
extern void spriteglass(int i,int n);
|
||||
extern void ceilingglass(int i,int sectnum,int n);
|
||||
extern void lotsofcolourglass(int i,int wallnum,int n);
|
||||
extern long GetTime(void);
|
||||
extern int GetTime(void);
|
||||
extern void CONFIG_GetSetupFilename(void);
|
||||
extern int32 CONFIG_FunctionNameToNum(char *func);
|
||||
extern char *CONFIG_FunctionNumToName(int32 func);
|
||||
|
@ -162,20 +162,20 @@ extern void readsavenames(void);
|
|||
extern int32 CONFIG_ReadSetup(void);
|
||||
extern void CONFIG_WriteSetup(void);
|
||||
extern void updateinterpolations(void);
|
||||
extern void setinterpolation(long *posptr);
|
||||
extern void stopinterpolation(long *posptr);
|
||||
extern void dointerpolations(long smoothratio);
|
||||
extern void setinterpolation(int *posptr);
|
||||
extern void stopinterpolation(int *posptr);
|
||||
extern void dointerpolations(int smoothratio);
|
||||
extern void restoreinterpolations(void);
|
||||
extern long ceilingspace(int sectnum);
|
||||
extern long floorspace(int sectnum);
|
||||
extern int ceilingspace(int sectnum);
|
||||
extern int floorspace(int sectnum);
|
||||
extern void addammo(int weapon,player_struct *p,int amount);
|
||||
extern void addweaponnoswitch(player_struct *p,int weapon);
|
||||
extern void addweapon(player_struct *p,int weapon);
|
||||
extern void checkavailinven(player_struct *p);
|
||||
extern void checkavailweapon(player_struct *p);
|
||||
extern void hitradius(int i,long r,long hp1,long hp2,long hp3,long hp4);
|
||||
extern int movesprite(int spritenum,long xchange,long ychange,long zchange,unsigned long cliptype);
|
||||
extern int ssp(int i,unsigned long cliptype);
|
||||
extern void hitradius(int i,int r,int hp1,int hp2,int hp3,int hp4);
|
||||
extern int movesprite(int spritenum,int xchange,int ychange,int zchange,unsigned int cliptype);
|
||||
extern int ssp(int i,unsigned int cliptype);
|
||||
extern void insertspriteq(int i);
|
||||
extern void lotsofmoney(int sp,int n);
|
||||
extern void lotsofmail(int sp, int n);
|
||||
|
@ -190,25 +190,25 @@ extern void movecyclers(void);
|
|||
extern void movedummyplayers(void);
|
||||
|
||||
// game.c
|
||||
extern inline void setstatusbarscale(long sc);
|
||||
extern inline void setstatusbarscale(int sc);
|
||||
|
||||
extern void setgamepalette(player_struct *player, char *pal, int set);
|
||||
extern void fadepal(int r, int g, int b, int start, int end, int step);
|
||||
|
||||
extern inline int minitextshade(int x,int y,const char *t,int s,int p,int sb);
|
||||
extern inline int gametext_(int small, int starttile, int x,int y,const char *t,int s,int p,int orientation,long x1, long y1, long x2, long y2);
|
||||
extern void txdigitalnumber(int starttile, long x,long y,long n,int s,int pal,int cs,long x1, long y1, long x2, long y2);
|
||||
extern void myosx(long x,long y,int tilenum,int shade,int orientation);
|
||||
extern void myospalx(long x,long y,int tilenum,int shade,int orientation,int p);
|
||||
extern inline int gametext_(int small, int starttile, int x,int y,const char *t,int s,int p,int orientation,int x1, int y1, int x2, int y2);
|
||||
extern void txdigitalnumber(int starttile, int x,int y,int n,int s,int pal,int cs,int x1, int y1, int x2, int y2);
|
||||
extern void myosx(int x,int y,int tilenum,int shade,int orientation);
|
||||
extern void myospalx(int x,int y,int tilenum,int shade,int orientation,int p);
|
||||
extern void ResetGameVars(void);
|
||||
extern void ResetActorGameVars(int iActor);
|
||||
|
||||
extern void setupdynamictostatic();
|
||||
extern void processnames(const char *szLabel, long lValue);
|
||||
extern void processnames(const char *szLabel, int lValue);
|
||||
|
||||
extern void LoadActor(long sActor);
|
||||
extern void LoadActor(int sActor);
|
||||
|
||||
extern long GetGameVar(const char *szGameLabel, long lDefault, int iActor, int iPlayer);
|
||||
extern int GetGameVar(const char *szGameLabel, int lDefault, int iActor, int iPlayer);
|
||||
extern void DumpGameVars(FILE *fp);
|
||||
// extern void AddLog(const char *psz, ...);
|
||||
|
||||
|
@ -216,16 +216,16 @@ extern void ResetSystemDefaults(void);
|
|||
extern void InitGameVarPointers(void);
|
||||
extern void InitGameVars(void);
|
||||
extern void SaveGameVars(FILE *fil);
|
||||
extern int ReadGameVars(long fil);
|
||||
extern int ReadGameVars(int fil);
|
||||
|
||||
extern long GetGameVarID(int id, int iActor, int iPlayer);
|
||||
extern void SetGameVarID(int id, long lValue, int iActor, int iPlayer);
|
||||
extern int AddGameVar(const char *pszLabel, long lValue, unsigned long dwFlags);
|
||||
extern int GetGameVarID(int id, int iActor, int iPlayer);
|
||||
extern void SetGameVarID(int id, int lValue, int iActor, int iPlayer);
|
||||
extern int AddGameVar(const char *pszLabel, int lValue, unsigned int dwFlags);
|
||||
extern void ReportError(int iError);
|
||||
|
||||
extern void onvideomodechange(int newmode);
|
||||
|
||||
extern void OnEvent(int iEventID, int sActor, int sPlayer, long lDist);
|
||||
extern void OnEvent(int iEventID, int sActor, int sPlayer, int lDist);
|
||||
|
||||
extern int isspritemakingsound(int i, int num);
|
||||
extern int issoundplaying(int i, int num);
|
||||
|
@ -243,6 +243,6 @@ extern inline int checkspriteflagsp(int iPicnum, int iType);
|
|||
|
||||
extern int getteampal(int team);
|
||||
|
||||
extern void se40code(long x,long y,long z,long a,long h, long smoothratio);
|
||||
extern void se40code(int x,int y,int z,int a,int h, int smoothratio);
|
||||
|
||||
#endif // __funct_h__
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -37,21 +37,21 @@ extern int g_iHiTagID; // var ID of "HITAG"
|
|||
extern int g_iTextureID; // var ID of "TEXTURE"
|
||||
extern int g_iThisActorID; // var ID of "THISACTOR"
|
||||
|
||||
extern long *actorLoadEventScrptr[MAXTILES];
|
||||
extern int *actorLoadEventScrptr[MAXTILES];
|
||||
|
||||
extern long *apScriptGameEvent[MAXGAMEEVENTS];
|
||||
extern int *apScriptGameEvent[MAXGAMEEVENTS];
|
||||
|
||||
extern short otherp;
|
||||
extern long g_currentweapon;
|
||||
extern long g_gun_pos;
|
||||
extern long g_looking_arc;
|
||||
extern long g_currentweapon;
|
||||
extern long g_weapon_xoffset;
|
||||
extern long g_gs;
|
||||
extern long g_kb;
|
||||
extern long g_looking_angSR1;
|
||||
extern int g_currentweapon;
|
||||
extern int g_gun_pos;
|
||||
extern int g_looking_arc;
|
||||
extern int g_currentweapon;
|
||||
extern int g_weapon_xoffset;
|
||||
extern int g_gs;
|
||||
extern int g_kb;
|
||||
extern int g_looking_angSR1;
|
||||
extern int display_bonus_screen;
|
||||
extern long lastvisinc;
|
||||
extern int lastvisinc;
|
||||
extern char cheatquotes[][MAXCHEATLEN];
|
||||
extern char compilefile[BMAX_PATH];
|
||||
extern int total_lines,line_number;
|
||||
|
@ -59,7 +59,7 @@ extern int error,warning;
|
|||
typedef struct _labels
|
||||
{
|
||||
char *name;
|
||||
long lId;
|
||||
int lId;
|
||||
int flags;
|
||||
int maxParm2;
|
||||
} LABELS;
|
||||
|
|
|
@ -31,13 +31,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "osd.h"
|
||||
|
||||
int g_i,g_p;
|
||||
static long g_x,*g_t;
|
||||
static int g_x,*g_t;
|
||||
static spritetype *g_sp;
|
||||
static int killit_flag;
|
||||
|
||||
static void DoUserDef(int iSet, int lLabelID, int lVar2)
|
||||
{
|
||||
long lValue;
|
||||
int lValue;
|
||||
|
||||
if (g_p != myconnectindex)
|
||||
{
|
||||
|
@ -704,7 +704,7 @@ static void DoUserDef(int iSet, int lLabelID, int lVar2)
|
|||
|
||||
static void DoThisProjectile(int iSet, int lVar1, int lLabelID, int lVar2)
|
||||
{
|
||||
long lValue,proj=g_i;
|
||||
int lValue,proj=g_i;
|
||||
|
||||
if (lVar1 != g_iThisActorID)
|
||||
proj=GetGameVarID(lVar1, g_i, g_p);
|
||||
|
@ -925,8 +925,8 @@ static void DoThisProjectile(int iSet, int lVar1, int lLabelID, int lVar2)
|
|||
|
||||
static void DoPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2)
|
||||
{
|
||||
long lValue;
|
||||
long lTemp;
|
||||
int lValue;
|
||||
int lTemp;
|
||||
int iPlayer=g_p;
|
||||
|
||||
if (lVar1 != g_iThisActorID)
|
||||
|
@ -1983,7 +1983,7 @@ static void DoPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2)
|
|||
|
||||
static void DoInput(int iSet, int lVar1, int lLabelID, int lVar2)
|
||||
{
|
||||
long lValue;
|
||||
int lValue;
|
||||
int iPlayer=g_p;
|
||||
|
||||
if (lVar1 != g_iThisActorID)
|
||||
|
@ -2050,7 +2050,7 @@ static void DoInput(int iSet, int lVar1, int lLabelID, int lVar2)
|
|||
|
||||
static void DoWall(int iSet, int lVar1, int lLabelID, int lVar2)
|
||||
{
|
||||
long lValue;
|
||||
int lValue;
|
||||
int iWall = GetGameVarID(lVar1, g_i, g_p);
|
||||
|
||||
if (iWall<0 || iWall >= MAXWALLS)
|
||||
|
@ -2190,7 +2190,7 @@ static void DoWall(int iSet, int lVar1, int lLabelID, int lVar2)
|
|||
|
||||
static void DoSector(int iSet, int lVar1, int lLabelID, int lVar2)
|
||||
{
|
||||
long lValue;
|
||||
int lValue;
|
||||
int iSector=sprite[g_i].sectnum;
|
||||
|
||||
if (lVar1 != g_iThisActorID)
|
||||
|
@ -2376,8 +2376,8 @@ static void DoSector(int iSet, int lVar1, int lLabelID, int lVar2)
|
|||
|
||||
static void DoActor(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2)
|
||||
{
|
||||
long lValue;
|
||||
long lTemp;
|
||||
int lValue;
|
||||
int lTemp;
|
||||
int iActor=g_i;
|
||||
|
||||
if (lVar1 != g_iThisActorID)
|
||||
|
@ -2740,7 +2740,7 @@ static void DoActor(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2)
|
|||
|
||||
static void DoProjectile(int iSet, int lVar1, int lLabelID, int lVar2)
|
||||
{
|
||||
long lValue;
|
||||
int lValue;
|
||||
|
||||
if (lVar1 < 0 || lVar1 >= MAXTILES)
|
||||
{
|
||||
|
@ -2958,7 +2958,7 @@ static void DoProjectile(int iSet, int lVar1, int lLabelID, int lVar2)
|
|||
|
||||
static int parse(void);
|
||||
|
||||
void OnEvent(int iEventID, int iActor, int iPlayer, long lDist)
|
||||
void OnEvent(int iEventID, int iActor, int iPlayer, int lDist)
|
||||
{
|
||||
if (iEventID >= MAXGAMEEVENTS)
|
||||
{
|
||||
|
@ -2975,7 +2975,7 @@ void OnEvent(int iEventID, int iActor, int iPlayer, long lDist)
|
|||
|
||||
{
|
||||
int og_i=g_i, og_p=g_p, okillit_flag=killit_flag;
|
||||
long og_x=g_x, *og_t=g_t, *oinsptr=insptr;
|
||||
int og_x=g_x, *og_t=g_t, *oinsptr=insptr;
|
||||
spritetype *og_sp=g_sp;
|
||||
|
||||
g_i = iActor; // current sprite ID
|
||||
|
@ -3063,10 +3063,10 @@ static void forceplayerangle(player_struct *p)
|
|||
|
||||
static char dodge(spritetype *s)
|
||||
{
|
||||
long bx,by,bxvect,byvect,d,i;
|
||||
long mx = s->x, my = s->y;
|
||||
long mxvect = sintable[(s->ang+512)&2047];
|
||||
long myvect = sintable[s->ang&2047];
|
||||
int bx,by,bxvect,byvect,d,i;
|
||||
int mx = s->x, my = s->y;
|
||||
int mxvect = sintable[(s->ang+512)&2047];
|
||||
int myvect = sintable[s->ang&2047];
|
||||
|
||||
for (i=headspritestat[4];i>=0;i=nextspritestat[i]) //weapons list
|
||||
{
|
||||
|
@ -3095,9 +3095,9 @@ static char dodge(spritetype *s)
|
|||
int furthestangle(int iActor,int angs)
|
||||
{
|
||||
short hitsect,hitwall,hitspr,furthest_angle=0;
|
||||
long hx, hy, hz, d;
|
||||
int hx, hy, hz, d;
|
||||
spritetype *s = &sprite[iActor];
|
||||
long greatestd = -(1<<30);
|
||||
int greatestd = -(1<<30);
|
||||
int angincs = 2048/angs,j;
|
||||
|
||||
if (s->picnum != APLAYER)
|
||||
|
@ -3121,10 +3121,10 @@ int furthestangle(int iActor,int angs)
|
|||
return (furthest_angle&2047);
|
||||
}
|
||||
|
||||
int furthestcanseepoint(int iActor,spritetype *ts,long *dax,long *day)
|
||||
int furthestcanseepoint(int iActor,spritetype *ts,int *dax,int *day)
|
||||
{
|
||||
short hitsect,hitwall,hitspr, angincs;
|
||||
long hx, hy, hz, d, da;//, d, cd, ca,tempx,tempy,cx,cy;
|
||||
int hx, hy, hz, d, da;//, d, cd, ca,tempx,tempy,cx,cy;
|
||||
int j;
|
||||
spritetype *s = &sprite[iActor];
|
||||
|
||||
|
@ -3161,7 +3161,7 @@ void getglobalz(int iActor)
|
|||
|
||||
if (s->statnum == 10 || s->statnum == 6 || s->statnum == 2 || s->statnum == 1 || s->statnum == 4)
|
||||
{
|
||||
long hz,lz,zr = 127L;
|
||||
int hz,lz,zr = 127L;
|
||||
|
||||
if (s->statnum == 4)
|
||||
zr = 4L;
|
||||
|
@ -3204,7 +3204,7 @@ void getglobalz(int iActor)
|
|||
void makeitfall(int iActor)
|
||||
{
|
||||
spritetype *s = &sprite[iActor];
|
||||
long hz,lz,c = gc;
|
||||
int hz,lz,c = gc;
|
||||
|
||||
if (floorspace(s->sectnum))
|
||||
c = 0;
|
||||
|
@ -3261,7 +3261,7 @@ int getincangle(int a,int na)
|
|||
static void alterang(int a)
|
||||
{
|
||||
int aang = g_sp->ang, angdif, goalang;
|
||||
long ticselapsed = (g_t[0])&31, *moveptr = (long *)g_t[1];
|
||||
int ticselapsed = (g_t[0])&31, *moveptr = (int *)g_t[1];
|
||||
int j = g_player[g_p].ps->holoduke_on;
|
||||
|
||||
g_sp->xvel += (*moveptr-g_sp->xvel)/5;
|
||||
|
@ -3323,9 +3323,9 @@ static void alterang(int a)
|
|||
|
||||
static void move(void)
|
||||
{
|
||||
long l, *moveptr;
|
||||
int l, *moveptr;
|
||||
int a = g_sp->hitag, goalang, angdif;
|
||||
long daxvel;
|
||||
int daxvel;
|
||||
|
||||
if (a == -1) a = 0;
|
||||
|
||||
|
@ -3364,8 +3364,8 @@ static void move(void)
|
|||
|
||||
if (a&face_player_smart)
|
||||
{
|
||||
long newx = g_player[g_p].ps->posx+(g_player[g_p].ps->posxv/768);
|
||||
long newy = g_player[g_p].ps->posy+(g_player[g_p].ps->posyv/768);
|
||||
int newx = g_player[g_p].ps->posx+(g_player[g_p].ps->posxv/768);
|
||||
int newy = g_player[g_p].ps->posy+(g_player[g_p].ps->posyv/768);
|
||||
|
||||
goalang = getangle(newx-g_sp->x,newy-g_sp->y);
|
||||
angdif = getincangle(g_sp->ang,goalang)>>2;
|
||||
|
@ -3385,7 +3385,7 @@ static void move(void)
|
|||
return;
|
||||
}
|
||||
|
||||
moveptr = (long *)g_t[1];
|
||||
moveptr = (int *)g_t[1];
|
||||
|
||||
if (a&geth) g_sp->xvel += (*moveptr-g_sp->xvel)>>1;
|
||||
if (a&getv) g_sp->zvel += ((*(moveptr+1)<<4)-g_sp->zvel)>>1;
|
||||
|
@ -3513,7 +3513,7 @@ static void move(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void parseifelse(long condition)
|
||||
static void parseifelse(int condition)
|
||||
{
|
||||
if (condition)
|
||||
{
|
||||
|
@ -3523,7 +3523,7 @@ static void parseifelse(long condition)
|
|||
}
|
||||
else
|
||||
{
|
||||
insptr = (long *) *(insptr+1);
|
||||
insptr = (int *) *(insptr+1);
|
||||
if (*insptr == 10)
|
||||
{
|
||||
// else...
|
||||
|
@ -3534,11 +3534,11 @@ static void parseifelse(long condition)
|
|||
}
|
||||
}
|
||||
|
||||
// long *it = 0x00589a04;
|
||||
// int *it = 0x00589a04;
|
||||
|
||||
static int parse(void)
|
||||
{
|
||||
long j, l, s, tw;
|
||||
int j, l, s, tw;
|
||||
|
||||
if (killit_flag) return 1;
|
||||
|
||||
|
@ -3726,9 +3726,9 @@ static int parse(void)
|
|||
case CON_AI:
|
||||
insptr++;
|
||||
g_t[5] = *insptr++; // Ai
|
||||
g_t[4] = *(long *)(g_t[5]); // Action
|
||||
g_t[1] = *(long *)(g_t[5]+4); // move
|
||||
g_sp->hitag = *(long *)(g_t[5]+8); // move flags
|
||||
g_t[4] = *(int *)(g_t[5]); // Action
|
||||
g_t[1] = *(int *)(g_t[5]+4); // move
|
||||
g_sp->hitag = *(int *)(g_t[5]+8); // move flags
|
||||
g_t[0] = g_t[2] = g_t[3] = 0; // count, actioncount... g_t[3] = ???
|
||||
if (g_sp->hitag&random_angle)
|
||||
g_sp->ang = TRAND&2047;
|
||||
|
@ -3756,7 +3756,7 @@ static int parse(void)
|
|||
break;
|
||||
|
||||
case CON_ELSE:
|
||||
insptr = (long *) *(insptr+1);
|
||||
insptr = (int *) *(insptr+1);
|
||||
break;
|
||||
|
||||
case CON_ADDSTRENGTH:
|
||||
|
@ -4059,7 +4059,7 @@ static int parse(void)
|
|||
|
||||
case CON_DEBUG:
|
||||
insptr++;
|
||||
initprintf("%ld\n",*insptr++);
|
||||
initprintf("%d\n",*insptr++);
|
||||
break;
|
||||
|
||||
case CON_ENDOFGAME:
|
||||
|
@ -4137,9 +4137,9 @@ static int parse(void)
|
|||
|
||||
case CON_STATE:
|
||||
{
|
||||
long *tempscrptr=insptr+2;
|
||||
int *tempscrptr=insptr+2;
|
||||
|
||||
insptr = (long *) *(insptr+1);
|
||||
insptr = (int *) *(insptr+1);
|
||||
while (1) if (parse()) break;
|
||||
insptr = tempscrptr;
|
||||
}
|
||||
|
@ -4385,17 +4385,17 @@ static int parse(void)
|
|||
break;
|
||||
}
|
||||
|
||||
case CON_GETKEYNAME:
|
||||
insptr++;
|
||||
{
|
||||
int i = GetGameVarID(*insptr++, g_i, g_p), f=GetGameVarID(*insptr++, g_i, g_p);
|
||||
|
||||
j=GetGameVarID(*insptr++, g_i, g_p);
|
||||
|
||||
if (fta_quotes[i] != NULL && f < NUMGAMEFUNCTIONS && j < 2)
|
||||
Bstrcpy(fta_quotes[i], KB_ScanCodeToString(ud.config.KeyboardKeys[f][j]));
|
||||
|
||||
break;
|
||||
case CON_GETKEYNAME:
|
||||
insptr++;
|
||||
{
|
||||
int i = GetGameVarID(*insptr++, g_i, g_p), f=GetGameVarID(*insptr++, g_i, g_p);
|
||||
|
||||
j=GetGameVarID(*insptr++, g_i, g_p);
|
||||
|
||||
if (fta_quotes[i] != NULL && f < NUMGAMEFUNCTIONS && j < 2)
|
||||
Bstrcpy(fta_quotes[i], KB_ScanCodeToString(ud.config.KeyboardKeys[f][j]));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case CON_MYOSX:
|
||||
|
@ -4441,29 +4441,29 @@ static int parse(void)
|
|||
// script offset to default case (null if none)
|
||||
// For each case: value, ptr to code
|
||||
//AddLog("Processing Switch...");
|
||||
long lValue=GetGameVarID(*insptr++, g_i, g_p), lEnd=*insptr++, lCases=*insptr++;
|
||||
long *lpDefault=insptr++, *lpCases=insptr, bMatched=0, *lTempInsPtr, lCheckCase;
|
||||
int lValue=GetGameVarID(*insptr++, g_i, g_p), lEnd=*insptr++, lCases=*insptr++;
|
||||
int *lpDefault=insptr++, *lpCases=insptr, bMatched=0, *lTempInsPtr, lCheckCase;
|
||||
insptr+=lCases*2;
|
||||
lTempInsPtr=insptr;
|
||||
//Bsprintf(g_szBuf,"lEnd= %ld *lpDefault=%ld",lEnd,*lpDefault);
|
||||
//Bsprintf(g_szBuf,"lEnd= %d *lpDefault=%d",lEnd,*lpDefault);
|
||||
//AddLog(g_szBuf);
|
||||
|
||||
//Bsprintf(g_szBuf,"Checking %ld cases for %ld",lCases, lValue);
|
||||
//Bsprintf(g_szBuf,"Checking %d cases for %d",lCases, lValue);
|
||||
//AddLog(g_szBuf);
|
||||
for (lCheckCase=0; lCheckCase<lCases && !bMatched; lCheckCase++)
|
||||
{
|
||||
//Bsprintf(g_szBuf,"Checking #%ld Value= %ld",lCheckCase, lpCases[lCheckCase*2]);
|
||||
//Bsprintf(g_szBuf,"Checking #%d Value= %d",lCheckCase, lpCases[lCheckCase*2]);
|
||||
//AddLog(g_szBuf);
|
||||
|
||||
if (lpCases[lCheckCase*2] == lValue)
|
||||
{
|
||||
//AddLog("Found Case Match");
|
||||
//Bsprintf(g_szBuf,"insptr=%ld. lCheckCase=%ld, offset=%ld, &script[0]=%ld",
|
||||
// (long)insptr,(long)lCheckCase,lpCases[lCheckCase*2+1],(long)&script[0]);
|
||||
//Bsprintf(g_szBuf,"insptr=%d. lCheckCase=%d, offset=%d, &script[0]=%d",
|
||||
// (int)insptr,(int)lCheckCase,lpCases[lCheckCase*2+1],(int)&script[0]);
|
||||
//AddLog(g_szBuf);
|
||||
// fake a 2-d Array
|
||||
insptr=(long*)(lpCases[lCheckCase*2+1] + &script[0]);
|
||||
//Bsprintf(g_szBuf,"insptr=%ld. ", (long)insptr);
|
||||
insptr=(int*)(lpCases[lCheckCase*2+1] + &script[0]);
|
||||
//Bsprintf(g_szBuf,"insptr=%d. ", (int)insptr);
|
||||
//AddLog(g_szBuf);
|
||||
while (1)
|
||||
{
|
||||
|
@ -4479,7 +4479,7 @@ static int parse(void)
|
|||
if (*lpDefault)
|
||||
{
|
||||
//AddLog("No Matching Case: Using Default");
|
||||
insptr=(long*)(*lpDefault + &script[0]);
|
||||
insptr=(int*)(*lpDefault + &script[0]);
|
||||
while (1) if (parse()) break;
|
||||
}
|
||||
else
|
||||
|
@ -4487,8 +4487,8 @@ static int parse(void)
|
|||
//AddLog("No Matching Case: No Default to use");
|
||||
}
|
||||
}
|
||||
insptr=(long*)(lEnd + (long)&script[0]);
|
||||
//Bsprintf(g_szBuf,"insptr=%ld. ", (long)insptr);
|
||||
insptr=(int*)(lEnd + (int)&script[0]);
|
||||
//Bsprintf(g_szBuf,"insptr=%d. ", (int)insptr);
|
||||
//AddLog(g_szBuf);
|
||||
//AddLog("Done Processing Switch");
|
||||
|
||||
|
@ -4525,14 +4525,15 @@ static int parse(void)
|
|||
{
|
||||
switch (tw)
|
||||
{
|
||||
case CON_DIST:
|
||||
distx = dist(&sprite[xvar],&sprite[yvar]);
|
||||
break;
|
||||
case CON_LDIST:
|
||||
distx = ldist(&sprite[xvar],&sprite[yvar]);
|
||||
break;
|
||||
case CON_DIST:
|
||||
distx = dist(&sprite[xvar],&sprite[yvar]);
|
||||
break;
|
||||
case CON_LDIST:
|
||||
distx = ldist(&sprite[xvar],&sprite[yvar]);
|
||||
break;
|
||||
}
|
||||
} else OSD_Printf("error: invalid sprite\n");
|
||||
}
|
||||
else OSD_Printf("error: invalid sprite\n");
|
||||
|
||||
SetGameVarID(distvar, distx, g_i, g_p);
|
||||
break;
|
||||
|
@ -4658,7 +4659,7 @@ static int parse(void)
|
|||
case CON_EZSHOOTVAR:
|
||||
case CON_ZSHOOTVAR:
|
||||
{
|
||||
long lReturn=-1;
|
||||
int lReturn=-1;
|
||||
|
||||
insptr++;
|
||||
|
||||
|
@ -4743,11 +4744,11 @@ static int parse(void)
|
|||
int a=GetGameVarID(*insptr++,g_i,g_p);
|
||||
int horiz=GetGameVarID(*insptr++,g_i,g_p);
|
||||
int sect=GetGameVarID(*insptr++,g_i,g_p);
|
||||
long x1=scale(GetGameVarID(*insptr++,g_i,g_p),xdim,320);
|
||||
long y1=scale(GetGameVarID(*insptr++,g_i,g_p),ydim,200);
|
||||
long x2=scale(GetGameVarID(*insptr++,g_i,g_p),xdim,320);
|
||||
long y2=scale(GetGameVarID(*insptr++,g_i,g_p),ydim,200);
|
||||
long smoothratio = 65536;
|
||||
int x1=scale(GetGameVarID(*insptr++,g_i,g_p),xdim,320);
|
||||
int y1=scale(GetGameVarID(*insptr++,g_i,g_p),ydim,200);
|
||||
int x2=scale(GetGameVarID(*insptr++,g_i,g_p),xdim,320);
|
||||
int y2=scale(GetGameVarID(*insptr++,g_i,g_p),ydim,200);
|
||||
int smoothratio = 65536;
|
||||
|
||||
if (x1 > x2) swaplong(&x1,&x2);
|
||||
if (y1 > y2) swaplong(&y1,&y2);
|
||||
|
@ -4775,7 +4776,7 @@ static int parse(void)
|
|||
|
||||
if ((gotpic[MIRROR>>3]&(1<<(MIRROR&7))) > 0)
|
||||
{
|
||||
long j, i = 0, k, dst = 0x7fffffff;
|
||||
int j, i = 0, k, dst = 0x7fffffff;
|
||||
|
||||
for (k=0;k<mirrorcnt;k++)
|
||||
{
|
||||
|
@ -4786,7 +4787,7 @@ static int parse(void)
|
|||
|
||||
if (wall[mirrorwall[i]].overpicnum == MIRROR)
|
||||
{
|
||||
long tposx,tposy;
|
||||
int tposx,tposy;
|
||||
short tang;
|
||||
|
||||
preparemirror(x,y,z,a,horiz,mirrorwall[i],mirrorsector[i],&tposx,&tposy,&tang);
|
||||
|
@ -4826,8 +4827,8 @@ static int parse(void)
|
|||
int x=GetGameVarID(*insptr++,g_i,g_p), y=GetGameVarID(*insptr++,g_i,g_p), z=GetGameVarID(*insptr++,g_i,g_p);
|
||||
int a=GetGameVarID(*insptr++,g_i,g_p), tilenum=GetGameVarID(*insptr++,g_i,g_p), shade=GetGameVarID(*insptr++,g_i,g_p);
|
||||
int pal=GetGameVarID(*insptr++,g_i,g_p), orientation=GetGameVarID(*insptr++,g_i,g_p);
|
||||
long x1=GetGameVarID(*insptr++,g_i,g_p), y1=GetGameVarID(*insptr++,g_i,g_p);
|
||||
long x2=GetGameVarID(*insptr++,g_i,g_p), y2=GetGameVarID(*insptr++,g_i,g_p);
|
||||
int x1=GetGameVarID(*insptr++,g_i,g_p), y1=GetGameVarID(*insptr++,g_i,g_p);
|
||||
int x2=GetGameVarID(*insptr++,g_i,g_p), y2=GetGameVarID(*insptr++,g_i,g_p);
|
||||
|
||||
rotatesprite(x<<16,y<<16,z,a,tilenum,shade,pal,2|orientation,x1,y1,x2,y2);
|
||||
break;
|
||||
|
@ -4883,7 +4884,7 @@ static int parse(void)
|
|||
int sectnum=GetGameVarID(*insptr++,g_i,g_p);
|
||||
int ceilzvar=*insptr++, ceilhitvar=*insptr++, florzvar=*insptr++, florhitvar=*insptr++;
|
||||
int walldist=GetGameVarID(*insptr++,g_i,g_p), clipmask=GetGameVarID(*insptr++,g_i,g_p);
|
||||
long ceilz, ceilhit, florz, florhit;
|
||||
int ceilz, ceilhit, florz, florhit;
|
||||
|
||||
getzrange(x, y, z, sectnum, &ceilz, &ceilhit, &florz, &florhit, walldist, clipmask);
|
||||
SetGameVarID(ceilzvar, ceilz, g_i, g_p);
|
||||
|
@ -4902,7 +4903,7 @@ static int parse(void)
|
|||
int hitsectvar=*insptr++, hitwallvar=*insptr++, hitspritevar=*insptr++;
|
||||
int hitxvar=*insptr++, hityvar=*insptr++, hitzvar=*insptr++, cliptype=GetGameVarID(*insptr++,g_i,g_p);
|
||||
short hitsect, hitwall, hitsprite;
|
||||
long hitx, hity, hitz;
|
||||
int hitx, hity, hitz;
|
||||
|
||||
hitscan(xs, ys, zs, sectnum, vx, vy, vz, &hitsect, &hitwall, &hitsprite, &hitx, &hity, &hitz, cliptype);
|
||||
SetGameVarID(hitsectvar, hitsect, g_i, g_p);
|
||||
|
@ -4932,7 +4933,7 @@ static int parse(void)
|
|||
int xpivot=GetGameVarID(*insptr++,g_i,g_p), ypivot=GetGameVarID(*insptr++,g_i,g_p);
|
||||
int x=GetGameVarID(*insptr++,g_i,g_p), y=GetGameVarID(*insptr++,g_i,g_p), daang=GetGameVarID(*insptr++,g_i,g_p);
|
||||
int x2var=*insptr++, y2var=*insptr++;
|
||||
long x2, y2;
|
||||
int x2, y2;
|
||||
|
||||
rotatepoint(xpivot,ypivot,x,y,daang,&x2,&y2);
|
||||
SetGameVarID(x2var, x2, g_i, g_p);
|
||||
|
@ -4943,12 +4944,12 @@ static int parse(void)
|
|||
case CON_NEARTAG:
|
||||
insptr++;
|
||||
{
|
||||
// neartag(long x, long y, long z, short sectnum, short ang, //Starting position & angle
|
||||
// neartag(int x, int y, int 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)
|
||||
// int *neartaghitdist, //Returns actual distance to object (scale: 1024=largest grid size)
|
||||
// int neartagrange, //Choose maximum distance to scan (scale: 1024=largest grid size)
|
||||
// char tagsearch) //1-lotag only, 2-hitag only, 3-lotag&hitag
|
||||
|
||||
int x=GetGameVarID(*insptr++,g_i,g_p), y=GetGameVarID(*insptr++,g_i,g_p), z=GetGameVarID(*insptr++,g_i,g_p);
|
||||
|
@ -5362,7 +5363,7 @@ static int parse(void)
|
|||
else
|
||||
j = 0;
|
||||
}
|
||||
parseifelse((long) j);
|
||||
parseifelse((int) j);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -5507,7 +5508,7 @@ static int parse(void)
|
|||
case CON_ADDLOG:
|
||||
{
|
||||
insptr++;
|
||||
OSD_Printf("CONLOG: L=%ld\n",*insptr++);
|
||||
OSD_Printf("CONLOG: L=%d\n",*insptr++);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -5516,7 +5517,7 @@ static int parse(void)
|
|||
{
|
||||
int m=1;
|
||||
char szBuf[256];
|
||||
long l=*insptr++, lVarID = *insptr;
|
||||
int l=*insptr++, lVarID = *insptr;
|
||||
|
||||
if ((lVarID >= iGameVarCount) || lVarID < 0)
|
||||
{
|
||||
|
@ -5531,11 +5532,11 @@ static int parse(void)
|
|||
{
|
||||
// invalid varID
|
||||
insptr++;
|
||||
OSD_Printf("CONLOGVAR: L=%ld INVALID VARIABLE\n",l);
|
||||
OSD_Printf("CONLOGVAR: L=%d INVALID VARIABLE\n",l);
|
||||
break; // out of switch
|
||||
}
|
||||
}
|
||||
Bsprintf(szBuf,"CONLOGVAR: L=%ld %s ",l, aGameVars[lVarID].szLabel);
|
||||
Bsprintf(szBuf,"CONLOGVAR: L=%d %s ",l, aGameVars[lVarID].szLabel);
|
||||
strcpy(g_szBuf,szBuf);
|
||||
|
||||
if (aGameVars[lVarID].dwFlags & GAMEVAR_FLAG_READONLY)
|
||||
|
@ -5556,7 +5557,7 @@ static int parse(void)
|
|||
Bsprintf(szBuf," (Global)");
|
||||
}
|
||||
Bstrcat(g_szBuf,szBuf);
|
||||
Bsprintf(szBuf," =%ld\n", GetGameVarID(lVarID, g_i, g_p)*m);
|
||||
Bsprintf(szBuf," =%d\n", GetGameVarID(lVarID, g_i, g_p)*m);
|
||||
Bstrcat(g_szBuf,szBuf);
|
||||
OSD_Printf(g_szBuf);
|
||||
insptr++;
|
||||
|
@ -5755,7 +5756,7 @@ static int parse(void)
|
|||
// that is of <type> into <getvar>
|
||||
// -1 for none found
|
||||
// <type> <maxdistvarid> <varid>
|
||||
long var1 = *insptr++, d;
|
||||
int var1 = *insptr++, d;
|
||||
|
||||
if (tw == CON_FINDPLAYER) j=findplayer(&sprite[g_i],&d);
|
||||
else if (tw == CON_FINDOTHERPLAYER) j=findotherplayer(g_i,&d);
|
||||
|
@ -6214,7 +6215,7 @@ static int parse(void)
|
|||
case CON_WHILEVARN:
|
||||
{
|
||||
int i;
|
||||
long *savedinsptr=insptr;
|
||||
int *savedinsptr=insptr;
|
||||
j=1;
|
||||
while (j)
|
||||
{
|
||||
|
@ -6233,7 +6234,7 @@ static int parse(void)
|
|||
case CON_WHILEVARVARN:
|
||||
{
|
||||
int i,k;
|
||||
long *savedinsptr=insptr;
|
||||
int *savedinsptr=insptr;
|
||||
j=1;
|
||||
while (j)
|
||||
{
|
||||
|
@ -6456,24 +6457,24 @@ static int parse(void)
|
|||
case CON_GETCURRADDRESS:
|
||||
insptr++;
|
||||
j=*insptr++;
|
||||
SetGameVarID(j, (long)insptr, g_i, g_p);
|
||||
SetGameVarID(j, (int)insptr, g_i, g_p);
|
||||
break;
|
||||
|
||||
case CON_JUMP:
|
||||
insptr++;
|
||||
j = GetGameVarID(*insptr++, g_i, g_p);
|
||||
insptr = (long *)j;
|
||||
insptr = (int *)j;
|
||||
break;
|
||||
|
||||
default:
|
||||
OSD_Printf("fatal error: default processing: prev inst: %ld, curr inst: %ld, next inst: %ld\ncurrent actor: %d (%d)\n",*(insptr-1),*insptr,*(insptr+1),g_i,g_sp->picnum);
|
||||
OSD_Printf("fatal error: default processing: prev inst: %d, curr inst: %d, next inst: %d\ncurrent actor: %d (%d)\n",*(insptr-1),*insptr,*(insptr+1),g_i,g_sp->picnum);
|
||||
gameexit("An error has occurred in the EDuke32 CON executor.\n\nPlease mail all of your CON files along with the file eduke32.log\nto terminx@gmail.com.\n\nThank you.");
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void LoadActor(long iActor)
|
||||
void LoadActor(int iActor)
|
||||
{
|
||||
g_i = iActor; // Sprite ID
|
||||
g_p = -1; // iPlayer; // Player ID
|
||||
|
@ -6509,7 +6510,7 @@ void LoadActor(long iActor)
|
|||
}
|
||||
}
|
||||
|
||||
void execute(int iActor,int iPlayer,long lDist)
|
||||
void execute(int iActor,int iPlayer,int lDist)
|
||||
{
|
||||
short temp, temp2;
|
||||
|
||||
|
@ -6537,14 +6538,14 @@ void execute(int iActor,int iPlayer,long lDist)
|
|||
{
|
||||
g_sp->lotag += TICSPERFRAME;
|
||||
|
||||
if (g_sp->lotag > *(long *)(g_t[4]+16))
|
||||
if (g_sp->lotag > *(int *)(g_t[4]+16))
|
||||
{
|
||||
g_t[2]++;
|
||||
g_sp->lotag = 0;
|
||||
g_t[3] += *(long *)(g_t[4]+12);
|
||||
g_t[3] += *(int *)(g_t[4]+12);
|
||||
}
|
||||
|
||||
if (klabs(g_t[3]) >= klabs(*(long *)(g_t[4]+4) * *(long *)(g_t[4]+12)))
|
||||
if (klabs(g_t[3]) >= klabs(*(int *)(g_t[4]+4) * *(int *)(g_t[4]+12)))
|
||||
g_t[3] = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ static void FreeGameVars(void)
|
|||
{
|
||||
// aGameVars[i].lValue=0;
|
||||
// if (aGameVars[i].szLabel)
|
||||
//Bfree(aGameVars[i].szLabel);
|
||||
//Bfree(aGameVars[i].szLabel);
|
||||
// aGameVars[i].szLabel=NULL;
|
||||
// aGameVars[i].dwFlags=0;
|
||||
|
||||
|
@ -76,10 +76,10 @@ static void ClearGameVars(void)
|
|||
return;
|
||||
}
|
||||
|
||||
int ReadGameVars(long fil)
|
||||
int ReadGameVars(int fil)
|
||||
{
|
||||
int i;
|
||||
long l;
|
||||
int l;
|
||||
|
||||
// AddLog("Reading gamevars from savegame");
|
||||
|
||||
|
@ -99,9 +99,9 @@ int ReadGameVars(long fil)
|
|||
for (i=0;i<iGameVarCount;i++)
|
||||
{
|
||||
if (aGameVars[i].dwFlags & GAMEVAR_FLAG_PERPLAYER)
|
||||
aGameVars[i].plValues=Bcalloc(MAXPLAYERS,sizeof(long));
|
||||
aGameVars[i].plValues=Bcalloc(MAXPLAYERS,sizeof(int));
|
||||
else if (aGameVars[i].dwFlags & GAMEVAR_FLAG_PERACTOR)
|
||||
aGameVars[i].plValues=Bcalloc(MAXSPRITES,sizeof(long));
|
||||
aGameVars[i].plValues=Bcalloc(MAXSPRITES,sizeof(int));
|
||||
else
|
||||
// else nothing 'extra...'
|
||||
aGameVars[i].plValues=NULL;
|
||||
|
@ -117,15 +117,15 @@ int ReadGameVars(long fil)
|
|||
{
|
||||
if (aGameVars[i].dwFlags & GAMEVAR_FLAG_PERPLAYER)
|
||||
{
|
||||
//Bsprintf(g_szBuf,"Reading value array for %s (%d)",aGameVars[i].szLabel,sizeof(long) * MAXPLAYERS);
|
||||
//Bsprintf(g_szBuf,"Reading value array for %s (%d)",aGameVars[i].szLabel,sizeof(int) * MAXPLAYERS);
|
||||
//AddLog(g_szBuf);
|
||||
if (kdfread(aGameVars[i].plValues,sizeof(long) * MAXPLAYERS, 1, fil) != 1) goto corrupt;
|
||||
if (kdfread(aGameVars[i].plValues,sizeof(int) * MAXPLAYERS, 1, fil) != 1) goto corrupt;
|
||||
}
|
||||
else if (aGameVars[i].dwFlags & GAMEVAR_FLAG_PERACTOR)
|
||||
{
|
||||
//Bsprintf(g_szBuf,"Reading value array for %s (%d)",aGameVars[i].szLabel,sizeof(long) * MAXSPRITES);
|
||||
//Bsprintf(g_szBuf,"Reading value array for %s (%d)",aGameVars[i].szLabel,sizeof(int) * MAXSPRITES);
|
||||
//AddLog(g_szBuf);
|
||||
if (kdfread(&aGameVars[i].plValues[0],sizeof(long), MAXSPRITES, fil) != MAXSPRITES) goto corrupt;
|
||||
if (kdfread(&aGameVars[i].plValues[0],sizeof(int), MAXSPRITES, fil) != MAXSPRITES) goto corrupt;
|
||||
}
|
||||
// else nothing 'extra...'
|
||||
}
|
||||
|
@ -138,8 +138,8 @@ int ReadGameVars(long fil)
|
|||
for (i=0;i<MAXGAMEEVENTS;i++)
|
||||
if (apScriptGameEvent[i])
|
||||
{
|
||||
l = (long)apScriptGameEvent[i]+(long)&script[0];
|
||||
apScriptGameEvent[i] = (long *)l;
|
||||
l = (int)apScriptGameEvent[i]+(int)&script[0];
|
||||
apScriptGameEvent[i] = (int *)l;
|
||||
}
|
||||
|
||||
// Bsprintf(g_szBuf,"CP:%s %d",__FILE__,__LINE__);
|
||||
|
@ -170,7 +170,7 @@ corrupt:
|
|||
void SaveGameVars(FILE *fil)
|
||||
{
|
||||
int i;
|
||||
long l;
|
||||
int l;
|
||||
|
||||
// AddLog("Saving Game Vars to File");
|
||||
dfwrite(&iGameVarCount,sizeof(iGameVarCount),1,fil);
|
||||
|
@ -187,15 +187,15 @@ void SaveGameVars(FILE *fil)
|
|||
{
|
||||
if (aGameVars[i].dwFlags & GAMEVAR_FLAG_PERPLAYER)
|
||||
{
|
||||
//Bsprintf(g_szBuf,"Writing value array for %s (%d)",aGameVars[i].szLabel,sizeof(long) * MAXPLAYERS);
|
||||
//Bsprintf(g_szBuf,"Writing value array for %s (%d)",aGameVars[i].szLabel,sizeof(int) * MAXPLAYERS);
|
||||
//AddLog(g_szBuf);
|
||||
dfwrite(aGameVars[i].plValues,sizeof(long) * MAXPLAYERS, 1, fil);
|
||||
dfwrite(aGameVars[i].plValues,sizeof(int) * MAXPLAYERS, 1, fil);
|
||||
}
|
||||
else if (aGameVars[i].dwFlags & GAMEVAR_FLAG_PERACTOR)
|
||||
{
|
||||
//Bsprintf(g_szBuf,"Writing value array for %s (%d)",aGameVars[i].szLabel,sizeof(long) * MAXSPRITES);
|
||||
//Bsprintf(g_szBuf,"Writing value array for %s (%d)",aGameVars[i].szLabel,sizeof(int) * MAXSPRITES);
|
||||
//AddLog(g_szBuf);
|
||||
dfwrite(&aGameVars[i].plValues[0],sizeof(long), MAXSPRITES, fil);
|
||||
dfwrite(&aGameVars[i].plValues[0],sizeof(int), MAXSPRITES, fil);
|
||||
}
|
||||
// else nothing 'extra...'
|
||||
}
|
||||
|
@ -203,15 +203,15 @@ void SaveGameVars(FILE *fil)
|
|||
for (i=0;i<MAXGAMEEVENTS;i++)
|
||||
if (apScriptGameEvent[i])
|
||||
{
|
||||
l = (long)apScriptGameEvent[i]-(long)&script[0];
|
||||
apScriptGameEvent[i] = (long *)l;
|
||||
l = (int)apScriptGameEvent[i]-(int)&script[0];
|
||||
apScriptGameEvent[i] = (int *)l;
|
||||
}
|
||||
dfwrite(apScriptGameEvent,sizeof(apScriptGameEvent),1,fil);
|
||||
for (i=0;i<MAXGAMEEVENTS;i++)
|
||||
if (apScriptGameEvent[i])
|
||||
{
|
||||
l = (long)apScriptGameEvent[i]+(long)&script[0];
|
||||
apScriptGameEvent[i] = (long *)l;
|
||||
l = (int)apScriptGameEvent[i]+(int)&script[0];
|
||||
apScriptGameEvent[i] = (int *)l;
|
||||
}
|
||||
|
||||
Bsprintf(g_szBuf,"EOF: EDuke32");
|
||||
|
@ -239,19 +239,19 @@ void DumpGameVars(FILE *fp)
|
|||
fprintf(fp,"gamevar %s ",aGameVars[i].szLabel);
|
||||
|
||||
if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_PLONG))
|
||||
fprintf(fp,"%ld",*((long*)aGameVars[i].lValue));
|
||||
fprintf(fp,"%d",*((int*)aGameVars[i].lValue));
|
||||
else if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_PSHORT))
|
||||
fprintf(fp,"%d",*((short*)aGameVars[i].lValue));
|
||||
else if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_PCHAR))
|
||||
fprintf(fp,"%d",*((char*)aGameVars[i].lValue));
|
||||
else
|
||||
fprintf(fp,"%ld",aGameVars[i].lValue);
|
||||
fprintf(fp,"%d",aGameVars[i].lValue);
|
||||
if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_PERPLAYER))
|
||||
fprintf(fp," GAMEVAR_FLAG_PERPLAYER");
|
||||
else if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_PERACTOR))
|
||||
fprintf(fp," GAMEVAR_FLAG_PERACTOR");
|
||||
else
|
||||
fprintf(fp," %ld",aGameVars[i].dwFlags & (GAMEVAR_FLAG_USER_MASK));
|
||||
fprintf(fp," %d",aGameVars[i].dwFlags & (GAMEVAR_FLAG_USER_MASK));
|
||||
fprintf(fp," // ");
|
||||
if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_SYSTEM))
|
||||
fprintf(fp," (system)");
|
||||
|
@ -274,7 +274,7 @@ void ResetGameVars(void)
|
|||
|
||||
for (i=0;i<MAXGAMEVARS;i++)
|
||||
{
|
||||
//Bsprintf(g_szBuf,"Resetting %d: '%s' to %ld",i,aDefaultGameVars[i].szLabel,
|
||||
//Bsprintf(g_szBuf,"Resetting %d: '%s' to %d",i,aDefaultGameVars[i].szLabel,
|
||||
// aDefaultGameVars[i].lValue
|
||||
// );
|
||||
//AddLog(g_szBuf);
|
||||
|
@ -283,7 +283,7 @@ void ResetGameVars(void)
|
|||
}
|
||||
}
|
||||
|
||||
int AddGameVar(const char *pszLabel, long lValue, unsigned long dwFlags)
|
||||
int AddGameVar(const char *pszLabel, int lValue, unsigned int dwFlags)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
|
@ -294,7 +294,7 @@ int AddGameVar(const char *pszLabel, long lValue, unsigned long dwFlags)
|
|||
{
|
||||
error++;
|
||||
ReportError(-1);
|
||||
initprintf("%s:%ld: error: variable name `%s' exceeds limit of %d characters.\n",compilefile,line_number,pszLabel, MAXVARLABEL);
|
||||
initprintf("%s:%d: error: variable name `%s' exceeds limit of %d characters.\n",compilefile,line_number,pszLabel, MAXVARLABEL);
|
||||
return 0;
|
||||
}
|
||||
for (i=0;i<iGameVarCount;i++)
|
||||
|
@ -307,9 +307,9 @@ int AddGameVar(const char *pszLabel, long lValue, unsigned long dwFlags)
|
|||
if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_PLONG|GAMEVAR_FLAG_PSHORT|GAMEVAR_FLAG_PCHAR))
|
||||
{
|
||||
// warning++;
|
||||
// initprintf("%s:%ld: warning: Internal gamevar '%s' cannot be redefined.\n",compilefile,line_number,label+(labelcnt<<6));
|
||||
// initprintf("%s:%d: warning: Internal gamevar '%s' cannot be redefined.\n",compilefile,line_number,label+(labelcnt<<6));
|
||||
ReportError(-1);
|
||||
initprintf("%s:%ld: warning: cannot redefine internal gamevar `%s'.\n",compilefile,line_number,label+(labelcnt<<6));
|
||||
initprintf("%s:%d: warning: cannot redefine internal gamevar `%s'.\n",compilefile,line_number,label+(labelcnt<<6));
|
||||
return 0;
|
||||
}
|
||||
else if ((aGameVars[i].dwFlags & GAMEVAR_FLAG_DEFAULT) || (aGameVars[i].dwFlags & GAMEVAR_FLAG_SYSTEM))
|
||||
|
@ -371,14 +371,14 @@ int AddGameVar(const char *pszLabel, long lValue, unsigned long dwFlags)
|
|||
if (aGameVars[i].dwFlags & GAMEVAR_FLAG_PERPLAYER)
|
||||
{
|
||||
if (!aGameVars[i].plValues)
|
||||
aGameVars[i].plValues=Bcalloc(MAXPLAYERS,sizeof(long));
|
||||
aGameVars[i].plValues=Bcalloc(MAXPLAYERS,sizeof(int));
|
||||
for (j=0;j<MAXPLAYERS;j++)
|
||||
aGameVars[i].plValues[j]=lValue;
|
||||
}
|
||||
else if (aGameVars[i].dwFlags & GAMEVAR_FLAG_PERACTOR)
|
||||
{
|
||||
if (!aGameVars[i].plValues)
|
||||
aGameVars[i].plValues=Bcalloc(MAXSPRITES,sizeof(long));
|
||||
aGameVars[i].plValues=Bcalloc(MAXSPRITES,sizeof(int));
|
||||
for (j=0;j<MAXSPRITES;j++)
|
||||
aGameVars[i].plValues[j]=lValue;
|
||||
}
|
||||
|
@ -420,7 +420,7 @@ static int GetGameID(const char *szGameLabel)
|
|||
return -1;
|
||||
}
|
||||
|
||||
long GetGameVarID(int id, int iActor, int iPlayer)
|
||||
int GetGameVarID(int id, int iActor, int iPlayer)
|
||||
{
|
||||
int inv = 0;
|
||||
|
||||
|
@ -447,7 +447,7 @@ long GetGameVarID(int id, int iActor, int iPlayer)
|
|||
// for the current player
|
||||
if (iPlayer >= 0 && iPlayer < MAXPLAYERS)
|
||||
{
|
||||
//Bsprintf(g_szBuf,"GetGameVarID(%d, %d, %d) returns %ld\n",id,iActor,iPlayer, aGameVars[id].plValues[iPlayer]);
|
||||
//Bsprintf(g_szBuf,"GetGameVarID(%d, %d, %d) returns %d\n",id,iActor,iPlayer, aGameVars[id].plValues[iPlayer]);
|
||||
//AddLog(g_szBuf);
|
||||
if (inv) return(-aGameVars[id].plValues[iPlayer]);
|
||||
return (aGameVars[id].plValues[iPlayer]);
|
||||
|
@ -472,8 +472,8 @@ long GetGameVarID(int id, int iActor, int iPlayer)
|
|||
|
||||
if (aGameVars[id].dwFlags & GAMEVAR_FLAG_PLONG)
|
||||
{
|
||||
if (inv) return(-(*((long*)aGameVars[id].lValue)));
|
||||
return(*((long*)aGameVars[id].lValue));
|
||||
if (inv) return(-(*((int*)aGameVars[id].lValue)));
|
||||
return(*((int*)aGameVars[id].lValue));
|
||||
}
|
||||
|
||||
if (aGameVars[id].dwFlags & GAMEVAR_FLAG_PSHORT)
|
||||
|
@ -492,14 +492,14 @@ long GetGameVarID(int id, int iActor, int iPlayer)
|
|||
return (aGameVars[id].lValue);
|
||||
}
|
||||
|
||||
void SetGameVarID(int id, long lValue, int iActor, int iPlayer)
|
||||
void SetGameVarID(int id, int lValue, int iActor, int iPlayer)
|
||||
{
|
||||
if (id<0 || id >= iGameVarCount)
|
||||
{
|
||||
OSD_Printf("SetGameVarID(): tried to set invalid gamevar ID (%d) from sprite %d (%d), player %d\n",id,g_i,sprite[g_i].picnum,g_p);
|
||||
return;
|
||||
}
|
||||
//Bsprintf(g_szBuf,"SGVI: %d ('%s') to %ld for %d %d",id,aGameVars[id].szLabel,lValue,iActor,iPlayer);
|
||||
//Bsprintf(g_szBuf,"SGVI: %d ('%s') to %d for %d %d",id,aGameVars[id].szLabel,lValue,iActor,iPlayer);
|
||||
//AddLog(g_szBuf);
|
||||
if (aGameVars[id].dwFlags & GAMEVAR_FLAG_PERPLAYER)
|
||||
{
|
||||
|
@ -528,7 +528,7 @@ void SetGameVarID(int id, long lValue, int iActor, int iPlayer)
|
|||
if (aGameVars[id].dwFlags & GAMEVAR_FLAG_PLONG)
|
||||
{
|
||||
// set the value at pointer
|
||||
*((long*)aGameVars[id].lValue)=lValue;
|
||||
*((int*)aGameVars[id].lValue)=lValue;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -550,7 +550,7 @@ void SetGameVarID(int id, long lValue, int iActor, int iPlayer)
|
|||
aGameVars[id].lValue=lValue;
|
||||
}
|
||||
|
||||
long GetGameVar(const char *szGameLabel, long lDefault, int iActor, int iPlayer)
|
||||
int GetGameVar(const char *szGameLabel, int lDefault, int iActor, int iPlayer)
|
||||
{
|
||||
int i=0;
|
||||
for (;i<iGameVarCount;i++)
|
||||
|
@ -566,7 +566,7 @@ long GetGameVar(const char *szGameLabel, long lDefault, int iActor, int iPlayer)
|
|||
return lDefault;
|
||||
}
|
||||
|
||||
static long *GetGameValuePtr(const char *szGameLabel)
|
||||
static int *GetGameValuePtr(const char *szGameLabel)
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<iGameVarCount;i++)
|
||||
|
@ -1108,17 +1108,17 @@ static void AddSystemVars()
|
|||
AddGameVar("TRIPBOMB_CONTROL", TRIPBOMB_TRIPWIRE, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
AddGameVar("PIPEBOMB_CONTROL", NAM?PIPEBOMB_TIMER:PIPEBOMB_REMOTE, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
|
||||
AddGameVar("RESPAWN_MONSTERS", (long)&ud.respawn_monsters,GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("RESPAWN_ITEMS",(long)&ud.respawn_items, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("RESPAWN_INVENTORY",(long)&ud.respawn_inventory, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("MONSTERS_OFF",(long)&ud.monsters_off, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("MARKER",(long)&ud.marker, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("FFIRE",(long)&ud.ffire, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("LEVEL",(long)&ud.level_number, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_READONLY);
|
||||
AddGameVar("VOLUME",(long)&ud.volume_number, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_READONLY);
|
||||
AddGameVar("RESPAWN_MONSTERS", (int)&ud.respawn_monsters,GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("RESPAWN_ITEMS",(int)&ud.respawn_items, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("RESPAWN_INVENTORY",(int)&ud.respawn_inventory, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("MONSTERS_OFF",(int)&ud.monsters_off, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("MARKER",(int)&ud.marker, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("FFIRE",(int)&ud.ffire, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("LEVEL",(int)&ud.level_number, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_READONLY);
|
||||
AddGameVar("VOLUME",(int)&ud.volume_number, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_READONLY);
|
||||
|
||||
AddGameVar("COOP",(long)&ud.coop, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("MULTIMODE",(long)&ud.multimode, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("COOP",(int)&ud.coop, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("MULTIMODE",(int)&ud.multimode, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
|
||||
AddGameVar("WEAPON", 0, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYSTEM);
|
||||
AddGameVar("WORKSLIKE", 0, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYSTEM);
|
||||
|
@ -1130,66 +1130,66 @@ static void AddSystemVars()
|
|||
AddGameVar("HITAG", 0, GAMEVAR_FLAG_SYSTEM);
|
||||
AddGameVar("TEXTURE", 0, GAMEVAR_FLAG_SYSTEM);
|
||||
AddGameVar("THISACTOR", 0, GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYSTEM);
|
||||
AddGameVar("myconnectindex", (long)&myconnectindex, GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("screenpeek", (long)&screenpeek, GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("currentweapon",(long)&g_currentweapon, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("gs",(long)&g_gs, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("looking_arc",(long)&g_looking_arc, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("gun_pos",(long)&g_gun_pos, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("weapon_xoffset",(long)&g_weapon_xoffset, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("weaponcount",(long)&g_kb, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("looking_angSR1",(long)&g_looking_angSR1, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("xdim",(long)&xdim, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("ydim",(long)&ydim, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("windowx1",(long)&windowx1, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("windowx2",(long)&windowx2, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("windowy1",(long)&windowy1, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("windowy2",(long)&windowy2, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("totalclock",(long)&totalclock, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("lastvisinc",(long)&lastvisinc, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("numsectors",(long)&numsectors, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_READONLY);
|
||||
AddGameVar("numplayers",(long)&numplayers, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_READONLY);
|
||||
AddGameVar("viewingrange",(long)&viewingrange, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("yxaspect",(long)&yxaspect, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("gravitationalconstant",(long)&gc, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("gametype_flags",(long)&gametype_flags[ud.coop], GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("framerate",(long)&framerate, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myconnectindex", (int)&myconnectindex, GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("screenpeek", (int)&screenpeek, GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("currentweapon",(int)&g_currentweapon, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("gs",(int)&g_gs, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("looking_arc",(int)&g_looking_arc, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("gun_pos",(int)&g_gun_pos, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("weapon_xoffset",(int)&g_weapon_xoffset, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("weaponcount",(int)&g_kb, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("looking_angSR1",(int)&g_looking_angSR1, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("xdim",(int)&xdim, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("ydim",(int)&ydim, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("windowx1",(int)&windowx1, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("windowx2",(int)&windowx2, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("windowy1",(int)&windowy1, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("windowy2",(int)&windowy2, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("totalclock",(int)&totalclock, GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("lastvisinc",(int)&lastvisinc, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("numsectors",(int)&numsectors, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_READONLY);
|
||||
AddGameVar("numplayers",(int)&numplayers, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_READONLY);
|
||||
AddGameVar("viewingrange",(int)&viewingrange, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("yxaspect",(int)&yxaspect, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("gravitationalconstant",(int)&gc, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("gametype_flags",(int)&gametype_flags[ud.coop], GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("framerate",(int)&framerate, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("CLIPMASK0", CLIPMASK0, GAMEVAR_FLAG_SYSTEM|GAMEVAR_FLAG_READONLY);
|
||||
AddGameVar("CLIPMASK1", CLIPMASK1, GAMEVAR_FLAG_SYSTEM|GAMEVAR_FLAG_READONLY);
|
||||
|
||||
AddGameVar("camerax",(long)&ud.camerax, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("cameray",(long)&ud.cameray, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("cameraz",(long)&ud.cameraz, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("cameraang",(long)&ud.cameraang, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("camerahoriz",(long)&ud.camerahoriz, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("camerasect",(long)&ud.camerasect, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("camerax",(int)&ud.camerax, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("cameray",(int)&ud.cameray, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("cameraz",(int)&ud.cameraz, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("cameraang",(int)&ud.cameraang, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("camerahoriz",(int)&ud.camerahoriz, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("camerasect",(int)&ud.camerasect, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
|
||||
AddGameVar("myx",(long)&myx, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myy",(long)&myy, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myz",(long)&myz, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("omyx",(long)&omyx, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("omyy",(long)&omyy, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("omyz",(long)&omyz, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myxvel",(long)&myxvel, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myyvel",(long)&myyvel, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myzvel",(long)&myzvel, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myx",(int)&myx, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myy",(int)&myy, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myz",(int)&myz, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("omyx",(int)&omyx, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("omyy",(int)&omyy, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("omyz",(int)&omyz, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myxvel",(int)&myxvel, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myyvel",(int)&myyvel, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myzvel",(int)&myzvel, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||
|
||||
AddGameVar("myhoriz",(long)&myhoriz, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myhorizoff",(long)&myhorizoff, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("omyhoriz",(long)&omyhoriz, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("omyhorizoff",(long)&omyhorizoff, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myang",(long)&myang, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("omyang",(long)&omyang, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("mycursectnum",(long)&mycursectnum, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myjumpingcounter",(long)&myjumpingcounter, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myhoriz",(int)&myhoriz, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myhorizoff",(int)&myhorizoff, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("omyhoriz",(int)&omyhoriz, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("omyhorizoff",(int)&omyhorizoff, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myang",(int)&myang, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("omyang",(int)&omyang, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("mycursectnum",(int)&mycursectnum, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myjumpingcounter",(int)&myjumpingcounter, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||
|
||||
AddGameVar("myjumpingtoggle",(long)&myjumpingtoggle, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PCHAR | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myonground",(long)&myonground, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PCHAR | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myhardlanding",(long)&myhardlanding, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PCHAR | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myreturntocenter",(long)&myreturntocenter, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PCHAR | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myjumpingtoggle",(int)&myjumpingtoggle, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PCHAR | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myonground",(int)&myonground, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PCHAR | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myhardlanding",(int)&myhardlanding, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PCHAR | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("myreturntocenter",(int)&myreturntocenter, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PCHAR | GAMEVAR_FLAG_SYNCCHECK);
|
||||
|
||||
AddGameVar("display_mirror",(long)&display_mirror, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PCHAR | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("randomseed",(long)&randomseed, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("display_mirror",(int)&display_mirror, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PCHAR | GAMEVAR_FLAG_SYNCCHECK);
|
||||
AddGameVar("randomseed",(int)&randomseed, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
}
|
||||
|
||||
void InitGameVars(void)
|
||||
|
@ -1259,74 +1259,74 @@ void InitGameVarPointers(void)
|
|||
|
||||
static void ResetPointerVars(void)
|
||||
{
|
||||
aGameVars[GetGameID("RESPAWN_MONSTERS")].lValue = (long)&ud.respawn_monsters;
|
||||
aGameVars[GetGameID("RESPAWN_ITEMS")].lValue = (long)&ud.respawn_items;
|
||||
aGameVars[GetGameID("RESPAWN_INVENTORY")].lValue = (long)&ud.respawn_inventory;
|
||||
aGameVars[GetGameID("MONSTERS_OFF")].lValue = (long)&ud.monsters_off;
|
||||
aGameVars[GetGameID("MARKER")].lValue = (long)&ud.marker;
|
||||
aGameVars[GetGameID("FFIRE")].lValue = (long)&ud.ffire;
|
||||
aGameVars[GetGameID("LEVEL")].lValue = (long)&ud.level_number;
|
||||
aGameVars[GetGameID("VOLUME")].lValue = (long)&ud.volume_number;
|
||||
aGameVars[GetGameID("RESPAWN_MONSTERS")].lValue = (int)&ud.respawn_monsters;
|
||||
aGameVars[GetGameID("RESPAWN_ITEMS")].lValue = (int)&ud.respawn_items;
|
||||
aGameVars[GetGameID("RESPAWN_INVENTORY")].lValue = (int)&ud.respawn_inventory;
|
||||
aGameVars[GetGameID("MONSTERS_OFF")].lValue = (int)&ud.monsters_off;
|
||||
aGameVars[GetGameID("MARKER")].lValue = (int)&ud.marker;
|
||||
aGameVars[GetGameID("FFIRE")].lValue = (int)&ud.ffire;
|
||||
aGameVars[GetGameID("LEVEL")].lValue = (int)&ud.level_number;
|
||||
aGameVars[GetGameID("VOLUME")].lValue = (int)&ud.volume_number;
|
||||
|
||||
aGameVars[GetGameID("COOP")].lValue = (long)&ud.coop;
|
||||
aGameVars[GetGameID("MULTIMODE")].lValue = (long)&ud.multimode;
|
||||
aGameVars[GetGameID("COOP")].lValue = (int)&ud.coop;
|
||||
aGameVars[GetGameID("MULTIMODE")].lValue = (int)&ud.multimode;
|
||||
|
||||
aGameVars[GetGameID("myconnectindex")].lValue = (long)&myconnectindex;
|
||||
aGameVars[GetGameID("screenpeek")].lValue = (long)&screenpeek;
|
||||
aGameVars[GetGameID("currentweapon")].lValue = (long)&g_currentweapon;
|
||||
aGameVars[GetGameID("gs")].lValue = (long)&g_gs;
|
||||
aGameVars[GetGameID("looking_arc")].lValue = (long)&g_looking_arc;
|
||||
aGameVars[GetGameID("gun_pos")].lValue = (long)&g_gun_pos;
|
||||
aGameVars[GetGameID("weapon_xoffset")].lValue = (long)&g_weapon_xoffset;
|
||||
aGameVars[GetGameID("weaponcount")].lValue = (long)&g_kb;
|
||||
aGameVars[GetGameID("looking_angSR1")].lValue = (long)&g_looking_angSR1;
|
||||
aGameVars[GetGameID("xdim")].lValue = (long)&xdim;
|
||||
aGameVars[GetGameID("ydim")].lValue = (long)&ydim;
|
||||
aGameVars[GetGameID("windowx1")].lValue = (long)&windowx1;
|
||||
aGameVars[GetGameID("windowx2")].lValue = (long)&windowx2;
|
||||
aGameVars[GetGameID("windowy1")].lValue = (long)&windowy1;
|
||||
aGameVars[GetGameID("windowy2")].lValue = (long)&windowy2;
|
||||
aGameVars[GetGameID("totalclock")].lValue = (long)&totalclock;
|
||||
aGameVars[GetGameID("lastvisinc")].lValue = (long)&lastvisinc;
|
||||
aGameVars[GetGameID("numsectors")].lValue = (long)&numsectors;
|
||||
aGameVars[GetGameID("numplayers")].lValue = (long)&numplayers;
|
||||
aGameVars[GetGameID("viewingrange")].lValue = (long)&viewingrange;
|
||||
aGameVars[GetGameID("yxaspect")].lValue = (long)&yxaspect;
|
||||
aGameVars[GetGameID("gravitationalconstant")].lValue = (long)&gc;
|
||||
aGameVars[GetGameID("gametype_flags")].lValue = (long)&gametype_flags[ud.coop];
|
||||
aGameVars[GetGameID("framerate")].lValue = (long)&framerate;
|
||||
aGameVars[GetGameID("myconnectindex")].lValue = (int)&myconnectindex;
|
||||
aGameVars[GetGameID("screenpeek")].lValue = (int)&screenpeek;
|
||||
aGameVars[GetGameID("currentweapon")].lValue = (int)&g_currentweapon;
|
||||
aGameVars[GetGameID("gs")].lValue = (int)&g_gs;
|
||||
aGameVars[GetGameID("looking_arc")].lValue = (int)&g_looking_arc;
|
||||
aGameVars[GetGameID("gun_pos")].lValue = (int)&g_gun_pos;
|
||||
aGameVars[GetGameID("weapon_xoffset")].lValue = (int)&g_weapon_xoffset;
|
||||
aGameVars[GetGameID("weaponcount")].lValue = (int)&g_kb;
|
||||
aGameVars[GetGameID("looking_angSR1")].lValue = (int)&g_looking_angSR1;
|
||||
aGameVars[GetGameID("xdim")].lValue = (int)&xdim;
|
||||
aGameVars[GetGameID("ydim")].lValue = (int)&ydim;
|
||||
aGameVars[GetGameID("windowx1")].lValue = (int)&windowx1;
|
||||
aGameVars[GetGameID("windowx2")].lValue = (int)&windowx2;
|
||||
aGameVars[GetGameID("windowy1")].lValue = (int)&windowy1;
|
||||
aGameVars[GetGameID("windowy2")].lValue = (int)&windowy2;
|
||||
aGameVars[GetGameID("totalclock")].lValue = (int)&totalclock;
|
||||
aGameVars[GetGameID("lastvisinc")].lValue = (int)&lastvisinc;
|
||||
aGameVars[GetGameID("numsectors")].lValue = (int)&numsectors;
|
||||
aGameVars[GetGameID("numplayers")].lValue = (int)&numplayers;
|
||||
aGameVars[GetGameID("viewingrange")].lValue = (int)&viewingrange;
|
||||
aGameVars[GetGameID("yxaspect")].lValue = (int)&yxaspect;
|
||||
aGameVars[GetGameID("gravitationalconstant")].lValue = (int)&gc;
|
||||
aGameVars[GetGameID("gametype_flags")].lValue = (int)&gametype_flags[ud.coop];
|
||||
aGameVars[GetGameID("framerate")].lValue = (int)&framerate;
|
||||
|
||||
aGameVars[GetGameID("camerax")].lValue = (long)&ud.camerax;
|
||||
aGameVars[GetGameID("cameray")].lValue = (long)&ud.cameray;
|
||||
aGameVars[GetGameID("cameraz")].lValue = (long)&ud.cameraz;
|
||||
aGameVars[GetGameID("cameraang")].lValue = (long)&ud.cameraang;
|
||||
aGameVars[GetGameID("camerahoriz")].lValue = (long)&ud.camerahoriz;
|
||||
aGameVars[GetGameID("camerasect")].lValue = (long)&ud.camerasect;
|
||||
aGameVars[GetGameID("camerax")].lValue = (int)&ud.camerax;
|
||||
aGameVars[GetGameID("cameray")].lValue = (int)&ud.cameray;
|
||||
aGameVars[GetGameID("cameraz")].lValue = (int)&ud.cameraz;
|
||||
aGameVars[GetGameID("cameraang")].lValue = (int)&ud.cameraang;
|
||||
aGameVars[GetGameID("camerahoriz")].lValue = (int)&ud.camerahoriz;
|
||||
aGameVars[GetGameID("camerasect")].lValue = (int)&ud.camerasect;
|
||||
|
||||
aGameVars[GetGameID("myx")].lValue = (long)&myx;
|
||||
aGameVars[GetGameID("myy")].lValue = (long)&myy;
|
||||
aGameVars[GetGameID("myz")].lValue = (long)&myz;
|
||||
aGameVars[GetGameID("omyx")].lValue = (long)&omyx;
|
||||
aGameVars[GetGameID("omyy")].lValue = (long)&omyy;
|
||||
aGameVars[GetGameID("omyz")].lValue = (long)&omyz;
|
||||
aGameVars[GetGameID("myxvel")].lValue = (long)&myxvel;
|
||||
aGameVars[GetGameID("myyvel")].lValue = (long)&myyvel;
|
||||
aGameVars[GetGameID("myzvel")].lValue = (long)&myzvel;
|
||||
aGameVars[GetGameID("myx")].lValue = (int)&myx;
|
||||
aGameVars[GetGameID("myy")].lValue = (int)&myy;
|
||||
aGameVars[GetGameID("myz")].lValue = (int)&myz;
|
||||
aGameVars[GetGameID("omyx")].lValue = (int)&omyx;
|
||||
aGameVars[GetGameID("omyy")].lValue = (int)&omyy;
|
||||
aGameVars[GetGameID("omyz")].lValue = (int)&omyz;
|
||||
aGameVars[GetGameID("myxvel")].lValue = (int)&myxvel;
|
||||
aGameVars[GetGameID("myyvel")].lValue = (int)&myyvel;
|
||||
aGameVars[GetGameID("myzvel")].lValue = (int)&myzvel;
|
||||
|
||||
aGameVars[GetGameID("myhoriz")].lValue = (long)&myhoriz;
|
||||
aGameVars[GetGameID("myhorizoff")].lValue = (long)&myhorizoff;
|
||||
aGameVars[GetGameID("omyhoriz")].lValue = (long)&omyhoriz;
|
||||
aGameVars[GetGameID("omyhorizoff")].lValue = (long)&omyhorizoff;
|
||||
aGameVars[GetGameID("myang")].lValue = (long)&myang;
|
||||
aGameVars[GetGameID("omyang")].lValue = (long)&omyang;
|
||||
aGameVars[GetGameID("mycursectnum")].lValue = (long)&mycursectnum;
|
||||
aGameVars[GetGameID("myjumpingcounter")].lValue = (long)&myjumpingcounter;
|
||||
aGameVars[GetGameID("myhoriz")].lValue = (int)&myhoriz;
|
||||
aGameVars[GetGameID("myhorizoff")].lValue = (int)&myhorizoff;
|
||||
aGameVars[GetGameID("omyhoriz")].lValue = (int)&omyhoriz;
|
||||
aGameVars[GetGameID("omyhorizoff")].lValue = (int)&omyhorizoff;
|
||||
aGameVars[GetGameID("myang")].lValue = (int)&myang;
|
||||
aGameVars[GetGameID("omyang")].lValue = (int)&omyang;
|
||||
aGameVars[GetGameID("mycursectnum")].lValue = (int)&mycursectnum;
|
||||
aGameVars[GetGameID("myjumpingcounter")].lValue = (int)&myjumpingcounter;
|
||||
|
||||
aGameVars[GetGameID("myjumpingtoggle")].lValue = (long)&myjumpingtoggle;
|
||||
aGameVars[GetGameID("myonground")].lValue = (long)&myonground;
|
||||
aGameVars[GetGameID("myhardlanding")].lValue = (long)&myhardlanding;
|
||||
aGameVars[GetGameID("myreturntocenter")].lValue = (long)&myreturntocenter;
|
||||
aGameVars[GetGameID("myjumpingtoggle")].lValue = (int)&myjumpingtoggle;
|
||||
aGameVars[GetGameID("myonground")].lValue = (int)&myonground;
|
||||
aGameVars[GetGameID("myhardlanding")].lValue = (int)&myhardlanding;
|
||||
aGameVars[GetGameID("myreturntocenter")].lValue = (int)&myreturntocenter;
|
||||
|
||||
aGameVars[GetGameID("display_mirror")].lValue = (long)&display_mirror;
|
||||
aGameVars[GetGameID("randomseed")].lValue = (long)&randomseed;
|
||||
aGameVars[GetGameID("display_mirror")].lValue = (int)&display_mirror;
|
||||
aGameVars[GetGameID("randomseed")].lValue = (int)&randomseed;
|
||||
}
|
||||
|
|
|
@ -28,20 +28,20 @@ char MusicPtr[72000*2];
|
|||
short global_random;
|
||||
short neartagsector, neartagwall, neartagsprite;
|
||||
|
||||
long neartaghitdist,lockclock,start_armour_amount;
|
||||
int neartaghitdist,lockclock,start_armour_amount;
|
||||
// JBF: gc modified to default to Atomic ed. default when using 1.3d CONs
|
||||
long gc=176;
|
||||
int gc=176;
|
||||
|
||||
// long temp_data[MAXSPRITES][6];
|
||||
// int temp_data[MAXSPRITES][6];
|
||||
actordata_t hittype[MAXSPRITES];
|
||||
|
||||
short spriteq[1024],spriteqloc,spriteqamount=64;
|
||||
animwalltype animwall[MAXANIMWALLS];
|
||||
short numanimwalls;
|
||||
long *animateptr[MAXANIMATES], animategoal[MAXANIMATES], animatevel[MAXANIMATES], animatecnt;
|
||||
// long oanimateval[MAXANIMATES];
|
||||
int *animateptr[MAXANIMATES], animategoal[MAXANIMATES], animatevel[MAXANIMATES], animatecnt;
|
||||
// int oanimateval[MAXANIMATES];
|
||||
short animatesect[MAXANIMATES];
|
||||
long msx[2048],msy[2048];
|
||||
int msx[2048],msy[2048];
|
||||
short cyclers[MAXCYCLERS][6],numcyclers;
|
||||
|
||||
char *fta_quotes[MAXQUOTES],*redefined_quotes[MAXQUOTES];
|
||||
|
@ -77,7 +77,7 @@ sound_t g_sounds[ MAXSOUNDS ];
|
|||
|
||||
char numplayersprites,loadfromgrouponly=0,earthquaketime;
|
||||
|
||||
long fricxv,fricyv;
|
||||
int fricxv,fricyv;
|
||||
playerdata_t g_player[MAXPLAYERS];
|
||||
input inputfifo[MOVEFIFOSIZ][MAXPLAYERS];
|
||||
playerspawn_t g_PlayerSpawnPoints[MAXPLAYERS];
|
||||
|
@ -85,13 +85,13 @@ user_defs ud;
|
|||
|
||||
char pus, pub;
|
||||
char syncstat;
|
||||
long syncvaltail, syncvaltottail;
|
||||
int syncvaltail, syncvaltottail;
|
||||
|
||||
input loc;
|
||||
input recsync[RECSYNCBUFSIZ];
|
||||
long avgfvel, avgsvel, avgavel, avghorz, avgbits, avgextbits;
|
||||
int avgfvel, avgsvel, avgavel, avghorz, avgbits, avgextbits;
|
||||
|
||||
long movefifosendplc;
|
||||
int movefifosendplc;
|
||||
|
||||
//Multiplayer syncing variables
|
||||
short screenpeek;
|
||||
|
@ -99,14 +99,14 @@ short screenpeek;
|
|||
//Game recording variables
|
||||
|
||||
char ready2send;
|
||||
long vel, svel, angvel, horiz, ototalclock, respawnactortime=768, respawnitemtime=768, groupfile;
|
||||
int vel, svel, angvel, horiz, ototalclock, respawnactortime=768, respawnitemtime=768, groupfile;
|
||||
|
||||
long *scriptptr,*insptr,*labelcode,labelcnt,defaultlabelcnt,*labeltype;
|
||||
long *actorscrptr[MAXTILES],*parsing_actor;
|
||||
int *scriptptr,*insptr,*labelcode,labelcnt,defaultlabelcnt,*labeltype;
|
||||
int *actorscrptr[MAXTILES],*parsing_actor;
|
||||
char *label;
|
||||
char *music_pointer;
|
||||
char actortype[MAXTILES];
|
||||
long *script = NULL;
|
||||
int *script = NULL;
|
||||
|
||||
int g_ScriptSize = 16384;
|
||||
|
||||
|
@ -136,35 +136,35 @@ short weaponsandammosprites[15] =
|
|||
FREEZEAMMO__STATIC
|
||||
};
|
||||
|
||||
long impact_damage;
|
||||
int impact_damage;
|
||||
int g_ScriptDebug;
|
||||
|
||||
//GLOBAL.C - replace the end "my's" with this
|
||||
long myx, omyx, myxvel, myy, omyy, myyvel, myz, omyz, myzvel;
|
||||
int myx, omyx, myxvel, myy, omyy, myyvel, myz, omyz, myzvel;
|
||||
short myhoriz, omyhoriz, myhorizoff, omyhorizoff;
|
||||
short myang, omyang, mycursectnum, myjumpingcounter;
|
||||
|
||||
char myjumpingtoggle, myonground, myhardlanding, myreturntocenter;
|
||||
signed char multiwho, multipos, multiwhat, multiflag;
|
||||
|
||||
long fakemovefifoplc,movefifoplc;
|
||||
long myxbak[MOVEFIFOSIZ], myybak[MOVEFIFOSIZ], myzbak[MOVEFIFOSIZ];
|
||||
long myhorizbak[MOVEFIFOSIZ],dukefriction = 0xcc00, show_shareware;
|
||||
int fakemovefifoplc,movefifoplc;
|
||||
int myxbak[MOVEFIFOSIZ], myybak[MOVEFIFOSIZ], myzbak[MOVEFIFOSIZ];
|
||||
int myhorizbak[MOVEFIFOSIZ],dukefriction = 0xcc00, show_shareware;
|
||||
|
||||
short myangbak[MOVEFIFOSIZ];
|
||||
char myname[32];
|
||||
int camerashitable,freezerhurtowner=0,lasermode=0;
|
||||
int networkmode = 255, movesperpacket = 1,gamequit = 0,everyothertime;
|
||||
long numfreezebounces=3,rpgblastradius,pipebombblastradius,tripbombblastradius,shrinkerblastradius,morterblastradius,bouncemineblastradius,seenineblastradius;
|
||||
int numfreezebounces=3,rpgblastradius,pipebombblastradius,tripbombblastradius,shrinkerblastradius,morterblastradius,bouncemineblastradius,seenineblastradius;
|
||||
STATUSBARTYPE sbar;
|
||||
|
||||
long mymaxlag, otherminlag, bufferjitter = 1;
|
||||
int mymaxlag, otherminlag, bufferjitter = 1;
|
||||
short numclouds,clouds[128],cloudx[128],cloudy[128];
|
||||
long cloudtotalclock = 0,totalmemory = 0;
|
||||
long numinterpolations = 0, startofdynamicinterpolations = 0;
|
||||
long oldipos[MAXINTERPOLATIONS];
|
||||
long bakipos[MAXINTERPOLATIONS];
|
||||
long *curipos[MAXINTERPOLATIONS];
|
||||
int cloudtotalclock = 0,totalmemory = 0;
|
||||
int numinterpolations = 0, startofdynamicinterpolations = 0;
|
||||
int oldipos[MAXINTERPOLATIONS];
|
||||
int bakipos[MAXINTERPOLATIONS];
|
||||
int *curipos[MAXINTERPOLATIONS];
|
||||
|
||||
int nextvoxid = 0;
|
||||
|
||||
|
|
|
@ -138,14 +138,14 @@ int ScanGroups(void)
|
|||
if (fstat(fh, &st)) continue;
|
||||
|
||||
initprintf(" Checksumming %s...", sidx->name);
|
||||
crc32init((unsigned long *)&crcval);
|
||||
crc32init((unsigned int *)&crcval);
|
||||
do
|
||||
{
|
||||
b = read(fh, buf, sizeof(buf));
|
||||
if (b > 0) crc32block((unsigned long *)&crcval, (unsigned char *)buf, b);
|
||||
if (b > 0) crc32block((unsigned int *)&crcval, (unsigned char *)buf, b);
|
||||
}
|
||||
while (b == sizeof(buf));
|
||||
crc32finish((unsigned long *)&crcval);
|
||||
crc32finish((unsigned int *)&crcval);
|
||||
close(fh);
|
||||
initprintf(" Done\n");
|
||||
|
||||
|
|
|
@ -114,14 +114,14 @@ typedef struct
|
|||
short loopcount;
|
||||
short RunningStatus;
|
||||
unsigned time;
|
||||
long FPSecondsPerTick;
|
||||
int FPSecondsPerTick;
|
||||
short tick;
|
||||
short beat;
|
||||
short measure;
|
||||
short BeatsPerMeasure;
|
||||
short TicksPerBeat;
|
||||
short TimeBase;
|
||||
long delay;
|
||||
int delay;
|
||||
short active;
|
||||
} songcontext;
|
||||
|
||||
|
@ -130,7 +130,7 @@ typedef struct
|
|||
unsigned char *start;
|
||||
unsigned char *pos;
|
||||
|
||||
long delay;
|
||||
int delay;
|
||||
short active;
|
||||
short RunningStatus;
|
||||
|
||||
|
@ -142,8 +142,8 @@ typedef struct
|
|||
char EMIDI_VolumeChange;
|
||||
} track;
|
||||
|
||||
static long _MIDI_ReadNumber( void *from, size_t size );
|
||||
static long _MIDI_ReadDelta( track *ptr );
|
||||
static int _MIDI_ReadNumber( void *from, size_t size );
|
||||
static int _MIDI_ReadDelta( track *ptr );
|
||||
static void _MIDI_ResetTracks( void );
|
||||
static void _MIDI_AdvanceTick( void );
|
||||
static void _MIDI_MetaEvent( track *Track );
|
||||
|
|
|
@ -103,35 +103,35 @@ typedef struct VoiceNode
|
|||
|
||||
playbackstatus ( *GetSound )( struct VoiceNode *voice );
|
||||
|
||||
void ( *mix )( unsigned long position, unsigned long rate,
|
||||
char *start, unsigned long length );
|
||||
void ( *mix )( unsigned int position, unsigned int rate,
|
||||
char *start, unsigned int length );
|
||||
|
||||
char *NextBlock;
|
||||
char *LoopStart;
|
||||
char *LoopEnd;
|
||||
unsigned LoopCount;
|
||||
unsigned long LoopSize;
|
||||
unsigned long BlockLength;
|
||||
unsigned int LoopSize;
|
||||
unsigned int BlockLength;
|
||||
|
||||
unsigned long PitchScale;
|
||||
unsigned long FixedPointBufferSize;
|
||||
unsigned int PitchScale;
|
||||
unsigned int FixedPointBufferSize;
|
||||
|
||||
char *sound;
|
||||
unsigned long length;
|
||||
unsigned long SamplingRate;
|
||||
unsigned long RateScale;
|
||||
unsigned long position;
|
||||
unsigned int length;
|
||||
unsigned int SamplingRate;
|
||||
unsigned int RateScale;
|
||||
unsigned int position;
|
||||
int Playing;
|
||||
|
||||
int handle;
|
||||
int priority;
|
||||
|
||||
void ( *DemandFeed )( char **ptr, unsigned long *length );
|
||||
void ( *DemandFeed )( char **ptr, unsigned int *length );
|
||||
|
||||
short *LeftVolume;
|
||||
short *RightVolume;
|
||||
|
||||
unsigned long callbackval;
|
||||
unsigned int callbackval;
|
||||
|
||||
} VoiceNode;
|
||||
|
||||
|
@ -175,18 +175,18 @@ typedef struct
|
|||
typedef struct
|
||||
{
|
||||
char RIFF[ 4 ];
|
||||
unsigned long file_size;
|
||||
unsigned int file_size;
|
||||
char WAVE[ 4 ];
|
||||
char fmt[ 4 ];
|
||||
unsigned long format_size;
|
||||
unsigned int format_size;
|
||||
} riff_header;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short wFormatTag;
|
||||
unsigned short nChannels;
|
||||
unsigned long nSamplesPerSec;
|
||||
unsigned long nAvgBytesPerSec;
|
||||
unsigned int nSamplesPerSec;
|
||||
unsigned int nAvgBytesPerSec;
|
||||
unsigned short nBlockAlign;
|
||||
unsigned short nBitsPerSample;
|
||||
} format_header;
|
||||
|
@ -194,7 +194,7 @@ typedef struct
|
|||
typedef struct
|
||||
{
|
||||
unsigned char DATA[ 4 ];
|
||||
unsigned long size;
|
||||
unsigned int size;
|
||||
} data_header;
|
||||
|
||||
typedef MONO8 VOLUME8[ 256 ];
|
||||
|
@ -222,13 +222,13 @@ static short *MV_GetVolumeTable( int vol );
|
|||
|
||||
static void MV_SetVoiceMixMode( VoiceNode *voice );
|
||||
|
||||
static void MV_SetVoicePitch( VoiceNode *voice, unsigned long rate, int pitchoffset );
|
||||
static void MV_SetVoicePitch( VoiceNode *voice, unsigned int rate, int pitchoffset );
|
||||
static void MV_CalcVolume( int MaxLevel );
|
||||
static void MV_CalcPanTable( void );
|
||||
|
||||
void ClearBuffer_DW(void *ptr, long data, long length)
|
||||
void ClearBuffer_DW(void *ptr, int data, int length)
|
||||
{
|
||||
long *pptr = ptr;
|
||||
int *pptr = ptr;
|
||||
for (; length>0; length--) *(pptr++) = data;
|
||||
}
|
||||
|
||||
|
@ -283,29 +283,29 @@ parm [ edi ] [ eax ] [ ecx ] modify exact [ ecx edi ];
|
|||
#endif
|
||||
|
||||
|
||||
void CDEC MV_Mix8BitMono( unsigned long position, unsigned long rate,
|
||||
char *start, unsigned long length );
|
||||
void CDEC MV_Mix8BitMono( unsigned int position, unsigned int rate,
|
||||
char *start, unsigned int length );
|
||||
|
||||
void CDEC MV_Mix8BitStereo( unsigned long position,
|
||||
unsigned long rate, char *start, unsigned long length );
|
||||
void CDEC MV_Mix8BitStereo( unsigned int position,
|
||||
unsigned int rate, char *start, unsigned int length );
|
||||
|
||||
void CDEC MV_Mix16BitMono( unsigned long position,
|
||||
unsigned long rate, char *start, unsigned long length );
|
||||
void CDEC MV_Mix16BitMono( unsigned int position,
|
||||
unsigned int rate, char *start, unsigned int length );
|
||||
|
||||
void CDEC MV_Mix16BitStereo( unsigned long position,
|
||||
unsigned long rate, char *start, unsigned long length );
|
||||
void CDEC MV_Mix16BitStereo( unsigned int position,
|
||||
unsigned int rate, char *start, unsigned int length );
|
||||
|
||||
void CDEC MV_Mix16BitMono16( unsigned long position,
|
||||
unsigned long rate, char *start, unsigned long length );
|
||||
void CDEC MV_Mix16BitMono16( unsigned int position,
|
||||
unsigned int rate, char *start, unsigned int length );
|
||||
|
||||
void CDEC MV_Mix8BitMono16( unsigned long position, unsigned long rate,
|
||||
char *start, unsigned long length );
|
||||
void CDEC MV_Mix8BitMono16( unsigned int position, unsigned int rate,
|
||||
char *start, unsigned int length );
|
||||
|
||||
void CDEC MV_Mix8BitStereo16( unsigned long position,
|
||||
unsigned long rate, char *start, unsigned long length );
|
||||
void CDEC MV_Mix8BitStereo16( unsigned int position,
|
||||
unsigned int rate, char *start, unsigned int length );
|
||||
|
||||
void CDEC MV_Mix16BitStereo16( unsigned long position,
|
||||
unsigned long rate, char *start, unsigned long length );
|
||||
void CDEC MV_Mix16BitStereo16( unsigned int position,
|
||||
unsigned int rate, char *start, unsigned int length );
|
||||
|
||||
void CDEC MV_16BitReverb( char *src, char *dest, VOLUME16 *volume, int count );
|
||||
void CDEC MV_8BitReverb( signed char *src, signed char *dest, VOLUME16 *volume, int count );
|
||||
|
|
|
@ -34,11 +34,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define dprintOSD(...)
|
||||
|
||||
#ifdef WINDOWS
|
||||
extern long hWindow;
|
||||
extern int hWindow;
|
||||
#endif
|
||||
|
||||
|
||||
void(*FX_CallBackFunc)(unsigned long) = NULL;
|
||||
void(*FX_CallBackFunc)(unsigned int) = NULL;
|
||||
int FX_ErrorCode = FX_Ok;
|
||||
|
||||
#define FX_SetErrorCode( status ) \
|
||||
|
@ -49,9 +49,9 @@ FSOUND_SAMPLE * FX_Samples[MAXSOUNDS + 11]; // 11 remote ridicules
|
|||
int FX_NumVoices = 0;
|
||||
static char chtoggle=0;
|
||||
static char *chstates=NULL, *chstatesa, *chstatesb;
|
||||
static long *chcallvals=NULL;
|
||||
static int *chcallvals=NULL;
|
||||
|
||||
int FX_ReadVOCInfo(char *data, long size, int *samplerate, int *channels, int *samplesize, long *datalen);
|
||||
int FX_ReadVOCInfo(char *data, int size, int *samplerate, int *channels, int *samplesize, int *datalen);
|
||||
int FX_ReadVOCData(char *data, char *buf, int bufferlen, char eightbit);
|
||||
|
||||
int FX_SimulateCallbacks(void);
|
||||
|
@ -146,10 +146,10 @@ int FX_Init(int SoundCard, int numvoices, int numchannels, int samplebits, unsig
|
|||
|
||||
chtoggle=0;
|
||||
if (chstates) free(chstates);
|
||||
chstates = (char*)malloc(numvoices*2 + sizeof(long)*numvoices);
|
||||
memset(chstates,0,numvoices*2 + sizeof(long)*numvoices);
|
||||
chstates = (char*)malloc(numvoices*2 + sizeof(int)*numvoices);
|
||||
memset(chstates,0,numvoices*2 + sizeof(int)*numvoices);
|
||||
|
||||
chcallvals = (long*)(chstates + numvoices*2);
|
||||
chcallvals = (int*)(chstates + numvoices*2);
|
||||
chstatesa = chstates;
|
||||
chstatesb = chstates + numvoices;
|
||||
|
||||
|
@ -192,7 +192,7 @@ int FX_Shutdown(void)
|
|||
Sets the function to call when a voice is done.
|
||||
---------------------------------------------------------------------*/
|
||||
|
||||
int FX_SetCallBack(void(*function)(unsigned long))
|
||||
int FX_SetCallBack(void(*function)(unsigned int))
|
||||
{
|
||||
FX_CallBackFunc = function;
|
||||
FX_SetErrorCode(FX_Ok);
|
||||
|
@ -281,14 +281,14 @@ int FX_VoiceAvailable(int priority)
|
|||
int FX_PlayLoopedVOC
|
||||
(
|
||||
char *ptr,
|
||||
long loopstart,
|
||||
long loopend,
|
||||
int loopstart,
|
||||
int loopend,
|
||||
int pitchoffset,
|
||||
int vol,
|
||||
int left,
|
||||
int right,
|
||||
int priority,
|
||||
unsigned long callbackval
|
||||
unsigned int callbackval
|
||||
)
|
||||
{
|
||||
return FX_PlayLoopedSound(pitchoffset, vol, callbackval);
|
||||
|
@ -304,14 +304,14 @@ int FX_PlayLoopedVOC
|
|||
int FX_PlayLoopedWAV
|
||||
(
|
||||
char *ptr,
|
||||
long loopstart,
|
||||
long loopend,
|
||||
int loopstart,
|
||||
int loopend,
|
||||
int pitchoffset,
|
||||
int vol,
|
||||
int left,
|
||||
int right,
|
||||
int priority,
|
||||
unsigned long callbackval
|
||||
unsigned int callbackval
|
||||
)
|
||||
{
|
||||
return FX_PlayLoopedSound(pitchoffset, vol, callbackval);
|
||||
|
@ -332,7 +332,7 @@ int FX_PlayVOC3D
|
|||
int angle,
|
||||
int distance,
|
||||
int priority,
|
||||
unsigned long callbackval
|
||||
unsigned int callbackval
|
||||
)
|
||||
{
|
||||
return FX_PlayPositionedSound(pitchoffset, angle, distance, callbackval);
|
||||
|
@ -353,7 +353,7 @@ int FX_PlayWAV3D
|
|||
int angle,
|
||||
int distance,
|
||||
int priority,
|
||||
unsigned long callbackval
|
||||
unsigned int callbackval
|
||||
)
|
||||
{
|
||||
return FX_PlayPositionedSound(pitchoffset, angle, distance, callbackval);
|
||||
|
@ -424,7 +424,7 @@ int FX_StopAllSounds(void)
|
|||
int FX_PlayLoopedSound(
|
||||
int pitchoffset,
|
||||
int vol,
|
||||
unsigned long num
|
||||
unsigned int num
|
||||
)
|
||||
{
|
||||
int chan;
|
||||
|
@ -460,7 +460,7 @@ int FX_PlayPositionedSound(
|
|||
int pitchoffset,
|
||||
int angle,
|
||||
int distance,
|
||||
unsigned long num
|
||||
unsigned int num
|
||||
)
|
||||
{
|
||||
int chan;
|
||||
|
@ -491,12 +491,12 @@ int FX_PlayPositionedSound(
|
|||
}
|
||||
|
||||
|
||||
int FX_LoadSample(char *ptr, long size, unsigned long number, int priority)
|
||||
int FX_LoadSample(char *ptr, int size, unsigned int number, int priority)
|
||||
{
|
||||
FSOUND_SAMPLE *samp = NULL;
|
||||
int samplerate=0, channels=0, samplesize=0;
|
||||
int flags=0;
|
||||
long datalen=0;
|
||||
int datalen=0;
|
||||
void *ptr1,*ptr2;
|
||||
int ptr1len,ptr2len;
|
||||
|
||||
|
@ -532,7 +532,7 @@ int FX_LoadSample(char *ptr, long size, unsigned long number, int priority)
|
|||
}
|
||||
|
||||
|
||||
int FX_SampleLoaded(unsigned long number)
|
||||
int FX_SampleLoaded(unsigned int number)
|
||||
{
|
||||
return (FX_Samples[number] != NULL);
|
||||
}
|
||||
|
@ -541,7 +541,7 @@ int FX_SampleLoaded(unsigned long number)
|
|||
#define REGRESSTC(tc) (256000000/(65536-(tc)))
|
||||
#define REGRESSSR(sr) (1000000/(256-(sr)))
|
||||
|
||||
int FX_ReadVOCInfo(char *data, long size, int *samplerate, int *channels, int *samplesize, long *datalen)
|
||||
int FX_ReadVOCInfo(char *data, int size, int *samplerate, int *channels, int *samplesize, int *datalen)
|
||||
{
|
||||
short version,version2;
|
||||
char blocktype=0;
|
||||
|
@ -646,7 +646,7 @@ int FX_ReadVOCInfo(char *data, long size, int *samplerate, int *channels, int *s
|
|||
break;
|
||||
|
||||
case 9: /* sound data format 3 */
|
||||
*samplerate = *((long*)(ptr));
|
||||
*samplerate = *((int*)(ptr));
|
||||
*samplesize = ptr[4];
|
||||
*channels = ptr[5];
|
||||
if ((ptr[6] | (ptr[7] << 8)) != 0 &&
|
||||
|
|
|
@ -122,7 +122,7 @@ int FX_Shutdown
|
|||
|
||||
int FX_SetCallBack
|
||||
(
|
||||
void(*function)(unsigned long)
|
||||
void(*function)(unsigned int)
|
||||
)
|
||||
|
||||
{
|
||||
|
@ -227,14 +227,14 @@ int FX_VoiceAvailable
|
|||
int FX_PlayLoopedVOC
|
||||
(
|
||||
char *ptr,
|
||||
long loopstart,
|
||||
long loopend,
|
||||
int loopstart,
|
||||
int loopend,
|
||||
int pitchoffset,
|
||||
int vol,
|
||||
int left,
|
||||
int right,
|
||||
int priority,
|
||||
unsigned long callbackval
|
||||
unsigned int callbackval
|
||||
)
|
||||
|
||||
{
|
||||
|
@ -251,14 +251,14 @@ int FX_PlayLoopedVOC
|
|||
int FX_PlayLoopedWAV
|
||||
(
|
||||
char *ptr,
|
||||
long loopstart,
|
||||
long loopend,
|
||||
int loopstart,
|
||||
int loopend,
|
||||
int pitchoffset,
|
||||
int vol,
|
||||
int left,
|
||||
int right,
|
||||
int priority,
|
||||
unsigned long callbackval
|
||||
unsigned int callbackval
|
||||
)
|
||||
|
||||
{
|
||||
|
@ -280,7 +280,7 @@ int FX_PlayVOC3D
|
|||
int angle,
|
||||
int distance,
|
||||
int priority,
|
||||
unsigned long callbackval
|
||||
unsigned int callbackval
|
||||
)
|
||||
|
||||
{
|
||||
|
@ -302,7 +302,7 @@ int FX_PlayWAV3D
|
|||
int angle,
|
||||
int distance,
|
||||
int priority,
|
||||
unsigned long callbackval
|
||||
unsigned int callbackval
|
||||
)
|
||||
|
||||
{
|
||||
|
|
|
@ -341,7 +341,7 @@ int MUSIC_GetContext
|
|||
|
||||
void MUSIC_SetSongTick
|
||||
(
|
||||
unsigned long PositionInTicks
|
||||
unsigned int PositionInTicks
|
||||
)
|
||||
|
||||
{}
|
||||
|
@ -355,7 +355,7 @@ void MUSIC_SetSongTick
|
|||
|
||||
void MUSIC_SetSongTime
|
||||
(
|
||||
unsigned long milliseconds
|
||||
unsigned int milliseconds
|
||||
)
|
||||
|
||||
{}
|
||||
|
|
|
@ -24,7 +24,7 @@ void DB_SetXY( int x, int y );
|
|||
void DB_PutChar( char ch );
|
||||
int DB_PrintString( char *string );
|
||||
int DB_PrintNum( int number );
|
||||
int DB_PrintUnsigned( unsigned long number, int radix );
|
||||
int DB_PrintUnsigned( unsigned int number, int radix );
|
||||
int DB_printf( char *fmt, ... );
|
||||
|
||||
#endif
|
||||
|
|
|
@ -449,7 +449,7 @@ static DWORD WINAPI isr(LPVOID parm)
|
|||
{
|
||||
/*
|
||||
#define copybuf(S,D,c) \
|
||||
({ void *__S=(S), *__D=(D); long __c=(c); \
|
||||
({ void *__S=(S), *__D=(D); int __c=(c); \
|
||||
__asm__ __volatile__ ("rep; movsl" \
|
||||
: "+S" (__S), "+D" (__D), "+c" (__c) : : "memory", "cc"); \
|
||||
0; })
|
||||
|
|
|
@ -323,7 +323,7 @@ int FX_Shutdown
|
|||
|
||||
int FX_SetCallBack
|
||||
(
|
||||
void(*function)(unsigned long)
|
||||
void(*function)(unsigned int)
|
||||
)
|
||||
|
||||
{
|
||||
|
@ -612,7 +612,7 @@ int FX_PlayVOC
|
|||
int left,
|
||||
int right,
|
||||
int priority,
|
||||
unsigned long callbackval
|
||||
unsigned int callbackval
|
||||
)
|
||||
|
||||
{
|
||||
|
@ -639,14 +639,14 @@ int FX_PlayVOC
|
|||
int FX_PlayLoopedVOC
|
||||
(
|
||||
char *ptr,
|
||||
long loopstart,
|
||||
long loopend,
|
||||
int loopstart,
|
||||
int loopend,
|
||||
int pitchoffset,
|
||||
int vol,
|
||||
int left,
|
||||
int right,
|
||||
int priority,
|
||||
unsigned long callbackval
|
||||
unsigned int callbackval
|
||||
)
|
||||
|
||||
{
|
||||
|
@ -678,7 +678,7 @@ int FX_PlayWAV
|
|||
int left,
|
||||
int right,
|
||||
int priority,
|
||||
unsigned long callbackval
|
||||
unsigned int callbackval
|
||||
)
|
||||
|
||||
{
|
||||
|
@ -705,14 +705,14 @@ int FX_PlayWAV
|
|||
int FX_PlayLoopedWAV
|
||||
(
|
||||
char *ptr,
|
||||
long loopstart,
|
||||
long loopend,
|
||||
int loopstart,
|
||||
int loopend,
|
||||
int pitchoffset,
|
||||
int vol,
|
||||
int left,
|
||||
int right,
|
||||
int priority,
|
||||
unsigned long callbackval
|
||||
unsigned int callbackval
|
||||
)
|
||||
|
||||
{
|
||||
|
@ -744,7 +744,7 @@ int FX_PlayVOC3D
|
|||
int angle,
|
||||
int distance,
|
||||
int priority,
|
||||
unsigned long callbackval
|
||||
unsigned int callbackval
|
||||
)
|
||||
|
||||
{
|
||||
|
@ -776,7 +776,7 @@ int FX_PlayWAV3D
|
|||
int angle,
|
||||
int distance,
|
||||
int priority,
|
||||
unsigned long callbackval
|
||||
unsigned int callbackval
|
||||
)
|
||||
|
||||
{
|
||||
|
@ -803,14 +803,14 @@ int FX_PlayWAV3D
|
|||
int FX_PlayRaw
|
||||
(
|
||||
char *ptr,
|
||||
unsigned long length,
|
||||
unsigned int length,
|
||||
unsigned rate,
|
||||
int pitchoffset,
|
||||
int vol,
|
||||
int left,
|
||||
int right,
|
||||
int priority,
|
||||
unsigned long callbackval
|
||||
unsigned int callbackval
|
||||
)
|
||||
|
||||
{
|
||||
|
@ -837,7 +837,7 @@ int FX_PlayRaw
|
|||
int FX_PlayLoopedRaw
|
||||
(
|
||||
char *ptr,
|
||||
unsigned long length,
|
||||
unsigned int length,
|
||||
char *loopstart,
|
||||
char *loopend,
|
||||
unsigned rate,
|
||||
|
@ -846,7 +846,7 @@ int FX_PlayLoopedRaw
|
|||
int left,
|
||||
int right,
|
||||
int priority,
|
||||
unsigned long callbackval
|
||||
unsigned int callbackval
|
||||
)
|
||||
|
||||
{
|
||||
|
@ -982,14 +982,14 @@ int FX_StopAllSounds
|
|||
|
||||
int FX_StartDemandFeedPlayback
|
||||
(
|
||||
void(*function)(char **ptr, unsigned long *length),
|
||||
void(*function)(char **ptr, unsigned int *length),
|
||||
int rate,
|
||||
int pitchoffset,
|
||||
int vol,
|
||||
int left,
|
||||
int right,
|
||||
int priority,
|
||||
unsigned long callbackval
|
||||
unsigned int callbackval
|
||||
)
|
||||
|
||||
{
|
||||
|
|
|
@ -44,13 +44,13 @@ typedef struct
|
|||
|
||||
typedef struct
|
||||
{
|
||||
unsigned long Address;
|
||||
unsigned long Type;
|
||||
unsigned long Interrupt;
|
||||
unsigned long Dma8;
|
||||
unsigned long Dma16;
|
||||
unsigned long Midi;
|
||||
unsigned long Emu;
|
||||
unsigned int Address;
|
||||
unsigned int Type;
|
||||
unsigned int Interrupt;
|
||||
unsigned int Dma8;
|
||||
unsigned int Dma16;
|
||||
unsigned int Midi;
|
||||
unsigned int Emu;
|
||||
} fx_blaster_config;
|
||||
|
||||
enum FX_ERRORS
|
||||
|
@ -83,7 +83,7 @@ char *FX_ErrorString( int ErrorNumber );
|
|||
//int FX_SetupSoundBlaster( fx_blaster_config blaster, int *MaxVoices, int *MaxSampleBits, int *MaxChannels );
|
||||
int FX_Init( int SoundCard, int numvoices, int numchannels, int samplebits, unsigned mixrate );
|
||||
int FX_Shutdown( void );
|
||||
int FX_SetCallBack( void ( *function )( unsigned long ) );
|
||||
int FX_SetCallBack( void ( *function )( unsigned int ) );
|
||||
void FX_SetVolume( int volume );
|
||||
int FX_GetVolume( void );
|
||||
|
||||
|
@ -102,33 +102,33 @@ int FX_SetPitch( int handle, int pitchoffset );
|
|||
int FX_SetFrequency( int handle, int frequency );
|
||||
|
||||
int FX_PlayVOC( char *ptr, int pitchoffset, int vol, int left, int right,
|
||||
int priority, unsigned long callbackval );
|
||||
int FX_PlayLoopedVOC( char *ptr, long loopstart, long loopend,
|
||||
int priority, unsigned int callbackval );
|
||||
int FX_PlayLoopedVOC( char *ptr, int loopstart, int loopend,
|
||||
int pitchoffset, int vol, int left, int right, int priority,
|
||||
unsigned long callbackval );
|
||||
unsigned int callbackval );
|
||||
int FX_PlayWAV( char *ptr, int pitchoffset, int vol, int left, int right,
|
||||
int priority, unsigned long callbackval );
|
||||
int FX_PlayLoopedWAV( char *ptr, long loopstart, long loopend,
|
||||
int priority, unsigned int callbackval );
|
||||
int FX_PlayLoopedWAV( char *ptr, int loopstart, int loopend,
|
||||
int pitchoffset, int vol, int left, int right, int priority,
|
||||
unsigned long callbackval );
|
||||
unsigned int callbackval );
|
||||
int FX_PlayVOC3D( char *ptr, int pitchoffset, int angle, int distance,
|
||||
int priority, unsigned long callbackval );
|
||||
int priority, unsigned int callbackval );
|
||||
int FX_PlayWAV3D( char *ptr, int pitchoffset, int angle, int distance,
|
||||
int priority, unsigned long callbackval );
|
||||
int FX_PlayRaw( char *ptr, unsigned long length, unsigned rate,
|
||||
int priority, unsigned int callbackval );
|
||||
int FX_PlayRaw( char *ptr, unsigned int length, unsigned rate,
|
||||
int pitchoffset, int vol, int left, int right, int priority,
|
||||
unsigned long callbackval );
|
||||
int FX_PlayLoopedRaw( char *ptr, unsigned long length, char *loopstart,
|
||||
unsigned int callbackval );
|
||||
int FX_PlayLoopedRaw( char *ptr, unsigned int length, char *loopstart,
|
||||
char *loopend, unsigned rate, int pitchoffset, int vol, int left,
|
||||
int right, int priority, unsigned long callbackval );
|
||||
int right, int priority, unsigned int callbackval );
|
||||
int FX_Pan3D( int handle, int angle, int distance );
|
||||
int FX_SoundActive( int handle );
|
||||
int FX_SoundsPlaying( void );
|
||||
int FX_StopSound( int handle );
|
||||
int FX_StopAllSounds( void );
|
||||
int FX_StartDemandFeedPlayback( void ( *function )( char **ptr, unsigned long *length ),
|
||||
int FX_StartDemandFeedPlayback( void ( *function )( char **ptr, unsigned int *length ),
|
||||
int rate, int pitchoffset, int vol, int left, int right,
|
||||
int priority, unsigned long callbackval );
|
||||
int priority, unsigned int callbackval );
|
||||
int FX_StartRecording( int MixRate, void ( *function )( char *ptr, int length ) );
|
||||
void FX_StopRecord( void );
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ enum FX_ERRORS
|
|||
char *FX_ErrorString( int ErrorNumber );
|
||||
int FX_Init( int SoundCard, int numvoices, int numchannels, int samplebits, unsigned mixrate );
|
||||
int FX_Shutdown( void );
|
||||
int FX_SetCallBack( void ( *function )( unsigned long ) );
|
||||
int FX_SetCallBack( void ( *function )( unsigned int ) );
|
||||
void FX_SetVolume( int volume );
|
||||
|
||||
void FX_SetReverseStereo( int setting );
|
||||
|
@ -52,26 +52,26 @@ void FX_SetReverbDelay( int delay );
|
|||
|
||||
int FX_VoiceAvailable( int priority );
|
||||
|
||||
int FX_PlayLoopedVOC( char *ptr, long loopstart, long loopend,
|
||||
int FX_PlayLoopedVOC( char *ptr, int loopstart, int loopend,
|
||||
int pitchoffset, int vol, int left, int right, int priority,
|
||||
unsigned long callbackval );
|
||||
int FX_PlayLoopedWAV( char *ptr, long loopstart, long loopend,
|
||||
unsigned int callbackval );
|
||||
int FX_PlayLoopedWAV( char *ptr, int loopstart, int loopend,
|
||||
int pitchoffset, int vol, int left, int right, int priority,
|
||||
unsigned long callbackval );
|
||||
unsigned int callbackval );
|
||||
int FX_PlayVOC3D( char *ptr, int pitchoffset, int angle, int distance,
|
||||
int priority, unsigned long callbackval );
|
||||
int priority, unsigned int callbackval );
|
||||
int FX_PlayWAV3D( char *ptr, int pitchoffset, int angle, int distance,
|
||||
int priority, unsigned long callbackval );
|
||||
int priority, unsigned int callbackval );
|
||||
|
||||
int FX_Pan3D( int handle, int angle, int distance );
|
||||
int FX_StopSound( int handle );
|
||||
int FX_StopAllSounds( void );
|
||||
|
||||
int FX_LoadSample(char *ptr, long size, unsigned long number, int priority);
|
||||
int FX_SampleLoaded(unsigned long number);
|
||||
int FX_LoadSample(char *ptr, int size, unsigned int number, int priority);
|
||||
int FX_SampleLoaded(unsigned int number);
|
||||
|
||||
int FX_PlayLoopedSound(int,int,unsigned long);
|
||||
int FX_PlayPositionedSound(int,int,int,unsigned long);
|
||||
int FX_PlayLoopedSound(int,int,unsigned int);
|
||||
int FX_PlayPositionedSound(int,int,int,unsigned int);
|
||||
|
||||
int FX_SimulateCallbacks(void);
|
||||
|
||||
|
|
|
@ -31,8 +31,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#ifndef __INTERRUPT_H
|
||||
#define __INTERRUPT_H
|
||||
|
||||
unsigned long DisableInterrupts( void );
|
||||
void RestoreInterrupts( unsigned long flags );
|
||||
unsigned int DisableInterrupts( void );
|
||||
void RestoreInterrupts( unsigned int flags );
|
||||
|
||||
#ifdef PLAT_DOS
|
||||
#pragma aux DisableInterrupts = \
|
||||
|
|
|
@ -75,14 +75,14 @@ static unsigned _MIDI_Time;
|
|||
static int _MIDI_BeatsPerMeasure;
|
||||
static int _MIDI_TicksPerBeat;
|
||||
static int _MIDI_TimeBase;
|
||||
static long _MIDI_FPSecondsPerTick;
|
||||
static int _MIDI_FPSecondsPerTick;
|
||||
static unsigned _MIDI_TotalTime;
|
||||
static int _MIDI_TotalTicks;
|
||||
static int _MIDI_TotalBeats;
|
||||
static int _MIDI_TotalMeasures;
|
||||
|
||||
unsigned long _MIDI_PositionInTicks;
|
||||
unsigned long _MIDI_GlobalPositionInTicks;
|
||||
unsigned int _MIDI_PositionInTicks;
|
||||
unsigned int _MIDI_GlobalPositionInTicks;
|
||||
|
||||
static int _MIDI_Context;
|
||||
|
||||
|
@ -118,7 +118,7 @@ char MIDI_PatchMap[ 128 ];
|
|||
Reads a variable length number from a MIDI track.
|
||||
---------------------------------------------------------------------*/
|
||||
|
||||
static long _MIDI_ReadNumber
|
||||
static int _MIDI_ReadNumber
|
||||
(
|
||||
void *from,
|
||||
size_t size
|
||||
|
@ -126,7 +126,7 @@ static long _MIDI_ReadNumber
|
|||
|
||||
{
|
||||
unsigned char *FromPtr;
|
||||
long value;
|
||||
int value;
|
||||
|
||||
if (size > 4)
|
||||
{
|
||||
|
@ -152,13 +152,13 @@ static long _MIDI_ReadNumber
|
|||
Reads a variable length encoded delta delay time from the MIDI data.
|
||||
---------------------------------------------------------------------*/
|
||||
|
||||
static long _MIDI_ReadDelta
|
||||
static int _MIDI_ReadDelta
|
||||
(
|
||||
track *ptr
|
||||
)
|
||||
|
||||
{
|
||||
long value;
|
||||
int value;
|
||||
unsigned char c;
|
||||
|
||||
GET_NEXT_EVENT(ptr, value);
|
||||
|
@ -290,7 +290,7 @@ static void _MIDI_MetaEvent
|
|||
int command;
|
||||
int length;
|
||||
int denominator;
|
||||
long tempo;
|
||||
int tempo;
|
||||
|
||||
GET_NEXT_EVENT(Track, command);
|
||||
GET_NEXT_EVENT(Track, length);
|
||||
|
@ -1200,8 +1200,8 @@ int MIDI_PlaySong
|
|||
{
|
||||
int numtracks;
|
||||
int format;
|
||||
long headersize;
|
||||
long tracklength;
|
||||
int headersize;
|
||||
int tracklength;
|
||||
track *CurrentTrack;
|
||||
unsigned char *ptr;
|
||||
int status;
|
||||
|
@ -1220,7 +1220,7 @@ int MIDI_PlaySong
|
|||
return(MIDI_NullMidiModule);
|
||||
}
|
||||
|
||||
if (*(unsigned long *)song != MIDI_HEADER_SIGNATURE)
|
||||
if (*(unsigned int *)song != MIDI_HEADER_SIGNATURE)
|
||||
{
|
||||
return(MIDI_InvalidMidiFile);
|
||||
}
|
||||
|
@ -1261,7 +1261,7 @@ int MIDI_PlaySong
|
|||
numtracks = _MIDI_NumTracks;
|
||||
while (numtracks--)
|
||||
{
|
||||
if (*(unsigned long *)ptr != MIDI_TRACK_SIGNATURE)
|
||||
if (*(unsigned int *)ptr != MIDI_TRACK_SIGNATURE)
|
||||
{
|
||||
USRHOOKS_FreeMem(_MIDI_TrackPtr);
|
||||
|
||||
|
@ -1324,7 +1324,7 @@ void MIDI_SetTempo
|
|||
)
|
||||
|
||||
{
|
||||
long tickspersecond;
|
||||
int tickspersecond;
|
||||
|
||||
MIDI_Tempo = tempo;
|
||||
tickspersecond = ((tempo) * _MIDI_Division) / 60;
|
||||
|
@ -1512,7 +1512,7 @@ static int _MIDI_ProcessNextTick
|
|||
|
||||
void MIDI_SetSongTick
|
||||
(
|
||||
unsigned long PositionInTicks
|
||||
unsigned int PositionInTicks
|
||||
)
|
||||
|
||||
{
|
||||
|
@ -1559,13 +1559,13 @@ void MIDI_SetSongTick
|
|||
|
||||
void MIDI_SetSongTime
|
||||
(
|
||||
unsigned long milliseconds
|
||||
unsigned int milliseconds
|
||||
)
|
||||
|
||||
{
|
||||
unsigned long mil;
|
||||
unsigned long sec;
|
||||
unsigned long newtime;
|
||||
unsigned int mil;
|
||||
unsigned int sec;
|
||||
unsigned int newtime;
|
||||
|
||||
if (!_MIDI_SongLoaded)
|
||||
{
|
||||
|
@ -1620,7 +1620,7 @@ void MIDI_SetSongPosition
|
|||
)
|
||||
|
||||
{
|
||||
unsigned long pos;
|
||||
unsigned int pos;
|
||||
|
||||
if (!_MIDI_SongLoaded)
|
||||
{
|
||||
|
@ -1631,13 +1631,13 @@ void MIDI_SetSongPosition
|
|||
|
||||
pos = RELATIVE_BEAT(measure, beat, tick);
|
||||
|
||||
if (pos < (unsigned long)RELATIVE_BEAT(_MIDI_Measure, _MIDI_Beat, _MIDI_Tick))
|
||||
if (pos < (unsigned int)RELATIVE_BEAT(_MIDI_Measure, _MIDI_Beat, _MIDI_Tick))
|
||||
{
|
||||
_MIDI_ResetTracks();
|
||||
MIDI_Reset();
|
||||
}
|
||||
|
||||
while ((unsigned long)RELATIVE_BEAT(_MIDI_Measure, _MIDI_Beat, _MIDI_Tick) < pos)
|
||||
while ((unsigned int)RELATIVE_BEAT(_MIDI_Measure, _MIDI_Beat, _MIDI_Tick) < pos)
|
||||
{
|
||||
if (_MIDI_ProcessNextTick())
|
||||
{
|
||||
|
@ -1671,8 +1671,8 @@ void MIDI_GetSongPosition
|
|||
)
|
||||
|
||||
{
|
||||
unsigned long mil;
|
||||
unsigned long sec;
|
||||
unsigned int mil;
|
||||
unsigned int sec;
|
||||
|
||||
mil = (_MIDI_Time & ((1 << TIME_PRECISION) - 1)) * 1000;
|
||||
sec = _MIDI_Time >> TIME_PRECISION;
|
||||
|
@ -1696,8 +1696,8 @@ void MIDI_GetSongLength
|
|||
)
|
||||
|
||||
{
|
||||
unsigned long mil;
|
||||
unsigned long sec;
|
||||
unsigned int mil;
|
||||
unsigned int sec;
|
||||
|
||||
mil = (_MIDI_TotalTime & ((1 << TIME_PRECISION) - 1)) * 1000;
|
||||
sec = _MIDI_TotalTime >> TIME_PRECISION;
|
||||
|
|
|
@ -88,8 +88,8 @@ void MIDI_StopSong( void );
|
|||
int MIDI_PlaySong( unsigned char *song, int loopflag );
|
||||
void MIDI_SetTempo( int tempo );
|
||||
int MIDI_GetTempo( void );
|
||||
void MIDI_SetSongTick( unsigned long PositionInTicks );
|
||||
void MIDI_SetSongTime( unsigned long milliseconds );
|
||||
void MIDI_SetSongTick( unsigned int PositionInTicks );
|
||||
void MIDI_SetSongTime( unsigned int milliseconds );
|
||||
void MIDI_SetSongPosition( int measure, int beat, int tick );
|
||||
void MIDI_GetSongPosition( songposition *pos );
|
||||
void MIDI_GetSongLength( songposition *pos );
|
||||
|
|
|
@ -42,9 +42,9 @@ static DWORD mididevice = -1;
|
|||
|
||||
typedef struct
|
||||
{
|
||||
long time;
|
||||
long stream;
|
||||
long event;
|
||||
int time;
|
||||
int stream;
|
||||
int event;
|
||||
}
|
||||
MIDIEVENTHEAD;
|
||||
#define PAD(x) ((((x)+3)&(~3)))
|
||||
|
@ -57,8 +57,8 @@ static MIDIHDR bufferheaders[NUMBUFFERS];
|
|||
int _MPU_CurrentBuffer = 0;
|
||||
int _MPU_BuffersWaiting = 0;
|
||||
|
||||
extern unsigned long _MIDI_GlobalPositionInTicks;
|
||||
unsigned long _MPU_LastEvent=0;
|
||||
extern unsigned int _MIDI_GlobalPositionInTicks;
|
||||
unsigned int _MPU_LastEvent=0;
|
||||
|
||||
#define MIDI_NOTE_OFF 0x80
|
||||
#define MIDI_NOTE_ON 0x90
|
||||
|
@ -120,7 +120,7 @@ void CALLBACK MPU_MIDICallback(HMIDIOUT handle, UINT uMsg, DWORD dwInstance, DWO
|
|||
midiOutUnprepareHeader((HMIDIOUT)handle, (MIDIHDR*)dwParam1, sizeof(MIDIHDR));
|
||||
for (i=0;i<NUMBUFFERS;i++)
|
||||
{
|
||||
if (dwParam1 == (unsigned long)&bufferheaders[i])
|
||||
if (dwParam1 == (unsigned int)&bufferheaders[i])
|
||||
{
|
||||
eventcnt[i] = 0; // marks the buffer as free
|
||||
// printf("Finished buffer %d\n",i);
|
||||
|
@ -174,9 +174,9 @@ void MPU_SendMidi(char *data, int count)
|
|||
}
|
||||
|
||||
p = eventbuf[_MPU_CurrentBuffer] + eventcnt[_MPU_CurrentBuffer];
|
||||
((long*)p)[0] = _MIDI_GlobalPositionInTicks - _MPU_LastEvent;
|
||||
((long*)p)[1] = 0;
|
||||
((long*)p)[2] = (MEVT_SHORTMSG << 24) | ((*((long*)data)) & masks[count-1]);
|
||||
((int*)p)[0] = _MIDI_GlobalPositionInTicks - _MPU_LastEvent;
|
||||
((int*)p)[1] = 0;
|
||||
((int*)p)[2] = (MEVT_SHORTMSG << 24) | ((*((int*)data)) & masks[count-1]);
|
||||
eventcnt[_MPU_CurrentBuffer] += 12;
|
||||
}
|
||||
else
|
||||
|
@ -196,9 +196,9 @@ void MPU_SendMidi(char *data, int count)
|
|||
}
|
||||
|
||||
p = eventbuf[_MPU_CurrentBuffer] + eventcnt[_MPU_CurrentBuffer];
|
||||
((long*)p)[0] = _MIDI_GlobalPositionInTicks - _MPU_LastEvent;
|
||||
((long*)p)[1] = 0;
|
||||
((long*)p)[2] = (MEVT_LONGMSG<<24) | (count & 0xffffffl);
|
||||
((int*)p)[0] = _MIDI_GlobalPositionInTicks - _MPU_LastEvent;
|
||||
((int*)p)[1] = 0;
|
||||
((int*)p)[2] = (MEVT_LONGMSG<<24) | (count & 0xffffffl);
|
||||
p+=12; eventcnt[_MPU_CurrentBuffer] += 12;
|
||||
for (; count>0; count--, padded--, eventcnt[_MPU_CurrentBuffer]++)
|
||||
*(p++) = *(data++);
|
||||
|
@ -220,7 +220,7 @@ void MPU_SendMidiImmediate(char *data, int count)
|
|||
static int masks[3] = { 0x00ffffffl, 0x0000ffffl, 0x000000ffl };
|
||||
|
||||
if (!count) return;
|
||||
if (count<=3) midiOutShortMsg((HMIDIOUT)hmido, (*((long*)data)) & masks[count-1]);
|
||||
if (count<=3) midiOutShortMsg((HMIDIOUT)hmido, (*((int*)data)) & masks[count-1]);
|
||||
else
|
||||
{
|
||||
ZeroMemory(&mhdr, sizeof(mhdr));
|
||||
|
@ -450,7 +450,7 @@ void MPU_SetVolume(int volume)
|
|||
{
|
||||
/*
|
||||
HMIXER hmixer;
|
||||
long mixerid;
|
||||
int mixerid;
|
||||
MIXERCONTROLDETAILS mxcd;
|
||||
MIXERCONTROLDETAILS_UNSIGNED mxcdu;
|
||||
MMRESULT mme;
|
||||
|
|
|
@ -105,7 +105,7 @@ static VoiceNode VoicePool;
|
|||
int MV_MixPage = 0;
|
||||
static int MV_VoiceHandle = MV_MinVoiceHandle;
|
||||
|
||||
static void(*MV_CallBackFunc)(unsigned long) = NULL;
|
||||
static void(*MV_CallBackFunc)(unsigned int) = NULL;
|
||||
static void(*MV_RecordFunc)(char *ptr, int length) = NULL;
|
||||
static void(*MV_MixFunction)(VoiceNode *voice, int buffer);
|
||||
|
||||
|
@ -118,7 +118,7 @@ short *MV_RightVolume;
|
|||
int MV_SampleSize = 1;
|
||||
int MV_RightChannelOffset;
|
||||
|
||||
unsigned long MV_MixPosition;
|
||||
unsigned int MV_MixPosition;
|
||||
|
||||
int MV_ErrorCode = MV_Ok;
|
||||
|
||||
|
@ -255,10 +255,10 @@ static void MV_Mix(VoiceNode *voice, int buffer)
|
|||
{
|
||||
char *start;
|
||||
int length;
|
||||
long voclength;
|
||||
unsigned long position;
|
||||
unsigned long rate;
|
||||
unsigned long FixedPointBufferSize;
|
||||
int voclength;
|
||||
unsigned int position;
|
||||
unsigned int rate;
|
||||
unsigned int FixedPointBufferSize;
|
||||
|
||||
if ((voice->length == 0) && (voice->GetSound(voice) != KeepPlaying))
|
||||
{
|
||||
|
@ -504,8 +504,8 @@ playbackstatus MV_GetNextVOCBlock(VoiceNode *voice)
|
|||
unsigned char *ptr;
|
||||
int blocktype;
|
||||
int lastblocktype;
|
||||
unsigned long blocklength = 0;
|
||||
unsigned long samplespeed = 0;
|
||||
unsigned int blocklength = 0;
|
||||
unsigned int samplespeed = 0;
|
||||
unsigned int tc = 0;
|
||||
int packtype;
|
||||
int voicemode;
|
||||
|
@ -559,14 +559,14 @@ playbackstatus MV_GetNextVOCBlock(VoiceNode *voice)
|
|||
}
|
||||
|
||||
blocktype = (int)*ptr;
|
||||
blocklength = (*(unsigned long *)(ptr + 1)) & 0x00ffffff;
|
||||
blocklength = (*(unsigned int *)(ptr + 1)) & 0x00ffffff;
|
||||
ptr += 4;
|
||||
|
||||
switch (blocktype)
|
||||
{
|
||||
case 0 :
|
||||
// End of data
|
||||
if ((voice->LoopStart == NULL) || ((unsigned long *)voice->LoopStart >= (unsigned long *)(ptr - 4)))
|
||||
if ((voice->LoopStart == NULL) || ((unsigned int *)voice->LoopStart >= (unsigned int *)(ptr - 4)))
|
||||
{
|
||||
voice->Playing = FALSE;
|
||||
done = TRUE;
|
||||
|
@ -678,7 +678,7 @@ playbackstatus MV_GetNextVOCBlock(VoiceNode *voice)
|
|||
|
||||
case 9 :
|
||||
// New sound data block
|
||||
samplespeed = *(unsigned long *)ptr;
|
||||
samplespeed = *(unsigned int *)ptr;
|
||||
BitsPerSample = (unsigned)*(ptr + 4);
|
||||
Channels = (unsigned)*(ptr + 5);
|
||||
Format = (unsigned)*(unsigned short *)(ptr + 6);
|
||||
|
@ -727,17 +727,17 @@ playbackstatus MV_GetNextVOCBlock(VoiceNode *voice)
|
|||
|
||||
if (voice->LoopEnd != NULL)
|
||||
{
|
||||
if (blocklength > (unsigned long)voice->LoopEnd)
|
||||
if (blocklength > (unsigned int)voice->LoopEnd)
|
||||
{
|
||||
blocklength = (unsigned long)voice->LoopEnd;
|
||||
blocklength = (unsigned int)voice->LoopEnd;
|
||||
}
|
||||
else
|
||||
{
|
||||
voice->LoopEnd = (char *)blocklength;
|
||||
}
|
||||
|
||||
voice->LoopStart = voice->sound + (unsigned long)voice->LoopStart;
|
||||
voice->LoopEnd = voice->sound + (unsigned long)voice->LoopEnd;
|
||||
voice->LoopStart = voice->sound + (unsigned int)voice->LoopStart;
|
||||
voice->LoopEnd = voice->sound + (unsigned int)voice->LoopEnd;
|
||||
voice->LoopSize = voice->LoopEnd - voice->LoopStart;
|
||||
}
|
||||
|
||||
|
@ -989,7 +989,7 @@ int MV_Kill(int handle)
|
|||
{
|
||||
VoiceNode *voice;
|
||||
unsigned flags;
|
||||
unsigned long callbackval;
|
||||
unsigned int callbackval;
|
||||
|
||||
if (!MV_Installed)
|
||||
{
|
||||
|
@ -1168,7 +1168,7 @@ int MV_VoiceAvailable(int priority)
|
|||
Sets the pitch for the specified voice.
|
||||
---------------------------------------------------------------------*/
|
||||
|
||||
void MV_SetVoicePitch(VoiceNode *voice, unsigned long rate, int pitchoffset)
|
||||
void MV_SetVoicePitch(VoiceNode *voice, unsigned int rate, int pitchoffset)
|
||||
{
|
||||
voice->SamplingRate = rate;
|
||||
voice->PitchScale = PITCH_GetScale(pitchoffset);
|
||||
|
@ -1824,7 +1824,7 @@ void MV_StopRecord(void)
|
|||
Plays a digitized sound from a user controlled buffering system.
|
||||
---------------------------------------------------------------------*/
|
||||
|
||||
int MV_StartDemandFeedPlayback(void(*function)(char **ptr, unsigned long *length), int rate, int pitchoffset, int vol, int left, int right, int priority, unsigned long callbackval)
|
||||
int MV_StartDemandFeedPlayback(void(*function)(char **ptr, unsigned int *length), int rate, int pitchoffset, int vol, int left, int right, int priority, unsigned int callbackval)
|
||||
{
|
||||
VoiceNode *voice;
|
||||
|
||||
|
@ -1875,7 +1875,7 @@ int MV_StartDemandFeedPlayback(void(*function)(char **ptr, unsigned long *length
|
|||
priority.
|
||||
---------------------------------------------------------------------*/
|
||||
|
||||
int MV_PlayRaw(char *ptr, unsigned long length, unsigned rate, int pitchoffset, int vol, int left, int right, int priority, unsigned long callbackval)
|
||||
int MV_PlayRaw(char *ptr, unsigned int length, unsigned rate, int pitchoffset, int vol, int left, int right, int priority, unsigned int callbackval)
|
||||
{
|
||||
int status;
|
||||
|
||||
|
@ -1892,7 +1892,7 @@ int MV_PlayRaw(char *ptr, unsigned long length, unsigned rate, int pitchoffset,
|
|||
priority.
|
||||
---------------------------------------------------------------------*/
|
||||
|
||||
int MV_PlayLoopedRaw(char *ptr, long length, char *loopstart, char *loopend, unsigned rate, int pitchoffset, int vol, int left, int right, int priority, unsigned long callbackval)
|
||||
int MV_PlayLoopedRaw(char *ptr, int length, char *loopstart, char *loopend, unsigned rate, int pitchoffset, int vol, int left, int right, int priority, unsigned int callbackval)
|
||||
{
|
||||
VoiceNode *voice;
|
||||
|
||||
|
@ -1941,7 +1941,7 @@ int MV_PlayLoopedRaw(char *ptr, long length, char *loopstart, char *loopend, uns
|
|||
priority.
|
||||
---------------------------------------------------------------------*/
|
||||
|
||||
int MV_PlayWAV(char *ptr, int pitchoffset, int vol, int left, int right, int priority, unsigned long callbackval)
|
||||
int MV_PlayWAV(char *ptr, int pitchoffset, int vol, int left, int right, int priority, unsigned int callbackval)
|
||||
{
|
||||
int status;
|
||||
|
||||
|
@ -1958,7 +1958,7 @@ int MV_PlayWAV(char *ptr, int pitchoffset, int vol, int left, int right, int pri
|
|||
from listener.
|
||||
---------------------------------------------------------------------*/
|
||||
|
||||
int MV_PlayWAV3D(char *ptr, int pitchoffset, int angle, int distance, int priority, unsigned long callbackval)
|
||||
int MV_PlayWAV3D(char *ptr, int pitchoffset, int angle, int distance, int priority, unsigned int callbackval)
|
||||
{
|
||||
int left;
|
||||
int right;
|
||||
|
@ -2000,7 +2000,7 @@ int MV_PlayWAV3D(char *ptr, int pitchoffset, int angle, int distance, int priori
|
|||
priority.
|
||||
---------------------------------------------------------------------*/
|
||||
|
||||
int MV_PlayLoopedWAV(char *ptr, long loopstart, long loopend, int pitchoffset, int vol, int left, int right, int priority, unsigned long callbackval)
|
||||
int MV_PlayLoopedWAV(char *ptr, int loopstart, int loopend, int pitchoffset, int vol, int left, int right, int priority, unsigned int callbackval)
|
||||
{
|
||||
riff_header *riff;
|
||||
format_header *format;
|
||||
|
@ -2116,7 +2116,7 @@ int MV_PlayLoopedWAV(char *ptr, long loopstart, long loopend, int pitchoffset, i
|
|||
from listener.
|
||||
---------------------------------------------------------------------*/
|
||||
|
||||
int MV_PlayVOC3D(char *ptr, int pitchoffset, int angle, int distance, int priority, unsigned long callbackval)
|
||||
int MV_PlayVOC3D(char *ptr, int pitchoffset, int angle, int distance, int priority, unsigned int callbackval)
|
||||
{
|
||||
int left;
|
||||
int right;
|
||||
|
@ -2158,7 +2158,7 @@ int MV_PlayVOC3D(char *ptr, int pitchoffset, int angle, int distance, int priori
|
|||
priority.
|
||||
---------------------------------------------------------------------*/
|
||||
|
||||
int MV_PlayVOC(char *ptr, int pitchoffset, int vol, int left, int right, int priority, unsigned long callbackval)
|
||||
int MV_PlayVOC(char *ptr, int pitchoffset, int vol, int left, int right, int priority, unsigned int callbackval)
|
||||
{
|
||||
int status;
|
||||
|
||||
|
@ -2175,7 +2175,7 @@ int MV_PlayVOC(char *ptr, int pitchoffset, int vol, int left, int right, int pri
|
|||
priority.
|
||||
---------------------------------------------------------------------*/
|
||||
|
||||
int MV_PlayLoopedVOC(char *ptr, long loopstart, long loopend, int pitchoffset, int vol, int left, int right, int priority, unsigned long callbackval)
|
||||
int MV_PlayLoopedVOC(char *ptr, int loopstart, int loopend, int pitchoffset, int vol, int left, int right, int priority, unsigned int callbackval)
|
||||
{
|
||||
VoiceNode *voice;
|
||||
int status;
|
||||
|
@ -2375,7 +2375,7 @@ int MV_GetVolume(void)
|
|||
Set the function to call when a voice stops.
|
||||
---------------------------------------------------------------------*/
|
||||
|
||||
void MV_SetCallBack(void(*function)(unsigned long))
|
||||
void MV_SetCallBack(void(*function)(unsigned int))
|
||||
{
|
||||
MV_CallBackFunc = function;
|
||||
}
|
||||
|
@ -2414,7 +2414,7 @@ int MV_GetReverseStereo(void)
|
|||
int MV_TestPlayback(void)
|
||||
{
|
||||
unsigned flags;
|
||||
long time;
|
||||
int time;
|
||||
int start;
|
||||
int status;
|
||||
int pos;
|
||||
|
@ -2474,7 +2474,7 @@ int MV_TestPlayback(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
int USRHOOKS_GetMem(void **ptr, unsigned long size)
|
||||
int USRHOOKS_GetMem(void **ptr, unsigned int size)
|
||||
{
|
||||
*ptr = malloc(size);
|
||||
|
||||
|
|
|
@ -78,34 +78,34 @@ int MV_StartPlayback( void );
|
|||
void MV_StopPlayback( void );
|
||||
int MV_StartRecording( int MixRate, void ( *function )( char *ptr, int length ) );
|
||||
void MV_StopRecord( void );
|
||||
int MV_StartDemandFeedPlayback( void ( *function )( char **ptr, unsigned long *length ),
|
||||
int MV_StartDemandFeedPlayback( void ( *function )( char **ptr, unsigned int *length ),
|
||||
int rate, int pitchoffset, int vol, int left, int right,
|
||||
int priority, unsigned long callbackval );
|
||||
int MV_PlayRaw( char *ptr, unsigned long length,
|
||||
int priority, unsigned int callbackval );
|
||||
int MV_PlayRaw( char *ptr, unsigned int length,
|
||||
unsigned rate, int pitchoffset, int vol, int left,
|
||||
int right, int priority, unsigned long callbackval );
|
||||
int MV_PlayLoopedRaw( char *ptr, long length,
|
||||
int right, int priority, unsigned int callbackval );
|
||||
int MV_PlayLoopedRaw( char *ptr, int length,
|
||||
char *loopstart, char *loopend, unsigned rate, int pitchoffset,
|
||||
int vol, int left, int right, int priority,
|
||||
unsigned long callbackval );
|
||||
unsigned int callbackval );
|
||||
int MV_PlayWAV( char *ptr, int pitchoffset, int vol, int left,
|
||||
int right, int priority, unsigned long callbackval );
|
||||
int right, int priority, unsigned int callbackval );
|
||||
int MV_PlayWAV3D( char *ptr, int pitchoffset, int angle, int distance,
|
||||
int priority, unsigned long callbackval );
|
||||
int MV_PlayLoopedWAV( char *ptr, long loopstart, long loopend,
|
||||
int priority, unsigned int callbackval );
|
||||
int MV_PlayLoopedWAV( char *ptr, int loopstart, int loopend,
|
||||
int pitchoffset, int vol, int left, int right, int priority,
|
||||
unsigned long callbackval );
|
||||
unsigned int callbackval );
|
||||
int MV_PlayVOC3D( char *ptr, int pitchoffset, int angle, int distance,
|
||||
int priority, unsigned long callbackval );
|
||||
int priority, unsigned int callbackval );
|
||||
int MV_PlayVOC( char *ptr, int pitchoffset, int vol, int left, int right,
|
||||
int priority, unsigned long callbackval );
|
||||
int MV_PlayLoopedVOC( char *ptr, long loopstart, long loopend,
|
||||
int priority, unsigned int callbackval );
|
||||
int MV_PlayLoopedVOC( char *ptr, int loopstart, int loopend,
|
||||
int pitchoffset, int vol, int left, int right, int priority,
|
||||
unsigned long callbackval );
|
||||
unsigned int callbackval );
|
||||
void MV_CreateVolumeTable( int index, int volume, int MaxVolume );
|
||||
void MV_SetVolume( int volume );
|
||||
int MV_GetVolume( void );
|
||||
void MV_SetCallBack( void ( *function )( unsigned long ) );
|
||||
void MV_SetCallBack( void ( *function )( unsigned int ) );
|
||||
void MV_SetReverseStereo( int setting );
|
||||
int MV_GetReverseStereo( void );
|
||||
int MV_Init( int soundcard, int MixRate, int Voices, int numchannels,
|
||||
|
|
|
@ -395,7 +395,7 @@ int MUSIC_GetContext
|
|||
|
||||
void MUSIC_SetSongTick
|
||||
(
|
||||
unsigned long PositionInTicks
|
||||
unsigned int PositionInTicks
|
||||
)
|
||||
|
||||
{
|
||||
|
@ -411,7 +411,7 @@ void MUSIC_SetSongTick
|
|||
|
||||
void MUSIC_SetSongTime
|
||||
(
|
||||
unsigned long milliseconds
|
||||
unsigned int milliseconds
|
||||
)
|
||||
|
||||
{
|
||||
|
|
|
@ -50,8 +50,8 @@ enum MUSIC_ERRORS
|
|||
|
||||
typedef struct
|
||||
{
|
||||
unsigned long tickposition;
|
||||
unsigned long milliseconds;
|
||||
unsigned int tickposition;
|
||||
unsigned int milliseconds;
|
||||
unsigned int measure;
|
||||
unsigned int beat;
|
||||
unsigned int tick;
|
||||
|
@ -75,8 +75,8 @@ int MUSIC_StopSong( void );
|
|||
int MUSIC_PlaySong( unsigned char *song, int loopflag );
|
||||
void MUSIC_SetContext( int context );
|
||||
int MUSIC_GetContext( void );
|
||||
void MUSIC_SetSongTick( unsigned long PositionInTicks );
|
||||
void MUSIC_SetSongTime( unsigned long milliseconds );
|
||||
void MUSIC_SetSongTick( unsigned int PositionInTicks );
|
||||
void MUSIC_SetSongTime( unsigned int milliseconds );
|
||||
void MUSIC_SetSongPosition( int measure, int beat, int tick );
|
||||
void MUSIC_GetSongPosition( songposition *pos );
|
||||
void MUSIC_GetSongLength( songposition *pos );
|
||||
|
|
|
@ -36,7 +36,7 @@ Modifications for JonoF's port by Jonathon Fowler (jonof@edgenetwk.com)
|
|||
|
||||
#define MAXDETUNE 25
|
||||
|
||||
static unsigned long PitchTable[ 12 ][ MAXDETUNE ] =
|
||||
static unsigned int PitchTable[ 12 ][ MAXDETUNE ] =
|
||||
{
|
||||
{
|
||||
0x10000, 0x10097, 0x1012f, 0x101c7, 0x10260, 0x102f9, 0x10392, 0x1042c,
|
||||
|
@ -138,13 +138,13 @@ void PITCH_Init
|
|||
Returns a fixed-point value to scale number the specified amount.
|
||||
---------------------------------------------------------------------*/
|
||||
|
||||
unsigned long PITCH_GetScale
|
||||
unsigned int PITCH_GetScale
|
||||
(
|
||||
int pitchoffset
|
||||
)
|
||||
|
||||
{
|
||||
unsigned long scale;
|
||||
unsigned int scale;
|
||||
int octaveshift;
|
||||
int noteshift;
|
||||
int note;
|
||||
|
|
|
@ -40,5 +40,5 @@ enum PITCH_ERRORS
|
|||
};
|
||||
|
||||
//void PITCH_Init( void );
|
||||
unsigned long PITCH_GetScale( int pitchoffset );
|
||||
unsigned int PITCH_GetScale( int pitchoffset );
|
||||
#endif
|
||||
|
|
|
@ -187,7 +187,7 @@ void SafeWrite(int32 handle, void *buffer, int32 count)
|
|||
{
|
||||
iocount = count > 0x8000 ? 0x8000 : count;
|
||||
if (write(handle,buffer,iocount) != (int)iocount)
|
||||
Error("File write failure writing %ld bytes",count);
|
||||
Error("File write failure writing %d bytes",count);
|
||||
buffer = (void *)((byte *)buffer + iocount);
|
||||
count -= iocount;
|
||||
}
|
||||
|
@ -470,10 +470,10 @@ void PlayMusic(char *_filename)
|
|||
//FixFilePath(filename);
|
||||
|
||||
char filename[BMAX_PATH];
|
||||
long handle;
|
||||
long size;
|
||||
int handle;
|
||||
int size;
|
||||
void *song;
|
||||
long rc;
|
||||
int rc;
|
||||
|
||||
MUSIC_StopSong();
|
||||
|
||||
|
@ -550,13 +550,13 @@ int MUSIC_GetContext(void)
|
|||
} // MUSIC_GetContext
|
||||
|
||||
|
||||
void MUSIC_SetSongTick(unsigned long PositionInTicks)
|
||||
void MUSIC_SetSongTick(unsigned int PositionInTicks)
|
||||
{
|
||||
musdebug("STUB ... MUSIC_SetSongTick().\n");
|
||||
} // MUSIC_SetSongTick
|
||||
|
||||
|
||||
void MUSIC_SetSongTime(unsigned long milliseconds)
|
||||
void MUSIC_SetSongTime(unsigned int milliseconds)
|
||||
{
|
||||
musdebug("STUB ... MUSIC_SetSongTime().\n");
|
||||
}// MUSIC_SetSongTime
|
||||
|
|
|
@ -185,7 +185,7 @@ static void isr(void *userdata, unsigned char *stream, int len)
|
|||
{
|
||||
/*
|
||||
#define copybuf(S,D,c) \
|
||||
({ void *__S=(S), *__D=(D); long __c=(c); \
|
||||
({ void *__S=(S), *__D=(D); int __c=(c); \
|
||||
__asm__ __volatile__ ("rep; movsl" \
|
||||
: "+S" (__S), "+D" (__D), "+c" (__c) : : "memory", "cc"); \
|
||||
0; })
|
||||
|
|
|
@ -50,7 +50,7 @@ enum USRHOOKS_Errors
|
|||
Function Prototypes
|
||||
---------------------------------------------------------------------*/
|
||||
|
||||
int USRHOOKS_GetMem( void **ptr, unsigned long size );
|
||||
int USRHOOKS_GetMem( void **ptr, unsigned int size );
|
||||
int USRHOOKS_FreeMem( void *ptr );
|
||||
|
||||
#endif
|
||||
|
|
|
@ -233,7 +233,7 @@ void CONTROL_PrintKeyMap(void)
|
|||
|
||||
void CONTROL_PrintControlFlag(int32 which)
|
||||
{
|
||||
initprintf("function %2ld active=%d used=%d toggle=%d buttonheld=%d cleared=%ld\n",
|
||||
initprintf("function %2ld active=%d used=%d toggle=%d buttonheld=%d cleared=%d\n",
|
||||
which, CONTROL_Flags[which].active, CONTROL_Flags[which].used,
|
||||
CONTROL_Flags[which].toggle, CONTROL_Flags[which].buttonheld,
|
||||
CONTROL_Flags[which].cleared);
|
||||
|
@ -243,16 +243,16 @@ void CONTROL_PrintAxes(void)
|
|||
{
|
||||
int32 i;
|
||||
|
||||
initprintf("nummouseaxes=%ld\n", CONTROL_NumMouseAxes);
|
||||
initprintf("nummouseaxes=%d\n", CONTROL_NumMouseAxes);
|
||||
for (i=0;i<CONTROL_NumMouseAxes;i++) {
|
||||
initprintf("axis=%ld analog=%d digital1=%d digital2=%d\n",
|
||||
initprintf("axis=%d analog=%d digital1=%d digital2=%d\n",
|
||||
i, CONTROL_MouseAxesMap[i].analogmap,
|
||||
CONTROL_MouseAxesMap[i].minmap, CONTROL_MouseAxesMap[i].maxmap);
|
||||
}
|
||||
|
||||
initprintf("numjoyaxes=%ld\n", CONTROL_NumJoyAxes);
|
||||
initprintf("numjoyaxes=%d\n", CONTROL_NumJoyAxes);
|
||||
for (i=0;i<CONTROL_NumJoyAxes;i++) {
|
||||
initprintf("axis=%ld analog=%d digital1=%d digital2=%d\n",
|
||||
initprintf("axis=%d analog=%d digital1=%d digital2=%d\n",
|
||||
i, CONTROL_JoyAxesMap[i].analogmap,
|
||||
CONTROL_JoyAxesMap[i].minmap, CONTROL_JoyAxesMap[i].maxmap);
|
||||
}
|
||||
|
|
|
@ -270,7 +270,7 @@ boolean KB_KeypadActive( void )
|
|||
return numpad;
|
||||
}
|
||||
|
||||
static void KB_KeyEvent( long scancode, long keypressed )
|
||||
static void KB_KeyEvent( int scancode, int keypressed )
|
||||
{
|
||||
if (keypressed) KB_LastScan = scancode;
|
||||
}
|
||||
|
@ -283,6 +283,6 @@ void KB_Startup( void )
|
|||
|
||||
void KB_Shutdown( void )
|
||||
{
|
||||
setkeypresscallback((void(*)(long,long))NULL);
|
||||
setkeypresscallback((void(*)(int,int))NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -879,8 +879,8 @@ void SCRIPT_PutNumber
|
|||
{
|
||||
char raw[64];
|
||||
|
||||
if (hexadecimal) sprintf(raw, "0x%lX", number);
|
||||
else sprintf(raw, "%ld", number);
|
||||
if (hexadecimal) sprintf(raw, "0x%X", number);
|
||||
else sprintf(raw, "%d", number);
|
||||
|
||||
SCRIPT_AddEntry(scripthandle, sectionname, entryname, raw);
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue