Code directory changes

This commit is contained in:
Vulpovile
2021-03-04 21:48:29 -08:00
parent 8bf27c6412
commit 12843a0890
87 changed files with 224 additions and 510 deletions

View File

@@ -144,6 +144,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="&quot;C:\Users\Andreja\Documents\C++\G3D-Fun\src\include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
MinimalRebuild="false" MinimalRebuild="false"
BasicRuntimeChecks="0" BasicRuntimeChecks="0"
@@ -235,385 +236,357 @@
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
> >
<File <File
RelativePath=".\Application.cpp" RelativePath=".\src\source\Application.cpp"
> >
</File> </File>
<File <File
RelativePath=".\AudioPlayer.cpp" RelativePath=".\src\source\ArrowTool.cpp"
> >
</File> </File>
<File <File
RelativePath=".\ax.cpp" RelativePath=".\src\source\AudioPlayer.cpp"
> >
</File> </File>
<File <File
RelativePath=".\BrowserCallHandler.cpp" RelativePath=".\src\source\ax.cpp"
> >
</File> </File>
<File <File
RelativePath=".\CameraController.cpp" RelativePath=".\src\source\BaseButtonInstance.cpp"
> >
</File> </File>
<File <File
RelativePath=".\ErrorFunctions.cpp" RelativePath=".\src\source\BrowserCallHandler.cpp"
> >
</File> </File>
<File <File
RelativePath=".\Globals.cpp" RelativePath=".\src\source\ButtonListener.cpp"
> >
</File> </File>
<File <File
RelativePath=".\IEBrowser.cpp" RelativePath=".\src\source\CameraButtonListener.cpp"
> >
</File> </File>
<File <File
RelativePath=".\IEDispatcher.cpp" RelativePath=".\src\source\CameraController.cpp"
> >
</File> </File>
<File <File
RelativePath="main.cpp" RelativePath=".\src\source\DataModelInstance.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath=".\Mouse.cpp"
> >
</File> </File>
<File <File
RelativePath=".\propertyGrid.cpp" RelativePath=".\src\source\DeleteListener.cpp"
> >
</File> </File>
<File <File
RelativePath=".\PropertyWindow.cpp" RelativePath=".\src\source\ErrorFunctions.cpp"
> >
</File> </File>
<File <File
RelativePath=".\StringFunctions.cpp" RelativePath=".\src\source\Globals.cpp"
> >
</File> </File>
<File <File
RelativePath=".\TextureHandler.cpp" RelativePath=".\src\source\GroupInstance.cpp"
> >
</File> </File>
<File <File
RelativePath=".\WindowFunctions.cpp" RelativePath=".\src\source\GUDButtonListener.cpp"
>
</File>
<Filter
Name="Instance"
>
<File
RelativePath=".\BaseButtonInstance.cpp"
> >
</File> </File>
<File <File
RelativePath=".\DataModelInstance.cpp" RelativePath=".\src\source\GuiRootInstance.cpp"
> >
</File> </File>
<File <File
RelativePath=".\GroupInstance.cpp" RelativePath=".\src\source\IEBrowser.cpp"
> >
</File> </File>
<File <File
RelativePath=".\GuiRoot.cpp" RelativePath=".\src\source\IEDispatcher.cpp"
> >
</File> </File>
<File <File
RelativePath=".\ImageButtonInstance.cpp" RelativePath=".\src\source\ImageButtonInstance.cpp"
> >
</File> </File>
<File <File
RelativePath=".\Instance.cpp" RelativePath=".\src\source\Instance.cpp"
> >
</File> </File>
<File <File
RelativePath=".\LevelInstance.cpp" RelativePath=".\src\source\LevelInstance.cpp"
> >
</File> </File>
<File <File
RelativePath=".\PartInstance.cpp" RelativePath=".\src\source\main.cpp"
> >
</File> </File>
<File <File
RelativePath=".\PVInstance.cpp" RelativePath=".\src\source\MenuButtonListener.cpp"
> >
</File> </File>
<File <File
RelativePath=".\TextButtonInstance.cpp" RelativePath=".\src\source\ModeSelectionListener.cpp"
> >
</File> </File>
<File <File
RelativePath=".\ToggleImageButtonInstance.cpp" RelativePath=".\src\source\Mouse.cpp"
> >
</File> </File>
<File <File
RelativePath=".\WorkspaceInstance.cpp" RelativePath=".\src\source\PartInstance.cpp"
>
</File>
</Filter>
<Filter
Name="Listeners"
>
<File
RelativePath=".\ButtonListener.cpp"
> >
</File> </File>
<File <File
RelativePath=".\CameraButtonListener.cpp" RelativePath=".\src\source\propertyGrid.cpp"
> >
</File> </File>
<File <File
RelativePath=".\DeleteListener.cpp" RelativePath=".\src\source\PropertyWindow.cpp"
> >
</File> </File>
<File <File
RelativePath=".\GUDButtonListener.cpp" RelativePath=".\src\source\PVInstance.cpp"
> >
</File> </File>
<File <File
RelativePath=".\MenuButtonListener.cpp" RelativePath=".\src\source\RotateButtonListener.cpp"
> >
</File> </File>
<File <File
RelativePath=".\ModeSelectionListener.cpp" RelativePath=".\src\source\StringFunctions.cpp"
> >
</File> </File>
<File <File
RelativePath=".\RotateButtonListener.cpp" RelativePath=".\src\source\TextButtonInstance.cpp"
> >
</File> </File>
<File <File
RelativePath=".\ToolbarListener.cpp" RelativePath=".\src\source\TextureHandler.cpp"
>
</File>
</Filter>
<Filter
Name="Tools"
>
<File
RelativePath=".\ArrowTool.cpp"
> >
</File> </File>
<File <File
RelativePath=".\Tool.cpp" RelativePath=".\src\source\ToggleImageButtonInstance.cpp"
>
</File>
<File
RelativePath=".\src\source\Tool.cpp"
>
</File>
<File
RelativePath=".\src\source\ToolbarListener.cpp"
>
</File>
<File
RelativePath=".\src\source\WindowFunctions.cpp"
>
</File>
<File
RelativePath=".\src\source\WorkspaceInstance.cpp"
> >
</File> </File>
</Filter>
</Filter> </Filter>
<Filter <Filter
Name="Header Files" Name="Header Files"
Filter="h;hpp;hxx;hm;inl" Filter="h;hpp;hxx;hm;inl"
> >
<File <File
RelativePath=".\Application.h" RelativePath=".\src\include\Application.h"
> >
</File> </File>
<File <File
RelativePath=".\AudioPlayer.h" RelativePath=".\src\include\ArrowTool.h"
> >
</File> </File>
<File <File
RelativePath=".\ax.h" RelativePath=".\src\include\AudioPlayer.h"
> >
</File> </File>
<File <File
RelativePath=".\BrowserCallHandler.h" RelativePath=".\src\include\ax.h"
> >
</File> </File>
<File <File
RelativePath=".\CameraController.h" RelativePath=".\src\include\BaseButtonInstance.h"
> >
</File> </File>
<File <File
RelativePath=".\Demo.h" RelativePath=".\src\include\BrowserCallHandler.h"
> >
</File> </File>
<File <File
RelativePath=".\Enum.h" RelativePath=".\src\include\ButtonListener.h"
> >
</File> </File>
<File <File
RelativePath=".\Enums.h" RelativePath=".\src\include\CameraButtonListener.h"
> >
</File> </File>
<File <File
RelativePath=".\ErrorFunctions.h" RelativePath=".\src\include\CameraController.h"
> >
</File> </File>
<File <File
RelativePath=".\Globals.h" RelativePath=".\src\include\DataModelInstance.h"
> >
</File> </File>
<File <File
RelativePath=".\IEBrowser.h" RelativePath=".\src\include\DeleteListener.h"
> >
</File> </File>
<File <File
RelativePath=".\IEDispatcher.h" RelativePath=".\src\include\Enum.h"
> >
</File> </File>
<File <File
RelativePath=".\LevelInstance.h" RelativePath=".\src\include\Enums.h"
> >
</File> </File>
<File <File
RelativePath=".\Mouse.h" RelativePath=".\src\include\ErrorFunctions.h"
> >
</File> </File>
<File <File
RelativePath=".\propertyGrid.h" RelativePath=".\src\include\Globals.h"
> >
</File> </File>
<File <File
RelativePath=".\PropertyWindow.h" RelativePath=".\src\include\GroupInstance.h"
> >
</File> </File>
<File <File
RelativePath=".\rapidxml\rapidxml.hpp" RelativePath=".\src\include\GUDButtonListener.h"
> >
</File> </File>
<File <File
RelativePath=".\rapidxml\rapidxml_iterators.hpp" RelativePath=".\src\include\GuiRootInstance.h"
> >
</File> </File>
<File <File
RelativePath=".\rapidxml\rapidxml_print.hpp" RelativePath=".\src\include\IEBrowser.h"
> >
</File> </File>
<File <File
RelativePath=".\rapidxml\rapidxml_utils.hpp" RelativePath=".\src\include\IEDispatcher.h"
> >
</File> </File>
<File <File
RelativePath=".\resource.h" RelativePath=".\src\include\ImageButtonInstance.h"
> >
</File> </File>
<File <File
RelativePath=".\RotateButtonListener.h" RelativePath=".\src\include\Instance.h"
> >
</File> </File>
<File <File
RelativePath=".\StringFunctions.h" RelativePath=".\src\include\LevelInstance.h"
> >
</File> </File>
<File <File
RelativePath=".\TextureHandler.h" RelativePath=".\src\include\MenuButtonListener.h"
> >
</File> </File>
<File <File
RelativePath=".\ToggleImageButtonInstance.h" RelativePath=".\src\include\ModeSelectionListener.h"
> >
</File> </File>
<File <File
RelativePath=".\win32Defines.h" RelativePath=".\src\include\Mouse.h"
> >
</File> </File>
<File <File
RelativePath=".\WindowFunctions.h" RelativePath=".\src\include\PartInstance.h"
>
</File>
<File
RelativePath=".\src\include\propertyGrid.h"
>
</File>
<File
RelativePath=".\src\include\PropertyWindow.h"
>
</File>
<File
RelativePath=".\src\include\PVInstance.h"
>
</File>
<File
RelativePath=".\src\include\resource.h"
>
</File>
<File
RelativePath=".\src\include\RotateButtonListener.h"
>
</File>
<File
RelativePath=".\src\include\StringFunctions.h"
>
</File>
<File
RelativePath=".\src\include\TextButtonInstance.h"
>
</File>
<File
RelativePath=".\src\include\TextureHandler.h"
>
</File>
<File
RelativePath=".\src\include\ToggleImageButtonInstance.h"
>
</File>
<File
RelativePath=".\src\include\Tool.h"
>
</File>
<File
RelativePath=".\src\include\ToolbarListener.h"
>
</File>
<File
RelativePath=".\src\include\win32Defines.h"
>
</File>
<File
RelativePath=".\src\include\WindowFunctions.h"
>
</File>
<File
RelativePath=".\src\include\WorkspaceInstance.h"
> >
</File> </File>
<Filter <Filter
Name="Instance" Name="RapidXML"
> >
<File <File
RelativePath=".\BaseButtonInstance.h" RelativePath=".\src\include\rapidxml\rapidxml.hpp"
> >
</File> </File>
<File <File
RelativePath=".\DataModelInstance.h" RelativePath=".\src\include\rapidxml\rapidxml_iterators.hpp"
> >
</File> </File>
<File <File
RelativePath=".\GroupInstance.h" RelativePath=".\src\include\rapidxml\rapidxml_print.hpp"
> >
</File> </File>
<File <File
RelativePath=".\GuiRoot.h" RelativePath=".\src\include\rapidxml\rapidxml_utils.hpp"
>
</File>
<File
RelativePath=".\ImageButtonInstance.h"
>
</File>
<File
RelativePath=".\Instance.h"
>
</File>
<File
RelativePath=".\PartInstance.h"
>
</File>
<File
RelativePath=".\PVInstance.h"
>
</File>
<File
RelativePath=".\TextButtonInstance.h"
>
</File>
<File
RelativePath=".\WorkspaceInstance.h"
> >
</File> </File>
</Filter> </Filter>
<Filter <Filter
Name="Listeners" Name="DataModel"
> >
<File
RelativePath=".\ButtonListener.h"
>
</File>
<File
RelativePath=".\CameraButtonListener.h"
>
</File>
<File
RelativePath=".\DeleteListener.h"
>
</File>
<File
RelativePath=".\GUDButtonListener.h"
>
</File>
<File
RelativePath=".\MenuButtonListener.h"
>
</File>
<File
RelativePath=".\ModeSelectionListener.h"
>
</File>
<File
RelativePath=".\ToolbarListener.h"
>
</File>
</Filter> </Filter>
<Filter <Filter
Name="Tools" Name="Tool"
> >
<File </Filter>
RelativePath=".\ArrowTool.h" <Filter
Name="Listener"
> >
</File>
<File
RelativePath=".\Tool.h"
>
</File>
</Filter> </Filter>
</Filter> </Filter>
<Filter <Filter

