m_bbox.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Emacs style mode select -*- C++ -*-
  2. //-----------------------------------------------------------------------------
  3. //
  4. // $Id:$
  5. //
  6. // Copyright (C) 1993-1996 by id Software, Inc.
  7. //
  8. // This source is available for distribution and/or modification
  9. // only under the terms of the DOOM Source Code License as
  10. // published by id Software. All rights reserved.
  11. //
  12. // The source is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
  15. // for more details.
  16. //
  17. // $Log:$
  18. //
  19. // DESCRIPTION:
  20. // Main loop menu stuff.
  21. // Random number LUT.
  22. // Default Config File.
  23. // PCX Screenshots.
  24. //
  25. //-----------------------------------------------------------------------------
  26. static const char
  27. rcsid[] = "$Id: m_bbox.c,v 1.1 1997/02/03 22:45:10 b1 Exp $";
  28. #ifdef __GNUG__
  29. #pragma implementation "m_bbox.h"
  30. #endif
  31. #include "m_bbox.h"
  32. void M_ClearBox (fixed_t *box)
  33. {
  34. box[BOXTOP] = box[BOXRIGHT] = MININT;
  35. box[BOXBOTTOM] = box[BOXLEFT] = MAXINT;
  36. }
  37. void
  38. M_AddToBox
  39. ( fixed_t* box,
  40. fixed_t x,
  41. fixed_t y )
  42. {
  43. if (x<box[BOXLEFT])
  44. box[BOXLEFT] = x;
  45. else if (x>box[BOXRIGHT])
  46. box[BOXRIGHT] = x;
  47. if (y<box[BOXBOTTOM])
  48. box[BOXBOTTOM] = y;
  49. else if (y>box[BOXTOP])
  50. box[BOXTOP] = y;
  51. }