diff --git a/Dialogs.rc b/Dialogs.rc index e0c0b01..b4c19ae 100644 --- a/Dialogs.rc +++ b/Dialogs.rc @@ -5,7 +5,7 @@ #include #include #include -#include "resource.h" +#include "src/include/resource.h" //Should not have to do this... diff --git a/G3DTest.vcproj b/G3DTest.vcproj index 036c122..6ef896f 100644 --- a/G3DTest.vcproj +++ b/G3DTest.vcproj @@ -144,6 +144,7 @@ - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -420,198 +405,198 @@ Filter="h;hpp;hxx;hm;inl" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ShapeRenderer.cpp b/ShapeRenderer.cpp deleted file mode 100644 index c79b846..0000000 --- a/ShapeRenderer.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "ShapeRenderer.h" - -ShapeRenderer::ShapeRenderer(void) -{ -} - -ShapeRenderer::~ShapeRenderer(void) -{ -} diff --git a/main.cpp b/main.cpp deleted file mode 100644 index 5719ef4..0000000 --- a/main.cpp +++ /dev/null @@ -1,248 +0,0 @@ -/** - Licensed under GPLv2 - Based on G3D 6.10 © 2000-2006 Morgan McGuire. - */ - -// TODO: Move toolbar buttons with resized window. - - -#define _WIN32_WINNT 0x0400 -#define _WIN32_WINDOWS 0x0400 -#define WINVER 0x0400 - -#include -#include -#include -#include "Instance.h" -#include "resource.h" -#include "PartInstance.h" -#include "TextButtonInstance.h" -#include "ImageButtonInstance.h" -#include "DataModelInstance.h" -#include "CameraController.h" -#include "AudioPlayer.h" -#include "Globals.h" -#include "Application.h" -#include "win32Defines.h" -#include "WindowFunctions.h" -#include -#include -#include -#include -#include -#include "ax.h" -#include -#include "IEBrowser.h" -#include "PropertyWindow.h" -#include -#include "ErrorFunctions.h" - -#if G3D_VER < 61000 - #error Requires G3D 6.10 -#endif -HWND hwnd; - -HRESULT hresult; -OLECHAR dat = ((OLECHAR)"SayHello"); -OLECHAR * szMember = &dat; -DISPID dispid; -DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0}; -EXCEPINFO excepinfo; -UINT nArgErr; - -LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - Application *app = (Application *)GetWindowLongPtr(hwnd, GWL_USERDATA); - if (app==NULL) - { - return DefWindowProc(hwnd, msg, wParam, lParam); - } - switch(msg) - { - case WM_KEYDOWN: - if ((HIWORD(lParam)&0x4000)==0) // single key press - { - app->onKeyPressed(wParam); - } - break; - case WM_KEYUP: - { - app->onKeyUp(wParam); - } - break; - case WM_MOUSEWHEEL: - app->onMouseWheel(LOWORD(lParam),HIWORD(lParam),HIWORD(wParam)); - break; - case WM_SIZE: - app->resizeWithParent(hwnd); - break; - case WM_ACTIVATE: - if(wParam > WA_INACTIVE) app->setFocus(false); - else app->setFocus(true); - default: - { - return DefWindowProc(hwnd, msg, wParam, lParam); - } - } - return 0; -} - -LRESULT CALLBACK ToolboxProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - //Application *app = (Application *)GetWindowLongPtr(hwnd, GWL_USERDATA); - MessageBox(NULL, (LPCSTR)wParam, (LPCSTR)lParam, 1); - //if (app==NULL) - //{ - //return DefWindowProc(hwnd, msg, wParam, lParam); - //} - switch(msg) - { - case WM_SIZE: - break; - default: - { - return DefWindowProc(hwnd, msg, wParam, lParam); - } - } - return 0; -} - -LRESULT CALLBACK G3DProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - Application *app = (Application *)GetWindowLongPtr(hwnd, GWL_USERDATA); - if (app==NULL) - { - return DefWindowProc(hwnd, msg, wParam, lParam); - } - switch(msg) - { - case WM_QUIT: - app->QuitApp(); - break; - case WM_DESTROY: - app->QuitApp(); - break; - case WM_LBUTTONDOWN: - app->onMouseLeftPressed(hwnd,LOWORD(lParam),HIWORD(lParam)); - break; - case WM_LBUTTONUP: - app->onMouseLeftUp(app->getRenderDevice(),LOWORD(lParam),HIWORD(lParam)); - break; - case WM_RBUTTONDOWN: - app->onMouseRightPressed(LOWORD(lParam),HIWORD(lParam)); - break; - case WM_RBUTTONUP: - app->onMouseRightUp(LOWORD(lParam),HIWORD(lParam)); - break; - case WM_MOUSEMOVE: - app->onMouseMoved(LOWORD(lParam),HIWORD(lParam)); - break; - case WM_KEYDOWN: - if ((HIWORD(lParam)&0x4000)==0) // single key press - { - app->onKeyPressed(wParam); - } - break; - case WM_KEYUP: - { - app->onKeyUp(wParam); - } - break; - case WM_SYSKEYDOWN: - if ((HIWORD(lParam)&0x4000)==0) // single key press - { - app->onKeyPressed(wParam); - } - break; - case WM_SYSKEYUP: - { - app->onKeyUp(wParam); - } - case WM_SIZE: - { - app->onGraphics(app->getRenderDevice()); - } - break; - default: - { - return DefWindowProc(hwnd, msg, wParam, lParam); - } - } - - return 0; -} - -int main(int argc, char** argv) { - try{ - hresult = OleInitialize(NULL); - -/* IInternetSecurityManager *pSecurityMgr; - IInternetZoneManager *pZoneMgr; - LPCWSTR site1 = SysAllocString(L"http://www.androdome.com"); - - hr = CoCreateInstance(CLSID_InternetSecurityManager, NULL, CLSCTX_INPROC_SERVER, IID_IInternetSecurityManager, (void**)&pSecurityMgr); - - pSecurityMgr->SetZoneMapping((DWORD)2, site1, (DWORD)0); // 2 = Trusted Site, site1 is the URL to add, and 0 is to create the entry. -*/ - - - - if (!AXRegister()) - return 0; - - - INITCOMMONCONTROLSEX icc; -// WNDCLASSEX wcx; - - /* Initialize common controls. Also needed for MANIFEST's */ - - icc.dwSize = sizeof(icc); - icc.dwICC = ICC_WIN95_CLASSES/*|ICC_COOL_CLASSES|ICC_DATE_CLASSES| - ICC_PAGESCROLLER_CLASS|ICC_USEREX_CLASSES*/; - InitCommonControlsEx(&icc); - - AudioPlayer::init(); - /* GAppSettings settings; - settings.window.resizable = true; - settings.writeLicenseFile = false; - settings.window.center = true; */ - HMODULE hThisInstance = GetModuleHandle(NULL); - - if (!createWindowClass("mainHWND",WndProc,hThisInstance)) - return false; - if (!createWindowClass("toolboxHWND",ToolboxProc,hThisInstance)) - return false; - if (!createWindowClass("G3DWindow",G3DProc,hThisInstance)) - return false; - - HWND hwndMain = CreateWindowEx( - WS_EX_ACCEPTFILES, - "mainHWND", - "Main test", - WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, - CW_USEDEFAULT, - 800, - 660, - NULL, // parent - NULL, // menu - hThisInstance, - NULL - ); - if(hwndMain == NULL) - { - MessageBox(NULL, "Critical error loading: Failed to create HWND, must exit", (g_PlaceholderName + " Crash").c_str() , MB_OK); - return 0; - } - SendMessage(hwndMain, WM_SETICON, ICON_BIG,(LPARAM)LoadImage(GetModuleHandle(NULL), (LPCSTR)MAKEINTRESOURCEW(IDI_ICON1), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR | LR_DEFAULTSIZE)); - - - Application app = Application(hwndMain); - app.run(); - } - catch(...) - { - OnError(-1); - } - return 0; -} diff --git a/Application.h b/src/include/Application.h similarity index 96% rename from Application.h rename to src/include/Application.h index c33f121..b9529f9 100644 --- a/Application.h +++ b/src/include/Application.h @@ -1,12 +1,12 @@ #pragma once #include #include "PropertyWindow.h" -#include "TextButtonInstance.h" -#include "ImageButtonInstance.h" +#include "DataModel/TextButtonInstance.h" +#include "DataModel/ImageButtonInstance.h" #include "CameraController.h" #include "IEBrowser.h" #include "Mouse.h" -#include "Tool.h" +#include "Tool/Tool.h" //#include "GuiRoot.h" class TextButtonInstance; diff --git a/AudioPlayer.h b/src/include/AudioPlayer.h similarity index 100% rename from AudioPlayer.h rename to src/include/AudioPlayer.h diff --git a/BrowserCallHandler.h b/src/include/BrowserCallHandler.h similarity index 100% rename from BrowserCallHandler.h rename to src/include/BrowserCallHandler.h diff --git a/CameraController.h b/src/include/CameraController.h similarity index 96% rename from CameraController.h rename to src/include/CameraController.h index 88216ba..162adb7 100644 --- a/CameraController.h +++ b/src/include/CameraController.h @@ -1,7 +1,7 @@ #pragma once #include -#include "Instance.h" +#include "DataModel/Instance.h" #include "Globals.h" #include diff --git a/BaseButtonInstance.h b/src/include/DataModel/BaseButtonInstance.h similarity index 91% rename from BaseButtonInstance.h rename to src/include/DataModel/BaseButtonInstance.h index 3b3cb82..cd24eb8 100644 --- a/BaseButtonInstance.h +++ b/src/include/DataModel/BaseButtonInstance.h @@ -1,6 +1,6 @@ #pragma once -#include "instance.h" -#include "ButtonListener.h" +#include "Instance.h" +#include "Listener/ButtonListener.h" class ButtonListener; class Instance; diff --git a/DataModelInstance.h b/src/include/DataModel/DataModelInstance.h similarity index 92% rename from DataModelInstance.h rename to src/include/DataModel/DataModelInstance.h index c143a05..fb0d19a 100644 --- a/DataModelInstance.h +++ b/src/include/DataModel/DataModelInstance.h @@ -3,9 +3,9 @@ #include "LevelInstance.h" #include "PartInstance.h" #include "rapidxml/rapidxml.hpp" -#include "GuiRoot.h" +#include "GuiRootInstance.h" -class GuiRoot; +class GuiRootInstance; class DataModelInstance : public Instance @@ -27,7 +27,7 @@ public: std::string _loadedFileName; bool showMessage; G3D::GFontRef font; - GuiRoot* getGuiRoot(); + GuiRootInstance* getGuiRoot(); //float mousex; //float mousey; //Vector2 getMousePos(); @@ -52,6 +52,6 @@ private: float _modY; WorkspaceInstance* workspace; LevelInstance * level; - GuiRoot* guiRoot; + GuiRootInstance* guiRoot; bool running; }; diff --git a/GroupInstance.h b/src/include/DataModel/GroupInstance.h similarity index 100% rename from GroupInstance.h rename to src/include/DataModel/GroupInstance.h diff --git a/GuiRoot.h b/src/include/DataModel/GuiRootInstance.h similarity index 87% rename from GuiRoot.h rename to src/include/DataModel/GuiRootInstance.h index a19339f..5f916d0 100644 --- a/GuiRoot.h +++ b/src/include/DataModel/GuiRootInstance.h @@ -5,11 +5,11 @@ class ImageButtonInstance; class TextButtonInstance; -class GuiRoot : public Instance +class GuiRootInstance : public Instance { public: - GuiRoot(); - GuiRoot::~GuiRoot(); + GuiRootInstance(); + GuiRootInstance::~GuiRootInstance(); TextButtonInstance* makeTextButton(); void drawButtons(RenderDevice* rd); ImageButtonInstance* makeImageButton(G3D::TextureRef newImage, G3D::TextureRef overImage, G3D::TextureRef downImage, G3D::TextureRef disableImage); diff --git a/ImageButtonInstance.h b/src/include/DataModel/ImageButtonInstance.h similarity index 100% rename from ImageButtonInstance.h rename to src/include/DataModel/ImageButtonInstance.h diff --git a/Instance.h b/src/include/DataModel/Instance.h similarity index 100% rename from Instance.h rename to src/include/DataModel/Instance.h diff --git a/LevelInstance.h b/src/include/DataModel/LevelInstance.h similarity index 100% rename from LevelInstance.h rename to src/include/DataModel/LevelInstance.h diff --git a/PVInstance.h b/src/include/DataModel/PVInstance.h similarity index 100% rename from PVInstance.h rename to src/include/DataModel/PVInstance.h diff --git a/PartInstance.h b/src/include/DataModel/PartInstance.h similarity index 100% rename from PartInstance.h rename to src/include/DataModel/PartInstance.h diff --git a/TextButtonInstance.h b/src/include/DataModel/TextButtonInstance.h similarity index 100% rename from TextButtonInstance.h rename to src/include/DataModel/TextButtonInstance.h diff --git a/ToggleImageButtonInstance.h b/src/include/DataModel/ToggleImageButtonInstance.h similarity index 100% rename from ToggleImageButtonInstance.h rename to src/include/DataModel/ToggleImageButtonInstance.h diff --git a/WorkspaceInstance.h b/src/include/DataModel/WorkspaceInstance.h similarity index 100% rename from WorkspaceInstance.h rename to src/include/DataModel/WorkspaceInstance.h diff --git a/Enum.h b/src/include/Enum.h similarity index 100% rename from Enum.h rename to src/include/Enum.h diff --git a/Enums.h b/src/include/Enums.h similarity index 100% rename from Enums.h rename to src/include/Enums.h diff --git a/ErrorFunctions.h b/src/include/ErrorFunctions.h similarity index 100% rename from ErrorFunctions.h rename to src/include/ErrorFunctions.h diff --git a/Globals.h b/src/include/Globals.h similarity index 95% rename from Globals.h rename to src/include/Globals.h index bf0c991..9b6c960 100644 --- a/Globals.h +++ b/src/include/Globals.h @@ -1,5 +1,5 @@ #pragma once -#include "DataModelInstance.h" +#include "DataModel/DataModelInstance.h" class Application; diff --git a/IEBrowser.h b/src/include/IEBrowser.h similarity index 100% rename from IEBrowser.h rename to src/include/IEBrowser.h diff --git a/IEDispatcher.h b/src/include/IEDispatcher.h similarity index 100% rename from IEDispatcher.h rename to src/include/IEDispatcher.h diff --git a/ButtonListener.h b/src/include/Listener/ButtonListener.h similarity index 92% rename from ButtonListener.h rename to src/include/Listener/ButtonListener.h index b334c63..4ac7aa2 100644 --- a/ButtonListener.h +++ b/src/include/Listener/ButtonListener.h @@ -1,6 +1,6 @@ #pragma once //#include "Application.h" -#include "BaseButtonInstance.h" +#include "DataModel/BaseButtonInstance.h" class BaseButtonInstance; diff --git a/CameraButtonListener.h b/src/include/Listener/CameraButtonListener.h similarity index 100% rename from CameraButtonListener.h rename to src/include/Listener/CameraButtonListener.h diff --git a/DeleteListener.h b/src/include/Listener/DeleteListener.h similarity index 100% rename from DeleteListener.h rename to src/include/Listener/DeleteListener.h diff --git a/GUDButtonListener.h b/src/include/Listener/GUDButtonListener.h similarity index 100% rename from GUDButtonListener.h rename to src/include/Listener/GUDButtonListener.h diff --git a/MenuButtonListener.h b/src/include/Listener/MenuButtonListener.h similarity index 100% rename from MenuButtonListener.h rename to src/include/Listener/MenuButtonListener.h diff --git a/ModeSelectionListener.h b/src/include/Listener/ModeSelectionListener.h similarity index 100% rename from ModeSelectionListener.h rename to src/include/Listener/ModeSelectionListener.h diff --git a/RotateButtonListener.h b/src/include/Listener/RotateButtonListener.h similarity index 100% rename from RotateButtonListener.h rename to src/include/Listener/RotateButtonListener.h diff --git a/ToolbarListener.h b/src/include/Listener/ToolbarListener.h similarity index 100% rename from ToolbarListener.h rename to src/include/Listener/ToolbarListener.h diff --git a/Mouse.h b/src/include/Mouse.h similarity index 88% rename from Mouse.h rename to src/include/Mouse.h index 929fbf6..7ff08cf 100644 --- a/Mouse.h +++ b/src/include/Mouse.h @@ -1,7 +1,7 @@ #pragma once -#include "PartInstance.h" +#include "DataModel/PartInstance.h" #pragma once -#include "WorkspaceInstance.h" +#include "DataModel/WorkspaceInstance.h" struct MousePoint{ Vector3 position; diff --git a/PropertyWindow.h b/src/include/PropertyWindow.h similarity index 92% rename from PropertyWindow.h rename to src/include/PropertyWindow.h index 6495ad8..53c5862 100644 --- a/PropertyWindow.h +++ b/src/include/PropertyWindow.h @@ -1,5 +1,5 @@ #pragma once -#include "Instance.h" +#include "DataModel/Instance.h" class PropertyWindow { public: diff --git a/StringFunctions.h b/src/include/StringFunctions.h similarity index 100% rename from StringFunctions.h rename to src/include/StringFunctions.h diff --git a/TextureHandler.h b/src/include/TextureHandler.h similarity index 100% rename from TextureHandler.h rename to src/include/TextureHandler.h diff --git a/ArrowTool.h b/src/include/Tool/ArrowTool.h similarity index 100% rename from ArrowTool.h rename to src/include/Tool/ArrowTool.h diff --git a/Tool.h b/src/include/Tool/Tool.h similarity index 100% rename from Tool.h rename to src/include/Tool/Tool.h diff --git a/WindowFunctions.h b/src/include/WindowFunctions.h similarity index 100% rename from WindowFunctions.h rename to src/include/WindowFunctions.h diff --git a/ax.h b/src/include/ax.h similarity index 100% rename from ax.h rename to src/include/ax.h diff --git a/propertyGrid.h b/src/include/propertyGrid.h similarity index 100% rename from propertyGrid.h rename to src/include/propertyGrid.h diff --git a/rapidxml/license.txt b/src/include/rapidxml/license.txt similarity index 100% rename from rapidxml/license.txt rename to src/include/rapidxml/license.txt diff --git a/rapidxml/manual.html b/src/include/rapidxml/manual.html similarity index 100% rename from rapidxml/manual.html rename to src/include/rapidxml/manual.html diff --git a/rapidxml/rapidxml.hpp b/src/include/rapidxml/rapidxml.hpp similarity index 100% rename from rapidxml/rapidxml.hpp rename to src/include/rapidxml/rapidxml.hpp diff --git a/rapidxml/rapidxml_iterators.hpp b/src/include/rapidxml/rapidxml_iterators.hpp similarity index 100% rename from rapidxml/rapidxml_iterators.hpp rename to src/include/rapidxml/rapidxml_iterators.hpp diff --git a/rapidxml/rapidxml_print.hpp b/src/include/rapidxml/rapidxml_print.hpp similarity index 100% rename from rapidxml/rapidxml_print.hpp rename to src/include/rapidxml/rapidxml_print.hpp diff --git a/rapidxml/rapidxml_utils.hpp b/src/include/rapidxml/rapidxml_utils.hpp similarity index 100% rename from rapidxml/rapidxml_utils.hpp rename to src/include/rapidxml/rapidxml_utils.hpp diff --git a/resource.h b/src/include/resource.h similarity index 100% rename from resource.h rename to src/include/resource.h diff --git a/win32Defines.h b/src/include/win32Defines.h similarity index 100% rename from win32Defines.h rename to src/include/win32Defines.h diff --git a/Application.cpp b/src/source/Application.cpp similarity index 97% rename from Application.cpp rename to src/source/Application.cpp index de15824..4d9176f 100644 --- a/Application.cpp +++ b/src/source/Application.cpp @@ -1,12 +1,13 @@ #include #include #include -#include "Instance.h" #include "resource.h" -#include "PartInstance.h" -#include "TextButtonInstance.h" -#include "ImageButtonInstance.h" -#include "DataModelInstance.h" +#include "DataModel/Instance.h" +#include "DataModel/PartInstance.h" +#include "DataModel/TextButtonInstance.h" +#include "DataModel/ImageButtonInstance.h" +#include "DataModel/DataModelInstance.h" +#include "DataModel/GuiRootInstance.h" #include "CameraController.h" #include "AudioPlayer.h" #include "Globals.h" @@ -23,14 +24,13 @@ #include "PropertyWindow.h" #include #include "StringFunctions.h" -#include "GuiRoot.h" -#include "GUDButtonListener.h" -#include "ModeSelectionListener.h" -#include "DeleteListener.h" -#include "CameraButtonListener.h" -#include "RotateButtonListener.h" -//#define LEGACY_LOAD_G3DFUN_LEVEL +#include "Listener/GUDButtonListener.h" +#include "Listener/ModeSelectionListener.h" +#include "Listener/DeleteListener.h" +#include "Listener/CameraButtonListener.h" +#include "Listener/RotateButtonListener.h" +#define LEGACY_LOAD_G3DFUN_LEVEL //Ray testRay; //static int cursorid = 0; //static int cursorOvrid = 0; @@ -709,9 +709,7 @@ void Application::onGraphics(RenderDevice* rd) { rd->afterPrimitive(); - - - Draw::sphere(G3D::Sphere(mouse.getPosition(), 1), rd, Color3::cyan(), Color4::clear()); + Draw::box(G3D::Box(mouse.getPosition()-Vector3(2,0.5F,1),mouse.getPosition()+Vector3(2,0.5F,1)), rd, Color3::cyan(), Color4::clear()); if(g_selectedInstances.size() > 0) { for(size_t i = 0; i < g_selectedInstances.size(); i++) diff --git a/AudioPlayer.cpp b/src/source/AudioPlayer.cpp similarity index 100% rename from AudioPlayer.cpp rename to src/source/AudioPlayer.cpp diff --git a/BrowserCallHandler.cpp b/src/source/BrowserCallHandler.cpp similarity index 100% rename from BrowserCallHandler.cpp rename to src/source/BrowserCallHandler.cpp diff --git a/CameraController.cpp b/src/source/CameraController.cpp similarity index 99% rename from CameraController.cpp rename to src/source/CameraController.cpp index 7e4a3cc..d8a4fdb 100644 --- a/CameraController.cpp +++ b/src/source/CameraController.cpp @@ -1,7 +1,7 @@ #include "CameraController.h" #include "win32Defines.h" #include -#include "PartInstance.h" +#include "DataModel/PartInstance.h" #include "Application.h" #include "AudioPlayer.h" diff --git a/BaseButtonInstance.cpp b/src/source/DataModel/BaseButtonInstance.cpp similarity index 96% rename from BaseButtonInstance.cpp rename to src/source/DataModel/BaseButtonInstance.cpp index 2df06ef..0ccd0c8 100644 --- a/BaseButtonInstance.cpp +++ b/src/source/DataModel/BaseButtonInstance.cpp @@ -1,4 +1,4 @@ -#include "BaseButtonInstance.h" +#include "DataModel/BaseButtonInstance.h" #include "Globals.h" #include "Application.h" diff --git a/DataModelInstance.cpp b/src/source/DataModel/DataModelInstance.cpp similarity index 99% rename from DataModelInstance.cpp rename to src/source/DataModel/DataModelInstance.cpp index c3a4b25..1ac2fdc 100644 --- a/DataModelInstance.cpp +++ b/src/source/DataModel/DataModelInstance.cpp @@ -1,6 +1,6 @@ #include -#include "GuiRoot.h" -#include "DataModelInstance.h" +#include "DataModel/GuiRootInstance.h" +#include "DataModel/DataModelInstance.h" #include #include #include @@ -15,7 +15,7 @@ DataModelInstance::DataModelInstance(void) { Instance::Instance(); workspace = new WorkspaceInstance(); - guiRoot = new GuiRoot(); + guiRoot = new GuiRootInstance(); level = new LevelInstance(); //children.push_back(workspace); //children.push_back(level); @@ -601,7 +601,7 @@ void DataModelInstance::setMousePos(Vector2 pos) mousex=pos.x; mousey=pos.y; }*/ -GuiRoot* DataModelInstance::getGuiRoot() +GuiRootInstance* DataModelInstance::getGuiRoot() { return guiRoot; } diff --git a/GroupInstance.cpp b/src/source/DataModel/GroupInstance.cpp similarity index 97% rename from GroupInstance.cpp rename to src/source/DataModel/GroupInstance.cpp index 908e99f..959e191 100644 --- a/GroupInstance.cpp +++ b/src/source/DataModel/GroupInstance.cpp @@ -1,4 +1,4 @@ -#include "GroupInstance.h" +#include "DataModel/GroupInstance.h" GroupInstance::GroupInstance(void) { diff --git a/GuiRoot.cpp b/src/source/DataModel/GuiRootInstance.cpp similarity index 93% rename from GuiRoot.cpp rename to src/source/DataModel/GuiRootInstance.cpp index 4bef3a1..386ebc8 100644 --- a/GuiRoot.cpp +++ b/src/source/DataModel/GuiRootInstance.cpp @@ -1,25 +1,25 @@ #include #include #include "G3DAll.h" -#include "BaseButtonInstance.h" -#include "TextButtonInstance.h" -#include "ImageButtonInstance.h" -#include "ToggleImageButtonInstance.h" -#include "GuiRoot.h" +#include "DataModel/BaseButtonInstance.h" +#include "DataModel/TextButtonInstance.h" +#include "DataModel/ImageButtonInstance.h" +#include "DataModel/ToggleImageButtonInstance.h" +#include "DataModel/GuiRootInstance.h" +#include "DataModel/ImageButtonInstance.h" #include "Globals.h" #include "StringFunctions.h" -#include "GUDButtonListener.h" -#include "ModeSelectionListener.h" -#include "MenuButtonListener.h" -#include "RotateButtonListener.h" -#include "CameraButtonListener.h" -#include "DeleteListener.h" -#include "ToolbarListener.h" +#include "Listener/GUDButtonListener.h" +#include "Listener/ModeSelectionListener.h" +#include "Listener/MenuButtonListener.h" +#include "Listener/RotateButtonListener.h" +#include "Listener/CameraButtonListener.h" +#include "Listener/DeleteListener.h" +#include "Listener/ToolbarListener.h" -#include "ImageButtonInstance.h" -ImageButtonInstance* GuiRoot::makeImageButton(G3D::TextureRef newImage = NULL, G3D::TextureRef overImage = NULL, G3D::TextureRef downImage = NULL, G3D::TextureRef disableImage = NULL) +ImageButtonInstance* GuiRootInstance::makeImageButton(G3D::TextureRef newImage = NULL, G3D::TextureRef overImage = NULL, G3D::TextureRef downImage = NULL, G3D::TextureRef disableImage = NULL) { ImageButtonInstance* part = new ImageButtonInstance(newImage,overImage, downImage, disableImage); // instances.push_back(part); @@ -27,13 +27,13 @@ ImageButtonInstance* GuiRoot::makeImageButton(G3D::TextureRef newImage = NULL, G return part; } -TextButtonInstance* GuiRoot::makeTextButton() +TextButtonInstance* GuiRootInstance::makeTextButton() { TextButtonInstance* part = new TextButtonInstance(); return part; } ToolbarListener * toolbar; -GuiRoot::GuiRoot() : _message(""), _messageTime(0) +GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0) { toolbar = new ToolbarListener(); toolbar->doDelete = false; @@ -409,7 +409,7 @@ GuiRoot::GuiRoot() : _message(""), _messageTime(0) } -void GuiRoot::drawButtons(RenderDevice* rd) +void GuiRootInstance::drawButtons(RenderDevice* rd) { rd->pushState(); rd->beforePrimitive(); @@ -418,15 +418,15 @@ void GuiRoot::drawButtons(RenderDevice* rd) rd->popState(); } -void GuiRoot::setDebugMessage(std::string msg, G3D::RealTime msgTime) +void GuiRootInstance::setDebugMessage(std::string msg, G3D::RealTime msgTime) { _messageTime = msgTime; _message = msg; } -//void GuiRoot::render(G3D::RenderDevice* renderDevice) {} +//void GuiRootInstance::render(G3D::RenderDevice* renderDevice) {} -void GuiRoot::renderGUI(G3D::RenderDevice* rd, double fps) +void GuiRootInstance::renderGUI(G3D::RenderDevice* rd, double fps) { //TODO--Move these to their own instance @@ -463,7 +463,7 @@ void GuiRoot::renderGUI(G3D::RenderDevice* rd, double fps) render(rd); } -bool GuiRoot::mouseInGUI(G3D::RenderDevice* renderDevice,int x,int y) +bool GuiRootInstance::mouseInGUI(G3D::RenderDevice* renderDevice,int x,int y) { std::vector instances_2D = g_dataModel->getGuiRoot()->getAllChildren(); for(size_t i = 0; i < instances_2D.size(); i++) @@ -479,7 +479,7 @@ bool GuiRoot::mouseInGUI(G3D::RenderDevice* renderDevice,int x,int y) return false; } -void GuiRoot::update() +void GuiRootInstance::update() { Instance * obj6 = this->findFirstChild("Delete"); Instance * obj = this->findFirstChild("Duplicate"); @@ -515,12 +515,12 @@ void GuiRoot::update() } } -GuiRoot::~GuiRoot() +GuiRootInstance::~GuiRootInstance() { delete toolbar; } -void GuiRoot::onMouseLeftUp(G3D::RenderDevice* renderDevice, int x,int y) +void GuiRootInstance::onMouseLeftUp(G3D::RenderDevice* renderDevice, int x,int y) { std::vector instances_2D = this->getAllChildren(); for(size_t i = 0; i < instances_2D.size(); i++) diff --git a/ImageButtonInstance.cpp b/src/source/DataModel/ImageButtonInstance.cpp similarity index 98% rename from ImageButtonInstance.cpp rename to src/source/DataModel/ImageButtonInstance.cpp index e0fc785..f57ef47 100644 --- a/ImageButtonInstance.cpp +++ b/src/source/DataModel/ImageButtonInstance.cpp @@ -1,4 +1,4 @@ -#include "ImageButtonInstance.h" +#include "DataModel/ImageButtonInstance.h" ImageButtonInstance::ImageButtonInstance(G3D::TextureRef newImage, G3D::TextureRef overImage = NULL, G3D::TextureRef downImage = NULL, G3D::TextureRef disableImage = NULL) { diff --git a/Instance.cpp b/src/source/DataModel/Instance.cpp similarity index 98% rename from Instance.cpp rename to src/source/DataModel/Instance.cpp index 37bbcf7..a74a1aa 100644 --- a/Instance.cpp +++ b/src/source/DataModel/Instance.cpp @@ -1,6 +1,6 @@ #define WINVER 0x0400 #include -#include "Instance.h" +#include "DataModel/Instance.h" diff --git a/LevelInstance.cpp b/src/source/DataModel/LevelInstance.cpp similarity index 97% rename from LevelInstance.cpp rename to src/source/DataModel/LevelInstance.cpp index de4463b..5d0fdb2 100644 --- a/LevelInstance.cpp +++ b/src/source/DataModel/LevelInstance.cpp @@ -1,4 +1,4 @@ -#include "LevelInstance.h" +#include "DataModel/LevelInstance.h" LevelInstance::LevelInstance(void) { diff --git a/PVInstance.cpp b/src/source/DataModel/PVInstance.cpp similarity index 94% rename from PVInstance.cpp rename to src/source/DataModel/PVInstance.cpp index 5dc627c..8bdf6af 100644 --- a/PVInstance.cpp +++ b/src/source/DataModel/PVInstance.cpp @@ -1,4 +1,4 @@ -#include "PVInstance.h" +#include "DataModel/PVInstance.h" PVInstance::PVInstance(void) { @@ -42,6 +42,7 @@ static TCHAR* enumStr(int controller) case Enum::Controller::Flee: return "Joypad2"; } + return "None"; } static Enum::Controller::Value strEnum(TCHAR * tval) @@ -93,11 +94,11 @@ void PVInstance::PropUpdate(LPPROPGRIDITEM &pItem) { if(strcmp(pItem->lpszPropName, "NameShown") == 0) { - nameShown = (bool)pItem->lpCurValue; + nameShown = pItem->lpCurValue == TRUE; } if(strcmp(pItem->lpszPropName, "ControllerFlagShown") == 0) { - controllerFlagShown = (bool)pItem->lpCurValue; + controllerFlagShown = pItem->lpCurValue == TRUE; } if(strcmp(pItem->lpszPropName, "Controller") == 0) { diff --git a/PartInstance.cpp b/src/source/DataModel/PartInstance.cpp similarity index 99% rename from PartInstance.cpp rename to src/source/DataModel/PartInstance.cpp index bf84982..b8760ac 100644 --- a/PartInstance.cpp +++ b/src/source/DataModel/PartInstance.cpp @@ -1,4 +1,4 @@ -#include "PartInstance.h" +#include "DataModel/PartInstance.h" #include "Globals.h" #include #include @@ -1005,7 +1005,7 @@ void PartInstance::PropUpdate(LPPROPGRIDITEM &item) } if(strcmp(item->lpszPropName, "Anchored") == 0) { - anchored=(bool)item->lpCurValue; + anchored= item->lpCurValue == TRUE; changed=true; } else if(strcmp(item->lpszPropName, "Offset") == 0) diff --git a/TextButtonInstance.cpp b/src/source/DataModel/TextButtonInstance.cpp similarity index 98% rename from TextButtonInstance.cpp rename to src/source/DataModel/TextButtonInstance.cpp index 1529128..ae73feb 100644 --- a/TextButtonInstance.cpp +++ b/src/source/DataModel/TextButtonInstance.cpp @@ -1,4 +1,4 @@ -#include "TextButtonInstance.h" +#include "DataModel/TextButtonInstance.h" TextButtonInstance::TextButtonInstance(void) diff --git a/ToggleImageButtonInstance.cpp b/src/source/DataModel/ToggleImageButtonInstance.cpp similarity index 98% rename from ToggleImageButtonInstance.cpp rename to src/source/DataModel/ToggleImageButtonInstance.cpp index f59fdac..b14f794 100644 --- a/ToggleImageButtonInstance.cpp +++ b/src/source/DataModel/ToggleImageButtonInstance.cpp @@ -1,4 +1,4 @@ -#include "ToggleImageButtonInstance.h" +#include "DataModel/ToggleImageButtonInstance.h" ToggleImageButtonInstance::ToggleImageButtonInstance(G3D::TextureRef newImage, G3D::TextureRef overImage, diff --git a/WorkspaceInstance.cpp b/src/source/DataModel/WorkspaceInstance.cpp similarity index 82% rename from WorkspaceInstance.cpp rename to src/source/DataModel/WorkspaceInstance.cpp index 47fceec..46b2fae 100644 --- a/WorkspaceInstance.cpp +++ b/src/source/DataModel/WorkspaceInstance.cpp @@ -1,4 +1,4 @@ -#include "WorkspaceInstance.h" +#include "DataModel/WorkspaceInstance.h" WorkspaceInstance::WorkspaceInstance(void) diff --git a/ErrorFunctions.cpp b/src/source/ErrorFunctions.cpp similarity index 100% rename from ErrorFunctions.cpp rename to src/source/ErrorFunctions.cpp diff --git a/Globals.cpp b/src/source/Globals.cpp similarity index 100% rename from Globals.cpp rename to src/source/Globals.cpp diff --git a/IEBrowser.cpp b/src/source/IEBrowser.cpp similarity index 98% rename from IEBrowser.cpp rename to src/source/IEBrowser.cpp index 5bf843c..cb42c00 100644 --- a/IEBrowser.cpp +++ b/src/source/IEBrowser.cpp @@ -62,7 +62,7 @@ HRESULT IEBrowser::doExternal(std::wstring funcName, { CHOOSECOLOR color; - DWORD rgbCurrent; //Will be dynamic later + DWORD rgbCurrent = 0xFFFFFFFF; //Will be dynamic later ZeroMemory(&color, sizeof(CHOOSECOLOR)); color.lStructSize = sizeof(color); color.hwndOwner = hwnd; diff --git a/IEDispatcher.cpp b/src/source/IEDispatcher.cpp similarity index 100% rename from IEDispatcher.cpp rename to src/source/IEDispatcher.cpp diff --git a/ButtonListener.cpp b/src/source/Listener/ButtonListener.cpp similarity index 68% rename from ButtonListener.cpp rename to src/source/Listener/ButtonListener.cpp index 7d1f9e9..74799f2 100644 --- a/ButtonListener.cpp +++ b/src/source/Listener/ButtonListener.cpp @@ -1,5 +1,5 @@ -#include "BaseButtonInstance.h" -#include "ButtonListener.h" +#include "DataModel/BaseButtonInstance.h" +#include "Listener/ButtonListener.h" ButtonListener::ButtonListener() diff --git a/CameraButtonListener.cpp b/src/source/Listener/CameraButtonListener.cpp similarity index 95% rename from CameraButtonListener.cpp rename to src/source/Listener/CameraButtonListener.cpp index 09a1bf0..08c3dd7 100644 --- a/CameraButtonListener.cpp +++ b/src/source/Listener/CameraButtonListener.cpp @@ -1,4 +1,4 @@ -#include "CameraButtonListener.h" +#include "Listener/CameraButtonListener.h" #include "Globals.h" #include "AudioPlayer.h" #include "Application.h" diff --git a/DeleteListener.cpp b/src/source/Listener/DeleteListener.cpp similarity index 80% rename from DeleteListener.cpp rename to src/source/Listener/DeleteListener.cpp index 9fd3c30..d76de77 100644 --- a/DeleteListener.cpp +++ b/src/source/Listener/DeleteListener.cpp @@ -1,4 +1,4 @@ -#include "DeleteListener.h" +#include "Listener/DeleteListener.h" #include "Globals.h" #include "Application.h" diff --git a/GUDButtonListener.cpp b/src/source/Listener/GUDButtonListener.cpp similarity index 98% rename from GUDButtonListener.cpp rename to src/source/Listener/GUDButtonListener.cpp index f493cad..4e00f43 100644 --- a/GUDButtonListener.cpp +++ b/src/source/Listener/GUDButtonListener.cpp @@ -2,7 +2,7 @@ #include "Application.h" #include "Globals.h" #include "AudioPlayer.h" -#include "GUDButtonListener.h" +#include "Listener/GUDButtonListener.h" void GUDButtonListener::onButton1MouseClick(BaseButtonInstance* button) { diff --git a/MenuButtonListener.cpp b/src/source/Listener/MenuButtonListener.cpp similarity index 72% rename from MenuButtonListener.cpp rename to src/source/Listener/MenuButtonListener.cpp index e3aab7b..fe585d3 100644 --- a/MenuButtonListener.cpp +++ b/src/source/Listener/MenuButtonListener.cpp @@ -1,5 +1,5 @@ -#include "MenuButtonListener.h" -#include "toggleimagebuttoninstance.h" +#include "Listener/MenuButtonListener.h" +#include "DataModel/ToggleImageButtonInstance.h" #include "Globals.h" void MenuButtonListener::onButton1MouseClick(BaseButtonInstance* button) { diff --git a/ModeSelectionListener.cpp b/src/source/Listener/ModeSelectionListener.cpp similarity index 89% rename from ModeSelectionListener.cpp rename to src/source/Listener/ModeSelectionListener.cpp index 9356155..336fbab 100644 --- a/ModeSelectionListener.cpp +++ b/src/source/Listener/ModeSelectionListener.cpp @@ -1,8 +1,8 @@ #include "Globals.h" -#include "Instance.h" -#include "ModeSelectionListener.h" +#include "DataModel/Instance.h" +#include "Listener/ModeSelectionListener.h" #include "Application.h" -#include "ArrowTool.h" +#include "Tool/ArrowTool.h" void ModeSelectionListener::onButton1MouseClick(BaseButtonInstance* button) { diff --git a/RotateButtonListener.cpp b/src/source/Listener/RotateButtonListener.cpp similarity index 87% rename from RotateButtonListener.cpp rename to src/source/Listener/RotateButtonListener.cpp index 485582e..4c655bb 100644 --- a/RotateButtonListener.cpp +++ b/src/source/Listener/RotateButtonListener.cpp @@ -1,5 +1,5 @@ -#include "BaseButtonInstance.h" -#include "RotateButtonListener.h" +#include "DataModel/BaseButtonInstance.h" +#include "Listener/RotateButtonListener.h" #include "Globals.h" #include "AudioPlayer.h" diff --git a/ToolbarListener.cpp b/src/source/Listener/ToolbarListener.cpp similarity index 96% rename from ToolbarListener.cpp rename to src/source/Listener/ToolbarListener.cpp index f551275..22cb981 100644 --- a/ToolbarListener.cpp +++ b/src/source/Listener/ToolbarListener.cpp @@ -1,4 +1,4 @@ -#include "ToolbarListener.h" +#include "Listener/ToolbarListener.h" #include "Globals.h" #include "StringFunctions.h" #include "Application.h" diff --git a/Mouse.cpp b/src/source/Mouse.cpp similarity index 100% rename from Mouse.cpp rename to src/source/Mouse.cpp diff --git a/PropertyWindow.cpp b/src/source/PropertyWindow.cpp similarity index 100% rename from PropertyWindow.cpp rename to src/source/PropertyWindow.cpp diff --git a/StringFunctions.cpp b/src/source/StringFunctions.cpp similarity index 100% rename from StringFunctions.cpp rename to src/source/StringFunctions.cpp diff --git a/TextureHandler.cpp b/src/source/TextureHandler.cpp similarity index 100% rename from TextureHandler.cpp rename to src/source/TextureHandler.cpp diff --git a/ArrowTool.cpp b/src/source/Tool/ArrowTool.cpp similarity index 98% rename from ArrowTool.cpp rename to src/source/Tool/ArrowTool.cpp index ad58279..afcc577 100644 --- a/ArrowTool.cpp +++ b/src/source/Tool/ArrowTool.cpp @@ -1,4 +1,4 @@ -#include "ArrowTool.h" +#include "Tool/ArrowTool.h" #include "Application.h" ArrowTool::ArrowTool(void) diff --git a/Tool.cpp b/src/source/Tool/Tool.cpp similarity index 97% rename from Tool.cpp rename to src/source/Tool/Tool.cpp index 25f8f93..109d372 100644 --- a/Tool.cpp +++ b/src/source/Tool/Tool.cpp @@ -1,4 +1,4 @@ -#include "Tool.h" +#include "Tool/Tool.h" Tool::Tool(void) { diff --git a/WindowFunctions.cpp b/src/source/WindowFunctions.cpp similarity index 100% rename from WindowFunctions.cpp rename to src/source/WindowFunctions.cpp diff --git a/ax.cpp b/src/source/ax.cpp similarity index 100% rename from ax.cpp rename to src/source/ax.cpp diff --git a/propertyGrid.cpp b/src/source/propertyGrid.cpp similarity index 100% rename from propertyGrid.cpp rename to src/source/propertyGrid.cpp