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 | #include "map_man.hh"
|
---|
10 | #include "map.hh"
|
---|
11 | #include "g1_object.hh"
|
---|
12 |
|
---|
13 | g1_map_cell_class *g1_cells=0;
|
---|
14 | g1_map_vertex_class *g1_verts=0;
|
---|
15 | int g1_map_width, g1_map_height, g1_map_width_plus_one;
|
---|
16 |
|
---|
17 |
|
---|
18 | g1_map_class *g1_current_map_PRIVATE=0;
|
---|
19 |
|
---|
20 | void g1_destroy_map()
|
---|
21 | {
|
---|
22 | if (g1_current_map_PRIVATE)
|
---|
23 | {
|
---|
24 | delete g1_current_map_PRIVATE;
|
---|
25 | g1_current_map_PRIVATE=0;
|
---|
26 |
|
---|
27 | for (int i=0; i<=g1_last_object_type; i++)
|
---|
28 | if (g1_object_type_array[i] &&
|
---|
29 | (g1_object_type_array[i]->flags & g1_object_definition_class::DELETE_WITH_LEVEL))
|
---|
30 | {
|
---|
31 | g1_object_definition_class *od = g1_object_type_array[i];
|
---|
32 | g1_remove_object_type(i);
|
---|
33 | delete od;
|
---|
34 | }
|
---|
35 |
|
---|
36 | }
|
---|
37 | }
|
---|
38 |
|
---|
39 |
|
---|
40 | void g1_set_map(g1_map_class *map)
|
---|
41 | {
|
---|
42 | if (map)
|
---|
43 | {
|
---|
44 | g1_cells=map->cell(0,0);
|
---|
45 | g1_verts=map->vertex(0,0);
|
---|
46 | g1_map_width=map->width();
|
---|
47 | g1_map_width_plus_one=g1_map_width+1;
|
---|
48 | g1_map_height=map->height();
|
---|
49 | g1_current_map_PRIVATE=map;
|
---|
50 | }
|
---|
51 | else
|
---|
52 | {
|
---|
53 | g1_cells=0;
|
---|
54 | g1_verts=0;
|
---|
55 | g1_map_width=0;
|
---|
56 | g1_map_height=0;
|
---|
57 | g1_current_map_PRIVATE=0;
|
---|
58 | }
|
---|
59 | }
|
---|