Compare commits

..

No commits in common. "f5069859c5b3f57d3e28668f1c9469b5ed98cec1" and "db9c6c9446ada30464ef26edf4f23b7db0abba76" have entirely different histories.

48 changed files with 3 additions and 68 deletions

4
CMakeLists.txt Executable file → Normal file
View File

@ -15,8 +15,6 @@ option(BLT_ENABLE_WARN "Enable blt::logging BLT_WARN macro" ON)
option(BLT_ENABLE_ERROR "Enable blt::logging BLT_ERROR macro" ON)
option(BLT_ENABLE_FATAL "Enable blt::logging BLT_FATAL macro" ON)
configure_file(include/blt/config.h.in config/blt/config.h @ONLY)
if(${BUILD_STD} OR ${BUILD_PROFILING})
file(GLOB_RECURSE STD_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/blt/std/*.cpp")
else()
@ -52,6 +50,8 @@ message("Profiler Files ${PROFILING_FILES}")
message("Source: ${CMAKE_SOURCE_DIR}")
message("Current Source: ${CMAKE_CURRENT_SOURCE_DIR}")
configure_file(include/blt/config.h.in config/blt/config.h @ONLY)
add_library(BLT ${STD_FILES} ${PROFILING_FILES} ${NBT_FILES})
target_include_directories(BLT PUBLIC include/)

0
CMakeSettings.json Executable file → Normal file
View File

0
LICENSE Executable file → Normal file
View File

0
README.md Executable file → Normal file
View File

0
design.txt Executable file → Normal file
View File

0
icon.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

0
icon_large.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

0
icon_small.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

0
include/blt/config.h.in Executable file → Normal file
View File

0
include/blt/math/averages.h Executable file → Normal file
View File

0
include/blt/math/log_util.h Executable file → Normal file
View File

0
include/blt/math/math.h Executable file → Normal file
View File

2
include/blt/math/matrix.h Executable file → Normal file
View File

@ -96,7 +96,7 @@ namespace blt {
m00(m00() * x);
m11(m11() * y);
m22(m22() * z);
m22(m11() * z);
*this = *this * scale_mat;

0
include/blt/math/vectors.h Executable file → Normal file
View File

0
include/blt/nbt/nbt.h Executable file → Normal file
View File

0
include/blt/nbt/nbt_block.h Executable file → Normal file
View File

0
include/blt/profiling/profiler.h Executable file → Normal file
View File

0
include/blt/std/binary_tree.h Executable file → Normal file
View File

0
include/blt/std/filesystem.h Executable file → Normal file
View File

0
include/blt/std/format.h Executable file → Normal file
View File

0
include/blt/std/hash_map.h Executable file → Normal file
View File

0
include/blt/std/loader.h Executable file → Normal file
View File

0
include/blt/std/logging.h Executable file → Normal file
View File

0
include/blt/std/map.h Executable file → Normal file
View File

0
include/blt/std/memory.h Executable file → Normal file
View File

0
include/blt/std/queue.h Executable file → Normal file
View File

0
include/blt/std/random.h Executable file → Normal file
View File

36
include/blt/std/string.h Executable file → Normal file
View File

@ -16,41 +16,6 @@
namespace blt::string {
class StringBuffer {
private:
const size_t BLOCK_SIZE = 4096;
size_t front = 0;
size_t size = 0;
char* characterBuffer = nullptr;
void expand();
public:
void trim();
std::string str();
StringBuffer(){
characterBuffer = static_cast<char*>(malloc(BLOCK_SIZE));
size = BLOCK_SIZE;
}
StringBuffer& operator<<(char c);
StringBuffer& operator<<(const std::string& str) {
for (char c : str)
*this << c;
return *this;
}
template<typename T>
inline StringBuffer& operator<<(T t) {
*this << std::to_string(t);
return *this;
}
~StringBuffer() {
free(characterBuffer);
}
};
static inline bool starts_with(const std::string& string, const std::string& search){
if (search.length() > string.length())
return false;
@ -188,7 +153,6 @@ namespace blt::string {
trim(s);
return s;
}
}
#endif //BLT_STRING_H

0
include/blt/std/system.h Executable file → Normal file
View File

0
include/blt/std/time.h Executable file → Normal file
View File

0
include/blt/window/window.h Executable file → Normal file
View File

0
src/blt/nbt/nbt.cpp Executable file → Normal file
View File

0
src/blt/nbt/nbt_block.cpp Executable file → Normal file
View File

0
src/blt/profiling/profiler.cpp Executable file → Normal file
View File

0
src/blt/std/filesystem.cpp Executable file → Normal file
View File

0
src/blt/std/format.cpp Executable file → Normal file
View File

0
src/blt/std/loader.cpp Executable file → Normal file
View File

0
src/blt/std/logging.cpp Executable file → Normal file
View File

View File

@ -1,29 +0,0 @@
//
// Created by brett on 7/9/23.
//
#include <blt/std/string.h>
void blt::string::StringBuffer::expand() {
size_t multiplier = size / BLOCK_SIZE;
auto newSize = BLOCK_SIZE * (multiplier * 2);
characterBuffer = static_cast<char*>(realloc(characterBuffer, newSize));
size = newSize;
}
void blt::string::StringBuffer::trim() {
characterBuffer = static_cast<char*>(realloc(characterBuffer, front+1));
size = front+1;
characterBuffer[front] = '\0';
}
blt::string::StringBuffer& blt::string::StringBuffer::operator<<(char c) {
characterBuffer[front++] = c;
if (front > size)
expand();
return *this;
}
std::string blt::string::StringBuffer::str() {
trim();
return std::string{characterBuffer};
}

0
src/blt/std/system.cpp Executable file → Normal file
View File

0
src/blt/window/window.cpp Executable file → Normal file
View File

0
src/tests/binary_trees.h Executable file → Normal file
View File

0
src/tests/hashmap_tests.h Executable file → Normal file
View File

0
src/tests/logging.h Executable file → Normal file
View File

0
src/tests/main.cpp Executable file → Normal file
View File

0
src/tests/nbt_tests.h Executable file → Normal file
View File

0
src/tests/profiling_tests.h Executable file → Normal file
View File

0
src/tests/queue_tests.h Executable file → Normal file
View File