-
Bit Blit? Memory problem
What I have
Tile based game
64 pixel tiles, RGB color
maps that are changeable and variable in size
:confused: Problem:
Maps over 80 x 80 will not appear on the screen
Chemist not programmer
Slow brain
Thoughts:
I think its a memory thing but I am not sure.
Is keeping that big DC in memory really really bad?
I dont ever display the whole DC just what you see.
Also, if I change the picture in the DC does it create a memory
hole or pointer problem. I mean without deleting it.....
Thanks
-
in the early stages of my rpg engine i did the same thing as you, and realized the same thing~! so all you need to do to work around that problem is ONLY draw onto your backbuffer what you need to see on the screen at the moment! it takes a bit more thinking, but it wont take too much effort to adjust your code.
-
double buffer!
Blit your map on an invisible picbox, then copy (or "flip") that picbox to the end result picbox!
-MoMad
-
OK
those will work but what is the problem?
Why will the map not display...
Am I loosing memory?
More Explenation:
When I create the maps I blit the hexes one at a time in rows and cols. with every other column offset (hexes). I do this all in my backbuffer.
I then display only what is required from the backbuffer to the
display. Like I said it works for maps of up to 80 * 80 hexes but
not for larger ones.
-
Well
I am scrolling the map with a picture box behind the form, all of
the map data like player positions and hex type is stored a
data array. When the player moves from hex to hex it just
checks the array to find out whats there. The players are sepetate.... Thought this was efficiet.... guess I will have to
change it.
Scrolling offset hexes will be a pain in the but :(
Time to program....