1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 */ 22 23 #ifndef SHERLOCK_SCALPEL_SCENE_H 24 #define SHERLOCK_SCALPEL_SCENE_H 25 26 #include "common/scummsys.h" 27 #include "common/array.h" 28 #include "common/rect.h" 29 #include "common/serializer.h" 30 #include "sherlock/objects.h" 31 #include "sherlock/scene.h" 32 #include "sherlock/screen.h" 33 34 namespace Sherlock { 35 36 namespace Scalpel { 37 38 extern const int FS_TRANS[8]; 39 40 enum { BLACKWOOD_CAPTURE = 2, BAKER_STREET = 4, DRAWING_ROOM = 12, STATION = 17, PUB_INTERIOR = 19, 41 LAWYER_OFFICE = 27, BAKER_ST_EXTERIOR = 39, RESCUE_ANNA = 52, MOOREHEAD_DEATH = 53, EXIT_GAME = 55, 42 BRUMWELL_SUICIDE = 70, OVERHEAD_MAP2 = 98, DARTS_GAME = 99, OVERHEAD_MAP = 100 }; 43 44 class ScalpelScene : public Scene { 45 private: 46 void doBgAnimCheckCursor(); 47 protected: 48 /** 49 * Loads the data associated for a given scene. The room resource file's format is: 50 * BGHEADER: Holds an index for the rest of the file 51 * STRUCTS: The objects for the scene 52 * IMAGES: The graphic information for the structures 53 * 54 * The _misc field of the structures contains the number of the graphic image 55 * that it should point to after loading; _misc is then set to 0. 56 */ 57 virtual bool loadScene(const Common::String &filename); 58 59 /** 60 * Checks all the background shapes. If a background shape is animating, 61 * it will flag it as needing to be drawn. If a non-animating shape is 62 * colliding with another shape, it will also flag it as needing drawing 63 */ 64 virtual void checkBgShapes(); 65 66 /** 67 * Draw all the shapes, people and NPCs in the correct order 68 */ 69 virtual void drawAllShapes(); 70 71 /** 72 * Returns the index of the closest zone to a given point. 73 */ 74 virtual int closestZone(const Common::Point &pt); 75 public: ScalpelScene(SherlockEngine * vm)76 ScalpelScene(SherlockEngine *vm) : Scene(vm) {} 77 78 virtual ~ScalpelScene(); 79 80 /** 81 * Draw all objects and characters. 82 */ 83 virtual void doBgAnim(); 84 85 /** 86 * Attempt to start a canimation sequence. It will load the requisite graphics, and 87 * then copy the canim object into the _canimShapes array to start the animation. 88 * 89 * @param cAnimNum The canim object within the current scene 90 * @param playRate Play rate. 0 is invalid; 1=normal speed, 2=1/2 speed, etc. 91 * A negative playRate can also be specified to play the animation in reverse 92 */ 93 virtual int startCAnim(int cAnimNum, int playRate = 1); 94 95 /** 96 * Attempts to find a background shape within the passed bounds. If found, 97 * it will return the shape number, or -1 on failure. 98 */ 99 virtual int findBgShape(const Common::Point &pt); 100 }; 101 102 } // End of namespace Scalpel 103 104 } // End of namespace Sherlock 105 106 #endif 107