Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS

Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
This commit is contained in:
Cyd
2026-06-24 21:28:16 -05:00
commit 2b8ca921cb
66341 changed files with 7923174 additions and 0 deletions
@@ -0,0 +1,105 @@
// InstanceFileCreator.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "InstanceFileCreator.h"
#include "InstanceFileCreatorDlg.h"
#include <Stuff\Stuff.hpp>
#include <DLLPlatform\DLLPlatform.hpp>
void __stdcall InitializeGameEngine()
{
Stuff::InitializeClasses();
}
/////////////////////////////////////////////////////////////////////////////
// CInstanceFileCreatorApp
BEGIN_MESSAGE_MAP(CInstanceFileCreatorApp, CWinApp)
//{{AFX_MSG_MAP(CInstanceFileCreatorApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CInstanceFileCreatorApp construction
CInstanceFileCreatorApp::CInstanceFileCreatorApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CInstanceFileCreatorApp object
CInstanceFileCreatorApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CInstanceFileCreatorApp initialization
BOOL CInstanceFileCreatorApp::InitInstance()
{
InitGameOS(NULL, NULL, "blabla");
InitializeGameEngine();
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
CInstanceFileCreatorDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void __stdcall TerminateGameEngine()
{
Stuff::TerminateClasses();
}
void __stdcall GetGameOSEnvironment(char* CommandLine)
{
// Environment.UpdateRenderers = UpdateDisplay;
// Environment.DoGameLogic = DoGameLogic;
Environment.InitializeGameEngine = InitializeGameEngine;
Environment.TerminateGameEngine = TerminateGameEngine;
}
int CInstanceFileCreatorApp::ExitInstance()
{
// TODO: Add your specialized code here and/or call the base class
ExitGameOS();
return CWinApp::ExitInstance();
}
@@ -0,0 +1,175 @@
# Microsoft Developer Studio Project File - Name="InstanceFileCreator" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=InstanceFileCreator - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "InstanceFileCreator.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "InstanceFileCreator.mak" CFG="InstanceFileCreator - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "InstanceFileCreator - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "InstanceFileCreator - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE "InstanceFileCreator - Win32 Profile" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "InstanceFileCreator - Win32 Release"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../../rel.bin"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /G6 /Zp4 /MD /W3 /GX /O2 /I "..\..\Code" /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /I "..\..\Libraries\stlport" /D "USE_PROTOTYPES" /D "STRICT" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
# ADD LINK32 ws2_32.lib /nologo /subsystem:windows /machine:I386
!ELSEIF "$(CFG)" == "InstanceFileCreator - Win32 Debug"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../../dbg.bin"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /G6 /Zp4 /MDd /W3 /Gm /GR /ZI /Od /I "..\..\Code" /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /I "..\..\Libraries\stlport" /D "LAB_ONLY" /D "USE_PROTOTYPES" /D "STRICT" /D "_ARMOR" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /D "WIN32" /D "_DEBUG" /Yu"stdafx.h" /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ws2_32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
!ELSEIF "$(CFG)" == "InstanceFileCreator - Win32 Profile"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "InstanceFileCreator___Win32_Profile"
# PROP BASE Intermediate_Dir "InstanceFileCreator___Win32_Profile"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../../pro.bin"
# PROP Intermediate_Dir "Profile"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /Zp4 /MD /W3 /GX /O2 /I "..\..\Code" /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /I "..\..\Libraries\stlport" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /G6 /Zp4 /MD /W3 /GX /Zi /O2 /I "..\..\Code" /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /I "..\..\Libraries\stlport" /D "LAB_ONLY" /D "USE_PROTOTYPES" /D "STRICT" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 ws2_32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 ws2_32.lib /nologo /subsystem:windows /machine:I386
!ENDIF
# Begin Target
# Name "InstanceFileCreator - Win32 Release"
# Name "InstanceFileCreator - Win32 Debug"
# Name "InstanceFileCreator - Win32 Profile"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\InstanceFileCreator.cpp
# End Source File
# Begin Source File
SOURCE=.\InstanceFileCreator.rc
# End Source File
# Begin Source File
SOURCE=.\InstanceFileCreatorDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\InstanceFileCreator.h
# End Source File
# Begin Source File
SOURCE=.\InstanceFileCreatorDlg.h
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\res\InstanceFileCreator.ico
# End Source File
# Begin Source File
SOURCE=.\res\InstanceFileCreator.rc2
# End Source File
# End Group
# Begin Source File
SOURCE=.\ReadMe.txt
# End Source File
# End Target
# End Project
@@ -0,0 +1,50 @@
// InstanceFileCreator.h : main header file for the INSTANCEFILECREATOR application
//
#if !defined(AFX_INSTANCEFILECREATOR_H__280578DB_13F0_446E_BEFC_54FF2010BF83__INCLUDED_)
#define AFX_INSTANCEFILECREATOR_H__280578DB_13F0_446E_BEFC_54FF2010BF83__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CInstanceFileCreatorApp:
// See InstanceFileCreator.cpp for the implementation of this class
//
class CInstanceFileCreatorApp : public CWinApp
{
public:
CInstanceFileCreatorApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CInstanceFileCreatorApp)
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CInstanceFileCreatorApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_INSTANCEFILECREATOR_H__280578DB_13F0_446E_BEFC_54FF2010BF83__INCLUDED_)
@@ -0,0 +1,210 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif //_WIN32\r\n"
"#include ""res\\InstanceFileCreator.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""afxres.rc"" // Standard components\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON DISCARDABLE "res\\InstanceFileCreator.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About InstanceFileCreator"
FONT 8, "MS Sans Serif"
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
LTEXT "InstanceFileCreator Version 1.0",IDC_STATIC,40,10,119,8,
SS_NOPREFIX
LTEXT "Copyright (C) 2000",IDC_STATIC,40,25,119,8
DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP
END
IDD_INSTANCEFILECREATOR_DIALOG DIALOGEX 0, 0, 320, 138
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "InstanceFileCreator"
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT IDC_GAMEDIR,55,7,188,14,ES_AUTOHSCROLL
LTEXT "Game Dir:",IDC_STATIC,15,10,32,8
PUSHBUTTON "Browse",IDC_BROWSE,249,7,50,14
PUSHBUTTON "Create Files",IDC_CREATE,134,31,50,14
PUSHBUTTON "Exit",IDC_EXIT,135,117,50,14
LISTBOX IDC_OUTPUT,7,54,306,58,LBS_SORT | LBS_NOINTEGRALHEIGHT |
LBS_NOSEL | WS_VSCROLL | WS_TABSTOP
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "InstanceFileCreator MFC Application\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "InstanceFileCreator\0"
VALUE "LegalCopyright", "Copyright (C) 2000\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "InstanceFileCreator.EXE\0"
VALUE "ProductName", "InstanceFileCreator Application\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_ABOUTBOX, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 228
TOPMARGIN, 7
BOTTOMMARGIN, 48
END
IDD_INSTANCEFILECREATOR_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 313
TOPMARGIN, 7
BOTTOMMARGIN, 131
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_ABOUTBOX "&About InstanceFileCreator..."
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif //_WIN32
#include "res\InstanceFileCreator.rc2" // non-Microsoft Visual C++ edited resources
#include "afxres.rc" // Standard components
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
@@ -0,0 +1,344 @@
// InstanceFileCreatorDlg.cpp : implementation file
//
#include "stdafx.h"
#include "InstanceFileCreator.h"
#include "InstanceFileCreatorDlg.h"
#include <Stuff\Stuff.hpp>
#include <GameOS\ToolOS.hpp>
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CInstanceFileCreatorDlg dialog
CInstanceFileCreatorDlg::CInstanceFileCreatorDlg(CWnd* pParent /*=NULL*/)
: CDialog(CInstanceFileCreatorDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CInstanceFileCreatorDlg)
m_GameDir = _T("");
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CInstanceFileCreatorDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CInstanceFileCreatorDlg)
DDX_Control(pDX, IDC_OUTPUT, m_Output);
DDX_Text(pDX, IDC_GAMEDIR, m_GameDir);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CInstanceFileCreatorDlg, CDialog)
//{{AFX_MSG_MAP(CInstanceFileCreatorDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_EXIT, OnExit)
ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
ON_BN_CLICKED(IDC_CREATE, OnCreate)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CInstanceFileCreatorDlg message handlers
BOOL CInstanceFileCreatorDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
char path[MAX_PATH];
GetCurrentDirectory(MAX_PATH,path);
m_GameDir=path;
int pos;
pos=m_GameDir.ReverseFind('\\');
if(pos!=-1) m_GameDir=m_GameDir.Left(pos);
pos=m_GameDir.ReverseFind('\\');
if(pos!=-1) m_GameDir=m_GameDir.Left(pos);
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
}
void CInstanceFileCreatorDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CInstanceFileCreatorDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CInstanceFileCreatorDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CInstanceFileCreatorDlg::OnExit()
{
CDialog::OnOK();
}
void CInstanceFileCreatorDlg::OnBrowse()
{
char pname[MAX_PATH];
BROWSEINFO bi;
bi.hwndOwner = this->m_hWnd;
bi.pidlRoot = NULL;
bi.pszDisplayName = NULL;
bi.lpszTitle = "Choose Game Path...";
bi.ulFlags = BIF_RETURNONLYFSDIRS;
bi.lpfn = NULL;
bi.lParam = (LPARAM)this;
LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
if (SHGetPathFromIDList(pidl,pname))
{
m_GameDir=pname;
}
if (bi.pidlRoot)
{
LPITEMIDLIST pidl= const_cast< ITEMIDLIST* >( bi.pidlRoot ) ;
LPMALLOC pMalloc;
if (pidl)
{
SHGetMalloc(&pMalloc);
pMalloc->Free( pidl);
pMalloc->Release();
}
}
UpdateData(FALSE);
}
void CInstanceFileCreatorDlg::OnOK()
{
// CDialog::OnOK();
}
void CInstanceFileCreatorDlg::OnCancel()
{
// CDialog::OnCancel();
}
void CInstanceFileCreatorDlg::OnCreate()
{
UpdateData(TRUE);
CString path=m_GameDir;
path+="\\Content";
SetCurrentDirectory(path);
ParseDir("Vehicles");
ParseDir("Buildings");
}
void CInstanceFileCreatorDlg::ParseDir(CString dpath)
{
CString lpath;
WIN32_FIND_DATA dir_data,file_data;
HANDLE dirFind,fileFind;
Stuff::NotationFile build_file(dpath+"\\Resource.build.addtions");
build_file.DeleteAllPages();
Stuff::Page *build_page=build_file.AddPage("Additions");
dirFind=FindFirstFile(dpath+"\\*.*",&dir_data);
if(dirFind != INVALID_HANDLE_VALUE)
{
CString dname;
do
{
dname=dir_data.cFileName;
if(dname.CompareNoCase(".") &&
dname.CompareNoCase("..") &&
dir_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY )
{
lpath=dpath+"\\";
lpath+=dname;
fileFind=FindFirstFile(lpath+"\\*.data",&file_data);
if(fileFind != INVALID_HANDLE_VALUE)
{
CString fname,basename,instname,instpath,tstr,tpath;
do
{
fname=file_data.cFileName;
basename=fname;
basename=basename.Left(basename.ReverseFind('.'));
instname=basename+".instance";
instpath=lpath+"\\";
instpath+=instname;
if(fname.CompareNoCase("basic.data") && !gos_DoesFileExist((LPCSTR)instpath))
{
Stuff::NotationFile inst_file((LPCSTR)instpath);
Stuff::Page *page=inst_file.AddPage((char *)(LPCSTR)basename);
page->SetEntry("Model",(LPCSTR)fname);
page->SetEntry("ExecutionState","NeverExecuteState");
tstr=dname+".contents";
tpath=lpath+"\\"+tstr;
if(gos_DoesFileExist((LPCSTR)(tpath)))
{
page->SetEntry("Armature",tstr);
}
tstr=dname+".subsystems";
tpath=lpath+"\\"+tstr;
if(gos_DoesFileExist((LPCSTR)tpath))
{
page->SetEntry("Subsystems",tstr);
}
tstr=dname+".damage";
tpath=lpath+"\\"+tstr;
if(gos_DoesFileExist((LPCSTR)tpath))
{
page->SetEntry("DamageObjects",tstr);
}
inst_file.Save();
CString rbpath;
rbpath.Format("%s\\%s\\%s",dpath,dname,instname);
build_page->AppendEntry("instance",(LPCSTR)rbpath);
OutputMessage(instpath);
}
}
while (FindNextFile(fileFind,&file_data));
}
}
}
while (FindNextFile(dirFind,&dir_data));
}
build_file.Save();
}
void CInstanceFileCreatorDlg::OutputMessage(CString fname)
{
CString msg;
msg.Format("Createing %s",fname);
m_Output.AddString(msg);
}
@@ -0,0 +1,57 @@
// InstanceFileCreatorDlg.h : header file
//
#if !defined(AFX_INSTANCEFILECREATORDLG_H__330657EA_5A77_4EA6_8092_215B9CCE2EF2__INCLUDED_)
#define AFX_INSTANCEFILECREATORDLG_H__330657EA_5A77_4EA6_8092_215B9CCE2EF2__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CInstanceFileCreatorDlg dialog
class CInstanceFileCreatorDlg : public CDialog
{
// Construction
public:
void OutputMessage(CString fname);
void ParseDir(CString path);
CInstanceFileCreatorDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CInstanceFileCreatorDlg)
enum { IDD = IDD_INSTANCEFILECREATOR_DIALOG };
CListBox m_Output;
CString m_GameDir;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CInstanceFileCreatorDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CInstanceFileCreatorDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnExit();
afx_msg void OnBrowse();
virtual void OnOK();
virtual void OnCancel();
afx_msg void OnCreate();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_INSTANCEFILECREATORDLG_H__330657EA_5A77_4EA6_8092_215B9CCE2EF2__INCLUDED_)
@@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// InstanceFileCreator.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
@@ -0,0 +1,27 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__B8D37803_1667_4C4E_A09C_831636072316__INCLUDED_)
#define AFX_STDAFX_H__B8D37803_1667_4C4E_A09C_831636072316__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__B8D37803_1667_4C4E_A09C_831636072316__INCLUDED_)
@@ -0,0 +1,13 @@
//
// INSTANCEFILECREATOR.RC2 - resources Microsoft Visual C++ does not edit directly
//
#ifdef APSTUDIO_INVOKED
#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...
/////////////////////////////////////////////////////////////////////////////
@@ -0,0 +1,25 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by InstanceFileCreator.rc
//
#define IDM_ABOUTBOX 0x0010
#define IDD_ABOUTBOX 100
#define IDS_ABOUTBOX 101
#define IDD_INSTANCEFILECREATOR_DIALOG 102
#define IDR_MAINFRAME 128
#define IDC_GAMEDIR 1000
#define IDC_BROWSE 1001
#define IDC_CREATE 1002
#define IDC_EXIT 1003
#define IDC_OUTPUT 1004
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1007
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif