[Change] Seperated cinematics into spfx.
This commit is contained in:
parent
b860e38959
commit
05ed57907f
17
src/player.c
17
src/player.c
@ -498,22 +498,7 @@ void player_render(void) {
|
|||||||
pilot_render(player);
|
pilot_render(player);
|
||||||
|
|
||||||
// Fancy cinematic scene borders.
|
// Fancy cinematic scene borders.
|
||||||
glMatrixMode(GL_MODELVIEW);
|
spfx_cinematic();
|
||||||
glPushMatrix(); // Translation matrix.
|
|
||||||
glTranslated(x-(double)gl_screen.w/2., y-(double)gl_screen.h/2., 0);
|
|
||||||
|
|
||||||
COLOUR(cBlack);
|
|
||||||
glBegin(GL_QUADS);
|
|
||||||
glVertex2d(0., 0.);
|
|
||||||
glVertex2d(0., gl_screen.h*0.2);
|
|
||||||
glVertex2d(gl_screen.w, gl_screen.h*0.2);
|
|
||||||
glVertex2d(gl_screen.w, 0.);
|
|
||||||
glVertex2d(0., gl_screen.h);
|
|
||||||
glVertex2d(gl_screen.w, gl_screen.h);
|
|
||||||
glVertex2d(0., gl_screen.h*0.8);
|
|
||||||
glEnd();
|
|
||||||
|
|
||||||
glPopMatrix(); // Translation matrix.
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
20
src/spfx.c
20
src/spfx.c
@ -229,6 +229,26 @@ void spfx_shake(double mod) {
|
|||||||
vect_pset(&shake_vel, shake_rad, RNGF() * 2. * M_PI);
|
vect_pset(&shake_vel, shake_rad, RNGF() * 2. * M_PI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void spfx_cinematic(void) {
|
||||||
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
glPushMatrix(); // Translation matrix.
|
||||||
|
glTranslated(-(double)gl_screen.w/2., -(double)gl_screen.h/2., 0);
|
||||||
|
|
||||||
|
COLOUR(cBlack);
|
||||||
|
glBegin(GL_QUADS);
|
||||||
|
glVertex2d(0., 0.);
|
||||||
|
glVertex2d(0., gl_screen.h*0.2);
|
||||||
|
glVertex2d(gl_screen.w, gl_screen.h*0.2);
|
||||||
|
glVertex2d(gl_screen.w, 0.);
|
||||||
|
glVertex2d(0., gl_screen.h);
|
||||||
|
glVertex2d(gl_screen.w, gl_screen.h);
|
||||||
|
glVertex2d(gl_screen.w, gl_screen.h*0.8);
|
||||||
|
glVertex2d(0., gl_screen.h*0.8);
|
||||||
|
glEnd();
|
||||||
|
|
||||||
|
glPopMatrix(); // Translation matrix.
|
||||||
|
}
|
||||||
|
|
||||||
void spfx_render(const int layer) {
|
void spfx_render(const int layer) {
|
||||||
SPFX* spfx_stack;
|
SPFX* spfx_stack;
|
||||||
int i, spfx_nstack;
|
int i, spfx_nstack;
|
||||||
|
@ -23,6 +23,9 @@ void spfx_clear(void);
|
|||||||
void spfx_start(double dt);
|
void spfx_start(double dt);
|
||||||
void spfx_shake(double mod);
|
void spfx_shake(double mod);
|
||||||
|
|
||||||
|
// Other effects.
|
||||||
|
void spfx_cinematic(void);
|
||||||
|
|
||||||
// Load/free.
|
// Load/free.
|
||||||
int spfx_load(void);
|
int spfx_load(void);
|
||||||
void spfx_free(void);
|
void spfx_free(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user