Compare commits
87 Commits
SQC32_sauv
...
MenusMenus
Author | SHA1 | Date | |
---|---|---|---|
|
754130ec39 | ||
|
8569e17c93 | ||
|
c5700ae9fd | ||
|
78b3ed85cb | ||
|
4b6c641c97 | ||
|
9ed8ef3273 | ||
|
8b448f5072 | ||
|
a67499049b | ||
|
0af76b3f2e | ||
|
b2c73c930e | ||
|
4aa0aedd61 | ||
|
e52dbd3705 | ||
|
5a491c5446 | ||
|
20eb410b08 | ||
|
c44d1453ae | ||
|
37ea09aaf3 | ||
|
62b7719eb4 | ||
|
3842ca3485 | ||
|
98390c878f | ||
|
def1ab284e | ||
|
90e736a14c | ||
|
ac3628ec0b | ||
|
3e3a7650e8 | ||
|
28082a018d | ||
|
681ac61a74 | ||
|
38cfa95297 | ||
|
34ad4724f2 | ||
|
12ef911e79 | ||
|
5c346c48e6 | ||
|
e89b5914fb | ||
|
15882dc506 | ||
|
6db90a3a16 | ||
|
b23b2c6838 | ||
|
a26929fe66 | ||
|
10b8d77734 | ||
|
e8ca08ecab | ||
|
e330f5dd67 | ||
|
2f5579875e | ||
|
114c1631a8 | ||
|
cfc7f7e01d | ||
|
0b5c30b693 | ||
|
f9c3571ab2 | ||
|
2a7fe7e806 | ||
|
8ea5af6ef9 | ||
|
841b0176f6 | ||
|
702a65c5b0 | ||
|
b6d5975648 | ||
|
6e556b4f84 | ||
|
e6b3f2fb1c | ||
|
5e57a13820 | ||
|
9a7d25c1d9 | ||
|
c24123362a | ||
|
6c0d65ea22 | ||
|
9bb8b1c9e5 | ||
|
35a5ddd9bd | ||
|
85ab712032 | ||
|
0f1a864282 | ||
|
0200f77be8 | ||
|
935216e9c3 | ||
|
ea3d2ffc34 | ||
|
775c8cf26f | ||
|
0c1714dd14 | ||
|
981d66c730 | ||
|
bd3f677118 | ||
|
35c55f2e26 | ||
|
9bf5188e0f | ||
|
e8d456cc09 | ||
|
3043b1ff6b | ||
|
7ccecdfd4a | ||
|
6f13e8fb70 | ||
|
d1c3d17055 | ||
|
573316682b | ||
|
bd14cd3962 | ||
|
480521ebaf | ||
|
312542857a | ||
|
c1aa321f2b | ||
|
d7bd36d134 | ||
|
ce2d03c354 | ||
|
2e30995f1b | ||
|
9572a7d6fd | ||
|
f22c405915 | ||
|
bc7127ef7d | ||
|
06a5bb67d3 | ||
|
83e438583f | ||
|
75a32270b5 | ||
|
3ca941f0ce | ||
|
4c695fbe47 |
@@ -9,6 +9,10 @@ Chunk::Chunk(unsigned int x, unsigned int y, int64_t seed) : m_posX(x), m_posY(y
|
||||
//if (input.fail()) {
|
||||
OpenSimplexNoise::Noise simplex = OpenSimplexNoise::Noise(seed);
|
||||
m_blocks.Reset(BTYPE_AIR);
|
||||
int ratio = 0;
|
||||
|
||||
ratio = x * y % 7;
|
||||
|
||||
|
||||
for (int ix = 0; ix < CHUNK_SIZE_X; ++ix) // Montagnes
|
||||
for (int iz = 0; iz < CHUNK_SIZE_Z; ++iz) {
|
||||
@@ -47,8 +51,8 @@ Chunk::Chunk(unsigned int x, unsigned int y, int64_t seed) : m_posX(x), m_posY(y
|
||||
}
|
||||
}
|
||||
|
||||
int rnd = rand() % 15;
|
||||
if (rnd == 4)
|
||||
//int rnd = rand() % 15;
|
||||
if (ratio == 1)
|
||||
for (int ix = 0; ix < CHUNK_SIZE_X; ++ix) // structure
|
||||
for (int iz = 0; iz < CHUNK_SIZE_Z; ++iz) {
|
||||
for (int iy = 0; iy < 14; ++iy) {
|
||||
@@ -57,16 +61,16 @@ Chunk::Chunk(unsigned int x, unsigned int y, int64_t seed) : m_posX(x), m_posY(y
|
||||
Structure(ix, iy, iz, 2);
|
||||
}
|
||||
}
|
||||
if (rnd == 3)
|
||||
if (ratio == 3)
|
||||
for (int ix = 0; ix < CHUNK_SIZE_Z; ++ix) // structure
|
||||
for (int iz = 0; iz < CHUNK_SIZE_X; ++iz) {
|
||||
for (int iy = 0; iy < 14; ++iy) {
|
||||
if (iz == 4)
|
||||
if (GetBlock(ix, iy, iz) == BTYPE_AIR)
|
||||
Structure(ix, iy, iz, 2);
|
||||
Structure(ix, iy, iz, 1);
|
||||
}
|
||||
}
|
||||
if (rnd == 6)
|
||||
if (ratio == 5)
|
||||
for (int ix = 0; ix < CHUNK_SIZE_X; ++ix) // structure
|
||||
for (int iz = 0; iz < CHUNK_SIZE_Z; ++iz) {
|
||||
for (int iy = 0; iy < 14; ++iy) {
|
||||
|
@@ -45,13 +45,6 @@ enum ANIM_TYPE { STILL = 0, SHOOTING = 8, JUMPING = 16, JUMPINGSHOOTING = 24, DE
|
||||
enum ANIM_POS {FRONT, QUARTER_FRONT_LEFT, QUATER_FRONT_RIGHT, PROFIL_LEFT, PROFIL_RIGHT, QUARTER_BACK_LEFT, QUARTER_BACK_RIGHT, BACK , POS_LAST};
|
||||
typedef uint64_t Timestamp;
|
||||
|
||||
enum Resolution {
|
||||
HD = 0, // 1280x720 (High Definition)
|
||||
FHD, // 1920x1080 (Full HD)
|
||||
QHD, // 2560x1440 (Quad HD)
|
||||
UHD // 3840x2160 (Ultra HD)
|
||||
};
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#pragma comment(lib,"wsock32.lib") // Pour pouvoir faire fonctionner le linker sans le vcxproject
|
||||
|
@@ -34,7 +34,22 @@
|
||||
#define SHADER_PATH "./media/shaders/"
|
||||
#define AUDIO_PATH "./media/audio/"
|
||||
#define CHUNK_PATH "./media/chunks/"
|
||||
#define MENU_ITEM_PATH "./media/menu_items/"
|
||||
#define BOOSTER_TEXTURE_PATH "./media/textures/Booster/"
|
||||
|
||||
enum GameState {
|
||||
MAIN_MENU,
|
||||
SPLASH,
|
||||
OPTIONS,
|
||||
QUIT,
|
||||
PLAY,
|
||||
PAUSE
|
||||
};
|
||||
|
||||
enum Resolution {
|
||||
HD = 0, // 1280x720 (High Definition)
|
||||
FHD, // 1920x1080 (Full HD)
|
||||
QHD, // 2560x1440 (Quad HD)
|
||||
UHD // 3840x2160 (Ultra HD)
|
||||
};
|
||||
|
||||
#endif // DEFINE_H__
|
||||
|
@@ -30,9 +30,6 @@ class Engine : public OpenglContext {
|
||||
public:
|
||||
Engine();
|
||||
virtual ~Engine();
|
||||
virtual void DrawMenu();
|
||||
virtual void DrawPause();
|
||||
virtual void DrawSplachScreen();
|
||||
virtual void Init();
|
||||
virtual void DeInit();
|
||||
virtual void LoadResource();
|
||||
@@ -47,77 +44,122 @@ public:
|
||||
private:
|
||||
int GetFps(float elapsedTime) const;
|
||||
int GetCountdown(float elapsedTime);
|
||||
int GetOptionsChoice();
|
||||
|
||||
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 DisplayInfo(float elapsedTime, BlockType bloc);
|
||||
|
||||
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 DisplayGraphicsMenu(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 DisplayBarPercentValue(float centerX, float centerY, float posX, float posY, float minVal, float maxVal, float value);
|
||||
void DrawSlider(float centerX, float centerY, float value, float minVal, float maxVal, float bottomSideValue, float topSideValue);
|
||||
|
||||
|
||||
void PrintText(float x, float y, const std::string& t, float charSizeMultiplier = 1.0f);
|
||||
void ProcessNotificationQueue();
|
||||
|
||||
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];
|
||||
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_animeAtlas = TextureAtlas(TYPE_LAST + POS_LAST);
|
||||
|
||||
World m_world = World();
|
||||
Renderer m_renderer = Renderer();
|
||||
Booster m_booster = Booster();
|
||||
TextureAtlas::TextureIndex texBoostHeal;
|
||||
|
||||
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;
|
||||
|
||||
TextureAtlas::TextureIndex texBoostHeal;
|
||||
Texture m_textureMainMenu;
|
||||
Texture m_textureOptionsMenu;
|
||||
Texture m_texturePauseMenu;
|
||||
Texture m_textureSplashScreen;
|
||||
|
||||
Skybox m_skybox;
|
||||
Audio m_audio = Audio(AUDIO_PATH "start.wav");
|
||||
Texture m_textureHd;
|
||||
Texture m_textureFhd;
|
||||
Texture m_textureQhd;
|
||||
Texture m_textureUhd;
|
||||
Texture m_textureCheck;
|
||||
Texture m_textureChecked;
|
||||
|
||||
irrklang::ISound* m_powpow,
|
||||
* m_scream;
|
||||
irrklang::ISound *m_whoosh[MAX_BULLETS];
|
||||
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;
|
||||
|
||||
Player m_player = Player(Vector3f(.5f, CHUNK_SIZE_Y + 1.8f, .5f));
|
||||
Settings m_parameters = Settings(m_audio);
|
||||
Texture m_textureMenuBack;
|
||||
Texture m_textureMenuMulti;
|
||||
Texture m_textureMenuOptions;
|
||||
Texture m_textureMenuPlay;
|
||||
Texture m_textureMenuQuit;
|
||||
Texture m_textureMenuSingle;
|
||||
Texture m_textureMenuTitle;
|
||||
|
||||
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, QUIT, NEWG, PLAY, PAUSE };
|
||||
GameState m_gamestate = GameState::MAIN_MENU;
|
||||
Texture MenuTitleTexture;
|
||||
Texture MenuBGTexture;
|
||||
Texture MenuStartTexture;
|
||||
Texture MenuQuitTexture;
|
||||
Texture MenuOptionsTexture;
|
||||
Texture PauseBGTexture;
|
||||
Texture SplachScreenTexture;
|
||||
Settings m_options = Settings(m_audio);
|
||||
|
||||
Resolution m_resolution = HD;
|
||||
|
||||
float m_splashTime = 2.0f;
|
||||
float m_scale;
|
||||
float m_time = 0;
|
||||
float m_time_SplashScreen = 0;
|
||||
float m_titleX = 0;
|
||||
float m_titleY = 0;
|
||||
|
||||
@@ -126,6 +168,18 @@ private:
|
||||
int m_nbReductionChunk = 4;
|
||||
int m_timerReductionChunk = 30;
|
||||
|
||||
float m_volPrincipal = 0.0f;
|
||||
float m_volMusique = 0.0f;
|
||||
float m_volEffets = 0.0f;
|
||||
float m_volSensible = 0.0f;
|
||||
|
||||
int m_selectedOption = 0;
|
||||
|
||||
bool m_selectedOptAudioMainBar = false;
|
||||
bool m_selectedOptAudioMusicBar = false;
|
||||
bool m_selectedOptAudioSfxBar = false;
|
||||
bool m_selectedGameplaySensitivityBar = false;
|
||||
|
||||
bool m_damage = false;
|
||||
|
||||
bool m_wireframe = false;
|
||||
@@ -139,9 +193,12 @@ private:
|
||||
bool m_soloMultiChoiceMade = false;
|
||||
bool m_stopcountdown = false;
|
||||
|
||||
bool m_selectedPlayOptions = false;
|
||||
bool m_selectedOptions = false;
|
||||
bool m_selectedQuit = false;
|
||||
|
||||
bool m_key1 = false;
|
||||
bool m_key2 = false;
|
||||
|
||||
bool m_keyK = false;
|
||||
bool m_keyL = false;
|
||||
bool m_keyW = false;
|
||||
@@ -149,19 +206,17 @@ private:
|
||||
bool m_keyS = false;
|
||||
bool m_keyD = false;
|
||||
bool m_keySpace = false;
|
||||
|
||||
bool m_mouseL = false;
|
||||
bool m_mouseR = false;
|
||||
bool m_mouseC = false;
|
||||
bool m_mouseWU = false;
|
||||
bool m_mouseWD = false;
|
||||
//Pour trouver ou est la souris
|
||||
|
||||
float m_mousemx = 0;
|
||||
float m_mousemy = 0;
|
||||
|
||||
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__
|
||||
|
Before Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 6.5 MiB |
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
BIN
SQCSim2021/media/textures/menus/backgrounds/bgOptions.png
Normal file
After Width: | Height: | Size: 674 KiB |
BIN
SQCSim2021/media/textures/menus/backgrounds/bgPause.png
Normal file
After Width: | Height: | Size: 562 KiB |
Before Width: | Height: | Size: 195 KiB After Width: | Height: | Size: 195 KiB |
BIN
SQCSim2021/media/textures/menus/buttons/main/mainBack.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
SQCSim2021/media/textures/menus/buttons/main/mainMulti.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
SQCSim2021/media/textures/menus/buttons/main/mainOptions.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
SQCSim2021/media/textures/menus/buttons/main/mainPlay.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
SQCSim2021/media/textures/menus/buttons/main/mainQuit.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
SQCSim2021/media/textures/menus/buttons/main/mainSingle.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
SQCSim2021/media/textures/menus/buttons/options/optAudio.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
SQCSim2021/media/textures/menus/buttons/options/optBack.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
SQCSim2021/media/textures/menus/buttons/options/optGameplay.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
SQCSim2021/media/textures/menus/buttons/options/optGraphics.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
SQCSim2021/media/textures/menus/buttons/options/optMain.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
SQCSim2021/media/textures/menus/buttons/options/optMusic.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
SQCSim2021/media/textures/menus/buttons/options/optOptions.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 12 KiB |
BIN
SQCSim2021/media/textures/menus/buttons/options/optSfx.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
SQCSim2021/media/textures/menus/labels/labelFhd.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
SQCSim2021/media/textures/menus/labels/labelHd.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
SQCSim2021/media/textures/menus/labels/labelQhd.png
Normal file
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
BIN
SQCSim2021/media/textures/menus/labels/labelUhd.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
SQCSim2021/media/textures/menus/others/check.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
SQCSim2021/media/textures/menus/others/checked.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.1 KiB |