#include "mapviewer.h" int CViewer::Load(int argc, char *argv[]) { Obj = new CWorldObj; if (argc < 3) { cout << "You need to specify a dff file\n"; exit(0); } dffpath = new char[strlen(argv[2]+1)]; strcpy(dffpath, argv[2]); if (argc > 3) { txdpath = new char[strlen(argv[3]+1)]; strcpy(txdpath, argv[3]); } else { txdpath = NULL; } GLView.StartOgl(argc, argv); return 0; } void CViewer::Init() { GLView.Init(); Clock.Init(); Obj->Clump = FileLoader.LoadClump(dffpath); if (Obj->Clump == NULL) { cout << "Couldn't load Clump\n"; exit(1); } Obj->ObjCount = Obj->Clump->numAtomics; if (txdpath != NULL) { Obj->TexDict = FileLoader.LoadTexDict(txdpath); if (Obj->TexDict == NULL) { cout << "Couldn't load Txd\n"; exit(1); } Obj->TexDict->Parent = NULL; RwTexDictionarySetCurrent(Obj->TexDict); } Camera.SetPosition(20.0f, 0.0f, 0.0f); Camera.SetTarget(0.0f, 0.0f, 0.0f); carcol1ind = 0; carcol2ind = 0; } void CViewer::Draw() { int i; if (Obj->Clump->Geo[0].Flags & rpGEOMETRYNORMALS) Sky.SetLightModel(AMBIENT_AND_DIFFUSE); else Sky.SetLightModel(AMBIENT_ONLY); for (i = 0; i < Obj->ObjCount; i++) { Obj->Draw(true, i, false); Obj->Draw(true, i, true); } }