You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
2.8 KiB
C++
82 lines
2.8 KiB
C++
//
|
|
// G A M E.O.N.E - LOW LEVEL LIB V1.0
|
|
// Copyright (C) 2001 LEVEL ONE ENTERTAINMENT,
|
|
// Licensed under the terms of LGPL.
|
|
//:---------------------------------------------------------------------------
|
|
//:Description
|
|
//
|
|
// FRAMEWORK global object class LAYER
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
#if !defined(_LAYER_H)
|
|
#define _LAYER_H
|
|
|
|
#include "llfrm_actor.h"
|
|
|
|
|
|
class CLayer : public CActor
|
|
{
|
|
public:
|
|
CLayer();
|
|
virtual ~CLayer();
|
|
|
|
const char * GetName() { return m_obj_name; };
|
|
int GetZOrder() { return m_zorder; };
|
|
|
|
void SetName(const char * name);
|
|
void SetZOrder(int newZorder );
|
|
void SetAnchor(const char * name );
|
|
|
|
virtual bool Message(const char *Type );
|
|
virtual void SendMsg(const char *Type );
|
|
|
|
virtual bool ParseMsg(const char * arg); // override
|
|
|
|
llgfx_sRECT m_cliprect;
|
|
|
|
bool m_visible; // state flag
|
|
bool m_valid; // true when initialized
|
|
|
|
bool m_bParalax;
|
|
CVec2f m_paralax; // faktor x,y
|
|
bool m_tileblit;
|
|
|
|
static CVec2f last_position; // used by the offset message
|
|
|
|
/************************************************************************/
|
|
/* Native C++ msg interface */
|
|
/************************************************************************/
|
|
void visible(bool vis) { m_visible = vis; }
|
|
void xypos(CVec2f &newpos) { last_position = m_position = newpos; }
|
|
void xpos(float newx) { last_position.m_u = m_position.m_u = newx; }
|
|
void ypos(float newy) { last_position.m_v = m_position.m_v = newy; }
|
|
void offset(CVec2f &offset) { m_position = offset + last_position; last_position= m_position;}
|
|
void cliprect(s_rect &newcliprect) { ll2d::CopyRect(m_cliprect,newcliprect); m_bVDBlit = !ll2d::IsRectEmpty(m_cliprect); }
|
|
void blitfx_angle(float newangle){ m_blitfx.angle_z = newangle; } // radians
|
|
void blitfx_scale_x(float newscale) { m_scale.m_u = newscale; };
|
|
void blitfx_scale_y(float newscale) { m_scale.m_v = newscale; };
|
|
void blitfx_fixalpha(float newalpha) { m_blitfx.fixalpha = newalpha; };
|
|
void blitfx_color(TxU32 color) { m_blitfx.color1 = color; };
|
|
void blitflag( int newblitflags) { m_blitflag = newblitflags; }
|
|
void zorder(int newzorder) { m_zorder=newzorder; CRoot::PostMsg("layer.sort"); }
|
|
void paralax(CVec2f &dir){m_paralax = dir; m_bParalax = (dir!= CVec2f(1.0f,1.0f));};
|
|
void setparent(const char*parentname){CActor * parent; if( gl_root && NULL!= (parent = gl_root->FindActor( parentname )) ) {SetParent( parent );}}
|
|
void script_parse(const char*script){CActor::ParseLine(script);}
|
|
void script(const char*scriptfilename){ CActor::ParseSkriptFile(scriptfilename); }
|
|
|
|
|
|
protected:
|
|
const char *cur_msg; // temp pointer, set by Message()
|
|
virtual const char * ExtractMessage( const char * message );
|
|
|
|
int m_zorder; // layer zorder
|
|
|
|
protected:
|
|
bool m_bVDBlit; // true if cliprect set
|
|
|
|
};
|
|
|
|
#endif // !defined(_LAYER_H)
|