home *** CD-ROM | disk | FTP | other *** search
/ Learn 3D Graphics Programming on the PC / Learn_3D_Graphics_Programming_on_the_PC_Ferraro.iso / rwwin / clumpprp.c_ / clumpprp.bin
Encoding:
Text File  |  1995-11-14  |  3.3 KB  |  108 lines

  1. /**********************************************************************
  2.  *
  3.  * File :     clumpprp.c
  4.  *
  5.  * Abstract : Clump properties dialog for the simple RenderWare
  6.  *            application RWVIEW.EXE.
  7.  *
  8.  *            This application had been written to be compatible with
  9.  *            both the fixed and floating-point versions of the
  10.  *            RenderWare library, i.e., it uses the macros CREAL,
  11.  *            INT2REAL, RAdd, RDiv, RSub etc. If your application is
  12.  *            intended for the floating-point version of the library
  13.  *            only these macros are not necessary.
  14.  *
  15.  *            Please note that this application is intended for
  16.  *            demonstration purposes only. No support will be
  17.  *            provided for this code and it comes with no warranty.
  18.  *
  19.  **********************************************************************
  20.  *
  21.  * This file is a product of Criterion Software Ltd.
  22.  *
  23.  * This file is provided as is with no warranties of any kind and is
  24.  * provided without any obligation on Criterion Software Ltd. or
  25.  * Canon Inc. to assist in its use or modification.
  26.  *
  27.  * Criterion Software Ltd. will not, under any
  28.  * circumstances, be liable for any lost revenue or other damages arising
  29.  * from the use of this file.
  30.  *
  31.  * Copyright (c) 1994, 1995 Criterion Software Ltd.
  32.  * All Rights Reserved.
  33.  *
  34.  * RenderWare is a trademark of Canon Inc.
  35.  *
  36.  **********************************************************************/
  37.  
  38. /**********************************************************************
  39.  *
  40.  * Header files.
  41.  *
  42.  **********************************************************************/
  43.  
  44. #include <windows.h>
  45. #include <stdlib.h>
  46. #include <stdio.h>
  47. #include <string.h>
  48.  
  49. #include <rwlib.h>
  50. #include <rwwin31.h>
  51.  
  52. #include "resource.h"
  53.  
  54. #include "common.h"
  55. #include "clumpprp.h"
  56. #include "object.h"
  57.  
  58. /**********************************************************************
  59.  *
  60.  * Functions.
  61.  *
  62.  **********************************************************************/
  63.  
  64. /**********************************************************************/
  65.  
  66. /*
  67.  * The clump properties dialog message procedure.
  68.  */
  69. BOOL CALLBACK
  70. ClumpPropsDlgProc(HWND dialog, UINT message, WPARAM wParam, LPARAM lParam)
  71. {
  72.     static RwClump *Clump;
  73.     RwInt32         n;
  74.     char            buffer[10];
  75.     
  76.     switch (message)
  77.     {
  78.         case WM_INITDIALOG:
  79.             /*
  80.              * The parameter given to DialogBoxParam() is the clump
  81.              * we are modifying.
  82.              */
  83.             Clump = (RwClump *)lParam;
  84.             
  85.             SetDlgItemText(dialog, IDC_CLUMPPROPS_FILENAME, GETCLUMPFILENAME(Clump));
  86.             n = RwGetClumpNumVertices(Clump);
  87.             wsprintf(buffer, "%ld", n);
  88.             SetDlgItemText(dialog, IDC_CLUMPPROPS_NUMVERTICES, buffer);
  89.             n = RwGetClumpNumPolygons(Clump);
  90.             wsprintf(buffer, "%ld", n);
  91.             SetDlgItemText(dialog, IDC_CLUMPPROPS_NUMPOLYGONS, buffer);
  92.             
  93.             return TRUE;
  94.             
  95.         case WM_COMMAND:
  96.             switch (wParam)
  97.             {
  98.                 case IDOK:
  99.                     EndDialog(dialog, 1);
  100.                     break; 
  101.             }
  102.             return TRUE;
  103.     }
  104.     return FALSE;
  105. }
  106.  
  107. /**********************************************************************/
  108.