Fixed crash wheree empty prefab exists

This commit is contained in:
Antoine Pilote
2023-09-26 01:08:13 -04:00
parent d843d54388
commit 239d9479d8
5 changed files with 12 additions and 8 deletions

View File

@@ -496,6 +496,11 @@ namespace Nuake
void DynamicWorld::StepSimulation(Timestep ts)
{
if (ts > 0.1f)
{
ts = 0.08f;
}
// Next step
++_stepCount;

View File

@@ -20,7 +20,9 @@ namespace Nuake
if (FileSystem::FileExists(path, false))
{
std::string prefabTextContent = FileSystem::ReadFile(path);
newPrefab->Deserialize(json::parse(prefabTextContent));
if(!prefabTextContent.empty())
newPrefab->Deserialize(json::parse(prefabTextContent));
}
return newPrefab;

View File

@@ -35,14 +35,14 @@ namespace Nuake
float Exposure = 3.5f;
float Gamma = 1.1f;
bool BloomEnabled = false;
bool BloomEnabled = true;
Scope<Bloom> mBloom;
Scope<Volumetric> mVolumetric;
bool SSAOEnabled = true;
Scope<SSAO> mSSAO;
bool SSREnabled = false;
bool SSREnabled = true;
bool DOFEnabled = false;

View File

@@ -316,7 +316,9 @@ namespace Nuake
unsigned char pix = pixels[y * width + x];
if (pix >= 256 - 32)
{
fullbright = true;
}
textureData[y * width + x] = COL_ReadPalette(pix);
}

View File

@@ -80,11 +80,6 @@ int ApplicationMain(int argc, char* argv[])
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hInstPrev, LPSTR cdmline, int cmdshow)
{
BOOL USE_DARK_MODE = true;
BOOL SET_IMMERSIVE_DARK_MODE_SUCCESS = SUCCEEDED(DwmSetWindowAttribute(
WINhWnd, DWMWINDOWATTRIBUTE::DWMWA_USE_IMMERSIVE_DARK_MODE,
&USE_DARK_MODE, sizeof(USE_DARK_MODE)));
return ApplicationMain(__argc, __argv);
}