diff options
author | Martin Poirier <theeth@yahoo.com> | 2005-07-06 04:33:41 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2005-07-06 04:33:41 +0400 |
commit | 22a18ecdb85afb88294be2e1891aa4918e9a5c45 (patch) | |
tree | 0d3188f4ae21f67fda4e4d1d437fd567d77ed8a6 /source/blender/render/intern | |
parent | d50b2c0ff80466b52e1aa49428a47a6163040b4e (diff) |
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
Diffstat (limited to 'source/blender/render/intern')
-rw-r--r-- | source/blender/render/intern/source/pixelshading.c | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/texture.c | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c index 0af4696eee0..071f64fec70 100644 --- a/source/blender/render/intern/source/pixelshading.c +++ b/source/blender/render/intern/source/pixelshading.c @@ -746,6 +746,8 @@ void fillBackgroundImageChar(char *col, float x, float y) return; } + tag_image_time(R.backbuf); + /* Now for the real extraction: */ /* Get the y-coordinate of the scanline? */ iy= (int) ((y+R.afmy+R.ystart)*R.backbuf->ibuf->y)/(2*R.afmy); diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index 7f02260bfd7..191661d8ed7 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -1173,6 +1173,7 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, case TEX_IMAGE: if(osatex) retval= imagewraposa(tex, tex->ima, texvec, dxt, dyt, texres); else retval= imagewrap(tex, tex->ima, texvec, texres); + tag_image_time(tex->ima); /* tag image as having being used */ break; case TEX_PLUGIN: retval= plugintex(tex, texvec, dxt, dyt, osatex, texres); |