nerd of nerds
w00t!!!!
ok, so say i have an image that i blitted onto the screen from another C file that was converted using the gpconverter program... is there any way i can rotate it? preferably simple...code samples are VERY welcome 
#include "gpdef.h"
#include "gpstdlib.h"
#include "gpgraphic.h"
#include "math.h"
void GpMain(void *arg)
{
int i;
int x, y;
int length = 50;
float angle = 0.0;
float angle_stepsize = 0.1;
GPDRAWSURFACE gpDraw;
i = GpLcdSurfaceGet(&gpDraw, 0);
GpSurfaceSet(&gpDraw);
if ( !(GPC_LCD_ON_BIT & GpLcdStatusGet()) )
GpLcdEnable();
while (angle < 2 * 3.14159265)
{
x = length * sin (angle);
y = length * cos (angle);
GpPointSet(&gpDraw,x, y, 100);
angle += angle_stepsize;
while(1);
}
}
x = length * sin (angle) + 160;
y = length * cos (angle) + 120;
x = length * sin (angle);
y = length * cos (angle);
GpPointSet(&gpDraw, x + 160, y + 120, 100);
I guess someone is getting funny lately....mr.spiv posted on Mar 10 2004 at 07:49 AM said:I have some simple sprite scaling and rotation code for GP32.. I could post a link to when I manage to locate it <_<
naw, same result, even if i omit the centering part it draws the same rounded square (but only a quarter of it visible on screen due to the non centering).nerd of nerds posted on Mar 11 2004 at 09:05 PM said:hmmmm... maybe mine works becuase i use ADS... but, i can't wait until we get mr.spivs stuff... i want to make a crime-em-up game...
ok, it think i know what the prob is:
x = length * sin (angle) + 160;
y = length * cos (angle) + 120;
should be:
x = length * sin (angle);
y = length * cos (angle);
and if you want to center it then just to this:GpPointSet(&gpDraw, x + 160, y + 120, 100);
whats that supposed to mean?synkro posted on Mar 11 2004 at 09:17 PM said:I guess someone is getting funny lately....mr.spiv posted on Mar 10 2004 at 07:49 AM said:I have some simple sprite scaling and rotation code for GP32.. I could post a link to when I manage to locate it <_<
So am I. Maybe the math.h from that pack is faulty in some way?Arnout posted on Mar 12 2004 at 08:48 AM said:I have the same problems when using math functions like sin() cos sqrt() they all return 0.
So I use a .h with pre generated sin/cos tables.
BTW, I'm using the devkitadv from Rico's website:
http://www.thaworx.co.uk/ninja/