Revision: 1565
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=1565&view=rev
Author:   rorthomas
Date:     2011-01-15 22:29:15 +0000 (Sat, 15 Jan 2011)

Log Message:
-----------
fixed VS2010 problems
finding wxwidgets on its own again

Modified Paths:
--------------
    trunk/source/configurator/CMakeLists.txt
    trunk/source/configurator/configurator.cpp

Modified: trunk/source/configurator/CMakeLists.txt
===================================================================
--- trunk/source/configurator/CMakeLists.txt    2011-01-15 22:00:50 UTC (rev 
1564)
+++ trunk/source/configurator/CMakeLists.txt    2011-01-15 22:29:15 UTC (rev 
1565)
@@ -18,15 +18,20 @@
    endif(ROR_USE_${name})
 endmacro(setup_lib)
 
+# find wxwidgets
+SET(wxWidgets_USE_UNICODE ON)
+FIND_PACKAGE(wxWidgets REQUIRED COMPONENTS base core html net adv)
+include_directories(${wxWidgets_INCLUDE_DIRS})
+add_definitions("-D${wxWidgets_DEFINITIONS}" ${wxWidgets_CXX_FLAGS})
+link_directories (${wxWidgets_LIB_DIR})
+
 IF(WIN32)
    include_directories(${BOOST_INCLUDE_DIRS})
    link_directories   (${BOOST_LIBRARY_DIRS})
    include_directories(${PThread_INCLUDE_DIRS})
    link_directories   (${PThread_LIBRARY_DIRS})
-   include_directories(${WXWIDGETS_SHARED_INCLUDE_DIRS})
-   link_directories   (${WXWIDGETS_SHARED_LIBRARY_DIRS})
 
-   set(OS_LIBS "${PThread_LIBRARIES} dinput8.lib dxguid.lib")
+   set(OS_LIBS "${PThread_LIBRARIES};dinput8.lib;dxguid.lib")
    set(OS_SOURCE "icon.rc")
 
    # disable some annoying VS warnings:
@@ -52,15 +57,8 @@
    PKG_CHECK_MODULES  (Ogre OGRE REQUIRED)
    PKG_CHECK_MODULES  (Ois OIS REQUIRED)
 
-   # find wxwidgets
-   SET(wxWidgets_USE_UNICODE ON)
-   FIND_PACKAGE(wxWidgets REQUIRED COMPONENTS base core html net adv)
-   include_directories(${wxWidgets_INCLUDE_DIRS})
-   add_definitions("-D${wxWidgets_DEFINITIONS}" ${wxWidgets_CXX_FLAGS})
-   link_directories (${wxWidgets_LIB_DIR})
+   set(OS_LIBS "")
 
-   set(OS_LIBS "${wxWidgets_LIBRARIES}")
-
    setup_lib(CRASHRPT)
 ENDIF(WIN32)
 
@@ -77,9 +75,14 @@
 
 FILE(GLOB sources "*.cpp")
 FILE(GLOB headers "*.h")
-add_executable(rorconfig WIN32 ${sources} ${headers} ${OS_SOURCE} 
../main/InputEngine.cpp)
 
-TARGET_LINK_LIBRARIES(rorconfig ${WXWIDGETS_SHARED_LIBRARIES} 
${Ogre_LIBRARIES} ${Ois_LIBRARIES} ${OS_LIBS} ${optional_libs})
+IF(WIN32)
+       add_executable(rorconfig WIN32 ${sources} ${headers} ${OS_SOURCE} 
../main/InputEngine.cpp)
+ELSE(WIN32)
+       add_executable(rorconfig ${sources} ${headers} ${OS_SOURCE} 
../main/InputEngine.cpp)
+ENDIF(WIN32)
 
+TARGET_LINK_LIBRARIES(rorconfig ${Ogre_LIBRARIES} ${Ois_LIBRARIES} ${OS_LIBS} 
${optional_libs} ${wxWidgets_LIBRARIES})
 
 
+

