MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / init

Method init

Engine/source/gui/containers/guiFrameCtrl.cpp:571–620  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

569
570//-----------------------------------------------------------------------------
571bool GuiFrameSetCtrl::init(U32 columns, U32 rows, const U32 columnOffsets[], const U32 rowOffsets[])
572{
573 if (columns != 0 && rows != 0)
574 {
575 mColumnOffsets.clear();
576 mRowOffsets.clear();
577 U32 i;
578 for (i = 0; i < columns; i++)
579 {
580 if (columnOffsets == NULL)
581 mColumnOffsets.push_back(0);
582 else
583 {
584 AssertFatal(columnOffsets != NULL, "GuiFrameSetCtrl::init: NULL column offsets");
585 mColumnOffsets.push_back((U32)columnOffsets[i]);
586 if (i > 0)
587 {
588 AssertFatal(mColumnOffsets[i - 1] < mColumnOffsets[i], "GuiFrameSetCtrl::init: column offsets must be monotonically increasing");
589 mColumnOffsets.clear();
590 return(false);
591 }
592 }
593 }
594 for (i = 0; i < rows; i++)
595 {
596 if (rowOffsets == NULL)
597 mRowOffsets.push_back(0);
598 else
599 {
600 AssertFatal(rowOffsets != NULL, "GuiFrameSetCtrl::init: NULL row offsets");
601 mRowOffsets.push_back((U32)rowOffsets[i]);
602 if (i > 0)
603 {
604 AssertFatal(mRowOffsets[i - 1] < mRowOffsets[i], "GuiFrameSetCtrl::init: row offsets must be monotonically increasing");
605 mRowOffsets.clear();
606 return(false);
607 }
608 }
609 }
610 }
611 mFramesetDetails.mBorderWidth = DEFAULT_BORDER_WIDTH;
612 mFramesetDetails.mBorderEnable = FRAME_STATE_AUTO;
613 mFramesetDetails.mBorderMovable = FRAME_STATE_AUTO;
614 mAutoBalance = false;
615 mFudgeFactor = 0;
616 mCurHitRegion = NONE;
617 mCurVerticalHit = NO_HIT;
618 mCurHorizontalHit = NO_HIT;
619 return(true);
620}
621
622//-----------------------------------------------------------------------------
623// point is assumed to already be in local coordinates.

Callers 1

onRenderMethod · 0.45

Calls 2

clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected