cResourceImage* cImageManager::CreateFromBitmap(const tString &asName,iBitmap2D* apBmp, int alFrameHandle) { if(apBmp==NULL)return NULL; cResourceImage *pImage = AddToFrame(apBmp, alFrameHandle); if(pImage){ AddResource(pImage, false); pImage->IncUserCount(); } return pImage; }
iResourceBase* cImageManager::CreateInFrame(const tString& asName, int alFrameHandle) { cResourceImage *pImage = NULL; tString sPath; BeginLoad(asName); pImage = FindImage(asName, sPath); if(!pImage) { if(sPath != "") { iBitmap2D *pBmp; pBmp = mpLowLevelResources->LoadBitmap2D(sPath); if(pBmp==NULL){ Error("Imagemanager Couldn't load bitmap '%s'\n", sPath.c_str()); EndLoad(); return NULL; } pImage = AddToFrame(pBmp, alFrameHandle); hplDelete(pBmp); if(pImage==NULL){ Error("Imagemanager couldn't create image '%s'\n", asName.c_str()); } if(pImage) AddResource(pImage); } } else { //Log("Found '%s' in stock!\n",asName.c_str()); } if(pImage)pImage->IncUserCount(); else Error("Couldn't load image '%s'\n",asName.c_str()); //Log("Loaded image %s, it has %d users!\n", pImage->GetName().c_str(),pImage->GetUserCount()); //Log(" frame has %d pics\n", pImage->GetFrameTexture()->GetPicCount()); EndLoad(); return pImage; }
POTE Compiler::AddSymbolToFrame(const char* s, const TEXTRANGE& tokenRange) { POTE oteSelector = InternSymbol(s); AddToFrame(reinterpret_cast<Oop>(oteSelector), tokenRange); return oteSelector; }