version 1.7 | | version 1.8 |
---|
| | |
#include "polyobj.h" | | #include "polyobj.h" |
| | |
| | |
| | int last_width=-1,last_height=-1; |
int GL_TEXTURE_2D_enabled=-1; | | int GL_TEXTURE_2D_enabled=-1; |
int GL_texclamp_enabled=-1; | | int GL_texclamp_enabled=-1; |
| | |
| | |
} | | } |
else if(Objects[i].render_type==RT_POLYOBJ){ | | else if(Objects[i].render_type==RT_POLYOBJ){ |
ogl_cache_polymodel_textures(Objects[i].rtype.pobj_info.model_num); | | ogl_cache_polymodel_textures(Objects[i].rtype.pobj_info.model_num); |
//cache its textures... | | |
} | | } |
} | | } |
} | | } |
| | |
| | |
glBegin(GL_QUADS); | | glBegin(GL_QUADS); |
glColor3f(1.0,1.0,1.0); | | glColor3f(1.0,1.0,1.0); |
| | width = fixmul(width,Matrix_scale.x); |
| | height = fixmul(height,Matrix_scale.y); |
for (i=0;i<4;i++){ | | for (i=0;i<4;i++){ |
// g3_rotate_point(&p[i],pos); | | // g3_rotate_point(&p[i],pos); |
vm_vec_sub(&v1,pos,&View_position); | | vm_vec_sub(&v1,pos,&View_position); |
| | |
GLfloat xo,yo,xs,ys; | | GLfloat xo,yo,xs,ys; |
r_ubitmapc++; | | r_ubitmapc++; |
| | |
xo=x/(float)grd_curscreen->sc_w; | | xo=x/(float)last_width; |
xs=bm->bm_w/(float)grd_curscreen->sc_w; | | xs=bm->bm_w/(float)last_width; |
yo=1.0-y/(float)grd_curscreen->sc_h; | | yo=1.0-y/(float)last_height; |
ys=bm->bm_h/(float)grd_curscreen->sc_h; | | ys=bm->bm_h/(float)last_height; |
// printf("g3_draw_bitmap: %f,%f,%f - ",f2glf(pos->x),f2glf(pos->y),-f2glf(pos->z)); | | // printf("g3_draw_bitmap: %f,%f,%f - ",f2glf(pos->x),f2glf(pos->y),-f2glf(pos->z)); |
// printf("(%f,%f,%f) ",f2glf(View_position.x),f2glf(View_position.y),-f2glf(View_position.z)); | | // printf("(%f,%f,%f) ",f2glf(View_position.x),f2glf(View_position.y),-f2glf(View_position.z)); |
| | |
| | |
return 0; | | return 0; |
} | | } |
| | |
vms_vector aoeupos={0,0,-1000*f1_0}; | | |
vms_matrix aoeuorient=IDENTITY_MATRIX; | | |
void ogl_start_frame(void){ | | void ogl_start_frame(void){ |
r_polyc=0;r_tpolyc=0;r_bitmapc=0;r_ubitmapc=0; | | r_polyc=0;r_tpolyc=0;r_bitmapc=0;r_ubitmapc=0; |
| | |
| | OGL_VIEWPORT(grd_curcanv->cv_bitmap.bm_x,grd_curcanv->cv_bitmap.bm_y,Canvas_width,Canvas_height); |
glClearColor(0.0, 0.0, 0.0, 0.0); | | glClearColor(0.0, 0.0, 0.0, 0.0); |
// glEnable(GL_ALPHA_TEST); | | // glEnable(GL_ALPHA_TEST); |
// glAlphaFunc(GL_GREATER,0.0); | | // glAlphaFunc(GL_GREATER,0.0); |
| | |
glLoadIdentity();//clear matrix | | glLoadIdentity();//clear matrix |
//gluPerspective(90.0,(GLfloat)(grd_curscreen->sc_w*3)/(GLfloat)(grd_curscreen->sc_h*4),1.0,1000000.0); | | //gluPerspective(90.0,(GLfloat)(grd_curscreen->sc_w*3)/(GLfloat)(grd_curscreen->sc_h*4),1.0,1000000.0); |
gluPerspective(90.0,(GLfloat)(grd_curscreen->sc_w*3)/(GLfloat)(grd_curscreen->sc_h*4),0.01,1000000.0); | | gluPerspective(90.0,(GLfloat)(grd_curscreen->sc_w*3)/(GLfloat)(grd_curscreen->sc_h*4),0.01,1000000.0); |
| | //gluPerspective(90.0,(GLfloat)(Canvas_width*3)/(GLfloat)(Canvas_height*4),0.01,1000000.0); |
// gluPerspective(75.0,(GLfloat)Canvas_width/(GLfloat)Canvas_height,1.0,1000000.0); | | // gluPerspective(75.0,(GLfloat)Canvas_width/(GLfloat)Canvas_height,1.0,1000000.0); |
glMatrixMode(GL_MODELVIEW); | | glMatrixMode(GL_MODELVIEW); |
glLoadIdentity();//clear matrix | | glLoadIdentity();//clear matrix |
| | |
void ogl_end_frame(void){ | | void ogl_end_frame(void){ |
| | |
mprintf((0,"ogl_end_frame: rendered %i flat polys, %i tmapped polys, %i sprites, %i ubitmaps\n",r_polyc,r_tpolyc,r_bitmapc,r_ubitmapc)); | | mprintf((0,"ogl_end_frame: rendered %i flat polys, %i tmapped polys, %i sprites, %i ubitmaps\n",r_polyc,r_tpolyc,r_bitmapc,r_ubitmapc)); |
| | // glViewport(0,0,grd_curscreen->sc_w,grd_curscreen->sc_h); |
glMatrixMode(GL_PROJECTION); | | glMatrixMode(GL_PROJECTION); |
glLoadIdentity();//clear matrix | | glLoadIdentity();//clear matrix |
glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0); | | glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0); |