update submodules, project compiles again
This commit is contained in:
parent
aaa40d2017
commit
35985df611
6
.gitmodules
vendored
6
.gitmodules
vendored
@ -1,6 +1,6 @@
|
||||
[submodule "src/VulkanRenderer"]
|
||||
path = src/VulkanRenderer
|
||||
url = https://git.sleepy.day/sleepy-day/VulkanRenderer.git
|
||||
[submodule "src/DLibs"]
|
||||
path = src/DLibs
|
||||
url = https://git.sleepy.day/sleepy-day/DLibs.git
|
||||
[submodule "src/dlib"]
|
||||
path = src/dlib
|
||||
url = https://git.sleepy.day/sleepy-day/dlib
|
||||
|
||||
2
build.sh
2
build.sh
@ -28,4 +28,4 @@ done
|
||||
|
||||
/bin/bash src/VulkanRenderer/build.sh build
|
||||
|
||||
/bin/bash src/DLibs/build.sh build
|
||||
/bin/bash src/dlib/build.sh build
|
||||
|
||||
4
dub.json
4
dub.json
@ -9,8 +9,8 @@
|
||||
"targetPath": "build",
|
||||
"sourceFiles-linux": ["build/libvma.a", "build/libstb.a", "build/libm3d.a", "build/libcglm.a"],
|
||||
"sourceFiles-windows": [],
|
||||
"importPaths": ["src/gears", "src/DLibs", "src/DLibs/external/xxhash", "src/VulkanRenderer"],
|
||||
"sourcePaths": ["src/gears", "src/DLibs", "src/DLibs/external/xxhash", "src/VulkanRenderer"],
|
||||
"importPaths": ["src/gears", "src/dlib", "src/dlib/external/xxhash", "src/VulkanRenderer"],
|
||||
"sourcePaths": ["src/gears", "src/dlib", "src/dlib/external/xxhash", "src/VulkanRenderer"],
|
||||
"libs-linux": ["xcb", "X11", "X11-xcb", "vulkan", "stdc++", "xcb-xfixes", "freetype"],
|
||||
"libs-windows": [],
|
||||
"preGenerateCommands-linux": ["./build.sh"],
|
||||
|
||||
@ -1 +0,0 @@
|
||||
Subproject commit 3c6d214aa7e3058f8de1a4ff380fd1bb8ce56036
|
||||
@ -1 +1 @@
|
||||
Subproject commit 7a10601f51b651db006de6d1c5cafb547f90dc87
|
||||
Subproject commit 1290c5f45ac49cc5534817e8d6b0adae4ac058af
|
||||
1
src/dlib
Submodule
1
src/dlib
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit a97309cb04e0e802047586a5bacbacc9b8e9649b
|
||||
@ -1,16 +1,9 @@
|
||||
import aliases;
|
||||
import includes;
|
||||
import dlib;
|
||||
public import vulkan : PlatformHandles;
|
||||
import vulkan : Destroy;
|
||||
import vulkan;
|
||||
import assets;
|
||||
import util;
|
||||
import alloc;
|
||||
import platform;
|
||||
import math;
|
||||
import core.stdc.math : cosf, sinf;
|
||||
import std.algorithm.sorting;
|
||||
import fonts;
|
||||
import main;
|
||||
|
||||
const UI_COUNT = 50000;
|
||||
@ -69,6 +62,7 @@ struct Game
|
||||
Renderer rd;
|
||||
Arena arena;
|
||||
Arena frame_arena;
|
||||
Inputs* inputs;
|
||||
|
||||
PlatformWindow* window;
|
||||
|
||||
@ -188,7 +182,7 @@ Copy(Model* dst, Model* src)
|
||||
void
|
||||
ProcessInputs(Game* g, Camera* cam)
|
||||
{
|
||||
HandleInputs(cam, &g.window.inputs);
|
||||
HandleInputs(cam, g.inputs);
|
||||
}
|
||||
|
||||
void
|
||||
@ -285,9 +279,9 @@ struct Camera
|
||||
pragma(inline): void
|
||||
HandleInputs(Camera* cam, Inputs* inputs)
|
||||
{
|
||||
foreach(i; 0 .. inputs.count)
|
||||
for(auto n = inputs.list.first; n != null; n = n.next)
|
||||
{
|
||||
InputEvent event = inputs.events[i];
|
||||
InputEvent* event = &n.value;
|
||||
switch(event.key)
|
||||
{
|
||||
case Input.W: cam.velocity.z = event.pressed ? -1.0 : 0.0; break;
|
||||
@ -335,7 +329,7 @@ Update(Camera* cam)
|
||||
void
|
||||
Sort(Game* g, Vec3 pos, Model* model)
|
||||
{
|
||||
f32[] lengths = AllocArray!(f32)(&g.frame_arena, model.positions.length);
|
||||
f32[] lengths = Alloc!(f32)(&g.frame_arena, model.positions.length);
|
||||
|
||||
foreach(i; 0 .. lengths.length)
|
||||
{
|
||||
@ -434,8 +428,8 @@ LoadModel(Game* g, string name)
|
||||
m3d_t* m3d = m3d_load(data.ptr, null, null, null);
|
||||
scope(exit) m3d_free(m3d);
|
||||
|
||||
u32[] tex_lookup = AllocArray!(u32)(&g.frame_arena, m3d.numtexture);
|
||||
model.textures = AllocArray!(ImageView)(&g.arena, m3d.numtexture);
|
||||
u32[] tex_lookup = Alloc!(u32)(&g.frame_arena, m3d.numtexture);
|
||||
model.textures = Alloc!(ImageView)(&g.arena, m3d.numtexture);
|
||||
foreach(i; 0 .. m3d.numtexture)
|
||||
{
|
||||
u32 w = m3d.texture[i].w; u32 h = m3d.texture[i].h; u32 ch = m3d.texture[i].f;
|
||||
@ -447,9 +441,9 @@ LoadModel(Game* g, string name)
|
||||
//tex_lookup[i] = Pop(&g.rd, DT.SampledImage);
|
||||
}
|
||||
|
||||
Material[] mats = AllocArray!(Material)(&g.frame_arena, m3d.nummaterial);
|
||||
u32[] mat_lookup = AllocArray!(u32)(&g.frame_arena, m3d.nummaterial);
|
||||
model.materials = AllocArray!(Buffer)(&g.arena, m3d.nummaterial);
|
||||
Material[] mats = Alloc!(Material)(&g.frame_arena, m3d.nummaterial);
|
||||
u32[] mat_lookup = Alloc!(u32)(&g.frame_arena, m3d.nummaterial);
|
||||
model.materials = Alloc!(Buffer)(&g.arena, m3d.nummaterial);
|
||||
foreach(i; 0 .. m3d.nummaterial)
|
||||
{
|
||||
const(char)[] mat_name = m3d.material[i].name[0 .. strlen(m3d.material[i].name)];
|
||||
@ -504,7 +498,7 @@ LoadModel(Game* g, string name)
|
||||
}
|
||||
}
|
||||
|
||||
model.parts = AllocArray!(MeshPart)(&g.arena, mesh_count);
|
||||
model.parts = Alloc!(MeshPart)(&g.arena, mesh_count);
|
||||
last = u64.max;
|
||||
u32 index = 0;
|
||||
foreach(i; 0 .. m3d.numface)
|
||||
@ -535,10 +529,10 @@ LoadModel(Game* g, string name)
|
||||
|
||||
m3dv_t* vertex;
|
||||
|
||||
u32[] indices = AllocArray!(u32)(&g.arena, m3d.numface * 3);
|
||||
Vertex[] vertices = AllocArray!(Vertex)(&g.frame_arena, m3d.numface * 3);
|
||||
Vec3[] positions = AllocArray!(Vec3)(&g.arena, m3d.numface);
|
||||
u32[] pos_indices = AllocArray!(u32)(&g.arena, m3d.numface);
|
||||
u32[] indices = Alloc!(u32)(&g.arena, m3d.numface * 3);
|
||||
Vertex[] vertices = Alloc!(Vertex)(&g.frame_arena, m3d.numface * 3);
|
||||
Vec3[] positions = Alloc!(Vec3)(&g.arena, m3d.numface);
|
||||
u32[] pos_indices = Alloc!(u32)(&g.arena, m3d.numface);
|
||||
|
||||
foreach(i; 0 .. m3d.numface)
|
||||
{
|
||||
|
||||
@ -1,14 +1,9 @@
|
||||
import includes;
|
||||
import dlib;
|
||||
import std.stdio;
|
||||
import aliases;
|
||||
import core.memory;
|
||||
import platform;
|
||||
import game;
|
||||
import util;
|
||||
import core.simd;
|
||||
import math;
|
||||
import core.stdc.string : memcpy;
|
||||
import fonts;
|
||||
|
||||
// TODO:
|
||||
// 1. Determine how to better handle inputs
|
||||
@ -25,7 +20,7 @@ void main(string[] argv)
|
||||
|
||||
while (true)
|
||||
{
|
||||
HandleEvents(&window);
|
||||
g.inputs = GetInputs(&window);
|
||||
if (window.close)
|
||||
{
|
||||
break;
|
||||
|
||||
@ -1,3 +1 @@
|
||||
import aliases;
|
||||
import util;
|
||||
|
||||
import dlib;
|
||||
|
||||
@ -1,11 +1,8 @@
|
||||
import aliases;
|
||||
import includes;
|
||||
import dlib;
|
||||
import std.stdio;
|
||||
import std.string;
|
||||
import std.file;
|
||||
import util;
|
||||
import std.path;
|
||||
import assets;
|
||||
import std.traits;
|
||||
import std.algorithm.comparison;
|
||||
import core.memory;
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
import aliases;
|
||||
import util;
|
||||
import dlib;
|
||||
import std.math;
|
||||
import std.math.algebraic;
|
||||
import core.stdc.math : tanf, cosf, sinf, sqrtf;
|
||||
import std.traits;
|
||||
import inteli;
|
||||
import std.meta;
|
||||
import std.format;
|
||||
import std.stdio;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user