World of Might and Magic
0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
LightsStack.cpp
См. документацию.
1
#include "
Engine/Log.h
"
2
3
#include "
Engine/Graphics/Lights.h
"
4
5
//----- (00467D88) --------------------------------------------------------
6
bool
LightsStack_MobileLight_::AddLight
(
int16_t
x
,
int16_t
y
,
int16_t
z
,
7
int16_t
uSectorID,
int
uRadius,
8
uint8_t
r
,
uint8_t
g
,
9
uint8_t
b
,
char
uLightType) {
10
if
(
uNumLightsActive
>= 400) {
11
log
->
Warning
(L
"Too many mobile lights!"
);
12
return
false
;
13
}
14
15
pLights
[
uNumLightsActive
].
vPosition
.x =
x
;
16
pLights
[
uNumLightsActive
].
vPosition
.y =
y
;
17
pLights
[
uNumLightsActive
].
vPosition
.z =
z
;
18
pLights
[
uNumLightsActive
].
uRadius
= uRadius;
19
pLights
[
uNumLightsActive
].
field_C
= (((uRadius < 0) - 1) & 0x3E) - 31;
20
pLights
[
uNumLightsActive
].
uSectorID
= uSectorID;
21
pLights
[
uNumLightsActive
].
field_10
= uRadius * uRadius >> 5;
22
pLights
[
uNumLightsActive
].
uLightColorR
=
r
;
23
pLights
[
uNumLightsActive
].
uLightColorG
=
g
;
24
pLights
[
uNumLightsActive
].
uLightColorB
=
b
;
25
pLights
[
uNumLightsActive
++].
uLightType
= uLightType;
26
27
return
true
;
28
}
29
30
bool
LightsStack_StationaryLight_::AddLight
(
int16_t
x
,
int16_t
y
,
int16_t
z
,
31
int16_t
a5,
unsigned
char
r
,
32
unsigned
char
g
,
unsigned
char
b
,
33
char
uLightType) {
34
if
(
uNumLightsActive
>= 400) {
35
log
->
Warning
(L
"Too many stationary lights!"
);
36
return
false
;
37
}
38
39
StationaryLight
* pLight = &
pLights
[
uNumLightsActive
++];
40
pLight->
vPosition
.x =
x
;
41
pLight->
vPosition
.y =
y
;
42
pLight->
vPosition
.z =
z
;
43
pLight->
uRadius
= a5;
44
pLight->
uLightColorR
=
r
;
45
pLight->
uLightColorG
=
g
;
46
pLight->
uLightColorB
=
b
;
47
pLight->
uLightType
= uLightType;
48
return
true
;
49
}
LightsStack_StationaryLight_::uNumLightsActive
unsigned int uNumLightsActive
Definition:
Lights.h:65
MobileLight::vPosition
Vec3_short_ vPosition
Definition:
Lights.h:22
MobileLight::field_10
int16_t field_10
Definition:
Lights.h:30
int16_t
signed __int16 int16_t
Definition:
SDL_config.h:36
StationaryLight::uLightColorR
uint8_t uLightColorR
Definition:
Lights.h:13
MobileLight::uLightColorR
uint8_t uLightColorR
Definition:
Lights.h:24
z
GLdouble GLdouble z
Definition:
SDL_opengl_glext.h:407
Lights.h
StationaryLight::uLightType
char uLightType
Definition:
Lights.h:16
StationaryLight
Definition:
Lights.h:10
y
EGLSurface EGLint EGLint y
Definition:
SDL_egl.h:1596
LightsStack_StationaryLight_::log
Log * log
Definition:
Lights.h:67
x
EGLSurface EGLint x
Definition:
SDL_egl.h:1596
LightsStack_MobileLight_::log
Log * log
Definition:
Lights.h:89
Log::Warning
void Warning(const wchar_t *pFormat,...)
Definition:
Log.cpp:28
LightsStack_MobileLight_::pLights
MobileLight pLights[400]
Definition:
Lights.h:87
MobileLight::uSectorID
int16_t uSectorID
Definition:
Lights.h:29
MobileLight::uLightColorG
uint8_t uLightColorG
Definition:
Lights.h:25
MobileLight::uLightColorB
uint8_t uLightColorB
Definition:
Lights.h:26
uint8_t
unsigned __int8 uint8_t
Definition:
SDL_config.h:35
LightsStack_MobileLight_::uNumLightsActive
unsigned int uNumLightsActive
Definition:
Lights.h:88
StationaryLight::vPosition
Vec3_short_ vPosition
Definition:
Lights.h:11
StationaryLight::uLightColorG
uint8_t uLightColorG
Definition:
Lights.h:14
LightsStack_StationaryLight_::pLights
StationaryLight pLights[400]
Definition:
Lights.h:64
b
GLboolean GLboolean GLboolean b
Definition:
SDL_opengl_glext.h:1112
r
GLdouble GLdouble GLdouble r
Definition:
SDL_opengl.h:2079
StationaryLight::uRadius
int16_t uRadius
Definition:
Lights.h:12
LightsStack_StationaryLight_::AddLight
bool AddLight(int16_t x, int16_t y, int16_t z, int16_t a5, unsigned char r, unsigned char g, unsigned char b, char uLightType)
Definition:
LightsStack.cpp:30
StationaryLight::uLightColorB
uint8_t uLightColorB
Definition:
Lights.h:15
MobileLight::uLightType
char uLightType
Definition:
Lights.h:27
MobileLight::field_C
int16_t field_C
Definition:
Lights.h:28
g
GLboolean GLboolean g
Definition:
SDL_opengl_glext.h:1112
LightsStack_MobileLight_::AddLight
bool AddLight(int16_t x, int16_t y, int16_t z, int16_t uSectorID, int uRadius, uint8_t r, uint8_t g, uint8_t b, char a10)
Definition:
LightsStack.cpp:6
Log.h
MobileLight::uRadius
int16_t uRadius
Definition:
Lights.h:23
Engine
Graphics
LightsStack.cpp
Документация по World of Might and Magic. Последние изменения: Вт 7 Апр 2020 22:03:29. Создано системой
1.8.17