#include <ScalerGump.h>
Inheritance diagram for ScalerGump:
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::Scaler * | scaler1 |
RenderSurface * | buffer1 |
int | swidth2 |
int | sheight2 |
const Pentagram::Scaler * | scaler2 |
RenderSurface * | buffer2 |
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) |
Definition at line 31 of file ScalerGump.h.
ScalerGump constructor
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().
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::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().
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] |
const Pentagram::Scaler* ScalerGump::scaler2 [protected] |
int ScalerGump::sheight1 [protected] |
Definition at line 59 of file ScalerGump.h.
Referenced by GetScaledSize(), Paint(), and SetupScalers().
int ScalerGump::sheight2 [protected] |
int ScalerGump::swidth1 [protected] |
Definition at line 58 of file ScalerGump.h.
Referenced by GetScaledSize(), Paint(), and SetupScalers().
int ScalerGump::swidth2 [protected] |
sint32 ScalerGump::width [protected] |
Definition at line 68 of file ScalerGump.h.
Referenced by GumpToParent(), Paint(), ParentToGump(), RenderSurfaceChanged(), and SetupScalers().