Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor WorldMap to support functional sectors #2377

Merged
merged 25 commits into from
Jul 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f507d3b
Refactor WorldMap to support functional sectors
Vankata453 Jan 12, 2023
241899f
Store GameSession spawnpoints in a stack
Vankata453 Jan 29, 2023
7221e51
Merge remote-tracking branch 'supertux/master' into worldmap-refactor
Vankata453 May 9, 2023
f5185b7
Move SectorBase to a separate namespace and file
Vankata453 May 9, 2023
08611a4
Merge editor worldmap objects with main worldmap object classes
Vankata453 May 11, 2023
60621e7
Make scripting objects aware of their parent manager, only allow cert…
Vankata453 May 19, 2023
d19b0ef
Fix sector switch issues
Vankata453 May 19, 2023
eae2d59
"WorldMap" -> "WorldMapSector"
Vankata453 May 19, 2023
9348bb5
Fix SectorBase member initialization order
Vankata453 May 19, 2023
7c73787
Fix compilation warnings
Vankata453 May 19, 2023
c357566
Merge branch 'master' into worldmap-refactor
Vankata453 May 20, 2023
d3f1535
Merge branch 'master' into worldmap-refactor
Vankata453 May 24, 2023
a1b29e3
Merge remote-tracking branch 'supertux/master' into worldmap-refactor
Vankata453 Jun 24, 2023
e1069b2
Do not add gradient to new worldmap sectors in editor
Vankata453 Jun 28, 2023
9df0bd8
Execute special tile script independently from passive message
Vankata453 Jun 28, 2023
4f223df
Set force spawnpoint on worldmap sectors directly
Vankata453 Jun 28, 2023
804ec06
Do not process special tile directly when setting up sector
Vankata453 Jun 28, 2023
4dc28a3
Make passive map messages global for the worldmap
Vankata453 Jun 29, 2023
a93c5e7
Allow adding backgrounds to worldmaps
Vankata453 Jun 29, 2023
70245ec
Improve gradient addition check for sectors
Vankata453 Jun 29, 2023
d65553b
Avoid worldmap object hitbox hardcoding, support centered hitboxes
Vankata453 Jul 4, 2023
0b0b024
Merge remote-tracking branch 'supertux/master' into worldmap-refactor
Vankata453 Jul 9, 2023
ec5fde4
Do not store gravity in sector base, worldmap parser code improvements
Vankata453 Jul 10, 2023
544f175
Fix un-centered worldmap tiles when placing in editor
Vankata453 Jul 10, 2023
240d72a
WorldMap no longer inherits Level
Vankata453 Jul 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion data/images/engine/editor/objects.stoi
Original file line number Diff line number Diff line change
Expand Up @@ -418,5 +418,8 @@
(object
(class "tilemap")
(icon "images/engine/editor/tilemap.png"))
)
(object
(class "background")
(icon "images/engine/editor/background.png"))
)
)
2 changes: 1 addition & 1 deletion data/levels/world1/worldmap.stwm
Original file line number Diff line number Diff line change
Expand Up @@ -2629,7 +2629,7 @@ state.ambient_b <- 1;")
)
)
(tilemap
(solid #f)
(solid #t)
(z-pos 2)
(name "iv_secret")
(width 100)
Expand Down
3 changes: 1 addition & 2 deletions src/editor/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ Editor::test_level(const std::optional<std::pair<std::string, Vector>>& test_pos
m_autosave_levelfile = FileSystem::join(directory, backup_filename);
m_level->save(m_autosave_levelfile);
m_time_since_last_save = 0.f;
m_leveltested = true;

if (!m_level->is_worldmap())
{
Expand All @@ -342,8 +343,6 @@ Editor::test_level(const std::optional<std::pair<std::string, Vector>>& test_pos
{
GameManager::current()->start_worldmap(*current_world, "", m_autosave_levelfile);
}

m_leveltested = true;
}

void
Expand Down
4 changes: 2 additions & 2 deletions src/editor/overlay_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "editor/tile_selection.hpp"
#include "editor/tip.hpp"
#include "editor/util.hpp"
#include "editor/worldmap_objects.hpp"
#include "gui/menu.hpp"
#include "gui/menu_manager.hpp"
#include "math/bezier.hpp"
Expand All @@ -44,6 +43,7 @@
#include "video/renderer.hpp"
#include "video/video_system.hpp"
#include "video/viewport.hpp"
#include "worldmap/worldmap_object.hpp"

namespace {

Expand Down Expand Up @@ -863,7 +863,7 @@ EditorOverlayWidget::put_object()
mo->move_to(mo->get_pos() - Vector(bbox.get_width() / 2, bbox.get_height() / 2));
}

auto* wo = dynamic_cast<worldmap_editor::WorldmapObject*>(object.get());
auto* wo = dynamic_cast<worldmap::WorldMapObject*>(object.get());
if (wo) {
wo->move_to(wo->get_pos() / 32.0f);
}
Expand Down
280 changes: 0 additions & 280 deletions src/editor/worldmap_objects.cpp

This file was deleted.

Loading
Loading