Browse Source

configure gitignore, and temp build with liblog

master
Milang 1 year ago
parent
commit
0c22d2d016
4 changed files with 57 additions and 6 deletions
  1. +3
    -2
      .gitignore
  2. BIN
      1v13D.g1a
  3. +16
    -1
      Makefile
  4. +38
    -3
      src/main.c

+ 3
- 2
.gitignore View File

@@ -1,5 +1,6 @@
*.bin
*.elf
*.mak
build-fx/
*.o
build-fx/*
build-fx/map
build-fx/src/main.o

BIN
1v13D.g1a View File


+ 16
- 1
Makefile View File

@@ -38,7 +38,8 @@ target-fx := $(filename).g1a
target-cg := $(filename).g3a

# Source files
src := $(wildcard src/*.c src/*/*.c src/*/*/*.c src/*/*/*/*.c)
src := $(wildcard src/*.[csS] src/*/*.[csS] src/*/*/*.[csS] \
src/*/*/*/*.[csS])
assets-fx := $(wildcard assets-fx/*/*)
assets-cg := $(wildcard assets-cg/*/*)

@@ -88,6 +89,20 @@ build-cg/%.o: %.c
@ mkdir -p $(dir $@)
sh4eb-elf-gcc -c $< -o $@ $(cf-cg) $(dflags)

# Assembler sources
build-fx/%.o: %.s
@ mkdir -p $(dir $@)
sh3eb-elf-gcc -c $< -o $@
build-fx/%.o: %.S
@ mkdir -p $(dir $@)
sh3eb-elf-gcc -c $< -o $@ $(sflags)
build-cg/%.o: %.s
@ mkdir -p $(dir $@)
sh4eb-elf-gcc -c $< -o $@
build-cg/%.o: %.S
@ mkdir -p $(dir $@)
sh4eb-elf-gcc -c $< -o $@ $(sflags)

# Images
build-fx/assets/img/%.o: assets-fx/img/%
@ mkdir -p $(dir $@)


+ 38
- 3
src/main.c View File

@@ -1,9 +1,39 @@
#include <gint/display.h>
#include <gint/timer.h>
#include <gint/keyboard.h>

#include <liblog.h>

#include <fxengine/model/bitmap.h>
#include <fxengine/model/vertex.h>
#include <fxengine/model/triangle.h>
#include <fxengine/model/object.h>
#include <fxengine/renderlist.h>
#include <fxengine/fxengine.h>

int callback(void)
{
fe_callback_start();
fe_draw();
dupdate();
ll_send("Rendered Image\n");
key_event_t event = pollevent();
int state=0;
while (event.type!=KEYEV_NONE)
{
if (event.key == KEY_F1)
state = 1;
event=pollevent();
}
if (state)
{
timer_pause(1);
ll_pause();
timer_start(1);
}
fe_callback_end();
return 0;
}

int main(void)
{
@@ -44,7 +74,7 @@ int main(void)
fe_bitmap * bmp = fe_bitmap_new(32, 32, color, 0, 0, 0);

fe_vertex v[3]=
{
{
{30,-10,-10},
{30,10,10},
{30,-10,10}
@@ -56,7 +86,7 @@ int main(void)
fe_triangle t[1]=
{
fe_object_getvx(&obj,0),
fe_object_getvx(&obj,1),
fe_object_getvx(&obj,1),
fe_object_getvx(&obj,2),
bmp, bmp,
0
@@ -64,8 +94,13 @@ int main(void)
fe_object_set_faces(&obj, t, 1, 0);

// Add object to list
// Launch game timer
fe_renderlist_add(&obj);

// Launch game timer at 40 FPS max
timer_setup(1, timer_delay(0, 25 * 1000), 0, callback, 0);
timer_start(1);
// Launch 3D renderer
fe_load();
// Free Data
return;
}


Loading…
Cancel
Save