Patch - Uses degree conversion macro - V14.5.35

Replaces direct calculations of radians to degrees with a macro.

This change centralizes the conversion factor, enhancing code
readability and maintainability. It also removes a duplicate
definition of the same macro.
This commit is contained in:
2025-10-10 18:13:49 +02:00
parent 526b38eb4f
commit af5473f6e3
2 changed files with 5 additions and 21 deletions

View File

@@ -8,6 +8,8 @@
// --------------------- //
#define R_FALSE return false;
#define R_TRUE return true;
#define TO_RAD 0.0174532925f
#define TO_DEG (180.0f/3.141593f)
#ifdef max
#pragma push_macro("max")
@@ -164,8 +166,6 @@ inline bool TestPlaneCorner(
// ---------------------------------------------- //
// --- Macros for the camera input processing --- //
// ---------------------------------------------- //
#define TO_RAD 0.0174532925f
struct CameraInput {
bool move_forward = false;
bool move_backward = false;

View File

@@ -840,8 +840,8 @@ bool application_class::frame(input_class* Input)
camera_->move(frameTime, deltaX, deltaY);
XMFLOAT3 dir = sun_light_->GetDirection();
float pitch = asinf(-dir.y) * (180.0f / XM_PI); // en degr<67>s
float yaw = atan2f(dir.x, dir.z) * (180.0f / XM_PI); // en degr<67>s
float pitch = asinf(-dir.y) * TO_DEG; // en degr<67>s
float yaw = atan2f(dir.x, dir.z) * TO_DEG; // en degr<67>s
float roll = 0.0f;
if (Input->is_key_pressed(DIK_TAB)) {
@@ -1157,9 +1157,6 @@ bool application_class::render(float rotation, float x, float y, float z, float
R_FALSE
}
// Reset the world matrix.
worldMatrix = direct_3d_->get_world_matrix();
// Get the camera reflection view matrix.
camera_->get_reflection_view_matrix(reflectionMatrix);
@@ -1842,19 +1839,6 @@ bool application_class::render_pass(XMFLOAT4* diffuse, XMFLOAT4* position, XMFLO
renderCount += entitiesRendered;
}
// Rendu des objets traditionnels comme avant
// if (active_camera_ == sun_camera_)
// {
// shadow_map_->set_render_target(direct_3d_->get_device_context());
// shadow_map_->clear_render_target(direct_3d_->get_device_context());
// }
// if (active_camera_ == sun_camera_)
// {
// direct_3d_->set_back_buffer_render_target();
// direct_3d_->reset_viewport();
// }
set_render_count(renderCount);
R_TRUE