V8 beta

Previous topic - Next topic

MrTAToad

Looks like it :)

Moru

As a temporary workaround, just make the bitmap slightly higher and it should work :-)

dijster

Will future versions feature auto rotation, so the iPad can be help in either horizontal position and the display will correct itself?

I think I read somewhere that a game got rejected because it didn't do this.
Might just have been an arsey tester though

Kitty Hello

rotate it yourself. I'll post a code snippet for that.

dijster

Cool, thanks for answering.
It's great fun running code on the iPad, thanks again!!!

gregbug

#50
HI!

i'm trying to convert my code to v8 beta ...

in this code...
Code (glbasic) Select

TYPE geTimer
FrameRate# = 0 // Frequenza aggiornamento logica del gioco (in millisecondi)
LastTime# = 0 // Ultimo aggiornamento ?
ElapsedMS# = 0 // Milliseconti impiegati per eseguire un loop logico...
NumTicks# = 0 // Numero dei cicli logici...
LastNumTicks# = 0 // Numero dei cicli logici... ciclo precedente...
MilliSecs# = 0 // millisecondi di aggiornamento (frequenza)...
Threshold% = 150

// Inizializza il motore di timing con i valori di default iniziali.
FUNCTION Init: LogicFrameRate% = 200
self.MilliSecs# = 1000/LogicFrameRate%
self.LastTime# = GETTIMERALL()
self.NumTicks# = 0.0
self.Threshold% = LogicFrameRate%
ENDFUNCTION

// Calcola i cicli logici da eseguire
FUNCTION UpdateLogic: GamePhase%
LOCAL NowMS# = GETTIMERALL() // Millisecondi attuali...

self.ElapsedMS# = NowMS# - self.LastTime# // Millisecondi trascorsi dall'ultimo aggiornamento....

IF self.ElapsedMS# > self.Threshold%    // Se è intercorso un tempo maggiore dell'intervallo fisso (pc molto lento)
self.ElapsedMS# = self.Threshold% // allora impostiamo il minimo...
ENDIF

self.NumTicks# = (self.ElapsedMS# / self.MilliSecs#) // Numero dei cicli logici da eseguire...
self.LastTime# = NowMS#

LOCAL cLoops% = 0
WHILE cLoops% < self.NumTicks#
LogicUpdater(GamePhase%)
// *************** //
INC cLoops%, 1
// *************** //
WEND
ENDFUNCTION

// Questa è la funzione che aggiorna la logica del gioco...// da ridefinire ...
CALLBACK FUNCTION LogicUpdater: GamePhase%
// QUESTA FUNZIONE E' DA RIDEFINIRE ALL'INTERNO DEL GIOCO
// E CI SI DEVE INSERIRE TUTTA LA LOGICA DEL GIOCO
// GAME PHASE E' UNA VARIABILE INTERA CHE SERVE PER
// ESEGUIRE UN SELECT DELLA LOGICA DELLA SEZIONE DEL
// GIOCO DA CUI SI RICHIAMA...
ENDFUNCTION

// Impostiamo la velocità (in fotogrammi al secondo) della logica...
FUNCTION SetLogicFrameRate: Logic_Rate%
self.FrameRate = Logic_Rate%
self.MilliSecs = 1000.0/self.FrameRate
ENDFUNCTION
ENDTYPE

GLOBAL Timer AS geTimer
// Inizializza Genesis Engine
FUNCTION ge_InitEngine: LogicHZ% = 200
Timer.Init(LogicHZ%)
ENDFUNCTION

// Dealloca e libera la memoria utilizzata dell'engine
FUNCTION ge_FreeEngine:
ENDFUNCTION


if i compile with "unfolded" function v8 beta compile ok
but if  i "colse" the functions the compiler make this error:
Code (glbasic) Select


