World of Might and Magic
0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
|
См. документацию.
29 float alpha = multiplier * ((diffuse >> 24) & 0xFF);
30 int a = (int)floorf(
alpha + 0.5
f);
31 a = std::max(0, std::min(255,
a));
33 float red = multiplier * ((diffuse >> 16) & 0xFF);
34 int r = (int)floorf(red + 0.5
f);
35 r = std::max(0, std::min(255,
r));
37 float green = multiplier * ((diffuse >> 8) & 0xFF);
38 int g = (int)floorf(
green + 0.5
f);
39 g = std::max(0, std::min(255,
g));
41 float blue = multiplier * ((diffuse >> 0) & 0xFF);
42 int b = (int)floorf(
blue + 0.5
f);
43 b = std::max(0, std::min(255,
b));
45 return (
a << 24) | (
r << 16) | (
g << 8) |
b;
66 if (
p->vWorldViewPosition.x < 300.0 ||
67 (
v2 = 300.0 <
p[1].vWorldViewPosition.x,
v3 = 0,
68 v4 = 300.0 ==
p[1].vWorldViewPosition.x,
71 if (
p->vWorldViewPosition.x < 300.0) {
72 v6 = 300.0 <
p[1].vWorldViewPosition.x;
74 v8 = 300.0 ==
p[1].vWorldViewPosition.x;
80 v9 = 300.0 <
p->vWorldViewPosition.x;
82 v11 = 300.0 ==
p->vWorldViewPosition.x;
86 1.0f / (
p->vWorldViewPosition.x -
p[1].vWorldViewPosition.x);
87 v17 = (
p->vWorldViewPosition.y -
p[1].vWorldViewPosition.y) * v16;
88 v18 = (
p->vWorldViewPosition.z -
p[1].vWorldViewPosition.z) * v16;
89 float v19 = 300.0 -
p[1].vWorldViewPosition.x;
90 p[1].vWorldViewPosition.x = v19 +
p[1].vWorldViewPosition.x;
91 p[1].vWorldViewPosition.y = v17 * v19 +
p[1].vWorldViewPosition.y;
92 p[1].vWorldViewPosition.z = v19 * v18 +
p[1].vWorldViewPosition.z;
95 1.0f / (
p[1].vWorldViewPosition.x -
p->vWorldViewPosition.x);
96 v13 = (
p[1].vWorldViewPosition.y -
p->vWorldViewPosition.y) * v12;
97 v14 = (
p[1].vWorldViewPosition.z -
p->vWorldViewPosition.z) * v12;
98 float v15 = 300.0 -
p->vWorldViewPosition.x;
99 p->vWorldViewPosition.x = v15 +
p->vWorldViewPosition.x;
100 p->vWorldViewPosition.y = v13 * v15 +
p->vWorldViewPosition.y;
101 p->vWorldViewPosition.z = v15 * v14 +
p->vWorldViewPosition.z;
145 float x_offset,
float y_offset,
float z_offset,
float scale,
int diffuse) {
229 v[0].vWorldPosition.x =
p->
srcX;
230 v[0].vWorldPosition.y =
p->srcY;
231 v[0].vWorldPosition.z =
p->srcZ;
232 v[1].vWorldPosition.x =
p->dstX;
233 v[1].vWorldPosition.y =
p->dstY;
234 v[1].vWorldPosition.z =
p->dstZ;
243 render->DrawProjectile(
v[0].vWorldViewProjX,
v[0].vWorldViewProjY,
244 v[0].vWorldViewPosition.x, v11,
245 v[1].vWorldViewProjX,
v[1].vWorldViewProjY,
246 v[1].vWorldViewPosition.x, v10,
p->texture);
264 thisspellfxrend =
this;
265 memset(&local_0, 0, 0x68u);
269 v7 = &thisspellfxrend->
array_4[v6 & 0x1F];
286 local_0.
x =
x - 4.0f;
306 local_0.
x = v10 + 4.0f;
328 memset(&local_0, 0, 0x68u);
340 local_0.
r = (float)(rand() & 0x1FF) - 255.0
f;
341 local_0.
g = (float)(rand() & 0x1FF) - 255.0
f;
342 local_0.
b = (float)(rand() & 0x1FF) - 255.0
f;
352 v4 = (1.0 -
v3) * 4.0;
354 v4 =
v3 * 1.333333333333333;
367 for (
unsigned int i = 0; i < 10; ++i) {
368 local_0.
r = (rand() & 0x1FF) - 255;
369 local_0.
g = (rand() & 0x1FF) - 255;
370 local_0.
b = (rand() & 0x1FF) - 255;
377 floorf(0.5
f + (512.0 *
v3)),
387 v5 = v4 * 1.333333333333333;
393 floorf(0.5
f + (512.
f - v4 * 512.
f)),
424 for (
int i = 0; i < 10; i++) {
425 Dst.
r = (float)(rand() & 0x1FF) - 255.0
f;
426 Dst.
g = (float)(rand() & 0x1FF) - 255.0
f;
427 Dst.
b = (float)(rand() & 0x1FF) - 255.0
f;
437 uRadius, (uDiffuse & 0x00FF0000) >> 16, (uDiffuse & 0x0000FF00) >> 8,
457 memset(&local_0, 0, 0x68u);
463 local_0.
z = (float)(v5 + 32);
474 v8 = 0.70710677 * a4;
484 local_0.
r = uDiffusea;
497 local_0.
r = uTextureIDa;
498 local_0.
g = uTextureIDa;
504 local_0.
r = uTextureIDa;
505 local_0.
g = uDiffusea;
577 Actor *pActor,
unsigned int uDiffuse) {
585 memset(&Dst, 0, 0x68u);
593 v7 = (
unsigned __int8)rand() +
v3->vPosition.x - 127;
595 v7 = (
unsigned __int8)rand() +
v3->vPosition.y - 127;
597 v7 =
v3->vPosition.z + (
unsigned __int8)rand();
621 memset(&local_0, 0,
sizeof(local_0));
634 local_0.
x = v8 * 40.0f - 20.0f + v12;
638 local_0.
y = v9 * 40.0f - 20.0f + v11;
657 v2 = (
v3 - 64) * (
v3 - 64);
658 v4 = (double)
v2 / 5120.0 + 0.2;
661 v4 = 1.0 - (double)(
signed int)(
v3 *
v3) / 5120.0;
917 memcpy(pContainer,
"sp18h1", 7);
1104 unsigned __int16 uPlayerID) {
1223 unsigned int uDiffuseColor,
unsigned int uFadeTime) {
1258 if (v5 > 0.9) v5 = 1.0 - (v5 - 0.9) * 10.0;
1278 vd3d[0].
pos.
z = 0.0;
1287 vd3d[1].
pos.
z = 0.0;
1296 vd3d[2].
pos.
z = 0.0;
1305 vd3d[3].
pos.
z = 0.0;
1318 for (
uint i = 0; i < 4; ++i) {
1330 render->DrawTextureAlphaNew(
1462 bool currvert = (
field_64[0] <= NearClip);
1463 bool nextvert =
false;
1464 int ProducedVerts = 0;
1468 nextvert = (
field_64[(i+1) * 4] <= NearClip);
1470 if (currvert ^ nextvert) {
1475 field_B4[ProducedVerts * 4] = NearClip;
1487 field_B4[ProducedVerts * 4] = NearClip;
1512 currvert = nextvert;
1515 return this->uNumVertices = ProducedVerts;
1531 bool currvert = (
field_64[0] >= farclip);
1532 bool nextvert =
false;
1533 int ProducedVerts = 0;
1537 nextvert = (
field_64[(i + 1) * 4] >= farclip);
1539 if (currvert ^ nextvert) {
1544 field_B4[ProducedVerts * 4] = farclip;
1555 field_B4[ProducedVerts * 4] = farclip;
1580 currvert = nextvert;
1583 return this->uNumVertices = ProducedVerts;
1611 bool NeedNearClip = 0;
1612 bool NeedFarClip = 0;
1630 if (!NeedNearClip) {
1634 return this->uNumVertices != 0;
1644 return this->uNumVertices != 0;
1649 return this->uNumVertices != 0;
std::array< __int32, 128 *3 > array_4EBBD0_x
@ SPRITE_SPELL_MIND_BERSERK
void AddProjectile(struct SpriteObject *a2, int a3, Texture *)
@ SPELL_SPIRIT_RESSURECTION
@ SPRITE_SPELL_MIND_PSYCHIC_SHOCK
@ SPELL_SPIRIT_SHARED_LIFE
@ SPRITE_SPELL_BODY_FLYING_FIST
@ SPRITE_SPELL_AIR_LIGHNING_BOLT
@ SPRITE_BLASTER_PROJECTILE
unsigned int uTimeElapsed
@ SPRITE_SPELL_AIR_SPARKS
GLenum GLenum GLenum GLenum GLenum scale
@ SPELL_SPIRIT_PRESERVATION
unsigned int uNumVec4sInArray1
void InitializeAnimation(unsigned int uIconID)
@ SPRITE_PROJECTILE_530_IMPACT
GLenum GLint GLint GLint GLint GLuint GLenum GLint GLint dstX
struct SpriteFrameTable * pSpriteFrameTable
@ SPRITE_SPELL_FIRE_INCINERATE_IMPACT
SpellFX_Billboard * pStru1
PlayerBuffAnim pPlayerBuffs[4]
std::array< stru160, 66 > array_4EB8B8
struct IconFrameTable * pIconsFrameTable
@ SPELL_LIGHT_HOUR_OF_POWER
@ SPRITE_SPELL_MIND_ENSLAVE
int SpellFXFarClipAdjust(float a2)
@ SPELL_LIGHT_DAY_OF_PROTECTION
void _4A75CC_single_spell_collision_particle(struct SpriteObject *a1, unsigned int uDiffuse, Texture *texture)
@ SPRITE_PROJECTILE_540_IMPACT
unsigned int GetAnimLength() const
@ SPRITE_PROJECTILE_510_IMPACT
@ SPRITE_SPELL_DARK_DRAGON_BREATH
bool sr_42620A(RenderVertexSoft *p)
@ SPRITE_SPELL_EARTH_MASS_DISTORTION
int round_to_int(float x)
@ SPRITE_SPELL_WATER_ICE_BOLT_IMPACT
@ SPRITE_SPELL_LIGHT_SUMMON_ELEMENTAL
@ SPRITE_SPELL_DARK_SHARPMETAL_IMPACT
@ SPRITE_SPELL_DARK_SACRIFICE
void _47829F_sphere_particle(float x_offset, float y_offset, float z_offset, float scale, int diffuse)
@ SPRITE_SPELL_AIR_STARBURST
@ SPELL_EARTH_PROTECTION_FROM_EARTH
@ SPRITE_SPELL_DARK_DRAGON_BREATH_1
@ SPRITE_SPELL_FIRE_FIRE_BOLT
void _4A7F74(int x, int y, int z)
GLenum GLenum GLuint texture
@ SPELL_FIRE_PROTECTION_FROM_FIRE
@ SPELL_MIND_PROTECTION_FROM_MIND
@ SPRITE_SPELL_FIRE_INFERNO
@ SPRITE_SPELL_EARTH_ROCK_BLAST
unsigned __int16 uSpriteFrameID
@ SPELL_AIR_PROTECTION_FROM_AIR
@ SPRITE_SPELL_MIND_MIND_BLAST
void _4A7C07_stun_spell_fx(struct SpriteObject *a2)
@ SPRITE_SPELL_DARK_SHARPMETAL
@ SPRITE_PROJECTILE_535_IMPACT
ParticleEngine * particle_engine
@ SPRITE_SPELL_EARTH_TELEKINESIS
@ SPRITE_SPELL_WATER_ACID_BURST_IMPACT
void _4A7948_mind_blast_after_effect(struct SpriteObject *a1)
GLfloat GLfloat GLfloat alpha
EGLSurface EGLint EGLint y
Icon * GetIcon(unsigned int idx)
@ SPRITE_SPELL_EARTH_DEATH_BLOSSOM
GLenum GLint GLint GLint srcY
struct Vec3_int_ vPosition
@ SPRITE_SPELL_AIR_IMPLOSION_IMPACT
@ SPRITE_PROJECTILE_525_IMPACT
@ SPRITE_SPELL_EARTH_ROCK_BLAST_IMPACT
@ ACTOR_BUFF_MASS_DISTORTION
@ SPRITE_PROJECTILE_520_IMPACT
@ SPRITE_SPELL_EARTH_DEADLY_SWARM
SpriteFrame * GetFrame(unsigned int uSpriteID, unsigned int uTime)
@ SPRITE_SPELL_FIRE_IMMOLATION
GLenum GLint GLint GLint GLint GLuint GLenum GLint GLint GLint GLint dstZ
@ SPRITE_SPELL_MIND_MASS_FEAR
@ SPELL_BODY_REGENERATION
std::array< int16_t, 4 > pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing
void Project(int x, int y, int z, int *screenspace_x, int *screenspace_y)
@ SPRITE_SPELL_WATER_ACID_BURST
@ SPRITE_SPELL_LIGHT_LIGHT_BOLT_IMPACT
@ SPRITE_SPELL_FIRE_FIRE_BOLT_IMPACT
SpriteFrame * pSpriteSFrames
@ SPRITE_SPELL_FIRE_FIRE_SPIKE_IMPACT
bool AddMobileLight(struct SpriteObject *a1, unsigned int uDiffuse, int uRadius)
void _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(struct SpriteObject *a2, unsigned int uDiffuse, Texture *texture)
void _4A7688_fireball_collision_particle(struct SpriteObject *a2)
void DrawPlayerBuffAnims()
int SpellFXNearClipAdjust(float a2)
float _4A806F_get_mass_distortion_value(struct Actor *pActor)
@ SPRITE_SPELL_AIR_STARBURST_1
@ SPRITE_SPELL_DARK_TOXIC_CLOUD
void DoAddProjectile(float srcX, float srcY, float srcZ, float dstX, float dstY, float dstZ, Texture *)
@ SPRITE_SPELL_FIRE_METEOR_SHOWER
Texture * GetBitmap(const String &name)
@ SPRITE_SPELL_FIRE_METEOR_SHOWER_1
@ SPRITE_SPELL_EARTH_BLADES_IMPACT
@ SPRITE_SPELL_EARTH_DEADLY_SWARM_IMPACT
@ SPRITE_PROJECTILE_500_IMPACT
@ SPELL_MIND_CURE_INSANITY
unsigned int FindIcon(const char *pIconName)
void AddParticle(Particle_sw *a2)
void InitializeSprite(signed int uSpriteID)
ProjectileAnim pProjectiles[32]
bool RenderAsSprite(struct SpriteObject *a2)
@ SPRITE_SPELL_AIR_IMPLOSION
@ SPRITE_SPELL_LIGHT_SUNRAY_IMPACT
@ SPRITE_SPELL_BODY_FLYING_FIST_IMPACT
void _4A78AE_sparks_spell(struct SpriteObject *a1)
struct Viewport * pViewport
Icon * GetFrame(unsigned int uIconID, unsigned int frame_time)
@ SPRITE_SPELL_AIR_LIGHNING_BOLT_IMPACT
@ SPRITE_SPELL_EARTH_DEATH_BLOSSOM_IMPACT
int FastFindSprite(const char *pSpriteName)
GLenum GLint GLint GLint GLint srcZ
@ SPELL_BODY_PROTECTION_FROM_BODY
@ SPRITE_SPELL_WATER_POISON_SPRAY
@ SPRITE_SPELL_FIRE_INCINERATE
@ SPELL_SPIRIT_REMOVE_CURSE
GLboolean GLboolean GLboolean b
@ SPRITE_SPELL_LIGHT_DESTROY_UNDEAD
GLenum GLint GLint GLint GLint GLuint GLenum GLint GLint GLint dstY
struct OtherOverlayList * pOtherOverlayList
@ SPRITE_SPELL_DARK_REANIMATE
@ SPRITE_SPELL_EARTH_DEATH_BLOSSOM_FALLOUT
GLdouble GLdouble GLdouble r
virtual ~SpellFX_Billboard()
@ SPRITE_SPELL_LIGHT_PRISMATIC_LIGHT
@ SPRITE_SPELL_EARTH_STUN
@ SPELL_BODY_CURE_WEAKNESS
GLfloat GLfloat GLfloat v2
@ SPRITE_ARROW_PROJECTILE
@ SPRITE_SPELL_WATER_ICE_BLAST_FALLOUT
GLfloat GLfloat GLfloat GLfloat v3
void __cdecl __debugbreak(void)
unsigned int uNumVec3sInArray2
@ SPELL_WATER_PROTECTION_FROM_WATER
@ SPRITE_SPELL_WATER_POISON_SPRAY_IMPACT
@ SPRITE_SPELL_LIGHT_SUNRAY
@ SPRITE_SPELL_WATER_ICE_BLAST_IMPACT
@ SPELL_BODY_CURE_DISEASE
@ SPRITE_SPELL_WATER_ICE_BOLT
@ SPELL_LIGHT_DIVINE_INTERVENTION
void SetRange(int min, int max)
@ SPRITE_SPELL_LIGHT_PARALYZE
@ SPELL_SPIRIT_DETECT_LIFE
GLboolean GLboolean GLboolean GLboolean a
@ SPRITE_SPELL_MIND_TELEPATHY
unsigned int ModulateColor(unsigned int diffuse, float multiplier)
@ SPRITE_SPELL_DARK_CONTROL_UNDEAD
@ SPRITE_PROJECTILE_515_IMPACT
@ BECOME_MAGIC_GUILD_MEMBER
void ViewTransform(int x, int y, int z, int *transformed_x, int *transformed_y, int *transformed_z)
void FadeScreen__like_Turn_Undead_and_mb_Armageddon(unsigned int uDiffuseColor, unsigned int uFadeTime)
@ SPRITE_SPELL_MIND_CHARM
@ SPRITE_SPELL_FIRE_FIREBALL
float GetNearClip() const
LightsStack_MobileLight_ * pMobileLightsStack
@ SPRITE_SPELL_WATER_ICE_BLAST
void SetPlayerBuffAnim(uint16_t uSpellID, uint16_t uPlayerID)
@ SPRITE_SPELL_FIRE_FIREBALL_IMPACT
@ SPRITE_SPELL_MIND_MIND_BLAST_IMPACT
unsigned int GetLifetime()
void RenderSpecialEffects()
void _4A77FD_implosion_particle_d3d(struct SpriteObject *a1)
IndoorCameraD3D * pIndoorCameraD3D
void _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(SpriteObject *a1, unsigned int uDiffuse, Texture *texture, float a4)
@ SPELL_MIND_CURE_PARALYSIS
void _4A7E89_sparkles_on_actor_after_it_casts_buff(struct Actor *pActor, unsigned int uDiffuse)
int uSpellAnimTimeElapsed
unsigned int uTotalGameTimeElapsed
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)
@ SPRITE_SPELL_DARK_SHRINKING_RAY
@ SPRITE_SPELL_LIGHT_LIGHT_BOLT
@ SPRITE_PROJECTILE_505_IMPACT
SpriteFrame * GetSpriteFrame()
@ SPRITE_SPELL_EARTH_BLADES
int SpellFXViewTransform()
@ SPELL_BODY_PROTECTION_FROM_MAGIC
@ SPELL_LIGHT_DAY_OF_THE_GODS
@ SPRITE_SPELL_BODY_HARM_IMPACT
struct SpellBuff pActorBuffs[22]
std::shared_ptr< IRender > render
@ SPRITE_SPELL_FIRE_FIRE_SPIKE