diff --git a/Application.cpp b/Application.cpp index 0f4a45e..43d04d7 100644 --- a/Application.cpp +++ b/Application.cpp @@ -30,7 +30,7 @@ #include "DeleteListener.h" #include "CameraButtonListener.h" #include "RotateButtonListener.h" -//#define LEGACY_LOAD_G3DFUN_LEVEL +#define LEGACY_LOAD_G3DFUN_LEVEL Ray testRay; static int cursorid = 0; static int cursorOvrid = 0; @@ -113,7 +113,7 @@ Application::Application(HWND parentWindow) : _propWindow(NULL) { //: GApp(setti Win32Window* window = Win32Window::create(_settings.window,_hwndRenderer); ShowWindow(_hwndRenderer, SW_SHOW); ShowWindow(_hWndMain, SW_SHOW); - + quit=false; rightButtonHolding=false; mouseOnScreen=false; @@ -135,6 +135,8 @@ Application::Application(HWND parentWindow) : _propWindow(NULL) { //: GApp(setti SetWindowLongPtr(_hwndRenderer,GWL_USERDATA,(LONG)this); _propWindow = new PropertyWindow(0, 0, 200, 640, hThisInstance); webBrowser = new IEBrowser(_hwndToolbox); + + SetWindowLongPtr(_hwndToolbox,GWL_USERDATA+1,(LONG)webBrowser); //webBrowser->navigateSyncURL(L"http://androdome.com/res/ClientToolbox.php"); navigateToolbox(GetFileInPath("/content/page/controller.html")); @@ -342,7 +344,7 @@ void eject(PartInstance * colliding, PartInstance * collider) if(colliding == collider || !colliding->canCollide || !collider->canCollide) return; if(G3D::CollisionDetection::fixedSolidBoxIntersectsFixedSolidBox(collider->getBox(), colliding->getBox())) - collider->setVelocity(collider->getVelocity().reflectionDirection(colliding->cFrame.upVector())/1.3); + collider->setVelocity(collider->getVelocity().reflectionDirection(colliding->cFrame.upVector())/1.3F); } diff --git a/IEBrowser.cpp b/IEBrowser.cpp index 62d3737..e1dec47 100644 --- a/IEBrowser.cpp +++ b/IEBrowser.cpp @@ -7,11 +7,54 @@ #include "IEBrowser.h" #include "Globals.h" +#pragma once #include "ax.h" -void IEBrowser::Boop(char* test) +HRESULT IEBrowser::doExternal(std::wstring funcName, + DISPID dispIdMember, + REFIID riid, + LCID lcid, + WORD wFlags, + DISPPARAMS FAR* pDispParams, + VARIANT FAR* pVarResult, + EXCEPINFO FAR* pExcepInfo, + unsigned int FAR* puArgErr) { - // External functions may end up here in the future + if (funcName==L"Insert") + { + + MessageBoxW(NULL, pDispParams->rgvarg->bstrVal,L"Add insert here...",MB_OK); + return S_OK; + } + else if (funcName==L"Boop") + { + MessageBox(NULL, "BOOP", "Boopity boop",MB_OK); + } + else if (funcName==L"SetController") + { + bool ding = false; + //int len = SysStringLen(pDispParams->rgvarg->bstrVal)+1; + //char * args = new char[len]; + //WideCharToMultiByte(CP_ACP, 0, pDispParams->rgvarg->bstrVal, len, args, len, NULL, (LPBOOL)TRUE); + if(pDispParams->rgvarg->intVal < 0 || pDispParams->rgvarg->intVal > 7) + return S_OK; + Enum::Controller::Value cont = (Enum::Controller::Value)pDispParams->rgvarg->intVal; + for(size_t i = 0; i < g_selectedInstances.size(); i++) + { + if(PVInstance* part = dynamic_cast(g_selectedInstances.at(i))) + { + ding = true; + part->controller = cont; + } + } + if(ding) + AudioPlayer::playSound(dingSound); + return S_OK; + } + else + { + return E_NOTIMPL; + } } IEBrowser::IEBrowser(HWND attachHWnd) { @@ -39,7 +82,7 @@ IEBrowser::~IEBrowser(void) { bool IEBrowser::navigateSyncURL(wchar_t* url) { - MSG messages; + //MSG messages; if (webBrowser) { diff --git a/IEBrowser.h b/IEBrowser.h index 1bef0a7..15b3264 100644 --- a/IEBrowser.h +++ b/IEBrowser.h @@ -1,16 +1,27 @@ //#include "WindowFunctions.h" #pragma once +#include "Globals.h" +#pragma once #include #include #include #include "IEDispatcher.h" +#include "AudioPlayer.h" class IEBrowser { public: IEBrowser(HWND attachHWnd); ~IEBrowser(void); bool navigateSyncURL(wchar_t* url); - void Boop(char* test); + HRESULT doExternal(std::wstring funcName, + DISPID dispIdMember, + REFIID riid, + LCID lcid, + WORD wFlags, + DISPPARAMS FAR* pDispParams, + VARIANT FAR* pVarResult, + EXCEPINFO FAR* pExcepInfo, + unsigned int FAR* puArgErr); private: IWebBrowser2* webBrowser; HWND hwnd; diff --git a/ax.cpp b/ax.cpp index 0c4b4fc..a8f6eba 100644 --- a/ax.cpp +++ b/ax.cpp @@ -505,43 +505,10 @@ HRESULT _stdcall AXClientSite :: Invoke( EXCEPINFO FAR* pExcepInfo, unsigned int FAR* puArgErr) { - - if (m_lastExternalName==L"Insert") - { - - MessageBoxW(NULL, pDispParams->rgvarg->bstrVal,L"Add insert here...",MB_OK); - return S_OK; - } - else if (m_lastExternalName==L"Boop") - { - MessageBox(NULL, "BOOP", "Boopity boop",MB_OK); - } - else if (m_lastExternalName==L"SetController") - { - bool ding = false; - //int len = SysStringLen(pDispParams->rgvarg->bstrVal)+1; - //char * args = new char[len]; - //WideCharToMultiByte(CP_ACP, 0, pDispParams->rgvarg->bstrVal, len, args, len, NULL, (LPBOOL)TRUE); - if(pDispParams->rgvarg->intVal < 0 || pDispParams->rgvarg->intVal > 7) - return S_OK; - Enum::Controller::Value cont = (Enum::Controller::Value)pDispParams->rgvarg->intVal; - for(size_t i = 0; i < g_selectedInstances.size(); i++) - { - if(PVInstance* part = dynamic_cast(g_selectedInstances.at(i))) - { - ding = true; - part->controller = cont; - } - } - if(ding) - AudioPlayer::playSound(dingSound); - return S_OK; - } - else - { - return E_NOTIMPL; - } - return S_OK; + IEBrowser * browser = (IEBrowser *)GetWindowLongPtr(Window,GWL_USERDATA+1); + return browser->doExternal(m_lastExternalName,dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); + + //return S_OK; } diff --git a/ax.h b/ax.h index 10c1cc7..2fcce49 100644 --- a/ax.h +++ b/ax.h @@ -3,6 +3,8 @@ #include "Globals.h" #include #include +#pragma once +#include "IEBrowser.h" // messages #define AX_QUERYINTERFACE (WM_USER + 1) @@ -40,7 +42,6 @@ class AXClientSite : bool CalledCanInPlace; class AX* ax; - // MyClientSite Methods AXClientSite(); virtual ~AXClientSite(); diff --git a/content/page/hopper.html b/content/page/hopper.html index 8858292..bed95b0 100644 Binary files a/content/page/hopper.html and b/content/page/hopper.html differ diff --git a/main.cpp b/main.cpp index 3cf9e6c..51058b1 100644 --- a/main.cpp +++ b/main.cpp @@ -176,7 +176,6 @@ int main(int argc, char** argv) { try{ hresult = OleInitialize(NULL); - HRESULT hr; /* IInternetSecurityManager *pSecurityMgr; IInternetZoneManager *pZoneMgr; LPCWSTR site1 = SysAllocString(L"http://www.androdome.com");