--------------------------------------------------------------------------
| 948 | |
| 949 | //-------------------------------------------------------------------------- |
| 950 | GuiMLTextCtrl::Bitmap *GuiMLTextCtrl::allocBitmap(const char *bitmapName, U32 bitmapNameLen) |
| 951 | { |
| 952 | for(Bitmap *walk = mBitmapList; walk; walk = walk->next) |
| 953 | { |
| 954 | if (bitmapNameLen == walk->bitmapNameLen && !dStrncmp(walk->bitmapName, bitmapName, bitmapNameLen)) |
| 955 | return walk; |
| 956 | } |
| 957 | |
| 958 | Bitmap *ret = constructInPlace((Bitmap *) mResourceChunker.alloc(sizeof(Bitmap))); |
| 959 | ret->bitmapName = bitmapName; |
| 960 | ret->bitmapNameLen = bitmapNameLen; |
| 961 | char nameBuffer[256]; |
| 962 | AssertFatal(sizeof(nameBuffer) >= bitmapNameLen, "GuiMLTextCtrl::allocBitmap() - bitmap name too long"); |
| 963 | dStrncpy(nameBuffer, bitmapName, bitmapNameLen); |
| 964 | nameBuffer[bitmapNameLen] = 0; |
| 965 | ret->bitmapHandle = TextureHandle(nameBuffer, TextureHandle::BitmapTexture); |
| 966 | if(bool(ret->bitmapHandle)) |
| 967 | { |
| 968 | ret->next = mBitmapList; |
| 969 | mBitmapList = ret; |
| 970 | return ret; |
| 971 | } |
| 972 | return NULL; |
| 973 | } |
| 974 | |
| 975 | //-------------------------------------------------------------------------- |
| 976 | GuiMLTextCtrl::LineTag *GuiMLTextCtrl::allocLineTag(U32 id) |
nothing calls this directly
no test coverage detected