Skip to content

Commit 2683d1b

Browse files
committed
tweak(ww3d): Decouple render update from logic step in DazzleRenderObjClass::Render, TexProjectClass::Pre_Render_Update (#1579)
1 parent 8dc210c commit 2683d1b

File tree

4 files changed

+4
-14
lines changed

4 files changed

+4
-14
lines changed

Generals/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -940,8 +940,7 @@ void DazzleRenderObjClass::Render(RenderInfoClass & rinfo)
940940
const DazzleTypeClass* params=types[type];
941941
params->Calculate_Intensities(dazzle_intensity,dazzle_size,current_halo_intensity,camera_dir,current_dir,current_distance);
942942

943-
unsigned time_ms=WW3D::Get_Sync_Frame_Time();
944-
if (time_ms==0) time_ms=1;
943+
float time_ms=WW3D::Get_Logic_Frame_Time_Milliseconds();
945944
float weight=pow(params->ic.history_weight,time_ms);
946945

947946
if (dazzle_intensity>0.0f) {
@@ -1478,9 +1477,6 @@ void DazzleLayerClass::Render(CameraClass* camera)
14781477

14791478
camera->Apply();
14801479

1481-
unsigned time_ms=WW3D::Get_Sync_Frame_Time();
1482-
if (time_ms==0) time_ms=1;
1483-
14841480
DX8Wrapper::Set_Material(NULL);
14851481

14861482
for (unsigned type=0;type<type_count;++type) {

Generals/Code/Libraries/Source/WWVegas/WW3D2/texproject.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,9 +1283,8 @@ void TexProjectClass::Pre_Render_Update(const Matrix3D & camera)
12831283
/*
12841284
** update the current intensity by iterating it towards the desired intensity
12851285
*/
1286-
float frame_time = (float)WW3D::Get_Sync_Frame_Time() / 1000.0f;
12871286
float intensity_delta = DesiredIntensity - Intensity;
1288-
float max_intensity_delta = INTENSITY_RATE_OF_CHANGE * frame_time;
1287+
float max_intensity_delta = INTENSITY_RATE_OF_CHANGE * WW3D::Get_Logic_Frame_Time_Seconds();
12891288

12901289
if (intensity_delta > max_intensity_delta) {
12911290
Intensity += max_intensity_delta;

GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -975,8 +975,7 @@ void DazzleRenderObjClass::Render(RenderInfoClass & rinfo)
975975
const DazzleTypeClass* params=types[type];
976976
params->Calculate_Intensities(dazzle_intensity,dazzle_size,current_halo_intensity,camera_dir,current_dir,dir,current_distance);
977977

978-
unsigned time_ms=WW3D::Get_Sync_Frame_Time();
979-
if (time_ms==0) time_ms=1;
978+
float time_ms=WW3D::Get_Logic_Frame_Time_Milliseconds();
980979
float weight=pow(params->ic.history_weight,time_ms);
981980

982981
if (dazzle_intensity>0.0f) {
@@ -1584,9 +1583,6 @@ void DazzleLayerClass::Render(CameraClass* camera)
15841583

15851584
camera->Apply();
15861585

1587-
unsigned time_ms=WW3D::Get_Sync_Frame_Time();
1588-
if (time_ms==0) time_ms=1;
1589-
15901586
DX8Wrapper::Set_Material(NULL);
15911587

15921588
for (unsigned type=0;type<type_count;++type) {

GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texproject.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,9 +1317,8 @@ void TexProjectClass::Pre_Render_Update(const Matrix3D & camera)
13171317
/*
13181318
** update the current intensity by iterating it towards the desired intensity
13191319
*/
1320-
float frame_time = (float)WW3D::Get_Sync_Frame_Time() / 1000.0f;
13211320
float intensity_delta = DesiredIntensity - Intensity;
1322-
float max_intensity_delta = INTENSITY_RATE_OF_CHANGE * frame_time;
1321+
float max_intensity_delta = INTENSITY_RATE_OF_CHANGE * WW3D::Get_Logic_Frame_Time_Seconds();
13231322

13241323
if (intensity_delta > max_intensity_delta) {
13251324
Intensity += max_intensity_delta;

0 commit comments

Comments
 (0)