Fog factor correction, small fixes

This commit is contained in:
MihailRis
2023-11-14 22:57:27 +03:00
parent f6c74dfb8b
commit ccbfaa3a86
5 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ else()
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -lstdc++fs target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -lstdc++fs
# additional warnings # additional warnings
-Wformat-nonliteral -Wcast-align -Wformat-nonliteral -Wcast-align
-Wpointer-arith -Winline -Wundef -Wpointer-arith -Wundef
-Wwrite-strings -Wno-unused-parameter) -Wwrite-strings -Wno-unused-parameter)
endif() endif()
+1 -1
View File
@@ -115,7 +115,7 @@ void Engine::mainloop() {
level->update(); level->update();
level->chunksController->update(settings.chunks.loadSpeed); level->chunksController->update(settings.chunks.loadSpeed);
float fovFactor = 16.0f / (float)settings.chunks.loadDistance; float fovFactor = 18.0f / (float)settings.chunks.loadDistance;
worldRenderer.draw(camera, occlusion, fovFactor, settings.fogCurve); worldRenderer.draw(camera, occlusion, fovFactor, settings.fogCurve);
hud.draw(); hud.draw();
if (level->player->debug) { if (level->player->debug) {
+4 -4
View File
@@ -10,25 +10,25 @@ using std::stringstream;
using std::wstring; using std::wstring;
using std::wstringstream; using std::wstringstream;
wstring lfill(wstring s, int length, wchar_t c) { wstring lfill(wstring s, uint length, wchar_t c) {
if (s.length() >= length) { if (s.length() >= length) {
return s; return s;
} }
wstringstream ss; wstringstream ss;
for (int i = 0; i < length-s.length(); i++) { for (uint i = 0; i < length-s.length(); i++) {
ss << c; ss << c;
} }
ss << s; ss << s;
return ss.str(); return ss.str();
} }
wstring rfill(wstring s, int length, wchar_t c) { wstring rfill(wstring s, uint length, wchar_t c) {
if (s.length() >= length) { if (s.length() >= length) {
return s; return s;
} }
wstringstream ss; wstringstream ss;
ss << s; ss << s;
for (int i = 0; i < length-s.length(); i++) { for (uint i = 0; i < length-s.length(); i++) {
ss << c; ss << c;
} }
return ss.str(); return ss.str();
+2 -2
View File
@@ -4,8 +4,8 @@
#include <string> #include <string>
#include "../typedefs.h" #include "../typedefs.h"
extern std::wstring lfill(std::wstring s, int length, wchar_t c); extern std::wstring lfill(std::wstring s, uint length, wchar_t c);
extern std::wstring rfill(std::wstring s, int length, wchar_t c); extern std::wstring rfill(std::wstring s, uint length, wchar_t c);
extern uint encode_utf8(uint c, ubyte* bytes); extern uint encode_utf8(uint c, ubyte* bytes);
extern std::string wstr2str_utf8(const std::wstring ws); extern std::string wstr2str_utf8(const std::wstring ws);
+1 -1
View File
@@ -13,7 +13,7 @@
#include "coders/toml.h" #include "coders/toml.h"
#include "files/files.h" #include "files/files.h"
inline toml::Wrapper create_wrapper(EngineSettings& settings) { toml::Wrapper create_wrapper(EngineSettings& settings) {
toml::Wrapper wrapper; toml::Wrapper wrapper;
toml::Section& display = wrapper.add("display"); toml::Section& display = wrapper.add("display");
display.add("width", &settings.display.width); display.add("width", &settings.display.width);