Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/osx'
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Mar 18, 2017
2 parents 82615d9 + 00a9209 commit 04759ba
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 7 deletions.
28 changes: 27 additions & 1 deletion README.md
Expand Up @@ -75,7 +75,8 @@ set of packages might be:

To build DarkRadiant the standard Autotools build process is used:

```./autogen.sh
```
./autogen.sh
./configure
make
sudo make install
Expand All @@ -85,6 +86,31 @@ The available configure options are listed with `./configure --help`. There are
options for debug builds, and enabling or disabling various optional components
such as audio support and the Dark Mod-specific plugins.

# Compiling on OS X

## Prerequisites

To compile DarkRadiant, a number of libraries (with development headers) are
required. You can obtain them by using [MacPorts](https://distfiles.macports.org/MacPorts/):

Install MacPorts, then open a fresh console and issue these commands:

```
sudo port install jpeg wxwidgets-3.0 pkgconfig libsigcxx2 freetype ftgl glew
sudo port install boost libxml2 freealut libvorbis libogg openal
```

## Build

Start Xcode and open the project file in `tools/xcode/DarkRadiant.xcodeproj`.
Hit CMD-B to start the build, the output files will be placed to a folder
similar to this:

`~/Library/Developer/Xcode/DerivedData/DarkRadiant-somethingsomething/Build/Products/Release`

The `DarkRadiant.app` package in that folder can be launched right away or
copied to some location of your preference.

# More Information

A more detailed compilation guide can be found on The Dark Mod's wiki:
Expand Down
19 changes: 19 additions & 0 deletions plugins/entitylist/EntityList.cpp
Expand Up @@ -38,6 +38,18 @@ EntityList::EntityList() :
// Connect the window position tracker
InitialiseWindowPosition(300, 800, RKEY_WINDOW_STATE);
}

EntityList::~EntityList()
{
// In OSX we might receive callbacks during shutdown, so disable any events
if (_treeView != nullptr)
{
_treeView->Disconnect(wxEVT_DATAVIEW_SELECTION_CHANGED,
wxDataViewEventHandler(EntityList::onSelection), NULL, this);
_treeView->Disconnect(wxEVT_DATAVIEW_ITEM_EXPANDED,
wxDataViewEventHandler(EntityList::onRowExpand), NULL, this);
}
}

void EntityList::populateWindow()
{
Expand Down Expand Up @@ -158,6 +170,13 @@ void EntityList::_preHide()

// De-register self from the SelectionSystem
GlobalSelectionSystem().removeObserver(this);

// Unselect everything when hiding the dialog
_callbackActive = true;

_treeView->UnselectAll();

_callbackActive = false;
}

// Pre-show callback
Expand Down
2 changes: 2 additions & 0 deletions plugins/entitylist/EntityList.h
Expand Up @@ -93,6 +93,8 @@ class EntityList :
void _preShow();

public:
~EntityList();

