[Change] Seperated cinematics into spfx.
This commit is contained in:
parent
b860e38959
commit
05ed57907f
19
src/player.c
19
src/player.c
@ -498,23 +498,8 @@ void player_render(void) {
|
||||
pilot_render(player);
|
||||
|
||||
// Fancy cinematic scene borders.
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
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.
|
||||
|
||||
spfx_cinematic();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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) {
|
||||
SPFX* spfx_stack;
|
||||
int i, spfx_nstack;
|
||||
|
@ -23,6 +23,9 @@ void spfx_clear(void);
|
||||
void spfx_start(double dt);
|
||||
void spfx_shake(double mod);
|
||||
|
||||
// Other effects.
|
||||
void spfx_cinematic(void);
|
||||
|
||||
// Load/free.
|
||||
int spfx_load(void);
|
||||
void spfx_free(void);
|
||||
|
Loading…
Reference in New Issue
Block a user