Modified: trunk/source/configurator/configurator.cpp
===================================================================
--- trunk/source/configurator/configurator.cpp  2011-01-15 22:00:50 UTC (rev 
1564)
+++ trunk/source/configurator/configurator.cpp  2011-01-15 22:29:15 UTC (rev 
1565)
@@ -73,10 +73,10 @@
 #include <wx/log.h>
 #include <wx/timer.h>
 #include <wx/version.h>
+#include <wx/log.h>
 //#include "joysticks.h"
 #include "utils.h"
 
-
 #include "ImprovedConfigFile.h"
 
 #include "InputEngine.h"
@@ -90,7 +90,6 @@
 #define strnlen(str, len) strlen(str)
 #endif
 
-
 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
 #include <direct.h> // for getcwd
 #include <windows.h>
@@ -112,14 +111,12 @@
 wxLanguageInfo *language=0;
 std::vector<wxLanguageInfo*> avLanguages;
 
-
 std::map<std::string, std::string> settings;
 
 #ifdef USE_OPENCL
 #include <delayimp.h>
 #endif // USE_OPENCL
 
-
 #ifdef __WXGTK__
 #include <gtk/gtk.h>
 #include <gdk/gdkx.h>
@@ -163,7 +160,6 @@
        { wxCMD_LINE_NONE }
 };
 
-
 // from wxWidetgs wiki: 
http://wiki.wxwidgets.org/Calling_The_Default_Browser_In_WxHtmlWindow
 class HtmlWindow: public wxHtmlWindow
 {
@@ -544,7 +540,6 @@
 
                timer = new wxTimer(this, 2);
                timer->Start(50);
-
        }
        ~KeyTestDialog()
        {
@@ -616,7 +611,6 @@
        DECLARE_EVENT_TABLE()
 };
 
-
 class KeySelectDialog : public wxDialog
 {
 protected:
@@ -635,7 +629,6 @@
        float joySliderMaxState[MAX_JOYSTICKS][2][MAX_JOYSTICK_SLIDERS];
        void OnEraseBackGround(wxEraseEvent& event) { event.Skip(); };
 
-
 public:
        KeySelectDialog(MyDialog *_dlg, event_trigger_t *_t) : wxDialog(NULL, 
wxID_ANY, wxString(), wxDefaultPosition, wxSize(300,600), 
wxSTAY_ON_TOP|wxDOUBLE_BORDER|wxCLOSE_BOX), t(_t), dlg(_dlg)
        {
@@ -646,7 +639,6 @@
                if(t->eventtype == ET_MouseAxisX || t->eventtype == 
ET_MouseAxisY || t->eventtype == ET_MouseAxisZ || t->eventtype == 
ET_MouseButton)
                        captureMouse = true;
 
-
                for(int i=0;i<MAX_JOYSTICKS;i++)
                {
                        for(int x=0;x<MAX_JOYSTICK_AXIS;x++)
@@ -694,10 +686,8 @@
 
                SetBackgroundColour(wxColour(conv("white")));
 
-
                // centers dialog window on the screen
                Centre();
-
        }
 
        ~KeySelectDialog()
@@ -793,7 +783,6 @@
                                lastPov = joyPov;
                                lastJoy = joyNum;
                                lastPovDir = povDir;
-
                        } else if (!res)
                        {
                                wxString s = _("(Please use your POV)");
@@ -1035,7 +1024,6 @@
        int id;
 };
 
-
 enum
 {
        // command buttons
@@ -1176,7 +1164,6 @@
 // wxGetApp() which will return the reference of the right type (i.e. MyApp and
 // not wxApp)
 
-
 #ifdef USE_CONSOLE
 IMPLEMENT_APP_CONSOLE(MyApp)
 #else
@@ -1331,8 +1318,6 @@
                {
                        wxLogStatus(wxT("error while loading language!"));
                }
-
-
        }
        else
        {
@@ -1495,7 +1480,6 @@
        recurseCopy(SkeletonPath, UserPath);
 
        return true;
-
 }
 
 void MyApp::initLogging()
@@ -1524,7 +1508,6 @@
 // 'Main program' equivalent: the program execution "starts" here
 bool MyApp::OnInit()
 {
-
        buildmode=false;
        if (argc==2 && wxString(argv[1])==wxT("/buildmode")) buildmode=true;
        //setup the user filesystem
@@ -1610,7 +1593,6 @@
        kd=0;
        controlItemCounter = 0;
 
-
 //     SandStormFogStart = 500;
 //     caelumFogDensity = 0.005;
 
@@ -1965,7 +1947,6 @@
     network_enable=new wxCheckBox(panel_net_top, -1, _("Enable network mode"), 
wxPoint(5, 5));
        network_enable->SetToolTip(_("This switches RoR into network mode.\nBe 
aware that many features are not available in network mode.\nFor example, you 
not be able to leave your vehicle or hook objects."));
 
-
     dText = new wxStaticText(panel_net_top, -1, _("Nickname: "), 
wxPoint(230,7));
        nickname=new wxTextCtrl(panel_net_top, -1, _("Anonymous"), wxPoint(300, 
2), wxSize(170, -1));
        nickname->SetToolTip(_("Your network name. Maximum 20 Characters."));
@@ -2018,7 +1999,6 @@
        dText = new wxStaticText(advancedPanel, -1, _("You do not need to 
change these settings unless you experience problems"), wxPoint(10, y));
        y+=20;
 
-
        dText = new wxStaticText(advancedPanel, -1, _("Light source effects:"), 
wxPoint(10, y));
        flaresMode=new wxChoice(advancedPanel, -1, wxPoint(115, y), wxSize(200, 
-1), 0);
 //     flaresMode->Append(_("None (fastest)")); //this creates a bug in the 
autopilot
@@ -2146,7 +2126,7 @@
 
 #ifdef USE_OPENCL
        wxSizer *sizer_gpu = new wxBoxSizer(wxVERTICAL);
-       
+
        wxSizer *sizer_gpu2 = new wxBoxSizer(wxHORIZONTAL);
        const wxBitmap bm_ocl(opencllogo_xpm);
        wxStaticPicture *openCLImagePanel = new wxStaticPicture(GPUPanel, 
wxID_ANY, bm_ocl, wxPoint(0, 0), wxSize(200, 200), wxNO_BORDER);
@@ -2166,7 +2146,6 @@
        GPUPanel->SetSizer(sizer_gpu);
 #endif // USE_OPENCL
 
-
        //      controlstimer=new wxTimer(this, CONTROLS_TIMER_ID);
        timer1=new wxTimer(this, UPDATE_RESET_TIMER_ID);
 
@@ -2187,7 +2166,6 @@
        loadOgre();
 }
 
-
 void MyDialog::loadOgre()
 {
        if(ogreRoot) return;
@@ -2244,8 +2222,6 @@
                shadowDistance->Disable();
                shadowOptimizations->Disable();
        }
-
-
 }
 
 void MyDialog::onChangeLanguageChoice(wxCommandEvent& event)
@@ -2340,7 +2316,6 @@
                        cTree->SetItemData(item, new IDData(evt.suid));
                        updateItemText(item, (event_trigger_t *)&(evt));
                        treeItems[evt.suid] = item;
-
                }
        }
        INPUTENGINE.destroy();
@@ -2591,7 +2566,7 @@
        sprintf(tmp, "%d", shadowDistance->GetValue());
        settings["Shadow distance"] = tmp;
        settings["Shadow optimizations"] = (shadowOptimizations->GetValue()) ? 
"Yes" : "No";
-       
+
        settings["Water effects"] = conv(water->GetStringSelection());
        settings["Waves"] = (waves->GetValue()) ? "Yes" : "No";
        settings["Engine smoke"] = (smoke->GetValue()) ? "Yes" : "No";
@@ -2672,7 +2647,6 @@
                        if((*it)->Description == 
languageMode->GetStringSelection())
                                settings["Language Short"] = 
conv((*it)->CanonicalName);
                }
-
        }
 }
 
