Tried to add VS2003 support...

This commit is contained in:
Vulpovile
2021-03-18 23:22:37 -07:00
parent 7ea74a3980
commit 239f7b8fa8
12 changed files with 734 additions and 15 deletions

View File

@@ -2,6 +2,10 @@
#include <G3DAll.h>
#include "propertyGrid.h"
#include "map"
#ifdef NO_SPRINTF
#define sprintf_s sprintf
#endif
//#include "Properties/BoolProperty.h"
class Instance

5
src/include/winver.h Normal file
View File

@@ -0,0 +1,5 @@
#ifndef WINVER
#define _WIN32_WINNT 0x0400
#define _WIN32_WINDOWS 0x0400
#define WINVER 0x0400
#endif

View File

@@ -13,6 +13,7 @@ using namespace std;
using namespace rapidxml;
DataModelInstance::DataModelInstance(void)
{
Instance::Instance();
@@ -518,7 +519,6 @@ bool DataModelInstance::getOpen()
of.lpstrFile[0]='\0';
of.nMaxFile=500;
of.lpstrTitle="Hello";
of.Flags = OFN_FILEMUSTEXIST;
ShowCursor(TRUE);
BOOL file = GetOpenFileName(&of);
if (file)
@@ -526,6 +526,7 @@ bool DataModelInstance::getOpen()
_loadedFileName = of.lpstrFile;
load(of.lpstrFile,true);
}
//else MessageBox(NULL, "Failed to open dialog", "Failure", MB_ICONHAND | MB_OK);
return true;
}
void DataModelInstance::setMessage(std::string msg)

View File

@@ -1,4 +1,3 @@
#define WINVER 0x0400
#include <G3DAll.h>
#include "DataModelV2/Instance.h"

View File

@@ -279,6 +279,7 @@ void PartInstance::render(RenderDevice* rd) {
changed=false;
Vector3 renderSize = size/2;
glNewList(glList, GL_COMPILE);
//glScalef(0.5f,0.5f,0.5f);
renderShape(this->shape, renderSize, color);
renderSurface(TOP, this->top, renderSize, this->controller, color);
renderSurface(FRONT, this->front, renderSize, this->controller, color);

View File

@@ -69,6 +69,30 @@ void ArrowTool::onKeyDown(int key)
{
lctrlDown = true;
}
else if(key == 'R')
{
if(g_selectedInstances.size() > 0)
{
Instance* selectedInstance = g_selectedInstances.at(0);
AudioPlayer::playSound(clickSound);
if(PartInstance* part = dynamic_cast<PartInstance*>(selectedInstance))
{
part->setCFrame(part->getCFrame()*Matrix3::fromEulerAnglesXYZ(0,toRadians(90),0));
}
}
}
else if(key == 'T')
{
if(g_selectedInstances.size() > 0)
{
Instance* selectedInstance = g_selectedInstances.at(0);
AudioPlayer::playSound(clickSound);
if(PartInstance* part = dynamic_cast<PartInstance*>(selectedInstance))
{
part->setCFrame(part->getCFrame()*Matrix3::fromEulerAnglesXYZ(0,0,toRadians(90)));
}
}
}
}
void ArrowTool::onKeyUp(int key)

View File

@@ -1,9 +1,5 @@
// TODO: Move toolbar buttons with resized window.
#define _WIN32_WINNT 0x0400
#define _WIN32_WINDOWS 0x0400
#define WINVER 0x0400
#define _CRTBLD
#include "winver.h"
#include "resource.h"
#include "Application.h"
#include "WindowFunctions.h"
@@ -148,7 +144,9 @@ LRESULT CALLBACK G3DProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
int main(int argc, char** argv) {
#ifndef IGNORE_CATCH
try{
#endif
hresult = OleInitialize(NULL);
/* IInternetSecurityManager *pSecurityMgr;
@@ -173,7 +171,7 @@ int main(int argc, char** argv) {
icc.dwSize = sizeof(icc);
icc.dwICC = ICC_WIN95_CLASSES/*|ICC_COOL_CLASSES|ICC_DATE_CLASSES|
ICC_PAGESCROLLER_CLASS|ICC_USEREX_CLASSES*/;
// ICC_PAGESCROLLER_CLASS|ICC_USEREX_CLASSES*/;
InitCommonControlsEx(&icc);
AudioPlayer::init();
@@ -214,10 +212,12 @@ int main(int argc, char** argv) {
Globals::mainHwnd = hwndMain;
Application app = Application(hwndMain);
app.run();
#ifndef IGNORE_CATCH
}
catch(...)
{
OnError(-1);
}
#endif
return 0;
}

View File

@@ -31,13 +31,12 @@
//DWM 1.9: Suppress POCC Warning "Argument x to 'sscanf' does not match the format string;
// expected 'unsigned char *' but found 'unsigned long'"
#include "winver.h"
#ifdef __POCC__
#pragma warn(disable:2234)
#endif
#ifndef _WIN32_WINNT // Necessary for WM_MOUSEWHEEL support
#define _WIN32_WINNT 0x0400
#endif
// MSVC++ Support
#ifndef _CRT_SECURE_NO_WARNINGS