View File

@@ -1,9 +0,0 @@
#include "ShapeRenderer.h"
ShapeRenderer::ShapeRenderer(void)
{
}
ShapeRenderer::~ShapeRenderer(void)
{
}

248
main.cpp
View File

@@ -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 <G3DAll.h>
#include <initguid.h>
#include <iomanip>
#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 <limits.h>
#include <mshtml.h>
#include <exdisp.h>
#include <vector>
#include <string>
#include "ax.h"
#include <cguid.h>
#include "IEBrowser.h"
#include "PropertyWindow.h"
#include <commctrl.h>
#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;
}

View File

@@ -3,9 +3,9 @@
#include "LevelInstance.h" #include "LevelInstance.h"
#include "PartInstance.h" #include "PartInstance.h"
#include "rapidxml/rapidxml.hpp" #include "rapidxml/rapidxml.hpp"
#include "GuiRoot.h" #include "GuiRootInstance.h"
class GuiRoot; class GuiRootInstance;
class DataModelInstance : class DataModelInstance :
public Instance public Instance
@@ -27,7 +27,7 @@ public:
std::string _loadedFileName; std::string _loadedFileName;
bool showMessage; bool showMessage;
G3D::GFontRef font; G3D::GFontRef font;
GuiRoot* getGuiRoot(); GuiRootInstance* getGuiRoot();
//float mousex; //float mousex;
//float mousey; //float mousey;
//Vector2 getMousePos(); //Vector2 getMousePos();
@@ -52,6 +52,6 @@ private:
float _modY; float _modY;
WorkspaceInstance* workspace; WorkspaceInstance* workspace;
LevelInstance * level; LevelInstance * level;
GuiRoot* guiRoot; GuiRootInstance* guiRoot;
bool running; bool running;
}; };

View File

@@ -5,11 +5,11 @@ class ImageButtonInstance;
class TextButtonInstance; class TextButtonInstance;
class GuiRoot : public Instance class GuiRootInstance : public Instance
{ {
public: public:
GuiRoot(); GuiRootInstance();
GuiRoot::~GuiRoot(); GuiRootInstance::~GuiRootInstance();
TextButtonInstance* makeTextButton(); TextButtonInstance* makeTextButton();
void drawButtons(RenderDevice* rd); void drawButtons(RenderDevice* rd);
ImageButtonInstance* makeImageButton(G3D::TextureRef newImage, G3D::TextureRef overImage, G3D::TextureRef downImage, G3D::TextureRef disableImage); ImageButtonInstance* makeImageButton(G3D::TextureRef newImage, G3D::TextureRef overImage, G3D::TextureRef downImage, G3D::TextureRef disableImage);

View File

@@ -23,14 +23,14 @@
#include "PropertyWindow.h" #include "PropertyWindow.h"
#include <commctrl.h> #include <commctrl.h>
#include "StringFunctions.h" #include "StringFunctions.h"
#include "GuiRoot.h" #include "GuiRootInstance.h"
#include "GUDButtonListener.h" #include "GUDButtonListener.h"
#include "ModeSelectionListener.h" #include "ModeSelectionListener.h"
#include "DeleteListener.h" #include "DeleteListener.h"
#include "CameraButtonListener.h" #include "CameraButtonListener.h"
#include "RotateButtonListener.h" #include "RotateButtonListener.h"
//#define LEGACY_LOAD_G3DFUN_LEVEL #define LEGACY_LOAD_G3DFUN_LEVEL
//Ray testRay; //Ray testRay;
//static int cursorid = 0; //static int cursorid = 0;
//static int cursorOvrid = 0; //static int cursorOvrid = 0;
@@ -709,9 +709,7 @@ void Application::onGraphics(RenderDevice* rd) {
rd->afterPrimitive(); rd->afterPrimitive();
Draw::box(G3D::Box(mouse.getPosition()-Vector3(2,0.5F,1),mouse.getPosition()+Vector3(2,0.5F,1)), rd, Color3::cyan(), Color4::clear());
Draw::sphere(G3D::Sphere(mouse.getPosition(), 1), rd, Color3::cyan(), Color4::clear());
if(g_selectedInstances.size() > 0) if(g_selectedInstances.size() > 0)
{ {
for(size_t i = 0; i < g_selectedInstances.size(); i++) for(size_t i = 0; i < g_selectedInstances.size(); i++)

View File

@@ -1,5 +1,5 @@
#include <string> #include <string>
#include "GuiRoot.h" #include "GuiRootInstance.h"
#include "DataModelInstance.h" #include "DataModelInstance.h"
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
@@ -15,7 +15,7 @@ DataModelInstance::DataModelInstance(void)
{ {
Instance::Instance(); Instance::Instance();
workspace = new WorkspaceInstance(); workspace = new WorkspaceInstance();
guiRoot = new GuiRoot(); guiRoot = new GuiRootInstance();
level = new LevelInstance(); level = new LevelInstance();
//children.push_back(workspace); //children.push_back(workspace);
//children.push_back(level); //children.push_back(level);
@@ -601,7 +601,7 @@ void DataModelInstance::setMousePos(Vector2 pos)
mousex=pos.x; mousex=pos.x;
mousey=pos.y; mousey=pos.y;
}*/ }*/
GuiRoot* DataModelInstance::getGuiRoot() GuiRootInstance* DataModelInstance::getGuiRoot()
{ {
return guiRoot; return guiRoot;
} }

View File

@@ -5,7 +5,7 @@
#include "TextButtonInstance.h" #include "TextButtonInstance.h"
#include "ImageButtonInstance.h" #include "ImageButtonInstance.h"
#include "ToggleImageButtonInstance.h" #include "ToggleImageButtonInstance.h"
#include "GuiRoot.h" #include "GuiRootInstance.h"
#include "Globals.h" #include "Globals.h"
#include "StringFunctions.h" #include "StringFunctions.h"
@@ -19,7 +19,7 @@
#include "ImageButtonInstance.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); ImageButtonInstance* part = new ImageButtonInstance(newImage,overImage, downImage, disableImage);
// instances.push_back(part); // instances.push_back(part);
@@ -27,13 +27,13 @@ ImageButtonInstance* GuiRoot::makeImageButton(G3D::TextureRef newImage = NULL, G
return part; return part;
} }
TextButtonInstance* GuiRoot::makeTextButton() TextButtonInstance* GuiRootInstance::makeTextButton()
{ {
TextButtonInstance* part = new TextButtonInstance(); TextButtonInstance* part = new TextButtonInstance();
return part; return part;
} }
ToolbarListener * toolbar; ToolbarListener * toolbar;
GuiRoot::GuiRoot() : _message(""), _messageTime(0) GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
{ {
toolbar = new ToolbarListener(); toolbar = new ToolbarListener();
toolbar->doDelete = false; 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->pushState();
rd->beforePrimitive(); rd->beforePrimitive();
@@ -418,15 +418,15 @@ void GuiRoot::drawButtons(RenderDevice* rd)
rd->popState(); rd->popState();
} }
void GuiRoot::setDebugMessage(std::string msg, G3D::RealTime msgTime) void GuiRootInstance::setDebugMessage(std::string msg, G3D::RealTime msgTime)
{ {
_messageTime = msgTime; _messageTime = msgTime;
_message = msg; _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 //TODO--Move these to their own instance
@@ -463,7 +463,7 @@ void GuiRoot::renderGUI(G3D::RenderDevice* rd, double fps)
render(rd); render(rd);
} }
bool GuiRoot::mouseInGUI(G3D::RenderDevice* renderDevice,int x,int y) bool GuiRootInstance::mouseInGUI(G3D::RenderDevice* renderDevice,int x,int y)
{ {
std::vector<Instance*> instances_2D = g_dataModel->getGuiRoot()->getAllChildren(); std::vector<Instance*> instances_2D = g_dataModel->getGuiRoot()->getAllChildren();
for(size_t i = 0; i < instances_2D.size(); i++) 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; return false;
} }
void GuiRoot::update() void GuiRootInstance::update()
{ {
Instance * obj6 = this->findFirstChild("Delete"); Instance * obj6 = this->findFirstChild("Delete");
Instance * obj = this->findFirstChild("Duplicate"); Instance * obj = this->findFirstChild("Duplicate");
@@ -515,12 +515,12 @@ void GuiRoot::update()
} }
} }
GuiRoot::~GuiRoot() GuiRootInstance::~GuiRootInstance()
{ {
delete toolbar; delete toolbar;
} }
void GuiRoot::onMouseLeftUp(G3D::RenderDevice* renderDevice, int x,int y) void GuiRootInstance::onMouseLeftUp(G3D::RenderDevice* renderDevice, int x,int y)
{ {
std::vector<Instance*> instances_2D = this->getAllChildren(); std::vector<Instance*> instances_2D = this->getAllChildren();
for(size_t i = 0; i < instances_2D.size(); i++) for(size_t i = 0; i < instances_2D.size(); i++)