home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 19 / Amiga Plus Leser CD 19.iso / Tools / Freeware / Swf_Player / Lib / sprite.cc < prev    next >
Encoding:
C/C++ Source or Header  |  2002-11-17  |  2.0 KB  |  92 lines

  1. /////////////////////////////////////////////////////////////
  2. // Flash Plugin and Player
  3. // Copyright (C) 1998,1999 Olivier Debon
  4. // 
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU General Public License
  7. // as published by the Free Software Foundation; either version 2
  8. // of the License, or (at your option) any later version.
  9. // 
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. // GNU General Public License for more details.
  14. // 
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18. // 
  19. ///////////////////////////////////////////////////////////////
  20. //  Author : Olivier Debon  <odebon@club-internet.fr>
  21. //  
  22.  
  23. #include "swf.h"
  24.  
  25. #ifdef RCSID
  26. static char *rcsid = "$Id: sprite.cc,v 1.4 1999/09/03 15:17:41 ode Exp $";
  27. #endif
  28.  
  29. Sprite::Sprite(FlashMovie *movie, long id, long frameCount) : Character(SpriteType, id)
  30. {
  31.     program = new Program(movie, frameCount);
  32.     if (program == NULL) return;
  33.     if (program->totalFrames == 0) {
  34.         delete program;
  35.         program = NULL;
  36.         return;
  37.     }
  38.     program->dl->isSprite = 1;
  39. }
  40.  
  41. Sprite::~Sprite()
  42. {
  43.     delete program;
  44. }
  45.  
  46. void
  47. Sprite::reset()
  48. {
  49.     program->rewindMovie();
  50. }
  51.  
  52. int
  53. Sprite::isSprite(void)
  54. {
  55.     return 1;
  56. }
  57.  
  58. Program *
  59. Sprite::getProgram()
  60. {
  61.     return program;
  62. }
  63.  
  64. int
  65. Sprite::execute(GraphicDevice *gd, Matrix *matrix, Cxform *cxform)
  66. {
  67.     return program->dl->render(gd,matrix,cxform);
  68. }
  69.  
  70. ActionRecord *
  71. Sprite::eventHandler(GraphicDevice *gd, FlashEvent *event)
  72. {
  73. #if 0
  74.     DisplayList *dl;
  75.     ActionRecord *actions;
  76.  
  77.     dl = program->getDisplayList();
  78.     actions = dl->processEvent(gd, event);
  79.     if (actions) {
  80.         program->doAction(actions,0);
  81.     }
  82.     return actions;
  83. #endif
  84.     return NULL;
  85. }
  86.  
  87. void
  88. Sprite::getBoundingBox(Rect *bb, DisplayListEntry *e)
  89. {
  90.     program->dl->getBoundary(bb);
  91. }
  92.