I found a post that dated back to 2005 that said if an image was loaded prior to loading a level, then the image would just stay as the level is loaded. I'm trying to do that but the screen is just black. Any ideas?
Code to draw a piximap:
// Draw a piximap
void Time::DrawPixi(string image)
{
string imagex;
imagex = "/lib/std/" + image;
const char* pixi = imagex.c_str ( );
// Load HUD piximap
iTextureManager* txtmgr = g3d->GetTextureManager ();
csRef<iDataBuffer> buf = VFS->ReadFile (pixi);
csRef<iImage> ifile = imgldr->Load (buf, txtmgr->GetTextureFormat ());
csRef<iTextureHandle> txt =
txtmgr->RegisterTexture (ifile, CS_TEXTURE_2D);
csSimplePixmap* pixmap = new csSimplePixmap (txt);
pixmap->DrawScaled (g3d, 10, 10, 300, 300);
}
Code to load the map:
// Load the level file which is called 'world'.
DrawPixi("cslogo2.png");
if (!loader->LoadMapFile ("world"))
ReportError("Error couldn't load level!");
//console->Toggle();
csTextProgressMeter* meter = new csTextProgressMeter (system_console);
engine->Prepare (meter);
meter->Reset();
The PixiMap function works fine outside of trying to get it to show an image before/during a level load.
TIA
