OpenClonk
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 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

◆ Add()

void C4Rect::Add ( const C4Rect r2)
inherited

Definition at line 144 of file C4Rect.cpp.

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 y
Definition: C4Rect.h:30
int32_t Hgt
Definition: C4Rect.h:30
int32_t Wdt
Definition: C4Rect.h:30
int32_t x
Definition: C4Rect.h:30

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

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

Here is the caller graph for this function:

◆ AddVertex()

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

Definition at line 28 of file C4Shape.cpp.

29 {
30  if (VtxNum >= C4D_MaxVertex)
31  {
32  return false;
33  }
34  VtxX[VtxNum] = iX;
35  VtxY[VtxNum] = iY;
36  VtxNum++;
37  return true;
38 }
const int C4D_MaxVertex
Definition: C4Constants.h:55
int32_t VtxNum
Definition: C4Shape.h:42
int32_t VtxY[C4D_MaxVertex]
Definition: C4Shape.h:44
int32_t VtxX[C4D_MaxVertex]
Definition: C4Shape.h:43

References C4D_MaxVertex, VtxNum, VtxX, and VtxY.

◆ Attach()

bool C4Shape::Attach ( int32_t &  cx,
int32_t &  cy,
BYTE  cnat_pos 
)

Definition at line 215 of file C4Shape.cpp.

216 {
217  // Reset attached material
218  AttachMat = MNone;
219  int xcd = 0;
220  int ycd = 0;
221  // Determine attachment direction
222  switch (cnat_pos & (~CNAT_Flags))
223  {
224  case CNAT_Top:
225  ycd = -1;
226  break;
227  case CNAT_Bottom:
228  ycd = +1;
229  break;
230  case CNAT_Left:
231  xcd = -1;
232  break;
233  case CNAT_Right:
234  xcd = +1;
235  break;
236  default:
237  return false;
238  }
239  int testx = cx;
240  int testy = cy;
241  bool increase_distance = true;
242  bool any_contact = false;
243 
244  // Find the nearest position that has at least one vertex adjacent to dense material
245  // and no vertices in dense materials
246  while (Abs(testx - cx) < AttachRange && Abs(testy - cy) < AttachRange)
247  {
248  bool found = false;
249  for (int i = 0; i < VtxNum; ++i)
250  {
251  if (VtxCNAT[i] & cnat_pos)
252  {
253  // Get new vertex pos
254  int32_t ax = testx + VtxX[i];
255  int32_t ay = testy + VtxY[i];
256  if (CheckTouchableMaterial(ax, ay, i))
257  {
258  found = false;
259  break;
260  }
261  // Can attach here?
262  if (CheckTouchableMaterial(ax + xcd, ay + ycd, i, ycd))
263  {
264  found = true;
265  any_contact = true;
266  // Store attachment material
267  AttachMat = GBackMat(ax + xcd, ay + ycd);
268  // Store absolute attachment position
269  iAttachX = ax + xcd;
270  iAttachY = ay + ycd;
271  iAttachVtx = i;
272  }
273  }
274  }
275  if (found)
276  {
277  cx = testx;
278  cy = testy;
279  return true;
280  }
281  // Try positions in order of distance from the origin,
282  // and alternating the direction
283  testx = cx - (testx - cx);
284  testy = cy - (testy - cy);
285  if (increase_distance)
286  {
287  testx += xcd;
288  testy += ycd;
289  }
290  increase_distance = !increase_distance;
291  }
292  return any_contact;
293 }
const BYTE CNAT_Bottom
Definition: C4Constants.h:112
const int32_t MNone
Definition: C4Constants.h:177
const BYTE CNAT_Right
Definition: C4Constants.h:110
const BYTE CNAT_Top
Definition: C4Constants.h:111
const BYTE CNAT_Flags
Definition: C4Constants.h:119
const BYTE CNAT_Left
Definition: C4Constants.h:109
int32_t GBackMat(int32_t x, int32_t y)
Definition: C4Landscape.h:219
const int AttachRange
Definition: C4Physics.h:24
T Abs(T val)
Definition: Standard.h:42
int32_t AttachMat
Definition: C4Shape.h:50
int32_t VtxCNAT[C4D_MaxVertex]
Definition: C4Shape.h:45
int32_t iAttachY
Definition: C4Shape.h:53
int32_t iAttachX
Definition: C4Shape.h:53
int32_t iAttachVtx
Definition: C4Shape.h:53

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckContact()

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

Definition at line 413 of file C4Shape.cpp.

414 {
415  // Check all vertices at given object position.
416  // Return true on any contact.
417 
418  for (int32_t i = 0; i < VtxNum; i++)
419  {
420  if (!(VtxCNAT[i] & CNAT_NoCollision))
421  {
422  if (CheckTouchableMaterial(at_x + VtxX[i], at_y + VtxY[i], i))
423  {
424  return true;
425  }
426  }
427  }
428 
429  return false;
430 }
const BYTE CNAT_NoCollision
Definition: C4Constants.h:116

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

◆ CheckScaleToWalk()

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

Definition at line 482 of file C4Shape.cpp.

483 {
484  for (int32_t i = 0; i < VtxNum; i++)
485  {
486  if (VtxCNAT[i] & CNAT_NoCollision)
487  {
488  continue;
489  }
490  if (VtxCNAT[i] & CNAT_Bottom)
491  {
492  // No ground under the feet?
493  if (CheckTouchableMaterial(x + VtxX[i], y + VtxY[i] + 1, i))
494  {
495  return false;
496  }
497  }
498  else
499  {
500  // Can climb with hands?
501  if (CheckTouchableMaterial(x + VtxX[i] - 1, y + VtxY[i], i))
502  {
503  return false;
504  }
505  if (CheckTouchableMaterial(x + VtxX[i] + 1, y + VtxY[i], i))
506  {
507  return false;
508  }
509  }
510  }
511  return true;
512 }

References CNAT_Bottom, CNAT_NoCollision, VtxCNAT, VtxNum, VtxX, VtxY, C4Rect::x, and C4Rect::y.

◆ CompileFunc() [1/2]

void C4Rect::CompileFunc ( StdCompiler pComp)
inherited

Definition at line 31 of file C4Rect.cpp.

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 }
StdDefaultAdapt< T, D > mkDefaultAdapt(T &&rValue, const D &rDefault)
Definition: StdAdaptors.h:64
virtual bool Separator(Sep eSep=SEP_SEP)
Definition: StdCompiler.h:119
void Value(const T &rStruct)
Definition: StdCompiler.h:161

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