_______________________________________
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.6.972 SN:654fb5e3 - 3D, NET
Wordcount:19 commands
compiling:
C:\DOCUME~1\GregBUG\IMPOST~1\Temp\glbasic\gpc_tempg.cpp: In member function `DGInt __GLBASIC__::geTimer::LogicUpdater(DGNat)':
C:\DOCUME~1\GregBUG\IMPOST~1\Temp\glbasic\gpc_tempg.cpp:66: error: a function-definition is not allowed here before '{' token
C:\DOCUME~1\GregBUG\IMPOST~1\Temp\glbasic\gpc_tempg.cpp:58:1: unterminated #ifndef
C:\DOCUME~1\GregBUG\IMPOST~1\Temp\glbasic\gpc_tempg.cpp: At global scope:
C:\DOCUME~1\GregBUG\IMPOST~1\Temp\glbasic\gpc_tempg.cpp:78: error: expected `}' at end of input
*** FATAL ERROR - Please post this output in the forum
_______________________________________
*** Finished ***
Elapsed: 1.6 sec. Time: 14:50
Build: 0 succeeded.
*** 1 FAILED ***


it's is my fault or a bug?  :blink:

thanks.


ops... and is possible (feature request :)) to add type folding too?
thanks again!

Ciao Ciao,
Gianluca. (l'Aquila tornerà a volare alta nel cielo!!!!)

Slydog

Or, how about adding a general code folding directive, like Visual Studio:
http://msdn.microsoft.com/en-us/library/9a1ybwek.aspx

Like:
Code (glbasic) Select

#region Region Title
... code ...
#endregion


This would be handy for organizing larger projects / files by grouping common routines as one region.
Ha, but then what about nested regions?!
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Kitty Hello

aw, cool.

aonyn

Or the ability to add custom keywords and custom folding.
In purebasic, I use ;Segment_SomeDescription and ;EndSegment for folding sections of code.
Very useful, and keeps things looking tidy.

regards,
Dave
For by grace are ye saved through faith, and that not of yourselves: it is the gift of God: Not of works, lest any man should boast. -Ephesians 2:8-9

gregbug

nobody has the same problem with the IDE? (compile error with function folding?)
Ciao Ciao,
Gianluca. (l'Aquila tornerà a volare alta nel cielo!!!!)

Slydog

#55
I haven't tried it myself.
But, could it be specifically only when you use CALLBACK functions?

The error states:
Code (glbasic) Select
C:\DOCUME~1\GregBUG\IMPOST~1\Temp\glbasic\gpc_tempg.cpp: In member function `DGInt __GLBASIC__::geTimer::LogicUpdater(DGNat)':


And your function definition for LogicUpdater is:
Code (glbasic) Select
CALLBACK FUNCTION LogicUpdater: GamePhase%

[Edit]
Can you even have CALLBACK functions nested in a TYPE?

Quote from: gregbug on 2010-Jun-30
nobody has the same problem with the IDE? (compile error with function folding?)
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

gregbug

a little update...
the compiler only generate errors when "close" one of this function:

   CALLBACK FUNCTION LogicUpdater: GamePhase%
   FUNCTION UpdateLogic: GamePhase%
        FUNCTION ge_InitEngine: LogicHZ% = 200
        FUNCTION ge_FreeEngine:


mmmm. i'm going crazy...  :rant:

Ciao Ciao,
Gianluca. (l'Aquila tornerà a volare alta nel cielo!!!!)

MrTAToad

#57
With callbacks, this works :

Code (glbasic) Select
TYPE TT
CALLBACK FUNCTION moo%:
DEBUG "Yes\n"
ENDFUNCTION
ENDTYPE

LOCAL t AS TT

t.moo()


But not this :

Code (glbasic) Select
TYPE TT
CALLBACK FUNCTION moo%:
DEBUG "Yes\n"
ENDFUNCTION

FUNCTION moo%:
ENDFUNCTION
ENDTYPE

LOCAL t AS TT

t.moo()


I had no problem compiling with folded code -there is an error in the ge_FreeEngine function : ENDFUNCTIONG "No\n".  Fix that to something more valid, and all should be fine :)

Kitty Hello

does a callback within a type work? Dude, that's not intended. Use a PROTOTYPE instead. Much cleaner.

MrTAToad

I haven't tried a CALLBACK in a TYPE and the proper function outside it yet - will be interesting to see what happens :)