summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-10-25 14:45:16 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-10-25 14:45:16 (GMT)
commit565a3e10e46b487af4194da0c7710c36761be144 (patch)
tree23bac991b25117539a3cfd940fb9fb172323bec9 /src
parent48ad01f2ff0cb1551587cb25552093b9dfb51c5c (diff)
downloadpowder-565a3e10e46b487af4194da0c7710c36761be144.zip
powder-565a3e10e46b487af4194da0c7710c36761be144.tar.gz
Fix EMP flash
Diffstat (limited to 'src')
-rw-r--r--src/graphics.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/graphics.c b/src/graphics.c
index f1f9f6e..bb66bf1 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -1555,21 +1555,28 @@ void draw_other(pixel *vid) // EMP effect
return;
if (emp_decor>0)
{
- int r=emp_decor*2.5, g=100+emp_decor*1.5, b=255;
+#ifdef OGLR
+ float femp_decor = ((float)emp_decor)/255.0f;
+ /*int r=emp_decor*2.5, g=100+emp_decor*1.5, b=255;
int a=(1.0*emp_decor/110)*255;
if (r>255) r=255;
if (g>255) g=255;
if (b>255) g=255;
- if (a>255) a=255;
-#ifdef OGLR
+ if (a>255) a=255;*/
glBegin(GL_QUADS);
- glColor4i(r, g, b, a);
- glVertex2f(0, 0);
- glVertex2f(XRES, 0);
- glVertex2f(XRES, YRES);
- glVertex2f(0, YRES);
+ glColor4f(femp_decor*2.5f, 0.4f+femp_decor*1.5f, 1.0f+femp_decor*1.5f, femp_decor/0.44f);
+ glVertex2f(0, MENUSIZE);
+ glVertex2f(XRES, MENUSIZE);
+ glVertex2f(XRES, YRES+MENUSIZE);
+ glVertex2f(0, YRES+MENUSIZE);
glEnd();
#else
+ int r=emp_decor*2.5, g=100+emp_decor*1.5, b=255;
+ int a=(1.0*emp_decor/110)*255;
+ if (r>255) r=255;
+ if (g>255) g=255;
+ if (b>255) g=255;
+ if (a>255) a=255;
for (j=0; j<YRES; j++)
for (i=0; i<XRES; i++)
{