Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hrm...wtf :/
#1
As I'm writing this new routine for Useless Sock, I come across this messed up result:

[Image: scale-fsckup.png]
I normally don't ask for help but this is driving me insane. This was effectively translated from the working version in my TinyPTC extension library where it works flawlessly. Anyways, here's the code:
Code:
SUB USputScaledSprite (x AS INTEGER, y AS INTEGER, sourceSegment AS INTEGER, sourceOffset AS INTEGER, destSegment AS INTEGER, destOffset AS INTEGER, sizeX AS INTEGER, sizeY AS INTEGER)
'Puts a transparent sprite to the specified size
DIM xpos AS SINGLE, ypos AS SINGLE
DIM xscale AS SINGLE, yscale AS SINGLE
DIM totalx AS SINGLE, totalY AS SINGLE
DIM transX AS SINGLE, transY AS SINGLE
transX = sizeX: transY = sizeY
DEF SEG = sourceSegment
totalx = PEEK(sourceOffset)
totalY = PEEK(sourceOffset + 2)
xscale = totalx / transX
yscale = totalY / transY
ypos = 0
FOR ay = y TO (y + sizeY)
  xpos = 0
  FOR ax = x TO (x + sizeX)
    dood = INT((INT(ypos) * totalx * 2) + (INT(xpos) * 2) + 4)
    DEF SEG = sourceSegment
    Colour = PEEK(sourceOffset + dood)
    pixel = PEEK(sourceOffset + dood + 1)
    IF pixel <> 0 AND pixel <> 32 AND pixel <> 255 THEN USplaceElement ax, ay, pixel, Colour, destSegment, destOffset
    xpos = xpos + xscale
  NEXT
  ypos = ypos + yscale
NEXT
END SUB
Anyone got any ideas why this is happening? Thanks. Big Grin
I'd knock on wood, but my desk is particle board.
Reply
#2
Does this sub do some manipulating with the passed paramenters?

USplaceElement ax, ay, pixel, Colour, destSegment, destOffset
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#3
Nope...USplaceElement is effectively the PSET routine. It doesn't alter the data in any way; it just plots the character on the screen.
I'd knock on wood, but my desk is particle board.
Reply
#4
What is it supposed to look like? :???:
Reply
#5
It's supposed to look like a box. Big Grin

The solid white blocks surround the spotty green ones. It's the same demo sprite as used in the Useless Sock sprite demonstration.
I'd knock on wood, but my desk is particle board.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)