Add resource declarations to MFEd

master
Marrub 2017-09-26 17:00:23 -04:00
parent 0b3b95a79f
commit 10986d286b
7 changed files with 21 additions and 13 deletions

View File

@ -0,0 +1,7 @@
// Copyright © 2017 Project Golan, all rights reserved.
include "resdecl.rd"
font "editor" = "fonts/editor.otf", 24
// EOF

View File

@ -12,10 +12,10 @@
//
// G_Player_applyVelocity
//
void G_Player_applyVelocity(DGE_Entity ent)
static void G_Player_applyVelocity(DGE_Entity ent)
{
accum vx = (accum)DGE_GetInputAxis(0, DGE_Axis_X);
accum vy = (accum)DGE_GetInputAxis(0, DGE_Axis_Y);
DGE_Point2R ax = DGE_Input_GetAxis(1);
accum vx = (accum)ax.x, vy = (accum)ax.y;
float mag = sqrtf(vx * vx + vy * vy);
float ang = atan2f(vy, vx);
@ -25,6 +25,8 @@ void G_Player_applyVelocity(DGE_Entity ent)
ent.vx = ent.vx + c * mag * 1.1;
ent.vy = ent.vy - s * mag * 1.1;
// TODO: apply animation based on X velocity here
}
// Extern Functions ----------------------------------------------------------|

View File

@ -13,7 +13,7 @@
// Extern Objects ------------------------------------------------------------|
char const *G_place = u8"地球軌道・朝";
char const *G_Place = u8"地球軌道・朝";
// Static Functions ----------------------------------------------------------|

View File

@ -41,7 +41,7 @@ typedef struct G_stage
// Extern Objects ------------------------------------------------------------|
extern char const *G_place;
extern char const *G_Place;
// Extern Functions ----------------------------------------------------------|

View File

@ -12,7 +12,7 @@
//
// GInit
//
void GInit(void)
void GInit(char const *resdecl)
{
extern void R_ResDec_Load(char const *fname);
@ -23,7 +23,7 @@ void GInit(void)
DGE_Renderer_SetVirtualRes(960, 720);
printf("Loading resource declarations...\n");
R_ResDec_Load("resdecl.rd");
R_ResDec_Load(resdecl);
printf("Loading object function table...\n");
G_ObjDef_Init();
@ -45,7 +45,7 @@ void GInit(void)
[[__extern("asm")]] DGE_Callback
void main(void)
{
GInit();
GInit("resdecl.rd");
G_Stage_Begin(1);
}

View File

@ -15,9 +15,8 @@
[[__extern("asm")]] DGE_Callback
void main(void)
{
extern void GInit(void);
GInit();
printf("using mfed main\n");
extern void GInit(char const *resdecl);
GInit("resdecl_mfed.rd");
}
// EOF

View File

@ -54,8 +54,8 @@ void R_DrawPost(ulfra delta)
DGE_Draw_Rectangle(0, 0, 960, 720);
DGE_Font_Bind(DGE_Font_Get(s"base"));
DGE_Draw_SetTextAlign(DGE_Align_Center);
DGE_Draw_Text(760, 20, G_place);
DGE_Draw_SetTextAlign(DGE_Align_Center, DGE_Align_Top);
DGE_Draw_Text(760, 20, G_Place);
DGE_Draw_SetTextAlign(DGE_Align_Left);
DGE_Draw_Text(585, 70, u8"ハイスコア\nスコア\n\n残り再試行回");
DGE_Draw_SetTextAlign(DGE_Align_Right);