OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4Landscape::P Struct Reference
Collaboration diagram for C4Landscape::P:
[legend]

Public Member Functions

void ClearMatCount ()
 
void ExecuteScan (C4Landscape *)
 
int32_t DoScan (C4Landscape *, int32_t x, int32_t y, int32_t mat, int32_t dir)
 
uint32_t ChunkyRandom (uint32_t &iOffset, uint32_t iRange) const
 
void DrawChunk (C4Landscape *, int32_t tx, int32_t ty, int32_t wdt, int32_t hgt, uint8_t mcol, uint8_t mcolBkg, C4MaterialCoreShape Shape, uint32_t cro)
 
void DrawSmoothOChunk (C4Landscape *, int32_t tx, int32_t ty, int32_t wdt, int32_t hgt, uint8_t mcol, uint8_t mcolBkg, int flip, uint32_t cro)
 
void ChunkOZoom (C4Landscape *, const CSurface8 &sfcMap, const CSurface8 &sfcMapBkg, int32_t iMapX, int32_t iMapY, int32_t iMapWdt, int32_t iMapHgt, uint8_t iTexture, int32_t iOffX=0, int32_t iOffY=0)
 
bool TexOZoom (C4Landscape *, const CSurface8 &sfcMap, const CSurface8 &sfcMapBkg, int32_t iMapX, int32_t iMapY, int32_t iMapWdt, int32_t iMapHgt, DWORD *dwpTextureUsage, int32_t iToX=0, int32_t iToY=0)
 
bool MapToSurface (C4Landscape *, const CSurface8 &sfcMap, const CSurface8 &sfcMapBkg, int32_t iMapX, int32_t iMapY, int32_t iMapWdt, int32_t iMapHgt, int32_t iToX, int32_t iToY, int32_t iToWdt, int32_t iToHgt, int32_t iOffX, int32_t iOffY)
 
bool MapToLandscape (C4Landscape *d, const CSurface8 &sfcMap, const CSurface8 &sfcMapBkg, int32_t iMapX, int32_t iMapY, int32_t iMapWdt, int32_t iMapHgt, int32_t iOffsX=0, int32_t iOffsY=0, bool noClear=false)
 
bool InitTopAndBottomRowPix ()
 
bool GetMapColorIndex (const char *szMaterial, const char *szTexture, BYTE &rbyCol) const
 
bool CreateMap (CSurface8 *&sfcMap, CSurface8 *&sfcMapBkg)
 
bool CreateMapS2 (C4Group &ScenFile, CSurface8 *&sfcMap, CSurface8 *&sfcMapBkg)
 
bool Mat2Pal ()
 
void UpdatePixCnt (const C4Landscape *, const C4Rect &Rect, bool fCheck=false)
 
void UpdateMatCnt (const C4Landscape *, C4Rect Rect, bool fPlus)
 
void PrepareChange (const C4Landscape *d, const C4Rect &BoundingBox)
 
void FinishChange (C4Landscape *d, C4Rect BoundingBox)
 
bool DrawLineLandscape (int32_t iX, int32_t iY, int32_t iGrade, uint8_t line_color, uint8_t line_color_bkg)
 
bool DrawLineMap (int32_t iX, int32_t iY, int32_t iRadius, uint8_t line_color, uint8_t line_color_bkg)
 
uint8_t * GetBridgeMatConversion (const C4Landscape *d, int32_t for_material_col) const
 
bool SaveInternal (const C4Landscape *d, C4Group &hGroup) const
 
bool SaveDiffInternal (const C4Landscape *d, C4Group &hGroup, bool fSyncSave) const
 
int32_t ForPolygon (C4Landscape *d, int *vtcs, int length, const std::function< bool(int32_t, int32_t)> &callback, C4MaterialList *mats_count=nullptr, uint8_t col=0, uint8_t colBkg=0, uint8_t *conversion_table=nullptr)
 
std::unique_ptr< CSurface8CreateDefaultBkgSurface (CSurface8 &sfcFg, bool msbAsIft) const
 
void DigMaterial2Objects (int32_t tx, int32_t ty, C4MaterialList *mat_list, C4Object *pCollect=nullptr)
 
void BlastMaterial2Objects (int32_t tx, int32_t ty, C4MaterialList *mat_list, int32_t caused_by, int32_t str, C4ValueArray *out_objects)
 
bool DigFreePix (C4Landscape *d, int32_t tx, int32_t ty)
 
bool DigFreePixNoInstability (C4Landscape *d, int32_t tx, int32_t ty)
 
bool BlastFreePix (C4Landscape *d, int32_t tx, int32_t ty)
 
bool ShakeFreePix (C4Landscape *d, int32_t tx, int32_t ty)
 
C4ValueArrayPrepareFreeShape (C4Rect &BoundingBox, C4Object *by_object)
 
void PostFreeShape (C4ValueArray *dig_objects, C4Object *by_object)
 
BYTE DefaultBkgMat (BYTE fg) const
 

Public Attributes

std::unique_ptr< CSurface8Surface8
 
std::unique_ptr< CSurface8Surface8Bkg
 
std::unique_ptr< CSurface8Map
 
std::unique_ptr< CSurface8MapBkg
 
std::unique_ptr
< C4LandscapeRender
pLandscapeRender
 
std::vector< uint8_t > TopRowPix
 
std::vector< uint8_t > BottomRowPix
 
int32_t Pix2Mat [C4M_MaxTexIndex]
 
int32_t Pix2Dens [C4M_MaxTexIndex]
 
int32_t Pix2Place [C4M_MaxTexIndex]
 
bool Pix2Light [C4M_MaxTexIndex]
 
int32_t PixCntPitch = 0
 
std::vector< uint8_t > PixCnt
 
std::array< C4Rect,
C4LS_MaxRelights
Relights
 
std::array< std::unique_ptr
< uint8_t[]>, C4M_MaxTexIndex
BridgeMatConversion
 
LandscapeMode mode = LandscapeMode::Undefined
 
int32_t Width = 0
 
int32_t Height = 0
 
int32_t MapWidth = 0
 
int32_t MapHeight = 0
 
int32_t MapZoom = 0
 
std::array< DWORD, C4MaxMaterialMatCount
 
std::array< DWORD, C4MaxMaterialEffectiveMatCount {}
 
bool NoScan = false
 
int32_t ScanX = 0
 
int32_t ScanSpeed = 2
 
int32_t LeftOpen = 0
 
int32_t RightOpen = 0
 
int32_t TopOpen = 0
 
int32_t BottomOpen = 0
 
C4Real Gravity = DefaultGravAccel
 
uint32_t Modulation = 0
 
int32_t MapSeed = 0
 
C4Sky Sky
 
std::unique_ptr< C4MapCreatorS2pMapCreator
 
bool fMapChanged = false
 
std::unique_ptr< BYTE[]> pInitial
 
std::unique_ptr< BYTE[]> pInitialBkg
 
std::unique_ptr< C4FoWpFoW
 

Detailed Description

Definition at line 52 of file C4Landscape.cpp.

Member Function Documentation

bool C4Landscape::P::BlastFreePix ( C4Landscape d,
int32_t  tx,
int32_t  ty 
)

Definition at line 744 of file C4Landscape.cpp.

References C4MaterialCore::BlastFree, C4Material::BlastShiftTo, C4Landscape::CheckInstabilityRange(), C4Landscape::ClearPix(), C4Landscape::GetMat(), C4MaterialMap::Map, MaterialMap, MatTex2PixCol(), MatValid(), C4Landscape::SetPix2(), and C4Landscape::Transparent.

745 {
746  int32_t mat = d->GetMat(tx, ty);
747  if (MatValid(mat))
748  {
749  // for blast, either shift to different material or blast free
750  if (::MaterialMap.Map[mat].BlastFree)
751  {
752  d->ClearPix(tx, ty);
753  // check for instable materials to start moving by the cleared space
754  d->CheckInstabilityRange(tx, ty);
755  return true;
756  }
757  else
758  if (::MaterialMap.Map[mat].BlastShiftTo)
760  }
761  return false;
762 }
int32_t BlastShiftTo
Definition: C4Material.h:153
C4Material * Map
Definition: C4Material.h:171
int32_t BlastFree
Definition: C4Material.h:97
void CheckInstabilityRange(int32_t tx, int32_t ty)
int32_t GetMat(int32_t x, int32_t y) const
bool SetPix2(int32_t x, int32_t y, BYTE fgPix, BYTE bgPix)
C4MaterialMap MaterialMap
Definition: C4Material.cpp:970
bool ClearPix(int32_t tx, int32_t ty)
BYTE MatTex2PixCol(int32_t tex)
Definition: C4Material.h:232
static const uint8_t Transparent
Definition: C4Landscape.h:51
bool MatValid(int32_t mat)
Definition: C4Material.h:212

Here is the call graph for this function:

void C4Landscape::P::BlastMaterial2Objects ( int32_t  tx,
int32_t  ty,
C4MaterialList mat_list,
int32_t  caused_by,
int32_t  str,
C4ValueArray out_objects 
)

Definition at line 648 of file C4Landscape.cpp.

References C4MaterialList::Amount, C4MaterialCore::Blast2Object, C4MaterialCore::Blast2ObjectRatio, C4MaterialCore::Blast2PXSRatio, C4PXSSystem::Cast(), C4Game::CastObjects(), Game, C4MaterialMap::Map, MaterialMap, NO_OWNER, C4ID::None, C4MaterialMap::Num, and PXS.

649 {
650  for (int32_t mat = 0; mat < ::MaterialMap.Num; mat++)
651  {
652  if (mat_list->Amount[mat])
653  {
654  int32_t cast_strength = str;
655  int32_t pxsamount = 0, blastamount = 0;
656 
657  if (::MaterialMap.Map[mat].Blast2PXSRatio != 0)
658  {
659  pxsamount = mat_list->Amount[mat] / ::MaterialMap.Map[mat].Blast2PXSRatio;
660  ::PXS.Cast(mat, pxsamount, tx, ty, cast_strength * 2);
661  }
662 
663  if (::MaterialMap.Map[mat].Blast2Object != C4ID::None)
664  {
665  if (::MaterialMap.Map[mat].Blast2ObjectRatio != 0)
666  {
667  blastamount = mat_list->Amount[mat] / ::MaterialMap.Map[mat].Blast2ObjectRatio;
668  Game.CastObjects(::MaterialMap.Map[mat].Blast2Object, nullptr, blastamount, cast_strength, tx, ty, NO_OWNER, caused_by, out_objects);
669  }
670  }
671 
672  mat_list->Amount[mat] -= std::max(blastamount * ::MaterialMap.Map[mat].Blast2ObjectRatio,
673  pxsamount * ::MaterialMap.Map[mat].Blast2PXSRatio);
674  }
675  }
676 }
void Cast(int32_t mat, int32_t num, int32_t tx, int32_t ty, int32_t level)
Definition: C4PXS.cpp:357
C4Game Game
Definition: C4Globals.cpp:52
C4Material * Map
Definition: C4Material.h:171
void CastObjects(C4ID id, C4Object *pCreator, int32_t num, int32_t level, int32_t tx, int32_t ty, int32_t iOwner=NO_OWNER, int32_t iController=NO_OWNER, C4ValueArray *out_objects=nullptr)
Definition: C4Game.cpp:1415
static const C4ID None
Definition: C4Id.h:42
int32_t Blast2PXSRatio
Definition: C4Material.h:103
int32_t Blast2ObjectRatio
Definition: C4Material.h:102
const int NO_OWNER
Definition: C4Constants.h:138
C4PXSSystem PXS
Definition: C4PXS.cpp:526
int32_t Num
Definition: C4Material.h:170
int32_t Amount[C4MaxMaterial]
C4MaterialMap MaterialMap
Definition: C4Material.cpp:970

Here is the call graph for this function:

void C4Landscape::P::ChunkOZoom ( C4Landscape d,
const CSurface8 sfcMap,
const CSurface8 sfcMapBkg,
int32_t  iMapX,
int32_t  iMapY,
int32_t  iMapWdt,
int32_t  iMapHgt,
uint8_t  iTexture,
int32_t  iOffX = 0,
int32_t  iOffY = 0 
)

Definition at line 2169 of file C4Landscape.cpp.

References CSurface8::_GetPix(), C4M_Flat, C4M_Octagon, C4M_Smooth, C4M_Smoother, C4Game::C4S, C4TextureShape::Draw(), C4SLandscape::FlatChunkShapes, Game, C4TextureMap::GetEntry(), C4TexMapEntry::GetMaterial(), C4Texture::GetMaterialShape(), CSurface8::GetPix(), CSurface8::GetSurfaceSize(), C4TextureMap::GetTexture(), C4TexMapEntry::GetTextureName(), C4Scenario::Landscape, left, C4MaterialCore::MapChunkType, C4MaterialCore::MinShapeOverlap, right, and TextureMap.

