source: golgotha/src/golg/objs/target.cc

Last change on this file 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: 1.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#include "objs/target.hh"
10#include "object_definer.hh"
11#include "map.hh"
12#include "map_man.hh"
13
14g1_object_type g1_target_type;
15
16static void g1_target_init();
17
18g1_object_definer<g1_target_class>
19g1_target_def("target", 0, g1_target_init);
20
21static void g1_target_init()
22{
23  g1_target_type = g1_target_def.type;
24}
25
26g1_target_class::g1_target_class(g1_object_type id, g1_loader_class *fp)
27  : g1_object_class(id, fp)
28{
29  draw_params.setup("target");
30 
31  player_num=0;
32  set_flag(TARGETABLE    |
33           GROUND,
34           1);
35 
36}
37
38i4_bool g1_target_class::occupy_location()
39{
40  h=g1_get_map()->terrain_height(x,y);
41  lh=h;
42  return g1_object_class::occupy_location();
43}
44
45void g1_target_class::draw(g1_draw_context_class *context)
46{
47  g1_model_draw(this, draw_params, context);
48}
49
50void g1_target_class::setup(i4_float _x, i4_float _y)
51{
52  lx = x = _x;
53  ly = y = _y;
54
55  occupy_location();
56}
57
Note: See TracBrowser for help on using the repository browser.