Quote:
Originally posted by Omni
Use normal Render() on the screen. Each render, copy the screen to your larger clipboard. Surely Render()-ing screen by screen doesn't use a Gig of memory.
I certainly hope RenderMap() doesn't work like that. I mean, I guess it's logical, but in a situation like this it seems _very_ inefficient...
The problem with that idea is that I need to get parts of the map which are off-screen.
Here is the main problem: I want to completely redraw an area of the map using TBlitTile. I have to use TBlitTile because it has tiles off-screen, but let's just say I need to get the tiles on-screen to make it easier to explain. I can get past the part where I draw the tiles to a 640x480 image using this method. But I want it to scroll smoothly, not jumping entire tiles at a time, so I need to blit this image slightly off based on how far the entity is from the 0-point of the tile coordinate. This is the code I am using right now:
blit(0-(entity.x[mainchar]-((entity.x[mainchar]/16)*16)),0-(entity.y[mainchar]-((entity.y[mainchar]/16)*16)),imagestuff,screen);
The part that I added to the x position does it's job very well, scrolling the map smoothly when the character moves from left to right. But the part I added to y position does not work right. The screen, when moving down or up, will generally scroll in the correct direction, but it will move in a bouncy manner. It doesn't make any sense to me why the math for handling vertical character position would be different for the math handling horizontal position.
Oh, and I also think RenderMap would be far more useful if it was rendermap(sx1,sy1,sx2,sy2,dx,dy,srcimg,destimg).
EDIT: Based on a lot of testing, I have concluded that Verge calculates tile position on the y-axis differently than it does on the x-axis. Tile position changes on the y-axis when you have traveled halfway down/up the tile. It changes on the x-axis when you have traveled all 16 pixels across the tile. I would love it if someone who knows could verify or deny this.
EDIT: Woo-hoo, solved the problem. There was a number lost in the code that I had chosen arbitrarily, but it turned out it needed to be divisible by 16 or the whole thing was off. I may post a demo of this thing when I get it finished. Thanks.