Referenced by C4TargetRect::CompileFunc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CompileFunc() [2/2]

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

Definition at line 649 of file C4Shape.cpp.

650 {
651  const StdBitfieldEntry<int32_t> ContactDirections[] =
652  {
653 
654  { "CNAT_None", CNAT_None },
655  { "CNAT_Left", CNAT_Left },
656  { "CNAT_Right", CNAT_Right },
657  { "CNAT_Top", CNAT_Top },
658  { "CNAT_Bottom", CNAT_Bottom },
659  { "CNAT_Center", CNAT_Center },
660  { "CNAT_MultiAttach", CNAT_MultiAttach },
661  { "CNAT_NoCollision", CNAT_NoCollision },
662  { "CNAT_PhaseHalfVehicle", CNAT_PhaseHalfVehicle },
663 
664  { nullptr, 0 }
665  };
666 
667  // A default shape is given in object compilation context only
668  bool fRuntime = !!default_shape;
669  C4Shape default_def_shape;
670  if (!default_shape)
671  {
672  default_shape = &default_def_shape;
673  }
674  // Note: Compiled directly into "Object" and "DefCore"-categories, so beware of name clashes
675  // (see C4Object::CompileFunc and C4Def::CompileFunc)
676  pComp->Value(mkNamingAdapt( Wdt, "Width", default_shape->Wdt));
677  pComp->Value(mkNamingAdapt( Hgt, "Height", default_shape->Hgt));
678  pComp->Value(mkNamingAdapt( mkArrayAdaptDefArr(&x,2,&default_shape->x), "Offset", &default_shape->x));
679  pComp->Value(mkNamingAdapt( VtxNum, "Vertices", default_shape->VtxNum));
680  pComp->Value(mkNamingAdapt( mkArrayAdaptDMA(VtxX, default_shape->VtxX), "VertexX", default_shape->VtxX));
681  pComp->Value(mkNamingAdapt( mkArrayAdaptDMA(VtxY, default_shape->VtxY), "VertexY", default_shape->VtxY));
682  pComp->Value(mkNamingAdapt( mkArrayAdaptDMAM(VtxCNAT, default_shape->VtxCNAT, [&](decltype(*VtxCNAT) &elem){ return mkBitfieldAdapt<int32_t>(elem, ContactDirections); }), "VertexCNAT", default_shape->VtxCNAT));
683  pComp->Value(mkNamingAdapt( mkArrayAdaptDMA(VtxFriction, default_shape->VtxFriction), "VertexFriction", default_shape->VtxFriction));
684  pComp->Value(mkNamingAdapt( ContactDensity, "ContactDensity", default_shape->ContactDensity));
685  if (fRuntime)
686  {
687  pComp->Value(mkNamingAdapt( iAttachX, "AttachX", 0 ));
688  pComp->Value(mkNamingAdapt( iAttachY, "AttachY", 0 ));
689  pComp->Value(mkNamingAdapt( iAttachVtx, "AttachVtx", 0 ));
690  }
691 }
const BYTE CNAT_Center
Definition: C4Constants.h:113
const BYTE CNAT_PhaseHalfVehicle
Definition: C4Constants.h:117
const BYTE CNAT_MultiAttach
Definition: C4Constants.h:115
const BYTE CNAT_None
Definition: C4Constants.h:108
StdArrayDefaultArrayAdapt< T, D > mkArrayAdaptDMA(T(&array)[size], const D &rDefault)
Definition: StdAdaptors.h:446
StdArrayDefaultArrayAdapt< T, D, M > mkArrayAdaptDMAM(T(&array)[size], const D &rDefault, const M &map)
Definition: StdAdaptors.h:450
StdArrayDefaultArrayAdapt< T, D > mkArrayAdaptDefArr(T *pArray, size_t iSize, const D &rDefault)
Definition: StdAdaptors.h:444
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:92
Definition: StdAdaptors.h:883
int32_t ContactDensity
Definition: C4Shape.h:47
int32_t VtxFriction[C4D_MaxVertex]
Definition: C4Shape.h:46

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

Here is the call graph for this function:

◆ ContactCheck()

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

Definition at line 432 of file C4Shape.cpp.

433 {
434  // Check all vertices at given object position.
435  // Set ContactCNAT and ContactCount.
436  // Set VtxContactCNAT and VtxContactMat.
437  // Return true on any contact.
438 
440  ContactCount = 0;
441 
442  for (int32_t vertex = 0; vertex < VtxNum; vertex++)
443  {
444  // Ignore vertex if collision has been flagged out
445  if (!(VtxCNAT[vertex] & CNAT_NoCollision))
446  {
447  VtxContactCNAT[vertex] = CNAT_None;
448  int32_t x = at_x + VtxX[vertex];
449  int32_t y = at_y + VtxY[vertex];
450  VtxContactMat[vertex] = GBackMat(x, y);
451 
452  if (CheckTouchableMaterial(x, y, vertex, collide_halfvehic? 1:0))
453  {
454  ContactCNAT |= VtxCNAT[vertex];
455  VtxContactCNAT[vertex] |= CNAT_Center;
456  ContactCount++;
457  // Vertex center contact, now check top, bottom, left, right
458  // Not using our style guideline here, is more readable in "table" format
459  if (CheckTouchableMaterial(x, y - 1, vertex, collide_halfvehic ? 1 : 0)) VtxContactCNAT[vertex] |= CNAT_Top;
460  if (CheckTouchableMaterial(x, y + 1, vertex, collide_halfvehic ? 1 : 0)) VtxContactCNAT[vertex] |= CNAT_Bottom;
461  if (CheckTouchableMaterial(x - 1, y, vertex, collide_halfvehic ? 1 : 0)) VtxContactCNAT[vertex] |= CNAT_Left;
462  if (CheckTouchableMaterial(x + 1, y, vertex, collide_halfvehic ? 1 : 0)) VtxContactCNAT[vertex] |= CNAT_Right;
463  }
464  if (border_hack_contacts)
465  {
466  if (x == 0 && CheckTouchableMaterial(x - 1, y, vertex))
467  {
468  *border_hack_contacts |= CNAT_Left;
469  }
470  else if (x == ::Landscape.GetWidth() && CheckTouchableMaterial(x + 1, y, vertex))
471  {
472  *border_hack_contacts |= CNAT_Right;
473  }
474  }
475  }
476  }
477 
478 
479  return !!ContactCount;
480 }
C4Landscape Landscape
int32_t GetWidth() const
int32_t VtxContactMat[C4D_MaxVertex]
Definition: C4Shape.h:52
int32_t VtxContactCNAT[C4D_MaxVertex]
Definition: C4Shape.h:51
int32_t ContactCNAT
Definition: C4Shape.h:48
int32_t ContactCount
Definition: C4Shape.h:49

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Contains() [1/3]

bool C4Rect::Contains ( const C4Rect rect) const
inlineinherited

Definition at line 44 of file C4Rect.h.

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

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

Here is the call graph for this function:

◆ Contains() [2/3]

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

Definition at line 40 of file C4Rect.h.

41  { return iX>=x && iX<x+Wdt && iY>=y && iY<y+Hgt; }

References C4Rect::Hgt, C4Rect::x, 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().

Here is the caller graph for this function:

◆ Contains() [3/3]

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.

43  { return iX>=x && iX+iWdt<x+Wdt && iY>=y && iY+iHgt<y+Hgt; }

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

◆ CopyFrom()

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

Definition at line 532 of file C4Shape.cpp.

533 {
534  if (copy_vertices)
535  {
536  // Truncate / copy vertex count
537  VtxNum = (copy_vertices_from_self ? std::min<int32_t>(VtxNum, C4D_VertexCpyPos) : source.VtxNum);
538 
539  // Restore vertices from back of own buffer (retaining count)
540  int32_t iCopyPos = (copy_vertices_from_self ? C4D_VertexCpyPos : 0);
541  C4Shape &vertices_from = (copy_vertices_from_self ? *this : source);
542 
543  memcpy(VtxX, vertices_from.VtxX + iCopyPos, VtxNum * sizeof(*VtxX));
544  memcpy(VtxY, vertices_from.VtxY + iCopyPos, VtxNum * sizeof(*VtxY));
545  memcpy(VtxCNAT, vertices_from.VtxCNAT + iCopyPos, VtxNum * sizeof(*VtxCNAT));
546  memcpy(VtxFriction, vertices_from.VtxFriction + iCopyPos, VtxNum * sizeof(*VtxFriction));
547  memcpy(VtxContactCNAT, vertices_from.VtxContactCNAT + iCopyPos, VtxNum * sizeof(*VtxContactCNAT));
548  memcpy(VtxContactMat, vertices_from.VtxContactMat + iCopyPos, VtxNum * sizeof(*VtxContactMat));
549  }
550 
551  // Copies other members
552  *((C4Rect *) this) = source;
553  AttachMat = source.AttachMat;
554  ContactCNAT = source.ContactCNAT;
555  ContactCount = source.ContactCount;
556 }
#define C4D_VertexCpyPos
Definition: C4Rect.h:23
Definition: C4Rect.h:28

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

Referenced by C4Object::UpdateShape().

Here is the caller graph for this function:

◆ CreateOwnOriginalCopy()

void C4Shape::CreateOwnOriginalCopy ( C4Shape rFrom)

Definition at line 637 of file C4Shape.cpp.

638 {
639  // Copy vertices from original buffer, including count
640  VtxNum = std::min<int32_t>(source.VtxNum, C4D_VertexCpyPos);
641  memcpy(VtxX + C4D_VertexCpyPos, source.VtxX, VtxNum * sizeof(*VtxX));
642  memcpy(VtxY + C4D_VertexCpyPos, source.VtxY, VtxNum * sizeof(*VtxY));
643  memcpy(VtxCNAT + C4D_VertexCpyPos, source.VtxCNAT, VtxNum * sizeof(*VtxCNAT));
644  memcpy(VtxFriction + C4D_VertexCpyPos, source.VtxFriction, VtxNum * sizeof(*VtxFriction));
645  memcpy(VtxContactCNAT + C4D_VertexCpyPos, source.VtxContactCNAT, VtxNum * sizeof(*VtxContactCNAT));
646  memcpy(VtxContactMat + C4D_VertexCpyPos, source.VtxContactMat, VtxNum * sizeof(*VtxContactMat));
647 }

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

◆ Default()

void C4Shape::Default ( )

Definition at line 40 of file C4Shape.cpp.

41 {
42  InplaceReconstruct(this);
43 }
std::enable_if< std::is_nothrow_default_constructible< T >::value >::type InplaceReconstruct(T *obj)
Definition: Standard.h:35

References InplaceReconstruct().

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Enlarge() [1/2]

void C4Rect::Enlarge ( int32_t  iBy)
inlineinherited

Definition at line 53 of file C4Rect.h.

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

References C4Rect::Enlarge().

Here is the call graph for this function:

◆ Enlarge() [2/2]

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

Definition at line 51 of file C4Rect.h.

52  { x -= iByX; y -= iByY; Wdt += 2*iByX; Hgt += 2*iByY; }

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

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

Here is the caller graph for this function:

◆ GetBottom() [1/2]

int C4Shape::GetBottom ( )

Definition at line 575 of file C4Shape.cpp.

576 {
577  int b = INT_MIN;
578  for (int32_t i = 0; i < VtxNum; i++)
579  {
580  if (~VtxCNAT[i] & CNAT_NoCollision)
581  {
582  if (VtxY[i] > b)
583  {
584  b = VtxY[i];
585  }
586  }
587  }
588  if (b == INT_MIN)
589  {
590  return y + Hgt;
591  }
592  return b;
593 }
#define b

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

Referenced by C4Object::DoCon().

Here is the caller graph for this function:

◆ GetBottom() [2/2]

int32_t C4Rect::GetBottom ( ) const
inlineinherited

Definition at line 58 of file C4Rect.h.

58 { return y + Hgt; }

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

Referenced by C4FoWLightSection::Update().

Here is the caller graph for this function:

◆ GetBottomVertex()

int32_t C4Shape::GetBottomVertex ( )

Definition at line 558 of file C4Shape.cpp.

559 {
560  // Return bottom-most vertex
561  int32_t iMax = -1;
562  for (int32_t i = 0; i < VtxNum; i++)
563  {
564  if (VtxCNAT[i] & CNAT_Bottom)
565  {
566  if (iMax == -1 || VtxY[i] < VtxY[iMax])
567  {
568  iMax = i;
569  }
570  }
571  }
572  return iMax;
573 }

References CNAT_Bottom, VtxCNAT, VtxNum, and VtxY.

Referenced by ObjectComJump().

Here is the caller graph for this function:

◆ GetLeft()

