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

Last change on this file was 80, checked in by Sam Hocevar, 11 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.2 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/sprite_object.hh"
10#include "r1_api.hh"
11
12void g1_sprite_object_class::think()
13{
14  frame++;
15  if (frame >= anim_length)
16  {
17    unoccupy_location();
18    request_remove();
19  }
20  else
21  {
22    unoccupy_location();
23    request_think(); 
24  }
25}
26
27
28g1_sprite_object_class::g1_sprite_object_class(g1_object_type id,
29                                               g1_loader_class *fp)
30  : g1_object_class(id,fp)
31{
32  model_id=0;
33}
34
35
36void g1_sprite_object_class::init()
37{
38  /// get animation length now rather than in the constructor to make sure model_id is valid
39  g1_sprite_class *sprite=g1_sprite_list_man.get_sprite(model_id);
40  anim_length = sprite->num_animation_frames;
41}
42
43
Note: See TracBrowser for help on using the repository browser.