forums

TNT Basic Forums > Bugs!
Another Hardware Mode Bug
< Last Thread     Next Thread >
Author
Thread        Post A Reply

08-17-2003 03:16

Posted by:
CubeFusion

Location:
California, USA

Find more posts by CubeFusion

http://home.earthlink.net/~cubefusion/downloads/hardware_mode_bug.sit

Line 49 controls whether the program uses Hardware Mode or not. Just change gHardwareMode=TRUE to gHardwareMode=FALSE to turn off hardware mode.

In the above code, switching between hardware mode and software results in some very stretched and distorted sprites. This is what they look like in both modes.

Hardware Mode Off (This is the way it is supposed to look)


Hardware Mode On (Sprites are distorted)


I'm not doing any calls to mess with the size of the sprites, so I honestly can't figure out why there is such a difference between hardware and software with the same code. A bug in TNT perhaps?

08-17-2003 06:17

Posted by:
eekaydee

Location:
CA, USA

Click Here to Email eekaydee   Find more posts by eekaydee

It seems like a problem with the masking. Try painting canvas 0 blue and you will see what I mean.

08-17-2003 14:00

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

You don't use any transformation? I wouldn't be surprised if not. hardware mode is not even useable on my computer cause there are so many bugs: sprites being distoreted sometimes, map being always distorted, sprites displayed as flat squares, etc... Your bug is the latest in a long serie

08-17-2003 17:54

Posted by:
CubeFusion

Location:
California, USA

Find more posts by CubeFusion

eekaydee hit the nail on the head for this one. It seems the command "Copy Image" is the source of the problem. It doesn't correctly use the second image as a mask for some reason. This is the part of the code affected by the bug. I needed this procedure to break those large Escape Velocity style 6x6 grids of sprites into each individual element and copy them into image bank 132.

PROCEDURE DeconstructSpriteTable(INT id,INT targetID,INT rows,INT columns,INT offset,INT totalSprites)
INT width,height,count,hGridLocation,vGridLocation,rectLeft,rectTop,rectRight,rectBottom,currentSprite

width = IMAGE WIDTH (id,129) / columns
height = IMAGE HEIGHT (id,129) / rows

OPEN CANVAS 19,IMAGE WIDTH (id,129),IMAGE HEIGHT (id,129) ' Open Sprite Canvas
OPEN CANVAS 20,IMAGE WIDTH (id,130),IMAGE HEIGHT (id,130) ' Open Mask Canvas

CANVAS 19
PASTE IMAGE 0,0,id,129

CANVAS 20
PASTE IMAGE 0,0,id,130

FOR currentSprite = 0 to totalSprites-1

' Get Grid Location
hGridLocation = MOD (currentSprite,rows)
vGridLocation = currentSprite / rows

' Get Rectangle Location
rectLeft = hGridLocation * width
rectTop = vGridLocation * height
rectRight = rectLeft + width
rectBottom = rectTop + height

' Copy Sprite to new location
CANVAS 19
COPY IMAGE rectLeft,rectTop,rectRight,rectBottom,20,rectLeft,rectTop,FALSE TO (targetID+currentSprite),132

IF offset = TRUE THEN SET IMAGE OFFSETS targetID+currentSprite,132,width*0.50,height*0.50

NEXT currentSprite

CLOSE CANVAS 19 ' Close Sprite Canvas
CLOSE CANVAS 20 ' Close Mask Canvas

END PROC

There is another bug that I have seen many times in hardware mode, sometimes sprites will not display correctly if they are not seen through a viewport. The pong demo is pretty messed up for me unless I set everything through a viewport, odd.

08-17-2003 18:21

Posted by:
Mark Tully

Location:
TNT HQ, England

Click Here to Email Mark Tully   Find more posts by Mark Tully

Hmm.. I didn't know about any bugs with copy image. I've added it to our bug list and will investigate it further.

Also, Matthew, what version of Mac OS are you using, on what computer with what gfx card? (Check the system profiler tool if on OS 9 or above).

Cheers,

Mark

08-17-2003 23:14

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

>
Also, Matthew, what version of Mac OS are you using, on what computer with what gfx card? (Check the system profiler tool if on OS 9 or above).
>

Well, I have a 8.6 iMac ( originally 8.5 ), I don't know about the card, and I have reported tons of bugs but I just realised there was nothing to do but buying a new computer :(

08-21-2003 03:44

Posted by:
Wil Hostman

Find more posts by Wil Hostman

Replicated!

Replicated on iMac DVSE 500mhz g3,

OS X 10.2.6 (6L60)

ATY Rage 128Pk

Near identical effects.

08-21-2003 10:03

Posted by:
matteo

Location:
Venice, ITALY!

Click Here to Email matteo   Find more posts by matteo

beware of the deceptive bull-frog shabadow manabullow shydorguer iz rajdorguer in your face

I hate when people to expose bugs give code longer than 20 lines. Argh, I'll never gonna read it :-P

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.