création du projet avec le fxsdk refonte globale
This commit is contained in:
parent
d270593bf5
commit
4137431068
|
@ -1,49 +0,0 @@
|
|||
#include "FxEngine.h"
|
||||
|
||||
#include <display.h>
|
||||
|
||||
FE_Angle FxEngine::dh(0);
|
||||
FE_Angle FxEngine::dv(0);
|
||||
FE_Angle FxEngine::m_dh(0);
|
||||
FE_Angle FxEngine::m_dv(0);
|
||||
|
||||
FE_Position FxEngine::real(0,0,0);
|
||||
FE_Position FxEngine::m_virt(0,0,0);
|
||||
|
||||
int FxEngine::m_numChange=0;
|
||||
int FxEngine::numPublicChange=0;
|
||||
|
||||
FE_State FxEngine::m_state=FE_PASSIVE;
|
||||
|
||||
void FxEngine::newFrame()
|
||||
{
|
||||
numPublicChange=m_numChange;
|
||||
dh=m_dh;
|
||||
dv=m_dv;
|
||||
real=m_virt;
|
||||
dupdate();
|
||||
dclear(white);
|
||||
}
|
||||
|
||||
void FxEngine::setState(FE_State state)
|
||||
{
|
||||
if (m_moveActive==state)
|
||||
return;
|
||||
if (state==true)
|
||||
{
|
||||
// TODO
|
||||
// gint timer
|
||||
m_moveActive=true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO
|
||||
// gint kill timer
|
||||
m_moveActive=false;
|
||||
}
|
||||
}
|
||||
|
||||
void FxEngine::move()
|
||||
{
|
||||
// todo with math functions, not implemented yet !
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
#ifndef FENG_H
|
||||
#define FENG_H
|
||||
|
||||
#define FE_State bool
|
||||
#define FE_ACTIVE true
|
||||
#define FE_PASSIVE false
|
||||
|
||||
#include "math/pos.h"
|
||||
#include "math/angle.h"
|
||||
|
||||
|
||||
class FxEngine // regroupement des fonctions
|
||||
{
|
||||
public:
|
||||
static void newFrame(); // reloads coords
|
||||
static void setState(FE_State state);
|
||||
|
||||
static FE_Angle dh,dv;
|
||||
static FE_Position real;
|
||||
static int numPublicChange;
|
||||
private:
|
||||
static FE_Angle m_dh,m_dv;
|
||||
static FE_Position m_virt;
|
||||
|
||||
static FE_State m_state;
|
||||
static int m_numChange;
|
||||
|
||||
static void move(); // appelé à intervalles réguliers
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
|
@ -1,9 +0,0 @@
|
|||
#include "coord.h"
|
||||
|
||||
#include "angle.h"
|
||||
|
||||
void FE_Coord::calc()
|
||||
{
|
||||
transformed=original-real;
|
||||
// rotate
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#ifndef FE_COORD_H
|
||||
#define FE_COORD_H
|
||||
|
||||
#include "pos.h"
|
||||
|
||||
class FE_Coord
|
||||
{
|
||||
public:
|
||||
FE_Pos normal;
|
||||
FE_Pos transformed;
|
||||
void calc();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
|
@ -1,38 +0,0 @@
|
|||
#include "pos.h"
|
||||
|
||||
bool operator==(FE_Pos const& a, FE_Pos const& b)
|
||||
{return (a.x==b.x && a.y==b.y && a.z==b.z);}
|
||||
bool operator!=(FE_Pos const& a, FE_Pos const& b)
|
||||
{return !(a==b);}
|
||||
|
||||
FE_Pos::FE_Pos() : x(0), y(0), z(0)
|
||||
{}
|
||||
|
||||
FE_Pos::FE_Pos(const FE_Pos& coord)
|
||||
{
|
||||
x=coord.x;
|
||||
y=coord.y;
|
||||
z=coord.z;
|
||||
}
|
||||
|
||||
FE_Pos& FE_Pos::operator=(const FE_Pos& a)
|
||||
{this->FE_Pos(a);return *this;}
|
||||
|
||||
FE_Pos& FE_Pos::operator+=(const FE_Pos& a)
|
||||
{x+=a.x;y+=a.y;z+=a.z;return *this;}
|
||||
|
||||
FE_Pos& FE_Pos::operator-=(const FE_Pos& a)
|
||||
{x-=a.x;y-=a.y;z-=a.z;return *this;}
|
||||
|
||||
FE_Pos operator+(FE_Pos const& a, FE_Pos const& b)
|
||||
{
|
||||
FE_Pos copie(a);
|
||||
copie+=b;
|
||||
return copie;
|
||||
}
|
||||
FE_Pos operator-(FE_Pos const& a, FE_Pos const& b)
|
||||
{
|
||||
FE_Pos copie(a);
|
||||
copie-=b;
|
||||
return copie;
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
#ifndef FE_POS_H
|
||||
#define FE_POS_H
|
||||
|
||||
class FE_Pos
|
||||
{
|
||||
public:
|
||||
FE_Pos();
|
||||
FE_Pos(const FE_Pos& coord);
|
||||
FE_Pos& operator=(const FE_Pos& a);
|
||||
FE_Pos& operator+=(const FE_Pos& a);
|
||||
FE_Pos& operator-=(const FE_Pos& a);
|
||||
int x,y,z;
|
||||
};
|
||||
|
||||
bool operator==(FE_Pos const& a, FE_Pos const& b);
|
||||
FE_Pos operator+(FE_Pos const& a, FE_Pos const& b);
|
||||
FE_Pos operator-(FE_Pos const& a, FE_Pos const& b);
|
||||
|
||||
#endif
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
#include "texture.h"
|
||||
|
||||
static unsigned char black[1]={255};
|
||||
|
||||
static unsigned char* textures[]={black};
|
||||
static unsigned char sizes[2][]={{8,8}};
|
||||
|
||||
int FE_getPixelColor(int num, float x, float y)
|
||||
{
|
||||
if (y>1 || y<0 || x>1 || x<0) return -1;
|
||||
unsigned char texture=textures[num];
|
||||
int ix=x*sizes[0][num], iy=y*sizes[1][num];
|
||||
return (7-x%8 >>texture[(ix/8+iy*sizes[0][num])/8])&1); // à revoir
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
#ifndef FE_TEXTURE_H
|
||||
#define FE_TEXTURE_H
|
||||
|
||||
int FE_getPixelColor(int num, float x, float y);
|
||||
|
||||
|
||||
|
||||
#endif
|
|
@ -1,32 +0,0 @@
|
|||
#include "zbuffer.h"
|
||||
|
||||
int FE_ZBuffer::m_sign=1;
|
||||
unsigned short* FE_ZBuffer::m_data=calloc(8192,sizeof(unsigned short));
|
||||
|
||||
void FE_ZBuffer::clear()
|
||||
{
|
||||
m_sign*=-1;
|
||||
while (m_data==NULL)
|
||||
{}
|
||||
int* clearVal=(int*)m_data;
|
||||
int indice=0;
|
||||
|
||||
// TODO ** ajouter le DMA pour les architectures sh4
|
||||
for (indice=0; indice<4096; indice++)
|
||||
clearVal[indice]=0;
|
||||
}
|
||||
|
||||
bool FE_ZBuffer::setDist(int x, int y, int dist)
|
||||
{
|
||||
short ndist=(short)dist;
|
||||
x%=FE_ZB_SIZE_X;
|
||||
y%=FE_ZB_SIZE_Y;
|
||||
const int indice=x*y;
|
||||
if (m_data[indice]=0 || m_data[indice]>ndist)
|
||||
{
|
||||
m_data[indice]=ndist;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
#ifndef FE_ZBUFFER
|
||||
#define FE_ZBUFFER
|
||||
|
||||
// nouveuaté ! le zbuffer occupe tout l'écran, le rendu 3d offre donc de meilleures possibilités
|
||||
#define FE_ZB_SIZE_X 128
|
||||
#define FE_ZB_SIZE_Y 64
|
||||
|
||||
class FE_ZBuffer
|
||||
{
|
||||
public:
|
||||
static void clear(); // does not really clear the zbuffer, but changes encoding sign for the next frame ** on 1st frame, allocates data
|
||||
static bool setDist(int x, int y, int dist); // if you are allowed to draw the pixel on vram
|
||||
private:
|
||||
static unsigned short* m_data;
|
||||
static int m_sign;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue