41 if (!Inside<int32_t>(x,0,
MapWdt-1) || !Inside<int32_t>(y,0,
MapHgt-1))
return;
50 int32_t ycnt,xcnt,lwdt,dpy;
51 for (ycnt=-rad; ycnt<=rad; ycnt++)
53 lwdt= (int32_t) sqrt(
double(rad*rad-ycnt*ycnt)); dpy=y+ycnt;
54 for (xcnt=-lwdt; xcnt<lwdt+(lwdt==0); xcnt++)
62 for (cnt=0; cnt<size; cnt++)
65 for (cnt2=
Random(3); cnt2<5; cnt2++)
73 if (!Inside<int32_t>(x,0,
MapWdt-1) || !Inside<int32_t>(y,0,
MapHgt-1))
return 0;
82 double fullperiod= 20.0 * M_PI;
105 int32_t maxrange= level0*3/4;
106 double cy_curve,cy_natural;
108 double rnd_cy,rnd_tend;
109 rnd_cy= (double) (
Random(2000+1)-1000)/1000.0;
110 rnd_tend= (double) (
Random(200+1)-100)/20000.0;
112 for (cx=0; cx<
MapWdt; cx++)
116 rnd_tend+= (double) (
Random(100+1)-50)/10000;
117 if (rnd_tend>+0.05) rnd_tend=+0.05;
118 if (rnd_tend<-0.05) rnd_tend=-0.05;
119 if (rnd_cy<-0.5) rnd_tend+=0.01;
120 if (rnd_cy>+0.5) rnd_tend-=0.01;
122 cy_natural=rnd_cy*natural/100.0;
123 cy_curve=sin(fullperiod*period/100.0*(
float)cx/(
float)
MapWdt
124 +2.0*M_PI*phase/100.0) * amplitude/100.0;
126 cy=level0+
Clamp((int32_t)((
float)maxrange*(cy_curve+cy_natural)),
127 -maxrange,+maxrange);
134 for (cx=0; cx<
MapWdt; cx++)
141 for (cx=0; cx<
MapWdt; cx++)
150 int32_t cnt,clayer,layer_num,sptx,spty;
160 for (cnt=0; cnt<layer_num; cnt++)
177 for (iY=0; iY<
MapHgt; iY++)
178 for (iX=0; iX<
MapWdt; iX++)
const int32_t C4S_MaxMapPlayerExtend
T Clamp(T bval, T lbound, T rbound)
BYTE GetPix(int32_t x, int32_t y)
void Create(CSurface8 *sfcMap, C4SLandscape &rLScape, C4TextureMap &rTexMap, int32_t iPlayerNum=1)
void SetPix(int32_t x, int32_t y, BYTE col)
void DrawLayer(int32_t x, int32_t y, int32_t size, BYTE col)
void ValidateTextureIndices(C4TextureMap &rTexMap)
void SetSpot(int32_t x, int32_t y, int32_t rad, BYTE col)
char Name[C4MaxNameList][C4MaxName+1]
int32_t Count[C4MaxNameList]
int32_t GetIndexMatTex(const char *szMaterialTexture, const char *szDefaultTexture=nullptr, bool fAddIfNotExist=true, const char *szErrorIfFailed=nullptr)
const C4TexMapEntry * GetEntry(int32_t iIndex) const
void ClearBox8Only(int iX, int iY, int iWdt, int iHgt)
BYTE GetPix(int iX, int iY) const
void SetPix(int iX, int iY, BYTE byCol)