int32_t C4Rect::GetLeft ( ) const
inlineinherited

Definition at line 60 of file C4Rect.h.

60 { return x; }

References C4Rect::x.

◆ GetMiddleX()

int32_t C4Rect::GetMiddleX ( ) const
inlineinherited

Definition at line 56 of file C4Rect.h.

56 { return x+Wdt/2; }

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

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

Here is the caller graph for this function:

◆ GetMiddleY()

int32_t C4Rect::GetMiddleY ( ) const
inlineinherited

Definition at line 57 of file C4Rect.h.

57 { return y + Hgt / 2; }

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

Referenced by C4StartupScenSelDlg::C4StartupScenSelDlg(), and C4GUI::ComponentAligner::GetCentered().

Here is the caller graph for this function:

◆ GetRight()

int32_t C4Rect::GetRight ( ) const
inlineinherited

Definition at line 61 of file C4Rect.h.

61 { return x + Wdt; }

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

◆ GetTop()

int32_t C4Rect::GetTop ( ) const
inlineinherited

Definition at line 59 of file C4Rect.h.

59 { return y; }

References C4Rect::y.

◆ GetVertexContact()

int32_t C4Shape::GetVertexContact ( int32_t  iVtx,
DWORD  dwCheckMask,
int32_t  tx,
int32_t  ty,
const C4DensityProvider rDensityProvider = DefaultDensityProvider 
)

Definition at line 603 of file C4Shape.cpp.

604 {
605  int32_t contact_bits = 0;
606 
607  // Range check
608  if (!Inside<int32_t>(iVertex, 0, VtxNum - 1))
609  {
610  return contact_bits;
611  }
612 
613  // Default check mask
614  if (!dwCheckMask)
615  {
616  dwCheckMask = VtxCNAT[iVertex];
617  }
618 
619  // Check vertex positions
620  tx += VtxX[iVertex];
621  ty += VtxY[iVertex];
622 
623  // Check all directions for solid material
624  if (~VtxCNAT[iVertex] & CNAT_NoCollision)
625  {
626  // Not using our style guideline here, is more readable in "table" format
627  if (dwCheckMask & CNAT_Center) if (CheckTouchableMaterial(tx, ty , iVertex, 0, rDensityProvider)) contact_bits |= CNAT_Center;
628  if (dwCheckMask & CNAT_Left) if (CheckTouchableMaterial(tx-1, ty, iVertex, 0, rDensityProvider)) contact_bits |= CNAT_Left;
629  if (dwCheckMask & CNAT_Right) if (CheckTouchableMaterial(tx+1, ty, iVertex, 0, rDensityProvider)) contact_bits |= CNAT_Right;
630  if (dwCheckMask & CNAT_Top) if (CheckTouchableMaterial(tx, ty-1, iVertex, 0, rDensityProvider)) contact_bits |= CNAT_Top;
631  if (dwCheckMask & CNAT_Bottom) if (CheckTouchableMaterial(tx, ty+1, iVertex, 1, rDensityProvider)) contact_bits |= CNAT_Bottom;
632  }
633  // Return resulting bitmask
634  return contact_bits;
635 }

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

◆ GetVertexOutline()

void C4Shape::GetVertexOutline ( C4Rect rRect)

Definition at line 171 of file C4Shape.cpp.

172 {
173  rRect.x = 0;
174  rRect.y = 0;
175  rRect.Wdt = 0;
176  rRect.Hgt = 0;
177  for (int32_t i = 0; i < VtxNum; i++)
178  {
179  // Extend left
180  if (VtxX[i] < rRect.x)
181  {
182  rRect.Wdt += rRect.x - VtxX[i];
183  rRect.x = VtxX[i];
184  }
185  // Extend right
186  else if (VtxX[i] > rRect.x + rRect.Wdt)
187  {
188  rRect.Wdt = VtxX[i] - rRect.x;
189  }
190  // Extend up
191  if (VtxY[i] < rRect.y)
192  {
193  rRect.Hgt += rRect.y - VtxY[i];
194  rRect.y = VtxY[i];
195  }
196  // Extend down
197  else if (VtxY[i] > rRect.y + rRect.Hgt)
198  {
199  rRect.Hgt = VtxY[i] - rRect.y;
200  }
201  }
202 
203  rRect.Hgt += rRect.y - y;
204  rRect.y = y;
205 }

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

◆ GetVertexX()

int32_t C4Shape::GetVertexX ( int32_t  iVertex)

Definition at line 514 of file C4Shape.cpp.

515 {
516  if (!Inside<int32_t>(iVertex, 0, VtxNum - 1))
517  {
518  return 0;
519  }
520  return VtxX[iVertex];
521 }

References VtxNum, and VtxX.

Referenced by ObjectComJump().

Here is the caller graph for this function:

◆ GetVertexY()

int32_t C4Shape::GetVertexY ( int32_t  iVertex)

Definition at line 523 of file C4Shape.cpp.

524 {
525  if (!Inside<int32_t>(iVertex, 0, VtxNum - 1))
526  {
527  return 0;
528  }
529  return VtxY[iVertex];
530 }

References VtxNum, and VtxY.

Referenced by ObjectComJump().

Here is the caller graph for this function:

◆ GetX()

int32_t C4Shape::GetX ( ) const
inline

Definition at line 62 of file C4Shape.h.

62 { return x; }

References C4Rect::x.

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

Here is the caller graph for this function:

◆ GetY()

int32_t C4Shape::GetY ( ) const
inline

Definition at line 63 of file C4Shape.h.

63 { return y; }

References C4Rect::y.

Referenced by C4Object::At(), C4Command::Dig(), 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().

Here is the caller graph for this function:

◆ InsertVertex()

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

Definition at line 376 of file C4Shape.cpp.

377 {
378  if (VtxNum + 1 > C4D_MaxVertex)
379  {
380  return false;
381  }
382  if (!Inside<int32_t>(index_position, 0, VtxNum))
383  {
384  return false;
385  }
386  // Insert vertex before iPos
387  for (int32_t i = VtxNum; i > index_position; i--)
388  {
389  VtxX[i] = VtxX[i - 1];
390  VtxY[i] = VtxY[i - 1];
391  }
392  VtxX[index_position] = tx;
393  VtxY[index_position] = ty;
394  VtxNum++;
395  return true;
396 }

References C4D_MaxVertex, VtxNum, VtxX, and VtxY.

Referenced by LineConnect().

Here is the caller graph for this function:

◆ Intersect()

