Last change
on this file was
555,
checked in by Sam Hocevar, 11 years ago
|
ps3: make everything compile on the PS3. Of course, nothing links yet
because so much support is missing.
|
-
Property svn:keywords set to
Id
|
File size:
1.5 KB
|
Rev | Line | |
---|
[56] | 1 | /* |
---|
| 2 | * Abuse - dark 2D side-scrolling platform game |
---|
| 3 | * Copyright (c) 1995 Crack dot Com |
---|
[494] | 4 | * Copyright (c) 2005-2011 Sam Hocevar <sam@hocevar.net> |
---|
[56] | 5 | * |
---|
| 6 | * This software was released into the Public Domain. As with most public |
---|
[555] | 7 | * domain software, no warranty is made or implied by Crack dot Com, by |
---|
| 8 | * Jonathan Clark, or by Sam Hocevar. |
---|
[56] | 9 | */ |
---|
| 10 | |
---|
[2] | 11 | #ifndef __SEQUENCE_HPP_ |
---|
| 12 | #define __SEQUENCE_HPP_ |
---|
| 13 | |
---|
[481] | 14 | #include "image.h" |
---|
[541] | 15 | #include "transimage.h" |
---|
[481] | 16 | #include "items.h" |
---|
| 17 | #include "cache.h" |
---|
[541] | 18 | |
---|
[2] | 19 | #include <stdarg.h> |
---|
| 20 | |
---|
| 21 | class sequence |
---|
| 22 | { |
---|
| 23 | int total; |
---|
| 24 | int *seq; // array of ids to figures |
---|
| 25 | public : |
---|
| 26 | // takes a varible number of arguments (ints) specifing indexes into image array |
---|
| 27 | sequence(int *figures, int total_frames) { total=total_frames; seq=figures; } |
---|
| 28 | |
---|
| 29 | sequence(char *filename, void *pict_list, void *advance_list); |
---|
| 30 | |
---|
| 31 | int next_frame(short ¤t) { current++; if (current>=total) { current=0; return 0; } return 1; } |
---|
| 32 | int last_frame(short ¤t) { current--; if (current<0) { current=total-1; return 0; } return 1; } |
---|
[541] | 33 | TransImage *get_frame(short current, int direction) |
---|
[124] | 34 | { if (direction>0) return cache.fig(seq[current])->forward; |
---|
[123] | 35 | else return cache.fig(seq[current])->backward; } |
---|
| 36 | figure *get_figure(short current) { return cache.fig(seq[current]); } |
---|
[2] | 37 | int cache_in(); |
---|
[123] | 38 | int x_center(short current) { return (short) (cache.fig(seq[current])->xcfg); } |
---|
[2] | 39 | int length() { return total; } |
---|
[123] | 40 | int get_advance(int current) { return cache.fig(seq[current])->advance; } |
---|
[527] | 41 | size_t MemUsage(); |
---|
[2] | 42 | ~sequence(); |
---|
| 43 | }; |
---|
| 44 | |
---|
| 45 | #endif |
---|
| 46 | |
---|
| 47 | |
---|
Note: See
TracBrowser
for help on using the repository browser.