Results 1 to 3 of 3

Thread: CL_PixelCommandSprite::render_sprite_scale bug

  1. #1

    Default CL_PixelCommandSprite::render_sprite_scale bug

    Incorrect bug fix.
    Last edited by cdoty; 11-30-2012 at 09:24 PM.

  2. #2
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    Sorry, what?

  3. #3

    Default

    Quote Originally Posted by sphair View Post
    Sorry, what?
    I had initially posted a bug fix, but then realized there were issues with the bug fix. The bug is that sometimes the values in box can create an access past the end of a texture. With a scale value of 25% and a width and height of 192 and 160, (CL_Rect) box was getting set with a width of 48 and a height of 41.

    Here's the final fix I came up with for render_sprite_scale bug:

    In CL_PixelCommandSprite::render_sprite_scale, insert the following code snippet before the first for loop:
    Code:
    	while (dy * context->samplers[sampler].size.height * height >= context->samplers[sampler].size.height)
    	{
    		height--;
    	}
    and replace the for loop with:
    Code:
    	for (int y = box.top + skip_lines; y < box.top + height; y+=context->num_cores)
    The same thing might need to be done for the width, and the code would need to be placed in the other scale functions.

Similar Threads

  1. CL_PixelCommandSprite::render_sprite_scale , Crashed
    By apple1000 in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 03-02-2012, 10:17 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •