ScummVM API documentation
lua_v2.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  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (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, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef GRIM_LUA_V2
23 #define GRIM_LUA_V2
24 
25 #include "engines/grim/lua_v1.h"
26 
27 namespace Grim {
28 
29 class Lua_V2 : public Lua_V1 {
30 public:
31  typedef Lua_V2 LuaClass;
32  void registerOpcodes() override;
33 
34 protected:
35  bool findCostume(lua_Object costumeObj, Actor *actor, Costume **costume) override;
36  void setChoreAndCostume(lua_Object choreObj, lua_Object costumeObj, Actor *actor, Costume *&costume, int &chore);
37  static uint convertEmiVolumeToMixer(uint emiVolume);
38  static uint convertMixerVolumeToEmi(uint volume);
39  static const uint MAX_EMI_VOLUME = 100;
40 
41  DECLARE_LUA_OPCODE(UndimAll);
42  DECLARE_LUA_OPCODE(SetActorLocalAlpha);
43  DECLARE_LUA_OPCODE(UndimRegion);
44  DECLARE_LUA_OPCODE(DimScreen) override;
45  DECLARE_LUA_OPCODE(MakeCurrentSetup) override;
46  DECLARE_LUA_OPCODE(SetActorGlobalAlpha);
47  DECLARE_LUA_OPCODE(ImGetMillisecondPosition);
48  DECLARE_LUA_OPCODE(RemoveActorFromOverworld);
49  DECLARE_LUA_OPCODE(UnloadActor);
50  DECLARE_LUA_OPCODE(SetActorWalkRate) override;
51  DECLARE_LUA_OPCODE(GetActorWalkRate) override;
52  DECLARE_LUA_OPCODE(SetActorTurnRate) override;
53  DECLARE_LUA_OPCODE(SetReverb);
54  DECLARE_LUA_OPCODE(LockBackground);
55  DECLARE_LUA_OPCODE(UnLockBackground);
56  DECLARE_LUA_OPCODE(LockChore);
57  DECLARE_LUA_OPCODE(IsActorChoring) override;
58  DECLARE_LUA_OPCODE(IsChoreValid);
59  DECLARE_LUA_OPCODE(IsChorePlaying);
60  DECLARE_LUA_OPCODE(StopChore);
61  DECLARE_LUA_OPCODE(AdvanceChore);
62  DECLARE_LUA_OPCODE(SetActorSortOrder);
63  DECLARE_LUA_OPCODE(ActorActivateShadow);
64  DECLARE_LUA_OPCODE(ActorStopMoving);
65  DECLARE_LUA_OPCODE(ActorLookAt) override;
66  DECLARE_LUA_OPCODE(PutActorInOverworld);
67  DECLARE_LUA_OPCODE(GetActorWorldPos);
68  DECLARE_LUA_OPCODE(MakeScreenTextures);
69  DECLARE_LUA_OPCODE(PutActorInSet) override;
70  DECLARE_LUA_OPCODE(LoadBundle) override;
71  DECLARE_LUA_OPCODE(AreWeInternational);
72  DECLARE_LUA_OPCODE(ImSetState) override;
73  DECLARE_LUA_OPCODE(EnableVoiceFX);
74  DECLARE_LUA_OPCODE(SetGroupVolume);
75  DECLARE_LUA_OPCODE(EnableAudioGroup);
76  DECLARE_LUA_OPCODE(ImSelectSet);
77  DECLARE_LUA_OPCODE(GetActorChores) override;
78  DECLARE_LUA_OPCODE(PlayActorChore) override;
79  DECLARE_LUA_OPCODE(StopActorChores);
80  DECLARE_LUA_OPCODE(SetActorLighting);
81  DECLARE_LUA_OPCODE(SetActorCollisionMode) override;
82  DECLARE_LUA_OPCODE(SetActorCollisionScale) override;
83  DECLARE_LUA_OPCODE(GetActorPuckVector) override;
84  DECLARE_LUA_OPCODE(SetActorHeadLimits);
85  DECLARE_LUA_OPCODE(SetActorHead) override;
86  DECLARE_LUA_OPCODE(SetActorFOV);
87  DECLARE_LUA_OPCODE(AttachActor);
88  DECLARE_LUA_OPCODE(DetachActor);
89  DECLARE_LUA_OPCODE(GetCPUSpeed);
90  DECLARE_LUA_OPCODE(StartMovie) override;
91  DECLARE_LUA_OPCODE(IsMoviePlaying) override;
92  DECLARE_LUA_OPCODE(SetActiveCD);
93  DECLARE_LUA_OPCODE(GetActiveCD);
94  DECLARE_LUA_OPCODE(PurgeText) override;
95  DECLARE_LUA_OPCODE(ImFlushStack);
96  DECLARE_LUA_OPCODE(LoadSound);
97  DECLARE_LUA_OPCODE(ImSetMusicVol) override;
98  DECLARE_LUA_OPCODE(ImSetSfxVol) override;
99  DECLARE_LUA_OPCODE(ImSetVoiceVol) override;
100  DECLARE_LUA_OPCODE(ImSetVoiceEffect) override;
101  DECLARE_LUA_OPCODE(ToggleOverworld);
102  DECLARE_LUA_OPCODE(ScreenshotForSavegame);
103  DECLARE_LUA_OPCODE(EngineDisplay) override;
104  DECLARE_LUA_OPCODE(SetAmbientLight) override;
105  DECLARE_LUA_OPCODE(Display) override;
106  DECLARE_LUA_OPCODE(ThumbnailFromFile);
107  DECLARE_LUA_OPCODE(ClearSpecialtyTexture);
108  DECLARE_LUA_OPCODE(ClearOverworld);
109  DECLARE_LUA_OPCODE(EnableActorPuck);
110  DECLARE_LUA_OPCODE(GetActorSortOrder);
111  DECLARE_LUA_OPCODE(IsChoreLooping);
112  DECLARE_LUA_OPCODE(SetChoreLooping);
113  DECLARE_LUA_OPCODE(PlayChore);
114  DECLARE_LUA_OPCODE(PauseChore);
115  DECLARE_LUA_OPCODE(CompleteChore);
116  DECLARE_LUA_OPCODE(UnlockChore);
117  DECLARE_LUA_OPCODE(LockChoreSet);
118  DECLARE_LUA_OPCODE(UnlockChoreSet);
119  DECLARE_LUA_OPCODE(EscapeMovie);
120  DECLARE_LUA_OPCODE(StopAllSounds);
121  DECLARE_LUA_OPCODE(FreeSound);
122  DECLARE_LUA_OPCODE(PlayLoadedSound);
123  DECLARE_LUA_OPCODE(StopSound);
124  DECLARE_LUA_OPCODE(PlaySound) override;
125  DECLARE_LUA_OPCODE(IsSoundPlaying) override;
126  DECLARE_LUA_OPCODE(GetSoundVolume);
127  DECLARE_LUA_OPCODE(SetSoundVolume);
128  DECLARE_LUA_OPCODE(PlaySoundFrom);
129  DECLARE_LUA_OPCODE(PlayLoadedSoundFrom);
130  DECLARE_LUA_OPCODE(UpdateSoundPosition);
131  DECLARE_LUA_OPCODE(ImStateHasLooped);
132  DECLARE_LUA_OPCODE(ImStateHasEnded);
133  DECLARE_LUA_OPCODE(ImPushState);
134  DECLARE_LUA_OPCODE(ImPopState);
135  DECLARE_LUA_OPCODE(ImPause) override;
136  DECLARE_LUA_OPCODE(ImResume) override;
137  DECLARE_LUA_OPCODE(GetSectorName);
138  DECLARE_LUA_OPCODE(GetCameraYaw);
139  DECLARE_LUA_OPCODE(YawCamera);
140  DECLARE_LUA_OPCODE(GetCameraPitch);
141  DECLARE_LUA_OPCODE(GetCameraRoll) override;
142  DECLARE_LUA_OPCODE(PitchCamera);
143  DECLARE_LUA_OPCODE(RollCamera);
144  DECLARE_LUA_OPCODE(NewLayer);
145  DECLARE_LUA_OPCODE(FreeLayer);
146  DECLARE_LUA_OPCODE(SetLayerSortOrder);
147  DECLARE_LUA_OPCODE(SetLayerFrame);
148  DECLARE_LUA_OPCODE(AdvanceLayerFrame);
149  DECLARE_LUA_OPCODE(PushText);
150  DECLARE_LUA_OPCODE(PopText);
151  DECLARE_LUA_OPCODE(NukeAllScriptLocks);
152  DECLARE_LUA_OPCODE(ToggleDebugDraw);
153  DECLARE_LUA_OPCODE(ToggleDrawCameras);
154  DECLARE_LUA_OPCODE(ToggleDrawLights);
155  DECLARE_LUA_OPCODE(ToggleDrawSectors);
156  DECLARE_LUA_OPCODE(ToggleDrawBBoxes);
157  DECLARE_LUA_OPCODE(ToggleDrawFPS);
158  DECLARE_LUA_OPCODE(ToggleDrawPerformance);
159  DECLARE_LUA_OPCODE(ToggleDrawActorStats);
160  DECLARE_LUA_OPCODE(SectEditSelect);
161  DECLARE_LUA_OPCODE(SectEditPlace);
162  DECLARE_LUA_OPCODE(SectEditDelete);
163  DECLARE_LUA_OPCODE(SectEditInsert);
164  DECLARE_LUA_OPCODE(SectEditSortAdd);
165  DECLARE_LUA_OPCODE(SectEditForgetIt);
166  DECLARE_LUA_OPCODE(FRUTEY_Begin);
167  DECLARE_LUA_OPCODE(FRUTEY_End);
168  DECLARE_LUA_OPCODE(GetFontDimensions) override;
169  DECLARE_LUA_OPCODE(GetTextObjectDimensions) override;
170  DECLARE_LUA_OPCODE(GetTextCharPosition) override;
171  DECLARE_LUA_OPCODE(SetActorRestChore) override;
172  DECLARE_LUA_OPCODE(SetActorWalkChore) override;
173  DECLARE_LUA_OPCODE(SetActorTurnChores) override;
174  DECLARE_LUA_OPCODE(SetActorTalkChore) override;
175  DECLARE_LUA_OPCODE(SetActorMumblechore) override;
176  DECLARE_LUA_OPCODE(GammaEnabled);
177  DECLARE_LUA_OPCODE(FileFindFirst) override;
178  DECLARE_LUA_OPCODE(WalkActorToAvoiding) override;
179  DECLARE_LUA_OPCODE(WalkActorVector) override;
180  DECLARE_LUA_OPCODE(LocalizeString) override;
181  DECLARE_LUA_OPCODE(WorldToScreen) override;
182  DECLARE_LUA_OPCODE(RenderModeUser) override;
183  // PS2:
184  DECLARE_LUA_OPCODE(GetMemoryCardId);
185  DECLARE_LUA_OPCODE(OverWorldToScreen);
186  DECLARE_LUA_OPCODE(SetReplayMode);
187  // ResidualVM-hacks:
188  DECLARE_LUA_OPCODE(GetResidualVMPreference);
189  DECLARE_LUA_OPCODE(SetResidualVMPreference);
190 };
191 
192 } // end of namespace Grim
193 
194 #endif
Definition: lua_v2.h:29
Definition: lua_v1.h:38
Definition: actor.h:33
Actor represents a 3D character on screen.
Definition: actor.h:72
Definition: costume.h:45