From cb537351e7b61c84bbe77e25ee2c93be53d7c466 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Tue, 25 Oct 2011 12:13:32 +0100 Subject: [PATCH] Fixes to EMP and speed/zoom for FBO texture --- src/elements/emp.c | 25 ++++++++++++++----------- src/graphics.c | 4 ++-- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/elements/emp.c b/src/elements/emp.c index 201b8e4a9..a7978a393 100644 --- a/src/elements/emp.c +++ b/src/elements/emp.c @@ -110,16 +110,19 @@ int update_EMP(UPDATE_FUNC_ARGS) { } int graphics_EMP(GRAPHICS_FUNC_ARGS) { - *colr = cpart->life*1.5; - *colg = cpart->life*1.5; - *colb = 200-cpart->life; - if (*colr>255) - *colr = 255; - if (*colg>255) - *colg = 255; - if (*colb>255) - *colb = 255; - if (*colb<=0) - *colb = 0; + if(cpart->life) + { + *colr = cpart->life*1.5; + *colg = cpart->life*1.5; + *colb = 200-(cpart->life); + if (*colr>255) + *colr = 255; + if (*colg>255) + *colg = 255; + if (*colb>255) + *colb = 255; + if (*colb<=0) + *colb = 0; + } return 0; } diff --git a/src/graphics.c b/src/graphics.c index 45d26f33e..afeb79267 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -3621,8 +3621,8 @@ int sdl_open(void) glGenTextures(1, &partsFboTex); glBindTexture(GL_TEXTURE_2D, partsFboTex); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, XRES, YRES, 0, GL_RGBA, GL_FLOAT, NULL); - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); //FBO glGenFramebuffers(1, &partsFbo);