#include "C4Include.h"
#include "C4ForbidLibraryCompilation.h"
#include "landscape/C4Landscape.h"
#include "c4group/C4Components.h"
#include "control/C4Record.h"
#include "editor/C4ToolsDlg.h"
#include "game/C4GraphicsSystem.h"
#include "game/C4Physics.h"
#include "graphics/C4GraphicsResource.h"
#include "gui/C4GameMessage.h"
#include "landscape/C4LandscapeRender.h"
#include "landscape/C4Map.h"
#include "landscape/C4MapCreatorS2.h"
#include "landscape/C4MapScript.h"
#include "landscape/C4MassMover.h"
#include "landscape/C4Material.h"
#include "landscape/C4MaterialList.h"
#include "landscape/C4PXS.h"
#include "landscape/C4Sky.h"
#include "landscape/C4SolidMask.h"
#include "landscape/C4Texture.h"
#include "landscape/C4Weather.h"
#include "landscape/fow/C4FoW.h"
#include "lib/C4Random.h"
#include "lib/StdColors.h"
#include "object/C4Def.h"
#include "object/C4FindObject.h"
#include "object/C4GameObjects.h"
#include <array>
Go to the source code of this file.
Classes | |
struct | C4Landscape::P |
struct | CPolyEdge |
Macros | |
#define | PRETTY_TEMP_CONV |
#define | POLYGON_FIX_SHIFT 16 |
Functions | |
int32_t | PixCol2Mat (BYTE pixc) |
bool | AboveSemiSolid (int32_t &rx, int32_t &ry) |
bool | AboveSolid (int32_t &rx, int32_t &ry) |
bool | SemiAboveSolid (int32_t &rx, int32_t &ry) |
bool | FindLiquidHeight (int32_t cx, int32_t &ry, int32_t hgt) |
bool | FindTunnelHeight (int32_t cx, int32_t &ry, int32_t hgt) |
bool | FindSolidGround (int32_t &rx, int32_t &ry, int32_t width) |
bool | FindSurfaceLiquid (int32_t &rx, int32_t &ry, int32_t width, int32_t height) |
bool | FindLiquid (int32_t &rx, int32_t &ry, int32_t width, int32_t height) |
bool | FindTunnel (int32_t &rx, int32_t &ry, int32_t width, int32_t height) |
bool | FindLevelGround (int32_t &rx, int32_t &ry, int32_t width, int32_t hrange) |
bool | FindConSiteSpot (int32_t &rx, int32_t &ry, int32_t wdt, int32_t hgt, int32_t hrange) |
bool | PathFreePix (int32_t x, int32_t y) |
bool | PathFree (int32_t x1, int32_t y1, int32_t x2, int32_t y2) |
bool | PathFree (int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t *ix, int32_t *iy) |
bool | PathFreeIgnoreVehiclePix (int32_t x, int32_t y) |
bool | PathFreeIgnoreVehicle (int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t *ix, int32_t *iy) |
int32_t | TrajectoryDistance (int32_t iFx, int32_t iFy, C4Real iXDir, C4Real iYDir, int32_t iTx, int32_t iTy) |
bool | FindThrowingPosition (int32_t iTx, int32_t iTy, C4Real fXDir, C4Real fYDir, int32_t iHeight, int32_t &rX, int32_t &rY) |
bool | FindClosestFree (int32_t &rX, int32_t &rY, int32_t iAngle1, int32_t iAngle2, int32_t iExcludeAngle1, int32_t iExcludeAngle2) |
bool | ConstructionCheck (C4PropList *PropList, int32_t iX, int32_t iY, C4Object *pByObj) |
Variables | |
const int | QuickPolyBufSize = 20 |
CPolyEdge | QuickPolyBuf [QuickPolyBufSize] |
C4Landscape | Landscape |
struct CPolyEdge |
Definition at line 1150 of file C4Landscape.cpp.
Class Members | ||
---|---|---|
int | bottom | |
int | dx | |
struct CPolyEdge * | next | |
struct CPolyEdge * | prev | |
int | w | |
int | x | |
int | y |
#define POLYGON_FIX_SHIFT 16 |
Definition at line 1161 of file C4Landscape.cpp.
#define PRETTY_TEMP_CONV |
Definition at line 272 of file C4Landscape.cpp.
bool AboveSemiSolid | ( | int32_t & | rx, |
int32_t & | ry | ||
) |
Definition at line 2480 of file C4Landscape.cpp.
References GBackSemiSolid(), C4Landscape::GetHeight(), and Landscape.
Referenced by FindConSiteSpot(), FindLevelGround(), FindSolidGround(), and FindSurfaceLiquid().
bool AboveSolid | ( | int32_t & | rx, |
int32_t & | ry | ||
) |
Definition at line 2507 of file C4Landscape.cpp.
References GBackSemiSolid(), GBackSolid(), C4Landscape::GetHeight(), and Landscape.
Referenced by FindSolidGround().
bool ConstructionCheck | ( | C4PropList * | PropList, |
int32_t | iX, | ||
int32_t | iY, | ||
C4Object * | pByObj | ||
) |
Definition at line 3069 of file C4Landscape.cpp.
References C4Landscape::AreaSolidCount(), C4Def::ConSizeOff, C4Def::Constructable, C4Game::FindConstuctionSiteBlock(), FormatString(), Game, GameMsgObjectError(), StdStrBuf::getData(), C4PropList::GetDef(), C4PropList::GetName(), C4PropListStatic::GetName(), C4Rect::Hgt, Landscape, LoadResStr(), C4Def::Shape, and C4Rect::Wdt.
bool FindClosestFree | ( | int32_t & | rX, |
int32_t & | rY, | ||
int32_t | iAngle1, | ||
int32_t | iAngle2, | ||
int32_t | iExcludeAngle1, | ||
int32_t | iExcludeAngle2 | ||
) |
Definition at line 3049 of file C4Landscape.cpp.
Referenced by C4Command::Get().
bool FindConSiteSpot | ( | int32_t & | rx, |
int32_t & | ry, | ||
int32_t | wdt, | ||
int32_t | hgt, | ||
int32_t | hrange | ||
) |
Definition at line 2806 of file C4Landscape.cpp.
References AboveSemiSolid(), Abs(), C4Game::FindConstuctionSiteBlock(), Game, GBackSolid(), C4Landscape::GetWidth(), and Landscape.
Referenced by C4Player::PlaceReadyBase(), and C4Player::ScenarioInit().
bool FindLevelGround | ( | int32_t & | rx, |
int32_t & | ry, | ||
int32_t | width, | ||
int32_t | hrange | ||
) |
Definition at line 2752 of file C4Landscape.cpp.
References AboveSemiSolid(), Abs(), GBackSolid(), C4Landscape::GetWidth(), and Landscape.
Referenced by C4Player::PlaceReadyVehic().
bool FindLiquid | ( | int32_t & | rx, |
int32_t & | ry, | ||
int32_t | width, | ||
int32_t | height | ||
) |
Definition at line 2696 of file C4Landscape.cpp.
References FindLiquidHeight(), C4Landscape::GetWidth(), and Landscape.
Referenced by C4Game::PlaceAnimal().
bool FindLiquidHeight | ( | int32_t | cx, |
int32_t & | ry, | ||
int32_t | hgt | ||
) |
Definition at line 2562 of file C4Landscape.cpp.
References GBackLiquid(), C4Landscape::GetHeight(), and Landscape.
Referenced by FindLiquid().
bool FindSolidGround | ( | int32_t & | rx, |
int32_t & | ry, | ||
int32_t | width | ||
) |
Definition at line 2626 of file C4Landscape.cpp.
References AboveSemiSolid(), AboveSolid(), C4Landscape::GetWidth(), and Landscape.
Referenced by C4Game::PlaceAnimal(), C4Player::PlaceReadyCrew(), C4Player::PlaceReadyMaterial(), and C4Player::ScenarioInit().
bool FindSurfaceLiquid | ( | int32_t & | rx, |
int32_t & | ry, | ||
int32_t | width, | ||
int32_t | height | ||
) |
Definition at line 2656 of file C4Landscape.cpp.
References AboveSemiSolid(), GBackLiquid(), C4Landscape::GetWidth(), and Landscape.
Referenced by C4Game::PlaceAnimal().
bool FindThrowingPosition | ( | int32_t | iTx, |
int32_t | iTy, | ||
C4Real | fXDir, | ||
C4Real | fYDir, | ||
int32_t | iHeight, | ||
int32_t & | rX, | ||
int32_t & | rY | ||
) |
Definition at line 3014 of file C4Landscape.cpp.
References Inside(), and SemiAboveSolid().
Referenced by C4Command::Put(), and C4Command::Throw().
bool FindTunnel | ( | int32_t & | rx, |
int32_t & | ry, | ||
int32_t | width, | ||
int32_t | height | ||
) |
Definition at line 2724 of file C4Landscape.cpp.
References FindTunnelHeight(), C4Landscape::GetWidth(), and Landscape.
bool FindTunnelHeight | ( | int32_t | cx, |
int32_t & | ry, | ||
int32_t | hgt | ||
) |
Definition at line 2593 of file C4Landscape.cpp.
References C4M_Liquid, GBackMat(), C4Landscape::GetBackPix(), C4Landscape::GetHeight(), Landscape, and MatDensity().
Referenced by FindTunnel().
bool PathFree | ( | int32_t | x1, |
int32_t | y1, | ||
int32_t | x2, | ||
int32_t | y2 | ||
) |
Definition at line 2884 of file C4Landscape.cpp.
References PathFreePix().
Referenced by C4Command::Get(), C4Command::JumpControl(), C4Shape::LineConnect(), C4Command::MoveTo(), and ReduceLineSegments().
bool PathFree | ( | int32_t | x1, |
int32_t | y1, | ||
int32_t | x2, | ||
int32_t | y2, | ||
int32_t * | ix, | ||
int32_t * | iy | ||
) |
Definition at line 2889 of file C4Landscape.cpp.
References Abs(), GBackSolid(), CPolyEdge::x, and CPolyEdge::y.
bool PathFreeIgnoreVehicle | ( | int32_t | x1, |
int32_t | y1, | ||
int32_t | x2, | ||
int32_t | y2, | ||
int32_t * | ix, | ||
int32_t * | iy | ||
) |
Definition at line 2990 of file C4Landscape.cpp.
References PathFreeIgnoreVehiclePix().
Referenced by C4Shape::LineConnect().
bool PathFreeIgnoreVehiclePix | ( | int32_t | x, |
int32_t | y | ||
) |
Definition at line 2984 of file C4Landscape.cpp.
References DensitySolid(), C4Landscape::GetPix(), C4Landscape::GetPixMat(), Landscape, MVehic, CPolyEdge::x, and CPolyEdge::y.
Referenced by PathFreeIgnoreVehicle().
bool PathFreePix | ( | int32_t | x, |
int32_t | y | ||
) |
Definition at line 2879 of file C4Landscape.cpp.
References GBackSolid(), CPolyEdge::x, and CPolyEdge::y.
Referenced by PathFree().
int32_t PixCol2Mat | ( | BYTE | pixc | ) |
Definition at line 1943 of file C4Landscape.cpp.
References C4TextureMap::GetEntry(), C4TexMapEntry::GetMaterialIndex(), MNone, PixCol2Tex(), and TextureMap.
Referenced by C4Landscape::P::DoScan(), C4Landscape::RaiseTerrain(), and C4Landscape::UpdatePixMaps().
bool SemiAboveSolid | ( | int32_t & | rx, |
int32_t & | ry | ||
) |
Definition at line 2535 of file C4Landscape.cpp.
References GBackSolid(), C4Landscape::GetHeight(), and Landscape.
Referenced by FindThrowingPosition().
int32_t TrajectoryDistance | ( | int32_t | iFx, |
int32_t | iFy, | ||
C4Real | iXDir, | ||
C4Real | iYDir, | ||
int32_t | iTx, | ||
int32_t | iTy | ||
) |
Definition at line 2995 of file C4Landscape.cpp.
References Distance(), fixtoi(), GBackSolid(), C4Landscape::GetHeight(), C4Landscape::GetWidth(), GravAccel, Inside(), itofix(), and Landscape.
C4Landscape Landscape |
Definition at line 4350 of file C4Landscape.cpp.
Referenced by AboveSemiSolid(), AboveSolid(), C4TextureMap::AddEntry(), AdjustMoveToTarget(), C4Viewport::AdjustPosition(), C4EditCursor::ApplyToolBrush(), C4EditCursor::ApplyToolFill(), C4EditCursor::ApplyToolLine(), C4EditCursor::ApplyToolPicker(), C4EditCursor::ApplyToolRect(), C4ToolsDlg::AssertValidBackTexture(), C4ToolsDlg::AssertValidTexture(), C4Viewport::CalculateZoom(), C4Viewport::CenterPosition(), C4SolidMask::CheckConsistency(), C4Game::Clear(), C4Game::ClearPointers(), C4Game::CompileFunc(), ConstructionCheck(), C4Shape::ContactCheck(), C4FoWAmbient::CreateFromLandscape(), C4Game::CreateObjectConstruction(), C4Game::Default(), C4GraphicsSystem::DoSaveScreenshot(), C4Landscape::P::DoScan(), C4PXSSystem::Draw(), C4Viewport::Draw(), C4TextureShape::Draw(), C4Viewport::EnableFoW(), C4Object::ExecMovement(), C4Game::Execute(), C4MassMover::Execute(), C4PXS::Execute(), C4Player::Execute(), FindConSiteSpot(), FindLevelGround(), FindLiquid(), FindLiquidHeight(), FindSolidGround(), FindSurfaceLiquid(), FindTunnel(), FindTunnelHeight(), C4Sky::GetSkyFadeClr(), C4Weather::GetWind(), C4Player::Init(), C4MassMover::Init(), C4Game::InitInEarth(), C4Game::InitVegetation(), C4Viewport::InitZoom(), LandscapeFree(), C4Game::LoadScenarioSection(), C4MaterialMap::mrfCorrode(), C4MaterialMap::mrfIncinerate(), C4MaterialMap::mrfInsert(), mrfInsertCheck(), C4MaterialMap::mrfPoof(), PathFreeIgnoreVehiclePix(), C4Game::PlaceAnimal(), C4Game::PlaceInEarth(), C4SolidMask::Put(), C4SolidMask::PutSolidMasks(), C4SolidMask::PutTemporary(), C4Landscape::RaiseTerrain(), C4SolidMask::Remove(), C4SolidMask::RemoveSolidMasks(), C4SolidMask::RemoveTemporary(), C4SolidMask::Repair(), C4Console::SaveScenario(), C4Player::ScenarioInit(), C4Player::ScrollView(), SemiAboveSolid(), C4ToolsDlg::SetBackMaterial(), C4ToolsDlg::SetLandscapeMode(), C4ToolsDlg::SetMaterial(), C4Viewport::SetViewX(), C4Viewport::SetViewY(), C4Object::SideBounds(), SimFlight(), C4Object::StatusDeactivate(), C4Game::Synchronize(), TrajectoryDistance(), C4FoWLightSection::Update(), C4MouseControl::UpdateFogOfWar(), C4FoWAmbient::UpdateFromLandscape(), C4Object::UpdateLight(), C4EditCursor::UpdateStatusBar(), and C4Object::VerticalBounds().
CPolyEdge QuickPolyBuf[QuickPolyBufSize] |
Definition at line 1214 of file C4Landscape.cpp.
Referenced by C4Landscape::P::ForPolygon().
const int QuickPolyBufSize = 20 |
Definition at line 1213 of file C4Landscape.cpp.
Referenced by C4Landscape::P::ForPolygon().