File: intro.h

package info (click to toggle)
rockdodger 0.9.2-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,220 kB
  • ctags: 756
  • sloc: ansic: 5,374; makefile: 159; sh: 21
file content (49 lines) | stat: -rw-r--r-- 1,379 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef __rockdodger_INTRO_H__
#define __rockdodger_INTRO_H__
#include "scroller.h"

#define NUM_COPPERBARS 6

struct rockintro {
  SDL_Surface *copperbars[NUM_COPPERBARS];
  SDL_Surface *intro_image;
  float positions[NUM_COPPERBARS];
  float speeds[NUM_COPPERBARS];
  Scroller_t *scroller;
};

/*! \brief Initialise the intro.
 *
 * \param target Surface to be painted later on (for witdth, etc.)
 * \return NULL on error or pointer to allocated rockintro structure
 */
struct rockintro *init_intro(SDL_Surface *target);


/*! \brief Do the intro thingy.
 *
 * \param intro Pointer to the intro structure with the current state 
 * \param target SDL_Surface to draw on.
 * \param movementrate Relative speed to 50 fps, see rockdodger_globals.h.
 */
void update_and_draw_intro(struct rockintro *intro, SDL_Surface *target, float movementrate);

/*! Shutdown intro and free data
 *
 * Warning! Do not call on the same structure twice!
 * 
 * \param intro Pointer to the intro structure with the current state
 */
void shutdown_intro(struct rockintro *intro);

/*! \brief Play the whole intro
 *
 * This function will check if a file in the $HOME directory exists in
 * order not to bug the player too much.
 * 
 * \param force if nonzero then always play the intro
 * \param oss_sound_flag if nonzero then play a sound
 */
void play_intro(int force, int oss_sound_flag);

#endif