...
 
Commits (8)
This diff is collapsed.
#pragma once
#include <array>
#include <memory>
#include <vector>
......@@ -54,7 +55,7 @@ public:
enum class EFrozenFxType { None, Frozen, Thawed };
protected:
static const s32 skShootAnim[2];
static const std::array<s32, 2> skShootAnim;
zeus::CVector3f x4_scale;
std::optional<CModelData> x10_solidModelData;
std::optional<CModelData> x60_holoModelData;
......
#include "CWaveBeam.hpp"
#include "GameGlobalObjects.hpp"
#include "CSimplePool.hpp"
#include "CEnergyProjectile.hpp"
#include "Runtime/Weapon/CWaveBeam.hpp"
#include <array>
#include "Runtime/CSimplePool.hpp"
#include "Runtime/GameGlobalObjects.hpp"
#include "Runtime/Weapon/CEnergyProjectile.hpp"
namespace urde {
namespace {
constexpr float skShotAnglePitch = 120.f;
constexpr std::array<u16, 2> kSoundId{
SFXwpn_fire_wave_normal,
SFXwpn_fire_wave_charged,
};
} // Anonymous namespace
CWaveBeam::CWaveBeam(CAssetId characterId, EWeaponType type, TUniqueId playerId, EMaterialTypes playerMaterial,
const zeus::CVector3f& scale)
......@@ -50,9 +61,6 @@ void CWaveBeam::UpdateGunFx(bool shotSmoke, float dt, const CStateManager& mgr,
CGunWeapon::UpdateGunFx(shotSmoke, dt, mgr, xf);
}
static const float skShotAnglePitch = 120.f;
static const u16 kSoundId[] = {SFXwpn_fire_wave_normal, SFXwpn_fire_wave_charged};
void CWaveBeam::Fire(bool underwater, float dt, EChargeState chargeState, const zeus::CTransform& xf,
CStateManager& mgr, TUniqueId homingTarget, float chargeFactor1, float chargeFactor2) {
if (chargeState == EChargeState::Charged) {
......@@ -74,8 +82,8 @@ void CWaveBeam::Fire(bool underwater, float dt, EChargeState chargeState, const
if (chargeState == EChargeState::Charged)
x218_25_enableCharge = true;
NWeaponTypes::play_sfx(kSoundId[int(chargeState)], underwater, false, 0.165f);
CAnimPlaybackParms parms(skShootAnim[int(chargeState)], -1, 1.f, true);
NWeaponTypes::play_sfx(kSoundId[size_t(chargeState)], underwater, false, 0.165f);
const CAnimPlaybackParms parms(skShootAnim[size_t(chargeState)], -1, 1.f, true);
x10_solidModelData->GetAnimationData()->EnableLooping(false);
x10_solidModelData->GetAnimationData()->SetAnimation(parms, false);
}
......
......@@ -267,15 +267,13 @@ private:
}
template <typename Tp>
static void
destroy(Tp& t, std::enable_if_t<!std::is_destructible_v<Tp> || std::is_trivially_destructible_v<Tp>>* = nullptr) {
}
destroy(Tp& t, std::enable_if_t<!std::is_destructible_v<Tp> || std::is_trivially_destructible_v<Tp>>* = nullptr) {}
public:
reserved_vector() noexcept(std::is_nothrow_constructible_v<T>) : x0_size(0) {}
template <size_t LN>
reserved_vector(const T (&l)[LN]) noexcept(std::is_nothrow_copy_constructible_v<T>)
: x0_size(LN) {
reserved_vector(const T (&l)[LN]) noexcept(std::is_nothrow_copy_constructible_v<T>) : x0_size(LN) {
static_assert(LN <= N, "initializer array too large for reserved_vector");
for (size_t i = 0; i < LN; ++i) {
::new (static_cast<void*>(std::addressof(_value(i)))) T(l[i]);
......@@ -385,15 +383,18 @@ public:
}
template <class... _Args>
void emplace_back(_Args&&... args) {
T& emplace_back(_Args&&... args) {
#ifndef NDEBUG
if (x0_size == N) {
Log.report(logvisor::Fatal, fmt("emplace_back() called on full rstl::reserved_vector."));
}
#endif
::new (static_cast<void*>(std::addressof(_value(x0_size)))) T(std::forward<_Args>(args)...);
T& element = _value(x0_size);
::new (static_cast<void*>(std::addressof(element))) T(std::forward<_Args>(args)...);
++x0_size;
return element;
}
void pop_back() {
......