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 748 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.

749 {
750  int32_t mat = d->GetMat(tx, ty);
751  if (MatValid(mat))
752  {
753  // for blast, either shift to different material or blast free
754  if (::MaterialMap.Map[mat].BlastFree)
755  {
756  d->ClearPix(tx, ty);
757  // check for instable materials to start moving by the cleared space
758  d->CheckInstabilityRange(tx, ty);
759  return true;
760  }
761  else
762  if (::MaterialMap.Map[mat].BlastShiftTo)
764  }
765  return false;
766 }
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 652 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.

653 {
654  for (int32_t mat = 0; mat < ::MaterialMap.Num; mat++)
655  {
656  if (mat_list->Amount[mat])
657  {
658  int32_t cast_strength = str;
659  int32_t pxsamount = 0, blastamount = 0;
660 
661  if (::MaterialMap.Map[mat].Blast2PXSRatio != 0)
662  {
663  pxsamount = mat_list->Amount[mat] / ::MaterialMap.Map[mat].Blast2PXSRatio;
664  ::PXS.Cast(mat, pxsamount, tx, ty, cast_strength * 2);
665  }
666 
667  if (::MaterialMap.Map[mat].Blast2Object != C4ID::None)
668  {
669  if (::MaterialMap.Map[mat].Blast2ObjectRatio != 0)
670  {
671  blastamount = mat_list->Amount[mat] / ::MaterialMap.Map[mat].Blast2ObjectRatio;
672  Game.CastObjects(::MaterialMap.Map[mat].Blast2Object, nullptr, blastamount, cast_strength, tx, ty, NO_OWNER, caused_by, out_objects);
673  }
674  }
675 
676  mat_list->Amount[mat] -= std::max(blastamount * ::MaterialMap.Map[mat].Blast2ObjectRatio,
677  pxsamount * ::MaterialMap.Map[mat].Blast2PXSRatio);
678  }
679  }
680 }
void Cast(int32_t mat, int32_t num, int32_t tx, int32_t ty, int32_t level)
Definition: C4PXS.cpp:363
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:532
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 2173 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.

2174 {
2175  const C4TexMapEntry *entry = ::TextureMap.GetEntry(iTexture);
2176  C4Material *pMaterial = entry->GetMaterial();
2177  if (!pMaterial) return;
2178  const char *texture_name = entry->GetTextureName();
2179  C4Texture *texture = ::TextureMap.GetTexture(texture_name);
2180  C4TextureShape *shape = texture ? texture->GetMaterialShape() : nullptr;
2181  // Chunk type by material
2183  // Get map & landscape size
2184  int iMapWidth, iMapHeight;
2185  sfcMap.GetSurfaceSize(iMapWidth, iMapHeight);
2186  // Clip desired map segment to map size
2187  iMapX = Clamp<int32_t>(iMapX, 0, iMapWidth - 1);
2188  iMapY = Clamp<int32_t>(iMapY, 0, iMapHeight - 1);
2189  iMapWdt = Clamp<int32_t>(iMapWdt, 0, iMapWidth - iMapX);
2190  iMapHgt = Clamp<int32_t>(iMapHgt, 0, iMapHeight - iMapY);
2191  // get chunk size
2192  int iChunkWidth = MapZoom, iChunkHeight = MapZoom;
2193  // Scan map lines
2194  for (int iY = iMapY; iY < iMapY + iMapHgt; iY++)
2195  {
2196  // Landscape target coordinate vertical
2197  int iToY = iY * iChunkHeight + iOffY;
2198  // Scan map line
2199  for (int iX = iMapX; iX < iMapX + iMapWdt; iX++)
2200  {
2201  // Map scan line start
2202  uint8_t MapPixel = sfcMap._GetPix(iX, iY);
2203  uint8_t MapPixelBkg = sfcMapBkg._GetPix(iX, iY);
2204  // Landscape target coordinate horizontal
2205  int iToX = iX * iChunkWidth + iOffX;
2206  // Here's a chunk of the texture-material to zoom
2207  if (MapPixel == iTexture)
2208  {
2209  // Draw chunk
2210  DrawChunk(d, iToX, iToY, iChunkWidth, iChunkHeight, MapPixel, MapPixelBkg, iChunkType, (iX << 16) + iY);
2211  }
2212  // Other chunk, check for slope smoothers
2213  else if (iChunkType == C4M_Smooth || iChunkType == C4M_Smoother || iChunkType == C4M_Octagon)
2214  {
2215  // Map scan line pixel below
2216  uint8_t below = sfcMap.GetPix(iX, iY + 1);
2217  uint8_t above = sfcMap.GetPix(iX, iY - 1);
2218  uint8_t left = sfcMap.GetPix(iX - 1, iY);
2219  uint8_t right = sfcMap.GetPix(iX + 1, iY);
2220  uint8_t leftBkg = sfcMapBkg.GetPix(iX - 1, iY);
2221  uint8_t rightBkg = sfcMapBkg.GetPix(iX + 1, iY);
2222  // do not fill a tiny hole
2223  if (below == iTexture && above == iTexture && left == iTexture && right == iTexture)
2224  continue;
2225  int flat = iChunkType == C4M_Octagon ? 4 : 0;
2226  // Smooth chunk & same texture-material below
2227  if (iY < iMapHeight - 1 && below == iTexture)
2228  {
2229  // Same texture-material on left
2230  if (iX > 0 && left == iTexture)
2231  {
2232  // Draw smoother
2233  DrawSmoothOChunk(d, iToX, iToY, iChunkWidth, iChunkHeight, left, leftBkg, 3 + flat, (iX << 16) + iY);
2234  }
2235  // Same texture-material on right
2236  if (iX < iMapWidth - 1 && right == iTexture)
2237  {
2238  // Draw smoother
2239  DrawSmoothOChunk(d, iToX, iToY, iChunkWidth, iChunkHeight, right, rightBkg, 0 + flat, (iX << 16) + iY);
2240  }
2241  }
2242  // Smooth chunk & same texture-material above
2243  if (iY > 0 && above == iTexture)
2244  {
2245  // Same texture-material on left
2246  if (iX > 0 && left == iTexture)
2247  {
2248  // Draw smoother
2249  DrawSmoothOChunk(d, iToX, iToY, iChunkWidth, iChunkHeight, left, leftBkg, 2 + flat, (iX << 16) + iY);
2250  }
2251  // Same texture-material on right
2252  if (iX < iMapWidth - 1 && right == iTexture)
2253  {
2254  // Draw smoother
2255  DrawSmoothOChunk(d, iToX, iToY, iChunkWidth, iChunkHeight, right, rightBkg, 1 + flat, (iX << 16) + iY);
2256  }
2257  }
2258  }
2259  }
2260  }
2261  // Draw custom shapes on top of regular materials
2262  if (shape && !::Game.C4S.Landscape.FlatChunkShapes) shape->Draw(sfcMap, sfcMapBkg, iMapX, iMapY, iMapWdt, iMapHgt, iTexture, iOffX, iOffY, MapZoom, pMaterial->MinShapeOverlap);
2263 }
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:580
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 2103 of file C4Landscape.cpp.

