diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-07-19 14:33:34 +1000 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-07-19 14:33:34 +1000 |
commit | 82515f9d90ac149984013f0d64c1cab37b349b29 (patch) | |
tree | 6da445874d055e3e66ab1825d4aa3bb784955fc9 /src/core | |
parent | 5359c011a08ef2e06ed54104cc16c32868ca88ff (diff) |
chore clang format + tidy
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/camera.h | 8 | ||||
-rw-r--r-- | src/core/core.h | 12 | ||||
-rw-r--r-- | src/core/triggers.h | 6 | ||||
-rw-r--r-- | src/core/vfs.h | 38 |
4 files changed, 51 insertions, 13 deletions
diff --git a/src/core/camera.h b/src/core/camera.h index 9709677..7d2c7ed 100644 --- a/src/core/camera.h +++ b/src/core/camera.h @@ -22,12 +22,12 @@ Camera Camera_Create(Vec3 pos, Vec3 front, Vec3 up, f32 fov); * @param out_view optionally stores just the view matrix * @param out_proj optionally stores just the projection matrix * @returns the camera's view projection matrix pre-multiplied -*/ -PUB Mat4 Camera_ViewProj(Camera* c, f32 lens_height, f32 lens_width, Mat4* out_view, Mat4* out_proj); + */ +PUB Mat4 Camera_ViewProj(Camera* c, f32 lens_height, f32 lens_width, Mat4* out_view, + Mat4* out_proj); /** @brief Get 2D camera transform matrix */ -PUB Mat4 Camera_View2D(Camera* c); // TODO: 2D cameras - +PUB Mat4 Camera_View2D(Camera* c); // TODO: 2D cameras // TODO: (HIGH) Basic reusable camera controls /* diff --git a/src/core/core.h b/src/core/core.h index b0f8dbe..ac07c50 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -1,8 +1,8 @@ #pragma once #include "input.h" -#include "render_types.h" #include "mem.h" +#include "render_types.h" #include "scene.h" #include "screenspace.h" #include "terrain.h" @@ -14,11 +14,11 @@ TYPED_POOL(Model, Model) typedef struct GLFWwindow GLFWwindow; typedef struct Core { - const char* app_name; - GLFWwindow* window; - Renderer* renderer; - Input_State input; - Model_pool models; + const char* app_name; + GLFWwindow* window; + Renderer* renderer; + Input_State input; + Model_pool models; } Core; extern Core g_core; diff --git a/src/core/triggers.h b/src/core/triggers.h index a9ced17..a823890 100644 --- a/src/core/triggers.h +++ b/src/core/triggers.h @@ -4,12 +4,12 @@ // Events/signals that get triggered by certain things that happen /* -e.g. +e.g. collider enters volume (collider) collider exits volume (collider) -you could create a custom signal that only triggers when a collider has been inside a volume for 3 seconds -listen for Enter, start timer, if hits 3 -> emit signal. Else, reset state +you could create a custom signal that only triggers when a collider has been inside a volume for 3 +seconds listen for Enter, start timer, if hits 3 -> emit signal. Else, reset state Top-level triggers: level loaded diff --git a/src/core/vfs.h b/src/core/vfs.h new file mode 100644 index 0000000..41033f5 --- /dev/null +++ b/src/core/vfs.h @@ -0,0 +1,38 @@ +#pragma once +#include "defines.h" + +#define MAX_VIRTUAL_FILENAME_LEN 256 + +typedef struct VFS_Pack VFS_Pack; + +const char VFS_OpenErr_DoesNotExist[] = "PATH DOES NOT EXIST"; + +typedef struct VFS_File { + size_t n_bytes; + void* data; +} VFS_File; + +// virtual file open result +typedef struct VFS_FileRes { + bool success; + const char* error_reason; + VFS_File file; +} VFS_FileRes; + +VFS_Pack* VFS_Open(const char* filepath); + +bool VFS_Close(VFS_Pack*); + +VFS_FileRes VFS_VirtualRead(VFS_Pack* vfs, const char* unique_path); + +typedef struct VFS_PackBuilder { + const char* pack_filename; +} VFS_PackBuilder; + +typedef struct VFS_FileEntry { + char filename[MAX_VIRTUAL_FILENAME_LEN]; + size_t offset; + size_t size; +} VFS_FileEntry; + +VFS_PackBuilder VFS_Pack_Create();
\ No newline at end of file |