1 /*
2  * Copyright 2011-2012 Arx Libertatis Team (see the AUTHORS file)
3  *
4  * This file is part of Arx Libertatis.
5  *
6  * Arx Libertatis is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Arx Libertatis is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with Arx Libertatis.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 /* Based on:
20 ===========================================================================
21 ARX FATALIS GPL Source Code
22 Copyright (C) 1999-2010 Arkane Studios SA, a ZeniMax Media company.
23 
24 This file is part of the Arx Fatalis GPL Source Code ('Arx Fatalis Source Code').
25 
26 Arx Fatalis Source Code is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
27 License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
28 
29 Arx Fatalis Source Code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
30 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
31 
32 You should have received a copy of the GNU General Public License along with Arx Fatalis Source Code.  If not, see
33 <http://www.gnu.org/licenses/>.
34 
35 In addition, the Arx Fatalis Source Code is also subject to certain additional terms. You should have received a copy of these
36 additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Arx
37 Fatalis Source Code. If not, please request a copy in writing from Arkane Studios at the address below.
38 
39 If you have questions concerning this license or the applicable additional terms, you may contact in writing Arkane Studios, c/o
40 ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
41 ===========================================================================
42 */
43 // Code: Cyril Meynier
44 //
45 // Copyright (c) 1999-2000 ARKANE Studios SA. All rights reserved
46 
47 #ifndef ARX_CORE_CORE_H
48 #define ARX_CORE_CORE_H
49 
50 #include <stddef.h>
51 #include <string>
52 
53 #include "graphics/Color.h"
54 #include "graphics/data/Mesh.h"
55 #include "io/resource/ResourcePath.h"
56 #include "math/MathFwd.h"
57 
58 #include "Configure.h"
59 
60 class TextureContainer;
61 struct EERIE_3DOBJ;
62 struct EERIE_MULTI3DSCENE;
63 
64 const size_t MAX_GOLD_COINS_VISUALS = 7;
65 
66 extern Color3f FADECOLOR;
67 extern TextureContainer * TC_fire2;
68 extern TextureContainer * TC_fire;
69 extern TextureContainer * TC_smoke;
70 extern TextureContainer * GoldCoinsTC[MAX_GOLD_COINS_VISUALS];
71 extern EERIE_3DOBJ * cabal;
72 extern EERIE_3DOBJ * cameraobj;
73 extern EERIE_3DOBJ * markerobj;
74 extern Vec3f lastteleport;
75 extern EERIE_CAMERA bookcam;
76 extern Vec2s DANAEMouse;
77 extern EERIE_CAMERA subj, mapcam;
78 extern Vec3f moveto;
79 extern Vec2s STARTDRAG;
80 extern EERIE_3DOBJ * GoldCoinsObj[MAX_GOLD_COINS_VISUALS];
81 extern EERIE_3DOBJ * nodeobj;
82 extern Vec3f Mscenepos;
83 #ifdef BUILD_EDIT_LOADSAVE
84 extern EERIE_MULTI3DSCENE * mse;
85 extern long ADDED_IO_NOT_SAVED;
86 #endif
87 extern EERIE_CAMERA * Kam;
88 extern Entity * COMBINE;
89 extern res::path LastLoadedScene;
90 extern char TELEPORT_TO_LEVEL[64];
91 extern char TELEPORT_TO_POSITION[64];
92 extern float PULSATE;
93 extern float framedelay;
94 extern float BASE_FOCAL;
95 
96 extern float Xratio;
97 extern float Yratio;
sizeRatio()98 inline Vec2f sizeRatio() { return Vec2f(Xratio, Yratio); }
minSizeRatio()99 inline float minSizeRatio() { return std::min(Xratio, Yratio); }
100 
101 extern long	FADEDURATION;
102 extern long	FADEDIR;
103 extern float FrameDiff;
104 extern long FirstFrame;
105 #ifdef BUILD_EDITOR
106 extern long EDITMODE;
107 extern long EDITION;
108 extern long DEBUGNPCMOVE;
109 #else
110 const long EDITMODE = 0;
111 #endif
112 extern long SHOW_TORCH;
113 extern long CURRENTLEVEL;
114 extern long TELEPORT_TO_ANGLE;
115 extern long DANAESIZX;
116 extern long DANAESIZY;
117 extern long DANAECENTERX;
118 extern long DANAECENTERY;
119 extern unsigned long FADESTART;
120 extern unsigned long AimTime;
121 
122 class Image;
123 extern Image savegame_thumbnail;
124 
125 extern float Original_framedelay;
126 extern long LOADEDD;
127 extern std::string WILL_LAUNCH_CINE;
128 extern long PLAY_LOADED_CINEMATIC;
129 extern long CINE_PRELOAD;
130 
131 struct QUAKE_FX_STRUCT {
132 	float intensity;
133 	float frequency;
134 	unsigned long start;
135 	unsigned long duration;
136 	long	flags;
137 };
138 extern QUAKE_FX_STRUCT QuakeFx;
139 
140 void SetEditMode(long ed, const bool stop_sound = true);
141 void AddQuakeFX(float intensity, float duration, float period, long flags);
142 
143 void SendGameReadyMsg();
144 void DanaeSwitchFullScreen();
145 void DANAE_KillCinematic();
146 void ARX_SetAntiAliasing();
147 void ReMappDanaeButton();
148 void AdjustMousePosition();
149 void DANAE_StartNewQuest();
150 bool DANAE_ManageSplashThings();
151 long DANAE_Manage_Cinematic();
152 void DanaeRestoreFullScreen();
153 void FirstFrameHandling();
154 
155 void ShowTestText();
156 void ShowInfoText();
157 void ShowFPS();
158 
159 void DrawImproveVisionInterface();
160 void DrawMagicSightInterface();
161 void RenderAllNodes();
162 
163 void CheckMr();
164 
165 void ManageFade();
166 void ManageQuakeFX();
167 
168 void ManageCombatModeAnimations();
169 void ManageCombatModeAnimationsEND();
170 void ManageNONCombatModeAnimations();
171 
172 Entity * FlyingOverObject(Vec2s * pos);
173 
174 void runGame();
175 
176 void DANAE_ReleaseAllDatasDynamic();
177 
178 #endif // ARX_CORE_CORE_H
179