2017-09-23 12:43:54 -07:00
|
|
|
// Copyright © 2017 Project Golan, all rights reserved.
|
|
|
|
#include "r_draw.h"
|
|
|
|
|
|
|
|
#include "g_stage.h"
|
2017-09-29 04:50:36 -07:00
|
|
|
#include "g_object.h"
|
|
|
|
#include "g_player.h"
|
2017-09-23 12:43:54 -07:00
|
|
|
#include "m_str.h"
|
|
|
|
|
|
|
|
#include <Doominati.h>
|
|
|
|
|
|
|
|
// Static Functions ----------------------------------------------------------|
|
|
|
|
|
|
|
|
//
|
|
|
|
// R_drawHitboxes
|
|
|
|
//
|
|
|
|
static void R_drawHitboxes(void)
|
|
|
|
{
|
|
|
|
DGE_Texture_Bind(0);
|
|
|
|
DGE_Draw_SetColor(1lr, 0, 0, 0.5lr);
|
|
|
|
|
|
|
|
unsigned head = DGE_Thinker_Head();
|
|
|
|
DGE_Point2 vp = DGE_Renderer_GetViewpoint();
|
|
|
|
|
2017-09-28 10:51:14 -07:00
|
|
|
for(DGE_Thinker th = {head}; (th.id = th.next) != head;)
|
|
|
|
{
|
2017-09-23 12:43:54 -07:00
|
|
|
DGE_PhysicsThinker pth;
|
|
|
|
if((pth.id = DGE_Object_Cast(th.id, DGE_OT_PhysicsThinker))) {
|
|
|
|
fixed tx = pth.x - vp.x, ty = pth.y - vp.y;
|
|
|
|
DGE_Draw_Rectangle(tx - pth.sx, ty - pth.sy, tx + pth.sx, ty + pth.sy);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DGE_Draw_SetColor();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Extern Functions ----------------------------------------------------------|
|
|
|
|
|
|
|
|
//
|
|
|
|
// R_Draw
|
|
|
|
//
|
|
|
|
DGE_Callback
|
|
|
|
void R_Draw(ulfra delta)
|
|
|
|
{
|
|
|
|
DGE_Shader_Bind(DGE_Shader_Get(s"plasma"));
|
|
|
|
DGE_Texture_Bind(0);
|
|
|
|
DGE_Draw_Rectangle(0, 0, 960, 720);
|
|
|
|
DGE_Shader_Bind(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// R_DrawPost
|
|
|
|
//
|
|
|
|
DGE_Callback
|
|
|
|
void R_DrawPost(ulfra delta)
|
|
|
|
{
|
|
|
|
DGE_Texture_Bind(DGE_Texture_Get(s"gui/border"));
|
|
|
|
DGE_Draw_Rectangle(0, 0, 960, 720);
|
|
|
|
|
|
|
|
DGE_Font_Bind(DGE_Font_Get(s"base"));
|
2017-09-26 14:00:23 -07:00
|
|
|
DGE_Draw_SetTextAlign(DGE_Align_Center, DGE_Align_Top);
|
|
|
|
DGE_Draw_Text(760, 20, G_Place);
|
2017-09-29 04:50:36 -07:00
|
|
|
|
2017-09-23 12:43:54 -07:00
|
|
|
DGE_Draw_SetTextAlign(DGE_Align_Left);
|
2017-09-29 16:06:00 -07:00
|
|
|
DGE_Draw_Text(585, 70, M_StrGet(s"gui/highscore"));
|
2017-09-23 12:43:54 -07:00
|
|
|
DGE_Draw_SetTextAlign(DGE_Align_Right);
|
2017-09-29 04:50:36 -07:00
|
|
|
DGE_Draw_Text(945, 70, M_StrFmt("%.15i", 0));
|
|
|
|
|
|
|
|
for(int i = 0; i < G_Player_Count; i++)
|
|
|
|
{
|
|
|
|
DGE_Draw_SetTextAlign(DGE_Align_Left);
|
|
|
|
DGE_Draw_Text(585, 120 + i * 20,
|
2017-09-29 16:06:00 -07:00
|
|
|
M_StrFmt(M_StrGet(s"gui/player"), i + 1));
|
2017-09-29 04:50:36 -07:00
|
|
|
DGE_Draw_SetTextAlign(DGE_Align_Right);
|
|
|
|
DGE_Draw_Text(945, 140 + i * 20, M_StrFmt("%.15i\n%i", 0, 5));
|
|
|
|
}
|
2017-09-23 12:43:54 -07:00
|
|
|
|
2017-09-29 04:50:36 -07:00
|
|
|
//R_drawHitboxes();
|
2017-09-23 12:43:54 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// EOF
|