HI!
i'm trying to convert my code to v8 beta ...
in this code...
if i compile with "unfolded" function v8 beta compile ok
but if i "colse" the functions the compiler make this error:
it's is my fault or a bug?
thanks.
ops... and is possible (feature request ) to add type folding too?
thanks again!
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?
thanks.
ops... and is possible (feature request ) to add type folding too?
thanks again!