2170 {
2171  const C4TexMapEntry *entry = ::TextureMap.GetEntry(iTexture);
2172  C4Material *pMaterial = entry->GetMaterial();
2173  if (!pMaterial) return;
2174  const char *texture_name = entry->GetTextureName();
2175  C4Texture *texture = ::TextureMap.GetTexture(texture_name);
2176  C4TextureShape *shape = texture ? texture->GetMaterialShape() : nullptr;
2177  // Chunk type by material
2179  // Get map & landscape size
2180  int iMapWidth, iMapHeight;
2181  sfcMap.GetSurfaceSize(iMapWidth, iMapHeight);
2182  // Clip desired map segment to map size
2183  iMapX = Clamp<int32_t>(iMapX, 0, iMapWidth - 1);
2184  iMapY = Clamp<int32_t>(iMapY, 0, iMapHeight - 1);
2185  iMapWdt = Clamp<int32_t>(iMapWdt, 0, iMapWidth - iMapX);
2186  iMapHgt = Clamp<int32_t>(iMapHgt, 0, iMapHeight - iMapY);
2187  // get chunk size
2188  int iChunkWidth = MapZoom, iChunkHeight = MapZoom;
2189  // Scan map lines
2190  for (int iY = iMapY; iY < iMapY + iMapHgt; iY++)
2191  {
2192  // Landscape target coordinate vertical
2193  int iToY = iY * iChunkHeight + iOffY;
2194  // Scan map line
2195  for (int iX = iMapX; iX < iMapX + iMapWdt; iX++)
2196  {
2197  // Map scan line start
2198  uint8_t MapPixel = sfcMap._GetPix(iX, iY);
2199  uint8_t MapPixelBkg = sfcMapBkg._GetPix(iX, iY);
2200  // Landscape target coordinate horizontal
2201  int iToX = iX * iChunkWidth + iOffX;
2202  // Here's a chunk of the texture-material to zoom
2203  if (MapPixel == iTexture)
2204  {
2205  // Draw chunk
2206  DrawChunk(d, iToX, iToY, iChunkWidth, iChunkHeight, MapPixel, MapPixelBkg, iChunkType, (iX << 16) + iY);
2207  }
2208  // Other chunk, check for slope smoothers
2209  else if (iChunkType == C4M_Smooth || iChunkType == C4M_Smoother || iChunkType == C4M_Octagon)
2210  {
2211  // Map scan line pixel below
2212  uint8_t below = sfcMap.GetPix(iX, iY + 1);
2213  uint8_t above = sfcMap.GetPix(iX, iY - 1);
2214  uint8_t left = sfcMap.GetPix(iX - 1, iY);
2215  uint8_t right = sfcMap.GetPix(iX + 1, iY);
2216  uint8_t leftBkg = sfcMapBkg.GetPix(iX - 1, iY);
2217  uint8_t rightBkg = sfcMapBkg.GetPix(iX + 1, iY);
2218  // do not fill a tiny hole
2219  if (below == iTexture && above == iTexture && left == iTexture && right == iTexture)
2220  continue;
2221  int flat = iChunkType == C4M_Octagon ? 4 : 0;
2222  // Smooth chunk & same texture-material below
2223  if (iY < iMapHeight - 1 && below == iTexture)
2224  {
2225  // Same texture-material on left
2226  if (iX > 0 && left == iTexture)
2227  {
2228  // Draw smoother
2229  DrawSmoothOChunk(d, iToX, iToY, iChunkWidth, iChunkHeight, left, leftBkg, 3 + flat, (iX << 16) + iY);
2230  }
2231  // Same texture-material on right
2232  if (iX < iMapWidth - 1 && right == iTexture)
2233  {
2234  // Draw smoother
2235  DrawSmoothOChunk(d, iToX, iToY, iChunkWidth, iChunkHeight, right, rightBkg, 0 + flat, (iX << 16) + iY);
2236  }
2237  }
2238  // Smooth chunk & same texture-material above
2239  if (iY > 0 && above == iTexture)
2240  {
2241  // Same texture-material on left
2242  if (iX > 0 && left == iTexture)
2243  {
2244  // Draw smoother
2245  DrawSmoothOChunk(d, iToX, iToY, iChunkWidth, iChunkHeight, left, leftBkg, 2 + flat, (iX << 16) + iY);
2246  }
2247  // Same texture-material on right
2248  if (iX < iMapWidth - 1 && right == iTexture)
2249  {
2250  // Draw smoother
2251  DrawSmoothOChunk(d, iToX, iToY, iChunkWidth, iChunkHeight, right, rightBkg, 1 + flat, (iX << 16) + iY);
2252  }
2253  }
2254  }
2255  }
2256  }
2257  // Draw custom shapes on top of regular materials
2258  if (shape && !::Game.C4S.Landscape.FlatChunkShapes) shape->Draw(sfcMap, sfcMapBkg, iMapX, iMapY, iMapWdt, iMapHgt, iTexture, iOffX, iOffY, MapZoom, pMaterial->MinShapeOverlap);
2259 }
C4Game Game
Definition: C4Globals.cpp:52
void Draw(const CSurface8 &sfcMap, const CSurface8 &sfcMapBkg, int32_t iMapX, int32_t iMapY, int32_t iMapWdt, int32_t iMapHgt, uint8_t iTexture, int32_t iOffX, int32_t iOffY, int32_t MapZoom, int32_t min_overlap_ratio)
C4Material * GetMaterial() const
Definition: C4Texture.h:63
C4Scenario C4S
Definition: C4Game.h:76
C4SLandscape Landscape
Definition: C4Scenario.h:234
BYTE _GetPix(int x, int y) const
Definition: CSurface8.h:54
C4MaterialCoreShape
Definition: C4Material.h:73
C4TextureMap TextureMap
Definition: C4Texture.cpp:585
int32_t MinShapeOverlap
Definition: C4Material.h:139
class C4TextureShape * GetMaterialShape() const
Definition: C4Texture.h:40
BYTE GetPix(int iX, int iY) const
Definition: CSurface8.h:49
const C4TexMapEntry * GetEntry(int32_t iIndex) const
Definition: C4Texture.h:85
Definition: C4Texture.h:48
const char * GetTextureName() const
Definition: C4Texture.h:61
void GetSurfaceSize(int &irX, int &irY) const
Definition: CSurface8.cpp:195
void DrawChunk(C4Landscape *, int32_t tx, int32_t ty, int32_t wdt, int32_t hgt, uint8_t mcol, uint8_t mcolBkg, C4MaterialCoreShape Shape, uint32_t cro)
bool FlatChunkShapes
Definition: C4Scenario.h:186
const char * GetTexture(int32_t iIndex)
Definition: C4Texture.cpp:503
C4MaterialCoreShape MapChunkType
Definition: C4Material.h:93
void DrawSmoothOChunk(C4Landscape *, int32_t tx, int32_t ty, int32_t wdt, int32_t hgt, uint8_t mcol, uint8_t mcolBkg, int flip, uint32_t cro)

Here is the call graph for this function:

uint32_t C4Landscape::P::ChunkyRandom ( uint32_t &  iOffset,
uint32_t  iRange 
) const

Definition at line 2099 of file C4Landscape.cpp.

2100 {
2101  if (!iRange) return 0;
2102  iOffset = (iOffset * 16807) % 2147483647;
2103  return (iOffset ^ MapSeed) % iRange;
2104 }
void C4Landscape::P::ClearMatCount ( )

Definition at line 1946 of file C4Landscape.cpp.

1947 {
1948  std::fill(MatCount.begin(), MatCount.end(), 0);
1949  std::fill(EffectiveMatCount.begin(), EffectiveMatCount.end(), 0);
1950 }
std::array< DWORD, C4MaxMaterial > MatCount
Definition: C4Landscape.cpp:70
std::array< DWORD, C4MaxMaterial > EffectiveMatCount
Definition: C4Landscape.cpp:71
std::unique_ptr< CSurface8 > C4Landscape::P::CreateDefaultBkgSurface ( CSurface8 sfcFg,
bool  msbAsIft 
) const

Definition at line 1108 of file C4Landscape.cpp.

References CSurface8::_GetPix(), CSurface8::_SetPix(), CSurface8::Hgt, and CSurface8::Wdt.

1109 {
1110  auto sfcBg = std::make_unique<CSurface8>();
1111  if (!sfcBg->Create(sfcFg.Wdt, sfcFg.Hgt))
1112  {
1113  return nullptr;
1114  }
1115 
1116  for (int32_t y = 0; y < sfcFg.Hgt; ++y)
1117  {
1118  for (int32_t x = 0; x < sfcFg.Wdt; ++x)
1119  {
1120  BYTE fgPix = sfcFg._GetPix(x, y);
1121  BYTE bgPix;
1122 
1123  // If we treat the most significant bit as the IFT flag
1124  // (compatibility option for pre-7.0 maps), then set
1125  // the background pixel to 0 if the foreground does not
1126  // have IFT set, and remove the IFT flag from the
1127  // foreground pixel.
1128  if (msbAsIft)
1129  {
1130  if (fgPix & 0x80)
1131  {
1132  fgPix &= ~0x80;
1133  sfcFg._SetPix(x, y, fgPix);
1134  bgPix = DefaultBkgMat(fgPix);
1135  }
1136  else
1137  {
1138  bgPix = 0;
1139  }
1140  }
1141  else
1142  {
1143  bgPix = DefaultBkgMat(fgPix);
1144  }
1145 
1146  sfcBg->_SetPix(x, y, bgPix);
1147  }
1148  }
1149 
1150  return sfcBg;
1151 }
int Hgt
Definition: CSurface8.h:28
BYTE _GetPix(int x, int y) const
Definition: CSurface8.h:54
uint8_t BYTE
void _SetPix(int iX, int iY, BYTE byCol)
Definition: CSurface8.h:44
int Wdt
Definition: CSurface8.h:28
BYTE DefaultBkgMat(BYTE fg) const

Here is the call graph for this function:

bool C4Landscape::P::CreateMap ( CSurface8 *&  sfcMap,
CSurface8 *&  sfcMapBkg 
)

Definition at line 2386 of file C4Landscape.cpp.

References C4Game::C4S, C4MapCreator::Create(), Game, C4SLandscape::GetMapSize(), C4Scenario::Landscape, C4Game::StartupPlayerCount, and TextureMap.

