From 6ff756443a2afe877be9532c13f9e5b69a259eb1 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sun, 6 Apr 2008 15:48:38 +0000 Subject: [PATCH] particle_flash scaling git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1741 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/protos.h | 2 +- source/src/renderparticles.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/src/protos.h b/source/src/protos.h index b28baf5b..22cce530 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -393,7 +393,7 @@ extern void updatedmgindicator(vec &attack); // renderparticles extern void particleinit(); extern void particlereset(); -extern void particle_flash(int type, int fade, vec &p); +extern void particle_flash(int type, float scale, int fade, vec &p); extern void particle_splash(int type, int num, int fade, vec &p); extern void particle_trail(int type, int fade, vec &from, vec &to); extern void particle_emit(int type, int *args, vec &p); diff --git a/source/src/renderparticles.cpp b/source/src/renderparticles.cpp index 49d841c4..131b19c3 100644 --- a/source/src/renderparticles.cpp +++ b/source/src/renderparticles.cpp @@ -362,7 +362,7 @@ void render_particles(int time) vec( camright.x-camup.x, camright.y-camup.y, camright.z-camup.z), vec(-camright.x-camup.x, -camright.y-camup.y, -camright.z-camup.z) }; - loopk(4) corners[k].rotate(p->d.x, p->d.y, camdir).mul(sz).add(p->o); + loopk(4) corners[k].rotate(p->d.x, p->d.y, camdir).mul(sz*p->d.z).add(p->o); glTexCoord2i(0, 1); glVertex3fv(corners[0].v); glTexCoord2i(1, 1); glVertex3fv(corners[1].v); @@ -547,14 +547,14 @@ void particle_emit(int type, int *args, vec &p) if(type<0 || type>=MAXPARTYPES) return; parttype &pt = parttypes[type]; if(pt.type==PT_FIREBALL) particle_fireball(type, p); - else if(pt.type==PT_FLASH) particle_flash(type, args[0], p); + else if(pt.type==PT_FLASH) particle_flash(type, args[1]>0 ? args[1]/100.0f : 1.0f, args[0], p); else particle_splash(type, args[0], args[1], p); } -void particle_flash(int type, int fade, vec &p) +void particle_flash(int type, float scale, int fade, vec &p) { float angle = rnd(360)*RAD; - newparticle(p, vec(cosf(angle), sinf(angle), 0), fade, type); + newparticle(p, vec(cosf(angle), sinf(angle), scale), fade, type); } void particle_splash(int type, int num, int fade, vec &p)