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,94 @@
// MapShifter.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "MapShifter.h"
#include "MapShifterDlg.h"
#include <Stuff\Stuff.hpp>
#include <DLLPlatform\DLLPlatform.hpp>
void __stdcall InitializeGameEngine()
{
Stuff::InitializeClasses();
}
/////////////////////////////////////////////////////////////////////////////
// CMapShifterApp
BEGIN_MESSAGE_MAP(CMapShifterApp, CWinApp)
//{{AFX_MSG_MAP(CMapShifterApp)
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMapShifterApp construction
CMapShifterApp::CMapShifterApp()
{
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CMapShifterApp object
CMapShifterApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CMapShifterApp initialization
BOOL CMapShifterApp::InitInstance()
{
InitGameOS(NULL, NULL, "blabla");
InitializeGameEngine();
AfxEnableControlContainer();
// Standard initialization
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
CMapShifterDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
}
else if (nResponse == IDCANCEL)
{
}
// 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 CMapShifterApp::ExitInstance()
{
ExitGameOS();
return CWinApp::ExitInstance();
}
@@ -0,0 +1,178 @@
# Microsoft Developer Studio Project File - Name="MapShifter" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=MapShifter - 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 "MapShifter.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 "MapShifter.mak" CFG="MapShifter - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "MapShifter - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "MapShifter - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE "MapShifter - Win32 Profile" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "MapShifter - 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 /MD /W3 /GX /O2 /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)" == "MapShifter - 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)" == "MapShifter - Win32 Profile"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "MapShifter___Win32_Profile"
# PROP BASE Intermediate_Dir "MapShifter___Win32_Profile"
# 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 /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /G6 /Zp4 /MD /W3 /Zi /Ox /Ot /Oa /Og /Oi /I "..\..\Code" /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /I "..\..\Libraries\stlport" /D "LAB_ONLY" /D "USE_PROTOTYPES" /D "STRICT" /D "MULTI_PLAYER" /D TEST_CLASS=50 /D "NDEBUG" /D "_AFXDLL" /D "_MBCS" /D "MFC" /D "_WINDOWS" /D "WIN32" /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
!ENDIF
# Begin Target
# Name "MapShifter - Win32 Release"
# Name "MapShifter - Win32 Debug"
# Name "MapShifter - Win32 Profile"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\MapShifter.cpp
# End Source File
# Begin Source File
SOURCE=.\MapShifter.rc
# End Source File
# Begin Source File
SOURCE=.\MapShifterDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\ProgDlg.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=.\MapShifter.h
# End Source File
# Begin Source File
SOURCE=.\MapShifterDlg.h
# End Source File
# Begin Source File
SOURCE=.\ProgDlg.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\MapShifter.ico
# End Source File
# Begin Source File
SOURCE=.\res\MapShifter.rc2
# End Source File
# End Group
# End Target
# End Project
@@ -0,0 +1,48 @@
// MapShifter.h : main header file for the MAPSHIFTER application
//
#if !defined(AFX_MAPSHIFTER_H__748382FF_822E_44A4_92A5_8EB9A4D61435__INCLUDED_)
#define AFX_MAPSHIFTER_H__748382FF_822E_44A4_92A5_8EB9A4D61435__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
/////////////////////////////////////////////////////////////////////////////
// CMapShifterApp:
// See MapShifter.cpp for the implementation of this class
//
class CMapShifterApp : public CWinApp
{
public:
CMapShifterApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMapShifterApp)
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CMapShifterApp)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAPSHIFTER_H__748382FF_822E_44A4_92A5_8EB9A4D61435__INCLUDED_)
@@ -0,0 +1,194 @@
//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\\MapShifter.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\\MapShifter.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_MAPSHIFTER_DIALOG DIALOGEX 0, 0, 172, 186
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "MapShifter"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "Exit",IDOK,115,165,50,14
PUSHBUTTON "Shift Selected",IDC_SHIFT,115,84,50,14
LISTBOX IDC_MAPLIST,7,7,99,172,LBS_SORT | LBS_MULTIPLESEL |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Select All",IDC_SELECTALL,115,7,50,14
PUSHBUTTON "Clear Selection",IDC_CLEAR,115,25,50,14
END
IDD_PROGDLG DIALOG DISCARDABLE 0, 0, 186, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "ProgDlg"
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "Static",IDC_MSG,7,16,157,53
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", "MapShifter MFC Application\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "MapShifter\0"
VALUE "LegalCopyright", "Copyright (C) 2000\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "MapShifter.EXE\0"
VALUE "ProductName", "MapShifter 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_MAPSHIFTER_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 165
TOPMARGIN, 7
BOTTOMMARGIN, 179
END
IDD_PROGDLG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 179
TOPMARGIN, 7
BOTTOMMARGIN, 88
END
END
#endif // APSTUDIO_INVOKED
#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\MapShifter.rc2" // non-Microsoft Visual C++ edited resources
#include "afxres.rc" // Standard components
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
@@ -0,0 +1,453 @@
// MapShifterDlg.cpp : implementation file
//
#include "stdafx.h"
#include "MapShifter.h"
#include "MapShifterDlg.h"
#include "ProgDlg.h"
#include <Adept\Adept.hpp>
#include <Adept\Zone.hpp>
using namespace Stuff;
extern bool __stdcall gos_DoesFileExist( const char* FileName );
/////////////////////////////////////////////////////////////////////////////
// CMapShifterDlg dialog
CMapShifterDlg::CMapShifterDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMapShifterDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CMapShifterDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CMapShifterDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMapShifterDlg)
DDX_Control(pDX, IDC_MAPLIST, m_MapList);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMapShifterDlg, CDialog)
//{{AFX_MSG_MAP(CMapShifterDlg)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_SHIFT, OnShift)
ON_BN_CLICKED(IDC_SELECTALL, OnSelectall)
ON_BN_CLICKED(IDC_CLEAR, OnClear)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMapShifterDlg message handlers
BOOL CMapShifterDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
int mapcount=0;
WIN32_FIND_DATA file_data;
HANDLE mission_search = FindFirstFile("Content\\Missions\\*.*" , &file_data);
if(mission_search != INVALID_HANDLE_VALUE)
{
do
if(file_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
{
CString map_name(file_data.cFileName);
if(map_name.CompareNoCase(".") && map_name.CompareNoCase(".."))
m_MapList.AddString(file_data.cFileName);
mapcount++;
}
while (FindNextFile(mission_search,&file_data));
}
return TRUE; // return TRUE unless you set the focus to a control
}
// 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 CMapShifterDlg::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();
}
}
HCURSOR CMapShifterDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CMapShifterDlg::OnCancel()
{
// CDialog::OnCancel();
}
void CMapShifterDlg::OnOK()
{
CDialog::OnOK();
}
void ConvertMoveRectToZeroCenter (const char *filename,Stuff::Scalar xoffset,Stuff::Scalar zoffset)
{
if (!filename)
return;
DWORD *file;
DWORD filesize;
DWORD *data;
int numrects,i;
struct TRect
{
Scalar left,right,top,bottom;
int building;
bool vertical;
};
TRect *rects;
if(!gos_DoesFileExist(filename)) return;
gos_GetFile(filename,(unsigned char **) &file,&filesize);
data = file;
numrects = *((int*) data);
data++;
rects = (TRect *) data;
Stuff::FileStream stream(filename,Stuff::FileStream::WriteOnly);
stream << numrects;
for (i=0;i<numrects;i++)
{
rects->bottom += zoffset;
rects->top += zoffset;
rects->left += xoffset;
rects->right += xoffset;
stream.WriteBytes (rects,sizeof (TRect));
rects++;
}
gos_Free (file);
}
void CMapShifterDlg::ProcessMap(CString mis_name)
{
CProgDlg progdlg;
progdlg.Create(IDD_PROGDLG,this);
CString tmpstr;
tmpstr="Processing ";
tmpstr+=mis_name;
progdlg.SetWindowText(mis_name);
progdlg.ShowWindow(SW_SHOW);
progdlg.m_Msg="Collecting Mission Info";
progdlg.UpdateData(FALSE);
CString mis_path,con_path,inst_path,map_inst_path,map_name,mbounds_name,wbounds_name;
mis_path.Format("Content\\Missions\\%s",mis_name);
inst_path=mis_path+"\\"+mis_name+".instance";
NotationFile instance_file((LPCSTR)inst_path);
Page *page=instance_file.SetPage(mis_name);
const char *tstr;
tstr="";
page->GetEntry("Map",&tstr);
map_inst_path=tstr;
map_name=map_inst_path;
map_name=map_name.Left(map_name.ReverseFind('.'));
map_name=map_name.Mid(map_name.ReverseFind('\\')+1);
tstr="";
page->GetEntry("MissionBounds",&tstr);
mbounds_name=tstr;
tstr="";
page->GetEntry("WarningBounds",&tstr);
wbounds_name=tstr;
Scalar map_size_x,map_size_z;
GetMapSize(map_name,&map_size_x,&map_size_z);
Point3D org_offset;
org_offset.y=0.0f;
org_offset.x=-map_size_x*0.5f;
org_offset.z=-map_size_z*0.5f;
con_path=mis_path+"\\"+mis_name+".contents";
NotationFile contents_file((LPCSTR)con_path);
NotationFile::PageIterator *entity_page_list = contents_file.MakePageIterator();
Check_Object(entity_page_list);
progdlg.m_Msg="Offsetting Entities";
progdlg.UpdateData(FALSE);
Page *entity_page;
Point3D trans,newtrans;
while ((entity_page = entity_page_list->ReadAndNext()) != NULL)
{
entity_page->GetEntry("Translation",&trans);
newtrans=trans;
newtrans+=org_offset;
entity_page->SetEntry("Translation",newtrans);
}
contents_file.Save();
progdlg.m_Msg="Offsetting Paths";
progdlg.UpdateData(FALSE);
//Do Paths
CString paths_path;
paths_path=mis_path+"\\Paths";
WIN32_FIND_DATA file_data;
HANDLE path_search = FindFirstFile(paths_path+"\\*.contents" , &file_data);
if(path_search != INVALID_HANDLE_VALUE)
{
do
{
NotationFile path_file((paths_path+"\\"+file_data.cFileName));
Page *path_page=path_file.GetPage("Path");
Note *point_note;
Check_Object(path_page);
Page::NoteIterator *path_list=path_page->MakeNoteIterator();
while ((point_note = path_list->ReadAndNext()) != NULL)
{
point_note->GetEntry(&trans);
newtrans=trans;
newtrans+=org_offset;
point_note->SetEntry(newtrans);
}
path_file.Save();
}
while (FindNextFile(path_search,&file_data));
}
progdlg.m_Msg="Offsetting DropZones";
progdlg.UpdateData(FALSE);
//Do Paths
CString drop_path;
paths_path=mis_path+"\\dropzones";
NotationFile pstart_file((paths_path+"\\"+"PlayerStart.contents"));
Page *drop_page=pstart_file.GetPage("DropPoints");
Note *point_note;
Check_Object(drop_page);
Page::NoteIterator *drop_list=drop_page->MakeNoteIterator();
while ((point_note = drop_list->ReadAndNext()) != NULL)
{
point_note->GetEntry(&trans);
newtrans=trans;
newtrans+=org_offset;
point_note->SetEntry(newtrans);
}
pstart_file.Save();
progdlg.m_Msg="Offsetting Graph";
progdlg.UpdateData(FALSE);
//Do Graphs
CString graph_path;
graph_path=mis_path+"\\"+mis_name+"Graph.data";
NotationFile graph_file((LPCSTR)graph_path);
NotationFile::PageIterator *node_list = graph_file.MakePageIterator();
Check_Object(node_list);
Page *node_page;
while ((node_page = node_list->ReadAndNext()) != NULL)
{
CString page_name=node_page->GetName();
if(!page_name.Left(strlen("Node")).CompareNoCase("Node"))
{
node_page->GetEntry("Location",&trans);
newtrans=trans;
newtrans+=org_offset;
node_page->SetEntry("Location",newtrans);
}
}
graph_file.Save();
progdlg.m_Msg="Offsetting Bounds";
progdlg.UpdateData(FALSE);
/*
//Do Bounds
CString mbounds_path,wbounds_path;
mbounds_path.Format("%s\\%s",mis_path,mbounds_name);
wbounds_path.Format("%s\\%s",mis_path,wbounds_name);
FileStream bound_file;
DynamicArrayOf<Stuff::Vector2DOf<Stuff::Scalar> > bound;
int i;
if(mbounds_name.GetLength()>0 && gos_DoesFileExist((LPCSTR)mbounds_path))
{
bound_file.Open((LPCSTR)mbounds_path,FileStream::ReadOnly);
MemoryStreamIO_Read(&bound_file, &bound);
bound_file.Close();
for (i = 0; i < bound.GetLength(); i++)
{
bound[i].x += org_offset.x/Adept::c_ZoneSize;
bound[i].y += org_offset.z/Adept::c_ZoneSize;
}
bound_file.Open((LPCSTR)mbounds_path,FileStream::WriteOnly);
MemoryStreamIO_Write(&bound_file, &bound);
bound_file.Close();
}
if(wbounds_name.GetLength()>0 && gos_DoesFileExist((LPCSTR)wbounds_path))
{
bound_file.Open((LPCSTR)wbounds_path,FileStream::ReadOnly);
MemoryStreamIO_Read(&bound_file, &bound);
bound_file.Close();
for (i = 0; i < bound.GetLength(); i++)
{
bound[i].x += org_offset.x/Adept::c_ZoneSize;
bound[i].y += org_offset.z/Adept::c_ZoneSize;
}
bound_file.Open((LPCSTR)wbounds_path,FileStream::WriteOnly);
MemoryStreamIO_Write(&bound_file, &bound);
bound_file.Close();
}
*/
progdlg.m_Msg="Offsetting Rect Grid";
progdlg.UpdateData(FALSE);
//Do Rect Grid
CString move_rect_name;
move_rect_name=mis_path+"\\"+mis_name+"RectGrid.data";
ConvertMoveRectToZeroCenter(move_rect_name,org_offset.x,org_offset.z);
progdlg.m_Msg="Offsetting Lights";
progdlg.UpdateData(FALSE);
//Do Lights
CString light_path;
light_path=mis_path+"\\"+mis_name+".lights";
NotationFile lights_file((LPCSTR)light_path);
NotationFile::PageIterator *light_list = lights_file.MakePageIterator();
Check_Object(light_list);
Page *light_page;
Note *pos_note;
while ((light_page = light_list->ReadAndNext()) != NULL)
{
pos_note=light_page->FindNote("Position");
if(pos_note!=NULL)
{
pos_note->GetEntry(&trans);
newtrans=trans;
newtrans+=org_offset;
pos_note->SetEntry(newtrans);
}
}
lights_file.Save();
}
void CMapShifterDlg::OnShift()
{
int selCount = m_MapList.GetSelCount();
int* selected = new int [selCount];
m_MapList.GetSelItems(selCount,selected);
for (int i = 0; i < selCount; i++)
{
CString text;
m_MapList.GetText(selected[i],text);
ProcessMap(text);
}
delete selected;
}
void CMapShifterDlg::OnSelectall()
{
for (int i = 0; i < m_MapList.GetCount(); i++)
m_MapList.SetSel(i,true);
}
void CMapShifterDlg::OnClear()
{
for (int i = 0; i < m_MapList.GetCount(); i++)
m_MapList.SetSel(i,false);
}
void CMapShifterDlg::GetMapSize(CString map_name, float *xsize, float *zsize)
{
CString map_path;
map_path.Format("Content\\Maps\\%s",map_name);
int rows,cols;
rows=cols=0;
//count rows
CString erf_name;
erf_name.Format("%s\\%cA.erf",map_path,'A'+rows);
while(gos_DoesFileExist(erf_name))
{
rows++;
erf_name.Format("%s\\%cA.erf",map_path,'A'+rows);
}
erf_name.Format("%s\\A%c.erf",map_path,'A'+cols);
while(gos_DoesFileExist(erf_name))
{
cols++;
erf_name.Format("%s\\A%c.erf",map_path,'A'+cols);
}
*xsize=cols*Adept::c_ZoneSize;
*zsize=rows*Adept::c_ZoneSize;
}
@@ -0,0 +1,56 @@
// MapShifterDlg.h : header file
//
#if !defined(AFX_MAPSHIFTERDLG_H__6192E456_F12F_43F1_9509_7CB3857AB8C8__INCLUDED_)
#define AFX_MAPSHIFTERDLG_H__6192E456_F12F_43F1_9509_7CB3857AB8C8__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CMapShifterDlg dialog
class CMapShifterDlg : public CDialog
{
// Construction
public:
void GetMapSize(CString map_name,float *xsize,float *zsize);
void ProcessMap(CString map_name);
CMapShifterDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CMapShifterDlg)
enum { IDD = IDD_MAPSHIFTER_DIALOG };
CListBox m_MapList;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMapShifterDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CMapShifterDlg)
virtual BOOL OnInitDialog();
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
virtual void OnCancel();
virtual void OnOK();
afx_msg void OnShift();
afx_msg void OnSelectall();
afx_msg void OnClear();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAPSHIFTERDLG_H__6192E456_F12F_43F1_9509_7CB3857AB8C8__INCLUDED_)
@@ -0,0 +1,43 @@
// ProgDlg.cpp : implementation file
//
#include "stdafx.h"
#include "MapShifter.h"
#include "ProgDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CProgDlg dialog
CProgDlg::CProgDlg(CWnd* pParent /*=NULL*/)
: CDialog(CProgDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CProgDlg)
m_Msg = _T("");
//}}AFX_DATA_INIT
}
void CProgDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CProgDlg)
DDX_Text(pDX, IDC_MSG, m_Msg);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CProgDlg, CDialog)
//{{AFX_MSG_MAP(CProgDlg)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CProgDlg message handlers
@@ -0,0 +1,46 @@
#if !defined(AFX_PROGDLG_H__BE655E1E_500D_41AF_92E7_96B4EDCE90C1__INCLUDED_)
#define AFX_PROGDLG_H__BE655E1E_500D_41AF_92E7_96B4EDCE90C1__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ProgDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CProgDlg dialog
class CProgDlg : public CDialog
{
// Construction
public:
CProgDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CProgDlg)
enum { IDD = IDD_PROGDLG };
CString m_Msg;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CProgDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CProgDlg)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PROGDLG_H__BE655E1E_500D_41AF_92E7_96B4EDCE90C1__INCLUDED_)
@@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// MapShifter.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__E0CDCE98_0F37_425C_B5CF_C1E8AE51E4C7__INCLUDED_)
#define AFX_STDAFX_H__E0CDCE98_0F37_425C_B5CF_C1E8AE51E4C7__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__E0CDCE98_0F37_425C_B5CF_C1E8AE51E4C7__INCLUDED_)
Binary file not shown.
@@ -0,0 +1,13 @@
//
// MAPSHIFTER.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,23 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by MapShifter.rc
//
#define IDD_MAPSHIFTER_DIALOG 102
#define IDR_MAINFRAME 128
#define IDD_PROGDLG 129
#define IDC_SHIFT 1000
#define IDC_MAPLIST 1001
#define IDC_SELECTALL 1002
#define IDC_CLEAR 1003
#define IDC_MSG 1004
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 130
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1005
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif