-
Notifications
You must be signed in to change notification settings - Fork 1
/
particle.h
65 lines (55 loc) · 1.35 KB
/
particle.h
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* Abuse - dark 2D side-scrolling platform game
* Copyright (c) 1995 Crack dot Com
* Copyright (c) 2005-2011 Sam Hocevar <[email protected]>
*
* This software was released into the Public Domain. As with most public
* domain software, no warranty is made or implied by Crack dot Com, by
* Jonathan Clark, or by Sam Hocevar.
*/
#ifndef __PARTICLE_HPP_
#define __PARTICLE_HPP_
#include "specs.h"
#include "image.h"
class view;
int defun_pseq(void *args);
void add_panim(int id, long x, long y, int dir);
void delete_panims(); // called by ~level
void draw_panims(view *v);
void tick_panims();
void free_pframes();
void ScatterLine(ivec2 p1, ivec2 p2, int c, int s);
void AScatterLine(ivec2 p1, ivec2 p2, int c1, int c2, int s);
struct part
{
short x,y;
uint8_t color;
} ;
class part_frame
{
public :
int t,x1,y1,x2,y2;
part *data;
part_frame(bFILE *fp);
void draw(image *screen, int x, int y, int dir);
~part_frame();
} ;
class part_sequence
{
public :
int tframes;
int *frames; // array of id's
part_sequence(void *args);
~part_sequence() { if (tframes) free(frames); }
} ;
class part_animation
{
public :
part_animation *next;
part_sequence *seq;
int frame,dir;
long x,y;
part_animation(part_sequence *s, long X, long Y, int Dir, part_animation *Next)
{ x=X; y=Y; seq=s; next=Next; frame=0; dir=Dir; }
} ;
#endif