Skip to content

Commit

Permalink
Patch 1.0.1 (Bugfixes)
Browse files Browse the repository at this point in the history
Added options to save and load light settings for global lights and weapon lights in the lights debug menu
Added options to configure strength of headlights in the raytracing options
Added an option for "smooth textures" (bilinear filtering instead of point filtering) in the raytracing options

Fixed NaN values (black nanobot swarm) occurring while rendering the level
Fixed crashes that sometimes occurred when loading a savegame (both quicksaves and normal saves were affected by this)
Fixed the camera in the end level cutscene so now the ship leaving the mine will be shown properly
Fixed the lighting in the endlevel cutscenes (most of them were completely dark)
Fixed empty energy bar being visible through UI menus and elements
  • Loading branch information
Contingencyy committed Jul 19, 2023
1 parent 33f257c commit de81b9b
Show file tree
Hide file tree
Showing 20 changed files with 779 additions and 103 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,6 @@ tags # ctags files used with vim
# I don't want to include the noise textures because they originated from the renderer's assets which are kept
# elsewhere.
d1/assets/textures/noise

# make sure to include DXC dlls
!RT/Renderer/Backend/DX12/DXC/bin/*
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ D1X_RAYTRACER_NAME="D1X_RAYTRACER"

D1X_RAYTRACER_VERSION_MAJORi=1
D1X_RAYTRACER_VERSION_MINORi=0
D1X_RAYTRACER_VERSION_MICROi=0
D1X_RAYTRACER_VERSION_MICROi=1

#DXX-Retro last used version
DXX_VERSION_MAJORi=0
Expand Down
33 changes: 33 additions & 0 deletions RT/Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,32 @@ bool RT_ConfigReadInt(RT_Config *cfg, RT_String key, int *value)
return result;
}

bool RT_ConfigReadVec2(RT_Config *cfg, RT_String key, RT_Vec2 *value)
{
bool result = false;

RT_String string;
if (RT_ConfigReadString(cfg, key, &string))
{
RT_ParseFloatResult parse_x = RT_ParseFloat(string);
string = RT_StringAdvance(string, parse_x.advance);
string = RT_StringAdvance(string, RT_StringFindChar(string, ',') + 1);
string = RT_StringAdvance(string, RT_StringFindFirstNonWhitespace(string));
RT_ParseFloatResult parse_y = RT_ParseFloat(string);

result = (parse_x.success &&
parse_y.success);

if (result)
{
value->x = parse_x.value;
value->y = parse_y.value;
}
}

return result;
}

bool RT_ConfigReadVec3(RT_Config *cfg, RT_String key, RT_Vec3 *value)
{
bool result = false;
Expand Down Expand Up @@ -264,6 +290,13 @@ void RT_ConfigWriteInt(RT_Config *cfg, RT_String key, int value)
cfg->last_modified_time = RT_GetHighResTime().value;
}

void RT_ConfigWriteVec2(RT_Config *cfg, RT_String key, RT_Vec2 value)
{
RT_ConfigKeyValue *kv = RT_ConfigFindOrCreateKeyValue(cfg, key);
kv->value_count = snprintf(kv->value, sizeof(kv->value), "%f, %f", value.x, value.y);
cfg->last_modified_time = RT_GetHighResTime().value;
}

void RT_ConfigWriteVec3(RT_Config *cfg, RT_String key, RT_Vec3 value)
{
RT_ConfigKeyValue *kv = RT_ConfigFindOrCreateKeyValue(cfg, key);
Expand Down
2 changes: 2 additions & 0 deletions RT/Core/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ RT_API void RT_DeserializeConfigFromString(RT_Config *cfg, RT_String string);
RT_API bool RT_ConfigReadString(RT_Config *cfg, RT_String key, RT_String *value);
RT_API bool RT_ConfigReadFloat(RT_Config *cfg, RT_String key, float *value);
RT_API bool RT_ConfigReadInt(RT_Config *cfg, RT_String key, int *value);
RT_API bool RT_ConfigReadVec2(RT_Config *cfg, RT_String key, RT_Vec2 *value);
RT_API bool RT_ConfigReadVec3(RT_Config *cfg, RT_String key, RT_Vec3 *value);
RT_API void RT_ConfigWriteString(RT_Config *cfg, RT_String key, RT_String value);
RT_API void RT_ConfigWriteFloat(RT_Config *cfg, RT_String key, float value);
RT_API void RT_ConfigWriteInt(RT_Config *cfg, RT_String key, int value);
RT_API void RT_ConfigWriteVec2(RT_Config *cfg, RT_String key, RT_Vec2 value);
RT_API void RT_ConfigWriteVec3(RT_Config *cfg, RT_String key, RT_Vec3 value);
RT_API bool RT_ConfigEraseKey(RT_Config *cfg, RT_String key); // Returns true if the key existed
RT_API RT_String RT_SerializeConfigToString(RT_Arena *arena, RT_Config *cfg);
Expand Down
Loading

0 comments on commit de81b9b

Please sign in to comment.