Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.3 KiB

  1. /**************************************************************************
  2. * *
  3. * Copyright (C) 1992, Silicon Graphics, Inc. *
  4. * *
  5. * These coded instructions, statements, and computer programs contain *
  6. * unpublished proprietary information of Silicon Graphics, Inc., and *
  7. * are protected by Federal copyright law. They may not be disclosed *
  8. * to third parties or copied or duplicated in any form, in whole or *
  9. * in part, without the prior written consent of Silicon Graphics, Inc. *
  10. * *
  11. **************************************************************************/
  12. /*
  13. * uarray.c++ - $Revision: 1.4 $
  14. * Derrick Burns - 1991
  15. */
  16. #include "glimport.h"
  17. #include "myassert.h"
  18. #include "mystdio.h"
  19. #include "uarray.h"
  20. #include "arc.h"
  21. Uarray::Uarray( void )
  22. {
  23. uarray = 0;
  24. size = 0;
  25. }
  26. Uarray::~Uarray( void )
  27. {
  28. if( uarray ) delete[] uarray;
  29. }
  30. long
  31. Uarray::init( REAL delta, Arc_ptr lo, Arc_ptr hi )
  32. {
  33. ulines = (long) ((hi->tail()[0] - lo->tail()[0])/delta) + 3;
  34. if( size < ulines ) {
  35. size = ulines * 2;
  36. if( uarray ) delete[] uarray;
  37. uarray = new REAL[size];
  38. assert( uarray != 0);
  39. }
  40. uarray[0] = lo->tail()[0] - delta/2.0;
  41. for( long i = 1 ; i != ulines; i++ )
  42. uarray[i] = uarray[0] + i*delta;
  43. return ulines;
  44. }