Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

misc.h File Reference

miscellaneous functions which are used by ASC and all its tools More...

#include "global.h"
#include <string>

Include dependency graph for misc.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define dblue   lightgray

Functions

int firstBit (int i)
int log2 (int i)
 Count the number of zero bits on the LSB side of "zahl".
char * strr (int a)
 converts a to a string.
char * strrr (int a)
 converts a to a string.
char * strrr (double a)
 converts a to a string.
void beep (void)
int crc32buf (const void *vbuf, int len)
int atoi (const std::string &s)
double atof (const std::string &s)
template<typename T>
const T & min (const T &a, const T &b, const T &c)
template<typename T>
const T & max (const T &a, const T &b, const T &c)
char * strupr (const char *a)
char * itoa (int a, char *b, int c)
void * asc_malloc (size_t size)
void asc_free (void *p)

Variables

const char * digit []
const char * letter []


Detailed Description

miscellaneous functions which are used by ASC and all its tools

Definition in file misc.h.


Define Documentation

#define dblue   lightgray
 

Definition at line 33 of file misc.h.

Referenced by thelpsystem::buildgraphics(), tparagraph::checkscrolldown(), tdialogbox::editfield(), tshownewtanks::init(), tresearchinfo::init(), EditAiParam::init(), tputresourcesdlg::init(), thelpsystem::init(), MultilineEdit::init(), tviewanytext::init(), tviewanytext::redraw(), tmessagedlg::setup(), showplayerstat(), and tshowhistorypaintstat().


Function Documentation

void asc_free void *  p  ) 
 

Definition at line 261 of file memorycheck.cpp.

Referenced by tparagraph::cut(), tdialogbox::done(), thelpsystem::done(), tdialogbox::execbutton(), UnitPropertyEditor::init(), tdialogbox::knopfdruck(), tdialogbox::newknopfdruck(), tdialogbox::newknopfdruck2(), tdialogbox::newknopfdruck3(), tdialogbox::newknopfdruck4(), tmapgenerator::run(), PrehistoricEventStructure::~PrehistoricEventStructure(), tvirtualdisplay::~tvirtualdisplay(), and tvirtualscreenbuf::~tvirtualscreenbuf().

void* asc_malloc size_t  size  ) 
 

Definition at line 248 of file memorycheck.cpp.

References fatalError(), and malloc().

Referenced by tdialogbox::buildgraphics(), tdialogbox::execbutton(), tvirtualscreenbuf::init(), tdialogbox::knopfdruck(), loadpalette(), tdialogbox::newknopfdruck(), tdialogbox::newknopfdruck2(), tdialogbox::newknopfdruck3(), tdialogbox::newknopfdruck4(), readOldEvent(), tinitgfxengine::tinitgfxengine(), Surface::toBGI(), and uncompress_rlepict().

double atof const std::string &  s  ) 
 

Definition at line 166 of file misc.cpp.

References atof().

Referenced by atof(), ResourcePlacementDialog::buttonEvent(), FloatProperty::operation_eq(), DoubleArrayProperty::operation_eq(), IntegerProperty::operation_mult(), FloatProperty::operation_mult(), and SetProgressBarAtts().

int atoi const std::string &  s  ) 
 

Definition at line 161 of file misc.cpp.

References atoi().

Referenced by atoi(), ResourcePlacementDialog::buttonEvent(), checkFileVersion(), tviewtext::evalcommand(), ReplayRecorderDialog::getFramerate(), getNumericVersion(), ReplayRecorderDialog::getQuality(), PG_SpinnerBox::handleEditEnd(), loadsinglemessagefile(), IntegerArrayProperty::operation_eq(), ASCImageArrayProperty::operation_eq(), SingleUnitSet::parseIDs(), parseObjectProps(), SingleUnitSet::TranslationTable::parseString(), parseThemeProps(), CopyMap::paste(), PG_Layout::GetParamInt(), PG_Layout::GetParamScrollDirection(), SingleUnitSet::read(), VehicleTypeRenderer::renderWidget(), ResourcePlacementDialog::ResourcePlacementDialog(), Password::setEncoded(), String2IntRangeVector(), and Password::write().

void beep void   ) 
 

Definition at line 83 of file misc.cpp.

int crc32buf const void *  vbuf,
int  len
 

Definition at line 142 of file misc.cpp.

References UPDC32.

Referenced by Password::encodepassword().

int firstBit int  i  ) 
 

Definition at line 45 of file misc.cpp.

Referenced by ColorConverter< 1, 4 >::ColorConverter(), ColorMerger_AlphaHandler< 4 >::init(), and log2().

char* itoa int  a,
char *  b,
int  c
 

Definition at line 188 of file misc.cpp.

Referenced by tdialogbox::disablebutton(), tdialogbox::enablebutton(), int2string(), tdialogbox::intedit(), strr(), strrd8d(), strrd8n(), strrd8u(), strrr(), strrrd8d(), strrrd8n(), and strrrd8u().

int log2 int  i  )  [inline]
 

Count the number of zero bits on the LSB side of "zahl".

Definition at line 45 of file misc.h.

References firstBit().

