
struct VsInput
{
  float2 pos       : POSITION;
  float2 tc        : TEXCOORD0;
  float4 color     : COLOR0;
};

struct VsOutput
{
  float4 pos       : POSITION;
  float2 tc        : TEXCOORD0;
  float4 color     : COLOR0;
};


float4 tm          : register(c16);
float4 texTm       : register(c17);


VsOutput vsh(VsInput I)
{
  VsOutput O;
  O.pos=float4(I.pos.xy*tm.xy+tm.zw, 1, 1);
  O.tc=I.tc*texTm.xy+texTm.zw;
  O.color=I.color;
  return O;
}


sampler tex : register(s0);


float4 psh(VsOutput I) : COLOR
{
  if (I.tc.x>=0)
    return tex2D(tex, I.tc)*I.color;
  else
    return I.color;
}
