Oxygen Basic
Programming => Problems & Solutions => Topic started by: Peter on July 11, 2012, 07:17:30 AM
-
Deleted.
-
Hi Peter,
I use text markers for trimming the memory image. PE files require each section to be trimmed to the nearest 512 bytes. In the memory image, 4096 bytes is required.
Have you tried running empty frames? what components cause the GPF....
Charles
-
Hi Peter ...
I found that problem is in your Timer code..
btw in Timer2
look:
TestUfos
Timer1
'Timer2
Timer3
Timer4
Then work without crushing...why i don't know... :-\
-
Hmm weird im not sure what i do i just add comment
in line where jv is set to null:
Sub Timer2()
jv = jv +1
iF jv =50
'jv=0
jx = jx +1
iF jx = 21 Then jx=1
End iF
End Sub
And looks that there is no crush.. ::)
-
Hey Peter.. :)
Game work on excellent speed on my old 1.6GHz Pentium4 . ;)
Of course i test version with your win.inc
-
Looks almost identical to LoadBmp apart from /xframes /yframes.
Have you tried using loadbmp to see if it still crashes?
Also possible array overflows? These often cause unpredictable crashes.
Charles
-
I replace static type with ordinary INT inside fn LoadTiles():
Function LoadTiles(string File, sys xFrame,yFrame) as sys
iF xFrame=0 Then xFrame=1
iF yFrame=0 Then yFrame=1
int id: iF id <512 Then id +=1
THnd(id) = call LoadImage 0,File,0,0,0,16
THdc(id) = call CreateCompatibleDC(hdc)
call SelectObject THdc(id), THnd(id)
call GetObject THnd(id), sizeof info, &info
TWidth (id) = info.bmWidth /xFrame
THeight(id) = info.bmHeight/yFrame
Return id
End Function
and also i replace single with float type just to test how work.
float jv,zv,dv,r,za
And game work fine with good speed..
-
If it is an array boundary problem, the bug may not lie within LoadTiles, it looks fine to me, but without sight of your source code, I can only speculate.
When I'm really stuck I perform a type of binary convergence. It catches the most obscure bugs, and though it can be time consuming, it has not failed me yet. What is your debugging procedure Peter?
Charles
-
I killed this thread
There are too many experts here and I'm completely stupid.
Next time I will ask my Grandmother, she is computer woman scientist.
Hey man...
Don't be angry....
I am not expert at all ,especially not for games.
I just use method try-work/try-not->work
that is all...i know something about GUI programming in some languages
but sometimes i stuck in some things that i cannot belive why don't work
how i mean that must work...i hope you understand... ;)
-
Aurel, STOP TESTING!
I am not STUPID!
Ok...man..im stupid to for many,many things...