void view_draw(int tick) { obj_type *obj,*camera_obj; weapon_type *weap; // get player object and held weapon obj=object_find_uid(server.player_obj_uid); weap=weapon_find_current(obj); // camera render view.render=&view_camera_render; // set view camera camera_obj=object_find_uid(camera.obj_uid); camera_get_position(&view.render->camera.pnt,&view.render->camera.ang); view.render->camera.fov=camera.plane.fov; view.render->camera.flip=FALSE; view.render->camera.under_liquid_idx=camera_check_liquid(&view.render->camera.pnt); view.render->no_shadow=FALSE; view.render->force_camera_obj=FALSE; // camera adjustments if (camera.mode==cv_fpp) { view_calculate_scope(tick,obj,camera_obj); view_calculate_recoil(obj); } view_calculate_shakes(tick,obj); view_calculate_sways(tick,obj); view_calculate_bump(obj); // build the scene view_draw_scene_build(tick); // do any back frame rendering gl_back_render_frame_start(tick); // render the scene view_draw_scene_render(tick,obj,weap); // draw tints and fades view_draw_liquid_tint(view.render->camera.under_liquid_idx); view_draw_effect_tint(tick,obj); fade_screen_draw(tick); fade_object_draw(tick,obj); }
void view_draw_dim3rtl(void) { obj_type *obj,*camera_obj; weapon_type *weap; // get player object and held weapon obj=server.obj_list.objs[server.player_obj_idx]; weap=weapon_find_current(obj); // use the camera render view.render=&view_camera_render; // set view camera camera_view_draw_run(); camera_obj=server.obj_list.objs[camera.obj_idx]; memmove(&view.render->camera.pnt,&camera.cur_pos.pnt,sizeof(d3pnt)); memmove(&view.render->camera.ang,&camera.cur_pos.ang,sizeof(d3ang)); view.render->camera.fov=map.camera.plane.fov; view.render->camera.flip=FALSE; view.render->camera.under_liquid_idx=camera_check_liquid(obj,&view.render->camera.pnt); view.render->cull_idx=0; view.render->force_camera_obj=FALSE; // camera adjustments if (map.camera.camera_mode==cv_fpp) { view_calculate_scope(obj,camera_obj); view_calculate_recoil(obj); } view_calculate_shakes(obj); view_calculate_sways(obj); // build the scene view_draw_dim3rtl_scene_build(); // we setup the 2D elements before // rendering because we get the last // frame so we want to use the last // frames eye point label_draw_setup(); halo_draw_setup(); if ((obj!=NULL) && (weap!=NULL)) { crosshair_setup(obj,weap); zoom_setup(obj,weap); } // dim3rtl rendering view_dim3rtl_render(); // draw 2D opengl elements gl_2D_view_screen(); label_draw_render(); halo_draw_render(); if (!view.cinema.on) { if ((obj!=NULL) && (weap!=NULL)) { crosshair_draw(obj,weap); zoom_draw(obj,weap); } } // draw tints and fades view_draw_liquid_tint(view.render->camera.under_liquid_idx); view_draw_effect_tint(); view_fade_draw(); }