source: abuse/trunk/src/demo.h @ 658

Last change on this file since 658 was 658, checked in by Sam Hocevar, 9 years ago

game: convert a few integer pairs to vec2i variables.

  • Property svn:keywords set to Id
File size: 1.3 KB
Line 
1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
4 *  Copyright (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
5 *
6 *  This software was released into the Public Domain. As with most public
7 *  domain software, no warranty is made or implied by Crack dot Com, by
8 *  Jonathan Clark, or by Sam Hocevar.
9 */
10
11#ifndef __DEMO_HPP_
12#define __DEMO_HPP_
13
14#include "lisp.h"
15#include "jwindow.h"
16
17class demo_manager
18{
19  LSymbol *initial_difficulty;
20  bFILE *record_file;
21  int skip_next;
22
23  public :
24  enum demo_state { NORMAL,
25            RECORDING,
26            PLAYING    } state;
27  int set_state(demo_state new_state, char *filename=NULL);
28  demo_state current_state() { return state; }
29  int save_packet(void *packet, int packet_size);   // returns non 0 if actually saved
30  int get_packet(void *packet, int &packet_size);   // returns non 0 if actually loaded
31
32  int start_playing(char *filename);
33  int start_recording(char *filename);
34  void reset_game();
35  int demo_skip() { if (skip_next) { skip_next--; return 1; } else return 0; }
36  demo_manager() { state=NORMAL; skip_next=0; }
37  void do_inputs();
38} ;
39
40extern demo_manager demo_man;
41
42extern void get_event(Event &ev);
43extern int event_waiting();
44
45extern vec2i last_demo_mpos;
46extern int last_demo_mbut;
47
48//extern ulong demo_tick_on;
49#endif
50
Note: See TracBrowser for help on using the repository browser.