2104 {
2105  if (!iRange) return 0;
2106  iOffset = (iOffset * 16807) % 2147483647;
2107  return (iOffset ^ MapSeed) % iRange;
2108 }
void C4Landscape::P::ClearMatCount ( )

Definition at line 1950 of file C4Landscape.cpp.

1951 {
1952  std::fill(MatCount.begin(), MatCount.end(), 0);
1953  std::fill(EffectiveMatCount.begin(), EffectiveMatCount.end(), 0);
1954 }
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 1112 of file C4Landscape.cpp.

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

1113 {
1114  auto sfcBg = std::make_unique<CSurface8>();
1115  if (!sfcBg->Create(sfcFg.Wdt, sfcFg.Hgt))
1116  {
1117  return nullptr;
1118  }
1119 
1120  for (int32_t y = 0; y < sfcFg.Hgt; ++y)
1121  {
1122  for (int32_t x = 0; x < sfcFg.Wdt; ++x)
1123  {
1124  BYTE fgPix = sfcFg._GetPix(x, y);
1125  BYTE bgPix;
1126 
1127  // If we treat the most significant bit as the IFT flag
1128  // (compatibility option for pre-7.0 maps), then set
1129  // the background pixel to 0 if the foreground does not
1130  // have IFT set, and remove the IFT flag from the
1131  // foreground pixel.
1132  if (msbAsIft)
1133  {
1134  if (fgPix & 0x80)
1135  {
1136  fgPix &= ~0x80;
1137  sfcFg._SetPix(x, y, fgPix);
1138  bgPix = DefaultBkgMat(fgPix);
1139  }
1140  else
1141  {
1142  bgPix = 0;
1143  }
1144  }
1145  else
1146  {
1147  bgPix = DefaultBkgMat(fgPix);
1148  }
1149 
1150  sfcBg->_SetPix(x, y, bgPix);
1151  }
1152  }
1153 
1154  return sfcBg;
1155 }
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 2390 of file C4Landscape.cpp.

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

