Author Topic: V8 beta  (Read 59286 times)

MrTAToad

  • Guest
Re: V8 beta
« Reply #45 on: 2010-Jun-24 »
Looks like it :)

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1781
    • View Profile
    • Homepage
Re: V8 beta
« Reply #46 on: 2010-Jun-24 »
As a temporary workaround, just make the bitmap slightly higher and it should work :-)

Offline dijster

  • Mc. Print
  • *
  • Posts: 23
    • View Profile
Re: V8 beta
« Reply #47 on: 2010-Jun-25 »
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

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10725
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: V8 beta
« Reply #48 on: 2010-Jun-25 »
rotate it yourself. I'll post a code snippet for that.

Offline dijster

  • Mc. Print
  • *
  • Posts: 23
    • View Profile
Re: V8 beta
« Reply #49 on: 2010-Jun-25 »
Cool, thanks for answering.
It's great fun running code on the iPad, thanks again!!!

Offline gregbug

  • Mr. Drawsprite
  • **
  • Posts: 54
    • View Profile
Re: V8 beta
« Reply #50 on: 2010-Jun-30 »
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!

« Last Edit: 2010-Jun-30 by gregbug »
Ciao Ciao,
 Gianluca. (l'Aquila tornerà a volare alta nel cielo!!!!)

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 930
  • KodeSource
    • View Profile
    • KodeSource
Re: V8 beta
« Reply #51 on: 2010-Jun-30 »
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]

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10725
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: V8 beta
« Reply #52 on: 2010-Jun-30 »
aw, cool.

Offline aonyn

  • Mr. Polyvector
  • ***
  • Posts: 136
    • View Profile
Re: V8 beta
« Reply #53 on: 2010-Jun-30 »
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

Offline gregbug

  • Mr. Drawsprite
  • **
  • Posts: 54
    • View Profile
Re: V8 beta
« Reply #54 on: 2010-Jun-30 »
nobody has the same problem with the IDE? (compile error with function folding?)
Ciao Ciao,
 Gianluca. (l'Aquila tornerà a volare alta nel cielo!!!!)

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 930
  • KodeSource
    • View Profile
    • KodeSource
Re: V8 beta
« Reply #55 on: 2010-Jun-30 »
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?

nobody has the same problem with the IDE? (compile error with function folding?)
« Last Edit: 2010-Jun-30 by Slydog »
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Offline gregbug

  • Mr. Drawsprite
  • **
  • Posts: 54
    • View Profile
Re: V8 beta
« Reply #56 on: 2010-Jun-30 »
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

  • Guest
Re: V8 beta
« Reply #57 on: 2010-Jul-01 »
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 :)
« Last Edit: 2010-Jul-01 by MrTAToad »

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10725
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: V8 beta
« Reply #58 on: 2010-Jul-01 »
does a callback within a type work? Dude, that's not intended. Use a PROTOTYPE instead. Much cleaner.

MrTAToad

  • Guest
Re: V8 beta
« Reply #59 on: 2010-Jul-01 »
I haven't tried a CALLBACK in a TYPE and the proper function outside it yet - will be interesting to see what happens :)