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

Contents of /trunk/gr2lib_cpp_UnitTest/gr2lib_cpp_UnitTest.cpp

Parent Directory Parent Directory | Revision Log Revision Log


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

1 #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 // gr2lib_cpp_UnitTest.cpp : main project file.
5
6
7 #include "..\gr2lib_cpp\VSDebugOutput.h"
8 #include "stdafx.h"
9 #include "..\granny_sdk\include\granny.h"
10 #include <stdio.h>
11 #include <iostream>
12 #include <stdlib.h>
13 #include <assert.h>
14 #include <assert.h>
15 #include "..\gr2lib_cpp\grannyfile.h"
16 #include "..\gr2lib_cpp\guicon.h"
17 #include "..\gr2lib_cpp\gr2lib_rigeditor_frm.h"
18
19 using namespace std;
20 using namespace gr2lib::core;
21
22
23 void wait()
24 {
25 cout<<"\nPress {ENTER} to continue.";
26 cin.ignore(1);
27 }
28 [STAThreadAttribute]
29 int main(int argc, char const* argv[])
30 {
31
32 //grannyfile* grn_file = new grannyfile("C:\\temp\\S3_motorcycleChopper.gr2");
33 grannyfile* grn_file = new grannyfile("C:\\Program Files\\Granny Viewer\\Gryphon.gr2");
34
35 if (!grn_file->GrannyAPIVersion->APIVersionsMatch())
36 {
37 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 return EXIT_FAILURE;
39 }
40 else
41 {
42 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 //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 }
79 }
80
81 }
82
83
84 wait();
85 return 0;
86 }
87
88

  ViewVC Help
Powered by ViewVC 1.1.22