diff --git a/1v13D.g1a b/1v13D.g1a index cc997ea..ebc469b 100755 Binary files a/1v13D.g1a and b/1v13D.g1a differ diff --git a/src/main.c b/src/main.c index 431e99c..7ee9ed6 100755 --- a/src/main.c +++ b/src/main.c @@ -1,45 +1,89 @@ -/* #include -#include -#include -#include -#include -#include -*/ -/* + +#include +#include +#include +#include + int main(void) { -//init_controls(); -dclear(C_WHITE); -fe_integer_point point[4]={{{10,0,0},{0,0,0}},{{10,10,0},{0,0,0}},{{10,0,10},{0,0,0}},{{10,10,10},{0,0,0}}}; -//FE_face face={&point[0],&point[1],&point[2],1,2}; -//FE_face face2={&point[3],&point[1],&point[2],0,2}; + dclear(C_WHITE); + uint32_t color[32] = + { + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111 + }; + fe_bitmap * bmp = fe_bitmap_new(32, 32, color, 0, 0, 0); -while (1) -{ -//FE_new_frame(); -dclear(C_WHITE); -//reload_fps_displaying(); + fe_vertex v[3]= + { + {30,-10,-10}, + {30,10,10}, + {30,-10,10} + }; + fe_object obj; + fe_object_init(&obj); + fe_object_set_vertex(&obj, v, 3, 0); -for (int i=0;i<4;i++) -{ -fe_point_translate(&point[i]); -if (point[i].translated.z>0) -{ -dpixel(point[i].translated.x,point[i].translated.y,C_BLACK); -} + fe_triangle t[1]= + { + fe_object_getvx(&obj,0), + fe_object_getvx(&obj,1), + fe_object_getvx(&obj,2), + bmp, bmp, + 0 + }; + fe_object_set_faces(&obj, t, 1, 0); + + // Add object to list + // Launch game timer + // Launch 3D renderer + // Free Data + return; } -dupdate(); -//FE_draw_face(&face); -//FE_draw_face(&face2); -//display_fps(100,56); -} -getkey(); -return 1; -} -*/ + + + + + +/* + + + + + + + @@ -55,150 +99,166 @@ return 1; #include +#include + int main(void) { - ll_set_state(0); - ll_set_panic(); - ll_send("Log Beginning\n"); - dclear(C_WHITE); - uint32_t color[32] = - { - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111, - 0b11111111111111111111111111111111 - }; - fe_texture_rich * bmp = fe_texture_new_rich(32, 32, color, 0, 0, 0); - fe_ivertex v[4]= - { + ll_set_state(0); + ll_set_panic(); + ll_send("Log Beginning\n"); + dclear(C_WHITE); + uint32_t color[32] = { - {30,-10,-10}, - {0,0,0} - }, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b11111111111111111111111111111111 + }; + fe_texture_rich * bmp = fe_texture_new_rich(32, 32, color, 0, 0, 0); + fe_ivertex v[4]= { - {30,10,10}, - {0,0,0} - }, + { + {30,-10,-10}, + {0,0,0} + }, + { + {30,10,10}, + {0,0,0} + }, + { + {30,-10,10}, + {0,0,0} + } + }; + + fe_triangle triangle = { - {30,-10,10}, - {0,0,0} - } - }; - fe_object object; fe_object_init(&object); - fe_object_set_points(&object, &v, 3, 0); + { + fe_object_get_vertex(&object, 0), + fe_object_get_vertex(&object, 1), + fe_object_get_vertex(&object, 2), + bmp, + 0, + 0 + } + }; - fe_triangle triangle = - { + fe_object object; fe_object_init(&object); + fe_object_set_points(&object, &v, 3, 0); + + fe_triangle triangle = { - fe_object_get_vertex(&object, 0), - fe_object_get_vertex(&object, 1), - fe_object_get_vertex(&object, 2), - bmp, - 0, - 0 - } - }; - fe_object_set_faces(&object, &triangle, 1, 0); + { + fe_object_get_vertex(&object, 0), + fe_object_get_vertex(&object, 1), + fe_object_get_vertex(&object, 2), + bmp, + 0, + 0 + } + }; + fe_object_set_faces(&object, &triangle, 1, 0); - fe_camera cam = {{20,20,0},{20,20,0},0,0,0}; - int fps; - while (1) - { - int state=1; - - key_event_t event = pollevent(); - while (event.type!=KEYEV_NONE) + fe_camera cam = {{20,20,0},{20,20,0},0,0,0}; + int fps; + while (1) { - //ll_log(str); - if (event.key == KEY_LEFT) - cam.dh -= 0.01; - if (event.key == KEY_RIGHT) - cam.dh += 0.01; - cam.dh = fe_modulo_2pi(cam.dh); + int state=1; - if (event.key == KEY_UP) - cam.dv += 0.01; - if (event.key == KEY_DOWN) - cam.dv -= 0.01; - cam.dv = fe_modulo_2pi(cam.dv); + key_event_t event = pollevent(); + while (event.type!=KEYEV_NONE) + { + //ll_log(str); + if (event.key == KEY_LEFT) + cam.dh -= 0.01; + if (event.key == KEY_RIGHT) + cam.dh += 0.01; + cam.dh = fe_modulo_2pi(cam.dh); - if (event.key == KEY_8) - { - cam.pos.x = cam.pos.x + (int32_t)(5*fe_sin(cam.dh)); - cam.pos.y = cam.pos.y + (int32_t)(5*fe_cos(cam.dh)); - } - if (event.key == KEY_2) - { - cam.pos.x = cam.pos.x + (int32_t)(5*fe_sin(cam.dh+pi)); - cam.pos.y = cam.pos.y + (int32_t)(5*fe_cos(cam.dh+pi)); - } - if (event.key == KEY_6) - { - cam.pos.x = cam.pos.x + (int32_t)(5*fe_sin(cam.dh+pi_sur_2)); - cam.pos.y = cam.pos.y + (int32_t)(5*fe_cos(cam.dh+pi_sur_2)); - } - if (event.key == KEY_4) - { - cam.pos.x = cam.pos.x + (int32_t)(5*fe_sin(cam.dh-pi_sur_2)); - cam.pos.y = cam.pos.y + (int32_t)(5*fe_cos(cam.dh-pi_sur_2)); - } + if (event.key == KEY_UP) + cam.dv += 0.01; + if (event.key == KEY_DOWN) + cam.dv -= 0.01; + cam.dv = fe_modulo_2pi(cam.dv); - cam.dv = fe_modulo_2pi(cam.dv); + if (event.key == KEY_8) + { + cam.pos.x = cam.pos.x + (int32_t)(5*fe_sin(cam.dh)); + cam.pos.y = cam.pos.y + (int32_t)(5*fe_cos(cam.dh)); + } + if (event.key == KEY_2) + { + cam.pos.x = cam.pos.x + (int32_t)(5*fe_sin(cam.dh+pi)); + cam.pos.y = cam.pos.y + (int32_t)(5*fe_cos(cam.dh+pi)); + } + if (event.key == KEY_6) + { + cam.pos.x = cam.pos.x + (int32_t)(5*fe_sin(cam.dh+pi_sur_2)); + cam.pos.y = cam.pos.y + (int32_t)(5*fe_cos(cam.dh+pi_sur_2)); + } + if (event.key == KEY_4) + { + cam.pos.x = cam.pos.x + (int32_t)(5*fe_sin(cam.dh-pi_sur_2)); + cam.pos.y = cam.pos.y + (int32_t)(5*fe_cos(cam.dh-pi_sur_2)); + } - if (event.key == KEY_MENU) - return; - if (event.key==KEY_F1 && event.type==KEYEV_DOWN) - { - ll_pause(); - } - event=pollevent(); - } + cam.dv = fe_modulo_2pi(cam.dv); - fe_view_set(&cam); - fe_object_display(&object); + if (event.key == KEY_MENU) + return; + if (event.key==KEY_F1 && event.type==KEYEV_DOWN) + { + ll_pause(); + } + event=pollevent(); + } - char str[300]; - sprintf(str, "\nCamera Settings :\n>> x %d; y %d; z %d;\n>> dh %d; dv %d;\n", - cam.pos.x, - cam.pos.y, - cam.pos.z, - (int)(cam.dh*180/pi), - (int)(cam.dv*180/pi) - ); - ll_send(str); - sprintf(str,"FPS=%d",fps); - dtext(1,1,str,C_BLACK,C_NONE); - fps=fe_display(0); + fe_view_set(&cam); + fe_object_display(&object); + + char str[300]; + sprintf(str, "\nCamera Settings :\n>> x %d; y %d; z %d;\n>> dh %d; dv %d;\n", + cam.pos.x, + cam.pos.y, + cam.pos.z, + (int)(cam.dh*180/pi), + (int)(cam.dv*180/pi) + ); + ll_send(str); + sprintf(str,"FPS=%d",fps); + dtext(1,1,str,C_BLACK,C_NONE); + fps=fe_display(0); } return 1; } +*/ \ No newline at end of file