Postprocess work and hopefully improved memory handling. removing over used shared_ptr

This commit is contained in:
Ethan Adams 2025-02-26 03:17:38 -05:00
parent 5501a13488
commit 46838f2743
34 changed files with 879 additions and 318 deletions

View file

@ -11,6 +11,8 @@ endif()
include(FetchContent) include(FetchContent)
SET(CMAKE_EXPORT_COMPILE_COMMANDS 1)
SET(TRACY_ENABLE 1) SET(TRACY_ENABLE 1)
SET(TRACY_ON_DEMAND 1) SET(TRACY_ON_DEMAND 1)
SET(TRACY_ONLY_LOCALHOST 1) SET(TRACY_ONLY_LOCALHOST 1)

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.11.0" orientation="orthogonal" renderorder="right-down" width="30" height="20" tilewidth="62" tileheight="62" infinite="0" nextlayerid="5" nextobjectid="1"> <map version="1.10" tiledversion="1.11.0" orientation="orthogonal" renderorder="right-down" width="30" height="20" tilewidth="62" tileheight="62" infinite="0" nextlayerid="5" nextobjectid="1">
<tileset firstgid="1" source="tilesets/wOne.tsx"/> <tileset firstgid="1" source="tilesets/wOne.tsx"/>
<layer id="2" name="Tile Layer 2" width="30" height="20"> <layer id="2" name="Tile Layer 2" width="30" height="20" visible="0">
<data encoding="csv"> <data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,34,31,31,30,70,72,30,34,29,34,73,33,29,71,72,30,33,31,71,29,70,34,0,0,0,0,0,0,0, 0,34,31,31,30,70,72,30,34,29,34,73,33,29,71,72,30,33,31,71,29,70,34,0,0,0,0,0,0,0,
@ -25,7 +25,7 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
</data> </data>
</layer> </layer>
<layer id="3" name="Tile Layer 3" width="30" height="20"> <layer id="3" name="Tile Layer 3" width="30" height="20" visible="0">
<data encoding="csv"> <data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@ -49,7 +49,7 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
</data> </data>
</layer> </layer>
<layer id="4" name="Tile Layer 4" width="30" height="20"> <layer id="4" name="Tile Layer 4" width="30" height="20" visible="0">
<data encoding="csv"> <data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,

View file

@ -3,11 +3,11 @@
"height": 4300, "height": 4300,
"width": 2 "width": 2
}, },
"activeFile": "debugmap.tmx", "activeFile": "newmap.tmx",
"expandedProjectPaths": [ "expandedProjectPaths": [
"tilesets", "tilesets",
"C:/Users/Ethan/source/repos/YuppleMayham/Resources", ".",
"." "C:/Users/Ethan/source/repos/YuppleMayham/Resources"
], ],
"fileStates": { "fileStates": {
"": { "": {
@ -82,10 +82,10 @@
"project": "yupple.tiled-project", "project": "yupple.tiled-project",
"property.type": "bool", "property.type": "bool",
"recentFiles": [ "recentFiles": [
"debugmap.tmx",
"tilesets/shooterWorldOne.tsx",
"tilesets/wOne.tsx", "tilesets/wOne.tsx",
"newmap.tmx", "newmap.tmx",
"tilesets/shooterWorldOne.tsx",
"debugmap.tmx",
"tilesets/wsa.tsx", "tilesets/wsa.tsx",
"tilesets/was.tsx", "tilesets/was.tsx",
"tilesets/shooterWorldOneAtlas.tsx", "tilesets/shooterWorldOneAtlas.tsx",

View file

@ -0,0 +1,67 @@
#version 330 core
layout (std140) uniform uPostProcess {
int curTime;
int dt;
vec3 colorMod;
float blurIntensity;
float shakeIntensity;
float shakeTime;
int effects;
vec3 colorMod_hud;
float blurIntensity_hud;
float shakeIntensity_hud;
float shakeTime_hud;
int effects_hud;
};
out vec4 FragColor;
in vec2 texCoord;
uniform int edge_kernel[9];
uniform float blur_kernel[9];
const float offset = 1.0 / 300.0;
uniform sampler2D screenTexture;
uniform bool worldOrHud;
void main()
{
if (worldOrHud == false)
{
/*
vec2 offsets[9] = vec2[](
vec2(-offset, offset), // top-left
vec2( 0.0f, offset), // top-center
vec2( offset, offset), // top-right
vec2(-offset, 0.0f), // center-left
vec2( 0.0f, 0.0f), // center-center
vec2( offset, 0.0f), // center-right
vec2(-offset, -offset), // bottom-left
vec2( 0.0f, -offset), // bottom-center
vec2( offset, -offset) // bottom-right
);
vec2 tex_offset = 1.0 / vec2(800.0, 600.0); // gets size of single texel
vec4 result = vec4(0.0);
vec4 sampleTex[9];
for (int i = 0; i < 9; i++)
{
sampleTex[i] = vec4(texture(screenTexture, texCoord.st + offsets[i]));
}
for (int i = 0; i < 9; i++)
result += sampleTex[i] * edge_kernel[i];
*/
//FragColor = mix(vec4(result), vec4(0.4, 0.0, 0.7, 1.0), 0.2);
if ((effects & (1 << 1)) != 0)
{
//FragColor = mix(texture(screenTexture, texCoord), vec4(1.0, 0.8, 0.0, 1.0), 0.3 - (1.0 / shakeTime) * shakeIntensity);
FragColor = texture(screenTexture, texCoord);
}
else
{
FragColor = texture(screenTexture, texCoord);
}
}
}

View file

@ -0,0 +1,55 @@
#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec2 aTexCoord;
layout (std140) uniform uPostProcess {
int curTime;
int dt;
vec3 colorMod;
float blurIntensity;
float shakeIntensity;
float shakeTime;
int effects;
vec3 colorMod_hud;
float blurIntensity_hud;
float shakeIntensity_hud;
float shakeTime_hud;
int effects_hud;
};
/*
BLUR: 0001
SHAKE: 0010
NEGATIVE: 0100
COLORMOD: 1000
GREYSCALE:1 0000
*/
uniform bool worldOrHud;
out vec2 texCoord;
void main()
{
texCoord = aTexCoord;
gl_Position = vec4(aPos.x, aPos.y, 0.0, 1.0);
if (worldOrHud == false)
{
// SHAKE
if ((effects & (1 << 1)) != 0)
{
gl_Position.x += cos(dt * 10) * shakeIntensity;
gl_Position.y += cos(dt * 15) * shakeIntensity;
}
}
else
{
//SHAKE
if ((effects_hud & (1 << 1)) != 0)
{
gl_Position.x += cos(shakeTime_hud - 90) * 0.01;
gl_Position.y += cos(shakeTime_hud - 80) * 0.01;
}
}
}

View file

@ -1,16 +0,0 @@
#version 330 core
out vec4 FragColor;
in vec2 texCoord;
uniform sampler2D screenTexture;
void main()
{
//FragColor = texture(screenTexture, texCoord);
vec4 color = texture(screenTexture, texCoord);
if (color.rgb == vec3(0.0, 0.0, 0.0))
FragColor = vec4(0.0, 0.0, 1.0, 1.0);
else
FragColor = color;
}

View file

@ -1,11 +0,0 @@
#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec2 aTexCoord;
out vec2 texCoord;
void main()
{
texCoord = aTexCoord;
gl_Position = vec4(aPos.x, aPos.y, 0.0, 1.0);
}

View file

@ -1,12 +0,0 @@
#version 330 core
out vec4 FragColor;
in vec2 texCoord;
uniform sampler2D world_color;
void main()
{
//FragColor = vec4(0.0, 1.0, 1.0, 1.0);
FragColor = mix(texture(world_color, texCoord), vec4(0.4, 0.2, 0.2, 1.0), 0.2);
}

View file

@ -1,11 +0,0 @@
#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec2 aTexCoord;
out vec2 texCoord;
void main()
{
texCoord = aTexCoord;
gl_Position = vec4(aPos.x, aPos.y, 0.0, 1.0);
}

View file

@ -18,14 +18,18 @@ flat out int textureIndex;
void main() void main()
{ {
int tilesPerRow = aTilesPerRow; int tilesPerRow = aTilesPerRow;
gl_Position = projection * view * aModel * vec4(aPos, 1.0); float tileSize = 1.0 / aTilesPerRow;
// Slightly stretch the vertices to cover slight gaps
vec2 expansion = normalize(aPos.xy) * 0.001 * (1.0 / aTilesPerRow);
vec2 adjusted = aPos.xy + expansion;
gl_Position = projection * view * aModel * vec4(adjusted, aPos.z, 1.0);
textureIndex = aTextureIndex; textureIndex = aTextureIndex;
if (aTileIndex != 0) if (aTileIndex != 0)
{ {
vec2 scale = vec2(aOriginalSize.x / uCanvasSize.x, aOriginalSize.y / uCanvasSize.y); vec2 scale = vec2(aOriginalSize.x / uCanvasSize.x, aOriginalSize.y / uCanvasSize.y);
int index = aTileIndex - aStartIndex; int index = aTileIndex - aStartIndex;
float tileSize = 1.0 / float(tilesPerRow);
int row = index / tilesPerRow; int row = index / tilesPerRow;
int col = index % tilesPerRow; int col = index % tilesPerRow;

View file

@ -77,7 +77,9 @@ add_executable (YuppleMayham
"include/utility/logger.h" "include/utility/logger.h"
"src/utility/logger.cpp" "src/utility/logger.cpp"
"include/graphics/renderer.h" "include/graphics/renderer.h"
"src/graphics/renderer.cpp") "src/graphics/renderer.cpp"
"src/graphics/postprocess.cpp"
)
add_custom_command(TARGET YuppleMayham PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Resources/ $<TARGET_FILE_DIR:YuppleMayham>) add_custom_command(TARGET YuppleMayham PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Resources/ $<TARGET_FILE_DIR:YuppleMayham>)

View file

@ -3,6 +3,7 @@
#include <memory> #include <memory>
#include <SDL_events.h> #include <SDL_events.h>
#include <utility/events.h>
class InputHandler; class InputHandler;
class Scene; class Scene;
@ -48,6 +49,7 @@ private:
std::shared_ptr<ResourceManager> resourceManager; std::shared_ptr<ResourceManager> resourceManager;
std::shared_ptr<Renderer> renderer; std::shared_ptr<Renderer> renderer;
std::shared_ptr<Text> textHandler; std::shared_ptr<Text> textHandler;
std::shared_ptr<EventManager> globalEventManager;
}; };
#endif #endif

View file

@ -1,6 +1,7 @@
#ifndef _H_GAMEACTOR_H #ifndef _H_GAMEACTOR_H
#define _H_GAMEACTOR_H #define _H_GAMEACTOR_H
#include <memory>
#include <unordered_map> #include <unordered_map>
#include <SDL_timer.h> #include <SDL_timer.h>
#include <optional> #include <optional>
@ -8,10 +9,11 @@
#include "gameplay/entity.h" #include "gameplay/entity.h"
#include "utility/mousestate.h" #include "utility/mousestate.h"
class Component; #include <utility/component.h>
class AI; class AI;
class Weapon; class Weapon;
class EventManager; class ISceneContext;
// TODO: Finish weapon cycling code and add default weapon to every actor // TODO: Finish weapon cycling code and add default weapon to every actor
// TODO: Add ammo system, then work on some basic UI design // TODO: Add ammo system, then work on some basic UI design
@ -19,12 +21,11 @@ class EventManager;
class GameActor : public Entity class GameActor : public Entity
{ {
public: public:
GameActor(const unsigned shaderID) : Entity(shaderID) {} GameActor(ISceneContext* scene, const unsigned shaderID) : Entity(shaderID), sceneContext(scene) {}
~GameActor(); ~GameActor();
void addComponent(std::shared_ptr<Component> component); void addComponent(std::unique_ptr<Component> component);
void pickupWeapon(std::shared_ptr<Weapon> weapon); void pickupWeapon(std::shared_ptr<Weapon> weapon);
void hookEventManager(std::shared_ptr<EventManager> eventManager);
void update(double deltaTime) override; void update(double deltaTime) override;
void draw() override; void draw() override;
@ -48,13 +49,14 @@ public:
void cycleWeapons(const MouseState&); void cycleWeapons(const MouseState&);
void followMouse(const MouseState&); void followMouse(const MouseState&);
private: private:
using component_vector_t = std::vector<std::shared_ptr<Component>>; using component_vector_t = std::vector<std::unique_ptr<Component>>;
using weapon_vector_t = std::vector<std::shared_ptr<Weapon>>; using weapon_vector_t = std::vector<std::shared_ptr<Weapon>>;
component_vector_t components; component_vector_t components;
weapon_vector_t weapons; weapon_vector_t weapons;
size_t currentWeaponIndex = 0; size_t currentWeaponIndex = 0;
std::shared_ptr<EventManager> eventManager;
ISceneContext* sceneContext;
}; };
#endif //_H_GAMEACTOR_H #endif //_H_GAMEACTOR_H

View file

@ -1,17 +1,18 @@
#ifndef _H_SCENE_H #ifndef _H_SCENE_H
#define _H_SCENE_H #define _H_SCENE_H
#include <string> #include <span>
#include <unordered_map> #include <unordered_map>
#include <memory> #include <memory>
#include <gameplay/gameactor.h>
class Entity; class Entity;
class Camera; class Camera;
class Map; class Map;
class ResourceManager; class ResourceManager;
class Renderer; class Renderer;
class EventManager; class EventManager;
class GameActor;
class Line; class Line;
class PhysicsEngine; class PhysicsEngine;
class Sprite; class Sprite;
@ -24,15 +25,30 @@ enum SceneType {
SCENE_SHOOTER SCENE_SHOOTER
}; };
class Scene class ISceneContext {
public:
virtual std::weak_ptr<EventManager> getEventManager() = 0;
virtual std::weak_ptr<EventManager> getGlobalEventManager() = 0;
virtual std::span<std::weak_ptr<GameActor>> getAllEntities() const = 0;
virtual unsigned int getPlayerID() const = 0;
};
class Scene : public ISceneContext, public std::enable_shared_from_this<Scene>
{ {
public: public:
Scene(SceneType type, std::shared_ptr<ResourceManager> resources); Scene(SceneType type, std::shared_ptr<ResourceManager> resources, std::weak_ptr<EventManager> globalEvents);
void init();
void update(double deltaTime); void update(double deltaTime);
void render(std::shared_ptr<Renderer> renderer); void render(std::shared_ptr<Renderer> renderer);
std::shared_ptr<GameActor> getPlayer() const; std::shared_ptr<GameActor> getPlayer() const;
unsigned int getPlayerID() const override { return player->getEntityID(); }
std::weak_ptr<EventManager> getEventManager() override { return eventManager; }
std::weak_ptr<EventManager> getGlobalEventManager() override { return globalEventManager; }
std::span<std::weak_ptr<GameActor>> getAllEntities() const override;
void unloadScene(); void unloadScene();
@ -43,18 +59,20 @@ protected:
private: private:
void hookSceneEvents(); void hookSceneEvents();
std::shared_ptr<GameActor> getGameActorByID(const unsigned int ID); GameActor* getGameActorByID(const unsigned int ID);
SceneType type; SceneType type;
std::shared_ptr<Map> map; std::shared_ptr<Map> map;
//std::shared_ptr<TileSet> tileSet; //std::shared_ptr<TileSet> tileSet;
std::shared_ptr<GameActor> player; std::shared_ptr<GameActor> player;
std::unordered_map<unsigned int, std::shared_ptr<GameActor>> entities; std::unordered_map<unsigned int, std::shared_ptr<GameActor>> entities;
mutable std::vector<std::weak_ptr<GameActor>> entityCache;
std::shared_ptr<Camera> camera; std::shared_ptr<Camera> camera;
std::shared_ptr<PhysicsEngine> physicsEngine; std::shared_ptr<PhysicsEngine> physicsEngine;
std::shared_ptr<Line> debugLine; std::shared_ptr<Line> debugLine;
std::shared_ptr<ResourceManager> resourceManager; std::shared_ptr<ResourceManager> resourceManager;
std::weak_ptr<EventManager> globalEventManager;
std::shared_ptr<EventManager> eventManager; std::shared_ptr<EventManager> eventManager;
std::shared_ptr<SceneData> sceneData; std::shared_ptr<SceneData> sceneData;
}; };

View file

@ -2,9 +2,10 @@
#define _H_BULLET_H #define _H_BULLET_H
#include "gameplay/entity.h" #include "gameplay/entity.h"
#include <memory>
#include <utility/component.h>
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include <vector> #include <vector>
class Component;
class AnimationSet; class AnimationSet;
class Camera; class Camera;
@ -33,7 +34,7 @@ public:
ownerid = owner; ownerid = owner;
}; };
void addComponent(std::shared_ptr<Component> component); void addComponent(Component* component);
void update(double deltaTime) override; void update(double deltaTime) override;
void draw() override; void draw() override;
@ -50,7 +51,7 @@ private:
float bulletSpeed; float bulletSpeed;
float bulletDrop; float bulletDrop;
glm::vec2 bulletSize; glm::vec2 bulletSize;
std::vector<std::shared_ptr<Component>> components; std::vector<Component*> components;
}; };
#endif // _H_BULLET_H #endif // _H_BULLET_H

View file

@ -5,16 +5,18 @@
#include <vector> #include <vector>
#include <memory> #include <memory>
#include <utility/component.h>
class Bullet; class Bullet;
class Sprite; class Sprite;
class Shader; class Shader;
class Component;
class Camera; class Camera;
class EventManager; class EventManager;
class BulletManager class BulletManager : public std::enable_shared_from_this<BulletManager>
{ {
public: public:
BulletManager() {}
void addBullet(const std::shared_ptr<Bullet>& bullet); void addBullet(const std::shared_ptr<Bullet>& bullet);
void addBullet(const unsigned int owner, void addBullet(const unsigned int owner,
const glm::vec3& fireFrom, const glm::vec3& fireFrom,
@ -23,18 +25,18 @@ public:
float bulletDrop, float bulletDrop,
glm::vec2 bulletSize, glm::vec2 bulletSize,
const unsigned& shaderID, const unsigned& shaderID,
const std::shared_ptr<Component>& sprite); std::unique_ptr<Component> sprite);
void update(double deltaTime); void update(double deltaTime);
void draw(); void draw();
void hookEventManager(const std::shared_ptr<EventManager>& eventManager); void hookEventManager(std::weak_ptr<EventManager> eventManager);
const std::vector<std::shared_ptr<Bullet>> getBullets() { return bullets; } const std::vector<std::shared_ptr<Bullet>> getBullets() const { return bullets; }
private: private:
std::vector<std::shared_ptr<Bullet>> bullets; std::vector<std::shared_ptr<Bullet>> bullets;
std::shared_ptr<EventManager> eventManager; std::weak_ptr<EventManager> eventManager;
}; };
#endif #endif

View file

@ -8,15 +8,15 @@
#include "util.h" #include "util.h"
#include "gameplay/entity.h" #include "gameplay/entity.h"
#include "gameplay/weapons/bullet.h"
#include "utility/direction.h" #include "utility/direction.h"
#include <utility/component.h>
#include <gameplay/weapons/bulletmanager.h>
// TODO: Put all weapons inside of this base, we don't need a class for every weapon, we only need one class! // TODO: Put all weapons inside of this base, we don't need a class for every weapon, we only need one class!
class Shader; class Shader;
class Component;
class Camera; class Camera;
class BulletManager;
class EventManager; class EventManager;
class ResourceManager; class ResourceManager;
class GameActor; class GameActor;
@ -29,15 +29,15 @@ class Weapon : public Entity, public std::enable_shared_from_this<Weapon>
public: public:
Weapon(std::shared_ptr<WeaponData> data, const unsigned weaponShaderID, const unsigned bulletShaderID, ResourceManager* resourceManager); Weapon(std::shared_ptr<WeaponData> data, const unsigned weaponShaderID, const unsigned bulletShaderID, ResourceManager* resourceManager);
void setWielder(const std::shared_ptr<GameActor>& wielder) { this->wielder = wielder; } void setWielder(GameActor* wielder) { this->wielder = wielder; }
void toggleInfiniteAmmo() { infiniteAmmo = !infiniteAmmo; } void toggleInfiniteAmmo() { infiniteAmmo = !infiniteAmmo; }
void wield() { wielded = true; } void wield() { wielded = true; }
void putaway() { wielded = false; } void putaway() { wielded = false; }
void addComponent(const std::shared_ptr<Component>& component); void addComponent(std::unique_ptr<Component> component);
void attachScript(const std::shared_ptr<WeaponScript>& script); void attachScript(const std::shared_ptr<WeaponScript>& script);
void hookEventManager(const std::shared_ptr<EventManager>& eventManager); void hookEventManager(std::weak_ptr<EventManager> eventManager);
void shoot(); bool shoot();
void reload(); void reload();
void update(double deltaTime); void update(double deltaTime);
void draw(); void draw();
@ -50,7 +50,7 @@ public:
float speedMod = 1.f; float speedMod = 1.f;
float dropMod = 1.f; float dropMod = 1.f;
}; };
void onHitCallback(std::shared_ptr<GameActor> target, std::shared_ptr<PhysicsComponent> bullet, const glm::vec2& normal); void onHitCallback(GameActor* target, PhysicsComponent* bullet, const glm::vec2& normal);
glm::vec2 getWeaponSize() const { return weaponSize; } glm::vec2 getWeaponSize() const { return weaponSize; }
// This is the offset from the center right point of the weapon to the barrel of the gun defined in // This is the offset from the center right point of the weapon to the barrel of the gun defined in
@ -58,14 +58,14 @@ public:
glm::vec2 getWeaponOffset() const { return weaponOffset; } glm::vec2 getWeaponOffset() const { return weaponOffset; }
float getBulletSpeed() const { return bulletSpeed; } float getBulletSpeed() const { return bulletSpeed; }
glm::vec2 getBulletSize() const { return bulletSize; } glm::vec2 getBulletSize() const { return bulletSize; }
std::shared_ptr<GameActor> getWielder() const { return wielder; } GameActor* getWielder() const { return wielder; }
const Uint32 getMagazine() const { return weaponMag; } const Uint32 getMagazine() const { return weaponMag; }
const Uint32 getAmmo() const { return weaponAmmo; } const Uint32 getAmmo() const { return weaponAmmo; }
Weapon::BulletData genBulletData (); Weapon::BulletData genBulletData ();
void createBullet (const BulletData& data); void createBullet (const BulletData& data);
const std::shared_ptr<BulletManager>& getBulletManager() { return bulletManager; } const BulletManager* getBulletManager() { return bulletManager.get(); }
private: private:
void adjustWeapon(); void adjustWeapon();
@ -85,21 +85,21 @@ private:
float fireSpeed; float fireSpeed;
glm::vec2 bulletSize; glm::vec2 bulletSize;
unsigned bulletShaderID; unsigned bulletShaderID;
std::shared_ptr<Component> bulletSprite; std::unique_ptr<Component> bulletSprite;
std::shared_ptr<BulletManager> bulletManager; std::shared_ptr<BulletManager> bulletManager;
std::shared_ptr<EventManager> eventManager; std::weak_ptr<EventManager> eventManager;
std::shared_ptr<UTIL::RandomGenerator> bulletSpread; std::unique_ptr<UTIL::RandomGenerator> bulletSpread;
std::shared_ptr<UTIL::RandomGenerator> bulletModifer; std::unique_ptr<UTIL::RandomGenerator> bulletModifer;
std::shared_ptr<GameActor> wielder; GameActor* wielder;
// is the weapon currently active // is the weapon currently active
bool wielded = false; bool wielded = false;
int lastFireTime = 0; int lastFireTime = 0;
Direction lastDir; Direction lastDir;
std::vector <std::shared_ptr<Component>> components; std::vector <std::unique_ptr<Component>> components;
std::shared_ptr<WeaponScript> weaponScript; std::shared_ptr<WeaponScript> weaponScript;
}; };

