[Fix] Rumble no longer affects nebulae.
This commit is contained in:
parent
2381ca3a36
commit
9fb781d27e
@ -16,7 +16,9 @@
|
||||
#define NEBULAE_Z 16 /* Z plane. */
|
||||
#define NEBULAE_PATH "gen/nebu_%02d.png"
|
||||
|
||||
/* Extern. */
|
||||
extern double gui_xoff, gui_yoff;
|
||||
extern Vec2 shake_pos;
|
||||
|
||||
/* The nebulae textures. */
|
||||
static GLuint nebu_textures[NEBULAE_Z];
|
||||
@ -168,6 +170,11 @@ void nebu_render(void) {
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB, GL_SRC_ALPHA);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB, GL_SRC_ALPHA);
|
||||
|
||||
/* Compensate possible rubmle. */
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glTranslated(shake_pos.x, shake_pos.y, 0.);
|
||||
|
||||
/* Now render. */
|
||||
glBegin(GL_QUADS);
|
||||
glMultiTexCoord2d(GL_TEXTURE0, 0., 0.);
|
||||
@ -187,6 +194,8 @@ void nebu_render(void) {
|
||||
glVertex2d(-SCREEN_W/2., SCREEN_H/2.);
|
||||
glEnd();
|
||||
|
||||
glPopMatrix(); /* GL_PROJECTION */
|
||||
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
@ -204,7 +213,7 @@ void nebu_renderOverlay(double density) {
|
||||
glShadeModel(GL_SMOOTH);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glTranslated(gui_xoff, gui_yoff, 0.);
|
||||
glTranslated(gui_xoff+shake_pos.x, gui_yoff+shake_pos.y, 0.);
|
||||
|
||||
/* Stuff player partially sees. */
|
||||
glBegin(GL_TRIANGLE_FAN);
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
/* Shake, AKA RUMBLE! */
|
||||
static double shake_rad = 0.;
|
||||
static Vec2 shake_pos = { .x = 0., .y = 0. };
|
||||
Vec2 shake_pos = { .x = 0., .y = 0. }; /* Used in nebulae.c */
|
||||
static Vec2 shake_vel = { .x = 0., .y = 0. };
|
||||
static int shake_off = 1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user