Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

sprite.cc

Go to the documentation of this file.
00001 
00002 // Flash Plugin and Player
00003 // Copyright (C) 1998,1999 Olivier Debon
00004 // 
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 // 
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018 // 
00020 //  Author : Olivier Debon  <odebon@club-internet.fr>
00021 //  
00022 
00023 #include "swf.h"
00024 
00025 #ifdef RCSID
00026 static char *rcsid = "$Id: sprite.cc,v 1.1.1.1 2002/01/25 22:14:59 kergoth Exp $";
00027 #endif
00028 
00029 Sprite::Sprite(FlashMovie *movie, long id, long frameCount) : Character(SpriteType, id)
00030 {
00031         program = new Program(movie, frameCount);
00032         if (program == NULL) return;
00033         if (program->totalFrames == 0) {
00034                 delete program;
00035                 program = NULL;
00036                 return;
00037         }
00038         program->dl->isSprite = 1;
00039 }
00040 
00041 Sprite::~Sprite()
00042 {
00043         delete program;
00044 }
00045 
00046 void
00047 Sprite::reset()
00048 {
00049         program->rewindMovie();
00050 }
00051 
00052 int
00053 Sprite::isSprite(void)
00054 {
00055     return 1;
00056 }
00057 
00058 Program *
00059 Sprite::getProgram()
00060 {
00061         return program;
00062 }
00063 
00064 int
00065 Sprite::execute(GraphicDevice *gd, Matrix *matrix, Cxform *cxform)
00066 {
00067         return program->dl->render(gd,matrix,cxform);
00068 }
00069 
00070 ActionRecord *
00071 Sprite::eventHandler(GraphicDevice *gd, FlashEvent *event)
00072 {
00073 #if 0
00074         DisplayList *dl;
00075         ActionRecord *actions;
00076 
00077         dl = program->getDisplayList();
00078         actions = dl->processEvent(gd, event);
00079         if (actions) {
00080                 program->doAction(actions,0);
00081         }
00082         return actions;
00083 #endif
00084         return NULL;
00085 }
00086 
00087 void
00088 Sprite::getBoundingBox(Rect *bb, DisplayListEntry *e)
00089 {
00090         program->dl->getBoundary(bb);
00091 }

Generated on Sat Nov 5 16:15:36 2005 for OPIE by  doxygen 1.4.2