player sounds and controls get reset when player dies or the game ends
This commit is contained in:
+12
-2
@@ -127,9 +127,19 @@ bool Sprite::LoadFromPNG (const char *filename) {
|
||||
//Now generate the OpenGL texture object
|
||||
glGenTextures(1, &mGlTextureName);
|
||||
glBindTexture(GL_TEXTURE_2D, mGlTextureName);
|
||||
glTexImage2D(GL_TEXTURE_2D,0, GL_RGBA, mWidth, mHeight, 0,
|
||||
|
||||
bool mipmap = false;
|
||||
|
||||
if (mipmap) {
|
||||
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, mWidth, mHeight,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid*) image_data);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
|
||||
} else {
|
||||
glTexImage2D(GL_TEXTURE_2D,0, GL_RGBA, mWidth, mHeight, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid*) image_data);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
}
|
||||
|
||||
|
||||
//clean up memory and close stuff
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
|
||||
|
||||
Reference in New Issue
Block a user