source: abuse/trunk/src/items.h @ 489

Last change on this file since 489 was 481, checked in by Sam Hocevar, 10 years ago

Fuck the history, I'm renaming all .hpp files to .h for my own sanity.

  • Property svn:keywords set to Id
File size: 2.2 KB
Line 
1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
4 *
5 *  This software was released into the Public Domain. As with most public
6 *  domain software, no warranty is made or implied by Crack dot Com or
7 *  Jonathan Clark.
8 */
9
10#ifndef __ITEMS_HPP__
11#define __ITEMS_HPP__
12#include "image.h"
13#include "specs.h"
14#include "points.h"
15#include "timage.h"
16#include <stdio.h>
17#include <stdlib.h>
18
19#define AUTOTILE_WIDTH 6
20#define AUTOTILE_HEIGHT 3
21
22class boundary : public point_list      //  a list of points with
23{
24public :
25  boundary(bFILE *fp,char const *er_name);
26  uint8_t *inside;     // tells which side of the line is on the inside
27  boundary(boundary *p);      // flips the *inside list
28  ~boundary() { if (tot) free(inside); }
29} ;
30
31class backtile
32{
33public :
34  uint16_t next;
35  image *im;
36  backtile(spec_entry *e, bFILE *fp);
37  backtile(bFILE *fp);
38  int32_t size() { return 2+4+im->width()*im->height(); }
39  ~backtile() { delete im; }
40} ;
41
42class foretile
43{
44public :
45  trans_image *im;
46  uint16_t next;
47  uint8_t damage;
48  uint8_t ylevel;            // for fast intersections, this is the y level offset for the ground
49                           // if ground is not level this is 255
50  boundary *points;
51
52  image *micro_image;
53
54  foretile(bFILE *fp);
55  int32_t size() { return im->width()*im->height()+4+2+1+points->size(); }
56  ~foretile() { delete im; delete points; delete micro_image; }
57} ;
58
59class figure
60{
61public :
62  trans_image *forward,*backward;
63  uint8_t hit_damage,xcfg;
64  int8_t advance;
65  point_list *hit;
66  boundary *f_damage,*b_damage;
67  int size();
68
69  figure(bFILE *fp, int type);
70  int width() { return forward->width(); }
71  int height() { return forward->height(); }
72
73/*  int32_t size(int type)         // taken from spaint items
74  {
75    if
76    return forward->width()*backward->height()+4+
77                       1+1+       // hit & xcfg
78               touch->size()+
79               hit->size()+
80               damage->size();
81  }*/
82
83  ~figure() { delete forward; delete backward;
84          delete hit;
85          delete f_damage; delete b_damage; }
86} ;
87
88class char_tint
89{
90  public :
91  uint8_t data[256];
92  ~char_tint() { ; }
93  char_tint(bFILE *fp);               // should be a palette entry
94} ;
95
96#endif
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Note: See TracBrowser for help on using the repository browser.