BMAP after level_load

Posted By: flatron

BMAP after level_load - 10/10/12 09:54

HI
I know that after level_load , "the cache holding level entity files is purged. All current entities in the old level are removed".
but what about BMAP*?
Posted By: rayp

Re: BMAP after level_load - 10/10/12 13:19

Predefined bmaps like
Code:
BMAP* AnyBitmap = "bitmap.bmp";

are not removed. Bitmaps shown before level_load will stay visible after level loaded, to avoid that use
Code:
proc_mode = PROC_GLOBAL;

in your function which shows / hides the bmaps.

Hope this helped
greets
Posted By: flatron

Re: BMAP after level_load - 10/10/12 15:32

thank you for replay.
there is 3 questions:
1- what happened for bmap that removed?and how i know that is removed?
if a BMAP* removed and not set to NULL a problem will occur.in that situation this code make an error: (b is a BMAP*)
if (b!=NULL) ptr_remove(b)
if b dosen't set to null so b is not null but ptr_remove make an error.

2-if a BMAP* Predefined (out of any functions) ,what happend after level_load?

3-if a BMAP* defile in a function or action ,what happend after level_load?
Posted By: Uhrwerk

Re: BMAP after level_load - 10/10/12 15:59

You generally have to distinct between bitmaps you create manually (bmap_create, bmap_createblack, Panel Definitions etc.) on the one hand and bitmaps that are created automatically for textures for you level or your entities. When they are created automatically they will be removed automatically as well on a level change. When you created them yourself you have to take care of removing them any time you see removing may fit your needs.

1. They are freed from memory. You won't be notified about that. Exactly. Don't store pointers to bitmaps that are automatically freed in a pointer.

2. Nothing. Take care that you don't loose the pointer to such bitmaps or they won't be accessible any more.

3. Nothing
Posted By: flatron

Re: BMAP after level_load - 10/10/12 16:53

ok
I have some problem with BMAP*.
I have some global BMAP* and now try to use them as local.
thank you.

about number 3: that means bmap remain in memory and unaccessible because there is no pointer to it.is it true?
Posted By: Uhrwerk

Re: BMAP after level_load - 10/10/12 17:08

You can use any global bitmap pointer locally as well. There is no restriction. Why not posting your code and describing the problem?

3. Exactly. I believe that if you recreate the bitmap with the same filname it won't be loaded again because it is cached, but I wouldn't rely on that.
Posted By: rayp

Re: BMAP after level_load - 10/10/12 18:08

Have a look at
Code:
bmap_purge

© 2024 lite-C Forums