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.

78 lines
1.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 Layerobject - displays a single bitmap
//
// CActor
// +--CLayer
// +--CLayerSurface
//
// Displays a Color Surface
//
//:---------------------------------------------------------------------------
//////////////////////////////////////////////////////////////////////
#if !defined(_LAYER_SURFACE_H)
#define _LAYER_SURFACE_H
#include "llfrm_layer.h"
#include "../llgfx_blit.h"
class CLayerSurface : public CLayer
{
public:
CLayerSurface();
virtual ~CLayerSurface();
virtual bool ParseMsg(const char *Type );
virtual void Draw(llgfx_id id );
virtual void Action(float delta);
TxU32 m_color;
/************************************************************************/
/* Native C++ Interface */
/************************************************************************/
void color(TxU32 color )
{
m_color = color;
}
void CLayerSurface::xysize(int cx, int cy)
{
m_bounding_rect.x1 = m_bounding_rect.y1 = 0;
m_bounding_rect.x2 = cx;
m_bounding_rect.y2 = cy;
}
void CLayerSurface::xysize(float cx, float cy)
{
m_bounding_rect.x1 = m_bounding_rect.y1 = 0;
m_bounding_rect.x2 = (int)cx;
m_bounding_rect.y2 = (int)cy;
}
void CLayerSurface::xysize(s_rect *rect)
{
m_bounding_rect.x1 = m_bounding_rect.y1 = 0;
m_bounding_rect.x2 = ll2d::WIDTH(rect);
m_bounding_rect.y2 = ll2d::HEIGHT(rect);
}
void CLayerSurface::xysize(s_rect &rect)
{
m_bounding_rect.x1 = m_bounding_rect.y1 = 0;
m_bounding_rect.x2 = ll2d::WIDTH(rect);
m_bounding_rect.y2 = ll2d::HEIGHT(rect);
}
};
#endif // !defined(_LAYER_SURFACE_H)