// Will load the sprite if it doesn't find it in the texture cache. // The texture cache caches textures by filename. bool Actor::SetSprite(const String& filename, int frame, GLint clampmode, GLint filtermode, bool optional) { int textureReference = GetTextureReference(filename, clampmode, filtermode, optional); if (textureReference == -1) return false; SetSpriteTexture(textureReference, frame); return true; }
GrenadePickup::GrenadePickup() { m_pCollisionObject->SetRadius(GRENADEPICKUP_WIDTH / 2.0); SetSize(GRENADEPICKUP_WIDTH, GRENADEPICKUP_HEIGHT); SetSpriteTexture(GRENADEPICKUP_TEXTURE, GRENADEPICKUP_TEXTURE_ROWS, GRENADEPICKUP_TEXTURE_COLUMNS); m_LifespanInTicks = (int)TICK_RATE * GRENADEPICKUP_LIFESPAN_SECONDS; m_GlowColor = glm::vec2(1.0f, 0.0f); GenerateAnimationData(); }