source: golgotha/src/golg/draw_context.cc @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 11 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 1.4 KB
RevLine 
[80]1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#include "draw_context.hh"
10#include "g1_render.hh"
11
12g1_draw_context_class::g1_draw_context_class()
13{
14  style=0;
15  context=0;
16  screen=0;
17  transform=0;
18
19  texture_scale=1;
20  top=0;
21  light=0;
22  draw_editor_stuff=i4_F;
23
24  default_render_bits=0;
25
26}
27
28
29void g1_draw_context_class::window_setup(w32 win_x, w32 win_y, w32 win_w, w32 win_h,
30                                         float &center_x, float &center_y,
31                                         float &scale_x, float &scale_y,
32                                         float &ooscale_x, float &ooscale_y)
33{
34  w32 max_dim=win_w > win_h ? win_w : win_h;
35   
36  camera_scale_x=max_dim;
37  camera_scale_y=max_dim;
38
39  center_x=win_x + (i4_float)win_w/2.0;
40  center_y=win_y + (i4_float)win_h/2.0;
41
42  scale_x = (float)max_dim/win_w;
43  scale_y = (float)max_dim/win_h;
44
45  ooscale_x = (float)win_w/(float)max_dim;
46  ooscale_y = (float)win_h/(float)max_dim;
47}
Note: See TracBrowser for help on using the repository browser.