
-----------------------------------
Brightguy
Sun May 30, 2004 5:42 am

TIM files
-----------------------------------
The Turing IMage File...  it seems like a very awkward format.  Unfortunately I'm doing a project in good ol' DOS Turing, and I don't know of any other method to load images.  In the past, I've had troubles with colours being distorted when I try to display the image, so this time I'm using a basic 2-colour image.  I can get it to display, but for unknown reasons, it won't display if I change the x-value of where to place the image on the screen.  It only displays when the x-value is 0.  Any one here ever work with TIM files before?  Here's the code to read the file...
var maxArray := 8000

% Procedure to read a TIM file and write it to the screen
procedure fileToScreen (x, y : int, fName : string, var ok : boolean)
	var Y := y
	var pic : array 1 .. maxArray of int
	var fs : int

	open : fs, fName, read
	ok := fs > 0
	if not ok then
	    return
	end if
	var bytesToRead, bytesRead : int
	loop
	    exit when eof (fs)
	    read : fs, bytesToRead
	    read : fs, pic : bytesToRead : bytesRead
	    drawpic (x, Y, pic, 0)
	    Y += pic (1) + 1
	end loop
	close : fs
end fileToScreen

-----------------------------------
Delta
Sun May 30, 2004 6:58 am


-----------------------------------
Wow dude! Hats off to you. Poor guy. Why are you still using classic turing? Seriously do yourself a favour and get WinOOT at least. Man oh man. lol.

Well anyways. Now that that's over and done with. Oh ya, your problem. I've never used .TIM files but right off the bat I know your problem (*Whispers : Your using dos turing*) Buts thats ok I guess.

maybe this line has something to do with it
drawpic (x, Y, pic, 0)
because after all you are using an array, so therefore your should use an index of that array
for example :
drawpic (x, Y, pic(1), 0)

but then again you'd get an error because that parameter doesn't call for an integer does it. Hmmmm. I tried finding a version of DOS turing, but I couldn't. I'll try again but ya I dunno. Well I really hate saying, but dude.... your on your own :(

-----------------------------------
Delos
Sun May 30, 2004 4:38 pm


-----------------------------------
Oh man...[lugs out ol' Classic Turing]...

Now what...oh rite...I need a TIM file!

Care to post one?  Hopefully Delta already solved stuff for you...but in case, there still do exist other people with access to Classic Turing...sadly...

-----------------------------------
beard0
Sun May 30, 2004 5:25 pm


-----------------------------------
I myself only upgraded to WinOOT this year, but I was using a newer old version of turing - see if the TM2 image type will work - here are the procedures for it:

procedure FileToScreen (x, y : int, fileName : string)
    var version : int       
    var bufferSize : int    
    var xSize, ySize : int
    var screenWidth, screenHeight, screenColors : int
    var screenMode : string (11)
    var paletteUsed : int   
    var fs : int            
    open : fs, fileName, read
    if fs 