Super Derpy: Muffin Attack
 All Classes Files Functions Variables Enumerations Macros
Classes | Macros | Enumerations | Functions
main.h File Reference

Headers of main file of SuperDerpy engine. More...

#include <allegro5/allegro.h>
#include <allegro5/allegro_audio.h>
#include <allegro5/allegro_acodec.h>
#include <allegro5/allegro_image.h>
#include <allegro5/allegro_font.h>
#include <allegro5/allegro_ttf.h>
#include "allegro_utils.h"

Go to the source code of this file.

Classes

struct  Moonwalk
 Resources used by moonwalk level placeholder. More...
struct  Obstacle
 Structure representing obstacles and power-ups flying through the level. More...
struct  Spritesheet
 Structure representing one spritesheet animation of Derpy. More...
struct  Level
 Resources used by Level state. More...
struct  Menu
 Resources used by Menu state. More...
struct  Loading
 Resources used by Loading state. More...
struct  Pause
 Resources used by Pause state. More...
struct  About
 Resources used by About state. More...
struct  Map
 Resources used by Map state. More...
struct  Intro
 Resources used by Intro state. More...
struct  Game
 Resources used by Game state. More...

Macros

#define PROGRESS_INIT(a)   float load_p = 0, load_a = a;
 Declares variables used by displaying progress bar on loading screen. Takes number of loading steps as parameter.
#define PROGRESS   if (progress) (*progress)(game, load_p+=1/load_a);
 Increments progress of loading.

Enumerations

enum  gamestate_enum {
  GAMESTATE_PAUSE, GAMESTATE_LOADING, GAMESTATE_MENU, GAMESTATE_ABOUT,
  GAMESTATE_INTRO, GAMESTATE_MAP, GAMESTATE_LEVEL, GAMESTATE_DISCLAIMER
}
 Enum of all available gamestates.
enum  menustate_enum {
  MENUSTATE_MAIN, MENUSTATE_OPTIONS, MENUSTATE_CONTROLS, MENUSTATE_VIDEO,
  MENUSTATE_PAUSE, MENUSTATE_AUDIO
}
 Enum of menu states in Menu and Pause game states.

Functions

void PreloadGameState (struct Game *game, void(*progress)(struct Game *, float))
 Preloads gamestate set in game->loadstate.
void UnloadGameState (struct Game *game)
 Unloads gamestate set in game->gamestate.
void LoadGameState (struct Game *game)
 Loads gamestate set in game->loadstate.
void PrintConsole (struct Game *game, char *format,...)
 Print some message on game console.
void DrawConsole (struct Game *game)
 Draws console bitmap on screen.
ALLEGRO_BITMAP * LoadScaledBitmap (char *filename, int width, int height)
 Loads bitmap into memory and scales it with software linear filtering.
float tps (struct Game *game, float t)
 Draws console bitmap on screen.
void DrawGameState (struct Game *game)
 Draws frame from current gamestate.
int Shared_Load (struct Game *game)
 Load shared resources.
void Shared_Unload (struct Game *game)
 Unload shared resources.

Detailed Description

Headers of main file of SuperDerpy engine.

Contains basic functions shared by all views.


Function Documentation

void PrintConsole ( struct Game game,
char *  format,
  ... 
)

Print some message on game console.

Draws message on console bitmap, so it'll be displayed when calling DrawConsole. If game->debug is true, then it also prints given message on stdout. It needs to be called in printf style.