ScalerGump Class Reference

#include <ScalerGump.h>

Inheritance diagram for ScalerGump:

DesktopGump Gump Object List of all members.

Public Member Functions

 ENABLE_RUNTIME_CLASSTYPE ()
 ScalerGump (sint32 x, sint32 y, sint32 width, sint32 height)
virtual ~ScalerGump (void)
virtual void Paint (RenderSurface *surf, sint32 lerp_factor, bool scaled)
virtual void RenderSurfaceChanged ()
virtual void ParentToGump (int &px, int &py, PointRoundDir r=ROUND_TOPLEFT)
virtual void GumpToParent (int &gx, int &gy, PointRoundDir r=ROUND_TOPLEFT)
void GetScaledSize (sint32 &sw, sint32 &sh) const
void ChangeScaler (std::string scalername, int scalex, int scaley)

Protected Attributes

int swidth1
int sheight1
const Pentagram::Scalerscaler1
RenderSurfacebuffer1
int swidth2
int sheight2
const Pentagram::Scalerscaler2
RenderSurfacebuffer2
sint32 width
sint32 height

Private Member Functions

void SetupScalers ()
void DoScalerBlit (Texture *src, int swidth, int sheight, RenderSurface *dest, int dwidth, int dheight, const Pentagram::Scaler *scaler)

Static Private Member Functions

static void ConCmd_changeScaler (const Console::ArgvType &argv)
static void ConCmd_listScalers (const Console::ArgvType &argv)

Detailed Description

Definition at line 31 of file ScalerGump.h.


Constructor & Destructor Documentation

ScalerGump::ScalerGump ( sint32  x,
sint32  y,
sint32  width,
sint32  height 
)

ScalerGump constructor

Parameters:
x x coordinate of our top-left corner in parent
y y coordinate
width width after scaling (usually screenwidth)
height height after scaling (usually screenheight)
swidth1 width before scaling (usually game-width)
sheight1 height before scaling (usually game-height)
scaler1 scaler to use

Definition at line 31 of file ScalerGump.cpp.

References Console::AddConsoleCommand(), con, ConCmd_changeScaler(), ConCmd_listScalers(), and SetupScalers().

ScalerGump::~ScalerGump ( void   )  [virtual]

Definition at line 43 of file ScalerGump.cpp.

References buffer1, buffer2, con, ConCmd_changeScaler(), ConCmd_listScalers(), and Console::RemoveConsoleCommand().


Member Function Documentation

void ScalerGump::ChangeScaler ( std::string  scalername,
int  scalex,
int  scaley 
)

Definition at line 184 of file ScalerGump.cpp.

References SettingManager::get_instance(), Gump::RenderSurfaceChanged(), SettingManager::set(), and SetupScalers().

Referenced by ConCmd_changeScaler().

void ScalerGump::ConCmd_changeScaler ( const Console::ArgvType argv  )  [static, private]

"GuiApp::changeScaler" console command

Definition at line 232 of file ScalerGump.cpp.

References ChangeScaler(), Gump::FindGump(), GUIApp::get_instance(), GUIApp::getDesktopGump(), and pout.

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

void ScalerGump::ConCmd_listScalers ( const Console::ArgvType argv  )  [static, private]

"GuiApp::changeScaler" console command

Definition at line 250 of file ScalerGump.cpp.

References ScalerManager::get_instance(), ScalerManager::GetNumScalers(), ScalerManager::GetScaler(), and pout.

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

void ScalerGump::DoScalerBlit ( Texture src,
int  swidth,
int  sheight,
RenderSurface dest,
int  dwidth,
int  dheight,
const Pentagram::Scaler scaler 
) [private]

Definition at line 102 of file ScalerGump.cpp.

References Pentagram::Scaler::ScaleArbitrary(), RenderSurface::ScalerBlit(), and RenderSurface::StretchBlit().

Referenced by Paint().

ScalerGump::ENABLE_RUNTIME_CLASSTYPE (  ) 

Reimplemented from DesktopGump.

void ScalerGump::GetScaledSize ( sint32 sw,
sint32 sh 
) const [inline]

Definition at line 54 of file ScalerGump.h.

References sheight1, and swidth1.

void ScalerGump::GumpToParent ( int &  gx,
int &  gy,
PointRoundDir  r = ROUND_TOPLEFT 
) [virtual]

