I've implemented a drawing routine that utilized texture atlases for my game. Everything was working fine until I tried to scale some images up, then I noticed that when it is scaled the polyvector doesn't seem to be receiving the mapping of the texture quite correctly. I've attached a picture where I've scaled the number 4 using my drawing routine, and you will notice an artifact at the top of the image. I've run debug statements to check my width/height and tx mapping values; I am not seeing what would be causing this.
Any ideas?
CONSTANT MIRROR_NORMAL=1
CONSTANT MIRROR_VERT = 2
CONSTANT MIRROR_HORIZ = 4
FUNCTION draw_named_sprite: name$, x%, y%, mirror=MIRROR_NORMAL, scalex=1, scaley=1
LOCAL txt_spr AS SPRITE
txt_spr = get_named_sprite(name$)
LOCAL width%=txt_spr.width*scalex
LOCAL height%=txt_spr.height*scaley
DEBUG "x:" + x + ", y:" + y + "\n"
DEBUG "scalex:" + scalex + ", scaley:" + scaley + "\n"
DEBUG "width:" + width + ", height:" + height + "\n"
DEBUG "tx1:" + txt_spr.tx1 + ", tx2:" + txt_spr.tx2 + "\n"
DEBUG "ty1:" + txt_spr.ty1 + ", ty2:" + txt_spr.ty2 + "\n"
IF bAND(MIRROR_NORMAL, mirror)=1
// Normal
STARTPOLY 0,0 // Bitmap = No.0
POLYVECTOR x, y, txt_spr.tx1, txt_spr.ty1, RGB(255, 255, 255)
POLYVECTOR x, y+height, txt_spr.tx1, txt_spr.ty2, RGB (255, 255, 255)
POLYVECTOR x+width, y+height, txt_spr.tx2, txt_spr.ty2, RGB(255, 255, 255)
POLYVECTOR x+width, y, txt_spr.tx2, txt_spr.ty1, RGB(255, 255, 255)
ENDPOLY
ELSEIF bAND(bOR(MIRROR_VERT,MIRROR_HORIZ),mirror)=6
//LEFT/RIGHT/UP/DOWN
STARTPOLY 0,0 // Bitmap = No.0
POLYVECTOR x, y, txt_spr.tx2, txt_spr.ty2, RGB(255, 255, 255)
POLYVECTOR x, y+height, txt_spr.tx2, txt_spr.ty1, RGB (255, 255, 255)
POLYVECTOR x+width, y+height, txt_spr.tx1, txt_spr.ty1, RGB(255, 255, 255)
POLYVECTOR x+width, y, txt_spr.tx1, txt_spr.ty2, RGB(255, 255, 255)
ENDPOLY
ELSEIF bAND(MIRROR_VERT, mirror)=2
//LEFT/RIGHT
STARTPOLY 0,0 // Bitmap = No.0
POLYVECTOR x, y, txt_spr.tx2, txt_spr.ty1, RGB(255, 255, 255)
POLYVECTOR x, y+height, txt_spr.tx2, txt_spr.ty2, RGB (255, 255, 255)
POLYVECTOR x+width, y+height, txt_spr.tx1, txt_spr.ty2, RGB(255, 255, 255)
POLYVECTOR x+width, y, txt_spr.tx1, txt_spr.ty1, RGB(255, 255, 255)
ENDPOLY
ELSEIF bAND(MIRROR_HORIZ, mirror)=4
// UP/DOWN
STARTPOLY 0,0 // Bitmap = No.0
POLYVECTOR x, y, txt_spr.tx1, txt_spr.ty2, RGB(255, 255, 255)
POLYVECTOR x, y+height, txt_spr.tx1, txt_spr.ty1, RGB (255, 255, 255)
POLYVECTOR x+width, y+height, txt_spr.tx2, txt_spr.ty1, RGB(255, 255, 255)
POLYVECTOR x+width, y, txt_spr.tx2, txt_spr.ty2, RGB(255, 255, 255)
ENDPOLY
ENDIF
ENDFUNCTION
[attachment deleted by admin]