finish all functions. It is the beginning of beta phase !
This commit is contained in:
parent
6d745d454a
commit
0fc0adac49
|
@ -14,4 +14,6 @@ fe_object * fe_renderlist_remove_id(int id);
|
|||
|
||||
void fe_renderlist_clear(void);
|
||||
|
||||
void fe_render(void);
|
||||
|
||||
#endif
|
||||
|
|
BIN
libfxengine.a
BIN
libfxengine.a
Binary file not shown.
|
@ -6,7 +6,10 @@
|
|||
#include <libprof.h>
|
||||
#endif
|
||||
#include <gint/std/stdlib.h>
|
||||
#include <gint/std/string.h>
|
||||
#include <stdbool.h>
|
||||
#include <fxengine/renderlist.h>
|
||||
#include <fxengine/render/buffer.h>
|
||||
|
||||
// FPS count
|
||||
#ifdef USE_LIBPROF
|
||||
|
@ -61,8 +64,8 @@ void fe_load()
|
|||
quit=false;
|
||||
while (1)
|
||||
{
|
||||
fe_zbuffer_clear();
|
||||
render();
|
||||
fe_clear_zbuffer();
|
||||
fe_render();
|
||||
switch_frame();
|
||||
if (quit)
|
||||
break;
|
||||
|
@ -74,84 +77,4 @@ void fe_load()
|
|||
void fe_quit()
|
||||
{
|
||||
quit=1;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
#include <fxengine/zbuffer.h>
|
||||
|
||||
#include <gint/std/stdio.h>
|
||||
#include <gint/display.h>
|
||||
|
||||
#include <gint/exc.h>
|
||||
#include <gint/defs/attributes.h>
|
||||
|
||||
static void * fe_rendering_list;
|
||||
|
||||
#ifdef USE_LIBPROF
|
||||
#include <libprof.h>
|
||||
static uint32_t frame_interval_min=1000000;
|
||||
static uint32_t frame_interval_max=1;
|
||||
static uint32_t fps=0;
|
||||
#endif
|
||||
|
||||
// Double buffering
|
||||
static uint32_t * vram1 = vram;
|
||||
static uint32_t vram2[1024/sizeof(uint32_t)];
|
||||
static uint32_t * vrams[2]={vram1,vram2};
|
||||
static uint32_t drawing_vram=1;
|
||||
|
||||
static void switch_vram()
|
||||
{
|
||||
vram=vrams[drawing_vram];
|
||||
drawing_vram=1-drawing_vram;
|
||||
}
|
||||
|
||||
void fe_set_user_mode();
|
||||
void fe_set_working_mode();
|
||||
|
||||
|
||||
int32_t fe_get_fps()
|
||||
{
|
||||
#ifdef USE_LIBPROF
|
||||
return fps;
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void fe_display(const uint32_t libprof_channel)
|
||||
{
|
||||
fe_update(libprof_channel);
|
||||
dupdate();
|
||||
dclear(C_WHITE);
|
||||
}
|
||||
|
||||
|
||||
void fe_update(const uint32_t libprof_channel)
|
||||
{
|
||||
#ifdef USE_LIBPROF
|
||||
if (prof_elapsed)
|
||||
{
|
||||
prof_leave(libprof_channel);
|
||||
uint32_t frame_interval = prof_time(libprof_channel);
|
||||
//sleep_us(0, MINIMUM_FRAME_DELAY-frame_interval);
|
||||
if (frame_interval<frame_interval_min)
|
||||
frame_interval_min = frame_interval;
|
||||
if (frame_interval>frame_interval_max)
|
||||
frame_interval_max = frame_interval;
|
||||
fps=1000000/frame_interval;
|
||||
}
|
||||
else
|
||||
{
|
||||
prof_init(libprof_channel+1, 0);
|
||||
}
|
||||
prof_clear(libprof_channel);
|
||||
prof_enter(libprof_channel);
|
||||
#endif
|
||||
switch_vram();
|
||||
fe_zbuffer_clear();
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
#include <render/triangle.h>
|
||||
#include <render/buffer.h>
|
||||
#include <fxengine/render/triangle.h>
|
||||
#include <fxengine/render/buffer.h>
|
||||
#include <fxengine/model/vertex.h>
|
||||
#include <fxengine/model/bitmap.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
@ -128,7 +129,7 @@ int render_triangle_nobfc(fe_vertex const s1, fe_vertex const s2, fe_vertex cons
|
|||
int32_t vy2= ( vy*side->size_px_y/s3.z ) / ((32768-vy)/s1.z + vy/s3.z);
|
||||
|
||||
// Affichage du point
|
||||
const uint8_t color = fe_texture_get_pixel_r(side, vx2, vy2);
|
||||
const uint8_t color = fe_bitmap_get_px(side, vx2, vy2);
|
||||
|
||||
if (color >> 1)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <render/buffer.h>
|
||||
#include <fxengine/render/buffer.h>
|
||||
|
||||
/*
|
||||
#include <fxengine/parameters.h>
|
||||
|
@ -22,7 +22,7 @@ static const int size_char = size_uint32 * sizeof(uint32_t);
|
|||
static int32_t *zbuffer = (void *)0x88080000 - (((size_char >> 5) << 5) + 1);
|
||||
|
||||
|
||||
void fe_zbuffer_clear()
|
||||
void fe_clear_zbuffer()
|
||||
{
|
||||
uint32_t indice = 0;
|
||||
for (indice = 0; indice < size_uint32; indice ++)
|
||||
|
|
|
@ -24,13 +24,52 @@ int fe_renderlist_add(fe_object * const object)
|
|||
if (list==0)
|
||||
{
|
||||
list_size++;
|
||||
list=malloc(sizeof(int));
|
||||
list=malloc(sizeof(fe_object*));
|
||||
list[0]=object;
|
||||
}
|
||||
else
|
||||
{
|
||||
list_size++;
|
||||
list=realloc(list, list_size*sizeof(int));
|
||||
list=realloc(list, list_size*sizeof(fe_object*));
|
||||
list[list_size-1]=object;
|
||||
}
|
||||
}
|
||||
|
||||
int fe_renderlist_remove(fe_object * const object)
|
||||
{
|
||||
if (object==0)
|
||||
return -1;
|
||||
for (int i=0; i<list_size; i++)
|
||||
if (list[i]==object)
|
||||
{
|
||||
list[i]=0;
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
fe_object * fe_renderlist_remove_id(int id)
|
||||
{
|
||||
if (id>=list_size)
|
||||
return 0;
|
||||
else
|
||||
{
|
||||
fe_object * tmp = list[id];
|
||||
list[id]=0;
|
||||
return tmp;
|
||||
}
|
||||
}
|
||||
|
||||
void fe_renderlist_clear(void)
|
||||
{
|
||||
free(list);
|
||||
list_size=0;
|
||||
return;
|
||||
}
|
||||
|
||||
void fe_render(void)
|
||||
{
|
||||
for (int i=0; i<list_size; i++)
|
||||
if (list[i])
|
||||
fe_object_display(list[i]);
|
||||
}
|
Loading…
Reference in New Issue