moved .sql to new directory. deleted /res

This commit is contained in:
lunar-mining
2021-09-13 09:07:20 +02:00
parent e6867df4ec
commit a0cc6735b4
25 changed files with 11 additions and 2279 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 KiB

View File

@@ -1,13 +0,0 @@
# Blender MTL File: 'None'
# Material Count: 1
newmtl Material.001
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd earth.jpg

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +0,0 @@
#version 450
layout(location=0) in vec3 v_color;
layout(location=0) out vec4 f_color;
void main() {
f_color = vec4(v_color, 1.0);
}

Binary file not shown.

View File

@@ -1,27 +0,0 @@
#version 450
layout(location=0) in vec3 a_position;
layout(location=0) out vec3 v_color;
layout(set=0, binding=0)
uniform Uniforms {
vec3 u_view_position; // unused
mat4 u_view_proj;
};
layout(set=1, binding=0)
uniform Light {
vec3 u_position;
vec3 u_color;
};
// Let's keep our light smaller than our other objects
float scale = 0.25;
void main() {
vec3 v_position = a_position * scale + u_position;
gl_Position = u_view_proj * vec4(v_position, 1);
v_color = u_color;
}

Binary file not shown.

View File

@@ -1,47 +0,0 @@
#version 450
layout(location=0) in vec2 v_tex_coords;
layout(location=1) in vec3 v_normal;
layout(location=2) in vec3 v_position;
layout(location=0) out vec4 f_color;
layout(set = 0, binding = 0) uniform texture2D t_diffuse;
layout(set = 0, binding = 1) uniform sampler s_diffuse;
layout(set=1, binding=0)
uniform Uniforms {
vec3 u_view_position;
mat4 u_view_proj; // unused
};
layout(set = 2, binding = 0) uniform Light {
vec3 light_position;
vec3 light_color;
};
void main() {
vec4 object_color = texture(sampler2D(t_diffuse, s_diffuse), v_tex_coords);
// We don't need (or want) much ambient light, so 0.1 is fine
float ambient_strength = 0.1;
vec3 ambient_color = light_color * ambient_strength;
vec3 normal = normalize(v_normal);
vec3 light_dir = normalize(light_position - v_position);
float diffuse_strength = max(dot(normal, light_dir), 0.0);
vec3 diffuse_color = light_color * diffuse_strength;
vec3 view_dir = normalize(u_view_position - v_position);
vec3 reflect_dir = reflect(-light_dir, normal);
float specular_strength = pow(max(dot(view_dir, reflect_dir), 0.0), 32);
vec3 specular_color = specular_strength * light_color;
vec3 result = (ambient_color + diffuse_color + specular_color) * object_color.xyz;
// Since lights don't typically (afaik) cast transparency, so we use
// the alpha here at the end.
f_color = vec4(result, object_color.a);
}

Binary file not shown.

View File

@@ -1,47 +0,0 @@
#version 450
layout(location=0) in vec2 v_tex_coords;
layout(location=1) in vec3 v_normal;
layout(location=2) in vec3 v_position;
layout(location=0) out vec4 f_color;
layout(set = 0, binding = 0) uniform texture2D t_diffuse;
layout(set = 0, binding = 1) uniform sampler s_diffuse;
layout(set=1, binding=0)
uniform Uniforms {
vec3 u_view_position;
mat4 u_view_proj; // unused
};
layout(set=2, binding=0) uniform Light {
vec3 light_position;
vec3 light_color;
};
void main() {
vec4 object_color = texture(sampler2D(t_diffuse, s_diffuse), v_tex_coords);
// We don't need (or want) much ambient light, so 0.1 is fine
float ambient_strength = 0.1;
vec3 ambient_color = light_color * ambient_strength;
vec3 normal = normalize(v_normal);
vec3 light_dir = normalize(light_position - v_position);
float diffuse_strength = max(dot(normal, light_dir), 0.0);
vec3 diffuse_color = light_color * diffuse_strength;
vec3 view_dir = normalize(u_view_position - v_position);
vec3 half_dir = normalize(view_dir + light_dir);
float specular_strength = pow(max(dot(normal, half_dir), 0.0), 32);
vec3 specular_color = specular_strength * light_color;
vec3 result = (ambient_color + diffuse_color + specular_color) * object_color.xyz;
// Since lights don't typically (afaik) cast transparency, so we use
// the alpha here at the end.
f_color = vec4(result, object_color.a);
}