Referenced by attackpossible(), attackpossible28(), attackpossible2n(), attackpossible2u(), MapRenderer::bitmappedHeight2pass(), Vehicle::buildingconstructable(), UnitPropertyEditor::buttonpressed(), CalculateThreat_VehicleType::calc_threat_vehicletype(), ContainerBase::calcShadowDist(), VehicleService::FieldSearch::checkVehicle2Vehicle(), Vehicle::decreaseMovement(), MapDisplayPG::displayAddons(), VehicleMovement::execute(), fieldAccessible(), Message::getFromText(), Vehicle::getHeightChange(), getheightdelta(), getmaxwindspeedforunit(), MessageLineWidget::getName(), GuiFunctions::AttackGui::getName(), SingleWeapon::getScalarWeaponType(), AStar::getTravelTime(), Vehicle::getValueType(), WeapDist::getWeaponStrength(), Vehicle::hasMoved(), tsearchreactionfireingunits::init(), Vehicle::maxMovement(), BaseVehicleMovement::moveunitxy(), AttackPanel::painter(), ContainerBase::paintField(), BuildingType::read(), AiParameter::reset(), Vehicle::resetMovement(), Vehicle::setMovement(), stu_height(), tsearchdestructbuildingfields::testfield(), Vehicle::vehicleconstructable(), and ContainerBase::vehicleLoadable().

template<typename T>
const T& max const T &  a,
const T &  b,
const T &  c
 

Definition at line 110 of file misc.h.

Referenced by TextRenderer::AreaWidth(), ColorMerger_Brightness< pixelsize >::assign(), beeline(), calcMoveMalus(), VehicleService::FieldSearch::checkBuilding2Vehicle(), VehicleService::FieldSearch::checkVehicle2Vehicle(), MapDisplayPG::checkViewPosition(), MapDisplayPG::displayUnitMovement(), doresearch(), tdialogbox::enablebutton(), Vehicle::endOwnTurn(), BarGraphWidget::eventBlit(), BuildingTypeBaseWidget::getBuildingHeight(), UnitHooveringLogic::getEndurance(), VehicleService::FieldSearch::initrefuelling(), TextRenderer::layout(), Vehicletype::maxSpeed(), ResourceGraphLayer::paintSingleField(), PG_PropertyField_Integer< IntegerType >::PG_PropertyField_Integer(), tmemorystreambuf::readfromstream(), Vehicle::setMovement(), GraphWidget::setRange(), ASCGUI_Window::setup(), SourcePixelSelector_CacheZoom< pixelSize, SourcePixelSelector_DirectSubRectangle< pixelSize > >::setZoom(), DiplomaticStateVector::swap(), tshowhistorypaintstat(), viewmessages(), Building::write(), and writePNGtrim().

template<typename T>
const T& min const T &  a,
const T &  b,
const T &  c
 

Definition at line 93 of file misc.h.

Referenced by ContainerControls::ammoProducable(), AmmoTransferWindow::AmmoTransferWindow(), ColorMerger_Brightness< pixelsize >::assign(), VehicleService::FieldSearch::checkBuilding2Vehicle(), VehicleService::FieldSearch::checkVehicle2Vehicle(), compressrle(), ContainerBase::ContainerBase(), copy2screen(), BuildingTypeBaseWidget::display(), MapDisplayPG::displayUnitMovement(), BarGraphWidget::eventBlit(), tdialogbox::execbutton(), Vehicle::getAmmo(), Building::getAmmo(), Vehicle::getAvailableResource(), BuildingTypeBaseWidget::getBuildingHeight(), SourcePixelSelector_DirectSubRectangle< pixelSize >::getHeight(), SourcePixelSelector_DirectRectangle< pixelSize >::getHeight(), SourcePixelSelector_Rectangle< pixelsize >::getHeight(), ResourceTransferrable::getMax(), AmmoTransferrable::getMin(), Vehicle::getResource(), WeapDist::getWeaponStrength(), SourcePixelSelector_DirectSubRectangle< pixelSize >::getWidth(), SourcePixelSelector_DirectRectangle< pixelSize >::getWidth(), SourcePixelSelector_Rectangle< pixelsize >::getWidth(), VehicleService::FieldSearch::initrefuelling(), InternalAmmoTransferWindow::InternalAmmoTransferWindow(), MessageDialog::MessageDialog(), MessageSelectionWindow::messageSelected(), MiningGraph::MiningGraph(), PG_PropertyField_Integer< IntegerType >::PG_PropertyField_Integer(), Vehicle::putAmmo(), Vehicle::putResource(), WholeMapRenderer::renderVisibility(), CGameOptions::runTextIO(), SourcePixelSelector_Zoom< pixelsize >::setSize(), StartupScreen::StartupScreen(), tputresources::testfield(), MiningStation::testfield(), AmmoTransferrable::transfer(), ResourceTransferrable::transfer(), tshowhistorypaintstat(), viewmessages(), viewterraininfo(), Vehicle::write(), and writePNGtrim().

char* strr int  a  ) 
 

converts a to a string.

Returns:
a pointer to a newly allocated array of characters, which must be freed with delete[]

Definition at line 59 of file misc.cpp.

References itoa().

Referenced by tshowhistorypaintstat().

char* strrr double  a  ) 
 

converts a to a string.

Returns:
a pointer to a static array, which will be overwritten in the next call

Definition at line 77 of file misc.cpp.

References strstring.

char* strrr int  a  ) 
 

converts a to a string.

Returns:
a pointer to a static array, which will be overwritten in the next call

Definition at line 67 of file misc.cpp.

References itoa(), and strstring.

char* strupr const char *  a  ) 
 

Definition at line 173 of file misc.cpp.

References malloc().

Referenced by ASCStringHelpers::_Strupr().


Variable Documentation

const char* digit[]
 

Definition at line 37 of file misc.cpp.

Referenced by int2string().

const char* letter[]
 

Definition at line 38 of file misc.cpp.


Generated on Tue Jun 24 01:53:42 2008 for Advanced Strategic Command by  doxygen 1.4.2