From 71600738d4430e411ea3de531162eb86d40ac1b7 Mon Sep 17 00:00:00 2001 From: Recrown Date: Wed, 12 Sep 2018 21:39:21 -0500 Subject: [PATCH] content system now has done check; cleaned assets; --- RhythmBullet/Content/Content.mgcb | 64 ++++--------------- .../Content/fonts/darktech_ldr.spritefont | 60 ----------------- .../Content/fonts/gasalt_regular.spritefont | 60 ----------------- RhythmBullet/Content/fonts/iron_maiden.fx | 46 ------------- RhythmBullet/Content/shaders/basic.vsh | 14 ---- .../Content/shaders/bright_filter.fsh | 22 ------- RhythmBullet/Content/shaders/chrome_abb.fsh | 0 RhythmBullet/Content/shaders/combine.fsh | 27 -------- .../Content/shaders/gaussian_blur.fsh | 45 ------------- RhythmBullet/Content/shaders/mesh.fsh | 10 --- RhythmBullet/Content/shaders/mesh.vsh | 13 ---- .../Utilities/ContentSystem/ContentSystem.cs | 10 ++- 12 files changed, 21 insertions(+), 350 deletions(-) delete mode 100644 RhythmBullet/Content/fonts/darktech_ldr.spritefont delete mode 100644 RhythmBullet/Content/fonts/gasalt_regular.spritefont delete mode 100644 RhythmBullet/Content/fonts/iron_maiden.fx delete mode 100644 RhythmBullet/Content/shaders/basic.vsh delete mode 100644 RhythmBullet/Content/shaders/bright_filter.fsh delete mode 100644 RhythmBullet/Content/shaders/chrome_abb.fsh delete mode 100644 RhythmBullet/Content/shaders/combine.fsh delete mode 100644 RhythmBullet/Content/shaders/gaussian_blur.fsh delete mode 100644 RhythmBullet/Content/shaders/mesh.fsh delete mode 100644 RhythmBullet/Content/shaders/mesh.vsh diff --git a/RhythmBullet/Content/Content.mgcb b/RhythmBullet/Content/Content.mgcb index 17747f9..5f6c776 100644 --- a/RhythmBullet/Content/Content.mgcb +++ b/RhythmBullet/Content/Content.mgcb @@ -631,41 +631,6 @@ /processorParam:Quality=Best /build:sfx/pop_open.ogg -#begin shaders/basic.vsh -/importer: -/processor: -/build:shaders/basic.vsh - -#begin shaders/bright_filter.fsh -/importer: -/processor: -/build:shaders/bright_filter.fsh - -#begin shaders/chrome_abb.fsh -/importer: -/processor: -/build:shaders/chrome_abb.fsh - -#begin shaders/combine.fsh -/importer: -/processor: -/build:shaders/combine.fsh - -#begin shaders/gaussian_blur.fsh -/importer: -/processor: -/build:shaders/gaussian_blur.fsh - -#begin shaders/mesh.fsh -/importer: -/processor: -/build:shaders/mesh.fsh - -#begin shaders/mesh.vsh -/importer: -/processor: -/build:shaders/mesh.vsh - #begin defaultCover.png /importer:TextureImporter /processor:TextureProcessor @@ -690,23 +655,18 @@ /processorParam:TextureFormat=Color /build:splash_texture.png -#begin fonts/darktech_ldr.spritefont -/importer:FontDescriptionImporter -/processor:FontDescriptionProcessor -/processorParam:PremultiplyAlpha=True -/processorParam:TextureFormat=Compressed -/build:fonts/darktech_ldr.spritefont +#begin fonts/darktech_ldr.ttf +/importer: +/processor: +/build:fonts/darktech_ldr.ttf -#begin fonts/gasalt_regular.spritefont -/importer:FontDescriptionImporter -/processor:FontDescriptionProcessor -/processorParam:PremultiplyAlpha=True -/processorParam:TextureFormat=Compressed -/build:fonts/gasalt_regular.spritefont +#begin fonts/gasalt_regular.ttf +/importer: +/processor: +/build:fonts/gasalt_regular.ttf -#begin fonts/iron_maiden.fx -/importer:EffectImporter -/processor:EffectProcessor -/processorParam:DebugMode=Auto -/build:fonts/iron_maiden.fx +#begin fonts/iron_maiden.ttf +/importer: +/processor: +/build:fonts/iron_maiden.ttf diff --git a/RhythmBullet/Content/fonts/darktech_ldr.spritefont b/RhythmBullet/Content/fonts/darktech_ldr.spritefont deleted file mode 100644 index bd33ecf..0000000 --- a/RhythmBullet/Content/fonts/darktech_ldr.spritefont +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - Arial - - - 12 - - - 0 - - - true - - - - - - - - - - - - ~ - - - - diff --git a/RhythmBullet/Content/fonts/gasalt_regular.spritefont b/RhythmBullet/Content/fonts/gasalt_regular.spritefont deleted file mode 100644 index bd33ecf..0000000 --- a/RhythmBullet/Content/fonts/gasalt_regular.spritefont +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - Arial - - - 12 - - - 0 - - - true - - - - - - - - - - - - ~ - - - - diff --git a/RhythmBullet/Content/fonts/iron_maiden.fx b/RhythmBullet/Content/fonts/iron_maiden.fx deleted file mode 100644 index a1c6941..0000000 --- a/RhythmBullet/Content/fonts/iron_maiden.fx +++ /dev/null @@ -1,46 +0,0 @@ -#if OPENGL - #define SV_POSITION POSITION - #define VS_SHADERMODEL vs_3_0 - #define PS_SHADERMODEL ps_3_0 -#else - #define VS_SHADERMODEL vs_4_0_level_9_1 - #define PS_SHADERMODEL ps_4_0_level_9_1 -#endif - -matrix WorldViewProjection; - -struct VertexShaderInput -{ - float4 Position : POSITION0; - float4 Color : COLOR0; -}; - -struct VertexShaderOutput -{ - float4 Position : SV_POSITION; - float4 Color : COLOR0; -}; - -VertexShaderOutput MainVS(in VertexShaderInput input) -{ - VertexShaderOutput output = (VertexShaderOutput)0; - - output.Position = mul(input.Position, WorldViewProjection); - output.Color = input.Color; - - return output; -} - -float4 MainPS(VertexShaderOutput input) : COLOR -{ - return input.Color; -} - -technique BasicColorDrawing -{ - pass P0 - { - VertexShader = compile VS_SHADERMODEL MainVS(); - PixelShader = compile PS_SHADERMODEL MainPS(); - } -}; \ No newline at end of file diff --git a/RhythmBullet/Content/shaders/basic.vsh b/RhythmBullet/Content/shaders/basic.vsh deleted file mode 100644 index 639bc50..0000000 --- a/RhythmBullet/Content/shaders/basic.vsh +++ /dev/null @@ -1,14 +0,0 @@ -attribute vec4 a_position; -attribute vec4 a_color; -attribute vec2 a_texCoord0; - -uniform mat4 u_projTrans; - -varying vec4 vColor; -varying vec2 vTexCoord; - -void main() { - vColor = a_color; - vTexCoord = a_texCoord0; - gl_Position = u_projTrans * a_position; -} diff --git a/RhythmBullet/Content/shaders/bright_filter.fsh b/RhythmBullet/Content/shaders/bright_filter.fsh deleted file mode 100644 index 9129746..0000000 --- a/RhythmBullet/Content/shaders/bright_filter.fsh +++ /dev/null @@ -1,22 +0,0 @@ -#ifdef GL_ES -#define LOWP lowp -precision mediump float; -#else -#define LOWP -#endif - -varying LOWP vec4 vColor; -varying vec2 vTexCoord; - -uniform sampler2D u_texture; - -void main() { - vec4 color = texture(u_texture, vTexCoord); - float brightness = (color.r*0.2126) + (color.g*0.7152) + (color.b * 0.0722); - - if (brightness > 0.6) { - gl_FragColor = color *0.75; - } else { - gl_FragColor = vec4(0.0); - } -} diff --git a/RhythmBullet/Content/shaders/chrome_abb.fsh b/RhythmBullet/Content/shaders/chrome_abb.fsh deleted file mode 100644 index e69de29..0000000 diff --git a/RhythmBullet/Content/shaders/combine.fsh b/RhythmBullet/Content/shaders/combine.fsh deleted file mode 100644 index 11b8b7c..0000000 --- a/RhythmBullet/Content/shaders/combine.fsh +++ /dev/null @@ -1,27 +0,0 @@ -#ifdef GL_ES -#define LOWP lowp -precision mediump float; -#else -#define LOWP -#endif - -varying LOWP vec4 vColor; -varying vec2 vTexCoord; - - -uniform sampler2D u_texture; -uniform sampler2D u_texture1; - -void main() { - vec4 origColor = texture2D(u_texture, vTexCoord); - vec4 blurredColor = texture2D(u_texture1, vTexCoord); - - vec4 result; - result = origColor + blurredColor; - result.a = vColor.a; - result.rgb *= vColor.rgb; - gl_FragColor = result; - - -} - diff --git a/RhythmBullet/Content/shaders/gaussian_blur.fsh b/RhythmBullet/Content/shaders/gaussian_blur.fsh deleted file mode 100644 index e7145e5..0000000 --- a/RhythmBullet/Content/shaders/gaussian_blur.fsh +++ /dev/null @@ -1,45 +0,0 @@ -varying vec4 vColor; -varying vec2 vTexCoord; - -uniform sampler2D u_texture; -uniform vec2 resolution; -uniform float radius; -uniform int pass; - -void main() { - //this will be our RGBA sum - vec4 sum = vec4(0.0); - - //our original texcoord for this fragment - vec2 tc = vTexCoord; - - //the amount to blur, i.e. how far off center to sample from - //1.0 -> blur by one pixel - //2.0 -> blur by two pixels, etc. - float blur = radius/resolution.y; - - //the direction of our blur - //(1.0, 0.0) -> x-axis blur - //(0.0, 1.0) -> y-axis blur - float hstep = 1.0; - float vstep = 0.0; - - if (pass == 1) { - hstep = 0.0; - vstep = 1.0; - } - - sum += texture2D(u_texture, vec2(tc.x - 5.0*blur*hstep, tc.y - 5.0*blur*vstep)) * 0.014374; - sum += texture2D(u_texture, vec2(tc.x - 4.0*blur*hstep, tc.y - 4.0*blur*vstep)) * 0.035855; - sum += texture2D(u_texture, vec2(tc.x - 3.0*blur*hstep, tc.y - 3.0*blur*vstep)) * 0.072994; - sum += texture2D(u_texture, vec2(tc.x - 2.0*blur*hstep, tc.y - 2.0*blur*vstep)) * 0.121281; - sum += texture2D(u_texture, vec2(tc.x - 1.0*blur*hstep, tc.y - 1.0*blur*vstep)) * 0.164472; - - sum += texture2D(u_texture, vec2(tc.x + 1.0*blur*hstep, tc.y + 1.0*blur*vstep)) * 0.164472; - sum += texture2D(u_texture, vec2(tc.x + 2.0*blur*hstep, tc.y + 2.0*blur*vstep)) * 0.121281; - sum += texture2D(u_texture, vec2(tc.x + 3.0*blur*hstep, tc.y + 3.0*blur*vstep)) * 0.072994; - sum += texture2D(u_texture, vec2(tc.x + 4.0*blur*hstep, tc.y + 4.0*blur*vstep)) * 0.035855; - sum += texture2D(u_texture, vec2(tc.x + 5.0*blur*hstep, tc.y + 5.0*blur*vstep)) * 0.014374; - - gl_FragColor = sum; -} \ No newline at end of file diff --git a/RhythmBullet/Content/shaders/mesh.fsh b/RhythmBullet/Content/shaders/mesh.fsh deleted file mode 100644 index 0a10a45..0000000 --- a/RhythmBullet/Content/shaders/mesh.fsh +++ /dev/null @@ -1,10 +0,0 @@ -#ifdef GL_ES -precision mediump float; -#endif - -//input from vertex shader -varying vec4 vColor; - -void main() { - gl_FragColor = vColor; -} \ No newline at end of file diff --git a/RhythmBullet/Content/shaders/mesh.vsh b/RhythmBullet/Content/shaders/mesh.vsh deleted file mode 100644 index 9a9b0ca..0000000 --- a/RhythmBullet/Content/shaders/mesh.vsh +++ /dev/null @@ -1,13 +0,0 @@ -attribute vec2 a_position; -attribute vec4 a_color; - -//our camera matrix -uniform mat4 u_projTrans; - -//send the color out to the fragment shader -varying vec4 vColor; - -void main() { - vColor = a_color; - gl_Position = u_projTrans * vec4(a_position.xy, 0.0, 1.0); -} \ No newline at end of file diff --git a/RhythmBullet/Zer01HD/Utilities/ContentSystem/ContentSystem.cs b/RhythmBullet/Zer01HD/Utilities/ContentSystem/ContentSystem.cs index 1624a80..567b8c6 100644 --- a/RhythmBullet/Zer01HD/Utilities/ContentSystem/ContentSystem.cs +++ b/RhythmBullet/Zer01HD/Utilities/ContentSystem/ContentSystem.cs @@ -1,4 +1,5 @@ using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; using System.Linq; @@ -10,8 +11,8 @@ namespace RhythmBullet.Zer01HD.Utilities.ContentSystem { class ContentSystem { + volatile bool queued; Thread thread; - internal volatile bool loading; readonly ContentManager contentManager; readonly Queue queue; Dictionary assets; @@ -41,6 +42,7 @@ namespace RhythmBullet.Zer01HD.Utilities.ContentSystem ContentLoad content = queue.Dequeue(); Load(content.assetName, content.type); } + queued = false; } } @@ -54,6 +56,7 @@ namespace RhythmBullet.Zer01HD.Utilities.ContentSystem void Queue(string assetName, Type type) { + queued = true; lock (queue) { if (!assets.ContainsKey(assetName)) @@ -86,5 +89,10 @@ namespace RhythmBullet.Zer01HD.Utilities.ContentSystem assets.Remove(asset.Key); } } + + bool Done() + { + return queued; + } } }