How can the declaration below work? Freebasic is not case sensitive I thought?
And, do you compile with -exx? I get an 'out of bounds' on:
Code: Select all
If g < LargArqFonte - 1 Then PosLetra (h, 0) = g + 1
Hum, this may be a consequence of not loading images here it seems.
Code: Select all
Carregou = BLoad ("Res\Fonte.bmp", Grafx2)
Above fails here, not sure why yet. Ah, the "\". Changed to "../Res/xxx.bmp"
Now it compiles and starts without directly crashing, but behavior between 32 and 64-bit fbc is different here as well.
With 64-bit it seems I can start a game, but the map is empty.
With 32-bit I get stuck in the menu:
https://nr100.home.xs4all.nl/badidea/mi ... -09-18.png
The main sub-routine is a 1500-line select case / end select block :-)
This looks bad and seems to get the 32-bit version stuck here:
Timer returns a very large number on linux (seconds since 1970), multiply that by 1000 and try to store it in 32 bits. In TrocaTelas() or SwapScreens()
As a quick solution, you could try to make a "timer2" function which returns the number of seconds since program start. And use that everywhere instead of "timer". Something like this:
Code: Select all
function timer2() as double
static as integer init = 0
static as double startTimer
if init = 0 then
init = 1
startTimer = timer()
end if
return timer - startTimer
end function
Maybe timer_(), timer2 is already used.
Menu unstuck:
https://nr100.home.xs4all.nl/badidea/mi ... MinerX.bas
Next problem: Get a map loaded... This seems like really messy code.
But any binary file reading/writing should be checked for (u)integers. E.g.:
Code: Select all
Get #1, , Object (MXR + f, MYR + g).tp
Code: Select all
'Objects
Type TObj
Tp As UByte 'Object type
IsFalling As Byte '0=no; 1=yes
WasFalling As Byte 'Was falling in previous Cycle
BeingPushed As Byte '0=no; 1=to right; 2=to left
StepNumber As Integer 'Of movement
End Type
So 'StepNumber' could cause problems. But so far, I get no or empty maps.