Last change
on this file since 533 was
533,
checked in by Sam Hocevar, 12 years ago
|
imlib: rename trans_image to TImage. The code is now clean enough.
|
-
Property svn:keywords set to
Id
|
File size:
1.5 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 or |
---|
8 | * Jonathan Clark. |
---|
9 | */ |
---|
10 | |
---|
11 | #ifndef __SEQUENCE_HPP_ |
---|
12 | #define __SEQUENCE_HPP_ |
---|
13 | |
---|
14 | #include "image.h" |
---|
15 | #include "items.h" |
---|
16 | #include "timage.h" |
---|
17 | #include "cache.h" |
---|
18 | #include <stdarg.h> |
---|
19 | |
---|
20 | class sequence |
---|
21 | { |
---|
22 | int total; |
---|
23 | int *seq; // array of ids to figures |
---|
24 | public : |
---|
25 | // takes a varible number of arguments (ints) specifing indexes into image array |
---|
26 | sequence(int *figures, int total_frames) { total=total_frames; seq=figures; } |
---|
27 | |
---|
28 | sequence(char *filename, void *pict_list, void *advance_list); |
---|
29 | |
---|
30 | int next_frame(short ¤t) { current++; if (current>=total) { current=0; return 0; } return 1; } |
---|
31 | int last_frame(short ¤t) { current--; if (current<0) { current=total-1; return 0; } return 1; } |
---|
32 | TImage *get_frame(short current, int direction) |
---|
33 | { if (direction>0) return cache.fig(seq[current])->forward; |
---|
34 | else return cache.fig(seq[current])->backward; } |
---|
35 | figure *get_figure(short current) { return cache.fig(seq[current]); } |
---|
36 | int cache_in(); |
---|
37 | int x_center(short current) { return (short) (cache.fig(seq[current])->xcfg); } |
---|
38 | int length() { return total; } |
---|
39 | int get_advance(int current) { return cache.fig(seq[current])->advance; } |
---|
40 | size_t MemUsage(); |
---|
41 | ~sequence(); |
---|
42 | }; |
---|
43 | |
---|
44 | #endif |
---|
45 | |
---|
46 | |
---|
Note: See
TracBrowser
for help on using the repository browser.