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

Username:   Password: 
 RegisterRegister   
 Having Loading picture trouble, not the usual problem
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
MrShrimp




PostPosted: Sun May 23, 2004 6:07 pm   Post subject: Having Loading picture trouble, not the usual problem

The usual picture loading problem when using the Pic.FileNew and Pic.Draw statements is having a picture id of 0 or less. Turing uses the predfined identifiers of 0 or less in the Pic module to tell you that it had trouble importing the picture(usually incorrect file name or picture doesnt exist).

However i recently got errors because the pictures have IDs of 3500 or higher. "Illegal picture id number 3500 ('3500' is not a legal identifier.)."
The picture only seems to not work in my main program, if i make a test file the picture loads and draws normally. Im almost sure it isnt the code either because im loading and drawing a similiar picture in the EXACT same way.

Did i have too many pictures in or something?
Anybody encountered this before and could help me?
Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Sun May 23, 2004 6:42 pm   Post subject: (No subject)

How many pictures do you actually have for that prog?
Tony




PostPosted: Sun May 23, 2004 10:58 pm   Post subject: (No subject)

yes, there's a limit on the amout of pictures you could have. I'm sure that you're not displaying all 3500 of them on screen at same time, so use Pic.Free to free the pictures that are no longer in use.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
MrShrimp




PostPosted: Mon May 24, 2004 8:50 am   Post subject: (No subject)

Hmm even if i free it i dont think it will work. I think that the problem is that i load all the pictures and frames of each picture before hand so that it doesnt slow down my game while running with trying to load pictures. So now even if i free unused pictures it'll still have an id of over 3500. Oh well ill just change some things around i guess. And i dont actually have 3500 pictures loaded. I have ALOT less than that.
MrShrimp




PostPosted: Mon May 24, 2004 9:02 am   Post subject: (No subject)

Uhh forget what i said, i just changed it so that each object only has two frame of animation and that only one instance of each class being created. so now theres only about 3 objects with 2 pictures each... and the illegal picture id 3500 is still happening..

Well i give up, time to check my pic loading code AGAIN
Tony




PostPosted: Mon May 24, 2004 2:35 pm   Post subject: (No subject)

maybe you're loading the same picture over and over in some loop and that causes a problem? Thinking
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
PhOeNiX-47




PostPosted: Mon May 24, 2004 6:50 pm   Post subject: (No subject)

Use a variable to store the pic names , it worked for me
guruguru




PostPosted: Mon May 24, 2004 7:10 pm   Post subject: (No subject)

Can you post some code? That way we will be able to help you better.
Sponsor
Sponsor
Sponsor
sponsor
PhOeNiX-47




PostPosted: Mon May 24, 2004 7:44 pm   Post subject: (No subject)

Certainly

code:
var pic : int := Pic.FileNew ("image.bmp")

Pic.Draw (pic, 0, 0, picMerge)


That's the basics. I found out that everytime my program ran a new loop my aniamtion became slower and slower. I thought this would fix my problem and it did. Hope that works.
guruguru




PostPosted: Mon May 24, 2004 8:09 pm   Post subject: (No subject)

Haha lol. No I need the original posters code... silly Phoenix Wink .
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  [ 10 Posts ]
Jump to:   


Style:  
Search: