Ticket #1113: clean-build-mac-r10909.diff

File clean-build-mac-r10909.diff, 15.3 KB (added by Echelon9, 12 years ago)
  • source/ps/Util.cpp

     
    3333#include "lib/sysdep/smbios.h"
    3434#include "lib/tex/tex.h"
    3535
     36#include "ps/Pyrogenesis.h"
    3637#include "ps/GameSetup/Config.h"
    3738#include "ps/GameSetup/GameSetup.h"
    3839#include "ps/Game.h"
  • source/ps/Profiler2.cpp

     
    2828#include "ps/CLogger.h"
    2929#include "ps/CStr.h"
    3030#include "ps/Profiler2GPU.h"
     31#include "ps/Pyrogenesis.h"
    3132#include "third_party/mongoose/mongoose.h"
    3233
    3334#include <iomanip>
  • source/ps/ProfileViewer.cpp

     
    2727
    2828#include "ProfileViewer.h"
    2929
     30#include "ps/Pyrogenesis.h"
    3031#include "ps/CLogger.h"
    3132#include "ps/Filesystem.h"
    3233#include "ps/Font.h"
  • source/ps/Replay.cpp

     
    2424#include "lib/file/file_system.h"
    2525#include "lib/res/h_mgr.h"
    2626#include "lib/tex/tex.h"
     27#include "ps/Pyrogenesis.h"
    2728#include "ps/Game.h"
    2829#include "ps/Loader.h"
    2930#include "ps/Profile.h"
  • source/ps/GameSetup/Paths.cpp

     
    5454        m_config = appdata/"config"/"";
    5555        m_cache = appdata/"cache"/"";
    5656        m_logs = appdata/"logs"/"";
     57#elif defined __APPLE__
     58        const char* envHome = getenv("HOME");
     59        ENSURE(envHome);
     60        const OsPath home(envHome);
     61        m_data   = home/"Library/Application Support/0AD/data/";
     62        m_cache  =  home/"Library/Application Support/0AD/cache/";
     63        m_config =  home/"Library/Application Support/0AD/config/";
     64        m_logs   =  home/"Library/Application Support/0AD/logs/";
    5765#else
    5866        const char* envHome = getenv("HOME");
    5967        ENSURE(envHome);
     
    8694    if(!FileExists(pathname))
    8795        WARN_IF_ERR(StatusFromErrno());
    8896
     97#ifndef MAC_NATIVE  //  when running natively on a mac, i.e. with a proper app bundle our data is inside the app wrapper instead of next to it
    8998    for(size_t i = 0; i < 2; i++)   // remove "system/name.exe"
    9099        pathname = pathname.Parent();
     100#endif
     101
     102
    91103    return pathname;
    92104}
    93105
  • source/ps/DllLoader.cpp

     
    8989        {
    9090            CStr filename = GenerateFilename(name, suffixes[idxSuffix], extensions[idxExtension]);
    9191
     92#ifdef MAC_NATIVE // when running natively on a mac, i.e. with a proper app bundle our dylib is inside the app wrapper instead of next to it
     93            filename = "@executable_path/" + filename;
     94#endif
     95
    9296            // we don't really care when relocations take place, but one of
    9397            // {RTLD_NOW, RTLD_LAZY} must be specified. go with the former because
    9498            // it is safer and matches the Windows load behavior.
  • source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Cinematic/Cinematic.cpp

     
    490490       
    491491        displayH->Add(m_SplineDisplay, 0);
    492492        displayH->Add(m_RotationDisplay, 0);
    493         m_Sizer->Add(displayH, 0, wxTop | wxALIGN_CENTER, 10);
     493        m_Sizer->Add(displayH, 0, wxALIGN_TOP | wxALIGN_CENTER, 10);
    494494        m_Sizer->Add(m_DrawCurrent, 0);
    495495        m_Sizer->Add( new wxButton(this, Reset_ID, L"Reset Camera"), 0, wxALIGN_CENTER );
    496496    }
  • source/tools/atlas/AtlasUI/Misc/KeyMap.cpp

     
    1919
    2020#include "KeyMap.h"
    2121
    22 #include "SDL_keysym.h"
     22#include <SDL/SDL_keysym.h>
    2323
    2424int GetSDLKeyFromWxKeyCode(int wxkey)
    2525{
  • source/tools/atlas/AtlasUI/CustomControls/ColourDialog/ColourDialog.h

     
    1818#ifndef INCLUDED_COLOURDIALOG
    1919#define INCLUDED_COLOURDIALOG
    2020
    21 #include <wx/colordlg.h>
     21#include "wx/colordlg.h"
    2222
    2323class ColourDialog : public wxColourDialog
    2424{
  • source/tools/atlas/AtlasUI/CustomControls/VirtualDirTreeCtrl/virtualdirtreectrl.h

     
    3030    #include "wx/wx.h"
    3131#endif
    3232
    33 #include <wx/dynarray.h>
    34 #include <wx/treectrl.h>
    35 #include <wx/filesys.h>
    36 #include <wx/imaglist.h>
     33#include "wx/dynarray.h"
     34#include "wx/treectrl.h"
     35#include "wx/filesys.h"
     36#include "wx/imaglist.h"
    3737
    3838enum
    3939{
  • source/tools/atlas/AtlasUI/CustomControls/VirtualDirTreeCtrl/virtualdirtreectrl.cpp

     
    3232    #pragma hdrstop
    3333#endif
    3434
    35 #include <wx/dir.h>
    36 #include <wx/busyinfo.h>
     35#include "wx/dir.h"
     36#include "wx/busyinfo.h"
    3737#include "virtualdirtreectrl.h"
    3838
    3939// default images
  • source/tools/atlas/GameInterface/Handlers/EnvironmentHandlers.cpp

     
    6666
    6767    s.skyset = g_Renderer.GetSkyManager()->GetSkySet();
    6868
    69     // RGBColor (CVector3D) colours
     69    // RGBColorVector (CVector3D) colours
    7070#define COLOUR(A, B) A = Colour((int)(B.X*255), (int)(B.Y*255), (int)(B.Z*255))
    7171    s.sunoverbrightness = MaxComponent(g_LightEnv.m_SunColor);
    7272    // clamp color to [0..1] before packing into u8 triplet
     
    112112        skySet = L"default";
    113113    g_Renderer.GetSkyManager()->SetSkySet(skySet);
    114114
    115 #define COLOUR(A, B) B = RGBColor(A->r/255.f, A->g/255.f, A->b/255.f)
     115#define COLOUR(A, B) B = RGBColorVector(A->r/255.f, A->g/255.f, A->b/255.f)
    116116    COLOUR(s.suncolour, g_LightEnv.m_SunColor);
    117117    g_LightEnv.m_SunColor *= s.sunoverbrightness;
    118118    COLOUR(s.terraincolour, g_LightEnv.m_TerrainAmbientColor);
  • source/graphics/ParticleEmitterType.cpp

     
    539539
    540540            particle.size = m_Variables[VAR_SIZE]->Evaluate(emitter);
    541541
    542             RGBColor color;
     542            RGBColorVector color;
    543543            color.X = m_Variables[VAR_COLOR_R]->Evaluate(emitter);
    544544            color.Y = m_Variables[VAR_COLOR_G]->Evaluate(emitter);
    545545            color.Z = m_Variables[VAR_COLOR_B]->Evaluate(emitter);
  • source/graphics/MapReader.cpp

     
    593593        }
    594594        else if (element_name == el_suncolour)
    595595        {
    596             m_MapReader.m_LightEnv.m_SunColor = RGBColor(
     596            m_MapReader.m_LightEnv.m_SunColor = RGBColorVector(
    597597                attrs.GetNamedItem(at_r).ToFloat(),
    598598                attrs.GetNamedItem(at_g).ToFloat(),
    599599                attrs.GetNamedItem(at_b).ToFloat());
     
    608608        }
    609609        else if (element_name == el_terrainambientcolour)
    610610        {
    611             m_MapReader.m_LightEnv.m_TerrainAmbientColor = RGBColor(
     611            m_MapReader.m_LightEnv.m_TerrainAmbientColor = RGBColorVector(
    612612                attrs.GetNamedItem(at_r).ToFloat(),
    613613                attrs.GetNamedItem(at_g).ToFloat(),
    614614                attrs.GetNamedItem(at_b).ToFloat());
    615615        }
    616616        else if (element_name == el_unitsambientcolour)
    617617        {
    618             m_MapReader.m_LightEnv.m_UnitsAmbientColor = RGBColor(
     618            m_MapReader.m_LightEnv.m_UnitsAmbientColor = RGBColorVector(
    619619                attrs.GetNamedItem(at_r).ToFloat(),
    620620                attrs.GetNamedItem(at_g).ToFloat(),
    621621                attrs.GetNamedItem(at_b).ToFloat());
     
    13021302
    13031303    CColor sunColor;
    13041304    GET_ENVIRONMENT_PROPERTY(envObj.get(), SunColour, sunColor)
    1305     m_LightEnv.m_SunColor = RGBColor(sunColor.r, sunColor.g, sunColor.b);
     1305    m_LightEnv.m_SunColor = RGBColorVector(sunColor.r, sunColor.g, sunColor.b);
    13061306
    13071307    GET_ENVIRONMENT_PROPERTY(envObj.get(), SunElevation, m_LightEnv.m_Elevation)
    13081308    GET_ENVIRONMENT_PROPERTY(envObj.get(), SunRotation, m_LightEnv.m_Rotation)
    13091309   
    13101310    CColor terrainAmbientColor;
    13111311    GET_ENVIRONMENT_PROPERTY(envObj.get(), TerrainAmbientColour, terrainAmbientColor)
    1312     m_LightEnv.m_TerrainAmbientColor = RGBColor(terrainAmbientColor.r, terrainAmbientColor.g, terrainAmbientColor.b);
     1312    m_LightEnv.m_TerrainAmbientColor = RGBColorVector(terrainAmbientColor.r, terrainAmbientColor.g, terrainAmbientColor.b);
    13131313
    13141314    CColor unitsAmbientColor;
    13151315    GET_ENVIRONMENT_PROPERTY(envObj.get(), UnitsAmbientColour, unitsAmbientColor)
    1316     m_LightEnv.m_UnitsAmbientColor = RGBColor(unitsAmbientColor.r, unitsAmbientColor.g, unitsAmbientColor.b);
     1316    m_LightEnv.m_UnitsAmbientColor = RGBColorVector(unitsAmbientColor.r, unitsAmbientColor.g, unitsAmbientColor.b);
    13171317
    13181318    // Water properties
    13191319    CScriptValRooted waterObj;
  • source/graphics/Color.h

     
    2828
    2929// simple defines for 3 and 4 component floating point colors - just map to
    3030// corresponding vector types
    31 typedef CVector3D RGBColor;
    32 typedef CVector4D RGBAColor;
     31typedef CVector3D RGBColorVector;
     32typedef CVector4D RGBAColorVector;
    3333
    3434// exposed as function pointer because it is set at init-time to
    3535// one of several implementations depending on CPU caps.
    36 extern SColor4ub (*ConvertRGBColorTo4ub)(const RGBColor& src);
     36extern SColor4ub (*ConvertRGBColorTo4ub)(const RGBColorVector& src);
    3737
    3838// call once ia32_Init has run; detects CPU caps and activates the best
    3939// possible codepath.
  • source/graphics/tests/test_Color.h

     
    3939private:
    4040    void CheckColor(int r, int g, int b, u32 expected)
    4141    {
    42         SColor4ub colorStruct = ConvertRGBColorTo4ub(RGBColor(r,g,b));
     42        SColor4ub colorStruct = ConvertRGBColorTo4ub(RGBColorVector(r,g,b));
    4343        u32 actual;
    4444        memcpy(&actual, &colorStruct, sizeof(u32));
    4545        expected |= 0xff000000; // ConvertRGBColorTo4ub sets alpha to opaque
  • source/graphics/LightEnv.h

     
    7070    std::string m_LightingModel;
    7171
    7272public:
    73     RGBColor m_SunColor;
    74     RGBColor m_TerrainAmbientColor;
    75     RGBColor m_UnitsAmbientColor;
     73    RGBColorVector m_SunColor;
     74    RGBColorVector m_TerrainAmbientColor;
     75    RGBColorVector m_UnitsAmbientColor;
    7676
    7777public:
    7878    CLightEnv();
     
    9898     * @param normal normal vector (must have length 1)
    9999     * @param color resulting color
    100100     */
    101     void EvaluateTerrain(const CVector3D& normal, RGBColor& color) const
     101    void EvaluateTerrain(const CVector3D& normal, RGBColorVector& color) const
    102102    {
    103103        float dot = -normal.Dot(m_SunDir);
    104104
     
    115115     * @param normal normal vector (must have length 1)
    116116     * @param color resulting color
    117117     */
    118     void EvaluateUnit(const CVector3D& normal, RGBColor& color) const
     118    void EvaluateUnit(const CVector3D& normal, RGBColorVector& color) const
    119119    {
    120120        float dot = -normal.Dot(m_SunDir);
    121121
     
    131131     * @param normal normal vector (must have length 1)
    132132     * @param color resulting color
    133133     */
    134     void EvaluateDirect(const CVector3D& normal, RGBColor& color) const
     134    void EvaluateDirect(const CVector3D& normal, RGBColorVector& color) const
    135135    {
    136136        float dot = -normal.Dot(m_SunDir);
    137137
  • source/graphics/Color.cpp

     
    3131# include "lib/sysdep/arch/x86_x64/x86_x64.h"
    3232#endif
    3333
    34 static SColor4ub fallback_ConvertRGBColorTo4ub(const RGBColor& src)
     34static SColor4ub fallback_ConvertRGBColorTo4ub(const RGBColorVector& src)
    3535{
    3636    SColor4ub result;
    3737    result.R=clamp(int(src.X*255),0,255);
     
    4242}
    4343
    4444// on IA32, this is replaced by an SSE assembly version in ia32.cpp
    45 SColor4ub (*ConvertRGBColorTo4ub)(const RGBColor& src) = fallback_ConvertRGBColorTo4ub;
     45SColor4ub (*ConvertRGBColorTo4ub)(const RGBColorVector& src) = fallback_ConvertRGBColorTo4ub;
    4646
    4747
    4848// Assembler-optimized function for color conversion
    4949#if ARCH_X86_X64
    50 static SColor4ub sse_ConvertRGBColorTo4ub(const RGBColor& src)
     50static SColor4ub sse_ConvertRGBColorTo4ub(const RGBColorVector& src)
    5151{
    5252    const __m128 zero = _mm_setzero_ps();
    5353    const __m128 _255 = _mm_set_ss(255.0f);
  • source/renderer/ModelRenderer.cpp

     
    129129    size_t numVertices = mdef->GetNumVertices();
    130130    const CLightEnv& lightEnv = g_Renderer.GetLightEnv();
    131131    CColor shadingColor = model->GetShadingColor();
    132     RGBColor tempcolor;
     132    RGBColorVector tempcolor;
    133133
    134134    for (size_t j=0; j<numVertices; j++)
    135135    {
  • source/renderer/TerrainRenderer.cpp

     
    297297
    298298    glBlendFunc(GL_DST_COLOR, GL_ZERO);
    299299
    300     // GL_TEXTURE_ENV_COLOR requires four floats, so we shouldn't use the RGBColor directly
     300    // GL_TEXTURE_ENV_COLOR requires four floats, so we shouldn't use the RGBColorVector directly
    301301    float terrainAmbientColor[4] = {
    302302        lightEnv.m_TerrainAmbientColor.X,
    303303        lightEnv.m_TerrainAmbientColor.Y,
  • source/lib/external_libraries/libsdl.h

     
    3434# include "lib/sysdep/os/win/wsdl.h"
    3535#else
    3636
    37 # include "SDL.h"
    38 # include "SDL_thread.h"
     37# include "SDL/SDL.h"
     38# include "SDL/SDL_thread.h"
    3939
    4040// if the compiler doesn't support inlining, this header will pull
    4141// in static bswap routines. doesn't matter - modern compilers
    4242// will strip them if unused, and this is more convenient than
    4343// another header that toggles between wsdl and SDL_endian.h.
    44 # include "SDL_endian.h"
     44# include "SDL/SDL_endian.h"
    4545
    4646# if MSC_VERSION
    4747#  pragma comment(lib, "SDL")