| 1 | /*************************************************************************** |
| 2 | fire.cpp - description |
| 3 | ------------------- |
| 4 | begin : Fri Jan 18 2002 |
| 5 | copyright : (C) 2002 by Waldemar Baraldi |
| 6 | email : [email protected] |
| 7 | ***************************************************************************/ |
| 8 | |
| 9 | /*************************************************************************** |
| 10 | * * |
| 11 | * This program is free software; you can redistribute it and/or modify * |
| 12 | * it under the terms of the GNU General Public License as published by * |
| 13 | * the Free Software Foundation; either version 2 of the License, or * |
| 14 | * (at your option) any later version. * |
| 15 | * * |
| 16 | ***************************************************************************/ |
| 17 | |
| 18 | #include "fire.h"cxx . . $ `<file>/src/fire.h`/ |
| 19 | #include "sprite.h"cxx . . $ `<file>/src/sprite.h`/ |
| 20 | #include "random.h"cxx . . $ `<file>/src/random.h`/ |
| 21 | |
| 22 | const int Firecxx . . $ Fire#::NFramescxx . . $ Fire#NFrames.=2; |
| 23 | |
| 24 | Firecxx . . $ Fire#::Firecxx . . $ Fire#Fire(e88533388df2326a).(ImageManagercxx . . $ ImageManager# * im):AnimatedCanvascxx . . $ AnimatedCanvas#(){ |
| 25 | |
| 26 | l_widthcxx . . $ Fire#l_width.=8; |
| 27 | l_heightcxx . . $ Fire#l_height.=14; |
| 28 | ccxx . . $ Fire#c.=0; |
| 29 | framecxx . . $ Fire#frame.=0; |
| 30 | |
| 31 | spritecxx . . $ Fire#sprite.=new Spritecxx . . $ Sprite#Sprite(7c5e60030c36ad17).(new Strcxx . . $ Str#("fire"), new Strcxx . . $ Str#(".png"), NFramescxx . . $ Fire#NFrames., im); |
| 32 | } |
| 33 | |
| 34 | Firecxx . . $ Fire#::~cxx . . $ Fire#`~Fire`(ced63f7c635d850d).Firecxx . . $ Fire#(){ |
| 35 | delete spritecxx . . $ Fire#sprite.; |
| 36 | } |
| 37 | |
| 38 | int Firecxx . . $ Fire#::widthcxx . . $ Fire#width(b126dc7c1de90089).(){ |
| 39 | return l_widthcxx . . $ Fire#l_width.; |
| 40 | } |
| 41 | |
| 42 | int Firecxx . . $ Fire#::heightcxx . . $ Fire#height(b126dc7c1de90089).(){ |
| 43 | return l_heightcxx . . $ Fire#l_height.; |
| 44 | } |
| 45 | |
| 46 | |
| 47 | void Firecxx . . $ Fire#::paintcxx . . $ Fire#paint(dec28a01b93bce57).(VideoManagercxx . . $ VideoManager# * vm){ |
| 48 | vm->blitcxx . . $ VideoManager#blit(d6e51777aa68e081).(spritecxx . . $ Fire#sprite.->framecxx . . $ Sprite#frame(e8d7ae696153184b).(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).(), framecxx . . $ Fire#frame.), xcxx . . $ Canvas#x., ycxx . . $ Canvas#y.); |
| 49 | } |
| 50 | |
| 51 | void Firecxx . . $ Fire#::tickcxx . . $ Fire#tick(49f6e7a06ebc5aa8).(){ |
| 52 | if (ccxx . . $ Fire#c.++%6==0) framecxx . . $ Fire#frame.=(framecxx . . $ Fire#frame.+1)%NFramescxx . . $ Fire#NFrames.; |
| 53 | } |