/[Sims3RigEditor]/trunk/gr2lib_cpp_UnitTest/gr2lib_cpp_UnitTest.cpp
ViewVC logotype

Annotation of /trunk/gr2lib_cpp_UnitTest/gr2lib_cpp_UnitTest.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 55 - (hide annotations) (download)
Thu Aug 12 08:37:47 2010 UTC (9 years, 10 months ago) by william
File size: 3161 byte(s)
Fix all, current, c++ compiler warnings and linker errors

1 william 55 #define _CRT_SECURE_NO_WARNINGS
2     #pragma warning( disable : 4100 ) // disable 'unreferenced formal parameter' warnings
3     #pragma warning( disable : 4101 ) // disable 'unreferenced local variable' warnings
4 william 4 // gr2lib_cpp_UnitTest.cpp : main project file.
5    
6 william 55
7     #include "..\gr2lib_cpp\VSDebugOutput.h"
8 william 4 #include "stdafx.h"
9 william 55 #include "..\granny_sdk\include\granny.h"
10 william 4 #include <stdio.h>
11     #include <iostream>
12     #include <stdlib.h>
13     #include <assert.h>
14 william 55 #include <assert.h>
15 william 7 #include "..\gr2lib_cpp\grannyfile.h"
16 william 55 #include "..\gr2lib_cpp\guicon.h"
17 william 7 #include "..\gr2lib_cpp\gr2lib_rigeditor_frm.h"
18    
19 william 4 using namespace std;
20 william 7 using namespace gr2lib::core;
21 william 4
22    
23     void wait()
24     {
25     cout<<"\nPress {ENTER} to continue.";
26     cin.ignore(1);
27     }
28 william 55 [STAThreadAttribute]
29 william 4 int main(int argc, char const* argv[])
30     {
31    
32 william 6 //grannyfile* grn_file = new grannyfile("C:\\temp\\S3_motorcycleChopper.gr2");
33     grannyfile* grn_file = new grannyfile("C:\\Program Files\\Granny Viewer\\Gryphon.gr2");
34 william 4
35 william 5 if (!grn_file->GrannyAPIVersion->APIVersionsMatch())
36 william 4 {
37 william 5 printf("Warning:\n\t Loaded Granny2 DLL Version: %s\n\t Expected Version: %s",grn_file->GrannyAPIVersion->LoadedAPIVersion().c_str(),grn_file->GrannyAPIVersion->ExpectedAPIVersion().c_str());
38 william 4 return EXIT_FAILURE;
39     }
40     else
41     {
42 william 5 printf("Loaded Granny2 DLL Version: %s\n\t Expected Version: %s",grn_file->GrannyAPIVersion->LoadedAPIVersion().c_str(),grn_file->GrannyAPIVersion->ExpectedAPIVersion().c_str());
43    
44     if (grn_file->_grn_file == 0)
45     {
46     printf("Error: unable to load %s as a Granny file.\n", grn_file->GrannyFilename());
47     return EXIT_FAILURE;
48     }
49     else
50     {
51     if (grn_file->GrannyFileInfo == 0)
52     {
53     printf("Could not extract a granny_file_info from the file.\n");
54     return EXIT_FAILURE;
55     }
56     else
57     {
58     if (grn_file->GrannyFileInfo->ArtToolInfo)
59     {
60     printf("\nFile created by %s (%d.%d)\n",
61     grn_file->GrannyFileInfo->ArtToolInfo->FromArtToolName,
62     grn_file->GrannyFileInfo->ArtToolInfo->ArtToolMajorRevision,
63     grn_file->GrannyFileInfo->ArtToolInfo->ArtToolMinorRevision);
64     printf(" Coordinate system\n"
65     " Units per meter: %f\n"
66     " Right Vector: (%f %f %f)\n"
67     " Up Vector: (%f %f %f)\n"
68     " Back Vector: (%f %f %f)\n\n",
69     grn_file->GrannyFileInfo->ArtToolInfo->UnitsPerMeter,
70     grn_file->GrannyFileInfo->ArtToolInfo->RightVector[0], grn_file->GrannyFileInfo->ArtToolInfo->RightVector[1], grn_file->GrannyFileInfo->ArtToolInfo->RightVector[2],
71     grn_file->GrannyFileInfo->ArtToolInfo->UpVector[0], grn_file->GrannyFileInfo->ArtToolInfo->UpVector[1], grn_file->GrannyFileInfo->ArtToolInfo->UpVector[2],
72     grn_file->GrannyFileInfo->ArtToolInfo->BackVector[0], grn_file->GrannyFileInfo->ArtToolInfo->BackVector[1], grn_file->GrannyFileInfo->ArtToolInfo->BackVector[2]);
73     }
74    
75 william 55 //gr2lib_rigeditor_frm^ _editor = gcnew gr2lib_rigeditor_frm(grn_file);
76     //_editor->ShowDialog();
77     //printf("Art Tool Name: %s", grn_file->GrannyFileInfo->ArtToolInfo->FromArtToolName);
78 william 5 }
79     }
80    
81 william 4 }
82    
83 william 5
84 william 4 wait();
85     return 0;
86     }
87    
88    

  ViewVC Help
Powered by ViewVC 1.1.22