void C4Rect::Intersect ( const C4Rect r2)
inherited

Definition at line 100 of file C4Rect.cpp.

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 }

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().

Here is the caller graph for this function:

◆ IntersectsLine()

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

Definition at line 122 of file C4Rect.cpp.

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 }

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

Referenced by C4FindObjectOnLine::Check().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Jolt()

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

Definition at line 158 of file C4Shape.cpp.

159 {
160  y = ScaledByCon(y, iCon);
161  Hgt = ScaledByCon(Hgt, iCon);
162  if (update_vertices)
163  {
164  for (int32_t i = 0; i < VtxNum; i++)
165  {
166  VtxY[i] = ScaledByCon(VtxY[i], iCon);
167  }
168  }
169 }

References C4Rect::y.

Referenced by C4Object::UpdateShape().

Here is the caller graph for this function:

◆ LineConnect()

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

Definition at line 295 of file C4Shape.cpp.

296 {
297  // Lines require at least 2 vertices
298  if (VtxNum < 2)
299  {
300  return false;
301  }
302 
303  // No modification
304  if ((VtxX[cvtx] == tx) && (VtxY[cvtx] == ty))
305  {
306  return true;
307  }
308 
309  // Check new path
310  int32_t ix;
311  int32_t iy;
312  if (PathFree(tx, ty, VtxX[cvtx + ld], VtxY[cvtx + ld], &ix, &iy))
313  {
314  // Okay, set vertex
315  VtxX[cvtx] = tx;
316  VtxY[cvtx] = ty;
317  return true;
318  }
319  else
320  {
321  // Intersected, find bend vertex
322  bool found = false;
323  int32_t cix;
324  int32_t ciy;
325  for (int irange = 4; irange <= 12; irange += 4)
326  {
327  for (cix = ix - irange / 2; cix <= ix + irange; cix += irange)
328  {
329  for (ciy = iy - irange / 2; ciy <= iy + irange; ciy += irange)
330  {
331  if (PathFree(cix, ciy, tx, ty) && PathFree(cix, ciy, VtxX[cvtx + ld], VtxY[cvtx + ld]))
332  {
333  found = true;
334  goto out;
335  }
336  }
337  }
338  }
339 out:
340  if (!found)
341  {
342  // Try bending directly at path the line took
343  // Allow going through vehicle in this case to allow lines through castles and elevator shafts
344  cix = oldx;
345  ciy = oldy;
346  if (!PathFreeIgnoreVehicle(cix, ciy, tx, ty) || !PathFreeIgnoreVehicle(cix, ciy, VtxX[cvtx + ld], VtxY[cvtx + ld]))
347  {
348  return false; // Found no bend vertex
349  }
350  }
351  // Insert bend vertex
352  if (ld > 0)
353  {
354  if (!InsertVertex(cvtx + 1, cix, ciy))
355  {
356  return false;
357  }
358  }
359  else
360  {
361  if (!InsertVertex(cvtx, cix, ciy))
362  {
363  return false;
364  }
365  cvtx++;
366  }
367  // Okay, set vertex
368  VtxX[cvtx] = tx;
369  VtxY[cvtx] = ty;
370  return true;
371  }
372 
373  return false;
374 }
bool PathFree(int32_t x1, int32_t y1, int32_t x2, int32_t y2)
bool PathFreeIgnoreVehicle(int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t *ix, int32_t *iy)
bool InsertVertex(int32_t iPos, int32_t tx, int32_t ty)
Definition: C4Shape.cpp:376

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

Here is the call graph for this function:

◆ Normalize()

void C4Rect::Normalize ( )
inlineinherited

Definition at line 48 of file C4Rect.h.

49  { if (Wdt < 0) { x+=Wdt+1; Wdt=-Wdt; } if (Hgt < 0) { y+=Hgt+1; Hgt=-Hgt; } }

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

◆ operator!=()

bool C4Rect::operator!= ( const C4Rect r2) const
inlineinherited

Definition at line 38 of file C4Rect.h.

38 { return 0 != ((x-r2.x) | (y-r2.y) | (Wdt-r2.Wdt) | (Hgt-r2.Hgt)); }

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

◆ operator==()

bool C4Rect::operator== ( const C4Rect r2) const
inlineinherited

Definition at line 37 of file C4Rect.h.

37 { return !((x-r2.x) | (y-r2.y) | (Wdt-r2.Wdt) | (Hgt-r2.Hgt)); }

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

◆ Overlap()

bool C4Rect::Overlap ( C4Rect rTarget)
inherited

Definition at line 91 of file C4Rect.cpp.

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 }

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

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

Here is the caller graph for this function:

◆ RemoveVertex()

bool C4Shape::RemoveVertex ( int32_t  iPos)

Definition at line 398 of file C4Shape.cpp.

399 {
400  if (!Inside<int32_t>(index_position, 0, VtxNum - 1))
401  {
402  return false;
403  }
404  for (int32_t i = index_position; i + 1 < VtxNum; i++)
405  {
406  VtxX[i] = VtxX[i + 1];
407  VtxY[i] = VtxY[i + 1];
408  }
409  VtxNum--;
410  return true;
411 }

References VtxNum, VtxX, and VtxY.

Referenced by ReduceLineSegments().

Here is the caller graph for this function:

◆ Rotate()

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

Definition at line 45 of file C4Shape.cpp.

