52 lines
1.1 KiB
C
52 lines
1.1 KiB
C
|
// Copyright © 2017 Project Golan, all rights reserved.
|
||
|
#include "g_object.h"
|
||
|
|
||
|
#include "g_stage.h"
|
||
|
|
||
|
#include <Doominati.h>
|
||
|
|
||
|
// Extern Functions ----------------------------------------------------------|
|
||
|
|
||
|
//
|
||
|
// G_Entity_Create
|
||
|
//
|
||
|
void G_Entity_Create(G_mfdat *info)
|
||
|
{
|
||
|
DGE_Entity ent = {DGE_Entity_Create(0)};
|
||
|
|
||
|
ent.x = info->ent.x;
|
||
|
ent.y = info->ent.y;
|
||
|
|
||
|
G_entty const *type;
|
||
|
if((type = G_ObjDef_GetType(info->ent.name))) {
|
||
|
G_ObjDef_setupEntity(type, ent);
|
||
|
G_ObjDef_createTask (type, ent);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
//
|
||
|
// G_Sector_Create
|
||
|
//
|
||
|
void G_Sector_Create(G_mfdat *info)
|
||
|
{
|
||
|
DGE_Sector sec = {DGE_Sector_Create(4, 0)};
|
||
|
|
||
|
DGE_Object_RefAdd(sec.id);
|
||
|
|
||
|
sec.friction = 0.875lr;
|
||
|
sec.gz = -1;
|
||
|
|
||
|
fixed xl = info->sec.x , yl = info->sec.y;
|
||
|
fixed xu = info->sec.w + xl, yu = info->sec.h + yl;
|
||
|
|
||
|
DGE_Sector_PointSet(sec.id, 0, (DGE_Point2){xl, yl});
|
||
|
DGE_Sector_PointSet(sec.id, 1, (DGE_Point2){xl, yu});
|
||
|
DGE_Sector_PointSet(sec.id, 2, (DGE_Point2){xu, yu});
|
||
|
DGE_Sector_PointSet(sec.id, 3, (DGE_Point2){xu, yl});
|
||
|
|
||
|
DGE_Sector_CalcBounds(sec.id);
|
||
|
DGE_Sector_Block(sec.id);
|
||
|
}
|
||
|
|
||
|
// EOF
|