content system now has done check; cleaned assets;

This commit is contained in:
Harrison Deng 2018-09-12 21:39:21 -05:00
parent e45d998c3a
commit 71600738d4
12 changed files with 21 additions and 350 deletions

View File

@ -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

View File

@ -1,60 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file contains an xml description of a font, and will be read by the XNA
Framework Content Pipeline. Follow the comments to customize the appearance
of the font in your game, and to change the characters which are available to draw
with.
-->
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
<Asset Type="Graphics:FontDescription">
<!--
Modify this string to change the font that will be imported.
-->
<FontName>Arial</FontName>
<!--
Size is a float value, measured in points. Modify this value to change
the size of the font.
-->
<Size>12</Size>
<!--
Spacing is a float value, measured in pixels. Modify this value to change
the amount of spacing in between characters.
-->
<Spacing>0</Spacing>
<!--
UseKerning controls the layout of the font. If this value is true, kerning information
will be used when placing characters.
-->
<UseKerning>true</UseKerning>
<!--
Style controls the style of the font. Valid entries are "Regular", "Bold", "Italic",
and "Bold, Italic", and are case sensitive.
-->
<Style>Regular</Style>
<!--
If you uncomment this line, the default character will be substituted if you draw
or measure text that contains characters which were not included in the font.
-->
<!-- <DefaultCharacter>*</DefaultCharacter> -->
<!--
CharacterRegions control what letters are available in the font. Every
character from Start to End will be built and made available for drawing. The
default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin
character set. The characters are ordered according to the Unicode standard.
See the documentation for more information.
-->
<CharacterRegions>
<CharacterRegion>
<Start>&#32;</Start>
<End>&#126;</End>
</CharacterRegion>
</CharacterRegions>
</Asset>
</XnaContent>

View File

@ -1,60 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file contains an xml description of a font, and will be read by the XNA
Framework Content Pipeline. Follow the comments to customize the appearance
of the font in your game, and to change the characters which are available to draw
with.
-->
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
<Asset Type="Graphics:FontDescription">
<!--
Modify this string to change the font that will be imported.
-->
<FontName>Arial</FontName>
<!--
Size is a float value, measured in points. Modify this value to change
the size of the font.
-->
<Size>12</Size>
<!--
Spacing is a float value, measured in pixels. Modify this value to change
the amount of spacing in between characters.
-->
<Spacing>0</Spacing>
<!--
UseKerning controls the layout of the font. If this value is true, kerning information
will be used when placing characters.
-->
<UseKerning>true</UseKerning>
<!--
Style controls the style of the font. Valid entries are "Regular", "Bold", "Italic",
and "Bold, Italic", and are case sensitive.
-->
<Style>Regular</Style>
<!--
If you uncomment this line, the default character will be substituted if you draw
or measure text that contains characters which were not included in the font.
-->
<!-- <DefaultCharacter>*</DefaultCharacter> -->
<!--
CharacterRegions control what letters are available in the font. Every
character from Start to End will be built and made available for drawing. The
default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin
character set. The characters are ordered according to the Unicode standard.
See the documentation for more information.
-->
<CharacterRegions>
<CharacterRegion>
<Start>&#32;</Start>
<End>&#126;</End>
</CharacterRegion>
</CharacterRegions>
</Asset>
</XnaContent>

View File

@ -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();
}
};

View File

@ -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;
}

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -1,10 +0,0 @@
#ifdef GL_ES
precision mediump float;
#endif
//input from vertex shader
varying vec4 vColor;
void main() {
gl_FragColor = vColor;
}

View File

@ -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);
}

View File

@ -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<ContentLoad> queue;
Dictionary<string, IDisposable> 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;
}
}
}