diff --git a/client/client_application.cpp b/client/client_application.cpp index 0b215ca..37006eb 100644 --- a/client/client_application.cpp +++ b/client/client_application.cpp @@ -35,7 +35,12 @@ ClientApplication ClientApplication::instance; //------------------------- //Add the custom scene headers here -#include "editor_scene.hpp" +#include "splash_screen.hpp" +#include "main_menu.hpp" +#include "options_menu.hpp" +#include "lobby_menu.hpp" +#include "in_world.hpp" +#include "in_combat.hpp" //------------------------- //Public access members @@ -108,8 +113,23 @@ void ClientApplication::LoadScene(SceneList sceneIndex) { switch(sceneIndex) { //add scene creation calls here case SceneList::FIRST: - case SceneList::EDITORSCENE: - activeScene = new EditorScene(); + case SceneList::SPLASHSCREEN: + activeScene = new SplashScreen(); + break; + case SceneList::MAINMENU: + activeScene = new MainMenu(); + break; + case SceneList::OPTIONSMENU: + activeScene = new OptionsMenu(); + break; + case SceneList::LOBBYMENU: + activeScene = new LobbyMenu(); + break; + case SceneList::INWORLD: + activeScene = new InWorld(); + break; + case SceneList::INCOMBAT: + activeScene = new InCombat(); break; default: diff --git a/client/in_combat.cpp b/client/in_combat.cpp new file mode 100644 index 0000000..1d70713 --- /dev/null +++ b/client/in_combat.cpp @@ -0,0 +1,82 @@ +/* Copyright: (c) Kayne Ruse 2013 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#include "in_combat.hpp" + +//------------------------- +//Public access members +//------------------------- + +InCombat::InCombat() { + // +} + +InCombat::~InCombat() { + // +} + +//------------------------- +//Frame loop +//------------------------- + +void InCombat::FrameStart() { + // +} + +void InCombat::Update(double delta) { + // +} + +void InCombat::FrameEnd() { + // +} + +void InCombat::Render(SDL_Surface* const screen) { + // +} + +//------------------------- +//Event handlers +//------------------------- + +void InCombat::MouseMotion(SDL_MouseMotionEvent const& motion) { + // +} + +void InCombat::MouseButtonDown(SDL_MouseButtonEvent const& button) { + // +} + +void InCombat::MouseButtonUp(SDL_MouseButtonEvent const& button) { + // +} + +void InCombat::KeyDown(SDL_KeyboardEvent const& key) { + switch(key.keysym.sym) { + case SDLK_ESCAPE: + QuitEvent(); + break; + } +} + +void InCombat::KeyUp(SDL_KeyboardEvent const& key) { + // +} diff --git a/client/editor_scene.hpp b/client/in_combat.hpp similarity index 91% rename from client/editor_scene.hpp rename to client/in_combat.hpp index 38ca16c..b08a53d 100644 --- a/client/editor_scene.hpp +++ b/client/in_combat.hpp @@ -19,16 +19,16 @@ * 3. This notice may not be removed or altered from any source * distribution. */ -#ifndef EDITORSCENE_HPP_ -#define EDITORSCENE_HPP_ +#ifndef INCOMBAT_HPP_ +#define INCOMBAT_HPP_ #include "base_scene.hpp" -class EditorScene : public BaseScene { +class InCombat : public BaseScene { public: //Public access members - EditorScene(); - ~EditorScene(); + InCombat(); + ~InCombat(); protected: //Frame loop diff --git a/client/in_world.cpp b/client/in_world.cpp new file mode 100644 index 0000000..38a4a32 --- /dev/null +++ b/client/in_world.cpp @@ -0,0 +1,82 @@ +/* Copyright: (c) Kayne Ruse 2013 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#include "in_world.hpp" + +//------------------------- +//Public access members +//------------------------- + +InWorld::InWorld() { + // +} + +InWorld::~InWorld() { + // +} + +//------------------------- +//Frame loop +//------------------------- + +void InWorld::FrameStart() { + // +} + +void InWorld::Update(double delta) { + // +} + +void InWorld::FrameEnd() { + // +} + +void InWorld::Render(SDL_Surface* const screen) { + // +} + +//------------------------- +//Event handlers +//------------------------- + +void InWorld::MouseMotion(SDL_MouseMotionEvent const& motion) { + // +} + +void InWorld::MouseButtonDown(SDL_MouseButtonEvent const& button) { + // +} + +void InWorld::MouseButtonUp(SDL_MouseButtonEvent const& button) { + // +} + +void InWorld::KeyDown(SDL_KeyboardEvent const& key) { + switch(key.keysym.sym) { + case SDLK_ESCAPE: + QuitEvent(); + break; + } +} + +void InWorld::KeyUp(SDL_KeyboardEvent const& key) { + // +} diff --git a/client/in_world.hpp b/client/in_world.hpp new file mode 100644 index 0000000..6763db7 --- /dev/null +++ b/client/in_world.hpp @@ -0,0 +1,48 @@ +/* Copyright: (c) Kayne Ruse 2013 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#ifndef INWORLD_HPP_ +#define INWORLD_HPP_ + +#include "base_scene.hpp" + +class InWorld : public BaseScene { +public: + //Public access members + InWorld(); + ~InWorld(); + +protected: + //Frame loop + void FrameStart(); + void Update(double delta); + void FrameEnd(); + void Render(SDL_Surface* const); + + //Event handlers + void MouseMotion(SDL_MouseMotionEvent const&); + void MouseButtonDown(SDL_MouseButtonEvent const&); + void MouseButtonUp(SDL_MouseButtonEvent const&); + void KeyDown(SDL_KeyboardEvent const&); + void KeyUp(SDL_KeyboardEvent const&); +}; + +#endif diff --git a/client/lobby_menu.cpp b/client/lobby_menu.cpp new file mode 100644 index 0000000..6bb7805 --- /dev/null +++ b/client/lobby_menu.cpp @@ -0,0 +1,82 @@ +/* Copyright: (c) Kayne Ruse 2013 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#include "lobby_menu.hpp" + +//------------------------- +//Public access members +//------------------------- + +LobbyMenu::LobbyMenu() { + // +} + +LobbyMenu::~LobbyMenu() { + // +} + +//------------------------- +//Frame loop +//------------------------- + +void LobbyMenu::FrameStart() { + // +} + +void LobbyMenu::Update(double delta) { + // +} + +void LobbyMenu::FrameEnd() { + // +} + +void LobbyMenu::Render(SDL_Surface* const screen) { + // +} + +//------------------------- +//Event handlers +//------------------------- + +void LobbyMenu::MouseMotion(SDL_MouseMotionEvent const& motion) { + // +} + +void LobbyMenu::MouseButtonDown(SDL_MouseButtonEvent const& button) { + // +} + +void LobbyMenu::MouseButtonUp(SDL_MouseButtonEvent const& button) { + // +} + +void LobbyMenu::KeyDown(SDL_KeyboardEvent const& key) { + switch(key.keysym.sym) { + case SDLK_ESCAPE: + QuitEvent(); + break; + } +} + +void LobbyMenu::KeyUp(SDL_KeyboardEvent const& key) { + // +} diff --git a/client/lobby_menu.hpp b/client/lobby_menu.hpp new file mode 100644 index 0000000..bc3393c --- /dev/null +++ b/client/lobby_menu.hpp @@ -0,0 +1,48 @@ +/* Copyright: (c) Kayne Ruse 2013 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#ifndef LOBBYMENU_HPP_ +#define LOBBYMENU_HPP_ + +#include "base_scene.hpp" + +class LobbyMenu : public BaseScene { +public: + //Public access members + LobbyMenu(); + ~LobbyMenu(); + +protected: + //Frame loop + void FrameStart(); + void Update(double delta); + void FrameEnd(); + void Render(SDL_Surface* const); + + //Event handlers + void MouseMotion(SDL_MouseMotionEvent const&); + void MouseButtonDown(SDL_MouseButtonEvent const&); + void MouseButtonUp(SDL_MouseButtonEvent const&); + void KeyDown(SDL_KeyboardEvent const&); + void KeyUp(SDL_KeyboardEvent const&); +}; + +#endif diff --git a/client/main_menu.cpp b/client/main_menu.cpp new file mode 100644 index 0000000..ebf0dea --- /dev/null +++ b/client/main_menu.cpp @@ -0,0 +1,82 @@ +/* Copyright: (c) Kayne Ruse 2013 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#include "main_menu.hpp" + +//------------------------- +//Public access members +//------------------------- + +MainMenu::MainMenu() { + // +} + +MainMenu::~MainMenu() { + // +} + +//------------------------- +//Frame loop +//------------------------- + +void MainMenu::FrameStart() { + // +} + +void MainMenu::Update(double delta) { + // +} + +void MainMenu::FrameEnd() { + // +} + +void MainMenu::Render(SDL_Surface* const screen) { + // +} + +//------------------------- +//Event handlers +//------------------------- + +void MainMenu::MouseMotion(SDL_MouseMotionEvent const& motion) { + // +} + +void MainMenu::MouseButtonDown(SDL_MouseButtonEvent const& button) { + // +} + +void MainMenu::MouseButtonUp(SDL_MouseButtonEvent const& button) { + // +} + +void MainMenu::KeyDown(SDL_KeyboardEvent const& key) { + switch(key.keysym.sym) { + case SDLK_ESCAPE: + QuitEvent(); + break; + } +} + +void MainMenu::KeyUp(SDL_KeyboardEvent const& key) { + // +} diff --git a/client/main_menu.hpp b/client/main_menu.hpp new file mode 100644 index 0000000..02db7b1 --- /dev/null +++ b/client/main_menu.hpp @@ -0,0 +1,48 @@ +/* Copyright: (c) Kayne Ruse 2013 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#ifndef MAINMENU_HPP_ +#define MAINMENU_HPP_ + +#include "base_scene.hpp" + +class MainMenu : public BaseScene { +public: + //Public access members + MainMenu(); + ~MainMenu(); + +protected: + //Frame loop + void FrameStart(); + void Update(double delta); + void FrameEnd(); + void Render(SDL_Surface* const); + + //Event handlers + void MouseMotion(SDL_MouseMotionEvent const&); + void MouseButtonDown(SDL_MouseButtonEvent const&); + void MouseButtonUp(SDL_MouseButtonEvent const&); + void KeyDown(SDL_KeyboardEvent const&); + void KeyUp(SDL_KeyboardEvent const&); +}; + +#endif diff --git a/client/editor_scene.cpp b/client/options_menu.cpp similarity index 70% rename from client/editor_scene.cpp rename to client/options_menu.cpp index 53bfd65..c41a954 100644 --- a/client/editor_scene.cpp +++ b/client/options_menu.cpp @@ -19,17 +19,17 @@ * 3. This notice may not be removed or altered from any source * distribution. */ -#include "editor_scene.hpp" +#include "options_menu.hpp" //------------------------- //Public access members //------------------------- -EditorScene::EditorScene() { +OptionsMenu::OptionsMenu() { // } -EditorScene::~EditorScene() { +OptionsMenu::~OptionsMenu() { // } @@ -37,19 +37,19 @@ EditorScene::~EditorScene() { //Frame loop //------------------------- -void EditorScene::FrameStart() { +void OptionsMenu::FrameStart() { // } -void EditorScene::Update(double delta) { +void OptionsMenu::Update(double delta) { // } -void EditorScene::FrameEnd() { +void OptionsMenu::FrameEnd() { // } -void EditorScene::Render(SDL_Surface* const screen) { +void OptionsMenu::Render(SDL_Surface* const screen) { // } @@ -57,19 +57,19 @@ void EditorScene::Render(SDL_Surface* const screen) { //Event handlers //------------------------- -void EditorScene::MouseMotion(SDL_MouseMotionEvent const& motion) { +void OptionsMenu::MouseMotion(SDL_MouseMotionEvent const& motion) { // } -void EditorScene::MouseButtonDown(SDL_MouseButtonEvent const& button) { +void OptionsMenu::MouseButtonDown(SDL_MouseButtonEvent const& button) { // } -void EditorScene::MouseButtonUp(SDL_MouseButtonEvent const& button) { +void OptionsMenu::MouseButtonUp(SDL_MouseButtonEvent const& button) { // } -void EditorScene::KeyDown(SDL_KeyboardEvent const& key) { +void OptionsMenu::KeyDown(SDL_KeyboardEvent const& key) { switch(key.keysym.sym) { case SDLK_ESCAPE: QuitEvent(); @@ -77,6 +77,6 @@ void EditorScene::KeyDown(SDL_KeyboardEvent const& key) { } } -void EditorScene::KeyUp(SDL_KeyboardEvent const& key) { +void OptionsMenu::KeyUp(SDL_KeyboardEvent const& key) { // } diff --git a/client/options_menu.hpp b/client/options_menu.hpp new file mode 100644 index 0000000..39fba41 --- /dev/null +++ b/client/options_menu.hpp @@ -0,0 +1,48 @@ +/* Copyright: (c) Kayne Ruse 2013 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#ifndef OPTIONSMENU_HPP_ +#define OPTIONSMENU_HPP_ + +#include "base_scene.hpp" + +class OptionsMenu : public BaseScene { +public: + //Public access members + OptionsMenu(); + ~OptionsMenu(); + +protected: + //Frame loop + void FrameStart(); + void Update(double delta); + void FrameEnd(); + void Render(SDL_Surface* const); + + //Event handlers + void MouseMotion(SDL_MouseMotionEvent const&); + void MouseButtonDown(SDL_MouseButtonEvent const&); + void MouseButtonUp(SDL_MouseButtonEvent const&); + void KeyDown(SDL_KeyboardEvent const&); + void KeyUp(SDL_KeyboardEvent const&); +}; + +#endif diff --git a/client/scene_list.hpp b/client/scene_list.hpp index b3eb4dd..2953289 100644 --- a/client/scene_list.hpp +++ b/client/scene_list.hpp @@ -29,7 +29,12 @@ enum class SceneList { FIRST, //custom indexes - EDITORSCENE, + SPLASHSCREEN, + MAINMENU, + OPTIONSMENU, + LOBBYMENU, + INWORLD, + INCOMBAT, }; #endif diff --git a/client/splash_screen.cpp b/client/splash_screen.cpp new file mode 100644 index 0000000..97c64d0 --- /dev/null +++ b/client/splash_screen.cpp @@ -0,0 +1,82 @@ +/* Copyright: (c) Kayne Ruse 2013 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#include "splash_screen.hpp" + +//------------------------- +//Public access members +//------------------------- + +SplashScreen::SplashScreen() { + // +} + +SplashScreen::~SplashScreen() { + // +} + +//------------------------- +//Frame loop +//------------------------- + +void SplashScreen::FrameStart() { + // +} + +void SplashScreen::Update(double delta) { + // +} + +void SplashScreen::FrameEnd() { + // +} + +void SplashScreen::Render(SDL_Surface* const screen) { + // +} + +//------------------------- +//Event handlers +//------------------------- + +void SplashScreen::MouseMotion(SDL_MouseMotionEvent const& motion) { + // +} + +void SplashScreen::MouseButtonDown(SDL_MouseButtonEvent const& button) { + // +} + +void SplashScreen::MouseButtonUp(SDL_MouseButtonEvent const& button) { + // +} + +void SplashScreen::KeyDown(SDL_KeyboardEvent const& key) { + switch(key.keysym.sym) { + case SDLK_ESCAPE: + QuitEvent(); + break; + } +} + +void SplashScreen::KeyUp(SDL_KeyboardEvent const& key) { + // +} diff --git a/client/splash_screen.hpp b/client/splash_screen.hpp new file mode 100644 index 0000000..f5ce0c8 --- /dev/null +++ b/client/splash_screen.hpp @@ -0,0 +1,48 @@ +/* Copyright: (c) Kayne Ruse 2013 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#ifndef SPLASHSCREEN_HPP_ +#define SPLASHSCREEN_HPP_ + +#include "base_scene.hpp" + +class SplashScreen : public BaseScene { +public: + //Public access members + SplashScreen(); + ~SplashScreen(); + +protected: + //Frame loop + void FrameStart(); + void Update(double delta); + void FrameEnd(); + void Render(SDL_Surface* const); + + //Event handlers + void MouseMotion(SDL_MouseMotionEvent const&); + void MouseButtonDown(SDL_MouseButtonEvent const&); + void MouseButtonUp(SDL_MouseButtonEvent const&); + void KeyDown(SDL_KeyboardEvent const&); + void KeyUp(SDL_KeyboardEvent const&); +}; + +#endif