/[enigma]/enigma/src/display.cc
ViewVC logotype

Diff of /enigma/src/display.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by dheck, Wed May 7 20:28:21 2003 UTC revision 1.18 by dheck, Tue May 13 18:55:05 2003 UTC
# Line 416  DL_Grid::get_model (int x, int y) Line 416  DL_Grid::get_model (int x, int y)
416      return m_models(x,y);      return m_models(x,y);
417  }  }
418    
419  Model *  Model *DL_Grid::yield_model (int x, int y)
 DL_Grid::yield_model (int x, int y)  
420  {  {
421      Model *m = get_model (x, y);      Model *m = get_model (x, y);
422      if (m)      if (m)
# Line 445  DL_Grid::draw (px::GC &gc, const WorldAr Line 444  DL_Grid::draw (px::GC &gc, const WorldAr
444  // SPRITES  // SPRITES
445  //======================================================================  //======================================================================
446    
447  void  void SpriteHandle::kill()
 SpriteHandle::kill()  
448  {  {
449      layer->kill_sprite (id);      layer->kill_sprite (id);
450      layer = 0;      layer = 0;
451      id = 0;      id = 0;
452  }  }
453    
454  void  void SpriteHandle::move (const px::V2 &newpos) const
 SpriteHandle::move (const px::V2 &newpos) const  
455  {  {
456      if (layer)      if (layer)
457          layer->move_sprite (id, newpos);          layer->move_sprite (id, newpos);
458  }  }
459    
460  void  void SpriteHandle::replace_model (Model *m) const
 SpriteHandle::replace_model (Model *m) const  
461  {  {
462      if (layer)      if (layer)
463          layer->replace_sprite (id, m);          layer->replace_sprite (id, m);
# Line 469  SpriteHandle::replace_model (Model *m) c Line 465  SpriteHandle::replace_model (Model *m) c
465          delete m;          delete m;
466  }  }
467    
468  Model *  Model *SpriteHandle::get_model () const
 SpriteHandle::get_model () const  
469  {  {
470      return layer ? layer->get_model (id) : 0;      return layer ? layer->get_model (id) : 0;
471  }  }
472    
473  void  void SpriteHandle::set_callback (ModelCallback *cb) const
 SpriteHandle::set_callback (ModelCallback *cb) const  
474  {  {
475      if (Model *m = get_model())      if (Model *m = get_model())
476          m->set_callback(cb);          m->set_callback(cb);
# Line 606  DL_Sprites::draw_sprites (bool shades, G Line 600  DL_Sprites::draw_sprites (bool shades, G
600              int sx, sy;              int sx, sy;
601              get_engine()->world_to_screen(s->pos, &sx, &sy);              get_engine()->world_to_screen(s->pos, &sx, &sy);
602              if (shades)              if (shades)
603                  s->model->draw_shade(gc, sx, sy);                  s->model->draw_shadow(gc, sx, sy);
604              else              else
605                  s->model->draw(gc, sx, sy);                  s->model->draw(gc, sx, sy);
606          }          }
# Line 1067  DL_Shadows::get_shadow_model(int x, int Line 1061  DL_Shadows::get_shadow_model(int x, int
1061  {  {
1062      if (x >= 0 && y >= 0) {      if (x >= 0 && y >= 0) {
1063          Model *m = m_grid->get_model(x,y);          Model *m = m_grid->get_model(x,y);
1064          if (ShadedModel *sm = dynamic_cast<ShadedModel*>(m))          if (ShadowModel *sm = dynamic_cast<ShadowModel*>(m))
1065              return sm->get_shadow();              return sm->get_shadow();
1066      }      }
1067      return 0;      return 0;
# Line 1101  DL_Shadows::draw(GC &gc, int xpos, int y Line 1095  DL_Shadows::draw(GC &gc, int xpos, int y
1095                  if (Sprite *s = m_sprites->sprites[i]) {                  if (Sprite *s = m_sprites->sprites[i]) {
1096                      int sx = int(s->pos[0]*32) - x*32;                      int sx = int(s->pos[0]*32) - x*32;
1097                      int sy = int(s->pos[1]*32) - y*32;                      int sy = int(s->pos[1]*32) - y*32;
1098                      s->model->draw_shade(gc2, sx, sy);                      s->model->draw_shadow(gc2, sx, sy);
1099                  }                  }
1100              }              }
1101              blit(gc, xpos, ypos, buffer);              blit(gc, xpos, ypos, buffer);

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26