Skip to content

Commit

Permalink
Apply fixes from @Daaaav
Browse files Browse the repository at this point in the history
  • Loading branch information
NyakoFox committed Nov 17, 2024
1 parent b9de83c commit 61960a7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
4 changes: 2 additions & 2 deletions desktop_version/src/Ent.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#define rn( rx, ry) ((rx) + ((ry) * 100))

enum EntityTypes
enum EntityType
{
EntityType_INVALID = -1,
EntityType_PLAYER,
Expand Down Expand Up @@ -54,7 +54,7 @@ class entclass
public:
//Fundamentals
bool invis;
EntityTypes type;
EntityType type;
int size, tile, rule;
int state, statedelay;
int behave, animate;
Expand Down
18 changes: 10 additions & 8 deletions desktop_version/src/LevelDebugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,11 @@ namespace level_debugger
graphics.draw_rect(bounding_box.x, bounding_box.y, bounding_box.w, bounding_box.h, graphics.getRGB(15, 90, 90));

// For gravity lines, show the true hitbox.
if (obj.entities[i].type == 9)
if (obj.entities[i].type == EntityType_HORIZONTAL_GRAVITY_LINE)
{
graphics.draw_rect(bounding_box.x - 1, bounding_box.y + 1, bounding_box.w + 2, bounding_box.h, graphics.getRGB(90, 90, 15));
}
else if (obj.entities[i].type == 10)
else if (obj.entities[i].type == EntityType_VERTICAL_GRAVITY_LINE)
{
graphics.fill_rect(bounding_box.x - 2, bounding_box.y - 1, bounding_box.w + 1, bounding_box.h + 2, graphics.getRGB(90, 90, 15));
}
Expand Down Expand Up @@ -390,33 +390,35 @@ namespace level_debugger
// Mostly contains duplicates, but for ease of use
switch (entity->type)
{
case 0:
case EntityType_PLAYER:
// Player
render_info(line++, "Gravity", help.String(game.gravitycontrol));
render_info(line++, "Checkpoint", help.String(game.savepoint));
break;
case 1:
case EntityType_MOVING:
// Moving platforms and enemies
render_info(line++, "Speed", help.String(entity->para));
render_info(line++, "Movement type", help.String(entity->behave));
break;
case 7:
case EntityType_TRINKET:
// Trinkets
render_info(line++, "ID", help.String(entity->para));
break;
case 8:
case EntityType_CHECKPOINT:
// Checkpoints
render_info(line++, "ID", help.String(entity->para));
render_info(line++, "Active", game.savepoint == entity->para ? "True" : "False");
break;
case 9:
case EntityType_HORIZONTAL_GRAVITY_LINE:
// Horizontal gravity lines
render_info(line++, "Horizontal");
break;
case 10:
case EntityType_VERTICAL_GRAVITY_LINE:
// Vertical gravity lines
render_info(line++, "Vertical");
break;
default:
break;
}


Expand Down
14 changes: 9 additions & 5 deletions desktop_version/src/Logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1096,8 +1096,10 @@ void gamelogic(void)
size_t i;
for (i = 0; i < obj.entities.size(); ++i)
{
if (obj.entities[i].type >= 51
&& obj.entities[i].type <= 54) /* Don't warp warp lines */
if (obj.entities[i].type == EntityType_WARP_LINE_LEFT
|| obj.entities[i].type == EntityType_WARP_LINE_RIGHT
|| obj.entities[i].type == EntityType_WARP_LINE_TOP
|| obj.entities[i].type == EntityType_WARP_LINE_BOTTOM) /* Don't warp warp lines */
{
continue;
}
Expand Down Expand Up @@ -1128,9 +1130,11 @@ void gamelogic(void)
size_t i;
for (i = 0; i < obj.entities.size(); ++i)
{
if ((obj.entities[i].type >= 51
&& obj.entities[i].type <= 54) /* Don't warp warp lines */
|| obj.entities[i].rule == 0) /* Don't warp the player */
if ((obj.entities[i].type == EntityType_WARP_LINE_LEFT
|| obj.entities[i].type == EntityType_WARP_LINE_RIGHT
|| obj.entities[i].type == EntityType_WARP_LINE_TOP
|| obj.entities[i].type == EntityType_WARP_LINE_BOTTOM) /* Don't warp warp lines */
|| obj.entities[i].rule == 0) /* Don't warp the player */
{
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion desktop_version/src/Script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ void scriptclass::run(void)
{
for (size_t edi = 0; edi < obj.entities.size(); edi++)
{
if (obj.entities[edi].type == 11)
if (obj.entities[edi].type == EntityType_WARP_TOKEN)
{
obj.disableentity(edi);
}
Expand Down

0 comments on commit 61960a7

Please sign in to comment.