source: golgotha/src/golg/tile.hh @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 12 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 2.4 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#ifndef TILE_HH
10#define TILE_HH
11
12#include "init/init.hh"
13#include "tex_id.hh"
14
15class i4_const_str;
16class g1_object_class;
17class g1_quad_object_class;
18class r1_render_api_class;
19class g1_map_class;
20class li_object;
21class li_environment;
22class g1_map_cell_class;
23
24class g1_tile_class
25{
26public:
27  r1_texture_handle texture;
28  w32 filename_checksum;           // used to identify matchup tiles with saved levels
29  w8 flags;
30  w16 selection_order;
31
32  enum {
33    SELECTABLE        =1,     // if user can pick it for tile selection
34    WAVE              =2,     // water-wave
35    BLOCKING          =4      // blocks vehicle entry
36  };
37
38  float damping_fraction, damping_e, friction_fraction;
39  sw16 damage;
40
41  void init();    // initializes default values for the tile
42
43  void set_friction(float uB);
44 
45  void get_properties(li_object *properties, li_environment *env);
46
47  void apply_to_cell(g1_map_cell_class &cell);
48} ;
49
50
51
52class g1_tile_man_class : public i4_init_class
53{
54  g1_tile_class *array;
55  int t_tiles, max_tiles;
56  int sorted_by_checksum;
57  r1_texture_handle pink, default_tile_type;
58
59 
60
61public: 
62  int get_tile_from_name(i4_const_str &name);
63  int get_tile_from_name(char *name);
64  int get_tile_from_checksum(w32 checksum);
65
66  g1_tile_man_class();
67
68  void uninit();
69
70  void reset(int _max_tiles);
71  void add(li_object *o, li_environment *env);
72  void get_tile_texture(li_object *o, li_object *&texture_name, li_object *&save_name);
73
74
75  g1_tile_class *get(w32 handle) { return array+handle; }
76  r1_texture_handle get_texture(w32 handle) { return array[handle].texture; }
77
78  r1_texture_handle get_pink() { return pink; }
79  int get_default_tile_type() { return default_tile_type; }
80
81 
82  void finished_load();
83  int remap_size();
84  int get_remap(int tile_num);
85 
86  w32 total() { return t_tiles; }
87};
88
89
90extern g1_tile_man_class g1_tile_man;
91
92
93#endif
94
Note: See TracBrowser for help on using the repository browser.