-
Notifications
You must be signed in to change notification settings - Fork 2
/
Hunt.h
1535 lines (1275 loc) · 29 KB
/
Hunt.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "targetver.h"
#include <Windows.h>
#include <winuser.h>
#include <cmath>
#include <cstdint>
#include <string>
#include <array>
#include <vector>
#include <fstream>
#include <chrono>
#include "resource.h"
#include <ddraw.h>
#if defined(_d3d)
#include <d3d.h>
#elif defined(_d3d9)
#include <d3d9.h>
#elif defined(_d3d11)
#include <d3d11.h>
#elif defined(_opengl)
#include <GL/gl.h>
#endif
#define CARN_BUILDVERSION 4
#define ctHScale 32
#define PMORPHTIME 256
#define HiColor(R,G,B) ( ((R)<<10) + ((G)<<5) + (B) )
#define TCMAX ((128<<16)-62024)
#define TCMIN ((000<<16)+62024)
#define kfForward 0x00000001
#define kfBackward 0x00000002
#define kfLeft 0x00000004
#define kfRight 0x00000008
#define kfLookUp 0x00000010
#define kfLookDn 0x00000020
#define kfJump 0x00000040
#define kfDown 0x00000080
#define kfCall 0x00000100
#define kfSLeft 0x00001000
#define kfSRight 0x00002000
#define kfStrafe 0x00004000
#define fmWater 0x80
#define fmReverse 0x40
#define fmNOWAY 0x20
#define sfDoubleSide 1
#define sfDarkBack 2
#define sfOpacity 4
#define sfTransparent 8
#define sfMortal 0x0010
#define sfNeedVC 0x0080
#define sfDark 0x8000
#define ofPLACEWATER 1
#define ofPLACEGROUND 2
#define ofPLACEUSER 4
#define ofANIMATED 0x80000000
#define csONWATER 0x00010000
#define MAX_HEALTH 128000
enum PlayerRankEnum {
RANK_NOVICE = 0,
RANK_ADVANCED = 1,
RANK_MASTER = 2
};
enum CreatureTypeEnum {
CTYPE_HUNTER = 0,
CTYPE_MOSCH = 1,
CTYPE_GALLI = 2,
CTYPE_DIMOR = 3,
//CTYPE_SHIP = 4,
CTYPE_PARA = 5,
CTYPE_PACHY = 6,
CTYPE_STEGO = 7,
CTYPE_ALLO = 8,
CTYPE_TRIKE = 9,
CTYPE_VELOCI = 10,
CTYPE_TREX = 11,
CTYPE_MAX
};
#define HUNT_EAT 0
#define HUNT_BREATH 1
#define HUNT_FALL 2
#define HUNT_KILL 3
#ifdef _MAIN_
#define _EXTORNOT
#else
#define _EXTORNOT extern
#endif
#define ctMapSize 512
class dohalt : public std::exception {
private:
std::string _funcname;
std::string _file;
size_t _line;
std::string _what;
public:
dohalt(std::string what = "", std::string funcname = "", std::string file = "", size_t line = 0) :
_funcname(funcname),
_file(file),
_line(line),
_what(what)
{
}
dohalt(const dohalt& o) :
_funcname(o._funcname),
_file(o._file),
_line(o._line),
_what(o._what)
{
}
std::string function() {
return _funcname;
}
std::string file() {
return _file;
}
size_t line() {
return _line;
}
std::string what() {
return _what;
}
};
/*
TODO : Move this to "Engine.h"
*/
class CarnivoresEngine {
private:
bool m_Loop;
public:
CarnivoresEngine();
~CarnivoresEngine();
bool GetLoopStatus() { return m_Loop; }
};
struct TMessageList {
int64_t timeleft;
std::string mtext;
};
struct TRGB {
uint8_t B;
uint8_t G;
uint8_t R;
};
class TAni {
public:
char aniName[32];
int aniKPS,
FramesCount,
AniTime;
int16_t* aniData;
size_t aniDataLength;
TAni() {
std::memset(aniName, 0, 32);
aniKPS = 0;
FramesCount = 0;
AniTime = 0;
aniData = nullptr;
aniDataLength = 0;
}
TAni(const TAni& rhs) noexcept {
std::memcpy(aniName, rhs.aniName, 32);
aniKPS = rhs.aniKPS;
FramesCount = rhs.FramesCount;
AniTime = rhs.AniTime;
aniData = new int16_t[rhs.aniDataLength];
aniDataLength = rhs.aniDataLength;
std::memcpy(aniData, rhs.aniData, aniDataLength);
}
TAni(TAni&& rhs) noexcept {
std::memcpy(aniName, rhs.aniName, 32);
aniKPS = rhs.aniKPS;
FramesCount = rhs.FramesCount;
AniTime = rhs.AniTime;
aniData = rhs.aniData;
aniDataLength = rhs.aniDataLength;
rhs.aniData = nullptr;
}
~TAni() {
if (aniData) {
delete[] aniData;
}
}
};
class TVTL {
public:
int aniKPS;
int FramesCount;
int AniTime;
int16_t* aniData;
size_t aniDataLength;
TVTL() : aniKPS(0), FramesCount(0), AniTime(0), aniData(nullptr), aniDataLength(0) {}
TVTL(const TVTL& rhs) noexcept {
aniKPS = rhs.aniKPS;
FramesCount = rhs.FramesCount;
AniTime = rhs.AniTime;
aniDataLength = rhs.aniDataLength;
if (rhs.aniData != nullptr) {
aniData = new int16_t[FramesCount * (sizeof(int16_t) * 3)];
std::memcpy(aniData, rhs.aniData, FramesCount * (sizeof(int16_t) * 3));
}
else {
aniData = nullptr;
}
}
TVTL(TVTL&& rhs) noexcept {
aniKPS = rhs.aniKPS;
FramesCount = rhs.FramesCount;
AniTime = rhs.AniTime;
aniData = rhs.aniData;
aniDataLength = rhs.aniDataLength;
rhs.aniData = nullptr;
}
~TVTL() {
if (aniData) {
delete[] aniData;
}
}
};
class TSoundFX {
public:
int length;
int16_t* lpData;
TSoundFX() : length(0), lpData(nullptr) {}
TSoundFX(const TSoundFX& rhs) {
length = rhs.length;
lpData = new int16_t[rhs.length];
std::memcpy(lpData, rhs.lpData, length);
}
TSoundFX(TSoundFX&& rhs) noexcept {
length = rhs.length;
lpData = rhs.lpData;
rhs.lpData = nullptr;
}
~TSoundFX() {
if (lpData)
delete[] lpData;
}
};
class TText {
public:
int Lines;
std::array<std::string, 64> Text;
};
class TRD {
public:
int RNumber, RVolume, RFreq, RTmp;
TRD() : RNumber(0), RVolume(0), RFreq(0), RTmp(0) {}
TRD(const TRD& rhs) {
RNumber = rhs.RNumber;
RVolume = rhs.RVolume;
RFreq = rhs.RFreq;
RTmp = rhs.RTmp;
}
};
class TAmbient {
public:
TSoundFX sfx;
TRD rdata[16];
int RSFXCount;
int AVolume;
int RndTime;
TAmbient() {
sfx.length = 0;
sfx.lpData = nullptr;
RSFXCount = 0;
AVolume = 0;
RndTime = 0;
}
TAmbient(const TAmbient& rhs) noexcept {
sfx.length = rhs.sfx.length;
sfx.lpData = new int16_t[sfx.length];
std::memcpy(sfx.lpData, rhs.sfx.lpData, sfx.length);
for (int r = 0; r < 16; ++r) {
rdata[r].RNumber = rhs.rdata[r].RNumber;
rdata[r].RVolume = rhs.rdata[r].RVolume;
rdata[r].RFreq = rhs.rdata[r].RFreq;
rdata[r].RTmp = rhs.rdata[r].RTmp;
}
RSFXCount = rhs.RSFXCount;
AVolume = rhs.AVolume;
RndTime = rhs.RndTime;
}
TAmbient(TAmbient&& rhs) noexcept {
sfx.length = rhs.sfx.length;
sfx.lpData = rhs.sfx.lpData;
rhs.sfx.lpData = nullptr;
for (int r = 0; r < 16; ++r) {
rdata[r].RNumber = rhs.rdata[r].RNumber;
rdata[r].RVolume = rhs.rdata[r].RVolume;
rdata[r].RFreq = rhs.rdata[r].RFreq;
rdata[r].RTmp = rhs.rdata[r].RTmp;
}
RSFXCount = rhs.RSFXCount;
AVolume = rhs.AVolume;
RndTime = rhs.RndTime;
}
};
class TTexture {
protected:
int W, H;
uint16_t* data;
TTexture* mipmap; // NOTE: Needed for RenderSoft
public:
TTexture(int w = 0, int h = 0, uint16_t* d = nullptr) : W(w), H(h), data(d), mipmap(nullptr) {}
TTexture(const TTexture& rhs) noexcept : W(0), H(0), data(nullptr), mipmap(nullptr) { copy(rhs); }
TTexture(TTexture&& rhs) noexcept : W(rhs.W), H(rhs.H), data(rhs.data), mipmap(rhs.mipmap) {
rhs.data = nullptr;
rhs.mipmap = nullptr;
}
~TTexture() {
reset();
}
void reset() {
if (data) {
delete[] data;
}
if (mipmap) {
delete mipmap;
}
W = 0;
H = 0;
data = nullptr;
mipmap = nullptr;
}
/*
Store the width and height in the two parameter references
*/
void getDimensions(int& w, int& h) {
w = W;
h = H;
}
int getWidth() {
return W;
}
int getHeight() {
return H;
}
/*
UNSAFE!
Return a pointer to the internal data buffer
*/
uint16_t* getData() {
return data;
}
TTexture& getMipmap() {
if (!mipmap)
return *this;
else
return *mipmap;
}
bool hasMipmap() {
return (mipmap != nullptr);
}
/*
Copy a buffer of uint16_t's into the instance
*/
void copy(int w, int h, uint16_t* d);
/*
Copy an existing TTexture object's contents to this instance, including mipmaps if they exist.
*/
void copy(const TTexture& t);
/*
Generate mipmap data from this texture
*/
void generateMipMap();
};
#include "Math.h"
/*
! DEPRECATED !
A class that is used to deal with Vectors typical for 3D mathematics.
NOTE: This is deprecated and should not be used. See `vec3<T>` instead.
*/
class Vector3d {
public:
float x, y, z;
Vector3d(float X = 0.0f, float Y = 0.0f, float Z = 0.0f) : x(X), y(Y), z(Z) {}
Vector3d(const Vector3d& rhs) : x(rhs.x), y(rhs.y), z(rhs.z) {}
void operator= (const Vector3d& rhs) {
x = rhs.x;
y = rhs.y;
z = rhs.z;
}
Vector3d operator+ (const Vector3d& rhs) {
Vector3d v(x + rhs.x, y + rhs.y, z + rhs.z);
return v;
}
Vector3d operator- (const Vector3d& rhs) {
Vector3d v(x - rhs.x, y - rhs.y, z - rhs.z);
return v;
}
Vector3d operator* (float rhs) {
Vector3d v(x * rhs, y * rhs, z * rhs);
return v;
}
};
class TPoint3di {
public:
int32_t x, y, z;
TPoint3di(int32_t x = 0, int32_t y = 0, int32_t z = 0) {
this->x = x;
this->y = y;
this->z = z;
}
TPoint3di(const TPoint3di& v) : x(v.x), y(v.y), z(v.z) {
}
void operator= (const TPoint3di& v) {
x = v.x;
y = v.y;
z = v.z;
}
TPoint3di operator+ (const TPoint3di& v) {
TPoint3di v2(x + v.x, y + v.y, z + v.z);
return v2;
}
TPoint3di operator- (const TPoint3di& v) {
TPoint3di v2(x - v.x, y - v.y, z - v.z);
return v2;
}
};
typedef struct TagVector2di {
int x, y;
} Vector2di;
typedef struct TagVector2df {
float x, y;
} Vector2df;
typedef struct TagScrPoint {
int x, y, tx, ty,
Light, z, r2, r3;
} ScrPoint;
typedef struct TagMScrPoint {
int x, y, tx, ty;
} MScrPoint;
typedef struct tagClipPlane {
Vector3d v1, v2, nv;
} CLIPPLANE;
typedef struct TagEPoint {
Vector3d v;
int DFlags, scrx, scry, Light;
float Fog;
} EPoint;
typedef struct TagClipPoint {
EPoint ev;
float tx, ty;
} ClipPoint;
//================= MODEL ========================
class TPoint3d {
public:
float x;
float y;
float z;
int16_t owner;
int16_t hide; // Ignored in game, only used in Editors
TPoint3d() : x(0.0f), y(0.0f), z(0.0f), owner(-1), hide(0) {
}
};
class TFaceI {
public:
int32_t v1, v2, v3;
int32_t tax, tbx, tcx, tay, tby, tcy;
uint16_t Flags,
DMask;
int32_t Distant,
Next,
group;
uint8_t reserv[12];
};
class TFace {
public:
int32_t v1, v2, v3;
float tax, tbx, tcx, tay, tby, tcy; // RenderSoft needs these as int32_t types, they are generally 0-256 instead of 0.0f-1.0f so scale floats by 256.f
uint16_t Flags,
DMask;
int32_t Distant,
Next,
group;
uint8_t reserv[12];
TFace(int V1 = 0, int V2 = 0, int V3 = 0, float TAX = 0.f, float TBX = 0.f, float TCX = 0.f, float TAY = 0.f, float TBY = 0.f, float TCY = 0.f, uint16_t flags = 0, uint16_t dmask = 0, int distant = -1, int next_face = -1, int Group = 0) {
this->v1 = V1;
this->v2 = V2;
this->v3 = V3;
this->tax = TAX;
this->tbx = TBX;
this->tcx = TCX;
this->tay = TAY;
this->tby = TBY;
this->tcy = TCY;
this->Flags = flags;
this->DMask = dmask;
this->Distant = distant;
this->Next = next_face;
this->group = Group;
for (int i = 0; i < 12; ++i)
reserv[i] = 0;
}
TFace(const TFace& f) {
v1 = f.v1;
v2 = f.v2;
v3 = f.v3;
tax = f.tax;
tbx = f.tbx;
tcx = f.tcx;
tay = f.tay;
tby = f.tby;
tcy = f.tcy;
Flags = f.Flags;
DMask = f.DMask;
Distant = f.Distant;
Next = f.Next;
group = f.group;
for (int i = 0; i < 12; ++i)
reserv[i] = 0;
}
TFace(const TFaceI& f) {
v1 = f.v1;
v2 = f.v2;
v3 = f.v3;
tax = ((float)f.tax) / 256.f;
tbx = ((float)f.tbx) / 256.f;
tcx = ((float)f.tcx) / 256.f;
tay = ((float)f.tay) / 256.f;
tby = ((float)f.tby) / 256.f;
tcy = ((float)f.tcy) / 256.f;
Flags = f.Flags;
DMask = f.DMask;
Distant = f.Distant;
Next = f.Next;
group = f.group;
for (int i = 0; i < 12; ++i)
reserv[i] = 0;
}
};
typedef struct _Obj {
std::string OName; // 32-bytes
float ox;
float oy;
float oz;
int16_t owner;
int16_t hide;
} TObj;
class TModel {
public:
int VCount,
FCount,
TextureSize,
TextureHeight;
std::vector<TPoint3d> gVertex;
std::vector<TFace> gFace;
TTexture texture;
#ifdef _d3d
std::vector<int> VLight;
#else
std::vector<float> VLight;
#endif
TModel() {
VCount = 0;
FCount = 0;
TextureSize = 0;
TextureHeight = 0;
}
~TModel();
void reset();
};
//=========== END MODEL ==============================//
class TObjInfo {
public:
int Radius;
int YLo, YHi;
int linelenght, lintensity;
int circlerad, cintensity;
int flags;
int GrRad;
int LastAniTime;
uint8_t res[24];
};
class TObject {
public:
TObjInfo info;
TModel model;
TVTL vtl;
};
class TCharacterInfo {
public:
std::string ModelName;
int AniCount,
SfxCount;
TModel Model;
std::vector<TAni> Animation;
std::vector<TSoundFX> SoundFX;
std::array<int, 64> Anifx; // TODO: std::pair<TSFX,int> in SoundFX to reduce vector overhead.
~TCharacterInfo();
void reset();
};
typedef struct _TWeapon {
TCharacterInfo chinfo;
int state, FTime;
float shakel;
} TWeapon;
typedef struct _TExplosion {
Vector3d pos, rpos;
int EType, FTime;
} TExplosion;
class TCharacter {
public:
int CType;
TCharacterInfo* pinfo;
int StateF;
int State;
int NoWayCnt, NoFindCnt, AfraidTime, tgtime;
int PPMorphTime, PrevPhase, PrevPFTime, Phase, FTime;
float vspeed, rspeed, bend, scale;
int Slide;
float slidex, slidez;
float tgx, tgz;
Vector3d pos, rpos;
float tgalpha, alpha, beta,
tggamma, gamma,
lookx, lookz;
int Health;
};
class TPlayer {
public:
bool Active;
unsigned int IPaddr;
Vector3d pos;
float alpha, beta, vspeed;
int kbState;
std::string NickName;
};
typedef struct _TDemoPoint {
Vector3d pos;
int DemoTime,
CIndex;
} TDemoPoint;
// NOTE: Unused, left over from pre-release
class TLevelDef {
public:
std::string FileName;
std::string MapName;
uint32_t DinosAvail;
uint16_t* lpMapImage;
TLevelDef() : FileName(""), MapName(""), DinosAvail(0), lpMapImage(nullptr) {}
~TLevelDef() {
if (lpMapImage)
delete[] lpMapImage;
}
};
typedef struct tagShipTask {
int tcount;
int clist[255];
} TShipTask;
typedef struct tagShip {
Vector3d pos, rpos, tgpos, retpos;
float alpha, tgalpha, speed, rspeed, DeltaY;
int State, cindex, FTime;
} TShip;
typedef struct tagLandingList {
int PCount;
std::array<Vector2di, 64> list;
} TLandingList;
class TPlayerR {
public:
std::string PName; // Limit to 128
int RegNumber;
int Score,
Rank;
TPlayerR() : PName(""), RegNumber(0), Score(0), Rank(0) {}
~TPlayerR() {
reset();
}
void reset() {
PName = "";
RegNumber = 0;
Score = 0;
Rank = 0;
}
};
typedef struct _TTrophyItem {
int ctype, weapon, phase,
height, weight, score,
date, time;
float scale, range;
int r1, r2, r3, r4;
} TTrophyItem;
typedef struct _TStats {
int smade, ssucces;
float path, time;
} TStats;
class TTrophyRoom { // [128] + 44 + (sizeof(TTrophyItem) * 24)
public:
std::string PlayerName; // Limit to 128
int RegNumber;
int Score,
Rank;
TStats Last,
Total;
TTrophyItem Body[24];
TTrophyRoom() {
reset();
}
void reset() {
PlayerName = "";
RegNumber = -1;
Score = 0;
Rank = RANK_NOVICE;
Last.path = 0.0f;
Last.time = 0.0f;
Last.smade = 0;
Last.ssucces = 0;
Total.path = 0.0f;
Total.time = 0.0f;
Total.smade = 0;
Total.ssucces = 0;
for (int b = 0; b < 24; ++b) {
std::memset(&Body[b], 0, sizeof(TTrophyItem));
}
}
};
class TDinoInfo {
public:
// TODO: Make member variables protected
std::string Name;
int Health0;
bool DangerCall;
float Mass,
Length,
Radius,
SmellK,
HearK,
LookK,
ShDelta;
int Scale0,
ScaleA,
BaseScore;
TDinoInfo() :
Name(""),
Health0(0),
DangerCall(false),
Mass(0.f),
Length(0.f),
Radius(0.f),
SmellK(1.f),
HearK(1.f),
LookK(1.f),
ShDelta(0.f),
Scale0(800),
ScaleA(600),
BaseScore(0)
{}
~TDinoInfo() {}
const std::string& getName() { return Name; }
const int& getBaseHealth() { return Health0; }
const int& getBaseScale() { return Scale0; }
const int& getAddScale() { return ScaleA; }
int getMaxScale() { return Scale0 + ScaleA; } // Helper function
bool isDangerous() { return DangerCall; }
const float& getMass() { return Mass; }
const float& getLength() { return Length; }
const float& getRadius() { return Radius; }
const float& getSenseSmell() { return SmellK; }
const float& getSenseHearing() { return HearK; }
const float& getSenseSight() { return LookK; }
const float& getShipDelta() { return ShDelta; }
};
class TWeapInfo {
public:
std::string Name;
float Power,
Prec,
Loud,
Rate;
int Shots;
};
typedef struct _TFogEntity {
int fogRGB;
float YBegin;
bool Mortal;
float Transp, FLimit;
} TFogEntity;
typedef struct _TWind {
float alpha;
float speed;
Vector3d nv;
} TWind;
class TPicture {
public:
int W, H;
uint16_t* lpImage;
TPicture() : W(0), H(0), lpImage(nullptr) {}
~TPicture() {
if (lpImage) {
delete[] lpImage;
}
}
};
//============= functions ==========================//
// Assembly functions:
void HLineTxB(void);
void HLineTxC(void);
void HLineTxGOURAUD(void);
void HLineTxModel25(void);
void HLineTxModel75(void);
void HLineTxModel50(void);
void HLineTxModel3(void);
void HLineTxModel2(void);
void HLineTxModel(void);
void HLineTDGlass75(void);
void HLineTDGlass50(void);