Advanced Strategic Command
|
#include <surface.h>
Public Member Functions | |
Surface (SDL_Surface *surface) | |
Surface (const SDLmm::Surface &other) | |
Surface () | |
Surface | Duplicate () const |
void | newFromBGI (void *img) |
Creates an image from an BGI image structure. More... | |
void * | toBGI () const |
void | FillTransparent () |
void | read (tnstream &stream) |
void | readImageFile (tnstream &stream) |
void | write (tnstream &stream) const |
void | strech (int width, int height) |
void | writeDefaultPixelFormat (tnstream &stream) |
void | assignDefaultPalette () |
assigns the default ASC palette to the surface (only for 8 Bit surfaces) More... | |
void | assignPalette (SDL_Color *colors, int startColor=0, int colorNum=256) |
void | detectColorKey (bool RLE=false) |
tries to automatically detect the color key of the surface More... | |
bool | isTransparent (SDLmm::Color col) const |
void | ColorKey2AlphaChannel () |
bool | hasAlpha () |
int | getMemoryFootprint () const |
SDL_Surface * | getBaseSurface () |
const SDL_Surface * | getBaseSurface () const |
~Surface () | |
Static Public Member Functions | |
static Surface | createSurface (int width, int height, SDLmm::Color color=255) |
static Surface | createSurface (int width, int height, int depth, SDLmm::Color color=0xff0000ff) |
static Surface | Wrap (SDL_Surface *surface) |
static void | SetScreen (SDL_Surface *screen) |
static void | readDefaultPixelFormat (tnstream &stream) |
Static Public Attributes | |
static const Uint32 | transparent = 0 |
static const Uint32 | opaque = 255l |
Protected Member Functions | |
virtual int | getDepthFormat () |
void | convert () |
|
explicit |
Definition at line 145 of file surface.cpp.
References convert().
Surface::Surface | ( | const SDLmm::Surface & | other | ) |
Definition at line 198 of file surface.cpp.
References convert().
Surface::~Surface | ( | ) |
Definition at line 531 of file surface.cpp.
void Surface::assignDefaultPalette | ( | ) |
assigns the default ASC palette to the surface (only for 8 Bit surfaces)
Definition at line 429 of file surface.cpp.
References pal.
Referenced by copy2screen(), createSurface(), loadASCFieldImageArray(), MapDisplayPG::MapDisplayPG(), read(), VehicleType::runTextIO(), and strech().
void Surface::assignPalette | ( | SDL_Color * | colors, |
int | startColor = 0 , |
||
int | colorNum = 256 |
||
) |
Definition at line 444 of file surface.cpp.
void Surface::ColorKey2AlphaChannel | ( | ) |
Definition at line 734 of file surface.cpp.
References transparent.
Referenced by loadASCFieldImageArray().
|
protected |
Definition at line 151 of file surface.cpp.
References createSurface().
Referenced by read(), readImageFile(), and Surface().
|
static |
Definition at line 387 of file surface.cpp.
Referenced by applyLegacyFieldMask(), GuiFunctions::buildGuiIcon(), convert(), MapDisplayPG::createMovementBufferSurface(), VehicleTypeImage::display(), BuildingTypeBaseWidget::display(), VehicleTypeBaseWidget::display(), TechWidget::display(), VehicleBaseWidget::display(), BuildingItem::display(), MapComponent::displayClip(), StoringPosition::eventMouseMotion(), GuiFunctions::generate_gui_build_icon(), Building::getImage(), Vehicle::getImage(), initASCGraphicSubsystem(), loadASCFieldImageArray(), loadmapfromstream(), BuildingType::runTextIO(), MapDisplayPG::setNewZoom(), StoringPosition::StoringPosition(), ASCImageArrayProperty::toString(), WholeMapRenderer::WholeMapRenderer(), and writemaptostream().
|
static |
Definition at line 394 of file surface.cpp.
References assignDefaultPalette().
void Surface::detectColorKey | ( | bool | RLE = false | ) |
tries to automatically detect the color key of the surface
Definition at line 493 of file surface.cpp.
References hasAlpha().
Referenced by applyFieldMask(), applyLegacyFieldMask(), loadASCFieldImageArray(), rotateSurface(), and strech().
Surface Surface::Duplicate | ( | ) | const |
Definition at line 85 of file surface.cpp.
References nullParam.
Referenced by OverviewMapHolder::drawNextField(), and rotateSurface().
void Surface::FillTransparent | ( | ) |
Definition at line 419 of file surface.cpp.
Referenced by BuildingItem::display(), and StoringPosition::eventDraw().
|
inline |
Definition at line 116 of file surface.h.
Referenced by AmmoTransferWindow::AmmoTransferWindow(), CargoDialog::CargoDialog(), copy2screen(), SavegameWidget::display(), TextRenderer::eval_command(), StoringPosition::eventBlit(), StoringPosition::eventMouseMotion(), getMemoryFootprint(), InternalAmmoTransferWindow::InternalAmmoTransferWindow(), VisibilityLayer::paintSingleField(), ASCGUI_Window::parsePanelASCTXT(), GuiButton::registerFunc(), WholeMapRenderer::renderVisibility(), VehicleTypeRenderer::renderWidget(), DataTab::setData(), ASCGUI_Window::setImage(), showSurfaceInfo(), StartupScreen::StartupScreen(), UnitInfoDialog::UnitInfoDialog(), and WeaponInfoPanel::WeaponInfoPanel().
|
inline |
|
inlineprotectedvirtual |
Reimplemented in TypedSurface< colorDepth >.
int Surface::getMemoryFootprint | ( | ) | const |
Definition at line 716 of file surface.cpp.
References getBaseSurface().
Referenced by VehicleType::getMemoryFootprint().
bool Surface::hasAlpha | ( | ) |
Definition at line 476 of file surface.cpp.
Referenced by applyLegacyFieldMask(), and detectColorKey().
bool Surface::isTransparent | ( | SDLmm::Color | col | ) | const |
Definition at line 515 of file surface.cpp.
References opaque.
Referenced by OverviewMapImage::create().
void Surface::newFromBGI | ( | void * | img | ) |
Creates an image from an BGI image structure.
void Surface::read | ( | tnstream & | stream | ) |
Definition at line 265 of file surface.cpp.
References assignDefaultPalette(), convert(), tnstream::getLocation(), trleheader::id, tnstream::readdata(), tnstream::readInt(), tnstream::readUint8(), tnstream::readWord(), trleheader::rle, trleheader::size, surfaceVersion, uncompress_rlepict(), trleheader::x, and trleheader::y.
Referenced by GraphicSetManager_Base::loadData(), BuildingType::read(), ObjectType::read(), and VehicleType::read().
|
static |
Definition at line 205 of file surface.cpp.
References readSDLPixelFormat().
void Surface::readImageFile | ( | tnstream & | stream | ) |
Definition at line 380 of file surface.cpp.
References convert(), and SDL_RWFromStream().
Referenced by CargoDialog::CargoDialog(), and UnitInfoDialog::UnitInfoDialog().
|
static |
Definition at line 78 of file surface.cpp.
Referenced by ASC_PG_App::InitScreen().
void Surface::strech | ( | int | width, |
int | height | ||
) |
Definition at line 457 of file surface.cpp.
References assignDefaultPalette(), detectColorKey(), and SDL_StretchSurface().
Referenced by GraphicSetManager_Base::loadData(), VehicleType::runTextIO(), and Weathercast::Weathercast().
void * Surface::toBGI | ( | ) | const |
Definition at line 702 of file surface.cpp.
References imagesize(), and malloc().
|
inlinestatic |
Definition at line 76 of file surface.h.
References Surface().
Referenced by MapDisplayPG::blitInternalSurface(), MapDisplayPG::displayMovementStep(), MainScreenWidget::eventBlit(), Emboss::eventBlit(), GraphWidget::eventBlit(), DamageBarWidget::eventBlit(), SelectionItemWidget::eventDraw(), ExperienceOverview::eventDraw(), DiplomaticModeChooser< SelectionType >::eventDraw(), MapDisplayPG::MapDisplayPG(), OverviewMapPanel::painter(), DashboardPanel::painter(), Weathercast::painter(), AttackPanel::painter(), WeaponInfoLine::painter(), and Weathercast::paintWeatherArea().
void Surface::write | ( | tnstream & | stream | ) | const |
Definition at line 218 of file surface.cpp.
References surfaceVersion, tnstream::writedata(), tnstream::writeInt(), tnstream::writeUint8(), and tnstream::writeWord().
Referenced by BuildingType::write(), and VehicleType::write().
void Surface::writeDefaultPixelFormat | ( | tnstream & | stream | ) |
Definition at line 211 of file surface.cpp.
|
static |
Definition at line 66 of file surface.h.
Referenced by ColorMerger_AlphaMerge< 4 >::assign(), ColorConverter< 1, 4 >::convert(), OverviewMapImage::create(), hasTransparency(), and isTransparent().
|
static |
Definition at line 65 of file surface.h.
Referenced by ColorMerger_AlphaMerge< 4 >::assign(), OverviewMapHolder::clear(), ColorKey2AlphaChannel(), ColorConverter< 1, 4 >::convert(), OverviewMapImage::create(), Building::getImage(), Vehicle::getImage(), imageEmpty(), snowify(), ColorTransform_PlayerTrueColHSV< pixelsize >::transform(), WholeMapRenderer::WholeMapRenderer(), and writePNGtrim().