source: abuse/tags/pd/macabuse/inc/demo.hpp

Last change on this file was 49, checked in by Sam Hocevar, 11 years ago
  • Imported original public domain release, for future reference.
File size: 994 bytes
Line 
1#ifndef __DEMO_HPP_
2#define __DEMO_HPP_
3
4#include "jwindow.hpp"
5
6class demo_manager
7{
8  void *initial_difficulty;
9  bFILE *record_file;
10  int skip_next;
11
12  public :
13  enum demo_state { NORMAL,
14                    RECORDING,
15                    PLAYING    } state;
16  int set_state(demo_state new_state, char *filename=NULL);
17  demo_state current_state() { return state; }
18  int save_packet(void *packet, int packet_size);   // returns non 0 if actually saved
19  int get_packet(void *packet, int &packet_size);   // returns non 0 if actually loaded
20 
21  int start_playing(char *filename);
22  int start_recording(char *filename);
23  void reset_game();
24  int demo_skip() { if (skip_next) { skip_next--; return 1; } else return 0; }
25  demo_manager() { state=NORMAL; skip_next=0; }
26  void do_inputs();
27} ;
28
29extern demo_manager demo_man;
30
31extern void get_event(event &ev, window_manager *wm);
32extern int event_waiting(window_manager *wm);
33
34
35
36extern int last_demo_mx,last_demo_my,last_demo_mbut;
37//extern ulong demo_tick_on;
38#endif
39
Note: See TracBrowser for help on using the repository browser.