Binary file not shown.

View File

@@ -1,37 +0,0 @@
#version 450
layout(location=0) in vec3 a_position;
layout(location=1) in vec2 a_tex_coords;
layout(location=2) in vec3 a_normal;
layout(location=0) out vec2 v_tex_coords;
layout(location=1) out vec3 v_normal;
layout(location=2) out vec3 v_position;
layout(set=1, binding=0)
uniform Uniforms {
vec3 u_view_position; // unused
mat4 u_view_proj;
};
layout(location=5) in vec4 model_matrix_0;
layout(location=6) in vec4 model_matrix_1;
layout(location=7) in vec4 model_matrix_2;
layout(location=8) in vec4 model_matrix_3;
void main() {
mat4 model_matrix = mat4(
model_matrix_0,
model_matrix_1,
model_matrix_2,
model_matrix_3
);
v_tex_coords = a_tex_coords;
mat3 normal_matrix = mat3(transpose(inverse(model_matrix)));
v_normal = normal_matrix * a_normal;
vec4 model_space = model_matrix * vec4(a_position, 1.0);
v_position = model_space.xyz;
gl_Position = u_view_proj * model_space;
}

Binary file not shown.

View File

@@ -1,11 +0,0 @@
#version 450
layout(location=0) in vec2 v_tex_coords;
layout(location=0) out vec4 f_color;
layout(set = 0, binding = 0) uniform texture2D t_diffuse;
layout(set = 0, binding = 1) uniform sampler s_diffuse;
void main() {
f_color = texture(sampler2D(t_diffuse, s_diffuse), v_tex_coords);
}

Binary file not shown.

View File

@@ -1,11 +0,0 @@
#version 450
layout(location=0) in vec3 a_position;
layout(location=1) in vec2 a_tex_coords;
layout(location=0) out vec2 v_tex_coords;
void main() {
v_tex_coords = a_tex_coords;
gl_Position = vec4(a_position, 1.0);
}

Binary file not shown.

View File

@@ -35,7 +35,7 @@ impl CashierDb {
pub fn init_db(&self) -> Result<()> {
if !self.password.trim().is_empty() {
let contents = include_str!("../../res/cashier.sql");
let contents = include_str!("../../sql/cashier.sql");
let conn = Connection::open(&self.path)?;
debug!(target: "CASHIERDB", "Opened connection at path {:?}", self.path);
conn.pragma_update(None, "key", &self.password)?;
@@ -182,10 +182,10 @@ impl CashierDb {
let mut stmt = conn.prepare(
"SELECT coin_key_id FROM withdraw_keypairs WHERE d_key_public = :d_key_public AND asset_id = :asset_id",
)?;
let addr_iter =
stmt.query_map::<Vec<u8>, _, _>(&[(":d_key_public", &d_key_public), (":asset_id", &asset_id)], |row| {
Ok(row.get(0)?)
})?;
let addr_iter = stmt.query_map::<Vec<u8>, _, _>(
&[(":d_key_public", &d_key_public), (":asset_id", &asset_id)],
|row| Ok(row.get(0)?),
)?;
let mut coin_addresses = vec![];
@@ -196,7 +196,11 @@ impl CashierDb {
Ok(coin_addresses.pop())
}
pub fn delete_withdraw_key_record(&self, coin_address: &Vec<u8>, asset_id: &Vec<u8> ) -> Result<()> {
pub fn delete_withdraw_key_record(
&self,
coin_address: &Vec<u8>,
asset_id: &Vec<u8>,
) -> Result<()> {
debug!(target: "CASHIERDB", "Delete withdraw keys");
// open connection

View File

@@ -42,7 +42,7 @@ impl WalletDb {
pub fn init_db(&self) -> Result<()> {
if !self.password.trim().is_empty() {
let contents = include_str!("../../res/schema.sql");
let contents = include_str!("../../sql/schema.sql");
let conn = Connection::open(&self.path)?;
debug!(target: "WALLETDB", "OPENED CONNECTION AT PATH {:?}", self.path);
conn.pragma_update(None, "key", &self.password)?;