source: abuse/trunk/src/particle.h @ 672

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

game: make the scattered line functions use vec2i.

  • Property svn:keywords set to Id
File size: 1.4 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 __PARTICLE_HPP_
12#define __PARTICLE_HPP_
13
14#include "specs.h"
15#include "image.h"
16
17class view;
18
19int defun_pseq(void *args);
20void add_panim(int id, long x, long y, int dir);
21void delete_panims();      // called by ~level
22void draw_panims(view *v);
23void tick_panims();
24void free_pframes();
25void ScatterLine(vec2i p1, vec2i p2, int c, int s);
26void AScatterLine(vec2i p1, vec2i p2, int c1, int c2, int s);
27
28struct part
29{
30  short x,y;
31  uint8_t color;
32} ;
33
34class part_frame
35{
36  public :
37  int t,x1,y1,x2,y2;
38  part *data;
39  part_frame(bFILE *fp);
40  void draw(image *screen, int x, int y, int dir);
41  ~part_frame();
42} ;
43
44class part_sequence
45{
46  public :
47  int tframes;
48  int *frames;  // array of id's
49  part_sequence(void *args);
50  ~part_sequence() { if (tframes) free(frames); }
51} ;
52
53class part_animation
54{
55  public :
56  part_animation *next;
57  part_sequence *seq;
58  int frame,dir;
59  long x,y;
60  part_animation(part_sequence *s, long X, long Y, int Dir, part_animation *Next)
61  { x=X; y=Y; seq=s; next=Next; frame=0; dir=Dir; }
62} ;
63
64#endif
65
Note: See TracBrowser for help on using the repository browser.