Ok so I have multiple classes that use pointers to return a pointer to a bitmap that is ready to blit - these work flawlessly as far as I have seen the classes are implemented as pointers and I have no issues.
Now I took that same code while working on a new class for items my definition is
Nothing special, when I use my codeCode:Item Inventory[16][7];
It will load the picture fine, but when I try to display it crashes out horribly.Code:void Item::SetPicPath(char *path,RGB *pal)
{
if(PIC)delete PIC;
PIC = load_bitmap(path,pal);
}
BITMAP* Item::GetPic()
{
return PIC;
}
Now to me it seems reasonable that it is either where I assign a value into inventory or when I retrieve the info from the inventory.
So I did some testing and got a dump of the data in the character class (where inventory is instanced) dumped inventory in a save file and it has the relevant data. Ok so I thought maybe I can use the ID since I load all items into an array to referance the pic still no go ok maybe it doesn't even load correctly so I did a static referance and it worked fine.
I can post whatever more data you all want to see, but as there are many referances all over the program to this class it is hard to sort out what you all might want to see. Tell me what pieces you need to see to give me some ideas and I will post emm.