View file

@ -65,17 +65,17 @@ private:
// We will load our animation component with every loaded animation, // We will load our animation component with every loaded animation,
// this will be the handler for every animation an entity uses // this will be the handler for every animation an entity uses
class AnimationSet class AnimationSet : public std::enable_shared_from_this<AnimationSet>
{ {
public: public:
AnimationSet(const int& entityid); AnimationSet(const int& entityid);
AnimationSet(const int& entityid, ResourceManager* resourceManager, std::vector<std::shared_ptr<AnimationData>> animSet); AnimationSet(const int& entityid, ResourceManager* resourceManager, std::vector<std::shared_ptr<AnimationData>> animSet);
AnimationSet(const int& entityid, const std::unordered_map<std::string, std::shared_ptr<Animation>>& animations); AnimationSet(const int& entityid, std::unordered_map<std::string, std::unique_ptr<Animation>> animations);
std::shared_ptr<Animation>& operator [](std::string animType) { return anims[animType]; } Animation* operator [](std::string animType) { return anims[animType].get(); }
void addAnimation(const std::shared_ptr<Animation> anim) { anims.try_emplace(anim->getType(), anim); } void addAnimation(std::unique_ptr<Animation> anim) { std::string type = anim->getType(); anims.try_emplace(type, std::move(anim)); }
void setAnimation(const std::string& animType) { curAnim = anims[animType]; } void setAnimation(const std::string& animType) { curAnim = anims[animType].get(); }
const int getEntityID() const { return entityid; } const int getEntityID() const { return entityid; }
const bool getDirectional() const { return isDirectional; } const bool getDirectional() const { return isDirectional; }
@ -88,7 +88,7 @@ public:
void setFacingDir(Direction& dir) { facing = dir; } void setFacingDir(Direction& dir) { facing = dir; }
void attachEventManager(const std::shared_ptr<EventManager>& e); void attachEventManager(std::weak_ptr<EventManager> e);
private: private:
int entityid; int entityid;
@ -96,10 +96,10 @@ private:
Direction facing = Direction::Down; Direction facing = Direction::Down;
std::unordered_map<std::string, std::shared_ptr<Animation>> anims; std::unordered_map<std::string, std::unique_ptr<Animation>> anims;
std::shared_ptr<Animation> curAnim; Animation* curAnim;
std::shared_ptr<EventManager> eventManager; std::weak_ptr<EventManager> eventManager;
}; };
#endif // _H_ANIMATION_H #endif // _H_ANIMATION_H

View file

@ -0,0 +1,67 @@
#ifndef _H_POSTPROCESS_H
#define _H_POSTPROCESS_H
#include <SDL_Timer.h>
#include <glad/glad.h>
#include <glm/glm.hpp>
#include <memory>
#include <utility/resourcemanager.h>
#include <graphics/shader.h>
#include <utility/logger.h>
class Postprocessor
{
public:
Postprocessor(const std::shared_ptr<ResourceManager>&);
enum EFFECT {
BLUR = 1 << 0,
SHAKE = 1 << 1,
NEGATIVE = 1 << 2,
COLORMOD = 1 << 3,
GREYSCALE = 1 << 4
};
void ApplyEffect(EFFECT effect, float intensity=0.f, float effectDuration=0.f, glm::vec3 colorModifer=glm::vec3(0.0f));
void RemoveEffects(EFFECT effect);
void RemoveAllEffects();
void applyPostProcess(bool worldOrHud=0);
private:
int edge_kernel[9] = {
-1, -1, -1,
-1, 8, -1,
-1, -1, -1
};
float blur_kernel[9] = {
1.0f / 16.0f, 2.0f / 16.0f, 1.0f / 16.0f,
2.0f / 16.0f, 4.0f / 16.0f, 2.0f / 16.0f,
1.0f / 16.0f, 2.0f / 16.0f, 1.0f / 16.0f
};
unsigned int UBO;
struct PostProcessData_t {
alignas(4) int curTime;
// world
alignas(4) int dt;
alignas(16) glm::vec3 colorMod;
alignas(4) float blurIntensity;
alignas(4) float shakeIntensity;
alignas(4) float shakeTime;
alignas(4) int curEffects;
// hud
alignas(16) glm::vec3 colorMod_hud;
alignas(4) float blurIntensity_hud;
alignas(4) float shakeIntensity_hud;
alignas(4) float shakeTime_hud;
alignas(4) int curEffects_hud;
}postProcessData;
unsigned int lastTime;
Shader* postProcessShader;
};
#endif // _H_POSTPROCESS_H

View file

@ -9,6 +9,7 @@
#include <glm/gtc/type_ptr.hpp> #include <glm/gtc/type_ptr.hpp>
#include "graphics/quad.h" #include "graphics/quad.h"
#include "graphics/postprocess.h"
class ResourceManager; class ResourceManager;
class Shader; class Shader;
@ -70,6 +71,8 @@ public:
void clear(); void clear();
void hookEventManager(const std::weak_ptr<EventManager> eventManager);
void setProjAndViewMatrix(const glm::mat4& proj, const glm::mat4& view); void setProjAndViewMatrix(const glm::mat4& proj, const glm::mat4& view);
void addDrawable(RenderLayer renderLayer, std::shared_ptr<Drawable> drawable); void addDrawable(RenderLayer renderLayer, std::shared_ptr<Drawable> drawable);
void removeDrawable(RenderLayer renderLayer, std::shared_ptr<Drawable> drawable); void removeDrawable(RenderLayer renderLayer, std::shared_ptr<Drawable> drawable);
@ -103,10 +106,8 @@ private:
std::shared_ptr<ResourceManager> resourceManager; std::shared_ptr<ResourceManager> resourceManager;
void initFrameBuffers(); void initFrameBuffers();
void loadPostProcessShaders();
Shader* postProcess_World; std::unique_ptr<Postprocessor> postProcessor;
Shader* postProcess_HUD;
void sortLayerPool(auto& layerPool); void sortLayerPool(auto& layerPool);
void renderPool(auto& layerPool); void renderPool(auto& layerPool);

View file

