mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-22 09:49:11 +00:00
124 lines
3.7 KiB
C++
124 lines
3.7 KiB
C++
/* ScummVM - Graphic Adventure Engine
|
|
*
|
|
* ScummVM is the legal property of its developers, whose names
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
* file distributed with this source distribution.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
*
|
|
*/
|
|
|
|
/*
|
|
* This file is based on WME Lite.
|
|
* http://dead-code.org/redir.php?target=wmelite
|
|
* Copyright (c) 2011 Jan Nedoma
|
|
*/
|
|
|
|
#ifndef WINTERMUTE_ADOBJECT_H
|
|
#define WINTERMUTE_ADOBJECT_H
|
|
|
|
#include "AdTypes.h"
|
|
#include "PartEmitter.h"
|
|
|
|
namespace WinterMute {
|
|
|
|
class CAdWaypointGroup;
|
|
class CAdRegion;
|
|
class CAdSentence;
|
|
class CBFont;
|
|
class CBRegion;
|
|
class CAdInventory;
|
|
|
|
#define MAX_NUM_REGIONS 10
|
|
|
|
class CAdObject : public CBObject {
|
|
public:
|
|
CPartEmitter *_partEmitter;
|
|
virtual CPartEmitter *CreateParticleEmitter(bool FollowParent = false, int OffsetX = 0, int OffsetY = 0);
|
|
virtual HRESULT UpdatePartEmitter();
|
|
bool _partFollowParent;
|
|
int _partOffsetX;
|
|
int _partOffsetY;
|
|
|
|
HRESULT InvalidateCurrRegions();
|
|
bool _subtitlesModRelative;
|
|
bool _subtitlesModXCenter;
|
|
int _subtitlesModX;
|
|
int _subtitlesModY;
|
|
int _subtitlesWidth;
|
|
CAdRegion *_stickRegion;
|
|
bool _sceneIndependent;
|
|
bool _ignoreItems;
|
|
HRESULT UpdateBlockRegion();
|
|
bool _forcedTalkAnimUsed;
|
|
char *_forcedTalkAnimName;
|
|
virtual bool GetExtendedFlag(char *FlagName);
|
|
virtual HRESULT ResetSoundPan();
|
|
virtual HRESULT UpdateSounds();
|
|
HRESULT Reset();
|
|
DECLARE_PERSISTENT(CAdObject, CBObject)
|
|
virtual void Talk(char *Text, char *Sound = NULL, uint32 Duration = 0, char *Stances = NULL, TTextAlign Align = TAL_CENTER);
|
|
virtual int GetHeight();
|
|
CAdSentence *_sentence;
|
|
HRESULT SetFont(char *Filename);
|
|
virtual HRESULT Update();
|
|
virtual HRESULT Display();
|
|
bool _drawn;
|
|
bool _active;
|
|
virtual HRESULT PlayAnim(char *Filename);
|
|
CBSprite *_animSprite;
|
|
CBSprite *_currentSprite;
|
|
TObjectState _state;
|
|
TObjectState _nextState;
|
|
TObjectType _type;
|
|
CAdObject(CBGame *inGame);
|
|
virtual ~CAdObject();
|
|
CBFont *_font;
|
|
CBSprite *_tempSprite2;
|
|
CBRegion *_blockRegion;
|
|
CAdWaypointGroup *_wptGroup;
|
|
CBRegion *_currentBlockRegion;
|
|
CAdWaypointGroup *_currentWptGroup;
|
|
CAdInventory *GetInventory();
|
|
|
|
virtual HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent);
|
|
|
|
virtual HRESULT AfterMove();
|
|
CAdRegion *_currentRegions[MAX_NUM_REGIONS];
|
|
|
|
// scripting interface
|
|
virtual CScValue *ScGetProperty(char *Name);
|
|
virtual HRESULT ScSetProperty(char *Name, CScValue *Value);
|
|
virtual HRESULT ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, char *Name);
|
|
virtual char *ScToString();
|
|
|
|
CBArray<CAdObject *, CAdObject *> _attachmentsPre;
|
|
CBArray<CAdObject *, CAdObject *> _attachmentsPost;
|
|
|
|
HRESULT UpdateSpriteAttachments();
|
|
HRESULT DisplaySpriteAttachments(bool PreDisplay);
|
|
CAdObject *_registerAlias;
|
|
private:
|
|
HRESULT DisplaySpriteAttachment(CAdObject *Attachment);
|
|
CAdInventory *_inventory;
|
|
|
|
protected:
|
|
HRESULT GetScale(float *ScaleX, float *ScaleY);
|
|
};
|
|
|
|
} // end of namespace WinterMute
|
|
|
|
#endif
|