46 {
48  {
49  C4RCRotVtx rc;
50  rc.x = x;
51  rc.y = y;
52  rc.wdt = Wdt;
53  rc.hgt = Hgt;
54  rc.r = fixtoi(angle);
55  for (int32_t i = 0; i < 4; ++i)
56  {
57  rc.VtxX[i] = VtxX[i];
58  rc.VtxY[i] = VtxY[i];
59  }
60  AddDbgRec(RCT_RotVtx1, &rc, sizeof(rc));
61  }
62 
63  // Calculate rotation matrix
64  C4Real rot_matrix[4];
65  rot_matrix[0] = Cos(angle); rot_matrix[1] = -Sin(angle);
66  rot_matrix[2] = -rot_matrix[1]; rot_matrix[3] = rot_matrix[0];
67 
68  if (update_vertices)
69  {
70  // Rotate vertices
71  for (int32_t cnt = 0; cnt < VtxNum; cnt++)
72  {
73  int32_t old_x = VtxX[cnt];
74  int32_t old_y = VtxY[cnt];
75  VtxX[cnt] = fixtoi(rot_matrix[0] * old_x + rot_matrix[1] * old_y);
76  VtxY[cnt] = fixtoi(rot_matrix[2] * old_x + rot_matrix[3] * old_y);
77  }
78  }
79 
80  // Enlarge Rect
81  int32_t new_x = fixtoi(rot_matrix[0] * x + rot_matrix[1] * y);
82  int32_t new_y = fixtoi(rot_matrix[2] * x + rot_matrix[3] * y);
83  int32_t new_wdt = 0;
84  int32_t new_hgt = 0;
85  if (rot_matrix[0] > 0)
86  {
87  if (rot_matrix[1] > 0)
88  {
89  new_wdt = fixtoi(rot_matrix[0] * Wdt + rot_matrix[1] * Hgt);
90  new_hgt = fixtoi(rot_matrix[1] * Wdt + rot_matrix[0] * Hgt);
91  x = new_x;
92  y = new_y - fixtoi(rot_matrix[1] * Wdt);
93  }
94  else
95  {
96  new_wdt = fixtoi(rot_matrix[0] * Wdt - rot_matrix[1] * Hgt);
97  new_hgt = fixtoi(- rot_matrix[1] * Wdt + rot_matrix[0] * Hgt);
98  x = new_x + fixtoi(rot_matrix[1] * Hgt);
99  y = new_y;
100  }
101  }
102  else
103  {
104  if (rot_matrix[1] > 0)
105  {
106  new_wdt = fixtoi(- rot_matrix[0] * Wdt + rot_matrix[1] * Hgt);
107  new_hgt = fixtoi(rot_matrix[1] * Wdt - rot_matrix[0] * Hgt);
108  x = new_x + fixtoi(rot_matrix[0] * Wdt);
109  y = new_y - new_hgt;
110  }
111  else
112  {
113  new_wdt = fixtoi(- rot_matrix[0] * Wdt - rot_matrix[1] * Hgt);
114  new_hgt = fixtoi(- rot_matrix[1] * Wdt - rot_matrix[0] * Hgt);
115  x = new_x - new_wdt;
116  y = new_y + fixtoi(rot_matrix[0] * Hgt);
117  }
118  }
119  Wdt = new_wdt;
120  Hgt = new_hgt;
121  if (Config.General.DebugRec)
122  {
123  C4RCRotVtx rc;
124  rc.x = x;
125  rc.y = y;
126  rc.wdt = Wdt;
127  rc.hgt = Hgt;
128  for (int32_t i = 0; i < 4; ++i)
129  {
130  rc.VtxX[i] = VtxX[i];
131  rc.VtxY[i] = VtxY[i];
132  }
133  AddDbgRec(RCT_RotVtx2, &rc, sizeof(rc));
134  }
135 }
C4Config Config
Definition: C4Config.cpp:930
C4Real Cos(const C4Real &fAngle)
Definition: C4Real.h:266
int fixtoi(const C4Fixed &x)
Definition: C4Real.h:259
C4Real Sin(const C4Real &fAngle)
Definition: C4Real.h:265
void AddDbgRec(C4RecordChunkType eType, const void *pData, int iSize)
Definition: C4Record.cpp:32
@ RCT_RotVtx2
Definition: C4Record.h:66
@ RCT_RotVtx1
Definition: C4Record.h:65
int VtxX[4]
Definition: C4Record.h:165
int VtxY[4]
Definition: C4Record.h:165
int32_t DebugRec
Definition: C4Config.h:63
C4ConfigGeneral General
Definition: C4Config.h:255
Definition: C4Real.h:59

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

Referenced by C4Object::UpdateShape().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Set()

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

Definition at line 86 of file C4Rect.cpp.

87 {
88  x=iX; y=iY; Wdt=iWdt; Hgt=iHgt;
89 }

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

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

Here is the caller graph for this function:

◆ Stretch()

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

Definition at line 142 of file C4Shape.cpp.

143 {
144  x = ScaledByCon(x, iCon);
145  y = ScaledByCon(y, iCon);
146  Wdt = ScaledByCon(Wdt, iCon);
147  Hgt = ScaledByCon(Hgt, iCon);
148  if (update_vertices)
149  {
150  for (int32_t i = 0; i < VtxNum; i++)
151  {
152  VtxX[i] = ScaledByCon(VtxX[i], iCon);
153  VtxY[i] = ScaledByCon(VtxY[i], iCon);
154  }
155  }
156 }

References C4Rect::x.

Referenced by C4Object::UpdateShape().

Here is the caller graph for this function:

Member Data Documentation

◆ AttachMat

int32_t C4Shape::AttachMat = MNone

Definition at line 50 of file C4Shape.h.

Referenced by Attach(), and CopyFrom().

◆ ContactCNAT

int32_t C4Shape::ContactCNAT = 0

Definition at line 48 of file C4Shape.h.

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

◆ ContactCount

int32_t C4Shape::ContactCount = 0

Definition at line 49 of file C4Shape.h.

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

◆ ContactDensity

int32_t C4Shape::ContactDensity = C4M_Solid

Definition at line 47 of file C4Shape.h.

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

