Shape Class Reference

#include <Shape.h>

Inheritance diagram for Shape:

ShapeFont List of all members.

Public Member Functions

 Shape (const uint8 *data, uint32 size, const ConvertShapeFormat *format, const uint16 flexId, const uint32 shapenum)
 Shape (IDataSource *src, const ConvertShapeFormat *format)
virtual ~Shape ()
void setPalette (const Pentagram::Palette *pal)
const Pentagram::PalettegetPalette () const
uint32 frameCount () const
void getTotalDimensions (sint32 &w, sint32 &h, sint32 &x, sint32 &y) const
ShapeFramegetFrame (unsigned int frame)
void getShapeId (uint16 &flexId, uint32 &shapenum)
 ENABLE_RUNTIME_CLASSTYPE ()
 ENABLE_CUSTOM_MEMORY_ALLOCATION ()

Static Public Member Functions

static const ConvertShapeFormatDetectShapeFormat (const uint8 *data, uint32 size)
static const ConvertShapeFormatDetectShapeFormat (IDataSource *ds, uint32 size)

Protected Member Functions

void LoadU8Format (const uint8 *data, uint32 size, const ConvertShapeFormat *format)
void LoadPentagramFormat (const uint8 *data, uint32 size, const ConvertShapeFormat *format)
void LoadGenericFormat (const uint8 *data, uint32 size, const ConvertShapeFormat *format)

Protected Attributes

std::vector< ShapeFrame * > frames
const Pentagram::Palettepalette
const uint8data
uint32 size
const uint16 flexId
const uint32 shapenum

Detailed Description

Definition at line 29 of file Shape.h.


Constructor & Destructor Documentation

Shape::Shape ( const uint8 data,
uint32  size,
const ConvertShapeFormat format,
const uint16  flexId,
const uint32  shapenum 
)

Definition at line 32 of file Shape.cpp.

References DetectShapeFormat(), LoadGenericFormat(), LoadPentagramFormat(), LoadU8Format(), palette, PentagramShapeFormat, perr, U82DShapeFormat, and U8ShapeFormat.

Shape::Shape ( IDataSource src,
const ConvertShapeFormat format 
)

Definition at line 59 of file Shape.cpp.

References data, DetectShapeFormat(), IDataSource::getSize(), LoadGenericFormat(), LoadPentagramFormat(), LoadU8Format(), palette, PentagramShapeFormat, perr, IDataSource::read(), size, U82DShapeFormat, and U8ShapeFormat.

Shape::~Shape (  )  [virtual]

Definition at line 88 of file Shape.cpp.

References data, and frames.


Member Function Documentation

const ConvertShapeFormat * Shape::DetectShapeFormat ( IDataSource ds,
uint32  size 
) [static]

Definition at line 215 of file Shape.cpp.

References ConvertShape::CheckUnsafe(), Crusader2DShapeFormat, CrusaderShapeFormat, PentagramShapeFormat, U82DShapeFormat, U8CMPShapeFormat, U8ShapeFormat, and U8SKFShapeFormat.

const ConvertShapeFormat * Shape::DetectShapeFormat ( const uint8 data,
uint32  size 
) [static]

Definition at line 209 of file Shape.cpp.

Referenced by ShapeArchive::cache(), FontShapeArchive::cache(), load_image(), and Shape().

Shape::ENABLE_CUSTOM_MEMORY_ALLOCATION (  ) 

Shape::ENABLE_RUNTIME_CLASSTYPE (  ) 

Reimplemented in ShapeFont.

uint32 Shape::frameCount (  )  const [inline]

Definition at line 42 of file Shape.h.

References frames.

Referenced by Item::animateItem(), GUIApp::CreateHWCursors(), Actor::die(), ShapeFont::getBaseline(), ShapeFont::getHeight(), JPFont::JPFont(), load_image(), TypeFlags::loadArmourInfo(), and ShapeViewerGump::OnKeyDown().

ShapeFrame* Shape::getFrame ( unsigned int  frame  )  [inline]

Definition at line 49 of file Shape.h.

References frames.

Referenced by ItemSorter::AddItem(), GUIApp::CreateHWCursors(), JPRenderedText::draw(), JPRenderedText::drawBlended(), ShapeFont::getBaseline(), GameData::getFrame(), ShapeFont::getHeight(), ShapeFont::getWidth(), JPFont::getWidth(), U8SaveGump::InitGump(), SlidingWidget::InitGump(), SliderGump::InitGump(), ScrollGump::InitGump(), ReadableGump::InitGump(), QuitGump::InitGump(), PagedGump::InitGump(), MiniStatsGump::InitGump(), MenuGump::InitGump(), ContainerGump::InitGump(), ButtonWidget::InitGump(), BookGump::InitGump(), load_frame(), load_image(), Gump::PaintThis(), ContainerGump::PaintThis(), Gump::PointOnGump(), MiniMapGump::sampleAtPoint(), Gump::SetShape(), PaperdollGump::StartDraggingItem(), ItemSorter::Trace(), PaperdollGump::TraceObjId(), and ContainerGump::TraceObjId().

const Pentagram::Palette* Shape::getPalette (  )  const [inline]

Definition at line 40 of file Shape.h.

References palette.

Referenced by JPRenderedText::draw(), JPRenderedText::drawBlended(), and MiniMapGump::sampleAtPoint().

void Shape::getShapeId ( uint16 flexId,
uint32 shapenum 
)

Definition at line 96 of file Shape.cpp.

References flexId, and shapenum.

Referenced by Gump::saveData(), and ButtonWidget::saveData().

void Shape::getTotalDimensions ( sint32 w,
sint32 h,
sint32 x,
sint32 y 
) const

Returns the dimensions of all frames combined (w,h) = size of smallest rectangle covering all frames (x,y) = coordinates of origin relative to top-left point of rectangle

Definition at line 237 of file Shape.cpp.

References frame, frames, ShapeFrame::height, ShapeFrame::width, ShapeFrame::xoff, and ShapeFrame::yoff.

Referenced by ShapeViewerGump::OnKeyDown().

void Shape::LoadGenericFormat ( const uint8 data,
uint32  size,
const ConvertShapeFormat format 
) [protected]

Definition at line 149 of file Shape.cpp.

References ConvertShapeFormat::bytes_frame_length, ConvertShapeFormat::bytes_frame_length_kludge, ConvertShapeFormat::bytes_frame_offset, ConvertShapeFormat::bytes_frameheader_unk, ConvertShapeFormat::bytes_header_unk, ConvertShapeFormat::bytes_ident, ConvertShapeFormat::bytes_num_frames, ConvertShapeFormat::bytes_special, ConvertShape::CalcNumFrames(), frames, ConvertShapeFormat::ident, ConvertShapeFormat::len_frameheader, ConvertShapeFormat::len_header, prev, IBufferDataSource::read(), IBufferDataSource::read1(), IDataSource::readX(), and IBufferDataSource::skip().

Referenced by LoadPentagramFormat(), LoadU8Format(), and Shape().

void Shape::LoadPentagramFormat ( const uint8 data,
uint32  size,
const ConvertShapeFormat format 
) [protected]

Definition at line 129 of file Shape.cpp.

References frames, and LoadGenericFormat().

Referenced by Shape().

void Shape::LoadU8Format ( const uint8 data,
uint32  size,
const ConvertShapeFormat format 
) [protected]

Definition at line 109 of file Shape.cpp.

References frames, and LoadGenericFormat().

Referenced by Shape().

void Shape::setPalette ( const Pentagram::Palette pal  )  [inline]

Definition at line 39 of file Shape.h.

References pal, and palette.

Referenced by ShapeArchive::cache(), FontShapeArchive::cache(), JPRenderedText::draw(), JPRenderedText::drawBlended(), load_image(), GameData::loadRemorseData(), GameData::loadU8Data(), and SKFPlayer::run().


Member Data Documentation

const uint8* Shape::data [protected]

Definition at line 78 of file Shape.h.

Referenced by Shape(), and ~Shape().

const uint16 Shape::flexId [protected]

Definition at line 80 of file Shape.h.

Referenced by getShapeId().

std::vector<ShapeFrame*> Shape::frames [protected]

Definition at line 74 of file Shape.h.

Referenced by frameCount(), getFrame(), getTotalDimensions(), LoadGenericFormat(), LoadPentagramFormat(), LoadU8Format(), and ~Shape().

const Pentagram::Palette* Shape::palette [protected]

Definition at line 76 of file Shape.h.

Referenced by getPalette(), setPalette(), and Shape().

const uint32 Shape::shapenum [protected]

Definition at line 81 of file Shape.h.

Referenced by getShapeId().

uint32 Shape::size [protected]

Definition at line 79 of file Shape.h.

Referenced by Shape().


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 22:29:55 2007 for pentagram by  doxygen 1.4.7