2391 {
2392  int32_t iWidth = 0, iHeight = 0;
2393 
2394  // Create map surface
2395  Game.C4S.Landscape.GetMapSize(iWidth, iHeight, Game.StartupPlayerCount);
2396  auto fg_map = std::make_unique<CSurface8>(iWidth, iHeight);
2397 
2398  // Fill sfcMap
2399  C4MapCreator MapCreator;
2400  MapCreator.Create(fg_map.get(),
2403 
2404  auto bg_map = CreateDefaultBkgSurface(*fg_map, false);
2405  if (!bg_map)
2406  return false;
2407 
2408  sfcMap = fg_map.release();
2409  sfcMapBkg = bg_map.release();
2410  return true;
2411 }
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:580
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 2413 of file C4Landscape.cpp.

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

2414 {
2415  // file present?
2416  if (!ScenFile.AccessEntry(C4CFN_DynLandscape)) return false;
2417 
2418  // create map creator
2419  if (!pMapCreator)
2420  pMapCreator = std::make_unique<C4MapCreatorS2>(&Game.C4S.Landscape, &::TextureMap, &::MaterialMap, Game.StartupPlayerCount);
2421 
2422  // read file
2423  pMapCreator->ReadFile(C4CFN_DynLandscape, &ScenFile);
2424  // render landscape
2425  if (!pMapCreator->Render(nullptr, sfcMap, sfcMapBkg))
2426  return false;
2427 
2428  // keep map creator until script callbacks have been done
2429  return true;
2430 }
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:580
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 1107 of file C4Landscape.cpp.

References C4TextureMap::DefaultBkgMatTex(), and TextureMap.

1108 {
1110 }
BYTE DefaultBkgMatTex(BYTE fg) const
Definition: C4Texture.cpp:513
C4TextureMap TextureMap
Definition: C4Texture.cpp:580

Here is the call graph for this function:

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

Definition at line 734 of file C4Landscape.cpp.

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

735 {
736  int32_t mat = d->GetMat(tx, ty);
737  if (MatValid(mat))
738  if (::MaterialMap.Map[mat].DigFree)
739  {
740  d->ClearPix(tx, ty);
741  // check for instable materials to start moving by the cleared space
742  d->CheckInstabilityRange(tx, ty);
743  return true;
744  }
745  return false;
746 }
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 722 of file C4Landscape.cpp.

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

723 {
724  int32_t mat = d->GetMat(tx, ty);
725  if (MatValid(mat))
726  if (::MaterialMap.Map[mat].DigFree)
727  {
728  d->ClearPix(tx, ty);
729  return true;
730  }
731  return false;
732 }
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 682 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.

683 {
684  C4AulParSet pars(pCollect);
685  for (int32_t mat = 0; mat < ::MaterialMap.Num; mat++)
686  {
687  if (mat_list->Amount[mat])
688  {
689  if (::MaterialMap.Map[mat].Dig2Object != C4ID::None)
690  if (::MaterialMap.Map[mat].Dig2ObjectRatio != 0)
691  while (mat_list->Amount[mat] >= ::MaterialMap.Map[mat].Dig2ObjectRatio)
692  {
693  mat_list->Amount[mat] -= ::MaterialMap.Map[mat].Dig2ObjectRatio;
694  C4Object *pObj = Game.CreateObject(::MaterialMap.Map[mat].Dig2Object, nullptr, NO_OWNER, tx, ty);
695  if (!pObj || !pObj->Status) continue;
696  // Set controller to the controller of the object responsible for digging out
697  if (pCollect && pCollect->Status)
698  pObj->Controller = pCollect->Controller;
699  // Do callbacks to dug object and digger
700  pObj->Call(PSF_OnDugOut, &pars);
701  if (!pObj->Status || !pCollect || !pCollect->Status || pObj->Contained) continue;
702  C4AulParSet pars(C4VObj(pObj));
703  pCollect->Call(PSF_DigOutObject, &pars);
704  if (!pObj->Status || !pCollect->Status || pObj->Contained) continue;
705  // Try to collect object
706  if (::MaterialMap.Map[mat].Dig2ObjectCollect)
707  if (pCollect && pCollect->Status && pObj && pObj->Status)
708  if (!pCollect->Collect(pObj))
709  // Collection forced? Don't generate objects
710  if (::MaterialMap.Map[mat].Dig2ObjectCollect == 2)
711  {
712  pObj->AssignRemoval();
713  // Cap so we never have more than one object worth of material in the store
714  mat_list->Amount[mat] = ::MaterialMap.Map[mat].Dig2ObjectRatio;
715  break;
716  }
717  }
718  }
719  }
720 }
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:169
bool Collect(C4Object *pObj)
Definition: C4Object.cpp:4182
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 272 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, 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().

273 {
274  int32_t conv_to_tex = 0;
275  int32_t iTemperature = ::Weather.GetTemperature();
276  // Check below conv
277  if (::MaterialMap.Map[mat].BelowTempConvertDir == dir)
279  if (iTemperature< ::MaterialMap.Map[mat].BelowTempConvert)
280  conv_to_tex = ::MaterialMap.Map[mat].BelowTempConvertTo;
281  // Check above conv
282  if (::MaterialMap.Map[mat].AboveTempConvertDir == dir)
284  if (iTemperature>::MaterialMap.Map[mat].AboveTempConvert)
285  conv_to_tex = ::MaterialMap.Map[mat].AboveTempConvertTo;
286  // nothing to do?
287  if (!conv_to_tex) return 0;
288  // find material
289  int32_t conv_to = ::TextureMap.GetEntry(conv_to_tex)->GetMaterialIndex();
290  // find mat top
291  int32_t mconv = ::MaterialMap.Map[mat].TempConvStrength,
292  mconvs = mconv;
293 #ifdef DEBUGREC_MATSCAN
294  if (Config.General.DebugRec)
295  {
296  C4RCMatScan rc = { cx, cy, mat, conv_to, dir, mconvs };
297  AddDbgRec(RCT_MatScanDo, &rc, sizeof(C4RCMatScan));
298  }
299 #endif
300  int32_t ydir = (dir == 0 ? +1 : -1), cy2;
301 #ifdef PRETTY_TEMP_CONV
302  // get left pixel
303  int32_t lmat = (cx > 0 ? d->_GetMat(cx - 1, cy) : -1);
304  // left pixel not converted? do nothing
305  if (lmat == mat) return 0;
306  // left pixel converted? suppose it was done by a prior scan and skip check
307  if (lmat != conv_to)
308  {
309  int32_t iSearchRange = std::max<int32_t>(5, mconvs);
310  // search upper/lower bound
311  int32_t cys = cy, cxs = cx;
312  while (cxs < ::Landscape.GetWidth() - 1)
313  {
314  // one step right
315  cxs++;
316  if (d->_GetMat(cxs, cys) == mat)
317  {
318  // search surface
319  cys -= ydir;
320  while (Inside<int32_t>(cys, 0, ::Landscape.GetHeight() - 1) && d->_GetMat(cxs, cys) == mat)
321  {
322  cys -= ydir;
323  if ((mconvs = std::min(mconv - Abs(cys - cy), mconvs)) < 0)
324  return 0;
325  }
326  // out of bounds?
327  if (!Inside<int32_t>(cys, 0, ::Landscape.GetHeight() - 1)) break;
328  // back one step
329  cys += ydir;
330  }
331  else
332  {
333  // search surface
334  cys += ydir;
335  while (Inside<int32_t>(cys, 0, ::Landscape.GetHeight() - 1) && d->_GetMat(cxs, cys) != mat)
336  {
337  cys += ydir;
338  if (Abs(cys - cy) > iSearchRange)
339  break;
340  }
341  // out of bounds?
342  if (!Inside<int32_t>(cys, 0, ::Landscape.GetHeight() - 1)) break;
343  if (Abs(cys - cy) > iSearchRange) break;
344  }
345  }
346  }
347 #endif
348  // Conversion
349  bool conv_to_is_solid = (conv_to > -1) && DensitySolid(::MaterialMap.Map[conv_to].Density);
350  for (cy2 = cy; mconvs >= 0 && Inside<int32_t>(cy2, 0, ::Landscape.GetHeight() - 1); cy2 += ydir, mconvs--)
351  {
352  // material changed?
353  int32_t pix = d->_GetPix(cx, cy2);
354  if (PixCol2Mat(pix) != mat) break;
355 #ifdef PRETTY_TEMP_CONV
356  // get left pixel
357  int32_t lmat = (cx > 0 ? d->_GetMat(cx - 1, cy2) : -1);
358  // left pixel not converted? break
359  if (lmat == mat) break;
360 #endif
361  // set mat (and keep background material)
362  d->SetPix2(cx, cy2, MatTex2PixCol(conv_to_tex), Transparent);
363  if (!conv_to_is_solid) d->CheckInstabilityRange(cx, cy2);
364  }
365  // return pixel converted
366  return Abs(cy2 - cy);
367 }
BYTE _GetPix(int32_t x, int32_t y) const
C4Config Config
Definition: C4Config.cpp:831
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:580
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 2110 of file C4Landscape.cpp.

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

2111 {
2112  unsigned int top_rough = 0, side_rough = 0, bottom_rough = 0;
2113  // what to do?
2114  switch (Shape)
2115  {
2116  case C4M_Flat: case C4M_Octagon:
2117  if (mcol != Transparent) Surface8->Box(tx, ty, tx + wdt, ty + hgt, mcol);
2118  if (mcolBkg != Transparent) Surface8Bkg->Box(tx, ty, tx + wdt, ty + hgt, mcolBkg);
2119  return;
2120  case C4M_TopFlat:
2121  top_rough = 0; side_rough = 2; bottom_rough = 4;
2122  break;
2123  case C4M_Smooth:
2124  top_rough = 2; side_rough = 2; bottom_rough = 2;
2125  break;
2126  case C4M_Rough:
2127  top_rough = 4; side_rough = 4; bottom_rough = 4;
2128  break;
2129  case C4M_Smoother:
2130  top_rough = 1; side_rough = 1; bottom_rough = 1;
2131  break;
2132  }
2133  int vtcs[16];
2134  unsigned int rx = std::max(wdt / 2, 1);
2135 
2136  vtcs[0] = tx - ChunkyRandom(cro, rx * side_rough / 4); vtcs[1] = ty - ChunkyRandom(cro, rx * top_rough / 4);
2137  vtcs[2] = tx - ChunkyRandom(cro, rx * side_rough / 2); vtcs[3] = ty + hgt / 2;
2138  vtcs[4] = tx - ChunkyRandom(cro, rx * side_rough / 4); vtcs[5] = ty + hgt + ChunkyRandom(cro, rx * bottom_rough / 4);
2139  vtcs[6] = tx + wdt / 2; vtcs[7] = ty + hgt + ChunkyRandom(cro, rx * bottom_rough / 2);
2140  vtcs[8] = tx + wdt + ChunkyRandom(cro, rx * side_rough / 4); vtcs[9] = ty + hgt + ChunkyRandom(cro, rx * bottom_rough / 4);
2141  vtcs[10] = tx + wdt + ChunkyRandom(cro, rx * side_rough / 2); vtcs[11] = ty + hgt / 2;
2142  vtcs[12] = tx + wdt + ChunkyRandom(cro, rx * side_rough / 4); vtcs[13] = ty - ChunkyRandom(cro, rx * top_rough / 4);
2143  vtcs[14] = tx + wdt / 2; vtcs[15] = ty - ChunkyRandom(cro, rx * top_rough / 2);
2144 
2145  ForPolygon(d, vtcs, 8, nullptr, nullptr, mcol, mcolBkg);
2146 }
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 3452 of file C4Landscape.cpp.

3453 {
3454  Surface8->Circle(iX, iY, iGrade, line_color);
3455  Surface8Bkg->Circle(iX, iY, iGrade, line_color_bkg);
3456  return true;
3457 }
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 3459 of file C4Landscape.cpp.

3460 {
3461  if (!Map) return false;
3462  if (iRadius == 1)
3463  {
3464  Map->SetPix(iX, iY, line_color); MapBkg->SetPix(iX, iY, line_color_bkg);
3465  }
3466  else
3467  {
3468  Map->Circle(iX, iY, iRadius, line_color); MapBkg->Circle(iX, iY, iRadius, line_color_bkg);
3469  }
3470  return true;
3471 }
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 2148 of file C4Landscape.cpp.

2149 {
2150  int vtcs[8];
2151  unsigned int rx = std::max(wdt / 2, 1);
2152 
2153  vtcs[0] = tx; vtcs[1] = ty;
2154  vtcs[2] = tx; vtcs[3] = ty + hgt;
2155  vtcs[4] = tx + wdt; vtcs[5] = ty + hgt;
2156  vtcs[6] = tx + wdt; vtcs[7] = ty;
2157 
2158  switch (flip)
2159  {
2160  case 0: vtcs[0] = tx + wdt / 2; vtcs[1] += hgt / 3; vtcs[7] -= ChunkyRandom(cro, rx / 2); break;
2161  case 1: vtcs[2] = tx + wdt / 2; vtcs[3] -= hgt / 3; vtcs[5] += ChunkyRandom(cro, rx / 2); break;
2162  case 2: vtcs[4] = tx + wdt / 2; vtcs[5] -= hgt / 3; vtcs[3] += ChunkyRandom(cro, rx / 2); break;
2163  case 3: vtcs[6] = tx + wdt / 2; vtcs[7] += hgt / 3; vtcs[1] -= ChunkyRandom(cro, rx / 2); break;
2164  case 4: vtcs[0] = tx + wdt / 2; vtcs[1] += hgt / 2; break;
2165  case 5: vtcs[2] = tx + wdt / 2; vtcs[3] -= hgt / 2; break;
2166  case 6: vtcs[4] = tx + wdt / 2; vtcs[5] -= hgt / 2; break;
2167  case 7: vtcs[6] = tx + wdt / 2; vtcs[7] += hgt / 2; break;
2168  }
2169 
2170  ForPolygon(d, vtcs, 4, nullptr, nullptr, mcol, mcolBkg);
2171 }
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, 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 
235 #ifdef DEBUGREC_MATSCAN
236  if (Config.General.DebugRec)
237  AddDbgRec(RCT_MatScan, &ScanX, sizeof(ScanX));
238 #endif
239 
240  for (int32_t cnt = 0; cnt < ScanSpeed; cnt++)
241  {
242 
243  // Scan landscape column: sectors down
244  int32_t last_mat = -1;
245  for (cy = 0; cy < Height; cy++)
246  {
247  mat = d->_GetMat(ScanX, cy);
248  // material change?
249  if (last_mat != mat)
250  {
251  // upwards
252  if (last_mat != -1)
253  DoScan(d, ScanX, cy - 1, last_mat, 1);
254  // downwards
255  if (mat != -1)
256  cy += DoScan(d, ScanX, cy, mat, 0);
257  }
258  last_mat = mat;
259  }
260 
261  // Scan advance & rewind
262  ScanX++;
263  if (ScanX >= Width)
264  ScanX = 0;
265 
266  }
267 
268 }
std::array< DWORD, C4MaxMaterial > MatCount
Definition: C4Landscape.cpp:70
int32_t DoScan(C4Landscape *, int32_t x, int32_t y, int32_t mat, int32_t dir)
C4Config Config
Definition: C4Config.cpp:831
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 3906 of file C4Landscape.cpp.

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

3907 {
3908  // Intersect bounding box with landscape
3909  BoundingBox.Intersect(C4Rect(0, 0, Width, Height));
3910  if (!BoundingBox.Wdt || !BoundingBox.Hgt) return;
3911  // update render
3912  if (pLandscapeRender)
3913  pLandscapeRender->Update(BoundingBox, d);
3914  UpdateMatCnt(d, BoundingBox, true);
3915  // Restore Solidmasks
3916  C4Rect SolidMaskRect = BoundingBox;
3917  if (pLandscapeRender)
3918  SolidMaskRect = pLandscapeRender->GetAffectedRect(pLandscapeRender->GetAffectedRect(SolidMaskRect));
3919  for (C4SolidMask * pSolid = C4SolidMask::First; pSolid; pSolid = pSolid->Next)
3920  {
3921  pSolid->Repair(SolidMaskRect);
3922  }
3924  UpdatePixCnt(d, BoundingBox);
3925  // update FoW
3926  if (pFoW)
3927  {
3928  pFoW->Invalidate(BoundingBox);
3929  pFoW->Ambient.UpdateFromLandscape(*d, BoundingBox);
3930  }
3931 }
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 bool CheckConsistency()
Definition: C4SolidMask.h:88
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 1227 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.

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

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

3844 {
3845  // safety
3846  int32_t for_material = d->GetPixMat(for_material_col);
3847  if (for_material < 0 || for_material >= MaterialMap.Num) return nullptr;
3848  // query map. create if not done yet
3849  if (!BridgeMatConversion[for_material_col])
3850  {
3851  auto conv_map = std::make_unique<uint8_t[]>(C4M_MaxTexIndex);
3852  for (int32_t i = 0; i < C4M_MaxTexIndex; ++i)
3853  {
3854  if ((MatDensity(for_material) >= d->GetPixDensity(i)))
3855  {
3856  // bridge pixel OK here. change pixel.
3857  conv_map[i] = for_material_col;
3858  }
3859  else
3860  {
3861  // bridge pixel not OK - keep current pixel
3862  conv_map[i] = i;
3863  }
3864  }
3865  BridgeMatConversion[for_material_col] = std::move(conv_map);
3866  }
3867  return BridgeMatConversion[for_material_col].get();
3868 }
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 3384 of file C4Landscape.cpp.

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

3385 {
3386  // Sky
3387  if (SEqual(szMaterial, C4TLS_MatSky))
3388  rbyCol = 0;
3389  // Material-Texture
3390  else
3391  {
3392  rbyCol = ::TextureMap.GetIndex(szMaterial, szTexture);
3393  if (!rbyCol) return false;
3394  }
3395  // Found
3396  return true;
3397 }
C4TextureMap TextureMap
Definition: C4Texture.cpp:580
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 2043 of file C4Landscape.cpp.

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

2044 {
2045  assert(Width > 0);
2046  // Init Top-/BottomRowPix array, which determines if out-of-landscape pixels on top/bottom side of the map are solid or not
2047  // In case of Top-/BottomOpen=2, unit by map and not landscape to avoid runtime join sync losses
2048  if (!Width) return true;
2049  TopRowPix.clear();
2050  BottomRowPix.clear();
2051  // must access Game.C4S here because Landscape.TopOpen / Landscape.BottomOpen may not be initialized yet
2052  // why is there a local copy of that static variable anyway?
2053  int32_t top_open_flag = Game.C4S.Landscape.TopOpen;
2054  int32_t bottom_open_flag = Game.C4S.Landscape.BottomOpen;
2055  if (top_open_flag == 2 && !Map) top_open_flag = 1;
2056  if (bottom_open_flag == 2 && !Map) bottom_open_flag = 1;
2057 
2058  // Init TopRowPix
2059  switch (top_open_flag)
2060  {
2061  // TopOpen=0: Top is closed
2062  case 0: TopRowPix.assign(Width, MCVehic); break;
2063  // TopOpen=2: Top is open when pixel below has sky background
2064  case 2:
2065  TopRowPix.resize(Width);
2066  for (int32_t x = 0; x < Width; ++x)
2067  {
2068  uint8_t map_pix = MapBkg->GetPix(x / MapZoom, 0);
2069  TopRowPix[x] = ((map_pix != 0) ? MCVehic : 0);
2070  }
2071  break;
2072  // TopOpen=1: Top is open
2073  default: TopRowPix.assign(Width, 0); break;
2074  }
2075 
2076  // Init BottomRowPix
2077  switch (bottom_open_flag)
2078  {
2079  // BottomOpen=0: Bottom is closed
2080  case 0: BottomRowPix.assign(Width, MCVehic); break;
2081  // BottomOpen=2: Bottom is open when pixel above has sky background
2082  case 2:
2083  BottomRowPix.resize(Width);
2084  for (int32_t x = 0; x < Width; ++x)
2085  {
2086  uint8_t map_pix = MapBkg->GetPix(x / MapZoom, Map->Hgt - 1);
2087  BottomRowPix[x] = ((map_pix != 0) ? MCVehic : 0);
2088  }
2089  break;
2090  // BottomOpen=1: Bottom is open
2091  default: BottomRowPix.assign(Width, 0); break;
2092  }
2093  return true;
2094 }
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 2355 of file C4Landscape.cpp.

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

2356 {
2357  assert(Surface8 && Surface8Bkg);
2358  // Clip to map/landscape segment
2359  int iMapWidth, iMapHeight, iLandscapeWidth, iLandscapeHeight;
2360  // Get map & landscape size
2361  sfcMap.GetSurfaceSize(iMapWidth, iMapHeight);
2362  Surface8->GetSurfaceSize(iLandscapeWidth, iLandscapeHeight);
2363  // Clip map segment to map size
2364  iMapX = Clamp<int32_t>(iMapX, 0, iMapWidth - 1); iMapY = Clamp<int32_t>(iMapY, 0, iMapHeight - 1);
2365  iMapWdt = Clamp<int32_t>(iMapWdt, 0, iMapWidth - iMapX); iMapHgt = Clamp<int32_t>(iMapHgt, 0, iMapHeight - iMapY);
2366  // No segment
2367  if (!iMapWdt || !iMapHgt) return true;
2368 
2369  // Get affected landscape rect
2370  C4Rect To;
2371  To.x = iMapX*MapZoom + iOffsX;
2372  To.y = iMapY*MapZoom + iOffsY;
2373  To.Wdt = iMapWdt*MapZoom;
2374  To.Hgt = iMapHgt*MapZoom;
2375 
2376  PrepareChange(d, To);
2377 
2378  // clear the old landscape if not supressed
2379  if (!noClear)
2380  {
2381  Surface8->ClearBox8Only(To.x, To.y, To.Wdt, To.Hgt);
2382  Surface8Bkg->ClearBox8Only(To.x, To.y, To.Wdt, To.Hgt);
2383  }
2384 
2385  MapToSurface(d, sfcMap, sfcMapBkg, iMapX, iMapY, iMapWdt, iMapHgt, To.x, To.y, To.Wdt, To.Hgt, iOffsX, iOffsY);
2386  FinishChange(d, To);
2387  return true;
2388 }
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 2327 of file C4Landscape.cpp.

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

2328 {
2329 
2330  // assign clipper
2331  Surface8->Clip(iToX, iToY, iToX + iToWdt - 1, iToY + iToHgt - 1);
2332  Surface8Bkg->Clip(iToX, iToY, iToX + iToWdt - 1, iToY + iToHgt - 1);
2334 
2335  // Enlarge map segment for chunky rim
2336  iMapX -= 2 + MaterialMap.max_shape_width / MapZoom;
2337  iMapY -= 2 + MaterialMap.max_shape_height / MapZoom;
2338  iMapWdt += 4 + MaterialMap.max_shape_width / MapZoom * 2;
2339  iMapHgt += 4 + MaterialMap.max_shape_height / MapZoom * 2;
2340 
2341  // Determine texture usage in map segment
2342  DWORD dwTexUsage[C4M_MaxTexIndex];
2343  if (!GetTexUsage(sfcMap, sfcMapBkg, iMapX, iMapY, iMapWdt, iMapHgt, dwTexUsage)) return false;
2344  // Texture zoom map to landscape
2345  if (!TexOZoom(d, sfcMap, sfcMapBkg, iMapX, iMapY, iMapWdt, iMapHgt, dwTexUsage, iOffX, iOffY)) return false;
2346 
2347  // remove clipper
2348  Surface8->NoClip();
2349  Surface8Bkg->NoClip();
2350 
2351  // success
2352  return true;
2353 }
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 4217 of file C4Landscape.cpp.

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

4218 {
4219  if (!Surface8 || !Surface8Bkg) return false;
4220  // set landscape pal
4221  int32_t tex;
4222  for (tex = 0; tex < C4M_MaxTexIndex; tex++)
4223  {
4224  const C4TexMapEntry *pTex = ::TextureMap.GetEntry(tex);
4225  if (!pTex || pTex->isNull())
4226  continue;
4227  // colors
4228  DWORD dwPix = pTex->GetPattern().PatternClr(0, 0);
4229  Surface8->pPal->Colors[MatTex2PixCol(tex)] = dwPix;
4230  Surface8Bkg->pPal->Colors[MatTex2PixCol(tex)] = dwPix;
4231  }
4232  // success
4233  return true;
4234 }
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:580
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 541 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.

542 {
543  // Do callbacks to digger and dug out objects for objects that are now dug free
544  if (by_object)
545  {
546  for (int32_t i = 0; i < dig_objects->GetSize(); ++i)
547  {
548  C4Object *dig_object = dig_objects->GetItem(i).getObj();
549  if (dig_object && !GBackSolid(dig_object->GetX(), dig_object->GetY()))
550  if (dig_object != by_object)
551  if (!dig_object->Contained && dig_object->Status)
552  {
553  C4AulParSet pars(by_object);
554  dig_object->Call(PSF_OnDugOut, &pars);
555  if (dig_object->Status && by_object->Status)
556  {
557  C4AulParSet pars(dig_object);
558  by_object->Call(PSF_DigOutObject, &pars);
559  }
560  }
561  }
562  }
563 }
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:169
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 3893 of file C4Landscape.cpp.

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

3894 {
3895  // move solidmasks out of the way
3896  C4Rect SolidMaskRect = BoundingBox;
3897  if (pLandscapeRender)
3898  SolidMaskRect = pLandscapeRender->GetAffectedRect(pLandscapeRender->GetAffectedRect(SolidMaskRect));
3899  for (C4SolidMask * pSolid = C4SolidMask::Last; pSolid; pSolid = pSolid->Prev)
3900  {
3901  pSolid->RemoveTemporary(SolidMaskRect);
3902  }
3903  UpdateMatCnt(d, BoundingBox, false);
3904 }
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 530 of file C4Landscape.cpp.

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

531 {
532  // Remember any in-earth objects in area
533  C4FindObjectInRect fo_inrect(BoundingBox);
534  C4FindObjectOCF fo_insolid(OCF_InSolid);
535  C4FindObjectLayer fo_layer(by_object ? by_object->Layer : nullptr);
536  C4FindObject *fo_list[] = { &fo_inrect, &fo_insolid, &fo_layer };
537  C4FindObjectAndStatic fo_srch(3, fo_list);
538  return fo_srch.FindMany(::Objects, ::Objects.Sectors);
539 }
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 1762 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().

1763 {
1764  assert(pInitial && pInitialBkg);
1765  if (!pInitial || !pInitialBkg) return false;
1766 
1767  // If it shouldn't be sync-save: Clear all bytes that have not changed, i.e.
1768  // set them to C4M_MaxTexIndex
1769  bool fChanged = false, fChangedBkg = false;;
1770  if (!fSyncSave)
1771  for (int y = 0; y < Height; y++)
1772  for (int x = 0; x < Width; x++)
1773  {
1774  if (pInitial[y * Width + x] == Surface8->_GetPix(x, y))
1775  Surface8->SetPix(x, y, C4M_MaxTexIndex);
1776  else
1777  fChanged = true;
1778 
1779  if (pInitialBkg[y * Width + x] == Surface8Bkg->_GetPix(x, y))
1780  Surface8Bkg->SetPix(x, y, C4M_MaxTexIndex);
1781  else
1782  fChangedBkg = true;
1783  }
1784 
1785  if (fSyncSave || fChanged)
1786  {
1787  // Save landscape surface
1789  return false;
1790 
1791  // Move temp file to group
1794  return false;
1795  }
1796 
1797  if (fSyncSave || fChangedBkg)
1798  {
1799  // Save landscape surface
1801  return false;
1802 
1803  // Move temp file to group
1806  return false;
1807  }
1808 
1809  // Restore landscape pixels
1810  if (!fSyncSave)
1811  for (int y = 0; y < Height; y++)
1812  for (int x = 0; x < Width; x++)
1813  {
1814  if (Surface8->_GetPix(x, y) == C4M_MaxTexIndex)
1815  Surface8->SetPix(x, y, pInitial[y * Width + x]);
1816  if (Surface8Bkg->_GetPix(x, y) == C4M_MaxTexIndex)
1817  Surface8Bkg->SetPix(x, y, pInitialBkg[y * Width + x]);
1818  }
1819 
1820  // Save changed map, too
1821  if (fMapChanged && Map)
1822  if (!d->SaveMap(hGroup)) return false;
1823 
1824  // and textures (if changed)
1825  if (!d->SaveTextures(hGroup)) return false;
1826 
1827  return true;
1828 }
#define C4CFN_DiffLandscapeBkg
Definition: C4Components.h:64
C4Config Config
Definition: C4Config.cpp:831
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:538
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 1721 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().

1722 {
1723  // Save landscape surface
1724  char szTempLandscape[_MAX_PATH + 1];
1725  SCopy(Config.AtTempPath(C4CFN_TempLandscape), szTempLandscape);
1726  MakeTempFilename(szTempLandscape);
1727  if (!Surface8->Save(szTempLandscape))
1728  return false;
1729 
1730  // Move temp file to group
1731  if (!hGroup.Move(szTempLandscape, C4CFN_LandscapeFg))
1732  return false;
1733 
1734  // Same for background surface
1735  SCopy(Config.AtTempPath(C4CFN_TempLandscapeBkg), szTempLandscape);
1736  MakeTempFilename(szTempLandscape);
1737  if (!Surface8Bkg->Save(szTempLandscape))
1738  return false;
1739  if (!hGroup.Move(szTempLandscape, C4CFN_LandscapeBg))
1740  return false;
1741 
1742  // Save map
1743  if (fMapChanged && Map)
1744  if (!d->SaveMap(hGroup))
1745  return false;
1746 
1747  // save textures (if changed)
1748  if (!d->SaveTextures(hGroup))
1749  return false;
1750 
1751  return true;
1752 }
C4Config Config
Definition: C4Config.cpp:831
void SCopy(const char *szSource, char *sTarget, size_t iMaxL)
Definition: Standard.cpp:122
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:538
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 768 of file C4Landscape.cpp.

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

769 {
770  int32_t mat = d->GetMat(tx, ty);
771  if (MatValid(mat))
772  {
773  if (::MaterialMap.Map[mat].DigFree)
774  {
775  d->ClearPix(tx, ty);
776  ::PXS.Create(mat, itofix(tx), itofix(ty));
777  // check for instable materials to start moving by the cleared space
778  d->CheckInstabilityRange(tx, ty);
779  return true;
780  }
781  }
782  return false;
783 }
C4Material * Map
Definition: C4Material.h:171
bool Create(int32_t mat, C4Real ix, C4Real iy, C4Real ixdir=Fix0, C4Real iydir=Fix0)
Definition: C4PXS.cpp:212
void CheckInstabilityRange(int32_t tx, int32_t ty)
C4Fixed itofix(int32_t x)
Definition: C4Real.h:261
C4PXSSystem PXS
Definition: C4PXS.cpp:532
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 2311 of file C4Landscape.cpp.

References C4TextureMap::Order, and TextureMap.

2312 {
2313  // ChunkOZoom all used textures
2314  for (auto iIndex : ::TextureMap.Order)
2315  {
2316  if (dwpTextureUsage[iIndex] > 0)
2317  {
2318  // ChunkOZoom map to landscape
2319  ChunkOZoom(d, sfcMap, sfcMapBkg, iMapX, iMapY, iMapWdt, iMapHgt, iIndex, iToX, iToY);
2320  }
2321  }
2322 
2323  // Done
2324  return true;
2325 }
C4TextureMap TextureMap
Definition: C4Texture.cpp:580
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 4254 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.

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

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

4238 {
4239  int32_t PixCntWidth = (Width + 16) / 17;
4240  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++)
4241  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++)
4242  {
4243  int iCnt = 0;
4244  for (int32_t x2 = x * 17; x2 < std::min<int32_t>(x * 17 + 17, Width); x2++)
4245  for (int32_t y2 = y * 15; y2 < std::min<int32_t>(y * 15 + 15, Height); y2++)
4246  if (d->_GetDensity(x2, y2))
4247  iCnt++;
4248  if (fCheck)
4249  assert(iCnt == PixCnt[x * PixCntPitch + y]);
4250  PixCnt[x * PixCntPitch + y] = iCnt;
4251  }
4252 }
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: