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.

52 lines
1.7 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. * reader.c++ - $Revision: 1.1 $
  14. * Derrick Burns - 1991
  15. */
  16. #include "glimport.h"
  17. #include "nurbscon.h"
  18. #include "reader.h"
  19. #include "trimvert.h"
  20. O_pwlcurve::O_pwlcurve( long _type, long count, INREAL *array, long byte_stride, TrimVertex *trimpts )
  21. {
  22. next = 0;
  23. used = 0;
  24. owner = 0;
  25. pts = trimpts;
  26. npts = (int) count;
  27. /* copy user data into internal trimming data structures */
  28. switch( _type ) {
  29. case N_P2D: {
  30. TrimVertex *v = pts;
  31. for( TrimVertex *lastv = v + count; v != lastv; v++ ) {
  32. v->param[0] = (REAL) array[0];
  33. v->param[1] = (REAL) array[1];
  34. array = (INREAL *) (((char *) array) + byte_stride);
  35. }
  36. break;
  37. }
  38. case N_P2DR: {
  39. TrimVertex *v = pts;
  40. for( TrimVertex *lastv = v + count; v != lastv; v++ ) {
  41. v->param[0] = (REAL) array[0] / (REAL) array[2];
  42. v->param[1] = (REAL) array[1] / (REAL) array[2];
  43. array = (INREAL *) (((char *) array) + byte_stride);
  44. }
  45. break;
  46. }
  47. }
  48. }