@@ -2731,7 +2705,6 @@
        st = settings["Vegetation"]; if (st.length()>0) 
vegetationMode->SetStringSelection(conv(st));
        st = settings["Screenshot Format"]; if (st.length()>0) 
screenShotFormat->SetStringSelection(conv(st));
 
-
        st = settings["Configurator Size"];
        if (st.length()>0)
        {
@@ -2793,7 +2766,6 @@
        return false;
 }
 
-
 void MyDialog::SaveConfig()
 {
        // first, update the settings map with the actual control values
@@ -2806,7 +2778,6 @@
                return;
        }
 
-
        //save Ogre stuff if we loaded ogre in the first place
        if(ogreRoot)
        {
@@ -2849,7 +2820,6 @@
        fclose(fd);
 }
 
-
 void MyDialog::onRightClickItem(wxTreeEvent& event)
 {
        if(isSelectedControlGroup())
@@ -2942,7 +2912,6 @@
                        i->Check(t->joystickAxisLinearity > 0.69f && 
t->joystickAxisLinearity < 0.71f);
 
                        i = m->AppendSubMenu(iLinear, _("Linearity"));
-
                }
 
                this->PopupMenu(m);
@@ -3011,8 +2980,6 @@
        delete kt;
 }
 
-
-
 /*
 void MyDialog::OnButRemap(wxCommandEvent& event)
 {
@@ -3031,7 +2998,6 @@
        return false;
 }
 
-
 event_trigger_t *MyDialog::getSelectedControlEvent()
 {
        int itemId = -1;
@@ -3100,7 +3066,6 @@
        }
 }
 
-
 void MyDialog::OnMenuJoystickOptionsClick(wxCommandEvent& ev)
 {
        event_trigger_t *t = getSelectedControlEvent();
@@ -3440,7 +3405,6 @@
 #include "ocl_bwtest.h"
 #endif // USE_OPENCL
 
-
 #ifdef USE_OPENCL
 // late loading DLLs
 // see http://msdn.microsoft.com/en-us/library/8yfshtha.aspx
@@ -3467,7 +3431,7 @@
 void MyDialog::tryLoadOpenCL()
 {
        if(openCLAvailable != 0) return;
-       
+
        openCLAvailable = tryLoadOpenCL2();
        if(openCLAvailable != 1)
        {
@@ -3479,7 +3443,6 @@
 }
 #endif // USE_OPENCL
 
-
 void MyDialog::OnButCheckOpenCLBW(wxCommandEvent& event)
 {
 #ifdef USE_OPENCL
@@ -3491,7 +3454,6 @@
 #endif // USE_OPENCL
 }
 
-
 void MyDialog::OnButCheckOpenCL(wxCommandEvent& event)
 {
 #ifdef USE_OPENCL
@@ -3504,7 +3466,7 @@
     // Get OpenCL platform ID for NVIDIA if avaiable, otherwise default
     tstream << "OpenCL Software Information:" << endl;
     char cBuffer[1024];
-    cl_platform_id clSelectedPlatformID = NULL; 
+    cl_platform_id clSelectedPlatformID = NULL;
     cl_int ciErrNum = oclGetPlatformID (&clSelectedPlatformID);
     if(ciErrNum != CL_SUCCESS)
        {
@@ -3519,18 +3481,18 @@
                if (ciErrNum == CL_SUCCESS)
                {
                        tstream << "Platform Name: " << cBuffer << endl;
-               } 
+               }
                else
                {
                        tstream << "Platform Name: ERROR " << ciErrNum << endl;
                        bPassed = false;
                }
-           
+
                ciErrNum = clGetPlatformInfo (clSelectedPlatformID, 
CL_PLATFORM_VERSION, sizeof(cBuffer), cBuffer, NULL);
                if (ciErrNum == CL_SUCCESS)
                {
                        tstream << "Platform Version: " << cBuffer << endl;
-               } 
+               }
                else
                {
                        tstream << "Platform Version: ERROR " << ciErrNum << 
endl;
@@ -3538,10 +3500,10 @@
                }
                tstream.flush();
 
-               // Log OpenCL SDK Revision # 
+               // Log OpenCL SDK Revision #
                tstream << "OpenCL SDK Revision: " << OCL_SDKREVISION << endl;
 
-               // Get and log OpenCL device info 
+               // Get and log OpenCL device info
                cl_uint ciDeviceCount;
                cl_device_id *devices;
                ciErrNum = clGetDeviceIDs (clSelectedPlatformID, 
CL_DEVICE_TYPE_ALL, 0, NULL, &ciDeviceCount);
@@ -3551,12 +3513,12 @@
                tstream << "OpenCL Hardware Information:" << endl;
                tstream << "Devices found: " << ciDeviceCount << endl;
 
-               // check for 0 devices found or errors... 
+               // check for 0 devices found or errors...
                if (ciDeviceCount == 0)
                {
                        tstream << "No devices found supporting OpenCL (return 
code " << ciErrNum << ")" << endl;
                        bPassed = false;
-               } 
+               }
                else if (ciErrNum != CL_SUCCESS)
                {
                        tstream << "Error in clGetDeviceIDs call: " << ciErrNum 
<< endl;
@@ -3579,11 +3541,11 @@
                                        tstream << "ERROR in clCreateContext 
call: " << ciErrNum << endl;
                                        bPassed = false;
                                }
-                               else 
+                               else
                                {
                                        // show info for each device in the 
context
-                                       for(unsigned int i = 0; i < 
ciDeviceCount; ++i ) 
-                                       {  
+                                       for(unsigned int i = 0; i < 
ciDeviceCount; ++i )
+                                       {
                                                clGetDeviceInfo(devices[i], 
CL_DEVICE_NAME, sizeof(cBuffer), &cBuffer, NULL);
                                                tstream << (i + 1) << " : 
Device " << cBuffer << endl;
                                                //oclPrintDevInfo(LOGBOTH, 
devices[i]);
@@ -3678,7 +3640,6 @@
 }
 */
 
-
 void MyDialog::OnShadowSliderScroll(wxScrollEvent &e)
 {
        wxString s;
@@ -3825,7 +3786,7 @@
                break;
        };
        getSettingsControls();
-       
+
        // update slider text
        wxScrollEvent dummye;
        OnShadowSliderScroll(dummye);
@@ -3849,7 +3810,6 @@
        val=ffCamera->GetValue();
        s.Printf(wxT("%i%%"), val);
        ffCameraText->SetLabel(s);
-
 }
 
 void MyDialog::OnLinkClicked(wxHtmlLinkEvent& event)
@@ -3883,7 +3843,6 @@
 //     res->ShowModal();
 }
 
-
 void MyDialog::OnLinkClickedUpdate(wxHtmlLinkEvent& event)
 {
        wxHtmlLinkInfo linkinfo=event.GetLinkInfo();
@@ -3956,7 +3915,6 @@
        btnUpdate->Enable(true);
 }
 
-
 void MyDialog::OnGetUserToken(wxCommandEvent& event)
 {
        wxLaunchDefaultBrowser(wxT("http://usertoken.rigsofrods.com";));
@@ -4067,7 +4025,6 @@
 
 static HRESULT (WINAPI *pDirectSoundEnumerateA)(LPDSENUMCALLBACKA 
pDSEnumCallback, LPVOID pContext);
 
-
 void MyDialog::DSoundEnumerate(wxChoice *wxc)
 {
     size_t iter = 1;
@@ -4099,6 +4056,5 @@
     hr = pDirectSoundEnumerateA(DSoundEnumDevices, wxc);
 //    if(FAILED(hr))
 //        AL_PRINT("Error enumerating DirectSound devices (%#x)!\n", (unsigned 
int)hr);
-
 }
 #endif
\ No newline at end of file


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Rigsofrods-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel

Reply via email to