22 #ifndef TITANIC_GAME_OBJECT_H 23 #define TITANIC_GAME_OBJECT_H 25 #include "audio/mixer.h" 26 #include "common/stream.h" 27 #include "titanic/core/named_item.h" 28 #include "titanic/sound/proximity.h" 29 #include "titanic/sound/sound_manager.h" 30 #include "titanic/support/mouse_cursor.h" 31 #include "titanic/support/credit_text.h" 32 #include "titanic/support/movie_range_info.h" 33 #include "titanic/support/rect.h" 34 #include "titanic/support/strings.h" 35 #include "titanic/support/movie_clip.h" 36 #include "titanic/pet_control/pet_section.h" 37 #include "titanic/gfx/text_control.h" 38 #include "titanic/game_state.h" 42 enum Find { FIND_GLOBAL = 1, FIND_ROOM = 2, FIND_PET = 4, FIND_MAILMAN = 8 };
43 enum Found { FOUND_NONE = 0, FOUND_GLOBAL = 1, FOUND_ROOM = 2, FOUND_PET = 3, FOUND_MAILMAN = 4 };
44 enum RoomFlagsComparison { RFC_LOCATION = 1, RFC_CLASS_ELEVATOR = 2, RFC_TITANIA = 3 };
46 enum StarControlAction {
52 STAR_VIEW_CONSTELLATIONS,
53 STAR_VIEW_RANDOM_STAR,
55 STAR_TOGGLE_STEREO_PAIR,
56 STAR_TOGGLE_HOME_PHOTO,
57 STAR_TOGGLE_SOLAR_RENDERING,
58 STAR_TOGGLE_POS_FRAME,
69 class CDontSaveFileItem;
74 class CMouseDragStartMsg;
83 static int _soundHandles[4];
88 void loadResource(
const CString &name);
93 void processMoveRangeInfo();
99 bool clipRect(
const Rect &rect1,
Rect &rect2)
const;
107 byte _toggleR, _toggleG, _toggleB;
114 uint _textBorderRight;
233 int playSound(
const CString &name, uint volume = 100,
int balance = 0,
bool repeated =
false);
250 int queueSound(
const CString &name, uint priorHandle, uint volume = 100,
int balance = 0,
258 void stopSound(
int handle, uint seconds = 0);
308 int addTimer(
int endVal, uint firstDuration, uint repeatDuration);
313 int addTimer(uint firstDuration, uint repeatDuration = 0);
333 void sleep(uint milli);
344 bool compareViewNameTo(
const CString &name)
const;
409 void playClip(uint startFrame, uint endFrame);
561 bool _handleMouseFlag;
627 virtual bool isPet()
const;
633 bool checkPoint(
const Point &pt,
bool ignoreSurface =
false,
bool visibleOnly =
false);
662 void playMovie(
int startFrame,
int endFrame, uint flags);
667 void playMovie(
int startFrame,
int endFrame,
int initialFrame, uint flags);
763 static bool compareRoomFlags(RoomFlagsComparison compareType, uint flags1, uint flags2);
775 void setText(
const CString &str,
int border = 0,
int borderRight = 0);
852 void addMail(uint destRoomFlags);
857 void sendMail(uint currRoomFlags, uint newRoomFlags);
884 bool petCheckNode(
const CString &name);
1006 void starFn(StarControlAction action);
Definition: mouse_messages.h:150
CViewItem * getView() const
CRoomItem * findRoomByName(const CString &name)
const CMovieClipList * getMovieClips() const override
Definition: game_object.h:592
void petReassignRoom(PassengerClass passClassNum)
void petHighlightGlyph(int id)
bool isBotDisallowedLocation()
Definition: text_control.h:35
int petGetRoomsWellEntry() const
CMailMan * getMailMan() const
Definition: dont_save_file_item.h:29
CGameObject * getDraggingObject() const
CGameObject * getMailManNextObject(CGameObject *prior) const
bool hasActiveMovie() const
bool surfaceHasFrame() const
void startTalking(CTrueTalkNPC *npc, uint id, CViewItem *view=nullptr)
CNodeItem * getNode() const
void petSetArea(PetArea newArea) const
void setMailDest(uint roomFlags)
CTextCursor * getTextCursor() const
void petDisplayMessage(int unused, StringId stringId)
CString getFullViewName()
bool changeView(const CString &viewName, const CString &clipName)
void setTextColor(byte r, byte g, byte b)
CGameObject * getHiddenObject(const CString &name) const
void setTalking(CTrueTalkNPC *npc, bool viewFlag, CViewItem *view=nullptr)
Definition: true_talk_npc.h:43
int getMovieFrame() const
CMusicRoom * getMusicRoom() const
void playMovie(uint flags)
void setAmbientSoundVolume(VolumeMode mode, uint seconds, int handleIndex)
Point getMousePos() const
void stopAmbientSound(bool transition, int handleIndex)
Definition: credit_text.h:48
void load(SimpleFile *file) override
Definition: proximity.h:36
Definition: mail_man.h:29
int getRandomNumber(int max, int *oldVal=nullptr)
CGameObject * getNextMail(CGameObject *prior)
void mouseSetPosition(const Point &pt, double rate)
void talkSetDialRegion(const CString &name, int dialNum, int regionNum)
Movement getMovement() const
Found find(const CString &name, CGameObject **item, int findAreas)
CGameObject * findRoomObject(const CString &name) const
Definition: simple_file.h:49
void gotoView(const CString &viewName, const CString &clipName)
Definition: saveable_object.h:35
void petMoveToHiddenRoom()
void addMail(uint destRoomFlags)
Definition: movie_range_info.h:76
void mouseDisableControl()
void setSoundVolume(int handle, uint percent, uint seconds)
Definition: room_item.h:33
Definition: named_item.h:33
Definition: node_item.h:29
int playSound(const CString &name, uint volume=100, int balance=0, bool repeated=false)
void movieSetPlaying(bool flag)
CRoomItem * getRoom() const
CGameObject * getMailManFirstObject() const
Definition: screen_manager.h:49
CString getViewFullName() const
PassengerClass getPriorClass() const
int startAnimTimer(const CString &action, uint firstDuration, uint repeatDuration=0)
CDontSaveFileItem * getDontSave() const
void stateSetSoundMakerAllowed(bool flag)
void playClip(const CString &name, uint flags=0)
bool checkPoint(const Point &pt, bool ignoreSurface=false, bool visibleOnly=false)
void petSetRoomsWellEntry(int entryNum)
Definition: game_object.h:79
void freeSurface() override
SoundType
Definition: mixer.h:62
void playAmbientSound(const CString &resName, VolumeMode mode, bool initialMute, bool repeated, int handleIndex, Audio::Mixer::SoundType soundType=Audio::Mixer::kMusicSoundType)
bool starIsSolved() const
Point getControid() const
CRoomItem * locateRoom(const CString &name) const
void draw(CScreenManager *screenManager) override
void setMovieFrameRate(double rate)
void starFn(StarControlAction action)
int getFrameNumber() const
Definition: game_object.h:692
void petSetRoomsElevatorBroken(bool flag)
void unlockInputHandler()
bool isSoundActive(int handle) const
void stopAnimTimer(int id)
Definition: tree_item.h:37
bool clipExistsByStart(const CString &name, int startFrame=0) const
void setPassengerClass(PassengerClass newClass)
void save(SimpleFile *file, int indent) override
bool mailExists(uint roomFlags) const
void loadMovie(const CString &name, bool pendingFlag=true)
void petAddToCarryParcel(CGameObject *obj)
void sendMail(uint currRoomFlags, uint newRoomFlags)
void playRandomClip(const char *const *names, uint flags=0)
int queueSound(const CString &name, uint priorHandle, uint volume=100, int balance=0, bool repeated=false, Audio::Mixer::SoundType soundType=Audio::Mixer::kPlainSoundType)
void loadFrame(int frameNumber)
CPetControl * getPetControl() const
void setPosition(const Point &newPos)
uint getNodeChangedCtr() const
void setTextFontNumber(int fontNumber)
Definition: text_cursor.h:33
bool petDismissBot(const CString &name)
CTreeItem * getDontSaveChild(ClassDef *classDef) const
static bool compareRoomFlags(RoomFlagsComparison compareType, uint flags1, uint flags2)
void setTextHasBorders(bool hasBorders)
CViewItem * parseView(const CString &viewString)
void loadImage(const CString &name, bool pendingFlag=true)
bool playCutscene(uint startFrame, uint endFrame)
bool compareRoomNameTo(const CString &name)
Definition: movie_clip.h:69
void petOnSummonBot(const CString &name, int val)
void setText(const CString &str, int border=0, int borderRight=0)
int addTimer(int endVal, uint firstDuration, uint repeatDuration)
void stopSoundChannel(bool channel3)
CGameObject * findMail(uint roomFlags) const
void mouseEnableControl()
CTreeItem * findUnder(CTreeItem *parent, const CString &name) const
PassengerClass getPassengerClass() const
uint getNodeEnterTicks() const
bool findPoint(Quadrant quadrant, Point &pt)
void stopSound(int handle, uint seconds=0)
CStarControl * getStarControl() const
Rect getBounds() const override
Definition: video_surface.h:43
CGameObject * findMailByFlags(RoomFlagsComparison compareType, uint roomFlags)
void setToggleColor(byte r, byte g, byte b)
void petSetRemoteTarget()
bool petDoorOrBellbotPresent() const
int talkGetDialRegion(const CString &name, int dialNum)
bool stateGetParrotMet() const
void setVisible(bool val)
int getClipDuration(const CString &name, int frameRate=14) const
CGameObject * findInRoom(const CString &name)
int getParrotResponse() const
void dragMove(const Point &pt)
Season stateGetSeason() const
Common::SeekableReadStream * getResource(const CString &name)
Definition: music_room.h:33
void loadSound(const CString &name)
Definition: pet_control.h:45
CString getRoomName() const
Definition: star_control.h:33
virtual bool isPet() const
CRoomItem * getHiddenRoom() const
Definition: view_item.h:32
CString getRoomNodeName() const
bool clipExistsByEnd(const CString &name, int endFrame=0) const
bool checkStartDragging(CMouseDragStartMsg *msg)