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: Didier Pédreno - Sébastien Scieux
44 //
45 // Copyright (c) 1999-2001 ARKANE Studios SA. All rights reserved
46 
47 #ifndef ARX_GRAPHICS_EFFECTS_SPELLEFFECTS_H
48 #define ARX_GRAPHICS_EFFECTS_SPELLEFFECTS_H
49 
50 #include "graphics/Color.h"
51 #include "graphics/Math.h"
52 #include "math/MathFwd.h"
53 
54 struct TexturedVertex;
55 
56 const int BEZIERPrecision = 32;
57 
58 void EE_RT2(TexturedVertex * in, TexturedVertex * out);
59 
60 class CSpellFx
61 {
62 	protected:
63 		float	fBeta;
64 		float	fBetaRad;
65 		float	fBetaRadCos;
66 		float	fBetaRadSin;
67 
68 		float	fManaCostToLaunch;
69 		float	fManaCostPerSecond;
70 
71 		float	fOneOnDuration;
72 
73 
74 	public:
75 		unsigned long ulDuration;
76 		unsigned long ulCurrentTime;
77 		long lLightId;
78 		long lSrc;
79 
80 	public:
81 		CSpellFx();
~CSpellFx()82 		virtual ~CSpellFx() { }
83 
84 		// accesseurs
85 	public:
86 		virtual void SetDuration(const unsigned long ulaDuration);
87 		virtual unsigned long getCurrentTime();
88 		virtual unsigned long GetDuration();
89 		void SetAngle(float angle);
90 
91 		// surcharge
92 	public:
93 		long			spellinstance;
Update(unsigned long)94 		virtual void	Update(unsigned long) { }
95 		void			Update(float time);
Render()96 		virtual float	Render()
97 		{
98 			return 1;
99 		};
100 };
101 
102 #define frand2() (1.0f - (2.0f * rnd()))
103 
104 void Draw3DLineTex2(Vec3f s, Vec3f e, float fSize, Color color, Color color2);
105 void Draw3DLineTex(Vec3f, Vec3f, Color, float, float);
106 
107 void Split(TexturedVertex * v, int a, int b, float fX, float fMulX, float fY, float fMulY, float fZ, float fMulZ);
108 void Split(TexturedVertex * v, int a, int b, float yo, float fMul = 0.5f);
109 
110 #endif // ARX_GRAPHICS_EFFECTS_SPELLEFFECTS_H
111