summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/libflash/sprite.cc
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/libflash/sprite.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/libflash/sprite.cc91
1 files changed, 91 insertions, 0 deletions
diff --git a/core/multimedia/opieplayer/libflash/sprite.cc b/core/multimedia/opieplayer/libflash/sprite.cc
new file mode 100644
index 0000000..de53095
--- a/dev/null
+++ b/core/multimedia/opieplayer/libflash/sprite.cc
@@ -0,0 +1,91 @@
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
26static char *rcsid = "$Id$";
27#endif
28
29Sprite::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
41Sprite::~Sprite()
42{
43 delete program;
44}
45
46void
47Sprite::reset()
48{
49 program->rewindMovie();
50}
51
52int
53Sprite::isSprite(void)
54{
55 return 1;
56}
57
58Program *
59Sprite::getProgram()
60{
61 return program;
62}
63
64int
65Sprite::execute(GraphicDevice *gd, Matrix *matrix, Cxform *cxform)
66{
67 return program->dl->render(gd,matrix,cxform);
68}
69
70ActionRecord *
71Sprite::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
87void
88Sprite::getBoundingBox(Rect *bb, DisplayListEntry *e)
89{
90 program->dl->getBoundary(bb);
91}