Cleared out the wiki
-19
@@ -1,19 +0,0 @@
|
||||
_This page was copied from the [Codebase wiki](https://github.com/Ratstail91/Codebase/wiki/Graphics)._
|
||||
|
||||
The graphics systems are designed to be resource-efficient. They're made up of the following files:
|
||||
|
||||
* [surface_manager.hpp](https://github.com/Ratstail91/Codebase/blob/master/graphics/surface_manager.hpp)
|
||||
* [surface_manager.cpp](https://github.com/Ratstail91/Codebase/blob/master/graphics/surface_manager.cpp)
|
||||
* [image.hpp](https://github.com/Ratstail91/Codebase/blob/master/graphics/image.hpp)
|
||||
* [image.cpp](https://github.com/Ratstail91/Codebase/blob/master/graphics/image.cpp)
|
||||
* [sprite_sheet.hpp](https://github.com/Ratstail91/Codebase/blob/master/graphics/sprite_sheet.hpp)
|
||||
* [sprite_sheet.cpp](https://github.com/Ratstail91/Codebase/blob/master/graphics/sprite_sheet.cpp)
|
||||
* [raster_font.hpp](https://github.com/Ratstail91/Codebase/blob/master/graphics/raster_font.hpp)
|
||||
* [raster_font.cpp](https://github.com/Ratstail91/Codebase/blob/master/graphics/raster_font.cpp)
|
||||
|
||||
## Breakdown
|
||||
|
||||
`surface_manager.hpp` and `surface_manager.cpp` hold the `SurfaceManager` class, which loads bitmap files into memory, distributes them throughout the program, and frees them when the resources are no longer needed.
|
||||
`image.hpp` and `image.cpp` hold the `Image` class, which acts as a simple static image on the screen. This class requires that the image file is loaded beforehand, and passed to the `Image` object. It also handles the clipping rectangle and drawing to a specific location.
|
||||
`sprite_sheet.hpp` and `sprite_sheet.cpp` hold the `SpriteSheet` class, which which utilizes `Image`. This class is a specialized image that displays an animated sprite sheet on the screen. In order to display this sprite sheet's animation, the width and height of a single "cell" of animation must be passed to the object alongside the surface. An "interval" must be specified using `SpriteSheet::SetInterval(double)`, and the delta time (time since the last call) must be passed to `SpriteSheet::Update(double)`.
|
||||
`raster_font.hpp` and `raster_font.cpp` hold the `RasterFont` class, which utilizes `Image`. This class is used to draw text to the screen, using a specialized rasterized font surface.
|
||||
+11
-13
@@ -1,6 +1,11 @@
|
||||
Welcome to the Tortuga wiki!
|
||||
|
||||
This guide should help you to understand this project, as well as helping me to plan out the expected features. This project uses C++11, which is available via GNU (or MinGW) 4.7, or Visual Studio 2012. Personally, I'm using MinGW 4.7.2.
|
||||
This guide should help you to understand this project, as well as helping me to plan out the expected features.
|
||||
|
||||
## General
|
||||
|
||||
* This project uses C++11, which is available via GNU (or MinGW) 4.7, or Visual Studio 2012.
|
||||
* (WIP)
|
||||
|
||||
## The Game
|
||||
|
||||
@@ -8,22 +13,15 @@ This guide should help you to understand this project, as well as helping me to
|
||||
|
||||
## The Client
|
||||
|
||||
* [Scene Framework](wiki/Scene-Framework)
|
||||
* [Graphics](wiki/Graphics)
|
||||
* Player System (WIP)
|
||||
* (WIP)
|
||||
|
||||
## The Server
|
||||
|
||||
* Client System (WIP)
|
||||
* (WIP)
|
||||
|
||||
## General
|
||||
|
||||
* Networking System and Protocols (WIP)
|
||||
* Map System (WIP)
|
||||
|
||||
## Libraries
|
||||
|
||||
* [SDL](http://www.libsdl.org/) - Simple DirectMedia Layer API
|
||||
* [SDL_net](http://www.libsdl.org/projects/SDL_net/) - SDL's networking extension; modified source included under libs/SDL_net
|
||||
* [Codebase](https://github.com/Ratstail91/Codebase) - files included locally; modifications will be included upstream further into this project.
|
||||
* [SDL](http://www.libsdl.org/)
|
||||
* [SDL_net](http://www.libsdl.org/projects/SDL_net/)
|
||||
* [Codebase](https://github.com/Ratstail91/Codebase/wiki)
|
||||
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
_This page was copied from the [Codebase wiki](https://github.com/Ratstail91/Codebase/wiki/Scene-Framework)._
|
||||
|
||||
The scene framework is the backbone of the program, utilizing the [strategy pattern](http://en.wikipedia.org/wiki/Strategy_pattern) to control various different logical scenarios found throughout the game (the main menu, the game world, combat scenarios, etc). It consists of the following files:
|
||||
|
||||
* [scene_list.hpp](https://github.com/Ratstail91/Codebase/blob/master/scene-framework/scene_list.hpp)
|
||||
* [base_scene.hpp](https://github.com/Ratstail91/Codebase/blob/master/scene-framework/base_scene.hpp)
|
||||
* [base_scene.cpp](https://github.com/Ratstail91/Codebase/blob/master/scene-framework/base_scene.cpp)
|
||||
* [scene_manager.hpp](https://github.com/Ratstail91/Codebase/blob/master/scene-framework/scene_manager.hpp)
|
||||
* [scene_manager.cpp](https://github.com/Ratstail91/Codebase/blob/master/scene-framework/scene_manager.cpp)
|
||||
* [main.cpp](https://github.com/Ratstail91/Codebase/blob/master/scene-framework/main.cpp)
|
||||
|
||||
## Breakdown
|
||||
|
||||
`main.cpp` simply creates an instance of `SceneManager`, calls it's `Init()`, `Loop()` and `Quit()` functions in order, and handles any fatal exceptions thrown from the rest of the program.
|
||||
`scene_list.hpp` holds an enum class of macros, one for each scene in the game. All scenes in the game should include this file in the *.cpp. The macros `QUIT`, `CONTINUE` and `FIRST` are reserved.
|
||||
`base_scene.hpp` and `base_scene.cpp` hold the interface of the strategy pattern i.e. all scenes in the game MUST inherit from the `BaseScene` class. This class handles the game's screen (which is a static member) and the player's input (via SDL).
|
||||
`scene_manager.hpp` and `scene_manager.cpp` hold the `SceneManager` class, which initializes and deinitializes the game client, and handles the transition between scenes in the strategy pattern.
|
||||
|
||||
## Instructions
|
||||
|
||||
To add a new scene to the game, create a class that inherits from `BaseScene`, overriding any or all of it's members. Then, include the class's header into `scene_manager.cpp` where it's [indicated](https://github.com/Ratstail91/Codebase/blob/master/scene-framework/scene_manager.cpp#L30). Finally, add a new macro for your scene to `scene_list.hpp`, and modify `SceneManager::LoadScene(SceneIndex)` to include that macro and your scene's constructor.
|
||||
Here's an example, using a class called `NewScene`:
|
||||
|
||||
```c++
|
||||
void SceneManager::LoadScene(SceneList sceneIndex) {
|
||||
UnloadScene();
|
||||
|
||||
switch(sceneIndex) {
|
||||
//add scene creation calls here
|
||||
case SceneList::FIRST: //use this to indicate the first scene created
|
||||
case SceneList::NEWSCENE: //the macro
|
||||
activeScene = new NewScene(); //the creation of a scene
|
||||
break;
|
||||
|
||||
default:
|
||||
throw(std::logic_error("Failed to recognize the scene index"));
|
||||
}
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user