SDLGameEngine

include/sgestage.h

Go to the documentation of this file.
00001 #ifndef _SGESTAGE_H
00002 #define _SGESTAGE_H
00003 
00004 #ifdef __cplusplus
00005 extern "C" {
00006 #endif
00007 
00012 /*
00013  * Copyright (c) 2007 Heiko Irrgang
00014  *
00015  * The license and distribution terms for this file may be
00016  * found in the file COPYING in this distribution or at
00017  * http://93-interactive.com/cms/products/software/sdl-game-engine/license/
00018  */
00019 
00032 #define ABSOLUTE 0
00033 
00039 #define RELATIVE 1
00040 
00055 #define sgeStageGetSpriteGroup(stage, group) sgeArrayGet(stage->spriteGroups, group)
00056 
00060 typedef struct {
00062         int x;
00064         int y;
00066         int w;
00068         int h;
00070         SGESPRITE *sprite;
00071 } SGELAYER;
00072 
00076 typedef struct {
00078         int cameraX;
00080         int cameraY;
00082         int w;
00084         int h;
00086         SGEARRAY *layers;
00088         SGEARRAY *spriteGroups;
00089 } SGESTAGE;
00090 
00104 SGELAYER *sgeLayerNew(SGESPRITE *sprite);
00105 
00110 void sgeLayerDestroy(SGELAYER *l);
00111 
00122 SGESTAGE *sgeStageNew(int width, int height);
00123 
00128 void sgeStageDestroy(SGESTAGE *s);
00129 
00138 int sgeStageAddLayer(SGESTAGE *s, SGESPRITE *sprite, int x, int y);
00139 
00146 void sgeStageSetLayerHeight(SGESTAGE *s, int layer, int height);
00147 
00154 void sgeStageSetLayerWidth(SGESTAGE *s, int layer, int width);
00155 
00162 void sgeStageDrawLayer(SGESTAGE *s, SDL_Surface *dest, int layer);
00163 
00170 int sgeStageAddSpriteGroup(SGESTAGE *s, SGESPRITEGROUP *g);
00171 
00178 int sgeStageAddSprite(SGESTAGE *s, int spriteGroup, SGESPRITE *sprite);
00179 
00185 void sgeStageDrawSpriteGroup(SGESTAGE *s, int spriteGroup);
00186 
00191 void sgeStageDrawSpriteGroups(SGESTAGE *s);
00192 
00211 int sgeStageSpriteGroupCollideSprite(SGESTAGE *s, int b, SGESPRITE *a, int orientation);
00212 
00222 int sgeStageSpriteGroupCollideSpriteGroup(SGESTAGE *s, int a, int b, int orientationa);
00223 
00244 SGEPOSITION *sgeStageScreenToReal(SGESTAGE *s, int x, int y);
00245 
00246 // }@
00247 
00248 #ifdef __cplusplus
00249 }
00250 #endif
00251 
00252 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines