ScummVM API documentation
scene_base.h
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  * Additional copyright for this file:
8  * Copyright (C) 1995 Presto Studios, Inc.
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14 
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19 
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  *
23  */
24 
25 #ifndef BURIED_SCENE_BASE_H
26 #define BURIED_SCENE_BASE_H
27 
28 #include "common/keyboard.h"
29 #include "common/rect.h"
30 
31 #include "buried/navdata.h"
32 
33 namespace Graphics {
34 struct Surface;
35 }
36 
37 namespace Buried {
38 
39 // Generic result codes
40 enum {
41  SC_FALSE = 0, // Everything did not go well, error out
42  SC_TRUE = 1, // Everything is kosher, continue as normal
43  SC_END_PROCESSING = 4 // Stop processing here
44 };
45 
46 // Post-exit specific result codes
47 enum {
48  SC_DEATH = 3 // We died, so do nothing further
49 };
50 
51 // Paint-specific return values
52 enum {
53  SC_REPAINT = 0,
54  SC_DO_NOT_REPAINT = 1
55 };
56 
57 // Movie status codes
58 enum {
59  MOVIE_START = 0,
60  MOVIE_STOPPED = 1,
61  MOVIE_PLAYING = 2,
62  MOVIE_ABORTED_BY_USER = 3,
63  MOVIE_LOOPING_RESTART = 4
64 };
65 
66 // Inventory item related return codes
67 enum {
68  SIC_REJECT = 0,
69  SIC_ACCEPT = 1
70 };
71 
72 class BuriedEngine;
73 class Window;
74 class VideoWindow;
75 
76 class SceneBase { // Wow, it's not a window!
77 public:
78  SceneBase(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation);
79  virtual ~SceneBase() {}
80 
81  virtual void preDestructor() {}
82 
83  virtual int preEnterRoom(Window *viewWindow, const Location &priorLocation) { return SC_TRUE; }
84  virtual int postEnterRoom(Window *viewWindow, const Location &priorLocation) { return SC_TRUE; }
85 
86  virtual int preExitRoom(Window *viewWindow, const Location &priorLocation) { return SC_TRUE; }
87  virtual int postExitRoom(Window *viewWindow, const Location &priorLocation) { return SC_TRUE; }
88 
89  virtual int mouseDown(Window *viewWindow, const Common::Point &pointLocation) { return SC_TRUE; }
90  virtual int mouseUp(Window *viewWindow, const Common::Point &pointLocation) { return SC_TRUE; }
91  virtual int mouseMove(Window *viewWindow, const Common::Point &pointLocation) { return SC_TRUE; }
92 
93  virtual int onCharacter(Window *viewWindow, const Common::KeyState &character) { return SC_TRUE; }
94 
95  virtual int paint(Window *viewWindow, Graphics::Surface *preBuffer);
96  virtual int gdiPaint(Window *viewWindow) { return SC_REPAINT; }
97 
98  virtual int movieCallback(Window *viewWindow, VideoWindow *movie, int animationID, int status) { return SC_TRUE; }
99  virtual int timerCallback(Window *viewWindow);
100 
101  virtual int draggingItem(Window *viewWindow, int itemID, const Common::Point &pointLocation, int itemFlags) { return 0; }
102  virtual int droppedItem(Window *viewWindow, int itemID, const Common::Point &pointLocation, int itemFlags) { return SIC_REJECT; }
103 
104  virtual int specifyCursor(Window *viewWindow, const Common::Point &pointLocation);
105 
106  virtual int locateAttempted(Window *viewWindow, const Common::Point &pointLocation) { return 0; }
107 
108  LocationStaticData _staticData;
109  int32 _frameCycleCount;
110 
111 protected:
112  BuriedEngine *_vm;
113 };
114 
115 } // End of namespace Buried
116 
117 #endif
Definition: window.h:37
Definition: surface.h:67
Definition: navdata.h:72
Definition: buried.h:67
Definition: agent_evaluation.h:31
Definition: video_window.h:37
Definition: formatinfo.h:28
Definition: rect.h:45
Definition: navdata.h:32
Definition: keyboard.h:294
Definition: scene_base.h:76