/** greebo: Shuts down this dialog, safely disconnects it
* from the EventManager and the SelectionSystem.
* Saves the window information to the Registry.
Expand Down
4 changes: 3 additions & 1 deletion radiant/ui/commandlist/CommandList.cpp
Expand Up @@ -28,7 +28,7 @@ CommandList::CommandList() :
// Create all the widgets
populateWindow();

FitToScreen(0.3f, 0.7f);
FitToScreen(0.4f, 0.7f);
}

void CommandList::reloadList()
Expand All @@ -40,6 +40,8 @@ void CommandList::reloadList()

// Cycle through all the events and create the according list items
GlobalEventManager().foreachEvent(populator);

_treeView->TriggerColumnSizeEvent();
}

void CommandList::populateWindow()
Expand Down
2 changes: 2 additions & 0 deletions radiant/ui/common/TexturePreviewCombo.cpp
Expand Up @@ -73,6 +73,8 @@ void TexturePreviewCombo::refreshInfoTable()
_infoTable->Append(_("Shader"), shader->getName());
_infoTable->Append(_("Defined in"), shader->getShaderFileName());
_infoTable->Append(_("Description"), shader->getDescription());

_infoTable->TriggerColumnSizeEvent();
}

// Popup menu callbacks
Expand Down
2 changes: 1 addition & 1 deletion radiant/ui/prefdialog/PrefDialog.cpp
Expand Up @@ -101,7 +101,7 @@ void PrefDialog::showModal(const std::string& requestedPage)
_notebook->ExpandNode(page, true);
}

FitToScreen(0.5f, 0.5f);
FitToScreen(0.7f, 0.5f);

// Is there a specific page display request?
if (!requestedPage.empty())
Expand Down
20 changes: 20 additions & 0 deletions tools/xcode/DarkRadiant.xcodeproj/project.pbxproj
Expand Up @@ -11300,6 +11300,8 @@
GCC_ENABLE_CPP_RTTI = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SRCROOT)/../../plugins/entity/precompiled.cpp";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
Expand Down Expand Up @@ -11348,6 +11350,8 @@
GCC_ENABLE_CPP_EXCEPTIONS = YES;
GCC_ENABLE_CPP_RTTI = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SRCROOT)/../../plugins/entity/precompiled.cpp";
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
Expand Down Expand Up @@ -12675,6 +12679,8 @@
GCC_ENABLE_CPP_RTTI = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SRCROOT)/../../plugins/script/precompiled.cpp";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
Expand Down Expand Up @@ -12723,6 +12729,8 @@
GCC_ENABLE_CPP_EXCEPTIONS = YES;
GCC_ENABLE_CPP_RTTI = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SRCROOT)/../../plugins/script/precompiled.cpp";
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
Expand Down Expand Up @@ -13698,6 +13706,8 @@
GCC_ENABLE_CPP_RTTI = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SRCROOT)/../../plugins/dm.objectives/precompiled.cpp";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
Expand Down Expand Up @@ -13746,6 +13756,8 @@
GCC_ENABLE_CPP_EXCEPTIONS = YES;
GCC_ENABLE_CPP_RTTI = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SRCROOT)/../../plugins/dm.objectives/precompiled.cpp";
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
Expand Down Expand Up @@ -13791,6 +13803,8 @@
GCC_ENABLE_CPP_RTTI = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SRCROOT)/../../plugins/dm.stimresponse/precompiled.cpp";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
Expand Down Expand Up @@ -13839,6 +13853,8 @@
GCC_ENABLE_CPP_EXCEPTIONS = YES;
GCC_ENABLE_CPP_RTTI = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SRCROOT)/../../plugins/dm.stimresponse/precompiled.cpp";
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
Expand Down Expand Up @@ -13882,6 +13898,8 @@
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SRCROOT)/../../radiant/precompiled.cpp";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
Expand Down Expand Up @@ -13929,6 +13947,8 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SRCROOT)/../../radiant/precompiled.cpp";
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
Expand Down
Expand Up @@ -574,7 +574,7 @@
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
Expand Down
6 changes: 3 additions & 3 deletions tools/xcode/package_bundle.sh
@@ -1,4 +1,4 @@
# This script takes copies the .dylib files DarkRadiant is depending on to the bundle's MacOS folder.
# This script copies the .dylib files DarkRadiant is depending on to the bundle's MacOS folder.
# Secondly, it's fixing up the dylib references in all the binaries recursively, replacing
# the hardcoded /opt/local/* paths with @executable_path, making use of otool and install_name_tool

Expand Down Expand Up @@ -102,8 +102,8 @@ done

echo Patching Main Executable $APP

pwd
otool -L $APP
#pwd
#otool -L $APP

# Replace the 3.0 version references with 3.0.0 ones
fileRegex=(\(libwx_[A-Za-z_]+-\)\([0-9]\.[0-9]\)\.dylib)
Expand Down

0 comments on commit 04759ba

Please sign in to comment.