◆ Hgt

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(), C4MapScriptLayer::Blit(), C4Viewport::BlitOutput(), C4GameOptionButtons::C4GameOptionButtons(), C4GameOverDlg::C4GameOverDlg(), C4LeagueSignupDialog::C4LeagueSignupDialog(), C4Rect::C4Rect(), C4SolidMask::C4SolidMask(), C4StartupMainDlg::C4StartupMainDlg(), C4StartupModsListEntry::C4StartupModsListEntry(), 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(), C4GUI::Element::DoContext(), C4GUI::Screen::DoContext(), C4ChatDlg::DoPlacement(), C4DefGraphics::Draw(), C4EditCursor::Draw(), C4SolidMask::Draw(), C4GUI::Window::Draw(), C4GUI::Dialog::Draw(), C4Viewport::Draw(), C4GraphicsOverlay::Draw(), C4GUI::FrameDecoration::Draw(), C4MouseControl::Draw(), C4Object::Draw(), C4GameMessage::Draw(), C4ScriptGuiWindow::Draw(), C4GUI::Element::Draw3DFrame(), C4GUI::Element::DrawBar(), C4ScriptGuiWindow::DrawChildren(), C4Landscape::DrawChunks(), 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(), C4MenuItem::DrawElement(), C4Menu::DrawElement(), C4StartupMainDlg::DrawElement(), C4StartupNetListEntry::DrawElement(), C4Chart::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(), GetBottom(), C4Rect::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(), C4GUI::Tabular::GetMarginTop(), C4GUI::Dialog::GetMarginTop(), C4StartupPlrSelDlg::GetMarginTop(), C4StartupScenSelDlg::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(), C4Command::JumpControl(), C4ParticleDef::Load(), C4StartupPlrSelDlg::PlayerListItem::Load(), C4TexRef::Lock(), C4TexRef::LockForUpdate(), C4GUI::ComponentAligner::LogIt(), C4Landscape::P::MapToLandscape(), C4GUI::MessageDialog::MessageDialog(), C4GUI::CheckBox::MouseInput(), C4ScriptGuiWindow::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::PreInit(), C4ScriptGuiWindow::ProcessMouseInput(), C4GUI::ProgressDialog::ProgressDialog(), C4Command::Put(), C4SolidMask::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(), C4TargetFacet::Set(), C4TargetRect::Set(), C4Rect::Set(), C4GUI::Dialog::SetClientSize(), C4GUI::Tabular::SetGfx(), C4GoalDisplay::SetGoals(), C4Object::SetOCF(), C4GUI::TextWindow::SetPicture(), C4TargetFacet::SetRect(), C4GUI::Label::SetText(), C4MouseControl::SetTooltipRectangle(), C4GUI::TextWindow::TextWindow(), C4Command::Throw(), C4TexRef::Unlock(), C4GUI::ScrollBar::Update(), C4GUI::ScrollWindow::Update(), C4FoWLightSection::Update(), C4LandscapeRenderGL::Update(), CStdGL::UpdateClipper(), C4StartupPlrSelDlg::PlayerListItem::UpdateCore(), C4MouseControl::UpdateCursorTarget(), C4GUI::ListBox::UpdateElementPositions(), C4Menu::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().

◆ iAttachVtx

int32_t C4Shape::iAttachVtx = 0

Definition at line 53 of file C4Shape.h.

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

◆ iAttachX

int32_t C4Shape::iAttachX = 0

Definition at line 53 of file C4Shape.h.

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

◆ iAttachY

int32_t C4Shape::iAttachY = 0

Definition at line 53 of file C4Shape.h.

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

◆ VtxCNAT

◆ VtxContactCNAT

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

◆ VtxContactMat

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

Definition at line 52 of file C4Shape.h.

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

◆ VtxFriction

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

Definition at line 46 of file C4Shape.h.

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

◆ VtxNum

◆ VtxX

◆ VtxY

◆ Wdt

int32_t C4Rect::Wdt = 0
inherited

Definition at line 30 of file C4Rect.h.

Referenced by C4Rect::Add(), C4GUI::ListBox::AddElement(), C4Object::AssignRemoval(), C4Object::At(), C4MapScriptLayer::Blit(), C4Viewport::BlitOutput(), C4GameOptionButtons::C4GameOptionButtons(), C4LeagueSignupDialog::C4LeagueSignupDialog(), C4Rect::C4Rect(), C4SolidMask::C4SolidMask(), C4StartupMainDlg::C4StartupMainDlg(), C4StartupModsDlg::C4StartupModsDlg(), C4StartupModsListEntry::C4StartupModsListEntry(), C4StartupNetDlg::C4StartupNetDlg(), C4StartupNetListEntry::C4StartupNetListEntry(), C4StartupOptionsDlg::C4StartupOptionsDlg(), C4StartupPlrSelDlg::C4StartupPlrSelDlg(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4TexRef::C4TexRef(), C4GUI::ContextMenu::CheckOpenSubmenu(), C4Object::CheckSolidMaskRect(), C4TexRef::ClearRect(), C4TargetRect::ClipBy(), C4RectList::ClipByRect(), C4MaterialCore::CompileFunc(), C4Rect::CompileFunc(), CompileFunc(), ConstructionCheck(), C4Rect::Contains(), C4GUI::ContextMenu::ContextMenu(), C4Game::CreateObjectConstruction(), C4GameObjects::CrossCheck(), C4MaterialMap::CrossMapMaterials(), C4Rect::Default(), C4GUI::Dialog::Dialog(), C4GUI::Element::DoContext(), C4GUI::Screen::DoContext(), C4ChatDlg::DoPlacement(), C4ScoreboardDlg::DoPlacement(), C4DefGraphics::Draw(), C4EditCursor::Draw(), C4SolidMask::Draw(), C4GUI::Window::Draw(), C4GUI::Dialog::Draw(), C4Viewport::Draw(), C4GraphicsOverlay::Draw(), C4GUI::FrameDecoration::Draw(), C4MouseControl::Draw(), C4Object::Draw(), C4GameMessage::Draw(), C4ScriptGuiWindow::Draw(), C4GUI::Element::Draw3DFrame(), C4GUI::Element::DrawBar(), C4ScriptGuiWindow::DrawChildren(), C4Landscape::DrawChunks(), 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(), C4MenuItem::DrawElement(), C4Menu::DrawElement(), C4StartupMainDlg::DrawElement(), C4StartupNetListEntry::DrawElement(), C4Chart::DrawElement(), C4Object::DrawFace(), C4ViewportList::DrawFullscreenBackground(), C4GUI::Element::DrawHBarByVGfx(), C4EditCursor::DrawObject(), C4Object::DrawSelectMark(), C4Object::DrawTopFace(), C4Rect::Enlarge(), C4GUI::ContextMenu::Entry::Entry(), 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(), C4GUI::Tabular::MouseInput(), C4ScriptGuiWindow::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::PreInit(), C4ScriptGuiWindow::ProcessMouseInput(), C4Command::Put(), C4SolidMask::Put(), C4SolidMask::PutTemporary(), C4ViewportList::RecalculateViewports(), C4SolidMask::Remove(), C4SolidMask::RemoveTemporary(), C4FoWRegion::Render(), C4SolidMask::Repair(), Rotate(), C4StartupScenSelDlg::ScenListItem::ScenListItem(), C4GUI::ScrollWindow::ScrollWindow(), C4TargetFacet::Set(), C4TargetRect::Set(), C4Rect::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(), C4GUI::TextWindow::TextWindow(), C4TexRef::Unlock(), C4GUI::ScrollWindow::Update(), C4FoWLightSection::Update(), C4LandscapeRenderGL::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().

◆ x

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(), C4LeagueSignupDialog::C4LeagueSignupDialog(), C4Rect::C4Rect(), C4StartupModsListEntry::C4StartupModsListEntry(), C4StartupNetListEntry::C4StartupNetListEntry(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4TexRef::C4TexRef(), C4FindObjectAtPoint::Check(), C4FindObjectAtRect::Check(), C4GUI::ContextMenu::CheckOpenSubmenu(), CheckScaleToWalk(), C4Object::CheckSolidMaskRect(), C4TexRef::ClearRect(), C4GUI::Element::ClientPos2ScreenPos(), C4TargetRect::ClipBy(), C4RectList::ClipByRect(), C4Rect::CompileFunc(), CompileFunc(), C4GUI::ComponentAligner::ComponentAligner(), ContactCheck(), C4Rect::Contains(), C4MapFolderData::CreateGUIElements(), C4GameObjects::CrossCheck(), C4GUI::ContextMenu::CtxMouseInput(), C4Rect::Default(), C4GUI::Element::DoDragging(), C4ChatDlg::DoPlacement(), C4ScoreboardDlg::DoPlacement(), C4DefGraphics::Draw(), C4EditCursor::Draw(), C4SolidMask::Draw(), C4GUI::Window::Draw(), C4GUI::Dialog::Draw(), C4Viewport::Draw(), C4GraphicsOverlay::Draw(), C4GUI::FrameDecoration::Draw(), C4GameMessage::Draw(), C4ScriptGuiWindow::Draw(), C4LandscapeRenderGL::Draw(), C4GUI::Element::Draw3DFrame(), C4GUI::Element::DrawBar(), C4ScriptGuiWindow::DrawChildren(), C4Landscape::DrawChunks(), 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(), C4MenuItem::DrawElement(), C4Menu::DrawElement(), C4ScoreboardDlg::DrawElement(), C4StartupNetListEntry::DrawElement(), C4StartupPlrPropertiesDlg::DrawElement(), C4Chart::DrawElement(), C4ViewportList::DrawFullscreenBackground(), C4GUI::Element::DrawHBarByVGfx(), C4GUI::Element::DrawHVBar(), C4EditCursor::DrawObject(), C4Object::DrawTopFace(), C4Rect::Enlarge(), 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(), C4Rect::GetMiddleX(), C4Object::GetOCFForPos(), C4MapScriptLayer::GetPixCount(), C4Rect::GetRight(), 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(), C4GUI::Window::MouseInput(), C4GUI::ContextMenu::MouseInput(), C4ScriptGuiWindow::MouseInput(), C4GUI::Screen::MouseInput(), C4MouseControl::Move(), C4Rect::Normalize(), ObjectComDrop(), C4ScriptGuiWindow::OnMouseIn(), C4GUI::ContextMenu::Open(), C4Rect::operator!=(), C4Rect::operator==(), C4Rect::Overlap(), CStdGL::PerformMesh(), C4Object::Picture2Facet(), C4ScriptGuiWindow::ProcessMouseInput(), C4Command::Put(), C4SolidMask::Put(), C4SolidMask::PutTemporary(), C4ViewportList::RecalculateViewports(), C4SolidMask::Remove(), C4SolidMask::RemoveTemporary(), C4FoWRegion::Render(), C4SolidMask::Repair(), Rotate(), C4StartupScenSelDlg::ScenListItem::ScenListItem(), C4GUI::Element::ScreenPos2ClientPos(), C4GUI::ScrollWindow::ScrollWindow(), C4TargetFacet::Set(), C4TargetRect::Set(), C4Rect::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(), C4GUI::ScrollWindow::Update(), C4ScoreboardDlg::Update(), C4FoWLightSection::Update(), C4LandscapeRenderGL::Update(), CStdGL::UpdateClipper(), C4MouseControl::UpdateCursorTarget(), C4GUI::ListBox::UpdateElementPosition(), C4GUI::ListBox::UpdateElementPositions(), C4Menu::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().

◆ y

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::Dialog::ApplyElementOffset(), C4GUI::Window::ApplyInvElementOffset(), C4GUI::Dialog::ApplyInvElementOffset(), C4MapScriptLayer::Blit(), C4Viewport::BlitOutput(), C4Rect::C4Rect(), C4StartupModsListEntry::C4StartupModsListEntry(), C4StartupNetListEntry::C4StartupNetListEntry(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4TexRef::C4TexRef(), C4FindObjectAtPoint::Check(), C4FindObjectAtRect::Check(), C4GUI::ContextMenu::CheckOpenSubmenu(), CheckScaleToWalk(), 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(), C4ChatDlg::DoPlacement(), C4ScoreboardDlg::DoPlacement(), C4DefGraphics::Draw(), C4EditCursor::Draw(), C4SolidMask::Draw(), C4GUI::Window::Draw(), C4GUI::Dialog::Draw(), C4Viewport::Draw(), C4GraphicsOverlay::Draw(), C4GUI::FrameDecoration::Draw(), C4GameMessage::Draw(), C4ScriptGuiWindow::Draw(), C4LandscapeRenderGL::Draw(), C4GUI::Element::Draw3DFrame(), C4GUI::Element::DrawBar(), C4ScriptGuiWindow::DrawChildren(), C4Landscape::DrawChunks(), 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(), C4MenuItem::DrawElement(), C4Menu::DrawElement(), C4ScoreboardDlg::DrawElement(), C4StartupNetListEntry::DrawElement(), C4StartupPlrPropertiesDlg::DrawElement(), C4Chart::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(), GetBottom(), C4Rect::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(), C4GUI::Window::MouseInput(), C4GUI::ContextMenu::MouseInput(), C4ScriptGuiWindow::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(), C4Command::Put(), C4SolidMask::Put(), C4SolidMask::PutTemporary(), C4ViewportList::RecalculateViewports(), C4SolidMask::Remove(), C4SolidMask::RemoveTemporary(), C4FoWRegion::Render(), C4SolidMask::Repair(), Rotate(), C4GUI::Element::ScreenPos2ClientPos(), C4GUI::ListBox::ScrollItemInView(), C4GUI::ScrollWindow::ScrollWindow(), C4TargetFacet::Set(), C4TargetRect::Set(), C4Rect::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(), C4GUI::TextWindow::TextWindow(), C4Object::Top(), C4TexRef::Unlock(), C4GUI::ScrollWindow::Update(), C4ScoreboardDlg::Update(), C4FoWLightSection::Update(), C4LandscapeRenderGL::Update(), CStdGL::UpdateClipper(), C4MouseControl::UpdateCursorTarget(), C4GUI::ListBox::UpdateElementPositions(), C4Menu::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: