fix briefing spinning robot display in OGL (d1x r1.28, r1.20, r1.2)
This commit is contained in:
parent
237094095c
commit
369a375f5f
|
@ -1,10 +1,10 @@
|
|||
2004-05-18 Bradley Bell <btb@icculus.org>
|
||||
|
||||
* arch/sdl/digi.c: fix typo
|
||||
|
||||
* arch/ogl/ogl.c, include/ogl_init.h, main/polyobj.c: fix briefing
|
||||
spinning robot display in OGL (d1x r1.28, r1.20, r1.2)
|
||||
|
||||
* arch/sdl/digi.c: fix typo
|
||||
|
||||
* main/state.c: fix savegame thumbnail saving in OGL (d1x r1.6)
|
||||
|
||||
* arch/win32/init.c, arch/win32/win32.c: move win32 window
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: ogl.c,v 1.15 2004-05-16 00:45:25 schaffner Exp $ */
|
||||
/* $Id: ogl.c,v 1.16 2004-05-19 03:29:04 btb Exp $ */
|
||||
/*
|
||||
*
|
||||
* Graphics support functions for OpenGL.
|
||||
|
@ -1155,6 +1155,39 @@ bool ogl_ubitblt_copy(int w,int h,int dx,int dy, int sx, int sy, grs_bitmap * sr
|
|||
return 0;
|
||||
}
|
||||
|
||||
grs_canvas *offscreen_save_canv = NULL, *offscreen_canv = NULL;
|
||||
|
||||
void ogl_start_offscreen_render(int x, int y, int w, int h)
|
||||
{
|
||||
if (offscreen_canv)
|
||||
Error("ogl_start_offscreen_render: offscreen_canv!=NULL");
|
||||
offscreen_save_canv = grd_curcanv;
|
||||
offscreen_canv = gr_create_sub_canvas(grd_curcanv, x, y, w, h);
|
||||
gr_set_current_canvas(offscreen_canv);
|
||||
glDrawBuffer(GL_BACK);
|
||||
}
|
||||
void ogl_end_offscreen_render(void)
|
||||
{
|
||||
int y;
|
||||
|
||||
if (!offscreen_canv)
|
||||
Error("ogl_end_offscreen_render: no offscreen_canv");
|
||||
|
||||
glDrawBuffer(GL_FRONT);
|
||||
glReadBuffer(GL_BACK);
|
||||
OGL_DISABLE(TEXTURE_2D);
|
||||
|
||||
y = last_height - offscreen_canv->cv_bitmap.bm_y - offscreen_canv->cv_bitmap.bm_h;
|
||||
glRasterPos2f(offscreen_canv->cv_bitmap.bm_x/(float)last_width, y/(float)last_height);
|
||||
glCopyPixels(offscreen_canv->cv_bitmap.bm_x, y,
|
||||
offscreen_canv->cv_bitmap.bm_w,
|
||||
offscreen_canv->cv_bitmap.bm_h, GL_COLOR);
|
||||
|
||||
gr_free_sub_canvas(offscreen_canv);
|
||||
gr_set_current_canvas(offscreen_save_canv);
|
||||
offscreen_canv=NULL;
|
||||
}
|
||||
|
||||
void ogl_start_frame(void){
|
||||
r_polyc=0;r_tpolyc=0;r_bitmapc=0;r_ubitmapc=0;r_ubitbltc=0;r_upixelc=0;
|
||||
// gl_badtexture=500;
|
||||
|
@ -1210,7 +1243,6 @@ void ogl_end_frame(void){
|
|||
//gluPerspective(90.0,(GLfloat)(grd_curscreen->sc_w*3)/(GLfloat)(grd_curscreen->sc_h*4),1.0,1000000.0);
|
||||
// ogl_swap_buffers();//platform specific code
|
||||
// glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
}
|
||||
void ogl_swap_buffers(void){
|
||||
ogl_clean_texture_cache();
|
||||
|
|
|
@ -81,6 +81,8 @@ void ogl_close(void);//one time shutdown
|
|||
void ogl_loadbmtexture_m(grs_bitmap *bm,int domipmap);
|
||||
void ogl_freebmtexture(grs_bitmap *bm);
|
||||
|
||||
void ogl_start_offscreen_render(int x, int y, int w, int h);
|
||||
void ogl_end_offscreen_render(void);
|
||||
void ogl_start_frame(void);
|
||||
void ogl_end_frame(void);
|
||||
void ogl_swap_buffers(void);
|
||||
|
@ -102,4 +104,4 @@ bool g3_draw_tmap_2(int nv,g3s_point **pointlist,g3s_uvl *uvl_list,grs_bitmap *b
|
|||
|
||||
void ogl_draw_reticle(int cross, int primary, int secondary);
|
||||
|
||||
#endif _OGL_INIT_H_
|
||||
#endif /* _OGL_INIT_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: polyobj.c,v 1.16 2003-10-10 09:36:35 btb Exp $ */
|
||||
/* $Id: polyobj.c,v 1.17 2004-05-19 03:29:04 btb Exp $ */
|
||||
/*
|
||||
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
|
||||
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
|
||||
|
@ -113,7 +113,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|||
#endif
|
||||
|
||||
#ifdef RCS
|
||||
static char rcsid[] = "$Id: polyobj.c,v 1.16 2003-10-10 09:36:35 btb Exp $";
|
||||
static char rcsid[] = "$Id: polyobj.c,v 1.17 2004-05-19 03:29:04 btb Exp $";
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -152,6 +152,10 @@ static char rcsid[] = "$Id: polyobj.c,v 1.16 2003-10-10 09:36:35 btb Exp $";
|
|||
#include "3dfx_des.h"
|
||||
#endif
|
||||
|
||||
#ifdef OGL
|
||||
#include "ogl_init.h"
|
||||
#endif
|
||||
|
||||
polymodel Polygon_models[MAX_POLYGON_MODELS]; // = {&bot11,&bot17,&robot_s2,&robot_b2,&bot11,&bot17,&robot_s2,&robot_b2};
|
||||
|
||||
int N_polygon_models = 0;
|
||||
|
@ -939,12 +943,18 @@ void draw_model_picture(int mn,vms_angvec *orient_angles)
|
|||
{
|
||||
vms_vector temp_pos=ZERO_VECTOR;
|
||||
vms_matrix temp_orient = IDENTITY_MATRIX;
|
||||
#ifndef OGL
|
||||
grs_canvas *save_canv = grd_curcanv,*temp_canv;
|
||||
#endif
|
||||
|
||||
Assert(mn>=0 && mn<N_polygon_models);
|
||||
|
||||
#ifdef OGL
|
||||
ogl_start_offscreen_render(0, 0, grd_curcanv->cv_bitmap.bm_w, grd_curcanv->cv_bitmap.bm_h);
|
||||
#else
|
||||
temp_canv = gr_create_canvas(save_canv->cv_bitmap.bm_w,save_canv->cv_bitmap.bm_h);
|
||||
gr_set_current_canvas(temp_canv);
|
||||
#endif
|
||||
gr_clear_canvas( BM_XRGB(0,0,0) );
|
||||
|
||||
g3_start_frame();
|
||||
|
@ -962,11 +972,17 @@ void draw_model_picture(int mn,vms_angvec *orient_angles)
|
|||
draw_polygon_model(&temp_pos,&temp_orient,NULL,mn,0,f1_0,NULL,NULL);
|
||||
PA_DFX (Lighting_on = save_light);
|
||||
|
||||
g3_end_frame();
|
||||
|
||||
#ifdef OGL
|
||||
ogl_end_offscreen_render();
|
||||
#else
|
||||
gr_set_current_canvas(save_canv);
|
||||
|
||||
gr_bitmap(0,0,&temp_canv->cv_bitmap);
|
||||
|
||||
gr_free_canvas(temp_canv);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef FAST_FILE_IO
|
||||
|
|
Loading…
Reference in a new issue