home *** CD-ROM | disk | FTP | other *** search
- /**********************************************************************
- *
- * File : clumpprp.c
- *
- * Abstract : Clump properties dialog for the simple RenderWare
- * application RWVIEW.EXE.
- *
- * This application had been written to be compatible with
- * both the fixed and floating-point versions of the
- * RenderWare library, i.e., it uses the macros CREAL,
- * INT2REAL, RAdd, RDiv, RSub etc. If your application is
- * intended for the floating-point version of the library
- * only these macros are not necessary.
- *
- * Please note that this application is intended for
- * demonstration purposes only. No support will be
- * provided for this code and it comes with no warranty.
- *
- **********************************************************************
- *
- * This file is a product of Criterion Software Ltd.
- *
- * This file is provided as is with no warranties of any kind and is
- * provided without any obligation on Criterion Software Ltd. or
- * Canon Inc. to assist in its use or modification.
- *
- * Criterion Software Ltd. will not, under any
- * circumstances, be liable for any lost revenue or other damages arising
- * from the use of this file.
- *
- * Copyright (c) 1994, 1995 Criterion Software Ltd.
- * All Rights Reserved.
- *
- * RenderWare is a trademark of Canon Inc.
- *
- **********************************************************************/
-
- /**********************************************************************
- *
- * Header files.
- *
- **********************************************************************/
-
- #include <windows.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
-
- #include <rwlib.h>
- #include <rwwin.h>
-
- #include "resource.h"
-
- #include "common.h"
- #include "clumpprp.h"
- #include "object.h"
-
- /**********************************************************************
- *
- * Functions.
- *
- **********************************************************************/
-
- /**********************************************************************/
-
- /*
- * The clump properties dialog message procedure.
- */
- BOOL CALLBACK
- ClumpPropsDlgProc(HWND dialog, UINT message, WPARAM wParam, LPARAM lParam)
- {
- static RwClump *Clump;
- RwInt32 n,tag;
- char buffer[50];
- RwV3d origin;
- switch (message)
- {
- case WM_INITDIALOG:
- /*
- * The parameter given to DialogBoxParam() is the clump
- * we are modifying.
- */
- Clump = (RwClump *)lParam;
-
- SetDlgItemText(dialog, IDC_CLUMPPROPS_FILENAME, GETCLUMPFILENAME(Clump));
- n = RwGetClumpNumVertices(Clump);
- wsprintf(buffer, "%ld", n);
- SetDlgItemText(dialog, IDC_CLUMPPROPS_NUMVERTICES, buffer);
- n = RwGetClumpNumPolygons(Clump);
- wsprintf(buffer, "%ld", n);
- SetDlgItemText(dialog, IDC_CLUMPPROPS_NUMPOLYGONS, buffer);
- RwGetClumpOrigin(Clump,&origin);
- sprintf(buffer,"X= %3.2f Y= %3.2f Z= %3.2f",REAL2FL(origin.x),REAL2FL(origin.y),REAL2FL(origin.z));
- SetDlgItemText(dialog, IDC_CLUMPPROPS_ORIGIN, buffer);
- tag = RwGetClumpTag(Clump);
- wsprintf(buffer,"%ld",tag);
- SetDlgItemText(dialog, IDC_CLUMPPROPS_TAG, buffer);
- return TRUE;
-
- case WM_COMMAND:
- #ifdef WIN32
- switch(LOWORD(wParam))
- #else
- switch (wParam)
- #endif
- {
- case IDOK:
- EndDialog(dialog, 1);
- break;
- }
- return TRUE;
- }
- return FALSE;
- }
-
- /**********************************************************************/
-