Skip to content

Commit

Permalink
Removed unaccessary workarounds to export preprocessor variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
larioteo committed Oct 15, 2023
1 parent 324750c commit e968a5a
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 39 deletions.
2 changes: 0 additions & 2 deletions Source/Library/Ultra/Core/Core.ixx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
export module Ultra.Core;

// Custom Library
export import "Core.h";
export import "Platform.h";
export import Ultra.Core.Helpers;
export import Ultra.Core.Types;

Expand Down
4 changes: 0 additions & 4 deletions Source/Library/Ultra/Core/Logger.h

This file was deleted.

11 changes: 7 additions & 4 deletions Source/Library/Ultra/Core/Logger.ixx
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export module Ultra.Logger;
module;

#include <Ultra/Core/Core.h>

export module Ultra.Logger;

// Library
import Ultra.Core;
Expand Down Expand Up @@ -541,13 +545,15 @@ template<typename ...Args> void LogDelimiter(const LogRecord &record, Args &&...
template<typename T, typename ...Args> bool AppAssert(T *object, const LogRecord &record, Args &&...args) {
if (!object) {
logger(LogLevel::Fatal, record, args...); logger << "\n";
//APP_DEBUGBREAK();
return true;
}
return false;
}
template<typename T, typename ...Args> bool AppAssert(T object, const LogRecord &record, Args &&...args) {
if (!object) {
logger(LogLevel::Fatal, record, args...); logger << "\n";
//APP_DEBUGBREAK();
return true;
}
return false;
Expand Down Expand Up @@ -609,6 +615,3 @@ struct formatter<Ultra::LogLevel> {
};

}

// Preprocessor Macro Extensions
export import "Logger.h";
2 changes: 1 addition & 1 deletion Source/Library/Ultra/Core/Types.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ using std::format;
using std::ofstream;
using std::ostream;
using std::ostringstream;
using std::wostringstream;
using std::stringstream;
using std::vformat;
using std::wofstream;
using std::wostream;
using std::wostringstream;

// Types
using std::int8_t;
Expand Down
3 changes: 1 addition & 2 deletions Source/Library/Ultra/Graphics/Context.cxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module;

// Hack: The included header unit in the Core module doesn't work here.
#include "Ultra/Core/Core.h"

module Ultra.Graphics.Context;
Expand Down Expand Up @@ -35,7 +34,7 @@ Reference<Context> Context::Create(void *window) {
}
}
#else
AppAssert(false, "This platform is currently not supported!");
AppAssert(false, "The selected platform is currently not supported!");
return nullptr;
#endif
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module;

// Hack: The included header unit in the Core module doesn't work here.
#include "Ultra/Core/Core.h"

#if defined(APP_PLATFORM_WINDOWS)
Expand Down
13 changes: 6 additions & 7 deletions Source/Library/Ultra/System/Event.cxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module;

// Hack: The included header unit in the Core module doesn't work here.
#include "Ultra/Core/Core.h"

module Ultra.System.Event;
Expand All @@ -14,12 +13,12 @@ import Ultra.Logger;
namespace Ultra {

Scope<EventListener> EventListener::Create() {
#ifdef APP_PLATFORM_WINDOWS
return CreateScope<WinEventListener>();
#else
AppAssert(nullptr, "The current platform isn't supported!");
return nullptr;
#endif
#ifdef APP_PLATFORM_WINDOWS
return CreateScope<WinEventListener>();
#else
AppAssert(nullptr, "The current platform isn't supported!");
return nullptr;
#endif
}

}
11 changes: 5 additions & 6 deletions Source/Library/Ultra/System/Input.cxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module;

// Hack: The included header unit in the Core module doesn't work here.
#include "Ultra/Core/Core.h"

module Ultra.System.Input;
Expand All @@ -17,11 +16,11 @@ namespace Ultra {
Scope<Input> Input::Instance = Input::Create();

Scope<Input> Input::Create() {
#if defined(APP_PLATFORM_WINDOWS)
return CreateScope<WinInput>();
#else
return nullptr;
#endif
#if defined(APP_PLATFORM_WINDOWS)
return CreateScope<WinInput>();
#else
return nullptr;
#endif
}

bool Input::GetKeyState(KeyCode code) {
Expand Down
13 changes: 6 additions & 7 deletions Source/Library/Ultra/UI/Dialog.cxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module;

// Hack: The included header unit in the Core module doesn't work here.
#include "Ultra/Core/Core.h"

module Ultra.UI.Dialog;
Expand All @@ -14,12 +13,12 @@ import Ultra.Logger;
namespace Ultra {

Scope<Dialog> Dialog::Create() {
#ifdef APP_PLATFORM_WINDOWS
return CreateScope<WinDialog>();
#else
AppAssert(nullptr, "The current platform isn't supported!");
return nullptr;
#endif
#ifdef APP_PLATFORM_WINDOWS
return CreateScope<WinDialog>();
#else
AppAssert(nullptr, "The current platform isn't supported!");
return nullptr;
#endif
}

}
1 change: 0 additions & 1 deletion Source/Library/Ultra/UI/ImGui/GUIBuilder.cxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module;

// Hack: The included header unit in the Core module doesn't work here.
#include "Ultra/Core/Core.h"

// Properties
Expand Down
2 changes: 0 additions & 2 deletions Source/Library/Ultra/UI/ImGui/GUIBuilder.ixx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
module;

// Hack: The included header unit in the Core module doesn't work here.
#include "Ultra/Core/Core.h"

///
Expand Down
1 change: 0 additions & 1 deletion Source/Library/Ultra/UI/Window.cxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module;

// Hack: The included header unit in the Core module doesn't work here.
#include "Ultra/Core/Core.h"

module Ultra.UI.Window;
Expand Down
2 changes: 1 addition & 1 deletion Source/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
///

// Application Information (the solution name will be replaced by preprocessor!)
namespace SOLUTION_NAME {
export namespace SOLUTION_NAME {

// Information
constexpr auto AppCaption = "Ultra Spectra";
Expand Down

0 comments on commit e968a5a

Please sign in to comment.