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 Discussion / Random Crash....Why????

Author
Message
Iceman
21
Years of Service
User Offline
Joined: 10th Jan 2003
Location:
Posted: 14th Jan 2003 01:17
Hi there.....

Does DB1.13 have ANY known problems with, say, memory leakage etc etc??

My program works fine, but when I load a large (15 meg) music files in to it, it sometimes bombs out back to windows.
This happens when I click on a New Game icon and the program jumps to the routine.

Any ideas as to why?

It also (AFTER it bombs out) gives this message if I try to re-load DB....
"Failed to set cooperative level for DirectDraw"
I think that this is not the reason it bombs, just a side-effect of it.

Here is a sample of the code for you to look at.....
(Any "*" and text after them I have added here... they are NOT in the real code)


REM START OF PROGRAM
hide mouse
cls 0
sync on
hide mouse
color backdrop 0

*Used for camera later on..Just ignore these 3 Variables*
pggh=25
pgxh=20
pgyh=20
*

REM *********TEST LINES for menu screen**************
ink rgb(244,214,210),1
tim=0
load music "pgmusic.wav",1
*This is the big 15 meg music file*

play music 1

*These are just simple pics for the menu*
load image "NG.bmp",95
load image "CO.bmp",96
load image "CR.bmp",97
load image "HE.bmp",98
load image "QU.bmp",99
load image "NM.bmp",100
load image "rotpg.bmp",101
load image "savecode.bmp",102
*
load bitmap "astral.bmp",0
wait 2500
cls
load bitmap "delzatelogo.bmp",0
wait 2500
cls
load bitmap "peatitlefin.bmp",0
wait 5000
sprite 95,50,200,95
sprite 96,50,250,96
sprite 97,50,300,97
sprite 98,50,350,98
sprite 99,50,400,99
for t=1 to 100
scale sprite 95,t
scale sprite 96,t
scale sprite 97,t
scale sprite 98,t
scale sprite 99,t
wait 1
next t
sprite 100,100,100,100

do

x=mousex()
y=mousey()
sprite 100,x,y,100

if mouseclick()=1 and sprite collision(95,100)>0 then goto megascroll
if mouseclick()=1 and sprite collision(96,100)>0 then goto gamecode
if mouseclick()=1 and sprite collision(97,100)>0 then gosub credits
if mouseclick()=1 and sprite collision(98,100)>0 then end
if mouseclick()=1 and sprite collision(99,100)>0 then end
sync
loop
REM ************End Menu screen*************
*The above just checks which sprite you have clicked on and goes to the routine....It works fine.*



REM ********************************************
REM THIS IS THE GAME
REM ********************************************
*this lot gets rid of any junk*
if sprite exist(95)=1 then delete sprite 95
if sprite exist(96)=1 then delete sprite 96
if sprite exist(97)=1 then delete sprite 97
if sprite exist(98)=1 then delete sprite 98
if sprite exist(99)=1 then delete sprite 99
if sprite exist(100)=1 then delete sprite 100

` clear junk from intro..If any!
for t= 1 to 100
if object exist(t)=1 then delete object t
if image exist(t)=1 then delete image t
next t
`End of clear routine


rem Create fog
fog on
fog color 0
fog distance 1500
aom=100
gosub gamestartup
sprite 2,0,0,999
sprite 3,10,100,5:sprite 4,30,100,5:sprite 5,50,100,5
sprite 6,70,100,5:sprite 7,90,100,5:sprite 8,110,100,5
sprite 9,130,100,5
sprite 11,180,115,6
set current bitmap 0
sync
`MAKE GROUND
make matrix 1, 2000, 2000, 45, 45

Ok.... thats it........ I know its not the best code ever...... it has to be cleaned up a bit.... but..... can ANYONE see where a prob may be in it.... OR in a DB bug??

Thanks.

Iceman

Login to post a reply

Server time is: 2024-04-23 09:40:36
Your offset time is: 2024-04-23 09:40:36