diff --git a/engine/joint/v4k.h b/engine/joint/v4k.h index 46afcb1..720f923 100644 --- a/engine/joint/v4k.h +++ b/engine/joint/v4k.h @@ -375859,40 +375859,19 @@ light_t* scene_index_light(unsigned light_index) { return &last_scene->lights[light_index]; } - void scene_render(int flags) { camera_t *cam = camera_get_active(); - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LESS); - glActiveTexture(GL_TEXTURE0); - if(flags & SCENE_BACKGROUND) { if(last_scene->skybox.program) { - skybox_push_state(&last_scene->skybox, cam->proj, cam->view); - - glDisable(GL_DEPTH_TEST); - // glDepthFunc(GL_LESS); - // glActiveTexture(GL_TEXTURE0); - // (flags & SCENE_CULLFACE ? glEnable : glDisable)(GL_CULL_FACE); glCullFace(GL_BACK); glFrontFace(GL_CCW); - // glPolygonMode( GL_FRONT_AND_BACK, flags & SCENE_WIREFRAME ? GL_LINE : GL_FILL ); - - mesh_render(&last_scene->skybox.geometry); - skybox_pop_state(); + skybox_push_state(&last_scene->skybox, cam->proj, cam->view); + mesh_render(&last_scene->skybox.geometry); + skybox_pop_state(); } ddraw_flush(); } - glDepthFunc(GL_LESS); - glActiveTexture(GL_TEXTURE0); - - // @fixme: CW ok for one-sided rendering. CCW ok for FXs. we need both - (flags & SCENE_CULLFACE ? glEnable : glDisable)(GL_CULL_FACE); glCullFace(GL_BACK); glFrontFace(GL_CCW); - glPolygonMode( GL_FRONT_AND_BACK, flags & SCENE_WIREFRAME ? GL_LINE : GL_FILL ); - // @todo alpha mode - // @todo texture mode - if( flags & SCENE_FOREGROUND ) { bool do_relighting = 0; for (unsigned j = 0; j < array_count(last_scene->lights); ++j) { @@ -375950,8 +375929,6 @@ void scene_render(int flags) { } glBindVertexArray(0); } - - glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); } #line 0 diff --git a/engine/split/v4k_scene.c b/engine/split/v4k_scene.c index a5cbb3f..d623b64 100644 --- a/engine/split/v4k_scene.c +++ b/engine/split/v4k_scene.c @@ -499,40 +499,19 @@ light_t* scene_index_light(unsigned light_index) { return &last_scene->lights[light_index]; } - void scene_render(int flags) { camera_t *cam = camera_get_active(); - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LESS); - glActiveTexture(GL_TEXTURE0); - if(flags & SCENE_BACKGROUND) { if(last_scene->skybox.program) { - skybox_push_state(&last_scene->skybox, cam->proj, cam->view); - - glDisable(GL_DEPTH_TEST); - // glDepthFunc(GL_LESS); - // glActiveTexture(GL_TEXTURE0); - // (flags & SCENE_CULLFACE ? glEnable : glDisable)(GL_CULL_FACE); glCullFace(GL_BACK); glFrontFace(GL_CCW); - // glPolygonMode( GL_FRONT_AND_BACK, flags & SCENE_WIREFRAME ? GL_LINE : GL_FILL ); - - mesh_render(&last_scene->skybox.geometry); - skybox_pop_state(); + skybox_push_state(&last_scene->skybox, cam->proj, cam->view); + mesh_render(&last_scene->skybox.geometry); + skybox_pop_state(); } ddraw_flush(); } - glDepthFunc(GL_LESS); - glActiveTexture(GL_TEXTURE0); - - // @fixme: CW ok for one-sided rendering. CCW ok for FXs. we need both - (flags & SCENE_CULLFACE ? glEnable : glDisable)(GL_CULL_FACE); glCullFace(GL_BACK); glFrontFace(GL_CCW); - glPolygonMode( GL_FRONT_AND_BACK, flags & SCENE_WIREFRAME ? GL_LINE : GL_FILL ); - // @todo alpha mode - // @todo texture mode - if( flags & SCENE_FOREGROUND ) { bool do_relighting = 0; for (unsigned j = 0; j < array_count(last_scene->lights); ++j) { @@ -590,6 +569,4 @@ void scene_render(int flags) { } glBindVertexArray(0); } - - glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); } diff --git a/engine/v4k.c b/engine/v4k.c index 7b49d53..128f8ff 100644 --- a/engine/v4k.c +++ b/engine/v4k.c @@ -22946,40 +22946,19 @@ light_t* scene_index_light(unsigned light_index) { return &last_scene->lights[light_index]; } - void scene_render(int flags) { camera_t *cam = camera_get_active(); - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LESS); - glActiveTexture(GL_TEXTURE0); - if(flags & SCENE_BACKGROUND) { if(last_scene->skybox.program) { - skybox_push_state(&last_scene->skybox, cam->proj, cam->view); - - glDisable(GL_DEPTH_TEST); - // glDepthFunc(GL_LESS); - // glActiveTexture(GL_TEXTURE0); - // (flags & SCENE_CULLFACE ? glEnable : glDisable)(GL_CULL_FACE); glCullFace(GL_BACK); glFrontFace(GL_CCW); - // glPolygonMode( GL_FRONT_AND_BACK, flags & SCENE_WIREFRAME ? GL_LINE : GL_FILL ); - - mesh_render(&last_scene->skybox.geometry); - skybox_pop_state(); + skybox_push_state(&last_scene->skybox, cam->proj, cam->view); + mesh_render(&last_scene->skybox.geometry); + skybox_pop_state(); } ddraw_flush(); } - glDepthFunc(GL_LESS); - glActiveTexture(GL_TEXTURE0); - - // @fixme: CW ok for one-sided rendering. CCW ok for FXs. we need both - (flags & SCENE_CULLFACE ? glEnable : glDisable)(GL_CULL_FACE); glCullFace(GL_BACK); glFrontFace(GL_CCW); - glPolygonMode( GL_FRONT_AND_BACK, flags & SCENE_WIREFRAME ? GL_LINE : GL_FILL ); - // @todo alpha mode - // @todo texture mode - if( flags & SCENE_FOREGROUND ) { bool do_relighting = 0; for (unsigned j = 0; j < array_count(last_scene->lights); ++j) { @@ -23037,8 +23016,6 @@ void scene_render(int flags) { } glBindVertexArray(0); } - - glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); } #line 0