Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Pic.Rotate
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
david92ng




PostPosted: Thu Apr 10, 2008 11:24 am   Post subject: Pic.Rotate

When I rotate a picture, I get this error after about... 30 seconds. "Cannot allocate item. Out of id numbers (Max 1000)."
This is part of the program i made that uses it. It is my first time i used Pic.Rotate and have no idea how to fix or it means.

setscreen ("Graphics:1000;800")
var chars : array char of boolean
%========================
var ship : int
var currentship : int
var angle : int := 1
ship := Pic.FileNew ("test.bmp")
%========================
var x, y : int := 1
var xmove, ymove : int := 0

loop
Input.KeyDown (chars)

if chars (KEY_UP_ARROW) then
ymove += 1

end if
if chars (KEY_RIGHT_ARROW) then
angle += 2
xmove += 1

end if
if chars (KEY_LEFT_ARROW) then
angle -= 2
xmove -= 1

end if
if chars (KEY_DOWN_ARROW) then

ymove -= 1
end if
if ymove > 3 then
ymove := 2
elsif ymove < -3 then
ymove := -2
end if
if xmove > 3 then
xmove := 2
elsif xmove < -3 then
xmove := -2
end if
x := x + xmove
y := y + ymove
if angle > 360 then
angle := (angle - 360)
end if
if angle < 0 then
angle := (angle + 360)
end if


currentship := Pic.Rotate (ship, angle, -1, -1)
put x, " ", y, " ", angle
Pic.Draw (currentship, x, y, picCopy)
View.Update
delay (100)
cls

end loop
Sponsor
Sponsor
Sponsor
sponsor
Nick




PostPosted: Thu Apr 10, 2008 2:11 pm   Post subject: RE:Pic.Rotate

pic.free Wink
andrew.




PostPosted: Thu Apr 10, 2008 4:34 pm   Post subject: Re: Pic.Rotate

Turing only allows you to have a max of 1000 things. To get around this, you have to "free" the picture with Pic.Free like nick said.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: