-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModelLib.h
143 lines (119 loc) · 3.16 KB
/
ModelLib.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
/*
-------------------------[ LBA Story Coder Source ]--------------------------
Copyright (C) 2004
-------------------------------[ ModelLib.h ]--------------------------------
Author: Alexandre Fontoura [alexfont]
Begin : Thu Aug 20 2004
Email : alexandrefontoura@oninetspeed.pt
Original Code: Vicent Hamm [yaz0r]
-------------------------------[ GNU License ]-------------------------------
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-----------------------------------------------------------------------------
*/
#ifndef ModelLibH
#define ModelLibH
//---------------------------------------------------------------------------
#include <gl/gl.h>
#include <gl/glu.h>
#include <stdio.h>
#include <windows.h>
#include <stdlib.h>
#include <process.h>
struct hqr_entry
{
char fileName[128];
int size1;
int remainingSize;
short int b;
short int unk;
unsigned char *ptr;
};
struct subHqr
{
unsigned char index;
unsigned int offFromPtr;
unsigned int size;
int lastAccessedTime;
};
struct pointTab
{
short int x;
short int y;
short int z;
};
struct pointTabShaded
{
short int shader;
short number;
};
struct renderTabEntry
{
short int depth;
short int renderType;
unsigned char* dataPtr;
};
struct pointEntry
{
short int data1;
short int data2;
short int data3;
short int param;
int flag1;
int flag2;
int field_10;
int field_14;
int field_18;
int field_1C;
int field_20;
short int field_24;
};
struct lineCoordinates
{
int data;
short int p1;
short int p2;
};
struct lineData
{
int data;
short int p1;
short int p2;
};
struct circleData
{
int color;
short int size;
short int center;
};
bool glCreate(TPanel *Panel1);
void glInit(float w, float h);
void glShutDwn(TPanel *Panel1);
void start(TPanel *Panel1, int model);
void loadGfxSub(unsigned char * ptr);
void draw_screen( void );
int setupModel(unsigned char * costumePtr);
int finishModelSetup(unsigned char* esi);
void renderS1S2(unsigned char * esi, int ecx, pointTab *dest,int* eax);
void renderS1S1(int* eax, int* ebp);
void renderS1(int edx, int ecx, int ebx, pointEntry* ptr);
int renderM2(unsigned char * ptr);
GLvoid CalculateVectorNormal(GLfloat fVert1[], GLfloat fVert2[], GLfloat fVert3[], GLfloat *fNormalX,GLfloat *fNormalY, GLfloat *fNormalZ);
void Draw();
void setModel(int model);
void setZoom(double z);
void setZoom();
void setAngle(int a);
int getAngle();
void autorotate();
void wireframe();
#endif