Merge pull request #34 from CegepSTH/MenusMenusMenus

Menus menus menus
This commit is contained in:
MarcEricMartel 2023-12-04 13:25:55 -05:00 committed by GitHub
commit bc5c28a373
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
41 changed files with 831 additions and 935 deletions

View File

@ -34,9 +34,17 @@
#define SHADER_PATH "./media/shaders/" #define SHADER_PATH "./media/shaders/"
#define AUDIO_PATH "./media/audio/" #define AUDIO_PATH "./media/audio/"
#define CHUNK_PATH "./media/chunks/" #define CHUNK_PATH "./media/chunks/"
#define MENU_ITEM_PATH "./media/menu_items/"
#define BOOSTER_TEXTURE_PATH "./media/textures/Booster/" #define BOOSTER_TEXTURE_PATH "./media/textures/Booster/"
enum GameState {
MAIN_MENU,
SPLASH,
OPTIONS,
QUIT,
PLAY,
PAUSE
};
enum Resolution { enum Resolution {
HD = 0, // 1280x720 (High Definition) HD = 0, // 1280x720 (High Definition)
FHD, // 1920x1080 (Full HD) FHD, // 1920x1080 (Full HD)

File diff suppressed because it is too large Load Diff

View File

@ -30,9 +30,6 @@ class Engine : public OpenglContext {
public: public:
Engine(); Engine();
virtual ~Engine(); virtual ~Engine();
virtual void DrawMenu();
virtual void DrawOption();
virtual void DrawSplachScreen();
virtual void Init(); virtual void Init();
virtual void DeInit(); virtual void DeInit();
virtual void LoadResource(); virtual void LoadResource();
@ -54,53 +51,82 @@ private:
void InstantDamage(); void InstantDamage();
void SystemNotification(std::string systemLog); void SystemNotification(std::string systemLog);
void KillNotification(Player killer, Player killed); void KillNotification(Player killer, Player killed);
void DisplayNotification(std::string message); void DisplayNotification(std::string message);
void DisplayCrosshair(); void DisplayCrosshair();
void DisplayPovGun(); void DisplayPovGun();
void DisplayCurrentItem(); void DisplayCurrentItem();
void DisplayHud(int timer); void DisplayHud(int timer);
void DrawHud(float elapsedTime, BlockType bloc);
void DisplayInfo(float elapsedTime, BlockType bloc); void DisplayInfo(float elapsedTime, BlockType bloc);
void DisplaySingleOrMultiplayerMenu();
void DisplaySplashScreen();
void DisplayPauseMenu();
void DisplayMainMenu();
void DrawButtonBackgrounds(float centerX, float centerY, int iterations);
void DrawMainMenuButtons(float centerX, float centerY);
void DrawSingleMultiButtons(float centerX, float centerY);
void DisplayOptionsMenu();
void DisplayAudioMenu(float centerX, float centerY); void DisplayAudioMenu(float centerX, float centerY);
void DisplayGraphicsMenu(float centerX, float centerY); void DisplayGraphicsMenu(float centerX, float centerY);
void DisplayGameplayMenu(float centerX, float centerY); void DisplayGameplayMenu(float centerX, float centerY);
void DrawSliderBackground(float centerX, float centerY, float minVal, float maxVal, float bottomSideValue, float topSideValue); void DrawSliderBackground(float centerX, float centerY, float minVal, float maxVal, float bottomSideValue, float topSideValue);
void DisplayBarPercentValue(float centerX, float centerY, float posX, float posY, float minVal, float maxVal, float value); void DisplayBarPercentValue(float centerX, float centerY, float posX, float posY, float minVal, float maxVal, float value);
void RedrawSlider(float centerX, float centerY, float value, float minVal, float maxVal, float bottomSideValue, float topSideValue); void DrawSlider(float centerX, float centerY, float value, float minVal, float maxVal, float bottomSideValue, float topSideValue);
void DrawHud(float elapsedTime, BlockType bloc);
void PrintText(float x, float y, const std::string& t, float charSizeMultiplier = 1.0f); void PrintText(float x, float y, const std::string& t, float charSizeMultiplier = 1.0f);
void ProcessNotificationQueue(); void ProcessNotificationQueue();
Connector m_conn; Connector m_conn;
Shader m_shader01;
Audio m_audio = Audio(AUDIO_PATH "start.wav");
irrklang::ISound* m_powpow, * m_scream;
irrklang::ISound* m_whoosh[MAX_BULLETS];
Bullet* m_bullets[MAX_BULLETS];
std::chrono::high_resolution_clock::time_point m_startTime;
std::unordered_map<uint64_t, Player*> m_players;
netprot::Buffer m_buf, m_bufout;
netprot::PlayerInfo m_pinfo;
RemotePlayer m_remotePlayer = RemotePlayer(netprot::PlayerInfo(), Vector3f(5.5f, CHUNK_SIZE_Y + 1.8f, 5.5f));
std::string m_messageNotification = "";
World m_world = World();
Player m_player = Player(Vector3f(.5f, CHUNK_SIZE_Y + 1.8f, .5f));
Renderer m_renderer = Renderer();
Booster m_booster = Booster();
BlockInfo* m_blockinfo[BTYPE_LAST]; BlockInfo* m_blockinfo[BTYPE_LAST];
BoostInfo* m_boostinfo[BTYPE_BOOST_LAST]; BoostInfo* m_boostinfo[BTYPE_BOOST_LAST];
GameState m_gamestate = GameState::SPLASH;
Shader m_shader01;
Skybox m_skybox;
TextureAtlas m_textureAtlas = TextureAtlas(BTYPE_LAST); TextureAtlas m_textureAtlas = TextureAtlas(BTYPE_LAST);
TextureAtlas m_animeAtlas = TextureAtlas(TYPE_LAST + POS_LAST); TextureAtlas m_animeAtlas = TextureAtlas(TYPE_LAST + POS_LAST);
World m_world = World(); TextureAtlas::TextureIndex texBoostHeal;
Renderer m_renderer = Renderer();
Booster m_booster = Booster();
Texture m_textureCrosshair; Texture m_textureCrosshair;
Texture m_textureFont; Texture m_textureFont;
Texture m_textureGun; Texture m_textureGun;
Texture m_texturePovGun; Texture m_texturePovGun;
Texture m_textureSkybox; Texture m_textureSkybox;
Texture m_textureSoloMultiMenu;
Texture m_textureSoloText; Texture m_textureMainMenu;
Texture m_textureMultiText; Texture m_textureOptionsMenu;
Texture m_textureTitle; Texture m_texturePauseMenu;
Texture m_textureOptions; Texture m_textureSplashScreen;
Texture m_textureRetour;
Texture m_textureVolume;
Texture m_textureMusique;
Texture m_textureGraphiques;
Texture m_textureSensibilite;
Texture m_textureResolution;
Texture m_texturePrincipal;
Texture m_textureEffets;
Texture m_textureGameplay;
Texture m_textureHd; Texture m_textureHd;
Texture m_textureFhd; Texture m_textureFhd;
Texture m_textureQhd; Texture m_textureQhd;
@ -108,46 +134,32 @@ private:
Texture m_textureCheck; Texture m_textureCheck;
Texture m_textureChecked; Texture m_textureChecked;
TextureAtlas::TextureIndex texBoostHeal; Texture m_textureOptAudio;
Texture m_textureOptBack;
Texture m_textureOptGameplay;
Texture m_textureOptGraphics;
Texture m_textureOptMain;
Texture m_textureOptMusic;
Texture m_textureOptOptions;
Texture m_textureOptResolution;
Texture m_textureOptSensitivity;
Texture m_textureOptSfx;
Skybox m_skybox; Texture m_textureMenuBack;
Audio m_audio = Audio(AUDIO_PATH "start.wav"); Texture m_textureMenuMulti;
Texture m_textureMenuOptions;
Texture m_textureMenuPlay;
Texture m_textureMenuQuit;
Texture m_textureMenuSingle;
Texture m_textureMenuTitle;
irrklang::ISound* m_powpow, Settings m_options = Settings(m_audio);
* m_scream;
irrklang::ISound *m_whoosh[MAX_BULLETS];
Player m_player = Player(Vector3f(.5f, CHUNK_SIZE_Y + 1.8f, .5f));
Settings m_parameters = Settings(m_audio);
Bullet* m_bullets[MAX_BULLETS];
std::unordered_map<uint64_t, Player*> m_players;
netprot::Buffer m_buf, m_bufout;
std::chrono::high_resolution_clock::time_point m_startTime;
//Menu
enum class GameState: uint8_t { MAIN_MENU, OPTIONS, SETTINGS, QUIT, NEWG, PLAY, PAUSE, SINGLEMULTI };
GameState m_gamestate = GameState::MAIN_MENU;
Texture MenuTitleTexture;
Texture MenuBGTexture;
Texture MenuBGFlouTexture;
Texture MenuBGOptionTexture;
Texture MenuStartTexture;
Texture MenuQuitTexture;
Texture MenuOptionsTexture;
Texture PauseBGTexture;
Texture SplachScreenTexture;
Texture MusicTexture; //TODO
Texture OnOffBtnTexture;//TODO
Texture BackBtnTexture;//TODO
Resolution m_resolution = HD; Resolution m_resolution = HD;
float m_splashTime = 2.0f;
float m_scale; float m_scale;
float m_time = 0; float m_time = 0;
float m_time_SplashScreen = 0;
float m_titleX = 0; float m_titleX = 0;
float m_titleY = 0; float m_titleY = 0;
@ -163,10 +175,10 @@ private:
int m_selectedOption = 0; int m_selectedOption = 0;
bool m_selectedPrincipalBar = false; bool m_selectedOptAudioMainBar = false;
bool m_selectedMusiqueBar = false; bool m_selectedOptAudioMusicBar = false;
bool m_selectedEffetsBar = false; bool m_selectedOptAudioSfxBar = false;
bool m_selectedSensibleBar = false; bool m_selectedGameplaySensitivityBar = false;
bool m_damage = false; bool m_damage = false;
@ -181,9 +193,12 @@ private:
bool m_soloMultiChoiceMade = false; bool m_soloMultiChoiceMade = false;
bool m_stopcountdown = false; bool m_stopcountdown = false;
bool m_selectedPlayOptions = false;
bool m_selectedOptions = false;
bool m_selectedQuit = false;
bool m_key1 = false; bool m_key1 = false;
bool m_key2 = false; bool m_key2 = false;
bool m_keyK = false; bool m_keyK = false;
bool m_keyL = false; bool m_keyL = false;
bool m_keyW = false; bool m_keyW = false;
@ -191,19 +206,17 @@ private:
bool m_keyS = false; bool m_keyS = false;
bool m_keyD = false; bool m_keyD = false;
bool m_keySpace = false; bool m_keySpace = false;
bool m_mouseL = false; bool m_mouseL = false;
bool m_mouseR = false; bool m_mouseR = false;
bool m_mouseC = false; bool m_mouseC = false;
bool m_mouseWU = false; bool m_mouseWU = false;
bool m_mouseWD = false; bool m_mouseWD = false;
//Pour trouver ou est la souris
float m_mousemx = 0; float m_mousemx = 0;
float m_mousemy = 0; float m_mousemy = 0;
bool m_networkgame = false; bool m_networkgame = false;
netprot::PlayerInfo m_pinfo;
RemotePlayer m_remotePlayer = RemotePlayer(netprot::PlayerInfo(),Vector3f(5.5f, CHUNK_SIZE_Y + 1.8f, 5.5f));
std::string m_messageNotification = "";
}; };
#endif // ENGINE_H__ #endif // ENGINE_H__

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 KiB

View File

Before

Width:  |  Height:  |  Size: 195 KiB

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB