Advertisement
Guest User

Untitled

a guest
Jul 4th, 2013
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. Ok. So, we have what I call worlds, which is basically just holding a 3D array. (which, are in the order depth->width->height).
  2.  
  3. What the drawer does is, scrolls when there is room left, and when it reaches the end, blends. The blending is the effect as in that picture - don't need help there. The idea was, to have that effect, using the end of the current generation, and the beginning of the next. (It was previously the end of both, and so immidietely after blending, all the blocks would change because it goes to the start).
  4.  
  5. So, what I am attempting to do is, the first time the blend function is called, it gets memory for what I call blend panes - they basically just hold the colors, of a size that the screen currently holds in blocks. In this way, it saves much processing over the old first attempt, which calculated the colors for every block, every time, which is terribly wasteful. So, I refactored.
  6.  
  7. Now, at the same time they are initialized, they should get the colors. The first pane is the end of the current generation - the blocks in view when it is done scrolling. Note that the width, depth, etc (from BlockSizeCalculator) are how many blocks are in the screen (as opposed to the world, of whichs functions return the full dimension).
  8.  
  9. In theory, the problem is just in getting the panes correct, and then drawing them in a fairly normal fashion... though I am not sure which of those I messed up, might be the drawing. Anyway, via debugging, the colors seem to be correct, so I think the drawing might be the culprit. I just realized, I think I am not drawing them taking the view into consideration... (I had debugged tryingt o draw a yellow rectangle and hadn't seen it). That might be the issue. Got to go, but I will try to look into that when I get back.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement