Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - gregbug

#16
Announcements / Re: V8 beta
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!

#17
Quote from: bigsofty on 2010-May-08
This seems to have been fixed.

Can someone with an iPhone give this a test please, just to be sure?

Many thanks,


Ian

wow... just tested on my iPhone 3GS work fine (solid 60FPS!)
#18
yeeeaaahhh!!!!
thanks!
#19
Quote from: Kitty Hello on 2010-Apr-27
It should work already. Try alphamode -1 at the start and right before the endpoly. And alphamode xxx in between the polyvector calls.

work fine thanks!
#20
Quote from: Kitty Hello on 2010-Apr-27
Uhm... No.
I was fixing the reduction to 2PFS when you use coloured vertices. It should be slightly faster with the next update.

wow thanks!

any news on alphamode with polyvector ?
#21
Quote from: trucidare on 2010-Apr-25
because initialisation on deklaration wont work on globals.

GLOBAL var
var = muh();

doh!

Thanks !
#22
why GLBasic crasch with this code ?

Code (glbasic) Select

SETCURRENTDIR("Media") // seperate media and binaries?
global sp1GFX = geSprite_LoadGFX("1.png")

FUNCTION geSprite_LoadGFX: Filename$
LOCAL gfxID = GENSPRITE() //geID_GetFreeGFX(gfxIsSprite%)
LOADSPRITE Filename$, gfxID
RETURN gfxID
ENDFUNCTION


if the var sp1GFX is LOCAL no crash!!! if it's Global it CRASH!!! why?  :noggin:

thanks!
#23
Quote from: Dark Schneider on 2010-Apr-24
Please clarify me, that means that setting and ALPHAMODE other than 0 or passing a param col% to POLYVECTOR is slow on iPhone and other OpenGL ES devices?.

on my iPhone 3gs passing color param to polyvector the fps pass from solid 30fps at 2-3FPS!!!

alphamode runs fine.
#24
Quote from: monono on 2010-Apr-23
Quoteand it works?
@Scott: thanks for your thoughts, but I dont know exactly how to do that. I donÃ,´t draw one polyvector for one sprite. I do draw nearly all sprites with one polyvector. ThatÃ,´s why I canÃ,´t use sprcoll with the image source. ItÃ,´s one big image, with all single graphics together, splitted up all over my polyvector. Can you pls explain what you mean in code. (I hope gregbug is satisfied and this is not too off-topic)

Thanks to all for the explanations!

@Monono I use the same technique to draw my sprites ... (One big texture) (I try to squeeze more fps from my iPhone)
for the collision I have implemented (or rather trying to implement) bbc technique (Bounding box collision) and for the sprites that are rotated OBBC (oriented bounding box collision)

for perfect pixel collision I do not know how to implement them! any suggestions?  (Scott_AW?) =D
#25
please... please... add polyvector with alpha!!!!  =D
i need it in my sprite lib (iPhone) that use polyvector and POLYNEWSTRIP

thanks!.
#26
again on polyvector...  =D

I'm trying to optimize my code... to render sprites using polyvector... for iPhone 3GS

using simple polyvector the speed is the same that using Drawsprite... (tested on 250 sprites 32x32 pixel)  :zzz:
using polyvector if i modify the color param the speed or alphamode on my iPhone is very very very slow... (30fps -> 1-2 Fps!!!)  :'(

I tried to use POLYNEWSTRIP and i had an huge speed boost! (solid 60fps) even if i change the color param or alphamode of polyvector...  :good:

now... my questions are:

1. is possible to change the alphamode of a sigle sprite using POLYNEWSTRIP ? ... if i change a sigle alpha value on a sprite all sprite change the alpha value... !

2. why on normal polyvector the color param or alphamode is so slow? (on iPhone) and on POLYNEWSTRIP do not slow ?

thanks!

Gianluca.

#27
Quote from: Moru on 2010-Jan-29
With polyvector you can specify the color of all corners which means flashing sprites in different colors, you can stretch in different angles, rotate and do whatever you like to the poor little things, Drawsprite just ... draws a sprite :-)

ah ok. thanks Moru!
but how about the speed? polyvector is faster?
#28
Excuse the beginner question ....  ::)
What are the advantages of using PolyVector instead of DrawSprite?
There are advantages in terms of speed? (and if there are ... as you can 'optimize everything to get the maximum speed of drawing?)

Thanks to all who have the time and patience to answer me ...  :P
#29
yes... yes... i'm using showscreen... ... and yes my iPhone is turned on and connected  :P (my next game is almost done...) and work perfect if compiled from my main dev-mac.

the problem is when i try to dev on my macbook (just reinstalled osx sl 10.6.2) transferred the apples certificates...
but not work... the games start on iphone (no error on provisioning certificates) but show only a black screen...

I am not saying that it is a Glbasic problem...  i think that it's a configuration problem on my macbook...
... mah! ...

I was hoping that it was already happened to someone else and then have a quick solution ...
... However I will try more testing ... I will keep you informed ... If you are interested ..  :P


OK. SOLVED.
small update ...

I do not know why, but I reinstalled the system, paralles, certificates and now everything works perfectly on the MacBook!

mah ... I did not understand well ... but now, at last, everything worked perfectly on the MacBook ... better that way ...

thank you all anyway for trying to help me!
#30
Quote from: MrTAToad on 2010-Jan-11
Copied your media into the correct location ?

yes...


i also tried a test program (like printing some text on the screen) but always black screen!... (the same folders copied in my main dev-mac and recompiled just work fine!)  :o

i don't know....  investigating now...