forked from Ports/goldeneye-pc-port
Water decal improvement
This commit is contained in:
1 parent
af9a3c19e6
commit
3154efa79f
3 files changed
+66
No files matched your search
@@ -1176,6 +1176,16 @@ void chraiDefaultWeaponFireHandler(s32 hand)
|
||||
rooms[1] = 255;
|
||||
explosionCreate(0, finalpos, hittile, 1, 0, get_cur_playernum(), rooms, 0);
|
||||
}
|
||||
#ifdef PORT
|
||||
else if (gotbghit && besttexture >= 0 && g_Textures[besttexture].hitTexture == HIT_WATER)
|
||||
{
|
||||
/* a splash instead of the yellow impact flash below */
|
||||
rooms[0] = bestroom;
|
||||
rooms[1] = 255;
|
||||
explosionCreateWaterSplash(finalpos, hittile, rooms);
|
||||
createSpark = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
finalpos->x -= 26.0f * shotdata.dir.x;
|
||||
|
||||
@@ -1590,6 +1590,9 @@ void explosionInitFlyingParticles(coord3d *spawnpos, f32 spawn_rand_scale, f32 s
|
||||
rand3 = (2.0f * (((f32) randomGetNext()) * (1.0f / (f32)UINT_MAX))) - 1.0f;
|
||||
|
||||
g_FlyingParticlesBuffer[g_NumParticleEntries].unk00 = 1;
|
||||
#ifdef PORT
|
||||
g_FlyingParticlesBuffer[g_NumParticleEntries].is_splash = FALSE;
|
||||
#endif
|
||||
|
||||
g_FlyingParticlesBuffer[g_NumParticleEntries].position.f[0] = spawnpos->f[0] + (spawn_rand_scale * rand1);
|
||||
g_FlyingParticlesBuffer[g_NumParticleEntries].position.f[1] = spawnpos->f[1] + (spawn_rand_scale * rand2);
|
||||
@@ -1739,6 +1742,15 @@ void explosionUpdateFlyingParticles(void)
|
||||
g_FlyingParticlesBuffer[i].unk00 = 0;
|
||||
}
|
||||
|
||||
#ifdef PORT
|
||||
if (g_FlyingParticlesBuffer[i].is_splash
|
||||
&& g_FlyingParticlesBuffer[i].position_drift.f[1] < 0.0f
|
||||
&& g_FlyingParticlesBuffer[i].position.f[1] < g_FlyingParticlesBuffer[i].splash_y)
|
||||
{
|
||||
g_FlyingParticlesBuffer[i].unk00 = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
// position-related. deletes particles that are too low or too high.
|
||||
if ((g_FlyingParticlesBuffer[i].position.f[1] < -30000.0f) || (g_FlyingParticlesBuffer[i].position.f[1] > 30000.0f))
|
||||
{
|
||||
@@ -1749,6 +1761,42 @@ void explosionUpdateFlyingParticles(void)
|
||||
}
|
||||
|
||||
|
||||
#ifdef PORT
|
||||
/* Bullet hitting water (PC): the N64 only drew the yellow impact flash there.
|
||||
* Throw up light blue droplets (the wall-hit dust particles, recoloured) that
|
||||
* vanish when they fall back through the surface, plus a white mist puff. */
|
||||
#define WATER_SPLASH_DROPLETS 12
|
||||
|
||||
void explosionCreateWaterSplash(coord3d *pos, StandTile *stan, u8 *rooms)
|
||||
{
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
for (i = 0; i < WATER_SPLASH_DROPLETS; i++)
|
||||
{
|
||||
struct FlyingParticles *drop = &g_FlyingParticlesBuffer[g_NumParticleEntries];
|
||||
|
||||
explosionInitFlyingParticles(pos, 2.0f, 1.0f, 6.0f, 3.0f);
|
||||
|
||||
drop->is_splash = TRUE;
|
||||
drop->splash_y = pos->f[1];
|
||||
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
u8 shade = 0xC0 + (randomGetNext() & 0x3F);
|
||||
|
||||
drop->vertex_list[j].v.cn[0] = shade - 0x30;
|
||||
drop->vertex_list[j].v.cn[1] = shade - 0x10;
|
||||
drop->vertex_list[j].v.cn[2] = 0xFF;
|
||||
drop->vertex_list[j].v.cn[3] = 0xB0;
|
||||
}
|
||||
}
|
||||
|
||||
explosionCreateSmoke(pos, stan, 7, rooms, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
extern Gfx globalDL_0xa50;
|
||||
|
||||
/***
|
||||
|
||||
@@ -148,6 +148,11 @@ struct FlyingParticles {
|
||||
s32 unk34;
|
||||
|
||||
Vtx vertex_list[4];
|
||||
#ifdef PORT
|
||||
/* water splash droplet: removed once it falls back below splash_y */
|
||||
s32 is_splash;
|
||||
f32 splash_y;
|
||||
#endif
|
||||
};
|
||||
|
||||
extern f32 g_SpExplosionDamageMult;
|
||||
@@ -178,6 +183,9 @@ Gfx *explosionRenderPropSmoke(PropRecord *arg0, Gfx *arg1, s32 withalpha);
|
||||
Gfx *explosionRenderBulletImpactOnProp(Gfx *arg0, PropRecord *arg1, s32 arg2);
|
||||
|
||||
void explosionCreateSmoke(coord3d *pos, StandTile *stan, s16 smoke_type, u8 *rooms, s32 flags);
|
||||
#ifdef PORT
|
||||
void explosionCreateWaterSplash(coord3d *pos, StandTile *stan, u8 *rooms);
|
||||
#endif
|
||||
void explosionUpdateFlyingParticles(void);
|
||||
u8 explosionChrpropSmokeTick(PropRecord* prop);
|
||||
u8 explosionChrpropExplosionTick(PropRecord* prop);
|
||||
|
||||
Reference in new issue
Block a user