Merge branch 'master' into SQC-22

This commit is contained in:
MarcEricMartel
2023-11-06 15:39:54 -05:00
committed by GitHub
44 changed files with 1793 additions and 666 deletions

View File

@@ -18,7 +18,8 @@
#include "audio.h"
#include "textureatlas.h"
#include "connector.h"
#include "worldrenderer.h"
#include "renderer.h"
#include "remoteplayer.h"
class Engine : public OpenglContext {
public:
@@ -26,6 +27,7 @@ public:
virtual ~Engine();
virtual void DrawMenu();
virtual void DrawPause();
virtual void DrawSplachScreen();
virtual void Init();
virtual void DeInit();
virtual void LoadResource();
@@ -38,23 +40,24 @@ public:
virtual void MouseReleaseEvent(const MOUSE_BUTTON &button, int x, int y);
private:
float GetScale() const;
int GetFps(float elapsedTime) const;
int GetCountdown(float elapsedTime);
bool LoadTexture(Texture& texture, const std::string& filename, bool useMipmaps = true, bool stopOnError = true);
void InstantDamage();
void SystemNotification(std::string systemLog);
void KillNotification(Player killer, Player killed);
void DisplayNotification(std::string message);
void ProcessNotificationQueue();
void DisplayCrosshair();
void DisplayPovGun();
void DisplayCurrentItem();
void DisplayHud(int timer);
void DisplayInfo(float elapsedTime, BlockType bloc);
void DisplaySingleOrMultiplayerMenu();
void DrawHud(float elapsedTime, BlockType bloc);
void PrintText(float x, float y, float scale, const std::string& t);
void PrintText(float x, float y, const std::string& t, float charSizeMultiplier = 1.0f);
Connector m_conn;
Shader m_shader01;
@@ -62,12 +65,17 @@ private:
TextureAtlas m_textureAtlas = TextureAtlas(BTYPE_LAST);
World m_world = World();
WorldRenderer m_wrenderer = WorldRenderer();
Renderer m_renderer = Renderer();
Texture m_textureSkybox;
Texture m_textureFont;
Texture m_textureCrosshair;
Texture m_textureFont;
Texture m_textureGun;
Texture m_texturePovGun;
Texture m_textureSkybox;
Texture m_textureSoloMultiMenu;
Texture m_textureSoloText;
Texture m_textureMultiText;
Texture m_textureTitle;
Skybox m_skybox;
Audio m_audio = Audio(AUDIO_PATH "start.wav");
@@ -80,8 +88,10 @@ private:
Bullet* m_bullets[MAX_BULLETS];
std::map<uint64_t, Player*> m_players;
//Menu
enum class GameState { MAIN_MENU, OPTIONS, QUIT, NEWG, PLAY, PAUSE };
enum class GameState: uint8_t { MAIN_MENU, OPTIONS, QUIT, NEWG, PLAY, PAUSE };
GameState m_gamestate = GameState::MAIN_MENU;
Texture MenuTitleTexture;
Texture MenuBGTexture;
@@ -89,13 +99,21 @@ private:
Texture MenuQuitTexture;
Texture MenuOptionsTexture;
Texture PauseBGTexture;
Texture SplachScreenTexture;
float m_scale;
float m_time = 0;
float m_time_SplashScreen = 0;
float m_titleX = 0;
float m_titleY = 0;
float m_Width = 0;
float m_Height = 0;
int m_renderCount = 0;
int m_countdown = COUNTDOWN;
bool m_damage = false;
bool m_wireframe = false;
bool m_isSkybox = true;
bool m_block = false;
@@ -104,6 +122,7 @@ private:
bool m_displayHud = true;
bool m_displayInfo = false;
bool m_resetcountdown = false;
bool m_soloMultiChoiceMade = false;
bool m_stopcountdown = false;
bool m_keyK = false;
@@ -122,6 +141,8 @@ private:
float m_mousemx = 0;
float m_mousemy = 0;
bool m_networkgame = false;
std::string m_messageNotification = "";
};