Added animations
Added new assets for the player Added lookups for assets Initial sound testing Re-enabled temp world drawing
This commit is contained in:
@@ -1,5 +1,18 @@
|
||||
// @Todo: These should move to draw/core.c
|
||||
//
|
||||
internal void G_AssetNameHash(D_Context *draw, Str8 name, U32 id) {
|
||||
D_AssetHash *result = M_ArenaPush(draw->arena, D_AssetHash);
|
||||
|
||||
U64 hash = Str8_Hash(name);
|
||||
U64 index = hash & (D_ASSET_HASH_COUNT - 1);
|
||||
|
||||
result->value = name;
|
||||
result->hash = hash;
|
||||
result->id = id;
|
||||
|
||||
SLL_Push(draw->lookup[index], result);
|
||||
}
|
||||
|
||||
void G_ImagesLoad(G_State *game) {
|
||||
M_TempScope(0, 0) {
|
||||
D_Context *draw = &game->draw;
|
||||
@@ -59,6 +72,9 @@ void G_ImagesLoad(G_State *game) {
|
||||
|
||||
white->name = S("_WHITE");
|
||||
|
||||
// This doesn't _really_ need one because its just zero and always will be zero
|
||||
G_AssetNameHash(draw, white->name, 0);
|
||||
|
||||
white->image.width = 2;
|
||||
white->image.height = 2;
|
||||
white->image.format = VK_FORMAT_R8G8B8A8_SRGB;
|
||||
@@ -71,7 +87,7 @@ void G_ImagesLoad(G_State *game) {
|
||||
// and submitting them in one go. It doesn't really matter for now
|
||||
//
|
||||
|
||||
VkImageMemoryBarrier2 transfer = { 0 };
|
||||
VkImageMemoryBarrier2 transfer = { 0 };
|
||||
VkImageMemoryBarrier2 shader_read = { 0 };
|
||||
|
||||
transfer.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2;
|
||||
@@ -147,10 +163,11 @@ void G_ImagesLoad(G_State *game) {
|
||||
|
||||
Assert(offset <= staging->size);
|
||||
|
||||
draw->n_images += 1;
|
||||
|
||||
image->name = Str8_Copy(game->arena, Str8_RemoveAfterLast(it->basename, '.'));
|
||||
|
||||
G_AssetNameHash(draw, image->name, draw->n_images);
|
||||
|
||||
draw->n_images += 1;
|
||||
printf("[Info] :: Loaded %.*s from %.*s\n", Sv(image->name), Sv(it->basename));
|
||||
|
||||
image->image.width = w;
|
||||
@@ -290,6 +307,22 @@ void G_PipelinesLoad(G_State *game) {
|
||||
Vk_PipelineCreate(basic);
|
||||
}
|
||||
|
||||
void G_AudioLoad(G_State *game) {
|
||||
(void) game;
|
||||
|
||||
M_TempScope(0, 0) {
|
||||
Str8 exe_path = FS_SystemPath(temp.arena, FS_SYSTEM_PATH_EXE);
|
||||
Str8 path = Sf(temp.arena, "%.*s/assets", Sv(exe_path));
|
||||
|
||||
FS_List assets = FS_PathList(temp.arena, path);
|
||||
|
||||
// @Incomplete: finish this
|
||||
|
||||
for (FS_Entry *it = assets.first; it != 0; it = it->next) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void G_CalculateCamera(G_Camera *camera, F32 aspect) {
|
||||
Mat4x4FInv proj = M4x4F_Perspective(camera->fov, aspect, camera->nearp, camera->farp);
|
||||
Mat4x4FInv view = M4x4F_CameraView(camera->x, camera->y, camera->z, camera->p);
|
||||
|
||||
Reference in New Issue
Block a user