Exemplo n.º 1
0
bool UrlParam::GetNamed(const char* name, int namelen, ReadBuffer& bs)
{
    int         n;
    int         len;
    
    n = GetParamIndex(name, namelen);
    if (n < 0)
        return false;
    
    len = GetParamLen(n) - (namelen + 1);
    if (len == -1)
        len = 0;        // param without value
    
    bs.SetBuffer((char*) GetParam(n) + (namelen + 1));
    bs.SetLength(len);

    return true;
}
Exemplo n.º 2
0
	void PS_ModifierUVAnim::Modify(Particle * p, float elapsedTime)
	{
		int pi = GetParamIndex();
		int ri = GetRandomParamIndex();
		float k = p->InitLife.x - p->Life;

		if (k - p->Param[pi].v_float > mInterval)
		{
			p->Param[pi].v_float += mInterval;

			if (mRandom)
			{
				p->UVRect = RandomUVRect();
			}
			else
			{
				int i = p->Param[ri].v_int + 1;
				int count = GetUVRectCount();

				if (mLooped)
				{
					if (i >= count)
						i = 0;

					p->UVRect = GetUVRect(i);
				}
				else if (i < count)
				{
					p->UVRect = GetUVRect(i);
					p->Param[ri].v_int = i;
				}

				p->Param[ri].v_int = Min(i, count);
			}
		}
	}
Exemplo n.º 3
0
void CShader::SetParamData( const char* szParamName, const void* data, size_t size, EShaderDataType eDataType )
{
	uint8 index = GetParamIndex(szParamName);
	if (index != INVALID_8BIT)
		SetParamData(index, data, size, eDataType);
}