1 /* $Id: setup.c,v 1.7 2005-08-02 06:14:48 chris Exp $ */
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
16 * Setup for 3d library
25 static char rcsid[] = "$Id: setup.c,v 1.7 2005-08-02 06:14:48 chris Exp $";
40 #include "texmap.h" // for init_interface_vars_to_assembler()
43 //initialize the 3d system
46 // div0_init(DM_ERROR);
50 //close down the 3d system
51 void g3_close(void) {}
54 void g3_start_frame(void)
58 //set int w,h & fixed-point w,h/2
59 Canv_w2 = (Canvas_width = grd_curcanv->cv_bitmap.bm_w)<<15;
60 Canv_h2 = (Canvas_height = grd_curcanv->cv_bitmap.bm_h)<<15;
62 fCanv_w2 = f2fl((Canvas_width = grd_curcanv->cv_bitmap.bm_w)<<15);
63 fCanv_h2 = f2fl((Canvas_height = grd_curcanv->cv_bitmap.bm_h)<<15);
66 //compute aspect ratio for this canvas
68 s = fixmuldiv(grd_curscreen->sc_aspect,Canvas_height,Canvas_width);
70 if (s <= f1_0) { //scale x
72 Window_scale.y = f1_0;
75 Window_scale.y = fixdiv(f1_0,s);
76 Window_scale.x = f1_0;
79 Window_scale.z = f1_0; //always 1
86 init_interface_vars_to_assembler(); //for the texture-mapper
90 //this doesn't do anything, but is here for completeness
91 void g3_end_frame(void)
97 // Assert(free_point_num==0);