Rename uniform setters to avoid future ambiguity.
This commit is contained in:
@@ -61,8 +61,8 @@ namespace OpenRA.FileFormats.Graphics
|
||||
|
||||
public interface IShader
|
||||
{
|
||||
void SetValue( string name, float x, float y );
|
||||
void SetValue( string param, ITexture texture );
|
||||
void SetVec(string name, float x, float y);
|
||||
void SetTexture(string param, ITexture texture);
|
||||
void Render(Action a);
|
||||
}
|
||||
|
||||
|
||||
@@ -89,10 +89,10 @@ namespace OpenRA.Graphics
|
||||
|
||||
void SetShaderParams(IShader s, float2 r1, float2 r2, float2 scroll)
|
||||
{
|
||||
s.SetValue("Palette", PaletteTexture);
|
||||
s.SetValue("Scroll", (int)scroll.X, (int)scroll.Y);
|
||||
s.SetValue("r1", r1.X, r1.Y);
|
||||
s.SetValue("r2", r2.X, r2.Y);
|
||||
s.SetTexture("Palette", PaletteTexture);
|
||||
s.SetVec("Scroll", (int)scroll.X, (int)scroll.Y);
|
||||
s.SetVec("r1", r1.X, r1.Y);
|
||||
s.SetVec("r2", r2.X, r2.Y);
|
||||
}
|
||||
|
||||
public void EndFrame(IInputHandler inputHandler)
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenRA.Graphics
|
||||
{
|
||||
if (nv > 0)
|
||||
{
|
||||
shader.SetValue( "DiffuseTexture", currentSheet.Texture );
|
||||
shader.SetTexture("DiffuseTexture", currentSheet.Texture);
|
||||
shader.Render(() =>
|
||||
{
|
||||
var vb = renderer.GetTempVertexBuffer();
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace OpenRA.Graphics
|
||||
|
||||
if( lastRow < firstRow ) lastRow = firstRow;
|
||||
|
||||
Game.Renderer.WorldSpriteShader.SetValue( "DiffuseTexture", terrainSheet.Texture );
|
||||
Game.Renderer.WorldSpriteShader.SetTexture("DiffuseTexture", terrainSheet.Texture);
|
||||
Game.Renderer.WorldSpriteShader.Render(() =>
|
||||
Game.Renderer.DrawBatch(vertexBuffer,
|
||||
verticesPerRow * firstRow, verticesPerRow * (lastRow - firstRow),
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace OpenRA.Renderer.Cg
|
||||
Tao.Cg.CgGl.cgGLDisableProfile(dev.vertexProfile);
|
||||
}
|
||||
|
||||
public void SetValue(string name, ITexture t)
|
||||
public void SetTexture(string name, ITexture t)
|
||||
{
|
||||
var texture = (Texture)t;
|
||||
var param = Tao.Cg.Cg.cgGetNamedEffectParameter(effect, name);
|
||||
@@ -75,7 +75,7 @@ namespace OpenRA.Renderer.Cg
|
||||
Tao.Cg.CgGl.cgGLSetupSampler(param, texture.texture);
|
||||
}
|
||||
|
||||
public void SetValue(string name, float x, float y)
|
||||
public void SetVec(string name, float x, float y)
|
||||
{
|
||||
var param = Tao.Cg.Cg.cgGetNamedEffectParameter(effect, name);
|
||||
if (param != IntPtr.Zero)
|
||||
|
||||
@@ -132,15 +132,16 @@ namespace OpenRA.Renderer.Glsl
|
||||
ErrorHandler.CheckGlError();
|
||||
}
|
||||
|
||||
public void SetValue(string name, ITexture t)
|
||||
public void SetTexture(string name, ITexture t)
|
||||
{
|
||||
if( t == null ) return;
|
||||
if (t == null)
|
||||
return;
|
||||
int texUnit;
|
||||
if (samplers.TryGetValue(name, out texUnit))
|
||||
textures[texUnit] = t;
|
||||
}
|
||||
|
||||
public void SetValue(string name, float x, float y)
|
||||
public void SetVec(string name, float x, float y)
|
||||
{
|
||||
Gl.glUseProgramObjectARB(program);
|
||||
ErrorHandler.CheckGlError();
|
||||
|
||||
@@ -60,8 +60,8 @@ namespace OpenRA.Renderer.Null
|
||||
|
||||
public class NullShader : IShader
|
||||
{
|
||||
public void SetValue(string name, float x, float y) { }
|
||||
public void SetValue(string param, ITexture texture) { }
|
||||
public void SetVec(string name, float x, float y) { }
|
||||
public void SetTexture(string param, ITexture texture) { }
|
||||
public void Commit() { }
|
||||
public void Render(Action a) { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user