diff --git a/NothinFancy/src/Application.cpp b/NothinFancy/src/Application.cpp index a6ae135..893a715 100644 --- a/NothinFancy/src/Application.cpp +++ b/NothinFancy/src/Application.cpp @@ -159,7 +159,7 @@ namespace nf { m_fpsClock1 = std::chrono::steady_clock::now(); } std::this_thread::sleep_until(next_time); - m_deltaTime = (std::chrono::steady_clock::now() - start_time).count(); + m_deltaTime = (double)(std::chrono::steady_clock::now() - start_time).count(); next_time += wait_time; } m_currentState->onExit(); diff --git a/NothinFancy/src/Renderer/VertexBuffer.cpp b/NothinFancy/src/Renderer/VertexBuffer.cpp index a385bab..b4ae9ac 100644 --- a/NothinFancy/src/Renderer/VertexBuffer.cpp +++ b/NothinFancy/src/Renderer/VertexBuffer.cpp @@ -1,7 +1,7 @@ #include "VertexBuffer.h" namespace nf { - VertexBuffer::VertexBuffer(const void* data, size_t size) { + VertexBuffer::VertexBuffer(const void* data, const size_t size) { glGenBuffers(1, &m_id); glBindBuffer(GL_ARRAY_BUFFER, m_id); glBufferData(GL_ARRAY_BUFFER, size, data, GL_STATIC_DRAW); diff --git a/NothinFancy/src/Utility.cpp b/NothinFancy/src/Utility.cpp index 2a66909..62ca2b8 100644 --- a/NothinFancy/src/Utility.cpp +++ b/NothinFancy/src/Utility.cpp @@ -12,7 +12,8 @@ namespace nf { void Debug::LogImp(const std::string& in) { std::chrono::duration time = getCurrentTime(); - std::printf("[%.4f] Debug: %s\n", time.count(), in.c_str()); + std::printf("[%.4f] Debug: ", time.count()); + std::cout << in << "\n"; } void Debug::LogImp(int in) { @@ -46,10 +47,10 @@ namespace nf { MultiByteToWideChar(CP_ACP, NULL, in, -1, out, length); return out; } - + //TODO: File encryption bool writeFile(const char* filename, const std::string& in) { std::string file(filename); - if (file.find('/') || file.find('\\')) { + if (file.find('/') != std::string::npos || file.find('\\') != std::string::npos) { int pos = file.find_last_of("/\\"); std::string temp = file.substr(0, pos); std::wstring folders(temp.begin(), temp.end()); @@ -71,7 +72,7 @@ namespace nf { out.close(); return true; } - //TODO: XOR encryption + std::string readFile(const char* filename) { std::ifstream in; in.open(filename); diff --git a/NothinFancy/src/include/Application.h b/NothinFancy/src/include/Application.h index e38df10..51fa9b4 100644 --- a/NothinFancy/src/include/Application.h +++ b/NothinFancy/src/include/Application.h @@ -9,6 +9,7 @@ #include "IntroGamestate.h" #include "Renderer.h" //TODO: Check #include consistency +//TODO: Separate #includes between headers and implementations //TODO: Document ALL frontend functions namespace nf { diff --git a/NothinFancy/src/include/VertexBuffer.h b/NothinFancy/src/include/VertexBuffer.h index 0ab97e9..55801c3 100644 --- a/NothinFancy/src/include/VertexBuffer.h +++ b/NothinFancy/src/include/VertexBuffer.h @@ -6,7 +6,7 @@ namespace nf { class VertexBuffer { public: - VertexBuffer(const void* data, size_t size); + VertexBuffer(const void* data, const size_t size); void bind() const;