Fixes to EMP and speed/zoom for FBO texture

This commit is contained in:
Simon Robertshaw 2011-10-25 12:13:32 +01:00
parent ef3bab249a
commit cb537351e7
2 changed files with 16 additions and 13 deletions

View File

@ -110,16 +110,19 @@ int update_EMP(UPDATE_FUNC_ARGS) {
} }
int graphics_EMP(GRAPHICS_FUNC_ARGS) int graphics_EMP(GRAPHICS_FUNC_ARGS)
{ {
*colr = cpart->life*1.5; if(cpart->life)
*colg = cpart->life*1.5; {
*colb = 200-cpart->life; *colr = cpart->life*1.5;
if (*colr>255) *colg = cpart->life*1.5;
*colr = 255; *colb = 200-(cpart->life);
if (*colg>255) if (*colr>255)
*colg = 255; *colr = 255;
if (*colb>255) if (*colg>255)
*colb = 255; *colg = 255;
if (*colb<=0) if (*colb>255)
*colb = 0; *colb = 255;
if (*colb<=0)
*colb = 0;
}
return 0; return 0;
} }

View File

@ -3621,8 +3621,8 @@ int sdl_open(void)
glGenTextures(1, &partsFboTex); glGenTextures(1, &partsFboTex);
glBindTexture(GL_TEXTURE_2D, partsFboTex); glBindTexture(GL_TEXTURE_2D, partsFboTex);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, XRES, YRES, 0, GL_RGBA, GL_FLOAT, NULL); 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_MAG_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
//FBO //FBO
glGenFramebuffers(1, &partsFbo); glGenFramebuffers(1, &partsFbo);