Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / What have I done?

Author
Message
FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 21st Aug 2003 23:45 Edited at: 21st Aug 2003 23:54
Here's my code:



All was working fine until I changed the name of the image I am trying to load. I changed the name in the code, deleted the old image that was in the project folder and added the new one. However, I keep getting a runtime error saying that it cannot load image at line 41. Line 41 is this one:



You can get the "metal.bmp" image by clicking below:
http://www.tinywars.dsl.pipex.com/images/metal.bmp
and the "splodge.bmp" image here:
http://www.tinywars.dsl.pipex.com/images/splodge.bmp

Of course, you only need one of them to test the code

Everything was working fine now its all screwed up! I don't know what I have done as I can't see any flaws with the code. Can someone help me out?

FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 22nd Aug 2003 00:00
As you can see from the code, every element in the array map(i,j) should = 1. Therefore, the compiler should interpret line 41 as:



But clearly it doesn't. I have put breaks in the code to test it and I can paste the image that is loaded but I think that for some strange reason the array is not being populated correctly!

FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 22nd Aug 2003 00:10
No worries, I've found the problem. It seems that loading an image after you have set the display settings is not smiled upon by DBP
Moving the load image command to underneath the set display mode seems to have done the trick

Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 22nd Aug 2003 00:31
Never gave me a problem that I can remember, but generally speaking it is good code policy to move prelimary setup above game-oriented file loading. It's a good habit to get into if you know what I mean

--Mouse

Famous (Avatarless) Fighting Furball
FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 22nd Aug 2003 00:33
Well, they say you learn something new everyday

Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 22nd Aug 2003 15:22
Setting the display mode flushes the video memory. It dumps all your textures, all your objects, and empties next doors dustbin.

Pneumatic Dryll
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 22nd Aug 2003 16:58
It's a pity it doesn't empty yours for you too

Login to post a reply

Server time is: 2026-07-23 15:49:33
Your offset time is: 2026-07-23 15:49:33