draw_context.cc 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #include "draw_context.hh"
  9. #include "g1_render.hh"
  10. g1_draw_context_class::g1_draw_context_class()
  11. {
  12. style=0;
  13. context=0;
  14. screen=0;
  15. transform=0;
  16. texture_scale=1;
  17. top=0;
  18. light=0;
  19. draw_editor_stuff=i4_F;
  20. default_render_bits=0;
  21. }
  22. void g1_draw_context_class::window_setup(w32 win_x, w32 win_y, w32 win_w, w32 win_h,
  23. float &center_x, float &center_y,
  24. float &scale_x, float &scale_y,
  25. float &ooscale_x, float &ooscale_y)
  26. {
  27. w32 max_dim=win_w > win_h ? win_w : win_h;
  28. camera_scale_x=max_dim;
  29. camera_scale_y=max_dim;
  30. center_x=win_x + (i4_float)win_w/2.0;
  31. center_y=win_y + (i4_float)win_h/2.0;
  32. scale_x = (float)max_dim/win_w;
  33. scale_y = (float)max_dim/win_h;
  34. ooscale_x = (float)win_w/(float)max_dim;
  35. ooscale_y = (float)win_h/(float)max_dim;
  36. }