Beispiel #1
0
void Mob::Render(unsigned char stil)
{	
	GLuint tex;
	
	if(stil==DIFFUSE)
		tex=textura;
	if(stil==NORMAL)
		tex=texturaN;
	if(stil==GLOW)
		tex=texturaG;

	if(stil==DIFFUSE) //SJENA
	{
		glEnable(GL_BLEND);
		glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
		glPushMatrix();		
		glColor4f(0.0, 0.0, 0.0, 0.6);			
		SpriteT(poz+Vec2(5,5),dim,rotacija,tex);			
		glColor4f(1.0, 1.0, 1.0, 1.0);
		glPopMatrix();
		glDisable(GL_BLEND);
	}

	glPushMatrix();	
	SpriteT(poz,dim,rotacija,tex);	
	glPopMatrix();	
}
void MinigunProjektil::Render(unsigned char stil)
{
	Projektil::Render(stil);
	if(stil==GLOW)
	{
		float rot=atan2(smjer.y,smjer.x)*180/3.14 + 90;	
		SpriteT(poz-Vec2(8,16),Vec2(16,32),rot,texG);
	}
}
Beispiel #3
0
void SmecePickup::Render(unsigned char stil)
{
	if(stil!=GLOW)
	{
		GLuint t;
		if(stil==DIFFUSE)
			t=tex;
		if(stil==NORMAL)
			t=texN;
	
		SpriteT(poz,Vec2(dim.x,dim.y),0,t);
		glColor3f(1.0, 1.0, 1.0);
	}
	
}
Beispiel #4
0
void Cestica::Render(unsigned char stil)
{
	GLuint t;
	if(stil==DIFFUSE)
		t=tex;
	if(stil==NORMAL)
		t=texN;
	if(stil==DIFFUSE)// || stil==NORMAL)
	{
		glEnable(GL_BLEND);
		glBlendFunc(GL_ONE, GL_ONE);
		glColor3f(zivot/maxZivot, zivot/maxZivot, zivot/maxZivot );
		SpriteT(poz,dim,0,t);
		glColor3f(1.0, 1.0, 1.0);
		glDisable(GL_BLEND);
	}
}
Beispiel #5
0
void KeyPickup::Render(unsigned char type)
{
    GLuint t;
    if(type==DIFFUSE)
        t=tex;
    if(type==NORMAL)
        t=texN;
    if(type==GLOW)
    {
        t=texG;
        if(id==RED)
            glColor3f(1.0, 0.1, 0.1);
        if(id==BLUE)
            glColor3f(0.1, 0.1, 1.0);
        if(id==GREEN)
            glColor3f(0.1, 1.0, 0.1);
    }
    SpriteT(DajPoz(),DajDim(),rotation,t);
    glColor3f(1.0, 1.0, 1.0);
}
Beispiel #6
0
//===========================================================================//
void Sprite::initialize(const std::string& filename,
                        const math::Vector2F& pivot,
                        const math::Vector2U& frames)
{
    mFrames = frames;

    if (filename.empty())
    {
        return;
    }

    if (filename != mFilename)
    {
        mFilename = filename;
        mSprite = SpriteT(core::path::join(
                core::DATA_PATH, "textures/" + mFilename));
    }

    mSprite.setPivot(pivot);
}
Beispiel #7
0
void PlazmaProjektil::Render(unsigned char stil)
{
	Projektil::Render(stil);
	if(stil==DIFFUSE)
		SpriteT(poz,dim,0,tex);
}