@ -2,10 +2,8 @@
#define _H_SHADER_H #define _H_SHADER_H
#include <glad/glad.h> #include <glad/glad.h>
#include <fstream> #include <fstream>
#include <iostream> #include <string>
#include <sstream>
class Shader class Shader
{ {
@ -16,6 +14,8 @@ public:
void use() { glUseProgram(ID); } void use() { glUseProgram(ID); }
void setFloat(const std::string& name, float value); void setFloat(const std::string& name, float value);
void setFloatArray(const std::string & name, size_t count, const float* value);
void setIntArray(const std::string & name, size_t count, const int* value);
void setInt(const std::string& name, int value); void setInt(const std::string& name, int value);
void setBool(const std::string& name, bool value); void setBool(const std::string& name, bool value);
void setVec2(const std::string& name, const float* value); void setVec2(const std::string& name, const float* value);

View file

@ -13,6 +13,7 @@
class Component class Component
{ {
public: public:
enum class TYPE { MESH, SPRITE, ANIMATION, SHADER, AI };
Component(const std::shared_ptr<EventManager>& eventManager) : eventManager(eventManager) {} Component(const std::shared_ptr<EventManager>& eventManager) : eventManager(eventManager) {}
virtual ~Component() {}; virtual ~Component() {};
virtual void bind() = 0; virtual void bind() = 0;
@ -20,6 +21,7 @@ public:
virtual void render() = 0; virtual void render() = 0;
virtual void play() = 0; virtual void play() = 0;
virtual void idle() = 0; virtual void idle() = 0;
virtual TYPE getType() const = 0;
int ownerid = 0; int ownerid = 0;
private: private:
@ -39,6 +41,7 @@ public:
void play() override { /*unused*/ } void play() override { /*unused*/ }
void idle() override { /*unused*/ } void idle() override { /*unused*/ }
TYPE getType() const override { return TYPE::MESH; }
~MeshComponent() { mesh->~Mesh(); } ~MeshComponent() { mesh->~Mesh(); }
@ -50,7 +53,7 @@ private:
class SpriteComponent : public Component class SpriteComponent : public Component
{ {
public: public:
SpriteComponent(Sprite* sprite) : sprite(sprite), Component(nullptr) {} SpriteComponent(Sprite* sprite) : Component(nullptr), sprite(sprite) {}
void bind() override { void bind() override {
if (sprite) sprite->bind(); if (sprite) sprite->bind();
@ -61,6 +64,7 @@ public:
} }
void play() override { /*unused*/ } void play() override { /*unused*/ }
void idle() override { /*unused*/ } void idle() override { /*unused*/ }
TYPE getType() const override { return TYPE::SPRITE; }
Sprite* getSprite() { return sprite; } Sprite* getSprite() { return sprite; }
@ -73,9 +77,9 @@ private:
class AnimationComponent : public Component class AnimationComponent : public Component
{ {
public: public:
AnimationComponent(std::shared_ptr<AnimationSet> animSet) : animSet(animSet), Component(nullptr) {}; AnimationComponent(std::shared_ptr<AnimationSet> animSet) : Component(nullptr), animSet(animSet) {};
AnimationComponent(std::shared_ptr<AnimationSet> animSet, const std::shared_ptr<EventManager>& eventManager) : AnimationComponent(std::shared_ptr<AnimationSet> animSet, const std::shared_ptr<EventManager>& eventManager) :
animSet(animSet), Component(nullptr) Component(nullptr), animSet(animSet)
{ {
this->animSet->attachEventManager(eventManager); this->animSet->attachEventManager(eventManager);
} }
@ -97,6 +101,7 @@ public:
if (animSet) if (animSet)
animSet->stop(); animSet->stop();
} }
TYPE getType() const override { return TYPE::ANIMATION; }
std::shared_ptr<AnimationSet>& getAnimationSet() { return animSet; } std::shared_ptr<AnimationSet>& getAnimationSet() { return animSet; }
@ -110,7 +115,7 @@ class ShaderComponent : public Component
{ {
public: public:
ShaderComponent(const char* vertexPath, const char* shaderPath) : ShaderComponent(const char* vertexPath, const char* shaderPath) :
shader(vertexPath, shaderPath), Component(nullptr) {}; Component(nullptr), shader(vertexPath, shaderPath) {};
void bind() override { void bind() override {
shader.use(); shader.use();
@ -119,6 +124,7 @@ public:
void render() override {} void render() override {}
void play() override { /*unused*/ } void play() override { /*unused*/ }
void idle() override { /*unused*/ } void idle() override { /*unused*/ }
TYPE getType() const override { return TYPE::SHADER; }
Shader& getShader() { return shader; } Shader& getShader() { return shader; }
@ -130,13 +136,14 @@ private:
class AIComponent : public Component { class AIComponent : public Component {
public: public:
AIComponent(std::shared_ptr<AI> ai) : ai(ai), Component(nullptr) {} AIComponent(std::shared_ptr<AI> ai) : Component(nullptr), ai(ai) {}
void bind() override { /*unused*/ } void bind() override { /*unused*/ }
void update() override { if (ai) ai->update(); } void update() override { if (ai) ai->update(); }
void render() override { /*unused*/ } void render() override { /*unused*/ }
void play() override { /*unused*/ } void play() override { /*unused*/ }
void idle() override { /*unused*/ } void idle() override { /*unused*/ }
TYPE getType() const override { return TYPE::AI; }
private: private:
std::shared_ptr<AI> ai; std::shared_ptr<AI> ai;

View file

@ -7,6 +7,7 @@
#include <unordered_map> #include <unordered_map>
#include "utility/direction.h" #include "utility/direction.h"
#include <glm/glm.hpp>
class Bullet; class Bullet;
struct PhysicsComponent; struct PhysicsComponent;
@ -44,7 +45,7 @@ public:
class DirectionChangeEvent : public Event { class DirectionChangeEvent : public Event {
public: public:
DirectionChangeEvent(const int entityid, Direction direction) : entityid(entityid), direction(direction) {} DirectionChangeEvent(const int entityid, Direction direction) : direction(direction), entityid(entityid) {}
std::string getType() const override { return "OnDirectionChange"; } std::string getType() const override { return "OnDirectionChange"; }
Direction direction; Direction direction;
int entityid; int entityid;
@ -88,12 +89,20 @@ public:
class AnimationFinishedEvent : public Event { class AnimationFinishedEvent : public Event {
public: public:
AnimationFinishedEvent(const int entityid, const std::string animType) : entityid(entityid), animType(animType) {} AnimationFinishedEvent(const int entityid, const std::string animType) : animType(animType), entityid(entityid) {}
std::string getType() const override { return "OnAnimationFinished"; } std::string getType() const override { return "OnAnimationFinished"; }
std::string animType; std::string animType;
int entityid; int entityid;
}; };
class ScreenShakeEvent : public Event {
public:
ScreenShakeEvent(float intensity, float duration) : intensity(intensity), duration(duration) {}
std::string getType() const override { return "OnScreenShake"; }
float intensity;
float duration;
};
class EventManager { class EventManager {
public: public:
using EventCallback = std::function<void(std::shared_ptr<Event>)>; using EventCallback = std::function<void(std::shared_ptr<Event>)>;

View file

@ -15,6 +15,8 @@
#include <iostream> #include <iostream>
#include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/matrix_transform.hpp>
#include <memory>
#include <utility/events.h>
bool Game::init() bool Game::init()
{ {
@ -49,8 +51,10 @@ bool Game::init()
inputHandler->bindMouseScroll(new CycleCommand()); inputHandler->bindMouseScroll(new CycleCommand());
game_state |= GAME_RUNNING; game_state |= GAME_RUNNING;
globalEventManager = std::make_shared<EventManager>();
resourceManager = std::make_shared<ResourceManager>(); resourceManager = std::make_shared<ResourceManager>();
renderer = std::make_shared<Renderer>(resourceManager); renderer = std::make_shared<Renderer>(resourceManager);
renderer->hookEventManager(globalEventManager);
textHandler = std::make_shared<Text>(); textHandler = std::make_shared<Text>();
if (!textHandler->loadFonts("fonts")) if (!textHandler->loadFonts("fonts"))
return false; return false;
@ -63,7 +67,8 @@ const unsigned Game::getWindowHeight() const { return window->height(); }
bool Game::loadDebugScene() bool Game::loadDebugScene()
{ {
currentScene = std::make_shared<Scene>(SCENE_SHOOTER, resourceManager); currentScene = std::make_shared<Scene>(SCENE_SHOOTER, resourceManager, globalEventManager);
currentScene->init();
if (currentScene->getPlayer() == nullptr) if (currentScene->getPlayer() == nullptr)
return false; return false;
inputHandler->setActor(currentScene->getPlayer().get()); inputHandler->setActor(currentScene->getPlayer().get());

View file

@ -1,17 +1,19 @@
#include "gameplay/gameactor.h" #include "gameplay/gameactor.h"
#include "gameplay/entity.h" #include "gameplay/entity.h"
#include "gameplay/physics.h" #include "gameplay/physics.h"
#include "gameplay/scene.h"
#include "gameplay/weapons/weapon.h" #include "gameplay/weapons/weapon.h"
#include "utility/events.h" #include "utility/events.h"
#include "utility/direction.h" #include "utility/direction.h"
#include "utility/component.h" #include "utility/component.h"
#include <memory>
GameActor::~GameActor() { } GameActor::~GameActor() { }
void GameActor::addComponent(std::shared_ptr<Component> component) void GameActor::addComponent(std::unique_ptr<Component> component)
{ {
component->ownerid = entityid; component->ownerid = entityid;
components.push_back(component); components.push_back(std::move(component));
} }
const std::shared_ptr<Weapon> GameActor::getHeldWeapon() const const std::shared_ptr<Weapon> GameActor::getHeldWeapon() const
@ -21,7 +23,10 @@ const std::shared_ptr<Weapon> GameActor::getHeldWeapon() const
void GameActor::pickupWeapon(std::shared_ptr<Weapon> weapon) void GameActor::pickupWeapon(std::shared_ptr<Weapon> weapon)
{ {
weapon->setWielder(std::shared_ptr<GameActor>(this)); weapon->setWielder(this);
if (auto eventManager = sceneContext->getEventManager().lock()) {
weapon->hookEventManager(eventManager);
}
weapons.push_back(weapon); weapons.push_back(weapon);
// wield the newly picked up weapon. // wield the newly picked up weapon.
getHeldWeapon()->putaway(); getHeldWeapon()->putaway();
@ -29,19 +34,14 @@ void GameActor::pickupWeapon(std::shared_ptr<Weapon> weapon)
getHeldWeapon()->wield(); getHeldWeapon()->wield();
} }
void GameActor::hookEventManager(std::shared_ptr<EventManager> eventManager)
{
this->eventManager = eventManager;
for (auto& weapon : weapons)
weapon->hookEventManager(eventManager);
}
void GameActor::setRotation(const float& rotation) void GameActor::setRotation(const float& rotation)
{ {
if (!isRotatable && eventManager) { if (!isRotatable) {
Direction newDir = getDirectionFromRotation(rotation); if (auto eventManager = sceneContext->getEventManager().lock()) {
if (getDirectionFromRotation(this->rotation) != newDir) Direction newDir = getDirectionFromRotation(rotation);
eventManager->notify(std::make_shared<DirectionChangeEvent>(entityid, newDir)); if (getDirectionFromRotation(this->rotation) != newDir)
eventManager->notify(std::make_shared<DirectionChangeEvent>(entityid, newDir));
}
} }
this->rotation = rotation; this->rotation = rotation;
updateModelMatrix(); updateModelMatrix();
@ -56,18 +56,19 @@ void GameActor::update(double deltaTime)
for (const auto& weapon : weapons) for (const auto& weapon : weapons)
weapon->update(deltaTime); weapon->update(deltaTime);
if (eventManager) if (isMoving && !wasMoving)
{ {
if (isMoving && !wasMoving) if (auto event = sceneContext->getEventManager().lock()) {
{ event->notify(std::make_shared<EntityMoveEvent>(entityid));
eventManager->notify(std::make_shared<EntityMoveEvent>(entityid));
wasMoving = true;
} }
else if (!isMoving && wasMoving) wasMoving = true;
{ }
eventManager->notify(std::make_shared<EntityStopEvent>(entityid)); else if (!isMoving && wasMoving)
wasMoving = false; {
if (auto event = sceneContext->getEventManager().lock()) {
event->notify(std::make_shared<EntityStopEvent>(entityid));
} }
wasMoving = false;
} }
isMoving = false; isMoving = false;
} }
@ -93,7 +94,18 @@ void GameActor::moveLeft() { if (physics) physics->rigidBody.applyForce(glm::vec
void GameActor::moveRight(){ if (physics) physics->rigidBody.applyForce(glm::vec3( 1.f, 0.f, 0.f), 1500.25f); isMoving = true; } void GameActor::moveRight(){ if (physics) physics->rigidBody.applyForce(glm::vec3( 1.f, 0.f, 0.f), 1500.25f); isMoving = true; }
// top-down shooter mode controls // top-down shooter mode controls
void GameActor::fireWeapon()const { if (auto& weapon = getHeldWeapon()) weapon->shoot(); } void GameActor::fireWeapon()const {
if (auto& weapon = getHeldWeapon()) {
if (weapon->shoot()) {
if (sceneContext->getPlayerID() == entityid) {
if (auto gEvent = sceneContext->getGlobalEventManager().lock()) {
gEvent->notify(std::make_shared<ScreenShakeEvent>(0.01f, 0.8f));
}
}
}
}
}
void GameActor::cycleUpWeapons() { void GameActor::cycleUpWeapons() {
if (!weapons.empty()) { if (!weapons.empty()) {
weapons[currentWeaponIndex]->putaway(); weapons[currentWeaponIndex]->putaway();
@ -119,9 +131,11 @@ void GameActor::followMouse(const MouseState& mouse_state)
{ {
glm::vec2 direction = glm::vec2(mouse_state.x, mouse_state.y) - glm::vec2(localPosition.x + 0.5f * scale.x, localPosition.y + 0.5f * scale.y); glm::vec2 direction = glm::vec2(mouse_state.x, mouse_state.y) - glm::vec2(localPosition.x + 0.5f * scale.x, localPosition.y + 0.5f * scale.y);
float newRotation = glm::degrees(glm::atan(direction.y, direction.x)); float newRotation = glm::degrees(glm::atan(direction.y, direction.x));
if (getDirectionFromRotation(rotation) != getDirectionFromRotation(newRotation)) if (getDirectionFromRotation(rotation) != getDirectionFromRotation(newRotation)) {
if (eventManager) if (auto event = sceneContext->getEventManager().lock()) {
eventManager->notify(std::make_shared<DirectionChangeEvent>(entityid, getDirectionFromRotation(newRotation))); event->notify(std::make_shared<DirectionChangeEvent>(entityid, getDirectionFromRotation(newRotation)));
}
}
//setRotation(glm::degrees(glm::atan(direction.y, direction.x))); //setRotation(glm::degrees(glm::atan(direction.y, direction.x)));
this->rotation = newRotation; this->rotation = newRotation;
} }

View file

@ -17,6 +17,7 @@
#include "utility/raycaster.h" #include "utility/raycaster.h"
#include "utility/debugdraw.h" #include "utility/debugdraw.h"
#include <memory>
#include <tracy/Tracy.hpp> #include <tracy/Tracy.hpp>
#include <execution> #include <execution>
@ -30,20 +31,25 @@ like this:
</player> </player>
*/ */
Scene::Scene(SceneType sceneType, std::shared_ptr<ResourceManager> resources) : type(sceneType), resourceManager(resources) Scene::Scene(SceneType sceneType, std::shared_ptr<ResourceManager> resources, std::weak_ptr<EventManager> globalEvents)
: type(sceneType), resourceManager(resources), globalEventManager(globalEvents)
{ {
camera = std::make_shared<Camera>(800.f, 600.f); camera = std::make_shared<Camera>(800.f, 600.f);
physicsEngine = std::make_shared<PhysicsEngine>(); physicsEngine = std::make_shared<PhysicsEngine>();
eventManager = std::make_shared<EventManager>(); eventManager = std::make_shared<EventManager>();
}
void Scene::init()
{
physicsEngine->hookEventManager(eventManager); physicsEngine->hookEventManager(eventManager);
hookSceneEvents(); //if (sceneType == SCENE_SHOOTER)
if (sceneType == SCENE_SHOOTER) loadDebugShooterScene();
loadDebugShooterScene();
} }
// This function is full of hardcoded values and test sprites, NOT for use with final product // This function is full of hardcoded values and test sprites, NOT for use with final product
void Scene::loadDebugShooterScene() void Scene::loadDebugShooterScene()
{ {
hookSceneEvents();
sceneData = resourceManager->loadScene("000"); sceneData = resourceManager->loadScene("000");
if (!sceneData) if (!sceneData)
return; return;
@ -59,7 +65,7 @@ void Scene::loadDebugShooterScene()
for (EntityData entityData : sceneData->entities) for (EntityData entityData : sceneData->entities)
{ {
auto entity = std::make_shared<GameActor>(playerShader); auto entity = std::make_shared<GameActor>(this, playerShader);
// Directional is the kind of sprite sheet we are using, in this case for directional, I have the sprite sheet handle the rotations // Directional is the kind of sprite sheet we are using, in this case for directional, I have the sprite sheet handle the rotations
// instead of just rotating the object, this makes it look quite a bit better from the end user perspective. // instead of just rotating the object, this makes it look quite a bit better from the end user perspective.
if (entityData.animated) if (entityData.animated)
@ -69,19 +75,18 @@ void Scene::loadDebugShooterScene()
// we set the this value to false so we no longer rotate the object. // we set the this value to false so we no longer rotate the object.
if (entityAnimation->getDirectional()) if (entityAnimation->getDirectional())
entity->setRotatable(false); entity->setRotatable(false);
entity->addComponent(std::make_shared<AnimationComponent>(entityAnimation, eventManager)); entity->addComponent(std::make_unique<AnimationComponent>(entityAnimation, eventManager));
} }
else else
{ {
auto entitySprite = resourceManager->loadSpriteStatic(entityData.graphic); auto entitySprite = resourceManager->loadSpriteStatic(entityData.graphic);
entity->addComponent(std::make_shared<SpriteComponent>(entitySprite)); entity->addComponent(std::make_unique<SpriteComponent>(entitySprite));
} }
auto defaultWeapon = resourceManager->loadWeapon("pistolGun", weaponShader, bubbleShader); auto defaultWeapon = resourceManager->loadWeapon("pistolGun", weaponShader, bubbleShader);
auto entityWeapon = resourceManager->loadWeapon(entityData.weapon, weaponShader, bubbleShader); auto entityWeapon = resourceManager->loadWeapon(entityData.weapon, weaponShader, bubbleShader);
entity->pickupWeapon(defaultWeapon); entity->pickupWeapon(defaultWeapon);
entity->pickupWeapon(entityWeapon); entity->pickupWeapon(entityWeapon);
entity->hookEventManager(eventManager);
entity->setPosition(glm::vec3(entityData.x * mapData->tileSize, entityData.y * mapData->tileSize, 0.f)); entity->setPosition(glm::vec3(entityData.x * mapData->tileSize, entityData.y * mapData->tileSize, 0.f));
entity->setScale(glm::vec3(mapData->tileSize, mapData->tileSize, 1.f)); entity->setScale(glm::vec3(mapData->tileSize, mapData->tileSize, 1.f));
@ -109,7 +114,7 @@ void Scene::loadDebugShooterScene()
auto ai = std::make_shared<AI>(entity, rayCaster); auto ai = std::make_shared<AI>(entity, rayCaster);
ai->setTarget(player); ai->setTarget(player);
ai->attachBehaviourScript(behaviourScript); ai->attachBehaviourScript(behaviourScript);
entity->addComponent(std::make_shared<AIComponent>(ai)); entity->addComponent(std::make_unique<AIComponent>(ai));
} }
} }
entities.emplace(entity->getEntityID(), entity); entities.emplace(entity->getEntityID(), entity);
@ -169,20 +174,32 @@ void Scene::unloadScene()
void Scene::hookSceneEvents() void Scene::hookSceneEvents()
{ {
eventManager->subscribe("OnBulletCollide", [this](std::shared_ptr<Event> e) { std::weak_ptr<Scene> weakSelf = shared_from_this();
auto collideEvent = std::static_pointer_cast<BulletCollideEvent>(e); eventManager->subscribe("OnBulletCollide", [weakSelf](std::shared_ptr<Event> e) {
std::shared_ptr<GameActor> shooter = getGameActorByID(collideEvent->ownerID); if (auto self = weakSelf.lock()) {
std::shared_ptr<GameActor> target = getGameActorByID(collideEvent->victimID); auto collideEvent = std::static_pointer_cast<BulletCollideEvent>(e);
if (shooter && target) GameActor* shooter = self->getGameActorByID(collideEvent->ownerID);
if (auto& weapon = shooter->getHeldWeapon()) GameActor* target = self->getGameActorByID(collideEvent->victimID);
weapon->onHitCallback(target, collideEvent->bullet, collideEvent->normal); if (shooter && target)
if (auto& weapon = shooter->getHeldWeapon())
weapon->onHitCallback(target, collideEvent->bullet.get(), collideEvent->normal);
}
}); });
} }
std::shared_ptr<GameActor> Scene::getGameActorByID(const unsigned int ID) GameActor* Scene::getGameActorByID(const unsigned int ID)
{ {
auto iterator = entities.find(ID); auto iterator = entities.find(ID);
if (iterator == entities.end()) if (iterator == entities.end())
return nullptr; return nullptr;
return iterator->second; return iterator->second.get();
}
std::span<std::weak_ptr<GameActor>> Scene::getAllEntities() const
{
entityCache.clear();
for (const auto& [_, entity] : entities) {
entityCache.push_back(entity);
}
return entityCache;
} }

View file

@ -1,10 +1,7 @@
#include "gameplay/weapons/bullet.h" #include "gameplay/weapons/bullet.h"
#include "gameplay/physics.h"
#include "utility/component.h" #include "utility/component.h"
#include "gameplay/camera.h" void Bullet::addComponent(Component* component)
void Bullet::addComponent(std::shared_ptr<Component> component)
{ {
components.push_back(component); components.push_back(component);
} }

View file

@ -6,20 +6,27 @@
#include "utility/component.h" #include "utility/component.h"
#include <algorithm> #include <algorithm>
#include <memory>
void BulletManager::hookEventManager(const std::shared_ptr<EventManager>& eventManager) void BulletManager::hookEventManager(std::weak_ptr<EventManager> eventManager)
{ {
this->eventManager = eventManager; this->eventManager = eventManager;
this->eventManager->subscribe("OnBulletDied", [this](std::shared_ptr<Event> e) { if (auto event = this->eventManager.lock()) {
auto bulletEvent = std::static_pointer_cast<BulletDiedEvent>(e); std::weak_ptr<BulletManager> weakSelf = shared_from_this();
auto iterator = std::find_if(bullets.begin(), bullets.end(), [&](std::shared_ptr<Bullet> bullet) { event->subscribe("OnBulletDied", [weakSelf](std::shared_ptr<Event> e) {
return bullet->getPhysicsComponent() == bulletEvent->physObj; if (auto self = weakSelf.lock()) {
auto bulletEvent = std::static_pointer_cast<BulletDiedEvent>(e);
auto iterator = std::find_if(self->bullets.begin(), self->bullets.end(), [&](std::shared_ptr<Bullet> bullet) {
return bullet->getPhysicsComponent() == bulletEvent->physObj;
});
if (iterator != self->bullets.end())
self->bullets.erase(iterator);
}
}); });
if (iterator != bullets.end()) }
bullets.erase(iterator);
});
} }
void BulletManager::addBullet(const std::shared_ptr<Bullet>& bullet) void BulletManager::addBullet(const std::shared_ptr<Bullet>& bullet)
{ {
bullets.emplace_back(bullet); bullets.emplace_back(bullet);
@ -31,10 +38,10 @@ void BulletManager::addBullet(const unsigned int owner, const glm::vec3& fireFro
float bulletDrop, float bulletDrop,
glm::vec2 bulletSize, glm::vec2 bulletSize,
const unsigned& shaderID, const unsigned& shaderID,
const std::shared_ptr<Component>& sprite) std::unique_ptr<Component> sprite)
{ {
auto bullet = std::make_shared<Bullet>(owner, shaderID, fireFrom, direction, bulletSpeed, bulletDrop, bulletSize); auto bullet = std::make_shared<Bullet>(owner, shaderID, fireFrom, direction, bulletSpeed, bulletDrop, bulletSize);
bullet->addComponent(sprite); bullet->addComponent(sprite.get());
//bullet->addPhysicsComponent(phy) //bullet->addPhysicsComponent(phy)
bullets.emplace_back(bullet); bullets.emplace_back(bullet);
} }
@ -48,8 +55,8 @@ void BulletManager::update(double deltaTime)
float distance = glm::distance(bullet->getPhysicsComponent()->rigidBody.position, bullet->getBulletOrigin()); float distance = glm::distance(bullet->getPhysicsComponent()->rigidBody.position, bullet->getBulletOrigin());
if (distance > bullet->getBulletDrop() || glm::length(bullet->getPhysicsComponent()->rigidBody.velocity) < 100.0f) if (distance > bullet->getBulletDrop() || glm::length(bullet->getPhysicsComponent()->rigidBody.velocity) < 100.0f)
{ {
if (eventManager) if (auto event = eventManager.lock())
eventManager->notify(std::make_shared<BulletDiedEvent>(bullet->getPhysicsComponent())); event->notify(std::make_shared<BulletDiedEvent>(bullet->getPhysicsComponent()));
//bullets.erase(std::remove(bullets.begin(), bullets.end(), bullet)); //bullets.erase(std::remove(bullets.begin(), bullets.end(), bullet));
} }
} }

View file

@ -17,44 +17,44 @@
Weapon::Weapon(std::shared_ptr<WeaponData> data, const unsigned weaponShaderID, const unsigned bulletShaderID, ResourceManager* resourceManager) Weapon::Weapon(std::shared_ptr<WeaponData> data, const unsigned weaponShaderID, const unsigned bulletShaderID, ResourceManager* resourceManager)
: :
Entity (weaponShaderID), Entity (weaponShaderID),
bulletShaderID (bulletShaderID),
weaponSize (glm::vec2(data->sizeX, data->sizeY)), weaponSize (glm::vec2(data->sizeX, data->sizeY)),
weaponOffset (glm::vec2(data->offsetX, data->offsetY)), weaponOffset (glm::vec2(data->offsetX, data->offsetY)),
weaponMagSize (data->clipSize),
weaponMag (data->clipSize), weaponMag (data->clipSize),
weaponMagSize (data->clipSize),
weaponAmmo (data->maxAmmo), weaponAmmo (data->maxAmmo),
bulletDrop (data->bulletDrop),
bulletSpeed (data->bulletSpeed), bulletSpeed (data->bulletSpeed),
bulletSize (glm::vec2(data->bulletSizeX, data->bulletSizeY)), bulletDrop (data->bulletDrop),
bulletSpread (std::make_shared<UTIL::RandomGenerator>(-data->bulletSpread, data->bulletSpread)),
bulletModifer (std::make_shared<UTIL::RandomGenerator>(data->modMin, data->modMax)),
fireSpeed (data->fireSpeed), fireSpeed (data->fireSpeed),
bulletManager (std::make_shared<BulletManager>()) bulletSize (glm::vec2(data->bulletSizeX, data->bulletSizeY)),
bulletShaderID (bulletShaderID),
bulletManager (std::make_shared<BulletManager>()),
bulletSpread (std::make_unique<UTIL::RandomGenerator>(-data->bulletSpread, data->bulletSpread)),
bulletModifer (std::make_unique<UTIL::RandomGenerator>(data->modMin, data->modMax))
{ {
if (data->bulletAnimated) if (data->bulletAnimated)
bulletSprite = std::make_shared<AnimationComponent>(resourceManager->loadAnimationSet(data->bulletGraphic, entityid)); bulletSprite = std::make_unique<AnimationComponent>(resourceManager->loadAnimationSet(data->bulletGraphic, entityid));
else else
bulletSprite = std::make_shared<SpriteComponent>(resourceManager->loadSpriteStatic(data->bulletGraphic)); bulletSprite = std::make_unique<SpriteComponent>(resourceManager->loadSpriteStatic(data->bulletGraphic));
if (data->animated) if (data->animated)
{ {
addComponent(std::make_shared<AnimationComponent>(resourceManager->loadAnimationSet(data->graphic, entityid))); addComponent(std::make_unique<AnimationComponent>(resourceManager->loadAnimationSet(data->graphic, entityid)));
} }
else else
addComponent(std::make_shared<SpriteComponent>(resourceManager->loadSpriteStatic(data->graphic))); addComponent(std::make_unique<SpriteComponent>(resourceManager->loadSpriteStatic(data->graphic)));
this->setScale(glm::vec3(weaponSize.x, weaponSize.y, 1.0f)); this->setScale(glm::vec3(weaponSize.x, weaponSize.y, 1.0f));
}; };
void Weapon::addComponent(const std::shared_ptr<Component>& comp) { void Weapon::addComponent(std::unique_ptr<Component> comp) {
components.push_back(comp); components.push_back(std::move(comp));
} }
void Weapon::reload() void Weapon::reload()
{ {
// TODO: Create reload event that will be captured by the gun animation set, to start the reloading animation // TODO: Create reload event that will be captured by the gun animation set, to start the reloading animation
if (eventManager) if (auto event = eventManager.lock())
{ {
eventManager->notify(std::make_shared<EntityReloadEvent>(entityid)); event->notify(std::make_shared<EntityReloadEvent>(entityid));
reloading = true; reloading = true;
if (weaponAmmo < weaponMagSize) { if (weaponAmmo < weaponMagSize) {
weaponMag = weaponAmmo; weaponMag = weaponAmmo;
@ -67,8 +67,9 @@ void Weapon::reload()
} }
} }
void Weapon::shoot() bool Weapon::shoot()
{ {
bool shotsFired = false;
if (wielder) if (wielder)
{ {
Uint32 currentTime = SDL_GetTicks(); Uint32 currentTime = SDL_GetTicks();
@ -76,8 +77,9 @@ void Weapon::shoot()
{ {
if (weaponMag > 0) if (weaponMag > 0)
{ {
if (eventManager) shotsFired = true;
eventManager->notify(std::make_shared<EntityFireEvent>(entityid, fireSpeed)); if (auto event = eventManager.lock())
event->notify(std::make_shared<EntityFireEvent>(entityid, fireSpeed));
if (!weaponScript || !weaponScript->lua["onShoot"].valid()) if (!weaponScript || !weaponScript->lua["onShoot"].valid())
{ {
// create bullet using this generated data // create bullet using this generated data
@ -99,32 +101,38 @@ void Weapon::shoot()
lastFireTime = currentTime; lastFireTime = currentTime;
} }
} }
return shotsFired;
} }
void Weapon::hookEventManager(const std::shared_ptr<EventManager>& eventManager) void Weapon::hookEventManager(std::weak_ptr<EventManager> eventManager)
{ {
this->eventManager = eventManager; this->eventManager = eventManager;
for (auto& component : components) for (auto& component : components)
{ {
auto animComponent = std::dynamic_pointer_cast<AnimationComponent>(component); if (component->getType() == Component::TYPE::ANIMATION)
if (animComponent != nullptr)
{ {
auto animComponent = static_cast<AnimationComponent*>(component.get());
animComponent->getAnimationSet()->attachEventManager(eventManager); animComponent->getAnimationSet()->attachEventManager(eventManager);
} }
} }
this->eventManager->subscribe("OnAnimationFinished", [&, this](std::shared_ptr<Event> e) { if (auto event = this->eventManager.lock()) {
auto animFinished = std::static_pointer_cast<AnimationFinishedEvent>(e); std::weak_ptr<Weapon> selfWeak = shared_from_this();
if (animFinished->entityid == entityid && animFinished->animType == "reload") event->subscribe("OnAnimationFinished", [selfWeak](std::shared_ptr<Event> e) {
{ if (auto self = selfWeak.lock()) {
if (reloading) auto animFinished = std::static_pointer_cast<AnimationFinishedEvent>(e);
{ if (animFinished->entityid == self->entityid && animFinished->animType == "reload")
reloading = false; {
wasReloading = true; if (self->reloading)
{
self->reloading = false;
self->wasReloading = true;
}
}
} }
} });
}); }
bulletManager->hookEventManager(eventManager); bulletManager->hookEventManager(eventManager);
} }
@ -136,7 +144,7 @@ void Weapon::attachScript(const std::shared_ptr<WeaponScript>& script)
LOG(DEBUG, "Weapon state bound"); LOG(DEBUG, "Weapon state bound");
} }
void Weapon::onHitCallback(std::shared_ptr<GameActor> target, std::shared_ptr<PhysicsComponent> bullet, const glm::vec2& normal) void Weapon::onHitCallback(GameActor* target, PhysicsComponent* bullet, const glm::vec2& normal)
{ {
if (weaponScript && weaponScript->lua["onHit"].valid()) if (weaponScript && weaponScript->lua["onHit"].valid())
{ {
@ -160,10 +168,12 @@ void Weapon::update(double deltaTime)
for (auto& component : components) for (auto& component : components)
component->update(); component->update();
if (eventManager && wasReloading) if (wasReloading)
{ {
wasReloading = false; wasReloading = false;
eventManager->notify(std::make_shared<EntityFinishReloadEvent>(entityid)); if (auto event = eventManager.lock()) {
event->notify(std::make_shared<EntityFinishReloadEvent>(entityid));
}
} }
} }
bulletManager->update(deltaTime); bulletManager->update(deltaTime);
@ -242,12 +252,12 @@ Weapon::BulletData Weapon::genBulletData()
void Weapon::createBullet(const Weapon::BulletData& data) void Weapon::createBullet(const Weapon::BulletData& data)
{ {
auto bullet = std::make_shared<Bullet>(wielder->getEntityID(), bulletShaderID, data.origin, data.direction, bulletSpeed, bulletDrop, bulletSize); auto bullet = std::make_shared<Bullet>(wielder->getEntityID(), bulletShaderID, data.origin, data.direction, bulletSpeed, bulletDrop, bulletSize);
bullet->addComponent(bulletSprite); bullet->addComponent(bulletSprite.get());
bullet->addPhysicsComponent(std::make_shared<PhysicsComponent>(PhysicsComponentFactory::makeBullet(wielder->getEntityID(), data.origin, data.mass, bulletSize.x / 2))); bullet->addPhysicsComponent(std::make_shared<PhysicsComponent>(PhysicsComponentFactory::makeBullet(wielder->getEntityID(), data.origin, data.mass, bulletSize.x / 2)));
bullet->getPhysicsComponent()->rigidBody.velocity += bulletSpeed * glm::vec3(data.direction.x, data.direction.y, 0.f) / data.mass; bullet->getPhysicsComponent()->rigidBody.velocity += bulletSpeed * glm::vec3(data.direction.x, data.direction.y, 0.f) / data.mass;
if (eventManager) if (auto event = eventManager.lock())
eventManager->notify(std::make_shared<BulletFiredEvent>(bullet)); event->notify(std::make_shared<BulletFiredEvent>(bullet));
bulletManager->addBullet(bullet); bulletManager->addBullet(bullet);
} }

View file

@ -7,12 +7,12 @@
Animation::Animation(const std::shared_ptr<AnimationData>& animData, ResourceManager* resourceManager) : Animation::Animation(const std::shared_ptr<AnimationData>& animData, ResourceManager* resourceManager) :
animName(animData->name), animName(animData->name),
animType(animData->type), animType(animData->type),
spriteAtlas(resourceManager->loadSpriteAtlas(animData->spriteAtlas, animData->frameSize, animData->directional)),
FPS(animData->FPS), FPS(animData->FPS),
currentFrame(0), currentFrame(0),
cycles(0), cycles(0),
isDirectional(animData->directional), isDirectional(animData->directional),
isPlaying(isDirectional), isPlaying(isDirectional)
spriteAtlas(resourceManager->loadSpriteAtlas(animData->spriteAtlas, animData->frameSize, animData->directional))
{} {}
void Animation::bind() void Animation::bind()
@ -76,22 +76,24 @@ void Animation::frameTick()
AnimationSet::AnimationSet(const int& entityid) : entityid(entityid), isDirectional(false) {}; AnimationSet::AnimationSet(const int& entityid) : entityid(entityid), isDirectional(false) {};
AnimationSet::AnimationSet(const int& entityid, ResourceManager* resourceManager, std::vector<std::shared_ptr<AnimationData>> animSet) : entityid(entityid) AnimationSet::AnimationSet(const int& entityid, ResourceManager* resourceManager, std::vector<std::shared_ptr<AnimationData>> animSet) : entityid(entityid)
{ {
curAnim = nullptr;
for (const auto& anim : animSet) for (const auto& anim : animSet)
{ {
anims.try_emplace(anim->type, std::make_shared<Animation>(anim, resourceManager)); anims.try_emplace(anim->type, std::make_unique<Animation>(anim, resourceManager));
if (anim->type == "idle") if (anim->type == "idle")
curAnim = anims[anim->type]; curAnim = anims[anim->type].get();
} }
// if we don't have an idle animation, we are just gonna set the current animation to the top of the set // if we don't have an idle animation, we are just gonna set the current animation to the top of the set
if (curAnim == nullptr) if (curAnim == nullptr)
curAnim = anims[animSet[0]->type]; curAnim = anims[animSet[0]->type].get();
isDirectional = curAnim->getDirectional(); isDirectional = curAnim->getDirectional();
} }
AnimationSet::AnimationSet(const int& entityid, const std::unordered_map<std::string, std::shared_ptr<Animation>>& animations) : entityid(entityid), anims(animations) AnimationSet::AnimationSet(const int& entityid, std::unordered_map<std::string, std::unique_ptr<Animation>> animations)
: entityid(entityid), anims(std::move(animations))
{ {
for (const auto& [type, anim] : animations) for (auto& [type, anim] : animations)
{ {
curAnim = anim; curAnim = anim.get();
if (type == "idle") if (type == "idle")
{ {
break; break;
@ -100,87 +102,105 @@ AnimationSet::AnimationSet(const int& entityid, const std::unordered_map<std::st
isDirectional = curAnim->getDirectional(); isDirectional = curAnim->getDirectional();
} }
void AnimationSet::attachEventManager(const std::shared_ptr<EventManager>& e) void AnimationSet::attachEventManager(std::weak_ptr<EventManager> e)
{ {
eventManager = e; eventManager = e;
eventManager->subscribe("OnDirectionChange", [this](std::shared_ptr<Event> e) { if (auto event = eventManager.lock()) {
auto directionEvent = std::static_pointer_cast<DirectionChangeEvent>(e); std::weak_ptr<AnimationSet> weakSelf = shared_from_this();
if (directionEvent->entityid == entityid)
setFacingDir(directionEvent->direction);
});
eventManager->subscribe("OnEntityMove", [this](std::shared_ptr<Event> e) { event->subscribe("OnDirectionChange", [weakSelf](std::shared_ptr<Event> e) {
auto moveEvent = std::static_pointer_cast<EntityMoveEvent>(e); if (auto self = weakSelf.lock()) {
if (moveEvent->entityid == entityid) auto directionEvent = std::static_pointer_cast<DirectionChangeEvent>(e);
{ if (directionEvent->entityid == self->entityid)
if (isDirectional) self->setFacingDir(directionEvent->direction);
{
if (anims["move"] != NULL)
curAnim = anims["move"];
} }
else });
play();
}
});
eventManager->subscribe("OnEntityStop", [this](std::shared_ptr<Event> e) { event->subscribe("OnEntityMove", [weakSelf](std::shared_ptr<Event> e) {
auto stopEvent = std::static_pointer_cast<EntityStopEvent>(e); if (auto self = weakSelf.lock()) {
if (stopEvent->entityid == entityid) auto moveEvent = std::static_pointer_cast<EntityMoveEvent>(e);
{ if (moveEvent->entityid == self->entityid)
if (isDirectional) {
{ if (self->isDirectional)
if (anims["idle"] != NULL) {
curAnim = anims["idle"]; if (self->anims["move"] != NULL)
self->curAnim = self->anims["move"].get();
}
else
self->play();
}
} }
else });
stop();
}
});
eventManager->subscribe("OnEntityReload", [this](std::shared_ptr<Event> e) { event->subscribe("OnEntityStop", [weakSelf](std::shared_ptr<Event> e) {
auto reloadEvent = std::static_pointer_cast<EntityReloadEvent>(e); if (auto self = weakSelf.lock()) {
if (reloadEvent->entityid == entityid) auto stopEvent = std::static_pointer_cast<EntityStopEvent>(e);
{ if (stopEvent->entityid == self->entityid)
if (anims["reload"] != NULL) {
{ if (self->isDirectional)
curAnim = anims["reload"]; {
curAnim->reset(); if (self->anims["idle"] != NULL)
self->curAnim = self->anims["idle"].get();
}
else
self->stop();
}
} }
} });
});
eventManager->subscribe("OnEntityFinishReload", [this](std::shared_ptr<Event> e) { event->subscribe("OnEntityReload", [weakSelf](std::shared_ptr<Event> e) {
auto reloadEvent = std::static_pointer_cast<EntityFinishReloadEvent>(e); if (auto self = weakSelf.lock()) {
if (reloadEvent->entityid == entityid) auto reloadEvent = std::static_pointer_cast<EntityReloadEvent>(e);
{ if (reloadEvent->entityid == self->entityid)
if (anims["idle"] != NULL) {
curAnim = anims["idle"]; if (self->anims["reload"] != NULL)
} {
}); self->curAnim = self->anims["reload"].get();
self->curAnim->reset();
eventManager->subscribe("OnEntityFire", [this](std::shared_ptr<Event> e) { }
auto fireEvent = std::static_pointer_cast<EntityFireEvent>(e); }
if (fireEvent->entityid == entityid)
{
if (anims["fire"] != NULL)
{
curAnim = anims["fire"];
curAnim->reset();
float newFPS = (1000.f / fireEvent->fireDelay) * 15.f;
curAnim->setFPS(newFPS);
} }
} });
});
eventManager->subscribe("OnAnimationFinished", [this](std::shared_ptr<Event> e) { event->subscribe("OnEntityFinishReload", [weakSelf](std::shared_ptr<Event> e) {
auto animEvent = std::static_pointer_cast<AnimationFinishedEvent>(e); if (auto self = weakSelf.lock()) {
if (animEvent->entityid == entityid && animEvent->animType == "fire") auto reloadEvent = std::static_pointer_cast<EntityFinishReloadEvent>(e);
{ if (reloadEvent->entityid == self->entityid)
if (anims["idle"] != NULL) {
curAnim = anims["idle"]; if (self->anims["idle"] != NULL)
} self->curAnim = self->anims["idle"].get();
}); }
}
});
event->subscribe("OnEntityFire", [weakSelf](std::shared_ptr<Event> e) {
if (auto self = weakSelf.lock()) {
auto fireEvent = std::static_pointer_cast<EntityFireEvent>(e);
if (fireEvent->entityid == self->entityid)
{
if (self->anims["fire"] != NULL)
{
self->curAnim = self->anims["fire"].get();
self->curAnim->reset();
float newFPS = (1000.f / fireEvent->fireDelay) * 15.f;
self->curAnim->setFPS(newFPS);
}
}
}
});
event->subscribe("OnAnimationFinished", [weakSelf](std::shared_ptr<Event> e) {
if (auto self = weakSelf.lock()) {
auto animEvent = std::static_pointer_cast<AnimationFinishedEvent>(e);
if (animEvent->entityid == self->entityid && animEvent->animType == "fire")
{
if (self->anims["idle"] != NULL)
self->curAnim = self->anims["idle"].get();
}
}
});
}
} }
void AnimationSet::bind() void AnimationSet::bind()
@ -197,11 +217,11 @@ void AnimationSet::draw()
curAnim->draw(); curAnim->draw();
// Sending animation events // Sending animation events
if (eventManager) // If the animation has cycled, we send this event after every cycle
{ if ((curAnim->getCycles() - lastCycle) > 0) {
// If the animation has cycled, we send this event after every cycle if (auto event = eventManager.lock()) {
if ((curAnim->getCycles() - lastCycle) > 0) event->notify(std::make_shared<AnimationFinishedEvent>(entityid, curAnim->getType()));
eventManager->notify(std::make_shared<AnimationFinishedEvent>(entityid, curAnim->getType())); }
} }
} }

View file

@ -0,0 +1,102 @@
#include "graphics/postprocess.h"
#include <graphics/quad.h>
Postprocessor::Postprocessor(const std::shared_ptr<ResourceManager>& resourceManager)
{
postProcessShader = resourceManager->getShaderByID(
resourceManager->loadShader(
"GL_postprocess",
"shaders/GL_postprocess.vert",
"shaders/GL_postprocess.frag")
);
// TODO: ADD FALLBACK SHADER!
if (postProcessShader == nullptr) {
LOG(ERROR, "Failed to load post processing shader! 'shaders/GL_postprocess.*");
assert(postProcessShader != nullptr); // force crash
}
postProcessShader->use();
postProcessShader->setIntArray("edge_kernel", 9, edge_kernel);
postProcessShader->setFloatArray("blur_kernel", 9, blur_kernel);
unsigned int uboIndex = glGetUniformBlockIndex(postProcessShader->ID, "uPostProcess");
if (uboIndex == GL_INVALID_INDEX) {
LOG(ERROR, "Could not find 'uPostProcess'!");
}
unsigned int bindPoint = 0;
glUniformBlockBinding(postProcessShader->ID, uboIndex, bindPoint);
glGenBuffers(1, &UBO);
glBindBuffer(GL_UNIFORM_BUFFER, UBO);
glBufferData(GL_UNIFORM_BUFFER, sizeof(PostProcessData_t), NULL, GL_DYNAMIC_DRAW);
glBindBuffer(GL_UNIFORM_BUFFER, 0);
glBindBufferBase(GL_UNIFORM_BUFFER, bindPoint, UBO);
lastTime = SDL_GetTicks();
}
void Postprocessor::ApplyEffect(EFFECT effect, float intensity, float effectDuration, glm::vec3 colorModifer)
{
postProcessData.curEffects |= effect;
if ((effect & EFFECT::BLUR) != 0) {
postProcessData.blurIntensity = intensity;
} else if ((effect & EFFECT::SHAKE) != 0) {
postProcessData.shakeIntensity = intensity;
postProcessData.shakeTime = effectDuration;
}
if ((effect & EFFECT::COLORMOD) != 0) {
postProcessData.colorMod = colorModifer;
}
}
void Postprocessor::RemoveAllEffects()
{
postProcessData.curEffects = 0;
postProcessData.curEffects_hud = 0;
}
void Postprocessor::RemoveEffects(EFFECT effect)
{
postProcessData.curEffects &= (postProcessData.curEffects ^ effect);
postProcessData.curEffects_hud &= (postProcessData.curEffects_hud ^ effect);
}
void Postprocessor::applyPostProcess(bool worldOrHud)
{
unsigned int curTime = SDL_GetTicks();
postProcessData.curTime = curTime;
postProcessData.dt = curTime - lastTime;
auto subtractTime = [](float remaining, unsigned int dt){
if ((remaining - 1.0f / static_cast<float>(dt)) <= 0.0f)
return 0.0f;
return remaining - (1.0f / static_cast<float>(dt));
};
if (!worldOrHud)
postProcessData.shakeTime = subtractTime(postProcessData.shakeTime, postProcessData.dt);
else
postProcessData.shakeTime_hud = subtractTime(postProcessData.shakeTime_hud, postProcessData.dt);
if (postProcessData.shakeTime <= 0.0f) {
RemoveEffects(SHAKE);
}
postProcessShader->use();
postProcessShader->setBool("worldOrHud", worldOrHud);
glBindBuffer(GL_UNIFORM_BUFFER, UBO);
glBufferSubData(GL_UNIFORM_BUFFER, 0, sizeof(PostProcessData_t), &postProcessData);
/*
PostProcessData_t* pp_data = (PostProcessData_t*)glMapBuffer(
GL_UNIFORM_BUFFER,
GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_RANGE_BIT | GL_MAP_UNSYNCHRONIZED_BIT);
if (pp_data) {
std::memcpy(pp_data, &postProcessData, sizeof(PostProcessData_t));
glUnmapBuffer(GL_UNIFORM_BUFFER);
}
*/
glBindBuffer(GL_UNIFORM_BUFFER, 0);
lastTime = curTime;
}

View file

@ -2,8 +2,11 @@
#include "graphics/shader.h" #include "graphics/shader.h"
#include "utility/resourcemanager.h" #include "utility/resourcemanager.h"
#include "utility/logger.h" #include "utility/logger.h"
#include "utility/events.h"
#include <algorithm> #include <algorithm>
#include <graphics/postprocess.h>
#include <memory>
Renderer::Renderer(const std::shared_ptr<ResourceManager>& r) Renderer::Renderer(const std::shared_ptr<ResourceManager>& r)
: resourceManager(r) : resourceManager(r)
@ -12,8 +15,21 @@ Renderer::Renderer(const std::shared_ptr<ResourceManager>& r)
viewMat = glm::mat4(0.f); viewMat = glm::mat4(0.f);
initFrameBuffers(); initFrameBuffers();
loadPostProcessShaders();
screenQuad = std::make_unique<ScreenQuad>(); screenQuad = std::make_unique<ScreenQuad>();
postProcessor = std::make_unique<Postprocessor>(r);
}
void Renderer::hookEventManager(std::weak_ptr<EventManager> eventManager)
{
if (auto e = eventManager.lock()) {
e->subscribe("OnScreenShake", [this](std::shared_ptr<Event> event) {
auto shakeEvent = std::dynamic_pointer_cast<ScreenShakeEvent>(event);
postProcessor->ApplyEffect(Postprocessor::SHAKE,
shakeEvent->intensity,
shakeEvent->duration
);
});
}
} }
// Initialize the framebuffers used by the renderer to allow for post-processing effects // Initialize the framebuffers used by the renderer to allow for post-processing effects
@ -66,20 +82,6 @@ void Renderer::initFrameBuffers()
glBindFramebuffer(GL_FRAMEBUFFER, 0); glBindFramebuffer(GL_FRAMEBUFFER, 0);
} }
void Renderer::loadPostProcessShaders()
{
postProcess_World = resourceManager->getShaderByID(resourceManager->loadShader("GL_pp_world-DEFAULT", "shaders/GL_pp_world.vert", "shaders/GL_pp_world.frag"));
if (postProcess_World == nullptr) {
LOG(ERROR, "Failed to load world shader: GL_pp_world!");
assert(1 == 0); // force crash
}
postProcess_HUD = resourceManager->getShaderByID(resourceManager->loadShader("GL_pp_hud-DEFAULT", "shaders/GL_pp_hud.vert", "shaders/GL_pp_hud.frag"));
if (postProcess_HUD == nullptr) {
LOG(ERROR, "Failed to load hud shader: GL_pp_hud!");
assert(1 == 0); // force crash
}
}
void Renderer::setProjAndViewMatrix(const glm::mat4& proj, const glm::mat4& view) void Renderer::setProjAndViewMatrix(const glm::mat4& proj, const glm::mat4& view)
{ {
projMat = proj; projMat = proj;
@ -123,11 +125,11 @@ void Renderer::render()
glActiveTexture(GL_TEXTURE0); glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, worldBuffer.texture); glBindTexture(GL_TEXTURE_2D, worldBuffer.texture);
postProcess_World->use(); postProcessor->applyPostProcess(0);
screenQuad->draw(); screenQuad->draw();
glBindTexture(GL_TEXTURE_2D, hudBuffer.texture); glBindTexture(GL_TEXTURE_2D, hudBuffer.texture);
postProcess_HUD->use(); postProcessor->applyPostProcess(1);
screenQuad->draw(); screenQuad->draw();
} }

View file

@ -86,6 +86,16 @@ void Shader::setFloat(const std::string& name, float value)
glUniform1f(glGetUniformLocation(ID, name.c_str()), value); glUniform1f(glGetUniformLocation(ID, name.c_str()), value);
} }
void Shader::setFloatArray(const std::string& name, size_t count, const float* value)
{
glUniform1fv(glGetUniformLocation(ID, name.c_str()), count, value);
}
void Shader::setIntArray(const std::string& name, size_t count, const int* value)
{
glUniform1iv(glGetUniformLocation(ID, name.c_str()), count, value);
}
void Shader::setInt(const std::string& name, int value) void Shader::setInt(const std::string& name, int value)
{ {
glUniform1i(glGetUniformLocation(ID, name.c_str()), value); glUniform1i(glGetUniformLocation(ID, name.c_str()), value);

188
compile_commands.json Normal file
View file

@ -0,0 +1,188 @@
[
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG /Fo_deps\\tracy-build\\CMakeFiles\\TracyClient.dir\\public\\TracyClient.cpp.obj /Fd_deps\\tracy-build\\CMakeFiles\\TracyClient.dir\\TracyClient.pdb /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public\\TracyClient.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public\\TracyClient.cpp",
"output": "_deps\\tracy-build\\CMakeFiles\\TracyClient.dir\\public\\TracyClient.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\main.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\main.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\main.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\main.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /MD /O2 /Ob2 /DNDEBUG /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\C_\\sdks\\glad\\src\\glad.c.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\sdks\\glad\\src\\glad.c",
"file": "C:\\sdks\\glad\\src\\glad.c",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\C_\\sdks\\glad\\src\\glad.c.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\graphics\\sprite.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\graphics\\sprite.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\graphics\\sprite.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\graphics\\sprite.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\graphics\\mesh.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\graphics\\mesh.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\graphics\\mesh.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\graphics\\mesh.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\entity.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\entity.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\entity.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\entity.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\gameactor.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\gameactor.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\gameactor.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\gameactor.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\graphics\\shader.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\graphics\\shader.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\graphics\\shader.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\graphics\\shader.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\util.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\util.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\util.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\util.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\camera.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\camera.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\camera.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\camera.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\utility\\command.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\utility\\command.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\utility\\command.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\utility\\command.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\input.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\input.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\input.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\input.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\weapons\\bullet.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\weapons\\bullet.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\weapons\\bullet.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\weapons\\bullet.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\weapons\\bulletmanager.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\weapons\\bulletmanager.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\weapons\\bulletmanager.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\weapons\\bulletmanager.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\scene.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\scene.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\scene.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\scene.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\graphics\\texture.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\graphics\\texture.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\graphics\\texture.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\graphics\\texture.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\utility\\resourcemanager.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\utility\\resourcemanager.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\utility\\resourcemanager.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\utility\\resourcemanager.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\utility\\xmlloader.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\utility\\xmlloader.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\utility\\xmlloader.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\utility\\xmlloader.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\game.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\game.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\game.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\game.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\graphics\\instancedraw.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\graphics\\instancedraw.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\graphics\\instancedraw.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\graphics\\instancedraw.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\map.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\map.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\map.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\map.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\weapons\\weapon.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\weapons\\weapon.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\weapons\\weapon.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\weapons\\weapon.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\physics.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\physics.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\physics.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\physics.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\utility\\debugdraw.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\utility\\debugdraw.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\utility\\debugdraw.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\utility\\debugdraw.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\utility\\script.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\utility\\script.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\utility\\script.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\utility\\script.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\ai.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\ai.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\gameplay\\ai.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\gameplay\\ai.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\utility\\ftfont.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\utility\\ftfont.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\utility\\ftfont.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\utility\\ftfont.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\graphics\\quad.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\graphics\\quad.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\graphics\\quad.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\graphics\\quad.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\graphics\\animation.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\graphics\\animation.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\graphics\\animation.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\graphics\\animation.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\utility\\logger.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\utility\\logger.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\utility\\logger.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\utility\\logger.cpp.obj"
},
{
"directory": "C:/Users/Ethan/source/repos/YuppleMayham/out/build/x64-release",
"command": "C:\\PROGRA~1\\MIB055~1\\2022\\COMMUN~1\\VC\\Tools\\MSVC\\1439~1.335\\bin\\Hostx64\\x64\\cl.exe /nologo /TP -DTRACY_ENABLE -DTRACY_ONLY_LOCALHOST -DTRACY_ON_DEMAND -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\include -external:Ic:\\sdks\\glad\\include -external:Ic:\\sdks\\tinyxml2-10.0.0\\debug\\include -external:Ic:\\sdks\\glm -external:IC:\\sdks\\sol2-3.3.0\\single\\single\\include -external:Ic:\\sdks\\lua-5.4.6\\include -external:IC:\\sdks\\freetype-2.13.2\\include -external:IC:\\sdks\\sdl2\\cmake\\..\\include -external:IC:\\sdks\\SDL2_image-2.8.2\\cmake\\..\\include -external:IC:\\Users\\Ethan\\source\\repos\\YuppleMayham\\out\\build\\x64-release\\_deps\\tracy-src\\public -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20 /FoYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\graphics\\renderer.cpp.obj /FdYuppleMayham\\CMakeFiles\\YuppleMayham.dir\\ /FS -c C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\graphics\\renderer.cpp",
"file": "C:\\Users\\Ethan\\source\\repos\\YuppleMayham\\YuppleMayham\\src\\graphics\\renderer.cpp",
"output": "YuppleMayham\\CMakeFiles\\YuppleMayham.dir\\src\\graphics\\renderer.cpp.obj"
}
]