diff --git a/desktop_version/src/Ent.h b/desktop_version/src/Ent.h index 7c3f17d687..d422a519f2 100644 --- a/desktop_version/src/Ent.h +++ b/desktop_version/src/Ent.h @@ -5,7 +5,7 @@ #define rn( rx, ry) ((rx) + ((ry) * 100)) -enum EntityTypes +enum EntityType { EntityType_INVALID = -1, EntityType_PLAYER, @@ -54,7 +54,7 @@ class entclass public: //Fundamentals bool invis; - EntityTypes type; + EntityType type; int size, tile, rule; int state, statedelay; int behave, animate; diff --git a/desktop_version/src/LevelDebugger.cpp b/desktop_version/src/LevelDebugger.cpp index b0f6481050..b180b70466 100644 --- a/desktop_version/src/LevelDebugger.cpp +++ b/desktop_version/src/LevelDebugger.cpp @@ -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)); } @@ -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; } diff --git a/desktop_version/src/Logic.cpp b/desktop_version/src/Logic.cpp index 659818f7f3..958bc8b229 100644 --- a/desktop_version/src/Logic.cpp +++ b/desktop_version/src/Logic.cpp @@ -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; } @@ -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; } diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index b500bf90e5..5aa50fe5d8 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -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); }