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

Method setBitmap

Engine/source/gui/controls/guiPopUpCtrlEx.cpp:781–809  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Added

Source from the content-addressed store, hash-verified

779//------------------------------------------------------------------------------
780// Added
781void GuiPopUpMenuCtrlEx::setBitmap(const char *name)
782{
783 StringTableEntry bitmapName = StringTable->insert(name);
784
785 if (bitmapName != StringTable->EmptyString())
786 {
787 char buffer[1024];
788 char* p;
789 dStrcpy(buffer, bitmapName, 1024);
790 p = buffer + dStrlen(buffer);
791 S32 pLen = 1024 - dStrlen(buffer);
792
793 dStrcpy(p, "_n", pLen);
794
795 _setBitmap((StringTableEntry)buffer, Normal);
796
797 dStrcpy(p, "_d", pLen);
798 _setBitmap((StringTableEntry)buffer, Depressed);
799
800 if (!mBitmap[Depressed])
801 mBitmap[Depressed] = mBitmap[Normal];
802 }
803 else
804 {
805 _setBitmap(StringTable->EmptyString(), Normal);
806 _setBitmap(StringTable->EmptyString(), Depressed);
807 }
808 setUpdate();
809}
810
811//------------------------------------------------------------------------------
812void GuiPopUpMenuCtrlEx::sort()

Callers 1

_setBitmapsMethod · 0.45

Calls 5

dStrcpyFunction · 0.85
_setBitmapFunction · 0.85
EmptyStringMethod · 0.80
dStrlenFunction · 0.50
insertMethod · 0.45

Tested by

no test coverage detected