Commit fc00e06c authored by Fritjof's avatar Fritjof

Remove old stuff

parent ac0114d0
Pipeline #43416365 passed with stage
in 1 minute and 51 seconds
......@@ -3,6 +3,7 @@
#define GMP_PLAYER_COMMON_STATE_HPP
#include "gmp/player/player_base_state.hpp" // for WriteData (ptr only)
namespace cor {
struct FrameContext;
}
......@@ -29,15 +30,11 @@ class PlayerCommonState : public PlayerBaseState {
SERIALIZE_BASE_CLASS((PlayerBaseState));
SERIALIZE(self.m_can_reach);
SERIALIZE(self.m_fly_by_sound_cooldown);
// SERIALIZE(self.m_antenna_dirs);
// SERIALIZE(self.m_antenna_cooldowns);
}
VIRTUAL_CLASS_DESERFUN((PlayerCommonState)) {
DESERIALIZE_BASE_CLASS((PlayerBaseState));
DESERIALIZE(self.m_can_reach);
DESERIALIZE(self.m_fly_by_sound_cooldown);
// DESERIALIZE(self.m_antenna_dirs);
// DESERIALIZE(self.m_antenna_cooldowns);
}
private:
......@@ -46,10 +43,6 @@ class PlayerCommonState : public PlayerBaseState {
float m_fly_by_sound_cooldown = -1.f;
const float m_antenna_length = 2.f;
const float m_antenna_start = 3.0f;
// const glm::vec3 m_antenna_offset = glm::vec3(0, 0, 0.9);
// #define ANTENNA_COUNT 6
// std::array<glm::vec4, ANTENNA_COUNT> m_antenna_dirs;
// std::array<float, ANTENNA_COUNT> m_antenna_cooldowns = {0};
};
}; // namespace gmp
......
......@@ -16,20 +16,6 @@ struct FrameContext;
namespace gmp {
class PlayerBaseState;
class PlayerCommonState;
class PlayerStanding;
class PlayerRunning;
class PlayerDashing;
class PlayerInAir;
class PlayerDrawing;
class PlayerAiming;
class PlayerSlowMotion;
class PlayerDead;
class PlayerSwinging;
class PlayerStunned;
class PlayerSpawning;
class ParticlesComponent;
// ECS system for the player
......
......@@ -41,13 +41,6 @@ void PlayerCommonState::enter(cor::FrameContext& context) {
pc.is_attacking = false;
pc.is_swinging = false;
pc.is_dashing = false;
// Generete antennas (for fly by)
// for (int i = 0; i < ANTENNA_COUNT; ++i) {
// m_antenna_dirs[i] =
// glm::rotate(glm::mat4(1), (float)(3.1415 * 2.f / ANTENNA_COUNT * i), glm::vec3(0, 1, 0)) *
// glm::vec4(0, 0, 1, 0);
//}
}
void PlayerCommonState::update(cor::FrameContext& context, const PlayerEvents& keys_pressed) {
......@@ -223,62 +216,6 @@ void PlayerCommonState::update(cor::FrameContext& context, const PlayerEvents& k
: glm::vec3(0, 0, 6);
cc.contents.set_up(glm::normalize(current_up * 300.f * smc.factor.get_converted_dt(context) +
speed_factor * m_player_system->m_desired_up + on_ground_up));
// Fly by something
// m_fly_by_sound_cooldown -=
// smc.factor.get_converted_dt(context); if
// (glm::length(cc.contents.get_velocity()) > 65.f &&
// m_fly_by_sound_cooldown < 0.f &&
// !cc.contents.on_ground()) {
// int close_count = 0;
// const glm::mat4 move_dir =
// glm::toMat4(glm::rotation(glm::vec3(0, 1, 0),
// glm::normalize(cc.contents.get_velocity())));
// // Check each antenna
// for (int i = 0; i < ANTENNA_COUNT; ++i) {
// if (m_antenna_cooldowns[i] < 0.f) {
// const glm::vec3 start =
// player_pos + m_antenna_offset +
// glm::vec3(move_dir * (m_antenna_dirs[i] *
// m_antenna_start + glm::vec4(0, 5, 0, 0)));
// const glm::vec3 end =
// start + glm::vec3(move_dir * (m_antenna_dirs[i] *
// (m_antenna_length)));
// hits = context.utilities.raycast(start,
// m_antenna_dirs[i], m_antenna_length); closest_hit =
// m_player_system->get_closest_non_player_hit(hits);
// //
// context.event_mgr.send_event(DebugDrawLineEvent({start,
// end, glm::vec3(1, 0, 1)}));
// if (closest_hit != nullptr) {
// close_count++;
// m_antenna_cooldowns[i] = 1.0f;
// m_antenna_cooldowns[(i - 1) % ANTENNA_COUNT] = 1.0f;
// m_antenna_cooldowns[(i + 1) % ANTENNA_COUNT] = 1.0f;
// }
// } else
// m_antenna_cooldowns[i] -=
// smc.factor.get_converted_dt(context);
// }
// Something was found close by
// if (close_count >= 1) {
// m_fly_by_sound_cooldown = 1.0f;
//
// // Play swoosh sound
// context.event_mgr.send_event(
// PlaySoundEvent(m_player_system->m_player_handle,
// bse::ASSETS_ROOT /
// "audio/effects/swinging/fly_by/post/swoosh.ogg"_fp,
// aud::SoundSettings()));
// }
//}
}
}; // namespace gmp
\ No newline at end of file
......@@ -277,8 +277,6 @@ void PlayerDrawing::update(cor::FrameContext& context, const PlayerEvents& keys_
(keys_pressed.draw_ended && m_player_system->m_shoot_cooldown > 0.f)) {
m_player_system->m_face_aiming_dir_states--;
// arrow.detach<AttachToJointComponent>();
destroy_arrow(m_arrow_handle, context);
m_player_system->m_unused_arrows.push_back(m_arrow_handle);
m_arrow_handle = cor::EntityHandle::NULL_HANDLE;
......@@ -294,9 +292,6 @@ void PlayerDrawing::update(cor::FrameContext& context, const PlayerEvents& keys_
PlayerDrawing::~PlayerDrawing() {
//
if (m_arrow_handle != cor::EntityHandle::NULL_HANDLE) {
// auto arrow = m_player_system->m_context.entity_mgr.get_entity(m_arrow_handle);
// arrow.detach<AttachToJointComponent>();
destroy_arrow(m_arrow_handle, m_player_system->m_context);
m_player_system->m_unused_arrows.push_back(m_arrow_handle);
......
......@@ -19,7 +19,6 @@
#include "gmp/components/rotate_z_component.hpp"
#include "gmp/components/slow_motion_component.hpp"
#include "gmp/components/transform_component.hpp"
//#include "gmp/systems/animation_system.hpp"
#include "gmp/gmp_helper_functions.hpp"
#include "gmp/systems/attach_update_system.hpp"
#include "gmp/systems/cloud_system.hpp"
......@@ -330,48 +329,12 @@ void UnboundGameState::initialize() {
}
});
// m_quick_save_listener =
// m_context.event_mgr.register_handler<QuickSave>([this](const QuickSave* event) {
// //
// // m_saved_state = std::move(bse::SerializedData{});
// m_saved_state = bse::serialize(m_context.entity_mgr);
// m_saved_state += bse::serialize(m_system_mgr);
// m_event_recorder.start_recording();
// LOG(NOTICE) << "Quick Saved : " << m_saved_state.bytes.size() << " bytes";
// });
m_quick_load_listener = m_context.event_mgr.register_handler<StartEventPlayback>(
[this](const StartEventPlayback* event) {
//
// if (m_saved_state.bytes.size() > 0) {
// int offset = 0;
// m_context.entity_mgr.clear();
// bse::deserialize(m_context.entity_mgr, m_saved_state, offset);
// bse::deserialize(m_system_mgr, m_saved_state, offset);
m_event_recorder.play(m_context, m_system_mgr);
// m_context.is_replay = true;
// LOG(NOTICE) << "Quick Loaded";
// }
});
// m_start_event_recording_listener = m_context.event_mgr.register_handler<StartEventRecording>(
// [this](const StartEventRecording* event) {
// //
// m_event_recorder.start_recording();
// });
// m_stop_event_recording_listener = m_context.event_mgr.register_handler<StopEventRecording>(
// [this](const StopEventRecording* event) {
// //
// m_event_recorder.stop_recording();
// });
// m_start_event_playback_listener = m_context.event_mgr.register_handler<StartEventPlayback>(
// [this](const StartEventPlayback* event) {
// //
// m_event_recorder.play(m_context);
// });
m_save_checkpoint_listener =
m_context.event_mgr.register_handler<SaveCheckpoint>([this](const SaveCheckpoint* event) {
//
......@@ -400,8 +363,7 @@ void UnboundGameState::initialize() {
}
});
bse::Asset<scr::Script> death_scripts(bse::ASSETS_ROOT / "script/gmp/death_callbacks.lua"_fp);
// register systems
m_system_mgr.add_system<PhysicsSystem>(m_context);
m_system_mgr.add_system<GraphicsSystem>(m_context, &m_window);
m_system_mgr.add_system<AnimationSystem>(m_context);
......@@ -412,7 +374,6 @@ void UnboundGameState::initialize() {
m_system_mgr.add_system<AISystem>(m_context);
m_system_mgr.add_system<ParticleSystem>();
m_system_mgr.add_system<AudioSystem>(m_context);
// register systems
m_system_mgr.add_system<CutsceneSystem>(m_context);
m_system_mgr.add_system<RotationSystem>();
m_system_mgr.add_system<AICombatSystem>(m_context);
......@@ -433,38 +394,7 @@ void UnboundGameState::initialize() {
m_input_mgr.lock_mouse();
return;
// This memorial was erected in memory of Motherfucker, the honorable cube who volunteered
// to act as test subject during the great projectile sticking incident of November 2018.
// His bravery allowed countless linear algebra experiments to be performed, all while he
// endured being pierced by numerous arrows. Unfortunately, Motherfucker passed away for
// unknown reasons just as the research concluded. Let us remember him fondly, for his
// contributions has allowed arrows all over the world to stick into surfaces just as they
// were always meant to.
// if (1) {
// cor::EntityHandle motherfucker_handle = m_context.entity_mgr.create_entity();
// cor::Entity motherfucker = m_context.entity_mgr.get_entity(motherfucker_handle);
// TransformComponent tc3 = TransformComponent();
// tc3.transform.translate(glm::vec3(81.0f, 1138.0f, 343.0f), m_context);
// motherfucker = tc3;
// ModelComponent mc3 = ModelComponent();
// mc3.asset = bse::Asset<gfx::Model>(bse::ASSETS_ROOT / "model/motherfucker.fbx"_fp);
// motherfucker = mc3;
// NameComponent name = NameComponent();
// name.name = "motherfucker";
// motherfucker = name;
// AnimationComponent& ac1 = motherfucker.attach<AnimationComponent>();
// // ac1.state = AnimationState(bse::Asset<AnimationBlueprint>(
// // bse::ASSETS_ROOT / "script/animation/motherfucker.lua/animation_blueprint.t"_fp));
// MaterialComponent mc = MaterialComponent();
// mc.material = MaterialType::FLESH;
// motherfucker = mc;
//}
} // namespace gmp
}
bool UnboundGameState::update(float dt) {
//
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment