OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4Shape Class Reference

#include <C4Shape.h>

Inheritance diagram for C4Shape:
[legend]
Collaboration diagram for C4Shape:
[legend]

Public Member Functions

void Default ()
 
void Rotate (C4Real Angle, bool bUpdateVertices)
 
void Stretch (int32_t iCon, bool bUpdateVertices)
 
void Jolt (int32_t iCon, bool bUpdateVertices)
 
void GetVertexOutline (C4Rect &rRect)
 
int32_t GetVertexY (int32_t iVertex)
 
int32_t GetVertexX (int32_t iVertex)
 
int32_t GetX () const
 
int32_t GetY () const
 
bool AddVertex (int32_t iX, int32_t iY)
 
bool CheckContact (int32_t cx, int32_t cy)
 
bool ContactCheck (int32_t cx, int32_t cy, uint32_t *border_hack_contacts=nullptr, bool collide_halfvehic=false)
 
bool Attach (int32_t &cx, int32_t &cy, BYTE cnat_pos)
 
bool LineConnect (int32_t tx, int32_t ty, int32_t cvtx, int32_t ld, int32_t oldx, int32_t oldy)
 
bool InsertVertex (int32_t iPos, int32_t tx, int32_t ty)
 
bool RemoveVertex (int32_t iPos)
 
void CopyFrom (C4Shape rFrom, bool bCpyVertices, bool fCopyVerticesFromSelf)
 
int32_t GetBottomVertex ()
 
int GetBottom ()
 
int32_t GetVertexContact (int32_t iVtx, DWORD dwCheckMask, int32_t tx, int32_t ty, const C4DensityProvider &rDensityProvider=DefaultDensityProvider)
 
bool CheckScaleToWalk (int x, int y)
 
void CreateOwnOriginalCopy (C4Shape &rFrom)
 
void CompileFunc (StdCompiler *pComp, const C4Shape *default_shape)
 
void Set (int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt)
 
bool Overlap (C4Rect &rTarget)
 
void Intersect (const C4Rect &r2)
 
void Add (const C4Rect &r2)
 
bool operator== (const C4Rect &r2) const
 
bool operator!= (const C4Rect &r2) const
 
bool Contains (int32_t iX, int32_t iY) const
 
bool Contains (int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt) const
 
bool Contains (const C4Rect &rect) const
 
bool IntersectsLine (int32_t iX, int32_t iY, int32_t iX2, int32_t iY2)
 
void Normalize ()
 
void Enlarge (int32_t iByX, int32_t iByY)
 
void Enlarge (int32_t iBy)
 
int32_t GetMiddleX () const
 
int32_t GetMiddleY () const
 
int32_t GetBottom () const
 
int32_t GetTop () const
 
int32_t GetLeft () const
 
int32_t GetRight () const
 
void CompileFunc (StdCompiler *pComp)
 

Public Attributes

int32_t FireTop = 0
 
int32_t VtxNum = 0
 
int32_t VtxX [C4D_MaxVertex] = { 0 }
 
int32_t VtxY [C4D_MaxVertex] = { 0 }
 
int32_t VtxCNAT [C4D_MaxVertex] = { 0 }
 
int32_t VtxFriction [C4D_MaxVertex] = { 0 }
 
int32_t ContactDensity = C4M_Solid
 
int32_t ContactCNAT = 0
 
int32_t ContactCount = 0
 
int32_t AttachMat = MNone
 
int32_t VtxContactCNAT [C4D_MaxVertex] = { 0 }
 
int32_t VtxContactMat [C4D_MaxVertex] = { 0 }
 
int32_t iAttachX = 0
 
int32_t iAttachY = 0
 
int32_t iAttachVtx = 0
 
int32_t x = 0
 
int32_t y = 0
 
int32_t Wdt = 0
 
int32_t Hgt = 0
 

Detailed Description

Definition at line 38 of file C4Shape.h.

Member Function Documentation

void C4Rect::Add ( const C4Rect r2)
inherited

Definition at line 144 of file C4Rect.cpp.

References C4Rect::Hgt, C4Rect::Wdt, C4Rect::x, and C4Rect::y.

Referenced by C4FindObjectOnLine::C4FindObjectOnLine(), C4FindObjectOr::C4FindObjectOr(), and C4Landscape::DrawLine().

145 {
146  // Null? Don't do anything
147  if (!r2.Wdt || !r2.Hgt) return;
148  if (!Wdt || !Hgt)
149  {
150  *this = r2;
151  return;
152  }
153  // Expand bounds
154  if (r2.x < x)
155  if (r2.x + r2.Wdt > x + Wdt)
156  { x = r2.x; Wdt = r2.Wdt; }
157  else
158  { Wdt += (x - r2.x); x = r2.x; }
159  else if (r2.x + r2.Wdt > x + Wdt)
160  Wdt = r2.x + r2.Wdt - x;
161  if (r2.y < y)
162  if (r2.y + r2.Hgt > y + Hgt)
163  { y = r2.y; Hgt = r2.Hgt; }
164  else
165  { Hgt += (y - r2.y); y = r2.y; }
166  else if (r2.y + r2.Hgt > y + Hgt)
167  Hgt = r2.y + r2.Hgt - y;
168 }
int32_t Wdt
Definition: C4Rect.h:30
int32_t y
Definition: C4Rect.h:30
int32_t x
Definition: C4Rect.h:30
int32_t Hgt
Definition: C4Rect.h:30

Here is the caller graph for this function:

bool C4Shape::AddVertex ( int32_t  iX,
int32_t  iY 
)

Definition at line 28 of file C4Shape.cpp.

References C4D_MaxVertex, VtxNum, VtxX, and VtxY.

29 {
30  if (VtxNum>=C4D_MaxVertex) return false;
31  VtxX[VtxNum]=iX; VtxY[VtxNum]=iY;
32  VtxNum++;
33  return true;
34 }
int32_t VtxNum
Definition: C4Shape.h:43
int32_t VtxX[C4D_MaxVertex]
Definition: C4Shape.h:44
const int C4D_MaxVertex
Definition: C4Constants.h:55
int32_t VtxY[C4D_MaxVertex]
Definition: C4Shape.h:45
bool C4Shape::Attach ( int32_t &  cx,
int32_t &  cy,
BYTE  cnat_pos 
)

Definition at line 185 of file C4Shape.cpp.

References Abs(), AttachMat, AttachRange, CNAT_Bottom, CNAT_Flags, CNAT_Left, CNAT_Right, CNAT_Top, GBackMat(), iAttachVtx, iAttachX, iAttachY, MNone, VtxCNAT, VtxNum, VtxX, and VtxY.

Referenced by C4Object::DoMovement(), and C4Object::ExecAction().

186 {
187  // reset attached material
189  int xcd = 0;
190  int ycd = 0;
191  // determine attachment direction
192  switch (cnat_pos & (~CNAT_Flags))
193  {
194  case CNAT_Top: ycd=-1; break;
195  case CNAT_Bottom: ycd=+1; break;
196  case CNAT_Left: xcd=-1; break;
197  case CNAT_Right: xcd=+1; break;
198  default: return false;
199  }
200  int testx = cx;
201  int testy = cy;
202  bool increase_distance = true;
203  bool any_contact = false;
204  // Find the nearest position that has at least one vertex adjacent to dense material
205  // and no vertices in dense materials
206  while (Abs(testx - cx) < AttachRange && Abs(testy - cy) < AttachRange)
207  {
208  bool found = false;
209  for (int i = 0; i < VtxNum; ++i)
210  {
211  if (VtxCNAT[i] & cnat_pos)
212  {
213  // get new vertex pos
214  int32_t ax = testx + VtxX[i], ay = testy + VtxY[i];
215  if (CheckTouchableMaterial(ax, ay, i))
216  {
217  found = false;
218  break;
219  }
220  // can attach here?
221  if (CheckTouchableMaterial(ax + xcd, ay + ycd, i, ycd))
222  {
223  found = true;
224  any_contact = true;
225  // store attachment material
226  AttachMat = GBackMat(ax + xcd, ay + ycd);
227  // store absolute attachment position
228  iAttachX = ax + xcd; iAttachY = ay + ycd;
229  iAttachVtx = i;
230  }
231 
232  }
233  }
234  if (found)
235  {
236  cx = testx;
237  cy = testy;
238  return true;
239  }
240  // Try positions in order of distance from the origin,
241  // and alternating the direction
242  testx = cx - (testx - cx);
243  testy = cy - (testy - cy);
244  if (increase_distance)
245  {
246  testx += xcd;
247  testy += ycd;
248  }
249  increase_distance = !increase_distance;
250  }
251  return any_contact;
252 }
int32_t AttachMat
Definition: C4Shape.h:51
int32_t iAttachY
Definition: C4Shape.h:54
const BYTE CNAT_Flags
Definition: C4Constants.h:120
const int32_t MNone
Definition: C4Constants.h:178
int32_t iAttachX
Definition: C4Shape.h:54
int32_t VtxNum
Definition: C4Shape.h:43
int32_t VtxX[C4D_MaxVertex]
Definition: C4Shape.h:44
int32_t iAttachVtx
Definition: C4Shape.h:54
const BYTE CNAT_Top
Definition: C4Constants.h:112
const BYTE CNAT_Right
Definition: C4Constants.h:111
T Abs(T val)
Definition: Standard.h:42
const int AttachRange
Definition: C4Physics.h:24
const BYTE CNAT_Left
Definition: C4Constants.h:110
const BYTE CNAT_Bottom
Definition: C4Constants.h:113
int32_t GBackMat(int32_t x, int32_t y)
Definition: C4Landscape.h:221
int32_t VtxCNAT[C4D_MaxVertex]
Definition: C4Shape.h:46
int32_t VtxY[C4D_MaxVertex]
Definition: C4Shape.h:45

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4Shape::CheckContact ( int32_t  cx,
int32_t  cy 
)

Definition at line 337 of file C4Shape.cpp.

References CNAT_NoCollision, VtxCNAT, VtxNum, VtxX, and VtxY.

Referenced by DoBridge().

338 {
339  // Check all vertices at given object position.
340  // Return true on any contact.
341 
342 
343  for (int32_t cvtx=0; cvtx<VtxNum; cvtx++)
344  if (!(VtxCNAT[cvtx] & CNAT_NoCollision))
345  if (CheckTouchableMaterial(cx+VtxX[cvtx],cy+VtxY[cvtx], cvtx))
346  return true;
347 
348 
349  return false;
350 }
const BYTE CNAT_NoCollision
Definition: C4Constants.h:117
int32_t VtxNum
Definition: C4Shape.h:43
int32_t VtxX[C4D_MaxVertex]
Definition: C4Shape.h:44
int32_t VtxCNAT[C4D_MaxVertex]
Definition: C4Shape.h:46
int32_t VtxY[C4D_MaxVertex]
Definition: C4Shape.h:45

Here is the caller graph for this function:

bool C4Shape::CheckScaleToWalk ( int  x,
int  y 
)

Definition at line 400 of file C4Shape.cpp.

References CNAT_Bottom, CNAT_NoCollision, VtxCNAT, VtxNum, VtxX, and VtxY.

Referenced by C4Object::ExecAction().

401 {
402  for (int32_t i = 0; i < VtxNum; i++)
403  {
404  if (VtxCNAT[i] & CNAT_NoCollision)
405  continue;
406  if (VtxCNAT[i] & CNAT_Bottom)
407  {
408  // no ground under the feet?
409  if (CheckTouchableMaterial(x + VtxX[i], y + VtxY[i] + 1, i))
410  return false;
411  }
412  else
413  {
414  // can climb with hands?
415  if (CheckTouchableMaterial(x + VtxX[i] - 1, y + VtxY[i], i))
416  return false;
417  if (CheckTouchableMaterial(x + VtxX[i] + 1, y + VtxY[i], i))
418  return false;
419  }
420  }
421  return true;
422 }
const BYTE CNAT_NoCollision
Definition: C4Constants.h:117
int32_t y
Definition: C4Rect.h:30
int32_t VtxNum
Definition: C4Shape.h:43
int32_t VtxX[C4D_MaxVertex]
Definition: C4Shape.h:44
int32_t x
Definition: C4Rect.h:30
const BYTE CNAT_Bottom
Definition: C4Constants.h:113
int32_t VtxCNAT[C4D_MaxVertex]
Definition: C4Shape.h:46
int32_t VtxY[C4D_MaxVertex]
Definition: C4Shape.h:45

Here is the caller graph for this function:

void C4Rect::CompileFunc ( StdCompiler pComp)
inherited

Definition at line 31 of file C4Rect.cpp.

References C4Rect::Hgt, mkDefaultAdapt(), StdCompiler::Separator(), StdCompiler::Value(), C4Rect::Wdt, C4Rect::x, and C4Rect::y.

Referenced by C4TargetRect::CompileFunc().

32 {
33  pComp->Value(mkDefaultAdapt(x, 0)); pComp->Separator();
34  pComp->Value(mkDefaultAdapt(y, 0)); pComp->Separator();
35  pComp->Value(mkDefaultAdapt(Wdt, 0)); pComp->Separator();
36  pComp->Value(mkDefaultAdapt(Hgt, 0));
37 }
virtual bool Separator(Sep eSep=SEP_SEP)
Definition: StdCompiler.h:119
int32_t Wdt
Definition: C4Rect.h:30
int32_t y
Definition: C4Rect.h:30
void Value(const T &rStruct)
Definition: StdCompiler.h:161
int32_t x
Definition: C4Rect.h:30
int32_t Hgt
Definition: C4Rect.h:30
StdDefaultAdapt< T, D > mkDefaultAdapt(T &&rValue, const D &rDefault)
Definition: StdAdaptors.h:64

Here is the call graph for this function:

Here is the caller graph for this function:

void C4Shape::CompileFunc ( StdCompiler pComp,
const C4Shape default_shape 
)

Definition at line 523 of file C4Shape.cpp.

References CNAT_Bottom, CNAT_Center, CNAT_Left, CNAT_MultiAttach, CNAT_NoCollision, CNAT_None, CNAT_PhaseHalfVehicle, CNAT_Right, CNAT_Top, ContactDensity, FireTop, C4Rect::Hgt, iAttachVtx, iAttachX, iAttachY, mkArrayAdaptDefArr(), mkArrayAdaptDMA, mkArrayAdaptDMAM, mkNamingAdapt(), StdCompiler::Value(), VtxCNAT, VtxFriction, VtxNum, VtxX, VtxY, C4Rect::Wdt, and C4Rect::x.

524 {
525  const StdBitfieldEntry<int32_t> ContactDirections[] =
526  {
527 
528  { "CNAT_None", CNAT_None },
529  { "CNAT_Left", CNAT_Left },
530  { "CNAT_Right", CNAT_Right },
531  { "CNAT_Top", CNAT_Top },
532  { "CNAT_Bottom", CNAT_Bottom },
533  { "CNAT_Center", CNAT_Center },
534  { "CNAT_MultiAttach", CNAT_MultiAttach },
535  { "CNAT_NoCollision", CNAT_NoCollision },
536  { "CNAT_PhaseHalfVehicle", CNAT_PhaseHalfVehicle },
537 
538  { nullptr, 0 }
539  };
540 
541  // a default shape is given in object compilation context only
542  bool fRuntime = !!default_shape;
543  C4Shape default_def_shape;
544  if (!default_shape) default_shape = &default_def_shape;
545  // Note: Compiled directly into "Object" and "DefCore"-categories, so beware of name clashes
546  // (see C4Object::CompileFunc and C4Def::CompileFunc)
547  pComp->Value(mkNamingAdapt( Wdt, "Width", default_shape->Wdt));
548  pComp->Value(mkNamingAdapt( Hgt, "Height", default_shape->Hgt));
549  pComp->Value(mkNamingAdapt( mkArrayAdaptDefArr(&x,2,&default_shape->x), "Offset", &default_shape->x));
550  pComp->Value(mkNamingAdapt( VtxNum, "Vertices", default_shape->VtxNum));
551  pComp->Value(mkNamingAdapt( mkArrayAdaptDMA(VtxX, default_shape->VtxX), "VertexX", default_shape->VtxX));
552  pComp->Value(mkNamingAdapt( mkArrayAdaptDMA(VtxY, default_shape->VtxY), "VertexY", default_shape->VtxY));
553  pComp->Value(mkNamingAdapt( mkArrayAdaptDMAM(VtxCNAT, default_shape->VtxCNAT, [&](decltype(*VtxCNAT) &elem){ return mkBitfieldAdapt<int32_t>(elem, ContactDirections); }), "VertexCNAT", default_shape->VtxCNAT));
554  pComp->Value(mkNamingAdapt( mkArrayAdaptDMA(VtxFriction, default_shape->VtxFriction), "VertexFriction", default_shape->VtxFriction));
555  pComp->Value(mkNamingAdapt( ContactDensity, "ContactDensity", default_shape->ContactDensity));
556  pComp->Value(mkNamingAdapt( FireTop, "FireTop", default_shape->FireTop));
557  if (fRuntime)
558  {
559  pComp->Value(mkNamingAdapt( iAttachX, "AttachX", 0 ));
560  pComp->Value(mkNamingAdapt( iAttachY, "AttachY", 0 ));
561  pComp->Value(mkNamingAdapt( iAttachVtx, "AttachVtx", 0 ));
562  }
563 }
Definition: StdAdaptors.h:850
#define mkArrayAdaptDMAM(A, D, M)
Definition: StdAdaptors.h:418
const BYTE CNAT_PhaseHalfVehicle
Definition: C4Constants.h:118
int32_t ContactDensity
Definition: C4Shape.h:48
int32_t FireTop
Definition: C4Shape.h:42
const BYTE CNAT_NoCollision
Definition: C4Constants.h:117
int32_t iAttachY
Definition: C4Shape.h:54
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:92
int32_t VtxFriction[C4D_MaxVertex]
Definition: C4Shape.h:47
int32_t Wdt
Definition: C4Rect.h:30
const BYTE CNAT_MultiAttach
Definition: C4Constants.h:116
int32_t iAttachX
Definition: C4Shape.h:54
int32_t VtxNum
Definition: C4Shape.h:43
int32_t VtxX[C4D_MaxVertex]
Definition: C4Shape.h:44
int32_t iAttachVtx
Definition: C4Shape.h:54
void Value(const T &rStruct)
Definition: StdCompiler.h:161
int32_t x
Definition: C4Rect.h:30
const BYTE CNAT_None
Definition: C4Constants.h:109
const BYTE CNAT_Top
Definition: C4Constants.h:112
const BYTE CNAT_Right
Definition: C4Constants.h:111
int32_t Hgt
Definition: C4Rect.h:30
const BYTE CNAT_Left
Definition: C4Constants.h:110
const BYTE CNAT_Bottom
Definition: C4Constants.h:113
#define mkArrayAdaptDMA(A, D)
Definition: StdAdaptors.h:415
int32_t VtxCNAT[C4D_MaxVertex]
Definition: C4Shape.h:46
int32_t VtxY[C4D_MaxVertex]
Definition: C4Shape.h:45
const BYTE CNAT_Center
Definition: C4Constants.h:114
StdArrayDefaultArrayAdapt< T, D > mkArrayAdaptDefArr(T *pArray, size_t iSize, const D &rDefault)
Definition: StdAdaptors.h:414

Here is the call graph for this function:

bool C4Shape::ContactCheck ( int32_t  cx,
int32_t  cy,
uint32_t *  border_hack_contacts = nullptr,
bool  collide_halfvehic = false 
)

Definition at line 352 of file C4Shape.cpp.

References CNAT_Bottom, CNAT_Center, CNAT_Left, CNAT_NoCollision, CNAT_None, CNAT_Right, CNAT_Top, ContactCNAT, ContactCount, GBackMat(), C4Landscape::GetWidth(), Landscape, VtxCNAT, VtxContactCNAT, VtxContactMat, VtxNum, VtxX, VtxY, C4Rect::x, and C4Rect::y.

Referenced by C4Object::ContactCheck(), and C4SolidMask::Put().

353 {
354  // Check all vertices at given object position.
355  // Set ContactCNAT and ContactCount.
356  // Set VtxContactCNAT and VtxContactMat.
357  // Return true on any contact.
358 
359 
361  ContactCount=0;
362 
363  for (int32_t cvtx=0; cvtx<VtxNum; cvtx++)
364 
365  // Ignore vertex if collision has been flagged out
366  if (!(VtxCNAT[cvtx] & CNAT_NoCollision))
367 
368  {
370  int32_t x = cx+VtxX[cvtx];
371  int32_t y = cy+VtxY[cvtx];
372  VtxContactMat[cvtx]=GBackMat(x,y);
373 
374  if (CheckTouchableMaterial(x, y, cvtx, collide_halfvehic? 1:0))
375  {
376  ContactCNAT |= VtxCNAT[cvtx];
378  ContactCount++;
379  // Vertex center contact, now check top,bottom,left,right
380  if (CheckTouchableMaterial(x,y-1,cvtx, collide_halfvehic ? 1 : 0))
381  VtxContactCNAT[cvtx]|=CNAT_Top;
382  if (CheckTouchableMaterial(x,y+1,cvtx, collide_halfvehic ? 1 : 0))
384  if (CheckTouchableMaterial(x-1,y,cvtx, collide_halfvehic ? 1 : 0))
385  VtxContactCNAT[cvtx]|=CNAT_Left;
386  if (CheckTouchableMaterial(x+1,y,cvtx, collide_halfvehic ? 1 : 0))
387  VtxContactCNAT[cvtx]|=CNAT_Right;
388  }
389  if (border_hack_contacts)
390  {
391  if (x == 0 && CheckTouchableMaterial(x-1, y, cvtx)) *border_hack_contacts |= CNAT_Left;
392  else if (x == ::Landscape.GetWidth() && CheckTouchableMaterial(x+1, y, cvtx)) *border_hack_contacts |= CNAT_Right;
393  }
394  }
395 
396 
397  return !!ContactCount;
398 }
const BYTE CNAT_NoCollision
Definition: C4Constants.h:117
int32_t VtxContactMat[C4D_MaxVertex]
Definition: C4Shape.h:53
int32_t ContactCount
Definition: C4Shape.h:50
int32_t y
Definition: C4Rect.h:30
C4Landscape Landscape
int32_t VtxContactCNAT[C4D_MaxVertex]
Definition: C4Shape.h:52
int32_t ContactCNAT
Definition: C4Shape.h:49
int32_t VtxNum
Definition: C4Shape.h:43
int32_t VtxX[C4D_MaxVertex]
Definition: C4Shape.h:44
int32_t x
Definition: C4Rect.h:30
const BYTE CNAT_None
Definition: C4Constants.h:109
const BYTE CNAT_Top
Definition: C4Constants.h:112
const BYTE CNAT_Right
Definition: C4Constants.h:111
const BYTE CNAT_Left
Definition: C4Constants.h:110
const BYTE CNAT_Bottom
Definition: C4Constants.h:113
int32_t GBackMat(int32_t x, int32_t y)
Definition: C4Landscape.h:221
int32_t GetWidth() const
int32_t VtxCNAT[C4D_MaxVertex]
Definition: C4Shape.h:46
int32_t VtxY[C4D_MaxVertex]
Definition: C4Shape.h:45
const BYTE CNAT_Center
Definition: C4Constants.h:114

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4Rect::Contains ( int32_t  iX,
int32_t  iY 
) const
inlineinherited

Definition at line 40 of file C4Rect.h.

References C4Rect::Hgt, and C4Rect::y.

Referenced by C4FindObjectInRect::Check(), C4FindObjectAtPoint::Check(), C4Rect::Contains(), C4GUI::ContextMenu::CtxMouseInput(), C4PXSSystem::Draw(), C4Rect::IntersectsLine(), C4GUI::ListBox::MouseInput(), C4GUI::Screen::MouseInput(), C4MapScriptAlgoRect::operator()(), and C4LArea::Set().

41  { return iX>=x && iX<x+Wdt && iY>=y && iY<y+Hgt; }
int32_t y
Definition: C4Rect.h:30
int32_t x
Definition: C4Rect.h:30
int32_t Hgt
Definition: C4Rect.h:30

Here is the caller graph for this function:

bool C4Rect::Contains ( int32_t  iX,
int32_t  iY,
int32_t  iWdt,
int32_t  iHgt 
) const
inlineinherited

Definition at line 42 of file C4Rect.h.

References C4Rect::Hgt, and C4Rect::y.

43  { return iX>=x && iX+iWdt<x+Wdt && iY>=y && iY+iHgt<y+Hgt; }
int32_t y
Definition: C4Rect.h:30
int32_t x
Definition: C4Rect.h:30
int32_t Hgt
Definition: C4Rect.h:30
bool C4Rect::Contains ( const C4Rect rect) const
inlineinherited

Definition at line 44 of file C4Rect.h.

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

45  { return Contains(rect.x, rect.y, rect.Wdt, rect.Hgt); }
bool Contains(int32_t iX, int32_t iY) const
Definition: C4Rect.h:40
int32_t Wdt
Definition: C4Rect.h:30
int32_t y
Definition: C4Rect.h:30
int32_t x
Definition: C4Rect.h:30
int32_t Hgt
Definition: C4Rect.h:30

Here is the call graph for this function:

void C4Shape::CopyFrom ( C4Shape  rFrom,
bool  bCpyVertices,
bool  fCopyVerticesFromSelf 
)

Definition at line 436 of file C4Shape.cpp.

References AttachMat, C4D_VertexCpyPos, ContactCNAT, ContactCount, FireTop, VtxCNAT, VtxContactCNAT, VtxContactMat, VtxFriction, VtxNum, VtxX, and VtxY.

Referenced by C4Object::UpdateShape().

437 {
438  if (bCpyVertices)
439  {
440  // truncate / copy vertex count
441  VtxNum = (fCopyVerticesFromSelf ? std::min<int32_t>(VtxNum, C4D_VertexCpyPos) : rFrom.VtxNum);
442  // restore vertices from back of own buffer (retaining count)
443  int32_t iCopyPos = (fCopyVerticesFromSelf ? C4D_VertexCpyPos : 0);
444  C4Shape &rVtxFrom = (fCopyVerticesFromSelf ? *this : rFrom);
445  memcpy(VtxX, rVtxFrom.VtxX+iCopyPos, VtxNum*sizeof(*VtxX));
446  memcpy(VtxY, rVtxFrom.VtxY+iCopyPos, VtxNum*sizeof(*VtxY));
447  memcpy(VtxCNAT, rVtxFrom.VtxCNAT+iCopyPos, VtxNum*sizeof(*VtxCNAT));
448  memcpy(VtxFriction, rVtxFrom.VtxFriction+iCopyPos, VtxNum*sizeof(*VtxFriction));
449  memcpy(VtxContactCNAT, rVtxFrom.VtxContactCNAT+iCopyPos, VtxNum*sizeof(*VtxContactCNAT));
450  memcpy(VtxContactMat, rVtxFrom.VtxContactMat+iCopyPos, VtxNum*sizeof(*VtxContactMat));
451  // continue: copies other members
452  }
453  *((C4Rect *) this) = rFrom;
454  AttachMat=rFrom.AttachMat;
455  ContactCNAT=rFrom.ContactCNAT;
457  FireTop=rFrom.FireTop;
458 }
int32_t AttachMat
Definition: C4Shape.h:51
int32_t FireTop
Definition: C4Shape.h:42
Definition: C4Rect.h:27
int32_t VtxContactMat[C4D_MaxVertex]
Definition: C4Shape.h:53
int32_t ContactCount
Definition: C4Shape.h:50
int32_t VtxFriction[C4D_MaxVertex]
Definition: C4Shape.h:47
#define C4D_VertexCpyPos
Definition: C4Rect.h:23
int32_t VtxContactCNAT[C4D_MaxVertex]
Definition: C4Shape.h:52
int32_t ContactCNAT
Definition: C4Shape.h:49
int32_t VtxNum
Definition: C4Shape.h:43
int32_t VtxX[C4D_MaxVertex]
Definition: C4Shape.h:44
int32_t VtxCNAT[C4D_MaxVertex]
Definition: C4Shape.h:46
int32_t VtxY[C4D_MaxVertex]
Definition: C4Shape.h:45

Here is the caller graph for this function:

void C4Shape::CreateOwnOriginalCopy ( C4Shape rFrom)

Definition at line 511 of file C4Shape.cpp.

References C4D_VertexCpyPos, VtxCNAT, VtxContactCNAT, VtxContactMat, VtxFriction, VtxNum, VtxX, and VtxY.

512 {
513  // copy vertices from original buffer, including count
514  VtxNum = std::min<int32_t>(rFrom.VtxNum, C4D_VertexCpyPos);
515  memcpy(VtxX+C4D_VertexCpyPos, rFrom.VtxX, VtxNum*sizeof(*VtxX));
516  memcpy(VtxY+C4D_VertexCpyPos, rFrom.VtxY, VtxNum*sizeof(*VtxY));
517  memcpy(VtxCNAT+C4D_VertexCpyPos, rFrom.VtxCNAT, VtxNum*sizeof(*VtxCNAT));
518  memcpy(VtxFriction+C4D_VertexCpyPos, rFrom.VtxFriction, VtxNum*sizeof(*VtxFriction));
521 }
int32_t VtxContactMat[C4D_MaxVertex]
Definition: C4Shape.h:53
int32_t VtxFriction[C4D_MaxVertex]
Definition: C4Shape.h:47
#define C4D_VertexCpyPos
Definition: C4Rect.h:23
int32_t VtxContactCNAT[C4D_MaxVertex]
Definition: C4Shape.h:52
int32_t VtxNum
Definition: C4Shape.h:43
int32_t VtxX[C4D_MaxVertex]
Definition: C4Shape.h:44
int32_t VtxCNAT[C4D_MaxVertex]
Definition: C4Shape.h:46
int32_t VtxY[C4D_MaxVertex]
Definition: C4Shape.h:45
void C4Shape::Default ( )

Definition at line 36 of file C4Shape.cpp.

References InplaceReconstruct().

Referenced by C4Object::Default(), and C4Def::DefaultDefCore().

37 {
38  InplaceReconstruct(this);
39 }
std::enable_if< std::is_nothrow_default_constructible< T >::value >::type InplaceReconstruct(T *obj)
Definition: Standard.h:35

Here is the call graph for this function:

Here is the caller graph for this function:

void C4Rect::Enlarge ( int32_t  iByX,
int32_t  iByY 
)
inlineinherited

Definition at line 51 of file C4Rect.h.

References C4Rect::Hgt, C4Rect::Wdt, and C4Rect::y.

Referenced by C4PXSSystem::Draw(), C4Rect::Enlarge(), and C4LandscapeRenderGL::GetAffectedRect().

52  { x -= iByX; y -= iByY; Wdt += 2*iByX; Hgt += 2*iByY; }
int32_t Wdt
Definition: C4Rect.h:30
int32_t y
Definition: C4Rect.h:30
int32_t x
Definition: C4Rect.h:30
int32_t Hgt
Definition: C4Rect.h:30

Here is the caller graph for this function:

void C4Rect::Enlarge ( int32_t  iBy)
inlineinherited

Definition at line 53 of file C4Rect.h.

References C4Rect::Enlarge().

54  { Enlarge(iBy, iBy); }
void Enlarge(int32_t iByX, int32_t iByY)
Definition: C4Rect.h:51

Here is the call graph for this function:

int32_t C4Rect::GetBottom ( ) const
inlineinherited

Definition at line 58 of file C4Rect.h.

References C4Rect::Hgt, and C4Rect::y.

Referenced by C4Landscape::DigFreeShape(), and C4FoWLightSection::Update().

58 { return y + Hgt; }
int32_t y
Definition: C4Rect.h:30
int32_t Hgt
Definition: C4Rect.h:30

Here is the caller graph for this function:

int C4Shape::GetBottom ( )

Definition at line 471 of file C4Shape.cpp.

References b, CNAT_NoCollision, C4Rect::Hgt, VtxCNAT, VtxNum, VtxY, and C4Rect::y.

Referenced by C4Object::DoCon().

472 {
473  int b = INT_MIN;
474  for (int32_t i = 0; i < VtxNum; i++)
475  if (~VtxCNAT[i] & CNAT_NoCollision)
476  if (VtxY[i] > b)
477  b = VtxY[i];
478  if (b == INT_MIN)
479  return y + Hgt;
480  return b;
481 }
#define b
const BYTE CNAT_NoCollision
Definition: C4Constants.h:117
int32_t y
Definition: C4Rect.h:30
int32_t VtxNum
Definition: C4Shape.h:43
int32_t Hgt
Definition: C4Rect.h:30
int32_t VtxCNAT[C4D_MaxVertex]
Definition: C4Shape.h:46
int32_t VtxY[C4D_MaxVertex]
Definition: C4Shape.h:45

Here is the caller graph for this function:

int32_t C4Shape::GetBottomVertex ( )

Definition at line 460 of file C4Shape.cpp.

References CNAT_Bottom, VtxCNAT, VtxNum, and VtxY.

Referenced by ObjectComJump().

461 {
462  // return bottom-most vertex
463  int32_t iMax = -1;
464  for (int32_t i = 0; i < VtxNum; i++)
465  if (VtxCNAT[i] & CNAT_Bottom)
466  if (iMax == -1 || VtxY[i] < VtxY[iMax])
467  iMax = i;
468  return iMax;
469 }
int32_t VtxNum
Definition: C4Shape.h:43
const BYTE CNAT_Bottom
Definition: C4Constants.h:113
int32_t VtxCNAT[C4D_MaxVertex]
Definition: C4Shape.h:46
int32_t VtxY[C4D_MaxVertex]
Definition: C4Shape.h:45

Here is the caller graph for this function:

int32_t C4Rect::GetLeft ( ) const
inlineinherited

Definition at line 60 of file C4Rect.h.

References C4Rect::x.

60 { return x; }
int32_t x
Definition: C4Rect.h:30
int32_t C4Rect::GetMiddleX ( ) const
inlineinherited

Definition at line 56 of file C4Rect.h.

References C4Rect::Wdt.

Referenced by C4Landscape::BlastFreeShape(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4Landscape::DigFreeShape(), C4GUI::ProgressBar::DrawElement(), C4GUI::ComponentAligner::GetCentered(), and C4GUI::TextWindow::TextWindow().

56 { return x+Wdt/2; }
int32_t Wdt
Definition: C4Rect.h:30
int32_t x
Definition: C4Rect.h:30

Here is the caller graph for this function:

int32_t C4Rect::GetMiddleY ( ) const
inlineinherited

Definition at line 57 of file C4Rect.h.

References C4Rect::Hgt, and C4Rect::y.

Referenced by C4Landscape::BlastFreeShape(), and C4GUI::ComponentAligner::GetCentered().

57 { return y + Hgt / 2; }
int32_t y
Definition: C4Rect.h:30
int32_t Hgt
Definition: C4Rect.h:30

Here is the caller graph for this function:

int32_t C4Rect::GetRight ( ) const
inlineinherited

Definition at line 61 of file C4Rect.h.

References C4Rect::Wdt.

61 { return x + Wdt; }
int32_t Wdt
Definition: C4Rect.h:30
int32_t x
Definition: C4Rect.h:30
int32_t C4Rect::GetTop ( ) const
inlineinherited

Definition at line 59 of file C4Rect.h.

References C4Rect::y.

59 { return y; }
int32_t y
Definition: C4Rect.h:30
int32_t C4Shape::GetVertexContact ( int32_t  iVtx,
DWORD  dwCheckMask,
int32_t  tx,
int32_t  ty,
const C4DensityProvider rDensityProvider = DefaultDensityProvider 
)

Definition at line 491 of file C4Shape.cpp.

References CNAT_Bottom, CNAT_Center, CNAT_Left, CNAT_NoCollision, CNAT_Right, CNAT_Top, VtxCNAT, VtxX, and VtxY.

492 {
493  // default check mask
494  if (!dwCheckMask) dwCheckMask = VtxCNAT[iVtx];
495  // check vertex positions (vtx num not range-checked!)
496  tx += VtxX[iVtx]; ty += VtxY[iVtx];
497  int32_t iContact = 0;
498  // check all directions for solid mat
499  if (~VtxCNAT[iVtx] & CNAT_NoCollision)
500  {
501  if (dwCheckMask & CNAT_Center) if (CheckTouchableMaterial(tx, ty , iVtx, 0, rDensityProvider)) iContact |= CNAT_Center;
502  if (dwCheckMask & CNAT_Left) if (CheckTouchableMaterial(tx-1, ty, iVtx, 0, rDensityProvider)) iContact |= CNAT_Left;
503  if (dwCheckMask & CNAT_Right) if (CheckTouchableMaterial(tx+1, ty, iVtx, 0, rDensityProvider)) iContact |= CNAT_Right;
504  if (dwCheckMask & CNAT_Top) if (CheckTouchableMaterial(tx, ty-1, iVtx, 0, rDensityProvider)) iContact |= CNAT_Top;
505  if (dwCheckMask & CNAT_Bottom) if (CheckTouchableMaterial(tx, ty+1, iVtx, 1, rDensityProvider)) iContact |= CNAT_Bottom;
506  }
507  // return resulting bitmask
508  return iContact;
509 }
const BYTE CNAT_NoCollision
Definition: C4Constants.h:117
int32_t VtxX[C4D_MaxVertex]
Definition: C4Shape.h:44
const BYTE CNAT_Top
Definition: C4Constants.h:112
const BYTE CNAT_Right
Definition: C4Constants.h:111
const BYTE CNAT_Left
Definition: C4Constants.h:110
const BYTE CNAT_Bottom
Definition: C4Constants.h:113
int32_t VtxCNAT[C4D_MaxVertex]
Definition: C4Shape.h:46
int32_t VtxY[C4D_MaxVertex]
Definition: C4Shape.h:45
const BYTE CNAT_Center
Definition: C4Constants.h:114
void C4Shape::GetVertexOutline ( C4Rect rRect)

Definition at line 146 of file C4Shape.cpp.

References C4Rect::Hgt, VtxNum, VtxX, VtxY, C4Rect::Wdt, C4Rect::x, and C4Rect::y.

147 {
148  int32_t cnt;
149  rRect.x=rRect.y=rRect.Wdt=rRect.Hgt=0;
150  for (cnt=0; cnt<VtxNum; cnt++)
151  {
152  // Extend left
153  if (VtxX[cnt]<rRect.x)
154  {
155  rRect.Wdt+=rRect.x-VtxX[cnt];
156  rRect.x=VtxX[cnt];
157  }
158  // Extend right
159  else if (VtxX[cnt]>rRect.x+rRect.Wdt)
160  { rRect.Wdt=VtxX[cnt]-rRect.x; }
161 
162  // Extend up
163  if (VtxY[cnt]<rRect.y)
164  {
165  rRect.Hgt+=rRect.y-VtxY[cnt];
166  rRect.y=VtxY[cnt];
167  }
168  // Extend down
169  else if (VtxY[cnt]>rRect.y+rRect.Hgt)
170  { rRect.Hgt=VtxY[cnt]-rRect.y; }
171  }
172 
173  rRect.Hgt+=rRect.y-y;
174  rRect.y=y;
175 
176 }
int32_t Wdt
Definition: C4Rect.h:30
int32_t y
Definition: C4Rect.h:30
int32_t VtxNum
Definition: C4Shape.h:43
int32_t VtxX[C4D_MaxVertex]
Definition: C4Shape.h:44
int32_t x
Definition: C4Rect.h:30
int32_t Hgt
Definition: C4Rect.h:30
int32_t VtxY[C4D_MaxVertex]
Definition: C4Shape.h:45
int32_t C4Shape::GetVertexX ( int32_t  iVertex)

Definition at line 424 of file C4Shape.cpp.

References VtxNum, and VtxX.

Referenced by ObjectComJump().

425 {
426  if (!Inside<int32_t>(iVertex,0,VtxNum-1)) return 0;
427  return VtxX[iVertex];
428 }
int32_t VtxNum
Definition: C4Shape.h:43
int32_t VtxX[C4D_MaxVertex]
Definition: C4Shape.h:44

Here is the caller graph for this function:

int32_t C4Shape::GetVertexY ( int32_t  iVertex)

Definition at line 430 of file C4Shape.cpp.

References VtxNum, and VtxY.

Referenced by ObjectComJump().

431 {
432  if (!Inside<int32_t>(iVertex,0,VtxNum-1)) return 0;
433  return VtxY[iVertex];
434 }
int32_t VtxNum
Definition: C4Shape.h:43
int32_t VtxY[C4D_MaxVertex]
Definition: C4Shape.h:45

Here is the caller graph for this function:

int32_t C4Shape::GetX ( ) const
inline

Definition at line 63 of file C4Shape.h.

References C4Rect::x.

Referenced by C4Object::ActivateMenu(), C4Object::At(), C4Object::DoMovement(), C4Object::Draw(), C4Object::DrawActionFace(), C4Object::DrawFace(), C4Object::DrawSelectMark(), C4Object::DrawTopFace(), C4Object::ExecMovement(), C4Object::GetArea(), and C4Object::SideBounds().

63 { return x; }
int32_t x
Definition: C4Rect.h:30

Here is the caller graph for this function:

int32_t C4Shape::GetY ( ) const
inline

Definition at line 64 of file C4Shape.h.

References C4Rect::y.

Referenced by C4Object::ActivateMenu(), C4Object::At(), C4Command::Dig(), C4Object::DoMovement(), C4Object::Draw(), C4Object::DrawActionFace(), C4Object::DrawFace(), C4Object::DrawSelectMark(), C4Object::DrawTopFace(), C4Object::ExecLife(), C4Object::ExecMovement(), C4Command::Exit(), C4Command::FlightControl(), C4Object::GetArea(), C4Command::JumpControl(), and C4Object::VerticalBounds().

64 { return y; }
int32_t y
Definition: C4Rect.h:30

Here is the caller graph for this function:

bool C4Shape::InsertVertex ( int32_t  iPos,
int32_t  tx,
int32_t  ty 
)

Definition at line 316 of file C4Shape.cpp.

References C4D_MaxVertex, VtxNum, VtxX, and VtxY.

Referenced by LineConnect().

317 {
318  if (VtxNum+1>C4D_MaxVertex) return false;
319  if (iPos < 0 || iPos > VtxNum) return false;
320  // Insert vertex before iPos
321  for (int32_t cnt=VtxNum; cnt>iPos; cnt--)
322  { VtxX[cnt]=VtxX[cnt-1]; VtxY[cnt]=VtxY[cnt-1]; }
323  VtxX[iPos]=tx; VtxY[iPos]=ty;
324  VtxNum++;
325  return true;
326 }
int32_t VtxNum
Definition: C4Shape.h:43
int32_t VtxX[C4D_MaxVertex]
Definition: C4Shape.h:44
const int C4D_MaxVertex
Definition: C4Constants.h:55
int32_t VtxY[C4D_MaxVertex]
Definition: C4Shape.h:45

Here is the caller graph for this function:

void C4Rect::Intersect ( const C4Rect r2)
inherited

Definition at line 100 of file C4Rect.cpp.

References C4Rect::Hgt, C4Rect::Wdt, C4Rect::x, and C4Rect::y.

Referenced by C4FindObjectAnd::C4FindObjectAnd(), C4Landscape::P::FinishChange(), FnParRect(), C4SolidMask::PutTemporary(), C4SolidMask::RemoveTemporary(), C4SolidMask::Repair(), C4LandscapeRenderGL::Update(), and C4Landscape::P::UpdateMatCnt().

101 {
102  // Narrow bounds
103  if (r2.x > x)
104  if (r2.x + r2.Wdt < x + Wdt)
105  { x = r2.x; Wdt = r2.Wdt; }
106  else
107  { Wdt -= (r2.x - x); x = r2.x; }
108  else if (r2.x + r2.Wdt < x + Wdt)
109  Wdt = r2.x + r2.Wdt - x;
110  if (r2.y > y)
111  if (r2.y + r2.Hgt < y + Hgt)
112  { y = r2.y; Hgt = r2.Hgt; }
113  else
114  { Hgt -= (r2.y - y); y = r2.y; }
115  else if (r2.y + r2.Hgt < y + Hgt)
116  Hgt = r2.y + r2.Hgt - y;
117  // Degenerated? Will happen when the two rects don't overlap
118  if (Wdt < 0) Wdt = 0;
119  if (Hgt < 0) Hgt = 0;
120 }
int32_t Wdt
Definition: C4Rect.h:30
int32_t y
Definition: C4Rect.h:30
int32_t x
Definition: C4Rect.h:30
int32_t Hgt
Definition: C4Rect.h:30

Here is the caller graph for this function:

bool C4Rect::IntersectsLine ( int32_t  iX,
int32_t  iY,
int32_t  iX2,
int32_t  iY2 
)
inherited

Definition at line 122 of file C4Rect.cpp.

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

Referenced by C4FindObjectOnLine::Check().

123 {
124  // Easy cases first
125  if (Contains(iX, iY)) return true;
126  if (Contains(iX2, iY2)) return true;
127  if (iX < x && iX2 < x) return false;
128  if (iY < y && iY2 < y) return false;
129  if (iX >= x+Wdt && iX2 >= x+Wdt) return false;
130  if (iY >= y+Hgt && iY2 >= y+Hgt) return false;
131  // check some special cases
132  if (iX == iX2 || iY == iY2) return true;
133  // Check intersection left/right
134  int32_t iXI, iYI;
135  iXI = (iX < x ? x : x+Wdt);
136  iYI = iY + (iY2 - iY) * (iXI - iX) / (iX2 - iX);
137  if (iYI >= y && iYI < y+Hgt) return true;
138  // Check intersection up/down
139  iYI = (iY < y ? y : y+Hgt);
140  iXI = iX + (iX2 - iX) * (iYI - iY) / (iY2 - iY);
141  return iXI >= x && iXI < x+Wdt;
142 }
bool Contains(int32_t iX, int32_t iY) const
Definition: C4Rect.h:40
int32_t Wdt
Definition: C4Rect.h:30
int32_t y
Definition: C4Rect.h:30
int32_t x
Definition: C4Rect.h:30
int32_t Hgt
Definition: C4Rect.h:30

Here is the call graph for this function:

Here is the caller graph for this function:

void C4Shape::Jolt ( int32_t  iCon,
bool  bUpdateVertices 
)

Definition at line 135 of file C4Shape.cpp.

References FireTop, FullCon, C4Rect::Hgt, VtxNum, VtxY, and C4Rect::y.

Referenced by C4Object::UpdateShape().

136 {
137  int32_t cnt;
138  y=y*iCon/FullCon;
139  Hgt=Hgt*iCon/FullCon;
140  FireTop=FireTop*iCon/FullCon;
141  if (bUpdateVertices)
142  for (cnt=0; cnt<VtxNum; cnt++)
143  VtxY[cnt]=VtxY[cnt]*iCon/FullCon;
144 }
int32_t FireTop
Definition: C4Shape.h:42
const int32_t FullCon
Definition: C4Constants.h:182
int32_t y
Definition: C4Rect.h:30
int32_t VtxNum
Definition: C4Shape.h:43
int32_t Hgt
Definition: C4Rect.h:30
int32_t VtxY[C4D_MaxVertex]
Definition: C4Shape.h:45

Here is the caller graph for this function:

bool C4Shape::LineConnect ( int32_t  tx,
int32_t  ty,
int32_t  cvtx,
int32_t  ld,
int32_t  oldx,
int32_t  oldy 
)

Definition at line 255 of file C4Shape.cpp.

References InsertVertex(), PathFree(), PathFreeIgnoreVehicle(), VtxNum, VtxX, and VtxY.

Referenced by C4Object::ExecAction().

256 {
257 
258  if (VtxNum<2) return false;
259 
260  // No modification
261  if ((VtxX[cvtx]==tx) && (VtxY[cvtx]==ty)) return true;
262 
263  // Check new path
264  int32_t ix,iy;
265  if (PathFree(tx,ty,VtxX[cvtx+ld],VtxY[cvtx+ld],&ix,&iy))
266  {
267  // Okay, set vertex
268  VtxX[cvtx]=tx; VtxY[cvtx]=ty;
269  return true;
270  }
271  else
272  {
273  // Intersected, find bend vertex
274  bool found = false;
275  int32_t cix;
276  int32_t ciy;
277  for (int irange = 4; irange <= 12; irange += 4)
278  for (cix = ix - irange / 2; cix <= ix + irange; cix += irange)
279  for (ciy = iy - irange / 2; ciy <= iy + irange; ciy += irange)
280  {
281  if (PathFree(cix,ciy,tx,ty) && PathFree(cix,ciy,VtxX[cvtx+ld],VtxY[cvtx+ld]))
282  {
283  found = true;
284  goto out;
285  }
286  }
287 out:
288  if (!found)
289  {
290  // try bending directly at path the line took
291  // allow going through vehicle in this case to allow lines through castles and elevator shafts
292  cix = oldx;
293  ciy = oldy;
294  if (!PathFreeIgnoreVehicle(cix,ciy,tx,ty) || !PathFreeIgnoreVehicle(cix,ciy,VtxX[cvtx+ld],VtxY[cvtx+ld]))
295  if (!PathFreeIgnoreVehicle(cix,ciy,tx,ty) || !PathFreeIgnoreVehicle(cix,ciy,VtxX[cvtx+ld],VtxY[cvtx+ld]))
296  return false; // Found no bend vertex
297  }
298  // Insert bend vertex
299  if (ld>0)
300  {
301  if (!InsertVertex(cvtx+1,cix,ciy)) return false;
302  }
303  else
304  {
305  if (!InsertVertex(cvtx,cix,ciy)) return false;
306  cvtx++;
307  }
308  // Okay, set vertex
309  VtxX[cvtx]=tx; VtxY[cvtx]=ty;
310  return true;
311  }
312 
313  return false;
314 }
bool PathFreeIgnoreVehicle(int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t *ix, int32_t *iy)
int32_t VtxNum
Definition: C4Shape.h:43
int32_t VtxX[C4D_MaxVertex]
Definition: C4Shape.h:44
bool PathFree(int32_t x1, int32_t y1, int32_t x2, int32_t y2)
bool InsertVertex(int32_t iPos, int32_t tx, int32_t ty)
Definition: C4Shape.cpp:316
int32_t VtxY[C4D_MaxVertex]
Definition: C4Shape.h:45

Here is the call graph for this function:

Here is the caller graph for this function:

void C4Rect::Normalize ( )
inlineinherited

Definition at line 48 of file C4Rect.h.

References C4Rect::Hgt, C4Rect::Wdt, and C4Rect::y.

49  { if (Wdt < 0) { x+=Wdt+1; Wdt=-Wdt; } if (Hgt < 0) { y+=Hgt+1; Hgt=-Hgt; } }
int32_t Wdt
Definition: C4Rect.h:30
int32_t y
Definition: C4Rect.h:30
int32_t x
Definition: C4Rect.h:30
int32_t Hgt
Definition: C4Rect.h:30
bool C4Rect::operator!= ( const C4Rect r2) const
inlineinherited

Definition at line 38 of file C4Rect.h.

References C4Rect::Hgt, C4Rect::Wdt, C4Rect::x, and C4Rect::y.

38 { return 0 != ((x-r2.x) | (y-r2.y) | (Wdt-r2.Wdt) | (Hgt-r2.Hgt)); }
int32_t Wdt
Definition: C4Rect.h:30
int32_t y
Definition: C4Rect.h:30
int32_t x
Definition: C4Rect.h:30
int32_t Hgt
Definition: C4Rect.h:30
bool C4Rect::operator== ( const C4Rect r2) const
inlineinherited

Definition at line 37 of file C4Rect.h.

References C4Rect::Hgt, C4Rect::Wdt, C4Rect::x, and C4Rect::y.

37 { return !((x-r2.x) | (y-r2.y) | (Wdt-r2.Wdt) | (Hgt-r2.Hgt)); }
int32_t Wdt
Definition: C4Rect.h:30
int32_t y
Definition: C4Rect.h:30
int32_t x
Definition: C4Rect.h:30
int32_t Hgt
Definition: C4Rect.h:30
bool C4Rect::Overlap ( C4Rect rTarget)
inherited

Definition at line 91 of file C4Rect.cpp.

References C4Rect::Hgt, C4Rect::Wdt, C4Rect::x, and C4Rect::y.

Referenced by C4FindObjectAtRect::Check(), and C4Game::FindConstuctionSiteBlock().

92 {
93  if (x+Wdt<=rTarget.x) return false;
94  if (x>=rTarget.x+rTarget.Wdt) return false;
95  if (y+Hgt<=rTarget.y) return false;
96  if (y>=rTarget.y+rTarget.Hgt) return false;
97  return true;
98 }
int32_t Wdt
Definition: C4Rect.h:30
int32_t y
Definition: C4Rect.h:30
int32_t x
Definition: C4Rect.h:30
int32_t Hgt
Definition: C4Rect.h:30

Here is the caller graph for this function:

bool C4Shape::RemoveVertex ( int32_t  iPos)

Definition at line 328 of file C4Shape.cpp.

References VtxNum, VtxX, and VtxY.

Referenced by ReduceLineSegments().

329 {
330  if (!Inside<int32_t>(iPos,0,VtxNum-1)) return false;
331  for (int32_t cnt=iPos; cnt+1<VtxNum; cnt++)
332  { VtxX[cnt]=VtxX[cnt+1]; VtxY[cnt]=VtxY[cnt+1]; }
333  VtxNum--;
334  return true;
335 }
int32_t VtxNum
Definition: C4Shape.h:43
int32_t VtxX[C4D_MaxVertex]
Definition: C4Shape.h:44
int32_t VtxY[C4D_MaxVertex]
Definition: C4Shape.h:45

Here is the caller graph for this function:

void C4Shape::Rotate ( C4Real  Angle,
bool  bUpdateVertices 
)

Definition at line 41 of file C4Shape.cpp.

References AddDbgRec(), Config, Cos(), C4ConfigGeneral::DebugRec, fixtoi(), C4Config::General, C4Rect::Hgt, C4RCRotVtx::hgt, C4RCRotVtx::r, RCT_RotVtx1, RCT_RotVtx2, Sin(), VtxNum, VtxX, C4RCRotVtx::VtxX, VtxY, C4RCRotVtx::VtxY, C4Rect::Wdt, C4RCRotVtx::wdt, C4Rect::x, C4RCRotVtx::x, C4Rect::y, and C4RCRotVtx::y.

Referenced by C4Object::UpdateShape().

42 {
43  C4RCRotVtx rc;
44  int32_t i = 0;
46  {
47  rc.x=x; rc.y=y; rc.wdt=Wdt; rc.hgt=Hgt; rc.r=fixtoi(Angle);
48  for (; i<4; ++i)
49  { rc.VtxX[i]=VtxX[i]; rc.VtxY[i]=VtxY[i]; }
50  AddDbgRec(RCT_RotVtx1, &rc, sizeof(rc));
51  }
52  int32_t cnt,nvtx,nvty,nwdt,nhgt;
53 
54  C4Real mtx[4];
55 
56  // Calculate rotation matrix
57  mtx[0] = Cos(Angle); mtx[1] = -Sin(Angle);
58  mtx[2] = -mtx[1]; mtx[3] = mtx[0];
59 
60  if (bUpdateVertices)
61  {
62  // Rotate vertices
63  for (cnt = 0; cnt < VtxNum; cnt++)
64  {
65  nvtx = fixtoi(mtx[0] * VtxX[cnt] + mtx[1] * VtxY[cnt]);
66  nvty = fixtoi(mtx[2] * VtxX[cnt] + mtx[3] * VtxY[cnt]);
67  VtxX[cnt] = nvtx; VtxY[cnt] = nvty;
68  }
69  }
70 
71  // Enlarge Rect
72  nvtx = fixtoi(mtx[0] * x + mtx[1] * y);
73  nvty = fixtoi(mtx[2] * x + mtx[3] * y);
74  if (mtx[0] > 0)
75  {
76  if (mtx[1] > 0)
77  {
78  nwdt = fixtoi(mtx[0] * Wdt + mtx[1] * Hgt);
79  nhgt = fixtoi(mtx[1] * Wdt + mtx[0] * Hgt);
80  x = nvtx;
81  y = nvty - fixtoi(mtx[1] * Wdt);
82  }
83  else
84  {
85  nwdt = fixtoi(mtx[0] * Wdt - mtx[1] * Hgt);
86  nhgt = fixtoi(- mtx[1] * Wdt + mtx[0] * Hgt);
87  x = nvtx + fixtoi(mtx[1] * Hgt);
88  y = nvty;
89  }
90  }
91  else
92  {
93  if (mtx[1] > 0)
94  {
95  nwdt = fixtoi(- mtx[0] * Wdt + mtx[1] * Hgt);
96  nhgt = fixtoi(mtx[1] * Wdt - mtx[0] * Hgt);
97  x = nvtx + fixtoi(mtx[0] * Wdt);
98  y = nvty - nhgt;
99  }
100  else
101  {
102  nwdt = fixtoi(- mtx[0] * Wdt - mtx[1] * Hgt);
103  nhgt = fixtoi(- mtx[1] * Wdt - mtx[0] * Hgt);
104  x = nvtx - nwdt;
105  y = nvty + fixtoi(mtx[0] * Hgt);
106  }
107  }
108  Wdt = nwdt;
109  Hgt = nhgt;
110  if (Config.General.DebugRec)
111  {
112  rc.x=x; rc.y=y; rc.wdt=Wdt; rc.hgt=Hgt;
113  for (i=0; i<4; ++i)
114  { rc.VtxX[i]=VtxX[i]; rc.VtxY[i]=VtxY[i]; }
115  AddDbgRec(RCT_RotVtx2, &rc, sizeof(rc));
116  }
117 }
int VtxX[4]
Definition: C4Record.h:165
C4Config Config
Definition: C4Config.cpp:833
C4ConfigGeneral General
Definition: C4Config.h:251
Definition: C4Real.h:58
int32_t Wdt
Definition: C4Rect.h:30
int32_t y
Definition: C4Rect.h:30
int32_t VtxNum
Definition: C4Shape.h:43
int32_t VtxX[C4D_MaxVertex]
Definition: C4Shape.h:44
void AddDbgRec(C4RecordChunkType eType, const void *pData, int iSize)
Definition: C4Record.cpp:32
int32_t x
Definition: C4Rect.h:30
int32_t DebugRec
Definition: C4Config.h:60
int32_t Hgt
Definition: C4Rect.h:30
C4Real Sin(const C4Real &fAngle)
Definition: C4Real.h:265
int fixtoi(const C4Fixed &x)
Definition: C4Real.h:259
C4Real Cos(const C4Real &fAngle)
Definition: C4Real.h:266
int32_t VtxY[C4D_MaxVertex]
Definition: C4Shape.h:45
int VtxY[4]
Definition: C4Record.h:165

Here is the call graph for this function:

Here is the caller graph for this function:

void C4Rect::Set ( int32_t  iX,
int32_t  iY,
int32_t  iWdt,
int32_t  iHgt 
)
inherited

Definition at line 86 of file C4Rect.cpp.

References C4Rect::Hgt, C4Rect::Wdt, C4Rect::x, and C4Rect::y.

Referenced by C4StartupNetListEntry::C4StartupNetListEntry(), C4MapFolderData::Clear(), C4GUI::Element::Element(), C4ChatControl::ChatSheet::NickItem::NickItem(), C4TargetRect::Set(), and C4GUI::Window::UpdateOwnPos().

87 {
88  x=iX; y=iY; Wdt=iWdt; Hgt=iHgt;
89 }
int32_t Wdt
Definition: C4Rect.h:30
int32_t y
Definition: C4Rect.h:30
int32_t x
Definition: C4Rect.h:30
int32_t Hgt
Definition: C4Rect.h:30

Here is the caller graph for this function:

void C4Shape::Stretch ( int32_t  iCon,
bool  bUpdateVertices 
)

Definition at line 119 of file C4Shape.cpp.

References FireTop, FullCon, C4Rect::Hgt, VtxNum, VtxX, VtxY, C4Rect::Wdt, C4Rect::x, and C4Rect::y.

Referenced by C4Object::UpdateShape().

120 {
121  int32_t cnt;
122  x=x*iCon/FullCon;
123  y=y*iCon/FullCon;
124  Wdt=Wdt*iCon/FullCon;
125  Hgt=Hgt*iCon/FullCon;
126  FireTop=FireTop*iCon/FullCon;
127  if (bUpdateVertices)
128  for (cnt=0; cnt<VtxNum; cnt++)
129  {
130  VtxX[cnt]=VtxX[cnt]*iCon/FullCon;
131  VtxY[cnt]=VtxY[cnt]*iCon/FullCon;
132  }
133 }
int32_t FireTop
Definition: C4Shape.h:42
const int32_t FullCon
Definition: C4Constants.h:182
int32_t Wdt
Definition: C4Rect.h:30
int32_t y
Definition: C4Rect.h:30
int32_t VtxNum
Definition: C4Shape.h:43
int32_t VtxX[C4D_MaxVertex]
Definition: C4Shape.h:44
int32_t x
Definition: C4Rect.h:30
int32_t Hgt
Definition: C4Rect.h:30
int32_t VtxY[C4D_MaxVertex]
Definition: C4Shape.h:45

Here is the caller graph for this function:

Member Data Documentation

int32_t C4Shape::AttachMat = MNone

Definition at line 51 of file C4Shape.h.

Referenced by Attach(), CopyFrom(), and C4Object::ExecAction().

int32_t C4Shape::ContactCNAT = 0

Definition at line 49 of file C4Shape.h.

Referenced by ContactCheck(), C4Object::ContactCheck(), and CopyFrom().

int32_t C4Shape::ContactCount = 0

Definition at line 50 of file C4Shape.h.

Referenced by ContactCheck(), C4Object::ContactCheck(), and CopyFrom().

int32_t C4Shape::ContactDensity = C4M_Solid

Definition at line 48 of file C4Shape.h.

Referenced by CompileFunc(), C4Command::JumpControl(), and ObjectComJump().

int32_t C4Shape::FireTop = 0

Definition at line 42 of file C4Shape.h.

Referenced by CompileFunc(), CopyFrom(), Jolt(), and Stretch().

int32_t C4Rect::Hgt = 0
inherited

Definition at line 30 of file C4Rect.h.

Referenced by C4Rect::Add(), C4GUI::ListBox::AddElement(), C4Object::addtop(), C4Menu::AdjustPosition(), C4Object::At(), C4Landscape::BlastFreeShape(), C4MapScriptLayer::Blit(), C4Viewport::BlitOutput(), C4GameOptionButtons::C4GameOptionButtons(), C4GameOverDlg::C4GameOverDlg(), C4LeagueSignupDialog::C4LeagueSignupDialog(), C4Rect::C4Rect(), C4SolidMask::C4SolidMask(), C4StartupMainDlg::C4StartupMainDlg(), C4StartupNetListEntry::C4StartupNetListEntry(), C4StartupOptionsDlg::C4StartupOptionsDlg(), C4StartupPlrSelDlg::C4StartupPlrSelDlg(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4TexRef::C4TexRef(), C4GUI::ContextMenu::CheckOpenSubmenu(), C4Object::CheckSolidMaskRect(), C4TexRef::ClearRect(), C4TargetRect::ClipBy(), C4RectList::ClipByRect(), C4Rect::CompileFunc(), CompileFunc(), ConstructionCheck(), C4Rect::Contains(), C4GUI::ContextMenu::ContextMenu(), C4GUI::ListBox::ContractToElementHeight(), C4Game::CreateObjectConstruction(), C4GameObjects::CrossCheck(), C4MaterialMap::CrossMapMaterials(), C4Rect::Default(), C4FileSelDlg::DefaultListItem::DefaultListItem(), DoBridge(), C4GUI::Element::DoContext(), C4GUI::Screen::DoContext(), C4Object::DoMovement(), C4ChatDlg::DoPlacement(), C4GameMessage::Draw(), C4DefGraphics::Draw(), C4SolidMask::Draw(), C4EditCursor::Draw(), C4Viewport::Draw(), C4MouseControl::Draw(), C4Object::Draw(), C4GraphicsOverlay::Draw(), C4ScriptGuiWindow::Draw(), C4GUI::Window::Draw(), C4GUI::FrameDecoration::Draw(), C4GUI::Dialog::Draw(), C4GUI::Element::Draw3DFrame(), C4GUI::Element::DrawBar(), C4ScriptGuiWindow::DrawChildren(), C4Landscape::DrawChunks(), C4StartupMainDlg::DrawElement(), C4MenuItem::DrawElement(), C4StartupNetListEntry::DrawElement(), C4Chart::DrawElement(), C4Menu::DrawElement(), C4GUI::WoodenLabel::DrawElement(), C4GUI::ProgressBar::DrawElement(), C4GUI::Picture::DrawElement(), C4GUI::OverlayPicture::DrawElement(), C4GUI::GroupBox::DrawElement(), C4GUI::Button::DrawElement(), C4GUI::IconButton::DrawElement(), C4GUI::ArrowButton::DrawElement(), C4GUI::FacetButton::DrawElement(), C4GUI::Edit::DrawElement(), C4GUI::CheckBox::DrawElement(), C4GUI::ListBox::DrawElement(), C4GUI::Tabular::DrawElement(), C4GUI::TextWindow::DrawElement(), C4GUI::ContextMenu::Entry::DrawElement(), C4GUI::ContextMenu::DrawElement(), C4GUI::ContextButton::DrawElement(), C4GUI::ComboBox::DrawElement(), C4GUI::Dialog::DrawElement(), C4Object::DrawFace(), C4ViewportList::DrawFullscreenBackground(), C4GUI::Element::DrawHBarByVGfx(), C4EditCursor::DrawObject(), C4Object::DrawSelectMark(), C4Object::DrawTopFace(), C4GUI::Element::DrawVBar(), C4GUI::TextWindow::ElementPosChanged(), C4GUI::TextWindow::ElementSizeChanged(), C4Rect::Enlarge(), C4GUI::ContextMenu::Entry::Entry(), C4GUI::ComponentAligner::ExpandBottom(), C4GUI::ComponentAligner::ExpandTop(), C4MapScriptLayer::Fill(), C4Game::FindConstuctionSiteBlock(), C4MapScriptLayer::FindPos(), C4Landscape::P::FinishChange(), C4GUI::FullscreenDialog::FullscreenDialog(), C4GUI::ComponentAligner::GetAll(), C4Object::GetArea(), C4Rect::GetBottom(), GetBottom(), C4GUI::ComponentAligner::GetCentered(), C4ScriptGuiWindow::GetClippingRect(), C4SolidMask::DensityProvider::GetDensity(), C4Object::GetEntranceArea(), C4FoWRegion::GetFragTransform(), C4FoWAmbient::GetFragTransform(), C4GUI::ComponentAligner::GetFromBottom(), C4GUI::ComponentAligner::GetFromLeft(), C4GUI::ComponentAligner::GetFromRight(), C4GUI::ComponentAligner::GetFromTop(), C4GUI::ComponentAligner::GetGridCell(), C4GUI::Element::GetHeight(), C4GUI::ComponentAligner::GetHeight(), C4GUI::ComponentAligner::GetInnerHeight(), C4GUI::WoodenLabel::GetLeftIndent(), C4GUI::Tabular::GetMarginBottom(), C4StartupPlrSelDlg::GetMarginTop(), C4StartupScenSelDlg::GetMarginTop(), C4GUI::Tabular::GetMarginTop(), C4GUI::Dialog::GetMarginTop(), C4GUI::ScrollBar::GetMaxScroll(), C4Rect::GetMiddleY(), C4Object::GetOCFForPos(), C4MapScriptLayer::GetPixCount(), C4GUI::GetScreenHgt(), C4Game::GetTextSpecImageAspect(), C4GUI::Element::GetToprightCornerRect(), GetVertexOutline(), C4GUI::ScrollBar::HasPin(), C4EditCursor::HasTransformMarker(), C4Object::Height(), C4GUI::DialogWindow::Init(), C4Command::InitEvaluation(), C4Menu::InitLocation(), C4Menu::InitSize(), C4GUI::InputDialog::InputDialog(), C4Rect::Intersect(), C4Rect::IntersectsLine(), C4FoWLightSection::Invalidate(), C4FindObjectInRect::IsImpossible(), C4GUI::ScrollWindow::IsRangeInView(), C4GUI::ScrollWindow::IsScrollingNecessary(), Jolt(), C4Command::JumpControl(), C4ParticleDef::Load(), C4StartupPlrSelDlg::PlayerListItem::Load(), C4TexRef::Lock(), C4TexRef::LockForUpdate(), C4GUI::ComponentAligner::LogIt(), C4Landscape::P::MapToLandscape(), C4GUI::MessageDialog::MessageDialog(), C4ScriptGuiWindow::MouseInput(), C4GUI::ScrollBar::MouseInput(), C4GUI::CheckBox::MouseInput(), C4MouseControl::Move(), C4Rect::Normalize(), ObjectComDrop(), C4ScriptGuiWindow::OnMouseIn(), C4StartupPlrSelDlg::OnNewBtn(), C4GUI::ScrollBar::OnPosChanged(), C4StartupPlrSelDlg::OnPropertyBtn(), C4Application::OnResolutionChanged(), C4Rect::operator!=(), ObjectAddWaypoint::operator()(), C4Rect::operator==(), C4Rect::Overlap(), C4GUI::PaintBox::PaintBox(), CStdGL::PerformMesh(), C4GUI::DialogWindow::PerformUpdate(), C4Object::Picture2Facet(), C4Game::PlaceAnimal(), C4Player::PlaceReadyBase(), C4Game::PlaceVegetation(), C4Game::PreInit(), C4ScriptGuiWindow::ProcessMouseInput(), C4GUI::ProgressDialog::ProgressDialog(), C4SolidMask::Put(), C4Command::Put(), C4SolidMask::PutTemporary(), C4ViewportList::RecalculateViewports(), C4SolidMask::Remove(), C4SolidMask::RemoveTemporary(), C4FoWRegion::Render(), C4SolidMask::Repair(), Rotate(), C4GUI::ScrollWindow::ScrollBy(), C4GUI::ListBox::ScrollItemInView(), C4GUI::ScrollWindow::ScrollPages(), C4GUI::ScrollWindow::ScrollRangeInView(), C4GUI::ScrollWindow::ScrollToBottom(), C4Rect::Set(), C4TargetRect::Set(), C4TargetFacet::Set(), C4GUI::Dialog::SetClientSize(), C4GUI::Tabular::SetGfx(), C4GoalDisplay::SetGoals(), C4Object::SetOCF(), C4GUI::TextWindow::SetPicture(), C4TargetFacet::SetRect(), C4GUI::Label::SetText(), C4MouseControl::SetTooltipRectangle(), Stretch(), C4GUI::TextWindow::TextWindow(), C4Command::Throw(), C4TexRef::Unlock(), C4FoWLightSection::Update(), C4LandscapeRenderGL::Update(), C4GUI::ScrollBar::Update(), C4GUI::ScrollWindow::Update(), CStdGL::UpdateClipper(), C4StartupPlrSelDlg::PlayerListItem::UpdateCore(), C4MouseControl::UpdateCursorTarget(), C4Menu::UpdateElementPositions(), C4GUI::ListBox::UpdateElementPositions(), C4Object::UpdateFace(), C4GraphicsOverlay::UpdateFacet(), C4FoWAmbient::UpdateFromLandscape(), C4GUI::MultilineLabel::UpdateHeight(), C4ScriptGuiWindow::UpdateLayout(), C4ScriptGuiWindow::UpdateLayoutGrid(), C4ScriptGuiWindow::UpdateLayoutTightGrid(), C4ScriptGuiWindow::UpdateLayoutVertical(), C4Landscape::P::UpdateMatCnt(), C4Object::UpdateOCF(), C4Viewport::UpdateOutputSize(), C4GUI::Window::UpdateOwnPos(), C4Landscape::P::UpdatePixCnt(), C4Menu::UpdateScrollBar(), C4GUI::TextWindow::UpdateSize(), C4GUI::Dialog::UpdateSize(), and C4Object::VerticalBounds().

int32_t C4Shape::iAttachVtx = 0

Definition at line 54 of file C4Shape.h.

Referenced by C4Object::AdjustWalkRotation(), Attach(), CompileFunc(), and C4Object::ExecAction().

int32_t C4Shape::iAttachX = 0

Definition at line 54 of file C4Shape.h.

Referenced by C4Object::AdjustWalkRotation(), Attach(), and CompileFunc().

int32_t C4Shape::iAttachY = 0

Definition at line 54 of file C4Shape.h.

Referenced by C4Object::AdjustWalkRotation(), Attach(), and CompileFunc().

int32_t C4Shape::VtxContactCNAT[C4D_MaxVertex] = { 0 }
int32_t C4Shape::VtxContactMat[C4D_MaxVertex] = { 0 }

Definition at line 53 of file C4Shape.h.

Referenced by ContactCheck(), CopyFrom(), and CreateOwnOriginalCopy().

int32_t C4Shape::VtxFriction[C4D_MaxVertex] = { 0 }

Definition at line 47 of file C4Shape.h.

Referenced by CompileFunc(), ContactVtxFriction(), CopyFrom(), and CreateOwnOriginalCopy().

int32_t C4Rect::Wdt = 0
inherited

Definition at line 30 of file C4Rect.h.

Referenced by C4Object::ActivateMenu(), C4Rect::Add(), C4GUI::ListBox::AddElement(), C4Object::AssignRemoval(), C4Object::At(), C4Landscape::BlastFreeShape(), C4MapScriptLayer::Blit(), C4Viewport::BlitOutput(), C4GameOptionButtons::C4GameOptionButtons(), C4LeagueSignupDialog::C4LeagueSignupDialog(), C4Rect::C4Rect(), C4SolidMask::C4SolidMask(), C4StartupMainDlg::C4StartupMainDlg(), C4StartupNetDlg::C4StartupNetDlg(), C4StartupNetListEntry::C4StartupNetListEntry(), C4StartupOptionsDlg::C4StartupOptionsDlg(), C4StartupPlrSelDlg::C4StartupPlrSelDlg(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4TexRef::C4TexRef(), C4GUI::ContextMenu::CheckOpenSubmenu(), C4Object::CheckSolidMaskRect(), C4TexRef::ClearRect(), C4TargetRect::ClipBy(), C4RectList::ClipByRect(), C4Rect::CompileFunc(), CompileFunc(), C4MaterialCore::CompileFunc(), ConstructionCheck(), C4Rect::Contains(), C4GUI::ContextMenu::ContextMenu(), C4Game::CreateObjectConstruction(), C4GameObjects::CrossCheck(), C4MaterialMap::CrossMapMaterials(), C4Rect::Default(), C4GUI::Dialog::Dialog(), DoBridge(), C4GUI::Element::DoContext(), C4GUI::Screen::DoContext(), C4Object::DoMovement(), C4ScoreboardDlg::DoPlacement(), C4ChatDlg::DoPlacement(), C4GameMessage::Draw(), C4DefGraphics::Draw(), C4SolidMask::Draw(), C4EditCursor::Draw(), C4Viewport::Draw(), C4MouseControl::Draw(), C4Object::Draw(), C4GraphicsOverlay::Draw(), C4ScriptGuiWindow::Draw(), C4GUI::Window::Draw(), C4GUI::FrameDecoration::Draw(), C4GUI::Dialog::Draw(), C4GUI::Element::Draw3DFrame(), C4GUI::Element::DrawBar(), C4ScriptGuiWindow::DrawChildren(), C4Landscape::DrawChunks(), C4StartupMainDlg::DrawElement(), C4MenuItem::DrawElement(), C4StartupNetListEntry::DrawElement(), C4Chart::DrawElement(), C4Menu::DrawElement(), C4GUI::WoodenLabel::DrawElement(), C4GUI::ProgressBar::DrawElement(), C4GUI::HorizontalLine::DrawElement(), C4GUI::Picture::DrawElement(), C4GUI::OverlayPicture::DrawElement(), C4GUI::GroupBox::DrawElement(), C4GUI::Button::DrawElement(), C4GUI::IconButton::DrawElement(), C4GUI::ArrowButton::DrawElement(), C4GUI::Edit::DrawElement(), C4GUI::ListBox::DrawElement(), C4GUI::Tabular::DrawElement(), C4GUI::TextWindow::DrawElement(), C4GUI::ContextMenu::Entry::DrawElement(), C4GUI::ContextMenu::DrawElement(), C4GUI::ContextButton::DrawElement(), C4GUI::ComboBox::DrawElement(), C4GUI::Dialog::DrawElement(), C4Object::DrawFace(), C4ViewportList::DrawFullscreenBackground(), C4GUI::Element::DrawHBarByVGfx(), C4EditCursor::DrawObject(), C4Object::DrawSelectMark(), C4Object::DrawTopFace(), C4Rect::Enlarge(), C4GUI::ContextMenu::Entry::Entry(), C4Object::ExecAction(), C4Object::ExecMovement(), C4Command::Exit(), C4GUI::ComponentAligner::ExpandLeft(), C4GUI::ComponentAligner::ExpandRight(), C4MapScriptLayer::Fill(), C4Game::FindConstuctionSiteBlock(), C4MapScriptLayer::FindPos(), C4Landscape::P::FinishChange(), C4GUI::FullscreenDialog::FullscreenDialog(), C4GUI::ComponentAligner::GetAll(), C4Object::GetArea(), C4GUI::ComponentAligner::GetCentered(), C4ScriptGuiWindow::GetClippingRect(), C4SolidMask::DensityProvider::GetDensity(), C4Object::GetEntranceArea(), C4FoWRegion::GetFragTransform(), C4FoWAmbient::GetFragTransform(), C4GUI::ComponentAligner::GetFromBottom(), C4GUI::ComponentAligner::GetFromLeft(), C4GUI::ComponentAligner::GetFromRight(), C4GUI::ComponentAligner::GetFromTop(), C4GUI::ComponentAligner::GetGridCell(), C4GUI::ComponentAligner::GetInnerWidth(), C4GUI::ListBox::GetItemWidth(), C4GUI::Tabular::GetMarginLeft(), C4GUI::Tabular::GetMarginRight(), C4GUI::ScrollBar::GetMaxScroll(), C4Rect::GetMiddleX(), C4Object::GetOCFForPos(), C4MapScriptLayer::GetPixCount(), C4Rect::GetRight(), C4GUI::GetScreenWdt(), C4Game::GetTextSpecImageAspect(), C4GUI::Element::GetToprightCornerRect(), GetVertexOutline(), C4GUI::Element::GetWidth(), C4GUI::ComponentAligner::GetWidth(), C4GUI::ScrollBar::HasPin(), C4EditCursor::HasTransformMarker(), C4GUI::DialogWindow::Init(), C4Menu::InitLocation(), C4GUI::InputDialog::InputDialog(), C4GUI::ListBox::InsertElement(), C4Rect::Intersect(), C4Rect::IntersectsLine(), C4FoWLightSection::Invalidate(), C4FindObjectInRect::IsImpossible(), C4ParticleDef::Load(), C4TexRef::Lock(), C4TexRef::LockForUpdate(), C4GUI::ComponentAligner::LogIt(), C4GameLobby::MainDlg::MainDlg(), C4Landscape::P::MapToLandscape(), C4GUI::MessageDialog::MessageDialog(), C4ScriptGuiWindow::MouseInput(), C4GUI::ScrollBar::MouseInput(), C4GUI::Tabular::MouseInput(), C4MouseControl::Move(), C4Command::MoveTo(), C4Rect::Normalize(), ObjectComDrop(), C4ScriptGuiWindow::OnMouseIn(), C4StartupPlrSelDlg::OnNewBtn(), C4StartupPlrSelDlg::OnPropertyBtn(), C4Application::OnResolutionChanged(), C4Rect::operator!=(), ObjectAddWaypoint::operator()(), C4Rect::operator==(), C4Rect::Overlap(), C4GUI::PaintBox::PaintBox(), CStdGL::PerformMesh(), C4GUI::DialogWindow::PerformUpdate(), C4Object::Picture2Facet(), C4Game::PlaceAnimal(), C4Player::PlaceReadyBase(), C4Player::PlaceReadyCrew(), C4Player::PlaceReadyMaterial(), C4Player::PlaceReadyVehic(), C4Game::PlaceVegetation(), C4Game::PreInit(), C4ScriptGuiWindow::ProcessMouseInput(), C4SolidMask::Put(), C4Command::Put(), C4SolidMask::PutTemporary(), C4ViewportList::RecalculateViewports(), C4SolidMask::Remove(), C4SolidMask::RemoveTemporary(), C4FoWRegion::Render(), C4SolidMask::Repair(), Rotate(), C4StartupScenSelDlg::ScenListItem::ScenListItem(), C4GUI::ScrollWindow::ScrollWindow(), C4Rect::Set(), C4TargetRect::Set(), C4TargetFacet::Set(), C4GUI::Dialog::SetClientSize(), C4GUI::Tabular::SetGfx(), C4GoalDisplay::SetGoals(), C4Object::SetOCF(), C4TargetFacet::SetRect(), C4GUI::Label::SetText(), C4GUI::Dialog::SetTitle(), C4MouseControl::SetTooltipRectangle(), C4GUI::Label::SetX0(), C4Object::SideBounds(), Stretch(), C4GUI::TextWindow::TextWindow(), C4TexRef::Unlock(), C4FoWLightSection::Update(), C4LandscapeRenderGL::Update(), C4GUI::ScrollWindow::Update(), CStdGL::UpdateClipper(), C4GUI::ListBox::UpdateColumnCount(), C4MouseControl::UpdateCursorTarget(), C4GUI::ListBox::UpdateElementPosition(), C4GUI::ListBox::UpdateElementPositions(), C4Object::UpdateFace(), C4GraphicsOverlay::UpdateFacet(), C4FoWAmbient::UpdateFromLandscape(), C4ScriptGuiWindow::UpdateLayout(), C4ScriptGuiWindow::UpdateLayoutGrid(), C4ScriptGuiWindow::UpdateLayoutTightGrid(), C4Landscape::P::UpdateMatCnt(), C4Object::UpdateOCF(), C4Viewport::UpdateOutputSize(), C4GUI::Label::UpdateOwnPos(), C4GUI::Window::UpdateOwnPos(), C4GUI::ScrollWindow::UpdateOwnPos(), C4Landscape::P::UpdatePixCnt(), C4GUI::MultilineLabel::UpdateSize(), C4GUI::TextWindow::UpdateSize(), C4GUI::Dialog::UpdateSize(), C4Object::UpdateSolidMask(), and C4Object::Width().

int32_t C4Rect::x = 0
inherited

Definition at line 30 of file C4Rect.h.

Referenced by C4Rect::Add(), C4GUI::ListBox::AddElement(), C4GUI::Window::ApplyElementOffset(), C4GUI::Dialog::ApplyElementOffset(), C4GUI::Window::ApplyInvElementOffset(), C4GUI::Dialog::ApplyInvElementOffset(), C4MapScriptLayer::Blit(), C4Viewport::BlitOutput(), C4StartupNetListEntry::C4StartupNetListEntry(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4TexRef::C4TexRef(), C4FindObjectAtPoint::Check(), C4FindObjectAtRect::Check(), C4GUI::ContextMenu::CheckOpenSubmenu(), C4Object::CheckSolidMaskRect(), C4TexRef::ClearRect(), C4GUI::Element::ClientPos2ScreenPos(), C4TargetRect::ClipBy(), C4RectList::ClipByRect(), C4Rect::CompileFunc(), CompileFunc(), C4GUI::ComponentAligner::ComponentAligner(), ContactCheck(), C4Rect::Contains(), C4MapFolderData::CreateGUIElements(), C4GameObjects::CrossCheck(), C4MaterialMap::CrossMapMaterials(), C4GUI::ContextMenu::CtxMouseInput(), C4Rect::Default(), C4GUI::Element::DoDragging(), C4ScoreboardDlg::DoPlacement(), C4ChatDlg::DoPlacement(), C4GameMessage::Draw(), C4DefGraphics::Draw(), C4SolidMask::Draw(), C4Viewport::Draw(), C4LandscapeRenderGL::Draw(), C4Object::Draw(), C4GraphicsOverlay::Draw(), C4ScriptGuiWindow::Draw(), C4GUI::Window::Draw(), C4GUI::FrameDecoration::Draw(), C4GUI::Dialog::Draw(), C4GUI::Element::Draw3DFrame(), C4GUI::Element::DrawBar(), C4ScriptGuiWindow::DrawChildren(), C4Landscape::DrawChunks(), C4ScoreboardDlg::DrawElement(), C4MenuItem::DrawElement(), C4StartupNetListEntry::DrawElement(), C4Chart::DrawElement(), C4StartupPlrPropertiesDlg::DrawElement(), C4Menu::DrawElement(), C4GUI::WoodenLabel::DrawElement(), C4GUI::MultilineLabel::DrawElement(), C4GUI::ProgressBar::DrawElement(), C4GUI::HorizontalLine::DrawElement(), C4GUI::Picture::DrawElement(), C4GUI::OverlayPicture::DrawElement(), C4GUI::ScrollBar::DrawElement(), C4GUI::GroupBox::DrawElement(), C4GUI::PaintBox::DrawElement(), C4GUI::Button::DrawElement(), C4GUI::IconButton::DrawElement(), C4GUI::ArrowButton::DrawElement(), C4GUI::Edit::DrawElement(), C4GUI::CheckBox::DrawElement(), C4GUI::ListBox::DrawElement(), C4GUI::Tabular::DrawElement(), C4GUI::TextWindow::DrawElement(), C4GUI::ContextMenu::Entry::DrawElement(), C4GUI::ContextMenu::DrawElement(), C4GUI::ContextButton::DrawElement(), C4GUI::ComboBox::DrawElement(), C4GUI::Dialog::DrawElement(), C4ViewportList::DrawFullscreenBackground(), C4GUI::Element::DrawHBarByVGfx(), C4GUI::Element::DrawHVBar(), C4EditCursor::DrawObject(), C4Object::DrawTopFace(), C4GUI::ComponentAligner::ExpandLeft(), C4MapScriptLayer::Fill(), C4Game::FindConstuctionSiteBlock(), C4MapScriptLayer::FindPos(), C4GUI::ComponentAligner::GetAll(), C4GUI::ComponentAligner::GetCentered(), C4ScriptGuiWindow::GetClippingRect(), C4GUI::Element::GetContainedClientRect(), C4SolidMask::DensityProvider::GetDensity(), C4Object::GetEntranceArea(), C4FoWRegion::GetFragTransform(), C4FoWAmbient::GetFragTransform(), C4GUI::ComponentAligner::GetFromBottom(), C4GUI::ComponentAligner::GetFromLeft(), C4GUI::ComponentAligner::GetFromRight(), C4GUI::ComponentAligner::GetFromTop(), C4GUI::ComponentAligner::GetGridCell(), C4Rect::GetLeft(), C4Object::GetOCFForPos(), C4MapScriptLayer::GetPixCount(), C4GUI::Element::GetToprightCornerRect(), GetVertexOutline(), GetX(), C4Menu::InitLocation(), C4Menu::InitSize(), C4GUI::InputDialog::InputDialog(), C4GUI::ListBox::InsertElement(), C4Rect::Intersect(), C4Rect::IntersectsLine(), C4Object::Left(), C4ParticleDef::Load(), C4TexRef::Lock(), C4TexRef::LockForUpdate(), C4GUI::ComponentAligner::LogIt(), C4Landscape::P::MapToLandscape(), C4GUI::MessageDialog::MessageDialog(), C4ScriptGuiWindow::MouseInput(), C4GUI::Window::MouseInput(), C4GUI::ContextMenu::MouseInput(), C4GUI::Screen::MouseInput(), C4MouseControl::Move(), ObjectComDrop(), C4ScriptGuiWindow::OnMouseIn(), C4GUI::ContextMenu::Open(), C4Rect::operator!=(), C4Rect::operator==(), C4Rect::Overlap(), CStdGL::PerformMesh(), C4Object::Picture2Facet(), C4ScriptGuiWindow::ProcessMouseInput(), C4SolidMask::Put(), C4Command::Put(), C4SolidMask::PutTemporary(), C4ViewportList::RecalculateViewports(), C4SolidMask::Remove(), C4SolidMask::RemoveTemporary(), C4FoWRegion::Render(), C4SolidMask::Repair(), Rotate(), C4StartupScenSelDlg::ScenListItem::ScenListItem(), C4GUI::Element::ScreenPos2ClientPos(), C4GUI::ScrollWindow::ScrollWindow(), C4Rect::Set(), C4TargetRect::Set(), C4TargetFacet::Set(), C4GUI::Dialog::SetClientSize(), C4GUI::Tabular::SetGfx(), C4TexRef::SetPix(), C4GUI::Window::SetPos(), C4TargetFacet::SetRect(), C4MouseControl::SetTooltipRectangle(), C4GUI::Label::SetX0(), C4GUI::Screen::ShowDialog(), Stretch(), C4GUI::TextWindow::TextWindow(), C4TexRef::Unlock(), C4ScoreboardDlg::Update(), C4FoWLightSection::Update(), C4LandscapeRenderGL::Update(), C4GUI::ScrollWindow::Update(), CStdGL::UpdateClipper(), C4MouseControl::UpdateCursorTarget(), C4GUI::ListBox::UpdateElementPosition(), C4Menu::UpdateElementPositions(), C4GUI::ListBox::UpdateElementPositions(), C4Object::UpdateFace(), C4GraphicsOverlay::UpdateFacet(), C4FoWAmbient::UpdateFromLandscape(), C4ScriptGuiWindow::UpdateLayout(), C4ScriptGuiWindow::UpdateLayoutGrid(), C4ScriptGuiWindow::UpdateLayoutTightGrid(), C4Landscape::P::UpdateMatCnt(), C4Viewport::UpdateOutputSize(), C4GUI::Label::UpdateOwnPos(), C4GUI::Window::UpdateOwnPos(), C4GUI::ScrollWindow::UpdateOwnPos(), C4Landscape::P::UpdatePixCnt(), C4GUI::Dialog::UpdatePos(), and C4GUI::TextWindow::UpdateSize().

int32_t C4Rect::y = 0
inherited

Definition at line 30 of file C4Rect.h.

Referenced by C4Rect::Add(), C4GUI::ListBox::AddElement(), C4Menu::AdjustPosition(), C4GUI::Window::ApplyElementOffset(), C4GUI::Window::ApplyInvElementOffset(), C4MapScriptLayer::Blit(), C4Viewport::BlitOutput(), C4Rect::C4Rect(), C4StartupNetListEntry::C4StartupNetListEntry(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4TexRef::C4TexRef(), C4FindObjectAtPoint::Check(), C4FindObjectAtRect::Check(), C4GUI::ContextMenu::CheckOpenSubmenu(), C4Object::CheckSolidMaskRect(), C4TexRef::ClearRect(), C4GUI::Element::ClientPos2ScreenPos(), C4TargetRect::ClipBy(), C4RectList::ClipByRect(), C4Rect::CompileFunc(), C4GUI::ComponentAligner::ComponentAligner(), ContactCheck(), C4Rect::Contains(), C4MapFolderData::CreateGUIElements(), C4GameObjects::CrossCheck(), C4MaterialMap::CrossMapMaterials(), C4GUI::ContextMenu::CtxMouseInput(), C4Rect::Default(), C4GUI::Element::DoDragging(), C4ScoreboardDlg::DoPlacement(), C4ChatDlg::DoPlacement(), C4GameMessage::Draw(), C4DefGraphics::Draw(), C4SolidMask::Draw(), C4EditCursor::Draw(), C4Viewport::Draw(), C4LandscapeRenderGL::Draw(), C4Object::Draw(), C4GraphicsOverlay::Draw(), C4ScriptGuiWindow::Draw(), C4GUI::Window::Draw(), C4GUI::FrameDecoration::Draw(), C4GUI::Dialog::Draw(), C4GUI::Element::Draw3DFrame(), C4GUI::Element::DrawBar(), C4ScriptGuiWindow::DrawChildren(), C4Landscape::DrawChunks(), C4ScoreboardDlg::DrawElement(), C4MenuItem::DrawElement(), C4StartupNetListEntry::DrawElement(), C4Chart::DrawElement(), C4StartupPlrPropertiesDlg::DrawElement(), C4Menu::DrawElement(), C4GUI::Label::DrawElement(), C4GUI::WoodenLabel::DrawElement(), C4GUI::MultilineLabel::DrawElement(), C4GUI::ProgressBar::DrawElement(), C4GUI::HorizontalLine::DrawElement(), C4GUI::Picture::DrawElement(), C4GUI::OverlayPicture::DrawElement(), C4GUI::ScrollBar::DrawElement(), C4GUI::GroupBox::DrawElement(), C4GUI::PaintBox::DrawElement(), C4GUI::Button::DrawElement(), C4GUI::IconButton::DrawElement(), C4GUI::ArrowButton::DrawElement(), C4GUI::Edit::DrawElement(), C4GUI::CheckBox::DrawElement(), C4GUI::ListBox::DrawElement(), C4GUI::Tabular::DrawElement(), C4GUI::TextWindow::DrawElement(), C4GUI::ContextMenu::Entry::DrawElement(), C4GUI::ContextMenu::DrawElement(), C4GUI::ContextButton::DrawElement(), C4GUI::ComboBox::DrawElement(), C4GUI::Dialog::DrawElement(), C4ViewportList::DrawFullscreenBackground(), C4GUI::Element::DrawHBarByVGfx(), C4GUI::Element::DrawHVBar(), C4EditCursor::DrawObject(), C4Object::DrawTopFace(), C4GUI::TextWindow::ElementPosChanged(), C4GUI::TextWindow::ElementSizeChanged(), C4Rect::Enlarge(), C4Command::Exit(), C4GUI::ComponentAligner::ExpandTop(), C4MapScriptLayer::Fill(), C4Game::FindConstuctionSiteBlock(), C4MapScriptLayer::FindPos(), C4GUI::ComponentAligner::GetAll(), C4Rect::GetBottom(), GetBottom(), C4GUI::ComponentAligner::GetCentered(), C4ScriptGuiWindow::GetClippingRect(), C4GUI::Element::GetContainedClientRect(), C4SolidMask::DensityProvider::GetDensity(), C4Object::GetEntranceArea(), C4FoWRegion::GetFragTransform(), C4FoWAmbient::GetFragTransform(), C4GUI::ComponentAligner::GetFromBottom(), C4GUI::ComponentAligner::GetFromLeft(), C4GUI::ComponentAligner::GetFromRight(), C4GUI::ComponentAligner::GetFromTop(), C4GUI::ComponentAligner::GetGridCell(), C4Rect::GetMiddleY(), C4Object::GetOCFForPos(), C4MapScriptLayer::GetPixCount(), C4Rect::GetTop(), C4GUI::Element::GetToprightCornerRect(), GetVertexOutline(), GetY(), C4EditCursor::HasTransformMarker(), C4Menu::InitLocation(), C4Menu::InitSize(), C4Rect::Intersect(), C4Rect::IntersectsLine(), C4FoWLightSection::Invalidate(), Jolt(), C4GUI::Label::Label(), C4ParticleDef::Load(), C4TexRef::Lock(), C4TexRef::LockForUpdate(), C4GUI::ComponentAligner::LogIt(), C4Landscape::P::MapToLandscape(), C4ScriptGuiWindow::MouseInput(), C4GUI::Window::MouseInput(), C4GUI::ContextMenu::MouseInput(), C4GUI::Screen::MouseInput(), C4MouseControl::Move(), C4Rect::Normalize(), ObjectActionThrow(), ObjectComDrop(), C4ScriptGuiWindow::OnMouseIn(), C4GUI::ContextMenu::Open(), C4Rect::operator!=(), C4Rect::operator==(), C4Rect::Overlap(), CStdGL::PerformMesh(), C4Object::Picture2Facet(), C4ScriptGuiWindow::ProcessMouseInput(), C4SolidMask::Put(), C4Command::Put(), C4SolidMask::PutTemporary(), C4ViewportList::RecalculateViewports(), C4SolidMask::Remove(), C4SolidMask::RemoveTemporary(), C4FoWRegion::Render(), C4SolidMask::Repair(), Rotate(), C4GUI::Element::ScreenPos2ClientPos(), C4GUI::ListBox::ScrollItemInView(), C4GUI::ScrollWindow::ScrollWindow(), C4Rect::Set(), C4TargetRect::Set(), C4TargetFacet::Set(), C4GUI::Dialog::SetClientSize(), C4GUI::Tabular::SetGfx(), C4GUI::TextWindow::SetPicture(), C4TexRef::SetPix(), C4GUI::Window::SetPos(), C4TargetFacet::SetRect(), C4GUI::ScrollWindow::SetScroll(), C4MouseControl::SetTooltipRectangle(), C4GUI::Screen::ShowDialog(), Stretch(), C4GUI::TextWindow::TextWindow(), C4Object::Top(), C4TexRef::Unlock(), C4ScoreboardDlg::Update(), C4FoWLightSection::Update(), C4LandscapeRenderGL::Update(), C4GUI::ScrollWindow::Update(), CStdGL::UpdateClipper(), C4MouseControl::UpdateCursorTarget(), C4Menu::UpdateElementPositions(), C4GUI::ListBox::UpdateElementPositions(), C4Object::UpdateFace(), C4GraphicsOverlay::UpdateFacet(), C4FoWAmbient::UpdateFromLandscape(), C4ScriptGuiWindow::UpdateLayout(), C4ScriptGuiWindow::UpdateLayoutGrid(), C4ScriptGuiWindow::UpdateLayoutTightGrid(), C4ScriptGuiWindow::UpdateLayoutVertical(), C4Landscape::P::UpdateMatCnt(), C4Viewport::UpdateOutputSize(), C4GUI::Window::UpdateOwnPos(), C4GUI::ScrollWindow::UpdateOwnPos(), C4Landscape::P::UpdatePixCnt(), C4GUI::Dialog::UpdatePos(), C4Menu::UpdateScrollBar(), and C4GUI::TextWindow::UpdateSize().


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