Definition at line 155 of file ScalerGump.cpp.

References Gump::dims, Pentagram::Rect::h, height, Gump::ROUND_BOTTOMRIGHT, Gump::ROUND_TOPLEFT, Pentagram::Rect::w, width, Gump::x, and Gump::y.

void ScalerGump::Paint ( RenderSurface surf,
sint32  lerp_factor,
bool  scaled 
) [virtual]

Paint the Gump (RenderSurface is relative to parent). Calls PaintThis and PaintChildren

Reimplemented from Gump.

Definition at line 52 of file ScalerGump.cpp.

References RenderSurface::BeginPainting(), buffer1, buffer2, Gump::children, DoScalerBlit(), RenderSurface::EndPainting(), RenderSurface::GetSurfaceAsTexture(), height, Gump::IsClosing(), Gump::IsHidden(), Gump::PaintChildren(), Gump::PaintCompositing(), scaler1, scaler2, sheight1, sheight2, swidth1, swidth2, and width.

void ScalerGump::ParentToGump ( int &  px,
int &  py,
PointRoundDir  r = ROUND_TOPLEFT 
) [virtual]

Definition at line 139 of file ScalerGump.cpp.

References Gump::dims, Pentagram::Rect::h, height, Gump::ROUND_BOTTOMRIGHT, Gump::ROUND_TOPLEFT, Pentagram::Rect::w, width, Gump::x, and Gump::y.

void ScalerGump::RenderSurfaceChanged (  )  [virtual]

Reimplemented from DesktopGump.

Definition at line 170 of file ScalerGump.cpp.

References Gump::GetDims(), Pentagram::Rect::h, height, Gump::parent, Gump::RenderSurfaceChanged(), SetupScalers(), Pentagram::Rect::w, and width.

void ScalerGump::SetupScalers (  )  [private]

Definition at line 197 of file ScalerGump.cpp.

References buffer1, buffer2, con, RenderSurface::CreateSecondaryRenderSurface(), Gump::dims, SettingManager::get(), ScalerManager::get_instance(), SettingManager::get_instance(), ScalerManager::GetPointScaler(), ScalerManager::GetScaler(), Pentagram::Rect::h, height, MM_INFO, Console::Printf(), scaler1, Pentagram::Scaler::ScalerCopyright(), Pentagram::Scaler::ScalerDesc(), SettingManager::setDefault(), sheight1, swidth1, Pentagram::Rect::w, and width.

Referenced by ChangeScaler(), RenderSurfaceChanged(), and ScalerGump().


Member Data Documentation

RenderSurface* ScalerGump::buffer1 [protected]

Definition at line 61 of file ScalerGump.h.

Referenced by Paint(), SetupScalers(), and ~ScalerGump().

RenderSurface* ScalerGump::buffer2 [protected]

Definition at line 66 of file ScalerGump.h.

Referenced by Paint(), SetupScalers(), and ~ScalerGump().

sint32 ScalerGump::height [protected]

Definition at line 69 of file ScalerGump.h.

Referenced by GumpToParent(), Paint(), ParentToGump(), RenderSurfaceChanged(), and SetupScalers().

const Pentagram::Scaler* ScalerGump::scaler1 [protected]

Definition at line 60 of file ScalerGump.h.

Referenced by Paint(), and SetupScalers().

const Pentagram::Scaler* ScalerGump::scaler2 [protected]

Definition at line 65 of file ScalerGump.h.

Referenced by Paint().

int ScalerGump::sheight1 [protected]

Definition at line 59 of file ScalerGump.h.

Referenced by GetScaledSize(), Paint(), and SetupScalers().

int ScalerGump::sheight2 [protected]

Definition at line 64 of file ScalerGump.h.

Referenced by Paint().

int ScalerGump::swidth1 [protected]

Definition at line 58 of file ScalerGump.h.

Referenced by GetScaledSize(), Paint(), and SetupScalers().

int ScalerGump::swidth2 [protected]

Definition at line 63 of file ScalerGump.h.

Referenced by Paint().

sint32 ScalerGump::width [protected]

Definition at line 68 of file ScalerGump.h.

Referenced by GumpToParent(), Paint(), ParentToGump(), RenderSurfaceChanged(), and SetupScalers().


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