Merge branch 'Shipping-Build-Overhaul'

This commit is contained in:
2025-11-14 12:59:53 +01:00
48 changed files with 80 additions and 15387 deletions

8
.gitattributes vendored
View File

@@ -8,3 +8,11 @@ x64/Debug/lua54.dll filter=lfs diff=lfs merge=lfs -text
x64/Release/lua54.dll filter=lfs diff=lfs merge=lfs -text
x64/Debug/config.txt filter=lfs diff=lfs merge=lfs -text
x64/Release/config.txt filter=lfs diff=lfs merge=lfs -text
enginecustom/assets/Skybox/*.png filter=lfs diff=lfs merge=lfs -text
enginecustom/assets/sounds/*.mp3 filter=lfs diff=lfs merge=lfs -text
enginecustom/assets/sounds/*.opus filter=lfs diff=lfs merge=lfs -text
enginecustom/assets/Texture/*.png filter=lfs diff=lfs merge=lfs -text
enginecustom/assets/Texture/*.jpg filter=lfs diff=lfs merge=lfs -text
enginecustom/assets/Texture/*.tga filter=lfs diff=lfs merge=lfs -text
enginecustom/assets/Model/TXT/* filter=lfs diff=lfs merge=lfs -text
enginecustom/assets/Model/OBJ/* filter=lfs diff=lfs merge=lfs -text

BIN
enginecustom/assets/Model/TXT/bath.txt (Stored with Git LFS)

Binary file not shown.

BIN
enginecustom/assets/Model/TXT/chunk.txt (Stored with Git LFS)

Binary file not shown.

BIN
enginecustom/assets/Model/TXT/cube.txt (Stored with Git LFS)

Binary file not shown.

BIN
enginecustom/assets/Model/TXT/ground.txt (Stored with Git LFS)

Binary file not shown.

BIN
enginecustom/assets/Model/TXT/plane.txt (Stored with Git LFS)

Binary file not shown.

File diff suppressed because it is too large Load Diff

BIN
enginecustom/assets/Model/TXT/square.txt (Stored with Git LFS)

Binary file not shown.

BIN
enginecustom/assets/Model/TXT/wall.txt (Stored with Git LFS)

Binary file not shown.

BIN
enginecustom/assets/Model/TXT/water.txt (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 MiB

After

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 493 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 510 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 498 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 422 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 MiB

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 MiB

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 588 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 MiB

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 917 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 934 KiB

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 KiB

After

Width:  |  Height:  |  Size: 131 B

View File

@@ -75,20 +75,20 @@ public:
*
* @return Pointer to the ID3D11Device interface.
*/
ID3D11Device* get_device();
ID3D11Device* get_device() const { return device_; };
/**
* @brief Gets the Direct3D device context.
*
* @return Pointer to the ID3D11DeviceContext interface.
*/
ID3D11DeviceContext* get_device_context();
ID3D11DeviceContext* get_device_context() const { return device_context_; };
//XMMATRIX get_projection_matrix(XMMATRIX& projectionMatrix);
IDXGISwapChain* swap_chain;
/**
* Get the swap chain associated with the Direct3D device.
* @return Pointer to the IDXGISwapChain interface.
*/
IDXGISwapChain* get_swap_chain();
IDXGISwapChain* get_swap_chain() const { return swap_chain; };
/**
* Resizes the swap chain to the specified width and height.
* @param width New width of the swap chain.
@@ -100,7 +100,7 @@ public:
*
* @param vsync True to enable vertical sync, false to disable.
*/
void set_vsync(bool vsync);
void set_vsync(bool vsync) { vsync_enabled_ = vsync; };
/**
* Get the projection matrix.
@@ -135,7 +135,10 @@ public:
/**
* Resets the viewport to the default settings.
*/
void reset_viewport();
void reset_viewport() const
{
device_context_->RSSetViewports(1, &viewport_);
}
/**
* Release all Direct3D resources.
@@ -151,11 +154,17 @@ public:
/**
* Turn on the Z-buffer to enable depth.
*/
void turn_z_buffer_on();
void turn_z_buffer_on()const
{
device_context_->OMSetDepthStencilState(depth_stencil_state_, 1);
}
/**
* Turn off the Z-buffer to disable depth.
*/
void turn_z_buffer_off();
void turn_z_buffer_off() const
{
device_context_->OMSetDepthStencilState(depth_disabled_stencil_state_, 1);
}
/**
* Turn on alpha blending for transparency effects.

View File

@@ -44,6 +44,7 @@ inline int size_t_to_int(size_t x)
// --- Macros for logging with different severity levels --- //
// --------------------------------------------------------- //
#ifdef _DEBUG
#define LOG(msg, level) Logger::Get().Log(msg, __FILE__, __LINE__, level)
#define LOG_INFO(msg) Logger::Get().Log(msg, __FILE__, __LINE__, Logger::LogLevel::Info)
#define LOG_WARNING(msg) Logger::Get().Log(msg, __FILE__, __LINE__, Logger::LogLevel::Warning)
@@ -58,6 +59,20 @@ inline int size_t_to_int(size_t x)
return false; \
}
#else
#define LOG(msg, level) ((void)0)
#define LOG_INFO(msg) ((void)0)
#define LOG_WARNING(msg)((void)0)
#define LOG_ERROR(msg) ((void)0)
#define LOG_DEBUG(msg) ((void)0)
#define LOG_SHUTDOWN(msg) ((void)0)
#define LOG_INIT(msg) ((void)0)
#define R_LOG_ERROR(result,msg) ((void)0);
#endif
// ---------------------------------------------------- //
// --- Macros for the Entity Component System (ECS) --- //
// ---------------------------------------------------- //

View File

@@ -3,8 +3,6 @@
#define WIN32_LEAN_AND_MEAN
static bool DEBUG_MODE = true;
#include "Logger.h"
#include "input_class.h"

View File

@@ -555,21 +555,9 @@ void d_3d_class::end_scene()
return;
}
ID3D11Device* d_3d_class::get_device()
void d_3d_class::get_video_card_info(char* description, int& memory)
{
return device_;
}
ID3D11DeviceContext* d_3d_class::get_device_context()
{
return device_context_;
}
void d_3d_class::get_video_card_info(char* cardName, int& memory)
{
strcpy_s(cardName, 128, video_card_description_);
strcpy_s(description, 128, video_card_description_);
memory = video_card_memory_;
return;
}
@@ -583,15 +571,6 @@ void d_3d_class::set_back_buffer_render_target()
return;
}
void d_3d_class::reset_viewport()
{
// Set the viewport.
device_context_->RSSetViewports(1, &viewport_);
return;
}
void d_3d_class::release_resources()
{
LOG_SHUTDOWN("Releasing D3D resources");
@@ -689,11 +668,6 @@ void d_3d_class::reset_resources(int newWidth, int newHeight)
device_context_->OMSetRenderTargets(1, &render_target_view_, depth_stencil_view_);
}
IDXGISwapChain* d_3d_class::get_swap_chain()
{
return swap_chain;
}
void d_3d_class::resize_swap_chain(int newWidth, int newHeight)
{
LOG_INFO("Resizing swap chain to " + std::to_string(newWidth) + "x" + std::to_string(newHeight));
@@ -721,19 +695,6 @@ void d_3d_class::resize_swap_chain(int newWidth, int newHeight)
device_context_->RSSetViewports(1, &viewport_);
}
void d_3d_class::turn_z_buffer_on()
{
device_context_->OMSetDepthStencilState(depth_stencil_state_, 1);
return;
}
void d_3d_class::turn_z_buffer_off()
{
device_context_->OMSetDepthStencilState(depth_disabled_stencil_state_, 1);
return;
}
void d_3d_class::enable_alpha_blending()
{
float blendFactor[4];
@@ -768,11 +729,6 @@ void d_3d_class::disable_alpha_blending()
return;
}
void d_3d_class::set_vsync(bool vsync)
{
vsync_enabled_ = vsync;
}
bool d_3d_class::set_projection_params(int width, int height, float screenDepth, float screenNear)
{
float fieldOfView, screenAspect;

View File

@@ -61,17 +61,16 @@ bool system_class::initialize()
application_->get_direct_3d()->resize_swap_chain(initial_window_width_, initial_window_height_);
}
#ifdef _DEBUG
// initialize imgui
if(DEBUG_MODE)
imgui_manager_ = std::make_shared<imguiManager>();
imgui_manager_->SetApp(application_);
result = imgui_manager_->Initialize(hwnd_, application_->get_direct_3d()->get_device(), application_->get_direct_3d()->get_device_context());
if (!result)
{
imgui_manager_ = std::make_shared<imguiManager>();
imgui_manager_->SetApp(application_);
result = imgui_manager_->Initialize(hwnd_, application_->get_direct_3d()->get_device(), application_->get_direct_3d()->get_device_context());
if (!result)
{
R_FALSE
}
R_FALSE
}
#endif
}
catch (const std::exception& e)
@@ -177,19 +176,8 @@ bool system_class::frame()
R_FALSE
}
if(!input_->IsKeyDown(222))
{
//log the key press
is_debug_key_pressed_ = false;
}
else if (input_->IsKeyDown(222) && !is_debug_key_pressed_)
{
// Log the key release state
is_debug_key_pressed_ = true;
DEBUG_MODE = !DEBUG_MODE;
}
if (DEBUG_MODE)
#ifdef _DEBUG
if (input_->IsKeyDown(DIK_F1))
{
// render ImGui
result = imgui_manager_->ImGuiWidgetRenderer();
@@ -199,6 +187,7 @@ bool system_class::frame()
R_FALSE
}
}
#endif
application_->get_direct_3d()->end_scene();

BIN
x64/Debug/config.txt (Stored with Git LFS)

Binary file not shown.

BIN
x64/Release/config.txt (Stored with Git LFS)

Binary file not shown.