summaryrefslogtreecommitdiffhomepage
path: root/main
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-20 23:25:32 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-20 23:25:32 +0200
commit4213fa8a986ccfdf03783638862a9aacf3ea8601 (patch)
treee1d78e3dcc74ce6c2605ff31e035fb7e4ad36453 /main
parentd22abc50862f7243228c93fd2fd3878b37821487 (diff)
rename macros
Diffstat (limited to 'main')
-rw-r--r--main/app.cpp4
-rw-r--r--main/debug.cpp2
-rw-r--r--main/editor.cpp12
-rw-r--r--main/loader-impl.cpp12
4 files changed, 15 insertions, 15 deletions
diff --git a/main/app.cpp b/main/app.cpp
index a5062a82..5fa7dfb9 100644
--- a/main/app.cpp
+++ b/main/app.cpp
@@ -55,7 +55,7 @@ app::app(const Arguments& arguments, app_settings opts):
reset_camera_offset();
#if 1
- ASSERT(framebufferSize() == windowSize());
+ fm_assert(framebufferSize() == windowSize());
_imgui = ImGuiIntegration::Context(Vector2{windowSize()}, windowSize(), framebufferSize());
recalc_viewport(windowSize());
#else
@@ -88,7 +88,7 @@ void app::recalc_viewport(Vector2i size)
void app::viewportEvent(Platform::Sdl2Application::ViewportEvent& event)
{
- ASSERT(event.framebufferSize() == event.windowSize());
+ fm_assert(event.framebufferSize() == event.windowSize());
recalc_viewport(event.windowSize());
}
diff --git a/main/debug.cpp b/main/debug.cpp
index 2b7d9e1d..3383948b 100644
--- a/main/debug.cpp
+++ b/main/debug.cpp
@@ -38,7 +38,7 @@ void app::debug_callback(GL::DebugOutput::Source src, GL::DebugOutput::Type type
switch (severity)
{
using enum GL::DebugOutput::Severity;
- case Notification: std::fputs("DEBUG ", stdout); break;
+ case Notification: std::fputs("fm_debug ", stdout); break;
case Low: std::fputs("INFO ", stdout); break;
case Medium: std::fputs("NOTICE ", stdout); break;
case High: std::fputs("ERROR ", stdout); break;
diff --git a/main/editor.cpp b/main/editor.cpp
index 38697a30..cfe793b9 100644
--- a/main/editor.cpp
+++ b/main/editor.cpp
@@ -51,7 +51,7 @@ std::shared_ptr<tile_atlas> tile_type::atlas(Containers::StringView str)
if (auto ptr = maybe_atlas(str); ptr)
return ptr;
else
- ABORT("no such atlas: %s", str.cbegin());
+ fm_abort("no such atlas: %s", str.cbegin());
}
void tile_type::clear_selection()
@@ -63,7 +63,7 @@ void tile_type::clear_selection()
void tile_type::select_tile(const std::shared_ptr<tile_atlas>& atlas, std::uint8_t variant)
{
- ASSERT(atlas);
+ fm_assert(atlas);
clear_selection();
_selection_mode = sel_tile;
_selected_tile = { atlas, variant };
@@ -71,7 +71,7 @@ void tile_type::select_tile(const std::shared_ptr<tile_atlas>& atlas, std::uint8
void tile_type::select_tile_permutation(const std::shared_ptr<tile_atlas>& atlas)
{
- ASSERT(atlas);
+ fm_assert(atlas);
clear_selection();
_selection_mode = sel_perm;
_permutation = { atlas, {} };
@@ -79,13 +79,13 @@ void tile_type::select_tile_permutation(const std::shared_ptr<tile_atlas>& atlas
bool tile_type::is_tile_selected(const std::shared_ptr<tile_atlas>& atlas, std::uint8_t variant)
{
- ASSERT(atlas);
+ fm_assert(atlas);
return _selection_mode == sel_tile && _selected_tile == std::make_tuple(atlas, variant);
}
bool tile_type::is_permutation_selected(const std::shared_ptr<tile_atlas>& atlas)
{
- ASSERT(atlas);
+ fm_assert(atlas);
return _selection_mode == sel_perm && std::get<0>(_permutation) == atlas;
}
@@ -135,7 +135,7 @@ void tile_type::place_tile(world& world, global_coords pos)
switch (_mode)
{
case editor_mode::select:
- WARN("wrong tile mode 'select'"); break;
+ fm_warn("wrong tile mode 'select'"); break;
case editor_mode::floor:
case editor_mode::walls:
diff --git a/main/loader-impl.cpp b/main/loader-impl.cpp
index 8112b350..9816fd40 100644
--- a/main/loader-impl.cpp
+++ b/main/loader-impl.cpp
@@ -48,7 +48,7 @@ std::string loader_impl::shader(Containers::StringView filename)
shader_res = std::make_optional<Utility::Resource>("floormat/shaders");
auto ret = shader_res->getString(filename);
if (ret.isEmpty())
- ABORT("can't find shader resource '%s'", filename.cbegin());
+ fm_abort("can't find shader resource '%s'", filename.cbegin());
return ret;
}
@@ -66,19 +66,19 @@ std::shared_ptr<tile_atlas> loader_impl::tile_atlas(Containers::StringView name,
Trade::ImageData2D loader_impl::tile_texture(Containers::StringView filename_)
{
static_assert(IMAGE_PATH[sizeof(IMAGE_PATH)-2] == '/');
- ASSERT(filename_.size() < 4096);
+ fm_assert(filename_.size() < 4096);
char* const filename = (char*)alloca(filename_.size() + sizeof(IMAGE_PATH));
std::memcpy(filename, IMAGE_PATH, sizeof(IMAGE_PATH)-1);
std::strcpy(filename + sizeof(IMAGE_PATH)-1, filename_.cbegin());
if (!tga_importer || !tga_importer->openFile(filename)) {
const auto path = Utility::Path::currentDirectory();
- MESSAGE("note: current working directory: '%s'", path->data());
- ABORT("can't open tile image '%s'", filename);
+ fm_log("note: current working directory: '%s'", path->data());
+ fm_abort("can't open tile image '%s'", filename);
}
auto img = tga_importer->image2D(0);
if (!img)
- ABORT("can't allocate tile image for '%s'", filename);
+ fm_abort("can't allocate tile image for '%s'", filename);
auto ret = std::move(*img);
return ret;
}
@@ -103,7 +103,7 @@ void loader_impl::set_application_working_directory()
std::error_code error;
std::filesystem::current_path(path, error);
if (error.value()) {
- WARN("failed to change working directory to '%s' (%s)",
+ fm_warn("failed to change working directory to '%s' (%s)",
path.string().data(), error.message().data());
}
}