home *** CD-ROM | disk | FTP | other *** search
/ Learn 3D Graphics Programming on the PC / Learn_3D_Graphics_Programming_on_the_PC_Ferraro.iso / rwwin / xlumpprp.c_ / xlumpprp.bin
Text File  |  1995-11-14  |  4KB  |  117 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 <rwwin.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,tag;
  74.     char            buffer[50];
  75.     RwV3d origin;
  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.             RwGetClumpOrigin(Clump,&origin);
  93.             sprintf(buffer,"X= %3.2f    Y= %3.2f    Z= %3.2f",REAL2FL(origin.x),REAL2FL(origin.y),REAL2FL(origin.z));
  94.             SetDlgItemText(dialog, IDC_CLUMPPROPS_ORIGIN, buffer);
  95.             tag = RwGetClumpTag(Clump);
  96.             wsprintf(buffer,"%ld",tag);
  97.             SetDlgItemText(dialog, IDC_CLUMPPROPS_TAG, buffer);                       
  98.             return TRUE;
  99.             
  100.         case WM_COMMAND:
  101. #ifdef WIN32
  102.             switch(LOWORD(wParam))
  103. #else
  104.             switch (wParam)
  105. #endif
  106.             {
  107.                 case IDOK:
  108.                     EndDialog(dialog, 1);
  109.                     break; 
  110.             }
  111.             return TRUE;
  112.     }
  113.     return FALSE;
  114. }
  115.  
  116. /**********************************************************************/
  117.