2387 {
2388  int32_t iWidth = 0, iHeight = 0;
2389 
2390  // Create map surface
2391  Game.C4S.Landscape.GetMapSize(iWidth, iHeight, Game.StartupPlayerCount);
2392  auto fg_map = std::make_unique<CSurface8>(iWidth, iHeight);
2393 
2394  // Fill sfcMap
2395  C4MapCreator MapCreator;
2396  MapCreator.Create(fg_map.get(),
2399 
2400  auto bg_map = CreateDefaultBkgSurface(*fg_map, false);
2401  if (!bg_map)
2402  return false;
2403 
2404  sfcMap = fg_map.release();
2405  sfcMapBkg = bg_map.release();
2406  return true;
2407 }
C4Game Game
Definition: C4Globals.cpp:52
C4Scenario C4S
Definition: C4Game.h:76
void GetMapSize(int32_t &rWdt, int32_t &rHgt, int32_t iPlayerNum)
Definition: C4Scenario.cpp:317
C4SLandscape Landscape
Definition: C4Scenario.h:234
C4TextureMap TextureMap
Definition: C4Texture.cpp:585
void Create(CSurface8 *sfcMap, C4SLandscape &rLScape, C4TextureMap &rTexMap, int32_t iPlayerNum=1)
Definition: C4Map.cpp:78
int32_t StartupPlayerCount
Definition: C4Game.h:111
std::unique_ptr< CSurface8 > CreateDefaultBkgSurface(CSurface8 &sfcFg, bool msbAsIft) const

Here is the call graph for this function:

bool C4Landscape::P::CreateMapS2 ( C4Group ScenFile,
CSurface8 *&  sfcMap,
CSurface8 *&  sfcMapBkg 
)

Definition at line 2409 of file C4Landscape.cpp.

References C4Group::AccessEntry(), C4CFN_DynLandscape, C4Game::C4S, Game, C4Scenario::Landscape, MaterialMap, C4Game::StartupPlayerCount, and TextureMap.

2410 {
2411  // file present?
2412  if (!ScenFile.AccessEntry(C4CFN_DynLandscape)) return false;
2413 
2414  // create map creator
2415  if (!pMapCreator)
2416  pMapCreator = std::make_unique<C4MapCreatorS2>(&Game.C4S.Landscape, &::TextureMap, &::MaterialMap, Game.StartupPlayerCount);
2417 
2418  // read file
2419  pMapCreator->ReadFile(C4CFN_DynLandscape, &ScenFile);
2420  // render landscape
2421  if (!pMapCreator->Render(nullptr, sfcMap, sfcMapBkg))
2422  return false;
2423 
2424  // keep map creator until script callbacks have been done
2425  return true;
2426 }
C4Game Game
Definition: C4Globals.cpp:52
bool AccessEntry(const char *szWildCard, size_t *iSize=nullptr, char *sFileName=nullptr, bool NeedsToBeAGroup=false)
Definition: C4Group.cpp:1695
C4Scenario C4S
Definition: C4Game.h:76
#define C4CFN_DynLandscape
Definition: C4Components.h:115
C4SLandscape Landscape
Definition: C4Scenario.h:234
C4TextureMap TextureMap
Definition: C4Texture.cpp:585
int32_t StartupPlayerCount
Definition: C4Game.h:111
std::unique_ptr< C4MapCreatorS2 > pMapCreator
Definition: C4Landscape.cpp:80
C4MaterialMap MaterialMap
Definition: C4Material.cpp:970

Here is the call graph for this function:

BYTE C4Landscape::P::DefaultBkgMat ( BYTE  fg) const

Definition at line 1103 of file C4Landscape.cpp.

References C4TextureMap::DefaultBkgMatTex(), and TextureMap.

1104 {
1106 }
BYTE DefaultBkgMatTex(BYTE fg) const
Definition: C4Texture.cpp:513
C4TextureMap TextureMap
Definition: C4Texture.cpp:585

Here is the call graph for this function:

bool C4Landscape::P::DigFreePix ( C4Landscape d,
int32_t  tx,
int32_t  ty 
)

Definition at line 730 of file C4Landscape.cpp.

References C4Landscape::CheckInstabilityRange(), C4Landscape::ClearPix(), C4MaterialCore::DigFree, C4Landscape::GetMat(), C4MaterialMap::Map, MaterialMap, and MatValid().

731 {
732  int32_t mat = d->GetMat(tx, ty);
733  if (MatValid(mat))
734  if (::MaterialMap.Map[mat].DigFree)
735  {
736  d->ClearPix(tx, ty);
737  // check for instable materials to start moving by the cleared space
738  d->CheckInstabilityRange(tx, ty);
739  return true;
740  }
741  return false;
742 }
C4Material * Map
Definition: C4Material.h:171
void CheckInstabilityRange(int32_t tx, int32_t ty)
int32_t GetMat(int32_t x, int32_t y) const
C4MaterialMap MaterialMap
Definition: C4Material.cpp:970
bool ClearPix(int32_t tx, int32_t ty)
bool MatValid(int32_t mat)
Definition: C4Material.h:212
int32_t DigFree
Definition: C4Material.h:96

Here is the call graph for this function:

bool C4Landscape::P::DigFreePixNoInstability ( C4Landscape d,
int32_t  tx,
int32_t  ty 
)

Definition at line 718 of file C4Landscape.cpp.

References C4Landscape::ClearPix(), C4MaterialCore::DigFree, C4Landscape::GetMat(), C4MaterialMap::Map, MaterialMap, and MatValid().

719 {
720  int32_t mat = d->GetMat(tx, ty);
721  if (MatValid(mat))
722  if (::MaterialMap.Map[mat].DigFree)
723  {
724  d->ClearPix(tx, ty);
725  return true;
726  }
727  return false;
728 }
C4Material * Map
Definition: C4Material.h:171
int32_t GetMat(int32_t x, int32_t y) const
C4MaterialMap MaterialMap
Definition: C4Material.cpp:970
bool ClearPix(int32_t tx, int32_t ty)
bool MatValid(int32_t mat)
Definition: C4Material.h:212
int32_t DigFree
Definition: C4Material.h:96

Here is the call graph for this function:

void C4Landscape::P::DigMaterial2Objects ( int32_t  tx,
int32_t  ty,
C4MaterialList mat_list,
C4Object pCollect = nullptr 
)

Definition at line 678 of file C4Landscape.cpp.

References C4MaterialList::Amount, C4Object::AssignRemoval(), C4VObj(), C4PropList::Call(), C4Object::Collect(), C4Object::Contained, C4Object::Controller, C4Game::CreateObject(), C4MaterialCore::Dig2Object, C4MaterialCore::Dig2ObjectCollect, C4MaterialCore::Dig2ObjectRatio, Game, C4MaterialMap::Map, MaterialMap, NO_OWNER, C4ID::None, C4MaterialMap::Num, PSF_DigOutObject, PSF_OnDugOut, and C4PropList::Status.

679 {
680  C4AulParSet pars(pCollect);
681  for (int32_t mat = 0; mat < ::MaterialMap.Num; mat++)
682  {
683  if (mat_list->Amount[mat])
684  {
685  if (::MaterialMap.Map[mat].Dig2Object != C4ID::None)
686  if (::MaterialMap.Map[mat].Dig2ObjectRatio != 0)
687  while (mat_list->Amount[mat] >= ::MaterialMap.Map[mat].Dig2ObjectRatio)
688  {
689  mat_list->Amount[mat] -= ::MaterialMap.Map[mat].Dig2ObjectRatio;
690  C4Object *pObj = Game.CreateObject(::MaterialMap.Map[mat].Dig2Object, nullptr, NO_OWNER, tx, ty);
691  if (!pObj || !pObj->Status) continue;
692  // Set controller to the controller of the object responsible for digging out
693  if (pCollect && pCollect->Status)
694  pObj->Controller = pCollect->Controller;
695  // Do callbacks to dug object and digger
696  pObj->Call(PSF_OnDugOut, &pars);
697  if (!pObj->Status || !pCollect || !pCollect->Status || pObj->Contained) continue;
698  C4AulParSet pars(C4VObj(pObj));
699  pCollect->Call(PSF_DigOutObject, &pars);
700  if (!pObj->Status || !pCollect->Status || pObj->Contained) continue;
701  // Try to collect object
702  if (::MaterialMap.Map[mat].Dig2ObjectCollect)
703  if (pCollect && pCollect->Status && pObj && pObj->Status)
704  if (!pCollect->Collect(pObj))
705  // Collection forced? Don't generate objects
706  if (::MaterialMap.Map[mat].Dig2ObjectCollect == 2)
707  {
708  pObj->AssignRemoval();
709  // Cap so we never have more than one object worth of material in the store
710  mat_list->Amount[mat] = ::MaterialMap.Map[mat].Dig2ObjectRatio;
711  break;
712  }
713  }
714  }
715  }
716 }
C4Game Game
Definition: C4Globals.cpp:52
C4Material * Map
Definition: C4Material.h:171
C4Value C4VObj(C4Object *pObj)
Definition: C4Value.cpp:90
int32_t Dig2ObjectCollect
Definition: C4Material.h:100
static const C4ID None
Definition: C4Id.h:42
void AssignRemoval(bool fExitContents=false)
Definition: C4Object.cpp:257
const int NO_OWNER
Definition: C4Constants.h:138
int32_t Num
Definition: C4Material.h:170
int32_t Status
Definition: C4PropList.h:170
bool Collect(C4Object *pObj)
Definition: C4Object.cpp:4174
int32_t Dig2ObjectRatio
Definition: C4Material.h:99
int32_t Amount[C4MaxMaterial]
C4MaterialMap MaterialMap
Definition: C4Material.cpp:970
C4ObjectPtr Contained
Definition: C4Object.h:144
C4Value Call(C4PropertyName k, C4AulParSet *pPars=0, bool fPassErrors=false)
Definition: C4PropList.h:112
int32_t Controller
Definition: C4Object.h:111
#define PSF_OnDugOut
Definition: C4GameScript.h:100
#define PSF_DigOutObject
Definition: C4GameScript.h:99
C4Object * CreateObject(C4PropList *type, C4Object *pCreator, int32_t owner=NO_OWNER, int32_t x=50, int32_t y=50, int32_t r=0, bool grow_from_center=false, C4Real xdir=Fix0, C4Real ydir=Fix0, C4Real rdir=Fix0, int32_t iController=NO_OWNER)
Definition: C4Game.cpp:1076

Here is the call graph for this function:

int32_t C4Landscape::P::DoScan ( C4Landscape d,
int32_t  x,
int32_t  y,
int32_t  mat,
int32_t  dir 
)

Definition at line 270 of file C4Landscape.cpp.

References C4Landscape::_GetMat(), C4Landscape::_GetPix(), C4MaterialCore::AboveTempConvert, C4MaterialCore::AboveTempConvertDir, C4Material::AboveTempConvertTo, Abs(), AddDbgRec(), C4MaterialCore::BelowTempConvert, C4MaterialCore::BelowTempConvertDir, C4Material::BelowTempConvertTo, C4Landscape::CheckInstabilityRange(), Config, C4ConfigGeneral::DebugRec, DEBUGREC_MATSCAN, C4MaterialCore::Density, DensitySolid(), C4Config::General, C4TextureMap::GetEntry(), C4Landscape::GetHeight(), C4TexMapEntry::GetMaterialIndex(), C4Weather::GetTemperature(), C4Landscape::GetWidth(), Landscape, C4MaterialMap::Map, MaterialMap, MatTex2PixCol(), PixCol2Mat(), RCT_MatScanDo, C4Landscape::SetPix2(), C4MaterialCore::TempConvStrength, TextureMap, C4Landscape::Transparent, and Weather.

Referenced by ExecuteScan().

271 {
272  int32_t conv_to_tex = 0;
273  int32_t iTemperature = ::Weather.GetTemperature();
274  // Check below conv
275  if (::MaterialMap.Map[mat].BelowTempConvertDir == dir)
277  if (iTemperature< ::MaterialMap.Map[mat].BelowTempConvert)
278  conv_to_tex = ::MaterialMap.Map[mat].BelowTempConvertTo;
279  // Check above conv
280  if (::MaterialMap.Map[mat].AboveTempConvertDir == dir)
282  if (iTemperature>::MaterialMap.Map[mat].AboveTempConvert)
283  conv_to_tex = ::MaterialMap.Map[mat].AboveTempConvertTo;
284  // nothing to do?
285  if (!conv_to_tex) return 0;
286  // find material
287  int32_t conv_to = ::TextureMap.GetEntry(conv_to_tex)->GetMaterialIndex();
288  // find mat top
289  int32_t mconv = ::MaterialMap.Map[mat].TempConvStrength,
290  mconvs = mconv;
292  {
293  C4RCMatScan rc = { cx, cy, mat, conv_to, dir, mconvs };
294  AddDbgRec(RCT_MatScanDo, &rc, sizeof(C4RCMatScan));
295  }
296  int32_t ydir = (dir == 0 ? +1 : -1), cy2;
297 #ifdef PRETTY_TEMP_CONV
298  // get left pixel
299  int32_t lmat = (cx > 0 ? d->_GetMat(cx - 1, cy) : -1);
300  // left pixel not converted? do nothing
301  if (lmat == mat) return 0;
302  // left pixel converted? suppose it was done by a prior scan and skip check
303  if (lmat != conv_to)
304  {
305  int32_t iSearchRange = std::max<int32_t>(5, mconvs);
306  // search upper/lower bound
307  int32_t cys = cy, cxs = cx;
308  while (cxs < ::Landscape.GetWidth() - 1)
309  {
310  // one step right
311  cxs++;
312  if (d->_GetMat(cxs, cys) == mat)
313  {
314  // search surface
315  cys -= ydir;
316  while (Inside<int32_t>(cys, 0, ::Landscape.GetHeight() - 1) && d->_GetMat(cxs, cys) == mat)
317  {
318  cys -= ydir;
319  if ((mconvs = std::min(mconv - Abs(cys - cy), mconvs)) < 0)
320  return 0;
321  }
322  // out of bounds?
323  if (!Inside<int32_t>(cys, 0, ::Landscape.GetHeight() - 1)) break;
324  // back one step
325  cys += ydir;
326  }
327  else
328  {
329  // search surface
330  cys += ydir;
331  while (Inside<int32_t>(cys, 0, ::Landscape.GetHeight() - 1) && d->_GetMat(cxs, cys) != mat)
332  {
333  cys += ydir;
334  if (Abs(cys - cy) > iSearchRange)
335  break;
336  }
337  // out of bounds?
338  if (!Inside<int32_t>(cys, 0, ::Landscape.GetHeight() - 1)) break;
339  if (Abs(cys - cy) > iSearchRange) break;
340  }
341  }
342  }
343 #endif
344  // Conversion
345  bool conv_to_is_solid = (conv_to > -1) && DensitySolid(::MaterialMap.Map[conv_to].Density);
346  for (cy2 = cy; mconvs >= 0 && Inside<int32_t>(cy2, 0, ::Landscape.GetHeight() - 1); cy2 += ydir, mconvs--)
347  {
348  // material changed?
349  int32_t pix = d->_GetPix(cx, cy2);
350  if (PixCol2Mat(pix) != mat) break;
351 #ifdef PRETTY_TEMP_CONV
352  // get left pixel
353  int32_t lmat = (cx > 0 ? d->_GetMat(cx - 1, cy2) : -1);
354  // left pixel not converted? break
355  if (lmat == mat) break;
356 #endif
357  // set mat (and keep background material)
358  d->SetPix2(cx, cy2, MatTex2PixCol(conv_to_tex), Transparent);
359  if (!conv_to_is_solid) d->CheckInstabilityRange(cx, cy2);
360  }
361  // return pixel converted
362  return Abs(cy2 - cy);
363 }
BYTE _GetPix(int32_t x, int32_t y) const
constexpr bool DEBUGREC_MATSCAN
Definition: C4Include.h:33
C4Config Config
Definition: C4Config.cpp:837
int32_t GetMaterialIndex() const
Definition: C4Texture.h:62
C4ConfigGeneral General
Definition: C4Config.h:252
C4Material * Map
Definition: C4Material.h:171
int32_t PixCol2Mat(BYTE pixc)
C4TextureMap TextureMap
Definition: C4Texture.cpp:585
const C4TexMapEntry * GetEntry(int32_t iIndex) const
Definition: C4Texture.h:85
int32_t AboveTempConvert
Definition: C4Material.h:128
int32_t _GetMat(int32_t x, int32_t y) const
C4Landscape Landscape
void CheckInstabilityRange(int32_t tx, int32_t ty)
int32_t AboveTempConvertDir
Definition: C4Material.h:129
int32_t GetTemperature()
Definition: C4Weather.cpp:101
int32_t AboveTempConvertTo
Definition: C4Material.h:156
void AddDbgRec(C4RecordChunkType eType, const void *pData, int iSize)
Definition: C4Record.cpp:36
C4Weather Weather
Definition: C4Weather.cpp:207
bool SetPix2(int32_t x, int32_t y, BYTE fgPix, BYTE bgPix)
int32_t Density
Definition: C4Material.h:94
int32_t GetHeight() const
int32_t BelowTempConvertTo
Definition: C4Material.h:155
int32_t BelowTempConvert
Definition: C4Material.h:125
C4MaterialMap MaterialMap
Definition: C4Material.cpp:970
int32_t DebugRec
Definition: C4Config.h:61
int32_t TempConvStrength
Definition: C4Material.h:131
T Abs(T val)
Definition: Standard.h:44
BYTE MatTex2PixCol(int32_t tex)
Definition: C4Material.h:232
static const uint8_t Transparent
Definition: C4Landscape.h:51
bool DensitySolid(int32_t dens)
Definition: C4Landscape.h:199
int32_t GetWidth() const
int32_t BelowTempConvertDir
Definition: C4Material.h:126

Here is the call graph for this function:

Here is the caller graph for this function:

void C4Landscape::P::DrawChunk ( C4Landscape d,
int32_t  tx,
int32_t  ty,
int32_t  wdt,
int32_t  hgt,
uint8_t  mcol,
uint8_t  mcolBkg,
C4MaterialCoreShape  Shape,
uint32_t  cro 
)

Definition at line 2106 of file C4Landscape.cpp.

References C4M_Flat, C4M_Octagon, C4M_Rough, C4M_Smooth, C4M_Smoother, C4M_TopFlat, and C4Landscape::Transparent.

2107 {
2108  unsigned int top_rough = 0, side_rough = 0, bottom_rough = 0;
2109  // what to do?
2110  switch (Shape)
2111  {
2112  case C4M_Flat: case C4M_Octagon:
2113  if (mcol != Transparent) Surface8->Box(tx, ty, tx + wdt, ty + hgt, mcol);
2114  if (mcolBkg != Transparent) Surface8Bkg->Box(tx, ty, tx + wdt, ty + hgt, mcolBkg);
2115  return;
2116  case C4M_TopFlat:
2117  top_rough = 0; side_rough = 2; bottom_rough = 4;
2118  break;
2119  case C4M_Smooth:
2120  top_rough = 2; side_rough = 2; bottom_rough = 2;
2121  break;
2122  case C4M_Rough:
2123  top_rough = 4; side_rough = 4; bottom_rough = 4;
2124  break;
2125  case C4M_Smoother:
2126  top_rough = 1; side_rough = 1; bottom_rough = 1;
2127  break;
2128  }
2129  int vtcs[16];
2130  unsigned int rx = std::max(wdt / 2, 1);
2131 
2132  vtcs[0] = tx - ChunkyRandom(cro, rx * side_rough / 4); vtcs[1] = ty - ChunkyRandom(cro, rx * top_rough / 4);
2133  vtcs[2] = tx - ChunkyRandom(cro, rx * side_rough / 2); vtcs[3] = ty + hgt / 2;
2134  vtcs[4] = tx - ChunkyRandom(cro, rx * side_rough / 4); vtcs[5] = ty + hgt + ChunkyRandom(cro, rx * bottom_rough / 4);
2135  vtcs[6] = tx + wdt / 2; vtcs[7] = ty + hgt + ChunkyRandom(cro, rx * bottom_rough / 2);
2136  vtcs[8] = tx + wdt + ChunkyRandom(cro, rx * side_rough / 4); vtcs[9] = ty + hgt + ChunkyRandom(cro, rx * bottom_rough / 4);
2137  vtcs[10] = tx + wdt + ChunkyRandom(cro, rx * side_rough / 2); vtcs[11] = ty + hgt / 2;
2138  vtcs[12] = tx + wdt + ChunkyRandom(cro, rx * side_rough / 4); vtcs[13] = ty - ChunkyRandom(cro, rx * top_rough / 4);
2139  vtcs[14] = tx + wdt / 2; vtcs[15] = ty - ChunkyRandom(cro, rx * top_rough / 2);
2140 
2141  ForPolygon(d, vtcs, 8, nullptr, nullptr, mcol, mcolBkg);
2142 }
std::unique_ptr< CSurface8 > Surface8
Definition: C4Landscape.cpp:54
int32_t ForPolygon(C4Landscape *d, int *vtcs, int length, const std::function< bool(int32_t, int32_t)> &callback, C4MaterialList *mats_count=nullptr, uint8_t col=0, uint8_t colBkg=0, uint8_t *conversion_table=nullptr)
uint32_t ChunkyRandom(uint32_t &iOffset, uint32_t iRange) const
std::unique_ptr< CSurface8 > Surface8Bkg
Definition: C4Landscape.cpp:55
static const uint8_t Transparent
Definition: C4Landscape.h:51
bool C4Landscape::P::DrawLineLandscape ( int32_t  iX,
int32_t  iY,
int32_t  iGrade,
uint8_t  line_color,
uint8_t  line_color_bkg 
)

Definition at line 3448 of file C4Landscape.cpp.

3449 {
3450  Surface8->Circle(iX, iY, iGrade, line_color);
3451  Surface8Bkg->Circle(iX, iY, iGrade, line_color_bkg);
3452  return true;
3453 }
std::unique_ptr< CSurface8 > Surface8
Definition: C4Landscape.cpp:54
std::unique_ptr< CSurface8 > Surface8Bkg
Definition: C4Landscape.cpp:55
bool C4Landscape::P::DrawLineMap ( int32_t  iX,
int32_t  iY,
int32_t  iRadius,
uint8_t  line_color,
uint8_t  line_color_bkg 
)

Definition at line 3455 of file C4Landscape.cpp.

3456 {
3457  if (!Map) return false;
3458  if (iRadius == 1)
3459  {
3460  Map->SetPix(iX, iY, line_color); MapBkg->SetPix(iX, iY, line_color_bkg);
3461  }
3462  else
3463  {
3464  Map->Circle(iX, iY, iRadius, line_color); MapBkg->Circle(iX, iY, iRadius, line_color_bkg);
3465  }
3466  return true;
3467 }
std::unique_ptr< CSurface8 > Map
Definition: C4Landscape.cpp:56
std::unique_ptr< CSurface8 > MapBkg
Definition: C4Landscape.cpp:57
void C4Landscape::P::DrawSmoothOChunk ( C4Landscape d,
int32_t  tx,
int32_t  ty,
int32_t  wdt,
int32_t  hgt,
uint8_t  mcol,
uint8_t  mcolBkg,
int  flip,
uint32_t  cro 
)

Definition at line 2144 of file C4Landscape.cpp.

2145 {
2146  int vtcs[8];
2147  unsigned int rx = std::max(wdt / 2, 1);
2148 
2149  vtcs[0] = tx; vtcs[1] = ty;
2150  vtcs[2] = tx; vtcs[3] = ty + hgt;
2151  vtcs[4] = tx + wdt; vtcs[5] = ty + hgt;
2152  vtcs[6] = tx + wdt; vtcs[7] = ty;
2153 
2154  switch (flip)
2155  {
2156  case 0: vtcs[0] = tx + wdt / 2; vtcs[1] += hgt / 3; vtcs[7] -= ChunkyRandom(cro, rx / 2); break;
2157  case 1: vtcs[2] = tx + wdt / 2; vtcs[3] -= hgt / 3; vtcs[5] += ChunkyRandom(cro, rx / 2); break;
2158  case 2: vtcs[4] = tx + wdt / 2; vtcs[5] -= hgt / 3; vtcs[3] += ChunkyRandom(cro, rx / 2); break;
2159  case 3: vtcs[6] = tx + wdt / 2; vtcs[7] += hgt / 3; vtcs[1] -= ChunkyRandom(cro, rx / 2); break;
2160  case 4: vtcs[0] = tx + wdt / 2; vtcs[1] += hgt / 2; break;
2161  case 5: vtcs[2] = tx + wdt / 2; vtcs[3] -= hgt / 2; break;
2162  case 6: vtcs[4] = tx + wdt / 2; vtcs[5] -= hgt / 2; break;
2163  case 7: vtcs[6] = tx + wdt / 2; vtcs[7] += hgt / 2; break;
2164  }
2165 
2166  ForPolygon(d, vtcs, 4, nullptr, nullptr, mcol, mcolBkg);
2167 }
int32_t ForPolygon(C4Landscape *d, int *vtcs, int length, const std::function< bool(int32_t, int32_t)> &callback, C4MaterialList *mats_count=nullptr, uint8_t col=0, uint8_t colBkg=0, uint8_t *conversion_table=nullptr)
uint32_t ChunkyRandom(uint32_t &iOffset, uint32_t iRange) const
void C4Landscape::P::ExecuteScan ( C4Landscape d)

Definition at line 216 of file C4Landscape.cpp.

References C4Landscape::_GetMat(), C4MaterialCore::AboveTempConvert, C4Material::AboveTempConvertTo, AddDbgRec(), C4MaterialCore::BelowTempConvert, C4Material::BelowTempConvertTo, Config, C4ConfigGeneral::DebugRec, DEBUGREC_MATSCAN, DoScan(), C4Config::General, C4Weather::GetTemperature(), Height, C4MaterialMap::Map, MatCount, MaterialMap, C4MaterialMap::Num, RCT_MatScan, ScanSpeed, and Weather.

217 {
218  int32_t cy, mat;
219 
220  // Check: Scan needed?
221  const int32_t iTemperature = ::Weather.GetTemperature();
222  for (mat = 0; mat < ::MaterialMap.Num; mat++)
223  if (MatCount[mat])
224  {
225  if (::MaterialMap.Map[mat].BelowTempConvertTo &&
226  iTemperature < ::MaterialMap.Map[mat].BelowTempConvert)
227  break;
228  else if (::MaterialMap.Map[mat].AboveTempConvertTo &&
229  iTemperature > ::MaterialMap.Map[mat].AboveTempConvert)
230  break;
231  }
232  if (mat >= ::MaterialMap.Num)
233  return;
234 
236  AddDbgRec(RCT_MatScan, &ScanX, sizeof(ScanX));
237 
238  for (int32_t cnt = 0; cnt < ScanSpeed; cnt++)
239  {
240 
241  // Scan landscape column: sectors down
242  int32_t last_mat = -1;
243  for (cy = 0; cy < Height; cy++)
244  {
245  mat = d->_GetMat(ScanX, cy);
246  // material change?
247  if (last_mat != mat)
248  {
249  // upwards
250  if (last_mat != -1)
251  DoScan(d, ScanX, cy - 1, last_mat, 1);
252  // downwards
253  if (mat != -1)
254  cy += DoScan(d, ScanX, cy, mat, 0);
255  }
256  last_mat = mat;
257  }
258 
259  // Scan advance & rewind
260  ScanX++;
261  if (ScanX >= Width)
262  ScanX = 0;
263 
264  }
265 
266 }
std::array< DWORD, C4MaxMaterial > MatCount
Definition: C4Landscape.cpp:70
constexpr bool DEBUGREC_MATSCAN
Definition: C4Include.h:33
int32_t DoScan(C4Landscape *, int32_t x, int32_t y, int32_t mat, int32_t dir)
C4Config Config
Definition: C4Config.cpp:837
C4ConfigGeneral General
Definition: C4Config.h:252
C4Material * Map
Definition: C4Material.h:171
int32_t AboveTempConvert
Definition: C4Material.h:128
int32_t _GetMat(int32_t x, int32_t y) const
int32_t GetTemperature()
Definition: C4Weather.cpp:101
int32_t AboveTempConvertTo
Definition: C4Material.h:156
void AddDbgRec(C4RecordChunkType eType, const void *pData, int iSize)
Definition: C4Record.cpp:36
C4Weather Weather
Definition: C4Weather.cpp:207
int32_t Num
Definition: C4Material.h:170
int32_t BelowTempConvertTo
Definition: C4Material.h:155
int32_t BelowTempConvert
Definition: C4Material.h:125
C4MaterialMap MaterialMap
Definition: C4Material.cpp:970
int32_t DebugRec
Definition: C4Config.h:61
int32_t ScanSpeed
Definition: C4Landscape.cpp:74

Here is the call graph for this function:

void C4Landscape::P::FinishChange ( C4Landscape d,
C4Rect  BoundingBox 
)

Definition at line 3902 of file C4Landscape.cpp.

References C4SolidMask::CheckConsistency(), C4SolidMask::First, C4Rect::Hgt, C4Rect::Intersect(), C4SolidMask::Next, and C4Rect::Wdt.

3903 {
3904  // Intersect bounding box with landscape
3905  BoundingBox.Intersect(C4Rect(0, 0, Width, Height));
3906  if (!BoundingBox.Wdt || !BoundingBox.Hgt) return;
3907  // update render
3908  if (pLandscapeRender)
3909  pLandscapeRender->Update(BoundingBox, d);
3910  UpdateMatCnt(d, BoundingBox, true);
3911  // Restore Solidmasks
3912  C4Rect SolidMaskRect = BoundingBox;
3913  if (pLandscapeRender)
3914  SolidMaskRect = pLandscapeRender->GetAffectedRect(pLandscapeRender->GetAffectedRect(SolidMaskRect));
3915  for (C4SolidMask * pSolid = C4SolidMask::First; pSolid; pSolid = pSolid->Next)
3916  {
3917  pSolid->Repair(SolidMaskRect);
3918  }
3920  UpdatePixCnt(d, BoundingBox);
3921  // update FoW
3922  if (pFoW)
3923  {
3924  pFoW->Invalidate(BoundingBox);
3925  pFoW->Ambient.UpdateFromLandscape(*d, BoundingBox);
3926  }
3927 }
static bool CheckConsistency()
std::unique_ptr< C4FoW > pFoW
Definition: C4Landscape.cpp:84
Definition: C4Rect.h:29
void UpdateMatCnt(const C4Landscape *, C4Rect Rect, bool fPlus)
void Intersect(const C4Rect &r2)
Definition: C4Rect.cpp:100
int32_t Wdt
Definition: C4Rect.h:32
static C4SolidMask * First
Definition: C4SolidMask.h:72
std::unique_ptr< C4LandscapeRender > pLandscapeRender
Definition: C4Landscape.cpp:58
int32_t Hgt
Definition: C4Rect.h:32
void UpdatePixCnt(const C4Landscape *, const C4Rect &Rect, bool fCheck=false)
C4SolidMask * Next
Definition: C4SolidMask.h:75

Here is the call graph for this function:

int32_t C4Landscape::P::ForPolygon ( C4Landscape d,
int *  vtcs,
int  length,
const std::function< bool(int32_t, int32_t)> &  callback,
C4MaterialList mats_count = nullptr,
uint8_t  col = 0,
uint8_t  colBkg = 0,
uint8_t *  conversion_table = nullptr 
)

Definition at line 1223 of file C4Landscape.cpp.

References C4MaterialList::Add(), bottom, CPolyEdge::bottom, CPolyEdge::dx, C4Landscape::GetPix(), C4Landscape::GetPixMat(), CPolyEdge::next, POLYGON_FIX_SHIFT, CPolyEdge::prev, QuickPolyBuf, top, C4Landscape::Transparent, CPolyEdge::w, CPolyEdge::x, and CPolyEdge::y.

1225 {
1226  // Variables for polygon drawer
1227  int c, x1, x2, y;
1228  int top = INT_MAX;
1229  int bottom = INT_MIN;
1230  int *i1, *i2;
1231  CPolyEdge *edge, *next_edge, *edgebuf;
1232  CPolyEdge *active_edges = nullptr;
1233  CPolyEdge *inactive_edges = nullptr;
1234  bool use_qpb = false;
1235 
1236  // Return value
1237  int32_t amount = 0;
1238  // Poly Buf
1239  if (length <= QuickPolyBufSize)
1240  {
1241  edgebuf = QuickPolyBuf; use_qpb = true;
1242  }
1243  else if (!(edgebuf = new CPolyEdge[length])) { return 0; }
1244 
1245  // Fill the edge table
1246  edge = edgebuf;
1247  i1 = vtcs;
1248  i2 = vtcs + (length - 1) * 2;
1249  for (c = 0; c < length; c++)
1250  {
1251  if (i1[1] != i2[1])
1252  {
1253  fill_edge_structure(edge, i1, i2);
1254  if (edge->bottom >= edge->y)
1255  {
1256  if (edge->y < top) top = edge->y;
1257  if (edge->bottom > bottom) bottom = edge->bottom;
1258  inactive_edges = add_edge(inactive_edges, edge, false);
1259  edge++;
1260  }
1261  }
1262  i2 = i1; i1 += 2;
1263  }
1264 
1265  // For each scanline in the polygon...
1266  for (c = top; c <= bottom; c++)
1267  {
1268  // Check for newly active edges
1269  edge = inactive_edges;
1270  while ((edge) && (edge->y == c))
1271  {
1272  next_edge = edge->next;
1273  inactive_edges = remove_edge(inactive_edges, edge);
1274  active_edges = add_edge(active_edges, edge, true);
1275  edge = next_edge;
1276  }
1277 
1278  // Draw horizontal line segments
1279  edge = active_edges;
1280  while ((edge) && (edge->next))
1281  {
1282  x1 = edge->x >> POLYGON_FIX_SHIFT;
1283  x2 = (edge->next->x + edge->next->w) >> POLYGON_FIX_SHIFT;
1284  y = c;
1285  // Fix coordinates
1286  if (x1 > x2) std::swap(x1, x2);
1287  // Set line
1288  if (callback)
1289  {
1290  for (int xcnt = x2 - x1 - 1; xcnt >= 0; xcnt--)
1291  {
1292  uint8_t pix = d->GetPix(x1 + xcnt, y);
1293  if (!conversion_table || conversion_table[pix])
1294  {
1295  int32_t mat = d->GetPixMat(pix);
1296  if (callback(x1 + xcnt, y))
1297  if (mats_count)
1298  {
1299  mats_count->Add(mat, 1);
1300  amount++;
1301  }
1302  }
1303  }
1304  }
1305  else if (conversion_table)
1306  for (int xcnt = x2 - x1 - 1; xcnt >= 0; xcnt--)
1307  {
1308  const uint8_t pix = conversion_table[uint8_t(d->GetPix(x1 + xcnt, y))];
1309  Surface8->SetPix(x1 + xcnt, y, pix);
1310  if (colBkg != Transparent) Surface8Bkg->SetPix(x1 + xcnt, y, colBkg);
1311  }
1312  else
1313  for (int xcnt = x2 - x1 - 1; xcnt >= 0; xcnt--)
1314  {
1315  if (col != Transparent) Surface8->SetPix(x1 + xcnt, y, col);
1316  if (colBkg != Transparent) Surface8Bkg->SetPix(x1 + xcnt, y, colBkg);
1317  }
1318  edge = edge->next->next;
1319  }
1320 
1321  // Update edges, sorting and removing dead ones
1322  edge = active_edges;
1323  while (edge)
1324  {
1325  next_edge = edge->next;
1326  if (c >= edge->bottom)
1327  {
1328  active_edges = remove_edge(active_edges, edge);
1329  }
1330  else
1331  {
1332  edge->x += edge->dx;
1333  while ((edge->prev) && (edge->x + edge->w / 2 < edge->prev->x + edge->prev->w / 2))
1334  {
1335  if (edge->next) edge->next->prev = edge->prev;
1336  edge->prev->next = edge->next;
1337  edge->next = edge->prev;
1338  edge->prev = edge->prev->prev;
1339  edge->next->prev = edge;
1340  if (edge->prev) edge->prev->next = edge;
1341  else active_edges = edge;
1342  }
1343  }
1344  edge = next_edge;
1345  }
1346  }
1347 
1348  // Clear scratch memory
1349  if (!use_qpb) delete[] edgebuf;
1350 
1351  return amount;
1352 }
std::unique_ptr< CSurface8 > Surface8
Definition: C4Landscape.cpp:54
struct CPolyEdge * prev
CPolyEdge QuickPolyBuf[QuickPolyBufSize]
struct CPolyEdge * next
BYTE GetPix(int32_t x, int32_t y) const
int32_t GetPixMat(BYTE byPix) const
std::unique_ptr< CSurface8 > Surface8Bkg
Definition: C4Landscape.cpp:55
const int QuickPolyBufSize
#define POLYGON_FIX_SHIFT
static const uint8_t Transparent
Definition: C4Landscape.h:51
void Add(int32_t iMaterial, int32_t iAmount)

Here is the call graph for this function:

uint8_t * C4Landscape::P::GetBridgeMatConversion ( const C4Landscape d,
int32_t  for_material_col 
) const

Definition at line 3839 of file C4Landscape.cpp.

References C4M_MaxTexIndex, C4Landscape::GetPixDensity(), C4Landscape::GetPixMat(), MatDensity(), MaterialMap, and C4MaterialMap::Num.

3840 {
3841  // safety
3842  int32_t for_material = d->GetPixMat(for_material_col);
3843  if (for_material < 0 || for_material >= MaterialMap.Num) return nullptr;
3844  // query map. create if not done yet
3845  if (!BridgeMatConversion[for_material_col])
3846  {
3847  auto conv_map = std::make_unique<uint8_t[]>(C4M_MaxTexIndex);
3848  for (int32_t i = 0; i < C4M_MaxTexIndex; ++i)
3849  {
3850  if ((MatDensity(for_material) >= d->GetPixDensity(i)))
3851  {
3852  // bridge pixel OK here. change pixel.
3853  conv_map[i] = for_material_col;
3854  }
3855  else
3856  {
3857  // bridge pixel not OK - keep current pixel
3858  conv_map[i] = i;
3859  }
3860  }
3861  BridgeMatConversion[for_material_col] = std::move(conv_map);
3862  }
3863  return BridgeMatConversion[for_material_col].get();
3864 }
int32_t MatDensity(int32_t mat)
Definition: C4Material.h:242
const int C4M_MaxTexIndex
Definition: C4Constants.h:51
int32_t Num
Definition: C4Material.h:170
int32_t GetPixMat(BYTE byPix) const
int32_t GetPixDensity(BYTE byPix) const
C4MaterialMap MaterialMap
Definition: C4Material.cpp:970
std::array< std::unique_ptr< uint8_t[]>, C4M_MaxTexIndex > BridgeMatConversion
Definition: C4Landscape.cpp:65

Here is the call graph for this function:

bool C4Landscape::P::GetMapColorIndex ( const char *  szMaterial,
const char *  szTexture,
BYTE rbyCol 
) const

Definition at line 3380 of file C4Landscape.cpp.

References C4TLS_MatSky, C4TextureMap::GetIndex(), SEqual(), and TextureMap.

3381 {
3382  // Sky
3383  if (SEqual(szMaterial, C4TLS_MatSky))
3384  rbyCol = 0;
3385  // Material-Texture
3386  else
3387  {
3388  rbyCol = ::TextureMap.GetIndex(szMaterial, szTexture);
3389  if (!rbyCol) return false;
3390  }
3391  // Found
3392  return true;
3393 }
C4TextureMap TextureMap
Definition: C4Texture.cpp:585
bool SEqual(const char *szStr1, const char *szStr2)
Definition: Standard.h:97
int32_t GetIndex(const char *szMaterial, const char *szTexture, bool fAddIfNotExist=true, const char *szErrorIfFailed=nullptr)
Definition: C4Texture.cpp:423
#define C4TLS_MatSky
Definition: C4ToolsDlg.h:39

Here is the call graph for this function:

bool C4Landscape::P::InitTopAndBottomRowPix ( )

Definition at line 2039 of file C4Landscape.cpp.

References C4SLandscape::BottomOpen, C4Game::C4S, Game, C4Scenario::Landscape, MCVehic, C4SLandscape::TopOpen, and CPolyEdge::x.

2040 {
2041  assert(Width > 0);
2042  // Init Top-/BottomRowPix array, which determines if out-of-landscape pixels on top/bottom side of the map are solid or not
2043  // In case of Top-/BottomOpen=2, unit by map and not landscape to avoid runtime join sync losses
2044  if (!Width) return true;
2045  TopRowPix.clear();
2046  BottomRowPix.clear();
2047  // must access Game.C4S here because Landscape.TopOpen / Landscape.BottomOpen may not be initialized yet
2048  // why is there a local copy of that static variable anyway?
2049  int32_t top_open_flag = Game.C4S.Landscape.TopOpen;
2050  int32_t bottom_open_flag = Game.C4S.Landscape.BottomOpen;
2051  if (top_open_flag == 2 && !Map) top_open_flag = 1;
2052  if (bottom_open_flag == 2 && !Map) bottom_open_flag = 1;
2053 
2054  // Init TopRowPix
2055  switch (top_open_flag)
2056  {
2057  // TopOpen=0: Top is closed
2058  case 0: TopRowPix.assign(Width, MCVehic); break;
2059  // TopOpen=2: Top is open when pixel below has sky background
2060  case 2:
2061  TopRowPix.resize(Width);
2062  for (int32_t x = 0; x < Width; ++x)
2063  {
2064  uint8_t map_pix = MapBkg->GetPix(x / MapZoom, 0);
2065  TopRowPix[x] = ((map_pix != 0) ? MCVehic : 0);
2066  }
2067  break;
2068  // TopOpen=1: Top is open
2069  default: TopRowPix.assign(Width, 0); break;
2070  }
2071 
2072  // Init BottomRowPix
2073  switch (bottom_open_flag)
2074  {
2075  // BottomOpen=0: Bottom is closed
2076  case 0: BottomRowPix.assign(Width, MCVehic); break;
2077  // BottomOpen=2: Bottom is open when pixel above has sky background
2078  case 2:
2079  BottomRowPix.resize(Width);
2080  for (int32_t x = 0; x < Width; ++x)
2081  {
2082  uint8_t map_pix = MapBkg->GetPix(x / MapZoom, Map->Hgt - 1);
2083  BottomRowPix[x] = ((map_pix != 0) ? MCVehic : 0);
2084  }
2085  break;
2086  // BottomOpen=1: Bottom is open
2087  default: BottomRowPix.assign(Width, 0); break;
2088  }
2089  return true;
2090 }
C4Game Game
Definition: C4Globals.cpp:52
C4Scenario C4S
Definition: C4Game.h:76
C4SLandscape Landscape
Definition: C4Scenario.h:234
std::unique_ptr< CSurface8 > Map
Definition: C4Landscape.cpp:56
int32_t TopOpen
Definition: C4Scenario.h:168
BYTE MCVehic
Definition: C4Material.cpp:38
int32_t BottomOpen
Definition: C4Scenario.h:168
std::vector< uint8_t > TopRowPix
Definition: C4Landscape.cpp:59
std::vector< uint8_t > BottomRowPix
Definition: C4Landscape.cpp:59
std::unique_ptr< CSurface8 > MapBkg
Definition: C4Landscape.cpp:57
bool C4Landscape::P::MapToLandscape ( C4Landscape d,
const CSurface8 sfcMap,
const CSurface8 sfcMapBkg,
int32_t  iMapX,
int32_t  iMapY,
int32_t  iMapWdt,
int32_t  iMapHgt,
int32_t  iOffsX = 0,
int32_t  iOffsY = 0,
bool  noClear = false 
)

Definition at line 2351 of file C4Landscape.cpp.

References CSurface8::GetSurfaceSize(), C4Rect::Hgt, C4Rect::Wdt, C4Rect::x, and C4Rect::y.

2352 {
2353  assert(Surface8 && Surface8Bkg);
2354  // Clip to map/landscape segment
2355  int iMapWidth, iMapHeight, iLandscapeWidth, iLandscapeHeight;
2356  // Get map & landscape size
2357  sfcMap.GetSurfaceSize(iMapWidth, iMapHeight);
2358  Surface8->GetSurfaceSize(iLandscapeWidth, iLandscapeHeight);
2359  // Clip map segment to map size
2360  iMapX = Clamp<int32_t>(iMapX, 0, iMapWidth - 1); iMapY = Clamp<int32_t>(iMapY, 0, iMapHeight - 1);
2361  iMapWdt = Clamp<int32_t>(iMapWdt, 0, iMapWidth - iMapX); iMapHgt = Clamp<int32_t>(iMapHgt, 0, iMapHeight - iMapY);
2362  // No segment
2363  if (!iMapWdt || !iMapHgt) return true;
2364 
2365  // Get affected landscape rect
2366  C4Rect To;
2367  To.x = iMapX*MapZoom + iOffsX;
2368  To.y = iMapY*MapZoom + iOffsY;
2369  To.Wdt = iMapWdt*MapZoom;
2370  To.Hgt = iMapHgt*MapZoom;
2371 
2372  PrepareChange(d, To);
2373 
2374  // clear the old landscape if not supressed
2375  if (!noClear)
2376  {
2377  Surface8->ClearBox8Only(To.x, To.y, To.Wdt, To.Hgt);
2378  Surface8Bkg->ClearBox8Only(To.x, To.y, To.Wdt, To.Hgt);
2379  }
2380 
2381  MapToSurface(d, sfcMap, sfcMapBkg, iMapX, iMapY, iMapWdt, iMapHgt, To.x, To.y, To.Wdt, To.Hgt, iOffsX, iOffsY);
2382  FinishChange(d, To);
2383  return true;
2384 }
std::unique_ptr< CSurface8 > Surface8
Definition: C4Landscape.cpp:54
bool MapToSurface(C4Landscape *, const CSurface8 &sfcMap, const CSurface8 &sfcMapBkg, int32_t iMapX, int32_t iMapY, int32_t iMapWdt, int32_t iMapHgt, int32_t iToX, int32_t iToY, int32_t iToWdt, int32_t iToHgt, int32_t iOffX, int32_t iOffY)
Definition: C4Rect.h:29
int32_t Wdt
Definition: C4Rect.h:32
void PrepareChange(const C4Landscape *d, const C4Rect &BoundingBox)
int32_t y
Definition: C4Rect.h:32
void GetSurfaceSize(int &irX, int &irY) const
Definition: CSurface8.cpp:195
int32_t x
Definition: C4Rect.h:32
std::unique_ptr< CSurface8 > Surface8Bkg
Definition: C4Landscape.cpp:55
int32_t Hgt
Definition: C4Rect.h:32
void FinishChange(C4Landscape *d, C4Rect BoundingBox)

Here is the call graph for this function:

bool C4Landscape::P::MapToSurface ( C4Landscape d,
const CSurface8 sfcMap,
const CSurface8 sfcMapBkg,
int32_t  iMapX,
int32_t  iMapY,
int32_t  iMapWdt,
int32_t  iMapHgt,
int32_t  iToX,
int32_t  iToY,
int32_t  iToWdt,
int32_t  iToHgt,
int32_t  iOffX,
int32_t  iOffY 
)

Definition at line 2323 of file C4Landscape.cpp.

References C4M_MaxTexIndex, MaterialMap, C4MaterialMap::max_shape_height, C4MaterialMap::max_shape_width, C4Draw::NoPrimaryClipper(), and pDraw.

2324 {
2325 
2326  // assign clipper
2327  Surface8->Clip(iToX, iToY, iToX + iToWdt - 1, iToY + iToHgt - 1);
2328  Surface8Bkg->Clip(iToX, iToY, iToX + iToWdt - 1, iToY + iToHgt - 1);
2330 
2331  // Enlarge map segment for chunky rim
2332  iMapX -= 2 + MaterialMap.max_shape_width / MapZoom;
2333  iMapY -= 2 + MaterialMap.max_shape_height / MapZoom;
2334  iMapWdt += 4 + MaterialMap.max_shape_width / MapZoom * 2;
2335  iMapHgt += 4 + MaterialMap.max_shape_height / MapZoom * 2;
2336 
2337  // Determine texture usage in map segment
2338  DWORD dwTexUsage[C4M_MaxTexIndex];
2339  if (!GetTexUsage(sfcMap, sfcMapBkg, iMapX, iMapY, iMapWdt, iMapHgt, dwTexUsage)) return false;
2340  // Texture zoom map to landscape
2341  if (!TexOZoom(d, sfcMap, sfcMapBkg, iMapX, iMapY, iMapWdt, iMapHgt, dwTexUsage, iOffX, iOffY)) return false;
2342 
2343  // remove clipper
2344  Surface8->NoClip();
2345  Surface8Bkg->NoClip();
2346 
2347  // success
2348  return true;
2349 }
std::unique_ptr< CSurface8 > Surface8
Definition: C4Landscape.cpp:54
int32_t max_shape_height
Definition: C4Material.h:173
bool TexOZoom(C4Landscape *, const CSurface8 &sfcMap, const CSurface8 &sfcMapBkg, int32_t iMapX, int32_t iMapY, int32_t iMapWdt, int32_t iMapHgt, DWORD *dwpTextureUsage, int32_t iToX=0, int32_t iToY=0)
const int C4M_MaxTexIndex
Definition: C4Constants.h:51
C4Draw * pDraw
Definition: C4Draw.cpp:45
std::unique_ptr< CSurface8 > Surface8Bkg
Definition: C4Landscape.cpp:55
C4MaterialMap MaterialMap
Definition: C4Material.cpp:970
int32_t max_shape_width
Definition: C4Material.h:173
bool NoPrimaryClipper()
Definition: C4Draw.cpp:240
uint32_t DWORD

Here is the call graph for this function:

bool C4Landscape::P::Mat2Pal ( )

Definition at line 4213 of file C4Landscape.cpp.

References C4M_MaxTexIndex, C4TextureMap::GetEntry(), C4TexMapEntry::GetPattern(), C4TexMapEntry::isNull(), MatTex2PixCol(), C4Pattern::PatternClr(), and TextureMap.

4214 {
4215  if (!Surface8 || !Surface8Bkg) return false;
4216  // set landscape pal
4217  int32_t tex;
4218  for (tex = 0; tex < C4M_MaxTexIndex; tex++)
4219  {
4220  const C4TexMapEntry *pTex = ::TextureMap.GetEntry(tex);
4221  if (!pTex || pTex->isNull())
4222  continue;
4223  // colors
4224  DWORD dwPix = pTex->GetPattern().PatternClr(0, 0);
4225  Surface8->pPal->Colors[MatTex2PixCol(tex)] = dwPix;
4226  Surface8Bkg->pPal->Colors[MatTex2PixCol(tex)] = dwPix;
4227  }
4228  // success
4229  return true;
4230 }
DWORD PatternClr(unsigned int iX, unsigned int iY) const
Definition: C4Draw.cpp:162
std::unique_ptr< CSurface8 > Surface8
Definition: C4Landscape.cpp:54
C4TextureMap TextureMap
Definition: C4Texture.cpp:585
const C4TexMapEntry * GetEntry(int32_t iIndex) const
Definition: C4Texture.h:85
Definition: C4Texture.h:48
const C4Pattern & GetPattern() const
Definition: C4Texture.h:64
const int C4M_MaxTexIndex
Definition: C4Constants.h:51
bool isNull() const
Definition: C4Texture.h:59
std::unique_ptr< CSurface8 > Surface8Bkg
Definition: C4Landscape.cpp:55
BYTE MatTex2PixCol(int32_t tex)
Definition: C4Material.h:232
uint32_t DWORD

Here is the call graph for this function:

void C4Landscape::P::PostFreeShape ( C4ValueArray dig_objects,
C4Object by_object 
)

Definition at line 537 of file C4Landscape.cpp.

References C4PropList::Call(), C4Object::Contained, GBackSolid(), C4ValueArray::GetItem(), C4Value::getObj(), C4ValueArray::GetSize(), C4Object::GetX(), C4Object::GetY(), PSF_DigOutObject, PSF_OnDugOut, and C4PropList::Status.

538 {
539  // Do callbacks to digger and dug out objects for objects that are now dug free
540  if (by_object)
541  {
542  for (int32_t i = 0; i < dig_objects->GetSize(); ++i)
543  {
544  C4Object *dig_object = dig_objects->GetItem(i).getObj();
545  if (dig_object && !GBackSolid(dig_object->GetX(), dig_object->GetY()))
546  if (dig_object != by_object)
547  if (!dig_object->Contained && dig_object->Status)
548  {
549  C4AulParSet pars(by_object);
550  dig_object->Call(PSF_OnDugOut, &pars);
551  if (dig_object->Status && by_object->Status)
552  {
553  C4AulParSet pars(dig_object);
554  by_object->Call(PSF_DigOutObject, &pars);
555  }
556  }
557  }
558  }
559 }
int32_t GetY() const
Definition: C4Object.h:287
const C4Value & GetItem(int32_t iElem) const
Definition: C4ValueArray.h:38
int32_t GetX() const
Definition: C4Object.h:286
int32_t Status
Definition: C4PropList.h:170
int32_t GetSize() const
Definition: C4ValueArray.h:36
C4ObjectPtr Contained
Definition: C4Object.h:144
C4Value Call(C4PropertyName k, C4AulParSet *pPars=0, bool fPassErrors=false)
Definition: C4PropList.h:112
#define PSF_OnDugOut
Definition: C4GameScript.h:100
#define PSF_DigOutObject
Definition: C4GameScript.h:99
C4Object * getObj() const
Definition: C4Value.cpp:70
bool GBackSolid(int32_t x, int32_t y)
Definition: C4Landscape.h:232

Here is the call graph for this function:

void C4Landscape::P::PrepareChange ( const C4Landscape d,
const C4Rect BoundingBox 
)

Definition at line 3889 of file C4Landscape.cpp.

References C4SolidMask::Last, and C4SolidMask::Prev.

3890 {
3891  // move solidmasks out of the way
3892  C4Rect SolidMaskRect = BoundingBox;
3893  if (pLandscapeRender)
3894  SolidMaskRect = pLandscapeRender->GetAffectedRect(pLandscapeRender->GetAffectedRect(SolidMaskRect));
3895  for (C4SolidMask * pSolid = C4SolidMask::Last; pSolid; pSolid = pSolid->Prev)
3896  {
3897  pSolid->RemoveTemporary(SolidMaskRect);
3898  }
3899  UpdateMatCnt(d, BoundingBox, false);
3900 }
Definition: C4Rect.h:29
void UpdateMatCnt(const C4Landscape *, C4Rect Rect, bool fPlus)
std::unique_ptr< C4LandscapeRender > pLandscapeRender
Definition: C4Landscape.cpp:58
C4SolidMask * Prev
Definition: C4SolidMask.h:74
static C4SolidMask * Last
Definition: C4SolidMask.h:73
C4ValueArray * C4Landscape::P::PrepareFreeShape ( C4Rect BoundingBox,
C4Object by_object 
)

Definition at line 526 of file C4Landscape.cpp.

References C4FindObject::FindMany(), C4Object::Layer, Objects, OCF_InSolid, and C4GameObjects::Sectors.

527 {
528  // Remember any in-earth objects in area
529  C4FindObjectInRect fo_inrect(BoundingBox);
530  C4FindObjectOCF fo_insolid(OCF_InSolid);
531  C4FindObjectLayer fo_layer(by_object ? by_object->Layer : nullptr);
532  C4FindObject *fo_list[] = { &fo_inrect, &fo_insolid, &fo_layer };
533  C4FindObjectAndStatic fo_srch(3, fo_list);
534  return fo_srch.FindMany(::Objects, ::Objects.Sectors);
535 }
const uint32_t OCF_InSolid
Definition: C4Constants.h:100
C4ObjectPtr Layer
Definition: C4Object.h:136
C4LSectors Sectors
Definition: C4GameObjects.h:42
C4GameObjects Objects
Definition: C4Globals.cpp:48

Here is the call graph for this function:

bool C4Landscape::P::SaveDiffInternal ( const C4Landscape d,
C4Group hGroup,
bool  fSyncSave 
) const

Definition at line 1758 of file C4Landscape.cpp.

References C4Config::AtTempPath(), C4CFN_DiffLandscape, C4CFN_DiffLandscapeBkg, C4CFN_TempLandscape, C4CFN_TempLandscapeBkg, C4M_MaxTexIndex, Config, C4Group::Move(), C4Landscape::SaveMap(), and C4Landscape::SaveTextures().

1759 {
1760  assert(pInitial && pInitialBkg);
1761  if (!pInitial || !pInitialBkg) return false;
1762 
1763  // If it shouldn't be sync-save: Clear all bytes that have not changed, i.e.
1764  // set them to C4M_MaxTexIndex
1765  bool fChanged = false, fChangedBkg = false;;
1766  if (!fSyncSave)
1767  for (int y = 0; y < Height; y++)
1768  for (int x = 0; x < Width; x++)
1769  {
1770  if (pInitial[y * Width + x] == Surface8->_GetPix(x, y))
1771  Surface8->SetPix(x, y, C4M_MaxTexIndex);
1772  else
1773  fChanged = true;
1774 
1775  if (pInitialBkg[y * Width + x] == Surface8Bkg->_GetPix(x, y))
1776  Surface8Bkg->SetPix(x, y, C4M_MaxTexIndex);
1777  else
1778  fChangedBkg = true;
1779  }
1780 
1781  if (fSyncSave || fChanged)
1782  {
1783  // Save landscape surface
1785  return false;
1786 
1787  // Move temp file to group
1790  return false;
1791  }
1792 
1793  if (fSyncSave || fChangedBkg)
1794  {
1795  // Save landscape surface
1797  return false;
1798 
1799  // Move temp file to group
1802  return false;
1803  }
1804 
1805  // Restore landscape pixels
1806  if (!fSyncSave)
1807  for (int y = 0; y < Height; y++)
1808  for (int x = 0; x < Width; x++)
1809  {
1810  if (Surface8->_GetPix(x, y) == C4M_MaxTexIndex)
1811  Surface8->SetPix(x, y, pInitial[y * Width + x]);
1812  if (Surface8Bkg->_GetPix(x, y) == C4M_MaxTexIndex)
1813  Surface8Bkg->SetPix(x, y, pInitialBkg[y * Width + x]);
1814  }
1815 
1816  // Save changed map, too
1817  if (fMapChanged && Map)
1818  if (!d->SaveMap(hGroup)) return false;
1819 
1820  // and textures (if changed)
1821  if (!d->SaveTextures(hGroup)) return false;
1822 
1823  return true;
1824 }
#define C4CFN_DiffLandscapeBkg
Definition: C4Components.h:64
C4Config Config
Definition: C4Config.cpp:837
std::unique_ptr< CSurface8 > Surface8
Definition: C4Landscape.cpp:54
#define C4CFN_DiffLandscape
Definition: C4Components.h:63
std::unique_ptr< CSurface8 > Map
Definition: C4Landscape.cpp:56
bool SaveTextures(C4Group &hGroup) const
std::unique_ptr< BYTE[]> pInitialBkg
Definition: C4Landscape.cpp:83
const int C4M_MaxTexIndex
Definition: C4Constants.h:51
bool Move(const char *szFile, const char *szAddAs)
Definition: C4Group.cpp:1325
#define C4CFN_TempLandscapeBkg
Definition: C4Components.h:157
std::unique_ptr< BYTE[]> pInitial
Definition: C4Landscape.cpp:82
std::unique_ptr< CSurface8 > Surface8Bkg
Definition: C4Landscape.cpp:55
const char * AtTempPath(const char *szFilename)
Definition: C4Config.cpp:544
bool SaveMap(C4Group &hGroup) const
#define C4CFN_TempLandscape
Definition: C4Components.h:156

Here is the call graph for this function:

bool C4Landscape::P::SaveInternal ( const C4Landscape d,
C4Group hGroup 
) const

Definition at line 1717 of file C4Landscape.cpp.

References _MAX_PATH, C4Config::AtTempPath(), C4CFN_LandscapeBg, C4CFN_LandscapeFg, C4CFN_TempLandscape, C4CFN_TempLandscapeBkg, Config, MakeTempFilename(), C4Group::Move(), C4Landscape::SaveMap(), C4Landscape::SaveTextures(), and SCopy().

1718 {
1719  // Save landscape surface
1720  char szTempLandscape[_MAX_PATH + 1];
1721  SCopy(Config.AtTempPath(C4CFN_TempLandscape), szTempLandscape);
1722  MakeTempFilename(szTempLandscape);
1723  if (!Surface8->Save(szTempLandscape))
1724  return false;
1725 
1726  // Move temp file to group
1727  if (!hGroup.Move(szTempLandscape, C4CFN_LandscapeFg))
1728  return false;
1729 
1730  // Same for background surface
1731  SCopy(Config.AtTempPath(C4CFN_TempLandscapeBkg), szTempLandscape);
1732  MakeTempFilename(szTempLandscape);
1733  if (!Surface8Bkg->Save(szTempLandscape))
1734  return false;
1735  if (!hGroup.Move(szTempLandscape, C4CFN_LandscapeBg))
1736  return false;
1737 
1738  // Save map
1739  if (fMapChanged && Map)
1740  if (!d->SaveMap(hGroup))
1741  return false;
1742 
1743  // save textures (if changed)
1744  if (!d->SaveTextures(hGroup))
1745  return false;
1746 
1747  return true;
1748 }
C4Config Config
Definition: C4Config.cpp:837
void SCopy(const char *szSource, char *sTarget, size_t iMaxL)
Definition: Standard.cpp:129
std::unique_ptr< CSurface8 > Surface8
Definition: C4Landscape.cpp:54
#define _MAX_PATH
std::unique_ptr< CSurface8 > Map
Definition: C4Landscape.cpp:56
bool SaveTextures(C4Group &hGroup) const
bool Move(const char *szFile, const char *szAddAs)
Definition: C4Group.cpp:1325
#define C4CFN_TempLandscapeBkg
Definition: C4Components.h:157
#define C4CFN_LandscapeFg
Definition: C4Components.h:61
std::unique_ptr< CSurface8 > Surface8Bkg
Definition: C4Landscape.cpp:55
const char * AtTempPath(const char *szFilename)
Definition: C4Config.cpp:544
void MakeTempFilename(char *szFilename)
Definition: StdFile.cpp:333
bool SaveMap(C4Group &hGroup) const
#define C4CFN_LandscapeBg
Definition: C4Components.h:62
#define C4CFN_TempLandscape
Definition: C4Components.h:156

Here is the call graph for this function:

bool C4Landscape::P::ShakeFreePix ( C4Landscape d,
int32_t  tx,
int32_t  ty 
)

Definition at line 764 of file C4Landscape.cpp.

References C4Landscape::CheckInstabilityRange(), C4Landscape::ClearPix(), C4PXSSystem::Create(), C4MaterialCore::DigFree, C4Landscape::GetMat(), itofix(), C4MaterialMap::Map, MaterialMap, MatValid(), and PXS.

765 {
766  int32_t mat = d->GetMat(tx, ty);
767  if (MatValid(mat))
768  {
769  if (::MaterialMap.Map[mat].DigFree)
770  {
771  d->ClearPix(tx, ty);
772  ::PXS.Create(mat, itofix(tx), itofix(ty));
773  // check for instable materials to start moving by the cleared space
774  d->CheckInstabilityRange(tx, ty);
775  return true;
776  }
777  }
778  return false;
779 }
C4Material * Map
Definition: C4Material.h:171
bool Create(int32_t mat, C4Real ix, C4Real iy, C4Real ixdir=Fix0, C4Real iydir=Fix0)
Definition: C4PXS.cpp:206
void CheckInstabilityRange(int32_t tx, int32_t ty)
C4Fixed itofix(int32_t x)
Definition: C4Real.h:261
C4PXSSystem PXS
Definition: C4PXS.cpp:526
int32_t GetMat(int32_t x, int32_t y) const
C4MaterialMap MaterialMap
Definition: C4Material.cpp:970
bool ClearPix(int32_t tx, int32_t ty)
bool MatValid(int32_t mat)
Definition: C4Material.h:212
int32_t DigFree
Definition: C4Material.h:96

Here is the call graph for this function:

bool C4Landscape::P::TexOZoom ( C4Landscape d,
const CSurface8 sfcMap,
const CSurface8 sfcMapBkg,
int32_t  iMapX,
int32_t  iMapY,
int32_t  iMapWdt,
int32_t  iMapHgt,
DWORD dwpTextureUsage,
int32_t  iToX = 0,
int32_t  iToY = 0 
)

Definition at line 2307 of file C4Landscape.cpp.

References C4TextureMap::Order, and TextureMap.

2308 {
2309  // ChunkOZoom all used textures
2310  for (auto iIndex : ::TextureMap.Order)
2311  {
2312  if (dwpTextureUsage[iIndex] > 0)
2313  {
2314  // ChunkOZoom map to landscape
2315  ChunkOZoom(d, sfcMap, sfcMapBkg, iMapX, iMapY, iMapWdt, iMapHgt, iIndex, iToX, iToY);
2316  }
2317  }
2318 
2319  // Done
2320  return true;
2321 }
C4TextureMap TextureMap
Definition: C4Texture.cpp:585
std::vector< int32_t > Order
Definition: C4Texture.h:77
void ChunkOZoom(C4Landscape *, const CSurface8 &sfcMap, const CSurface8 &sfcMapBkg, int32_t iMapX, int32_t iMapY, int32_t iMapWdt, int32_t iMapHgt, uint8_t iTexture, int32_t iOffX=0, int32_t iOffY=0)
void C4Landscape::P::UpdateMatCnt ( const C4Landscape d,
C4Rect  Rect,
bool  fPlus 
)

Definition at line 4250 of file C4Landscape.cpp.

References C4Landscape::_GetMat(), C4Landscape::GetMatHeight(), C4Rect::Hgt, C4Rect::Intersect(), C4MaterialMap::Map, MaterialMap, C4MaterialCore::MinHeightCount, C4Rect::Wdt, C4Rect::x, C4Rect::y, and CPolyEdge::y.

4251 {
4252  Rect.Intersect(C4Rect(0, 0, Width, Height));
4253  if (!Rect.Hgt || !Rect.Wdt) return;
4254  // Multiplicator for changes
4255  const int32_t iMul = fPlus ? +1 : -1;
4256  // Count pixels
4257  for (int32_t x = 0; x < Rect.Wdt; x++)
4258  {
4259  int iHgt = 0;
4260  int32_t y;
4261  for (y = 1; y < Rect.Hgt; y++)
4262  {
4263  int32_t iMat = d->_GetMat(Rect.x + x, Rect.y + y - 1);
4264  // Same material? Count it.
4265  if (iMat == d->_GetMat(Rect.x + x, Rect.y + y))
4266  iHgt++;
4267  else
4268  {
4269  if (iMat >= 0)
4270  {
4271  // Normal material counting
4272  MatCount[iMat] += iMul * (iHgt + 1);
4273  // Effective material counting enabled?
4274  if (int32_t iMinHgt = ::MaterialMap.Map[iMat].MinHeightCount)
4275  {
4276  // First chunk? Add any material above when checking chunk height
4277  int iAddedHeight = 0;
4278  if (Rect.y && iHgt + 1 == y)
4279  iAddedHeight = d->GetMatHeight(Rect.x + x, Rect.y - 1, -1, iMat, iMinHgt);
4280  // Check the chunk height
4281  if (iHgt + 1 + iAddedHeight >= iMinHgt)
4282  {
4283  EffectiveMatCount[iMat] += iMul * (iHgt + 1);
4284  if (iAddedHeight < iMinHgt)
4285  EffectiveMatCount[iMat] += iMul * iAddedHeight;
4286  }
4287  }
4288  }
4289  // Next chunk of material
4290  iHgt = 0;
4291  }
4292  }
4293  // Check last pixel
4294  int32_t iMat = d->_GetMat(Rect.x + x, Rect.y + Rect.Hgt - 1);
4295  if (iMat >= 0)
4296  {
4297  // Normal material counting
4298  MatCount[iMat] += iMul * (iHgt + 1);
4299  // Minimum height counting?
4300  if (int32_t iMinHgt = ::MaterialMap.Map[iMat].MinHeightCount)
4301  {
4302  int iAddedHeight1 = 0, iAddedHeight2 = 0;
4303  // Add any material above for chunk size check
4304  if (Rect.y && iHgt + 1 == Rect.Hgt)
4305  iAddedHeight1 = d->GetMatHeight(Rect.x + x, Rect.y - 1, -1, iMat, iMinHgt);
4306  // Add any material below for chunk size check
4307  if (Rect.y + y < Height)
4308  iAddedHeight2 = d->GetMatHeight(Rect.x + x, Rect.y + Rect.Hgt, 1, iMat, iMinHgt);
4309  // Chunk tall enough?
4310  if (iHgt + 1 + iAddedHeight1 + iAddedHeight2 >= ::MaterialMap.Map[iMat].MinHeightCount)
4311  {
4312  EffectiveMatCount[iMat] += iMul * (iHgt + 1);
4313  if (iAddedHeight1 < iMinHgt)
4314  EffectiveMatCount[iMat] += iMul * iAddedHeight1;
4315  if (iAddedHeight2 < iMinHgt)
4316  EffectiveMatCount[iMat] += iMul * iAddedHeight2;
4317  }
4318  }
4319  }
4320  }
4321 }
std::array< DWORD, C4MaxMaterial > MatCount
Definition: C4Landscape.cpp:70
int32_t GetMatHeight(int32_t x, int32_t y, int32_t iYDir, int32_t iMat, int32_t iMax) const
C4Material * Map
Definition: C4Material.h:171
Definition: C4Rect.h:29
void Intersect(const C4Rect &r2)
Definition: C4Rect.cpp:100
int32_t Wdt
Definition: C4Rect.h:32
int32_t y
Definition: C4Rect.h:32
int32_t _GetMat(int32_t x, int32_t y) const
std::array< DWORD, C4MaxMaterial > EffectiveMatCount
Definition: C4Landscape.cpp:71
int32_t MinHeightCount
Definition: C4Material.h:132
int32_t x
Definition: C4Rect.h:32
C4MaterialMap MaterialMap
Definition: C4Material.cpp:970
int32_t Hgt
Definition: C4Rect.h:32

Here is the call graph for this function:

void C4Landscape::P::UpdatePixCnt ( const C4Landscape d,
const C4Rect Rect,
bool  fCheck = false 
)

Definition at line 4233 of file C4Landscape.cpp.

References C4Landscape::_GetDensity(), C4Rect::Hgt, iCnt, C4Rect::Wdt, C4Rect::x, C4Rect::y, and CPolyEdge::y.

4234 {
4235  int32_t PixCntWidth = (Width + 16) / 17;
4236  for (int32_t y = std::max<int32_t>(0, Rect.y / 15); y < std::min<int32_t>(PixCntPitch, (Rect.y + Rect.Hgt + 14) / 15); y++)
4237  for (int32_t x = std::max<int32_t>(0, Rect.x / 17); x < std::min<int32_t>(PixCntWidth, (Rect.x + Rect.Wdt + 16) / 17); x++)
4238  {
4239  int iCnt = 0;
4240  for (int32_t x2 = x * 17; x2 < std::min<int32_t>(x * 17 + 17, Width); x2++)
4241  for (int32_t y2 = y * 15; y2 < std::min<int32_t>(y * 15 + 15, Height); y2++)
4242  if (d->_GetDensity(x2, y2))
4243  iCnt++;
4244  if (fCheck)
4245  assert(iCnt == PixCnt[x * PixCntPitch + y]);
4246  PixCnt[x * PixCntPitch + y] = iCnt;
4247  }
4248 }
std::vector< uint8_t > PixCnt
Definition: C4Landscape.cpp:63
int32_t Wdt
Definition: C4Rect.h:32
int32_t y
Definition: C4Rect.h:32
int iCnt
Definition: TstC4NetIO.cpp:35
int32_t PixCntPitch
Definition: C4Landscape.cpp:62
int32_t x
Definition: C4Rect.h:32
int32_t Hgt
Definition: C4Rect.h:32
int32_t _GetDensity(int32_t x, int32_t y) const

Here is the call graph for this function:

Member Data Documentation

int32_t C4Landscape::P::BottomOpen = 0

Definition at line 75 of file C4Landscape.cpp.

std::vector<uint8_t> C4Landscape::P::BottomRowPix

Definition at line 59 of file C4Landscape.cpp.

std::array< std::unique_ptr< uint8_t[]>, C4M_MaxTexIndex > C4Landscape::P::BridgeMatConversion
mutable

Definition at line 65 of file C4Landscape.cpp.

std::array<DWORD, C4MaxMaterial> C4Landscape::P::EffectiveMatCount {}

Definition at line 71 of file C4Landscape.cpp.

bool C4Landscape::P::fMapChanged = false

Definition at line 81 of file C4Landscape.cpp.

C4Real C4Landscape::P::Gravity = DefaultGravAccel

Definition at line 76 of file C4Landscape.cpp.

int32_t C4Landscape::P::Height = 0

Definition at line 68 of file C4Landscape.cpp.

Referenced by ExecuteScan().

int32_t C4Landscape::P::LeftOpen = 0

Definition at line 75 of file C4Landscape.cpp.

std::unique_ptr<CSurface8> C4Landscape::P::Map

Definition at line 56 of file C4Landscape.cpp.

std::unique_ptr<CSurface8> C4Landscape::P::MapBkg

Definition at line 57 of file C4Landscape.cpp.

int32_t C4Landscape::P::MapHeight = 0

Definition at line 69 of file C4Landscape.cpp.

int32_t C4Landscape::P::MapSeed = 0

Definition at line 78 of file C4Landscape.cpp.

int32_t C4Landscape::P::MapWidth = 0

Definition at line 69 of file C4Landscape.cpp.

int32_t C4Landscape::P::MapZoom = 0

Definition at line 69 of file C4Landscape.cpp.

std::array<DWORD, C4MaxMaterial> C4Landscape::P::MatCount

Definition at line 70 of file C4Landscape.cpp.

Referenced by ExecuteScan().

LandscapeMode C4Landscape::P::mode = LandscapeMode::Undefined

Definition at line 67 of file C4Landscape.cpp.

uint32_t C4Landscape::P::Modulation = 0

Definition at line 77 of file C4Landscape.cpp.

bool C4Landscape::P::NoScan = false

Definition at line 73 of file C4Landscape.cpp.

std::unique_ptr<C4FoW> C4Landscape::P::pFoW

Definition at line 84 of file C4Landscape.cpp.

std::unique_ptr<BYTE[]> C4Landscape::P::pInitial

Definition at line 82 of file C4Landscape.cpp.

std::unique_ptr<BYTE[]> C4Landscape::P::pInitialBkg

Definition at line 83 of file C4Landscape.cpp.

int32_t C4Landscape::P::Pix2Dens

Definition at line 60 of file C4Landscape.cpp.

bool C4Landscape::P::Pix2Light

Definition at line 61 of file C4Landscape.cpp.

int32_t C4Landscape::P::Pix2Mat

Definition at line 60 of file C4Landscape.cpp.

int32_t C4Landscape::P::Pix2Place

Definition at line 60 of file C4Landscape.cpp.

std::vector<uint8_t> C4Landscape::P::PixCnt

Definition at line 63 of file C4Landscape.cpp.

int32_t C4Landscape::P::PixCntPitch = 0

Definition at line 62 of file C4Landscape.cpp.

std::unique_ptr<C4LandscapeRender> C4Landscape::P::pLandscapeRender

Definition at line 58 of file C4Landscape.cpp.

std::unique_ptr<C4MapCreatorS2> C4Landscape::P::pMapCreator

Definition at line 80 of file C4Landscape.cpp.

std::array<C4Rect, C4LS_MaxRelights> C4Landscape::P::Relights

Definition at line 64 of file C4Landscape.cpp.

int32_t C4Landscape::P::RightOpen = 0

Definition at line 75 of file C4Landscape.cpp.

int32_t C4Landscape::P::ScanSpeed = 2

Definition at line 74 of file C4Landscape.cpp.

Referenced by ExecuteScan().

int32_t C4Landscape::P::ScanX = 0

Definition at line 74 of file C4Landscape.cpp.

C4Sky C4Landscape::P::Sky

Definition at line 79 of file C4Landscape.cpp.

std::unique_ptr< CSurface8 > C4Landscape::P::Surface8

Definition at line 54 of file C4Landscape.cpp.

std::unique_ptr<CSurface8> C4Landscape::P::Surface8Bkg

Definition at line 55 of file C4Landscape.cpp.

int32_t C4Landscape::P::TopOpen = 0

Definition at line 75 of file C4Landscape.cpp.

std::vector<uint8_t> C4Landscape::P::TopRowPix

Definition at line 59 of file C4Landscape.cpp.

int32_t C4Landscape::P::Width = 0

Definition at line 68 of file C4Landscape.cpp.


The documentation for this struct was generated from the following files: