How Fast?


Quiest

I like turtles!
Joined
Sep 2, 2004
Messages
3,411
Age
38
Location
Dteuschland ;)
How fast is SDL on the gp2x?

I mean, at which fps should a game run for example on my
1.6ghz laptop, to be running at a constant 60fps on the gp2x?


Thanks in advance,
and I hope it hasnt been asked already, as I was to lazy to
search. (I`m finished at work now, just finishing this post,
and I`m off to drive home.)


EDIT:
I got yet another thing to ask and I dont wanna open a new
thread again, so I`m asking here:

Why does this work:
Code:
SDL_Surface *water_effect(SDL_Surface *back)
{
	[b]for(int y=1; y<y_res-1; y++)[/b]
	{
		for(p.x=1; p.x<x_res-1; p.x++)
		{
			p.y=y;

			wave[j][p.x][p.y]=((wave[i][p.x-1][p.y]
							   +wave[i][p.x+1][p.y]
							   +wave[i][p.x][p.y-1]
							   +wave[i][p.x][p.y+1])>>1)-wave[j][p.x][p.y];

			wave[j][p.x][p.y]-=wave[j][p.x][p.y]>>4;


			if(wave[i][p.x][p.y]!=0)
			{
				p_mod.x=p.x+(wave[j][p.x+1][p.y]+wave[j][p.x-1][p.y])/50;
				p_mod.y=p.y+(wave[j][p.x][p.y+1]+wave[j][p.x][p.y-1])/50;
				SDL_BlitSurface(back,&p_mod,water,&p);
			}
		}
	}
	if(i){i=0;j=1;}else{i=1;j=0;}
	return water;
}

but this doesn`t:
Code:
SDL_Surface *water_effect(SDL_Surface *back)
{
	[b]for(p.y=1; p.y<y_res-1; p.y++)[/b]
	{
		for(p.x=1; p.x<x_res-1; p.x++)
		{
			wave[j][p.x][p.y]=((wave[i][p.x-1][p.y]
							   +wave[i][p.x+1][p.y]
							   +wave[i][p.x][p.y-1]
							   +wave[i][p.x][p.y+1])>>1)-wave[j][p.x][p.y];

			wave[j][p.x][p.y]-=wave[j][p.x][p.y]>>4;


			if(wave[i][p.x][p.y]!=0)
			{
				p_mod.x=p.x+(wave[j][p.x+1][p.y]+wave[j][p.x-1][p.y])/50;
				p_mod.y=p.y+(wave[j][p.x][p.y+1]+wave[j][p.x][p.y-1])/50;
				SDL_BlitSurface(back,&p_mod,water,&p);
			}
		}
	}
	if(i){i=0;j=1;}else{i=1;j=0;}
	return water;
}
p is a rect, btw (as is p_mod). I`m as confused as ever ^^
The for loop works for p.x but something is not right with p.y.
It totally renders the effect uneffectful :p
(tho there shouldn`t be any difference to the first version,
or should there?)

And please dont tell me that this`ll be slow on the gp2x.
I know. I`m already trying to make it faster.


EDIT2:
Hmm, bold tags in code tags dont work :D so please look at the
parts surrounded by the tags.
 

Parkydr

Developing for the GP2X since 2006
Joined
Dec 3, 2005
Messages
1,357
Website
www.parkydr.ezeedsl.co.uk
Come on people sad.gif Am I that annoying?

Yes :)

It's not really possible to do a direct fps translation, it's a different processor and the frame rate most probably is not limited by the processor speed on the PC. You may get 60 fps on the GP2X but it depends how processor intensive your code is.

You just have to try it and see.

I can't see anything obviously wrong with your code. It won't necessarily be too slow - it depends on what else you're doing.
 

Dr_Ian

Still Fresh
Joined
Sep 18, 2006
Messages
91
I guess both bits of code should be the same.
Does it make a difference if p.y = y is placed before the x loop?
 
Top