forked from townforge/townforge
fix most build problems on mac
This commit is contained in:
parent
fc21a69965
commit
d9d234a9fe
@ -307,7 +307,16 @@ endif()
|
||||
# elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*")
|
||||
# set(BSDI TRUE)
|
||||
|
||||
include_directories(external/rapidjson/include external/easylogging++ src contrib/epee/include external)
|
||||
if (APPLE)
|
||||
# set boost directories early to override any /usr/local/include from elsewhere that might find boost there
|
||||
set(Boost_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/external/boost-libs/install/include)
|
||||
set(Boost_LIBRARY_DIRS ${CMAKE_CURRENT_BINARY_DIR}/external/boost-libs/install/lib/)
|
||||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
link_directories(${Boost_LIBRARY_DIRS})
|
||||
link_directories(${CMAKE_CURRENT_BINARY_DIR}/external/unbound)
|
||||
endif()
|
||||
|
||||
include_directories(external/db_drivers/liblmdb external/rapidjson/include external/easylogging++ src contrib/epee/include external)
|
||||
|
||||
if(APPLE)
|
||||
include_directories(SYSTEM /usr/include/malloc)
|
||||
@ -897,8 +906,8 @@ set(Boost_PROGRAM_OPTIONS_LIBRARY ${Boost_LIBRARY_DIRS}/libboost_program_options
|
||||
set(Boost_SERIALIZATION_LIBRARY ${Boost_LIBRARY_DIRS}/libboost_serialization.a)
|
||||
set(Boost_THREAD_LIBRARY ${Boost_LIBRARY_DIRS}/libboost_thread.a)
|
||||
set(Boost_SYSTEM_LIBRARY ${Boost_LIBRARY_DIRS}/libboost_system.a)
|
||||
|
||||
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
|
||||
link_directories(SYSTEM ${Boost_LIBRARY_DIRS})
|
||||
|
||||
if(MINGW)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wa,-mbig-obj")
|
||||
|
2
external/tb
vendored
2
external/tb
vendored
@ -1 +1 @@
|
||||
Subproject commit da5a318e61322b7a33afe46dc28c667c0dc2a067
|
||||
Subproject commit fc25f698cd0926c0e1616a841117d9db433ef447
|
@ -2481,7 +2481,7 @@ bool t_rpc_command_executor::cc_get_account(uint32_t id, const std::string &data
|
||||
ss << (ss.str().empty() ? "" : ", ") << e.type << ": " << e.amount;
|
||||
tools::success_msg_writer() << "Item balances: " << ss.str();
|
||||
tools::success_msg_writer() << "Flags: " << boost::join(res.flags | boost::adaptors::transformed([](uint32_t id){return std::to_string(id);}), " ");
|
||||
ss = {};
|
||||
ss = std::stringstream();
|
||||
for (const auto &e: res.badges)
|
||||
ss << (ss.str().empty() ? "" : ", ") << e.type << ": level " << (unsigned)(e.level);
|
||||
tools::success_msg_writer() << "Badges: " << ss.str();
|
||||
@ -2580,7 +2580,7 @@ bool t_rpc_command_executor::cc_get_flag(uint32_t id, const std::string &data, b
|
||||
if (e.type > 0)
|
||||
ss << (unsigned)e.type << ": " << std::to_string(e.amount) << ", ";
|
||||
tools::success_msg_writer() << "Budget: " << ss.str();
|
||||
ss = {};
|
||||
ss = std::stringstream();
|
||||
for (size_t i = 0; i < res.palette.size(); ++i)
|
||||
{
|
||||
const uint16_t variant = res.palette[i];
|
||||
|
@ -224,12 +224,12 @@ else()
|
||||
set(URHO3D_LIBRARY "${CMAKE_BINARY_DIR}/external/urho3d/lib/${CMAKE_SHARED_LIBRARY_PREFIX}Urho3D${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
set(TB_LIBRARY "${CMAKE_BINARY_DIR}/external/tb/src/tb/${CMAKE_SHARED_LIBRARY_PREFIX}TurboBadgerLib${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
endif()
|
||||
include_directories("${CMAKE_SOURCE_DIR}/external/procsky")
|
||||
include_directories("${CMAKE_BINARY_DIR}/external/urho3d/include")
|
||||
include_directories("${CMAKE_BINARY_DIR}/external/urho3d/include/Urho3D/ThirdParty")
|
||||
include_directories("${CMAKE_SOURCE_DIR}/external/tb/src")
|
||||
include_directories("${CMAKE_SOURCE_DIR}/external/tb/src/tb")
|
||||
include_directories("${CMAKE_BINARY_DIR}/external/tb/src/tb")
|
||||
include_directories(BEFORE "${CMAKE_SOURCE_DIR}/external/procsky")
|
||||
include_directories(BEFORE "${CMAKE_BINARY_DIR}/external/urho3d/include")
|
||||
include_directories(BEFORE "${CMAKE_BINARY_DIR}/external/urho3d/include/Urho3D/ThirdParty")
|
||||
include_directories(BEFORE "${CMAKE_SOURCE_DIR}/external/tb/src")
|
||||
include_directories(BEFORE "${CMAKE_SOURCE_DIR}/external/tb/src/tb")
|
||||
include_directories(BEFORE "${CMAKE_BINARY_DIR}/external/tb/src/tb")
|
||||
target_link_libraries(game
|
||||
PRIVATE
|
||||
game_util
|
||||
|
@ -97,6 +97,16 @@ UIFoundCityDialog::UIFoundCityDialog(Context *ctx, const GameState *game):
|
||||
|
||||
UIFoundCityDialog::~UIFoundCityDialog()
|
||||
{
|
||||
delete[] elevationMap;
|
||||
delete[] stabilityMap;
|
||||
delete[] agricultureMap;
|
||||
delete[] geothermalHeatingMap;
|
||||
delete[] gemstoneMap;
|
||||
delete[] woodTypeMap;
|
||||
delete[] woodQuantityMap;
|
||||
delete[] stoneTypeMap;
|
||||
delete[] stoneQuantityMap;
|
||||
delete[] manualMap;
|
||||
}
|
||||
|
||||
void UIFoundCityDialog::HandleCancel(StringHash eventType, VariantMap& eventData)
|
||||
@ -205,7 +215,7 @@ void UIFoundCityDialog::UpdateValue()
|
||||
{
|
||||
const int selected = mapsWidget->GetValue();
|
||||
|
||||
std::shared_ptr<uint8_t[]> rgb;
|
||||
uint8_t *rgb = NULL;
|
||||
switch (selected)
|
||||
{
|
||||
case 0: rgb = elevationMap; break;
|
||||
@ -249,7 +259,7 @@ void UIFoundCityDialog::UpdateMaps(bool manual_only)
|
||||
uint32_t ox, oy;
|
||||
cc::get_city_origin(id == -1 ? expected_city_id : id, ox, oy);
|
||||
|
||||
auto update_map = [zoom, dx, dy](UITBAnimatedImageWidget *widget, std::shared_ptr<uint8_t[]> &rgb, const std::function<uint8_t(uint32_t, uint32_t)> &f)
|
||||
auto update_map = [zoom, dx, dy](UITBAnimatedImageWidget *widget, uint8_t *rgb, const std::function<uint8_t(uint32_t, uint32_t)> &f)
|
||||
{
|
||||
for (uint32_t y = 0; y < map_size; ++y)
|
||||
{
|
||||
@ -283,7 +293,7 @@ void UIFoundCityDialog::UpdateMaps(bool manual_only)
|
||||
rgb[pidx*4+0] = 0xff;
|
||||
rgb[pidx*4+1] = 0;
|
||||
}
|
||||
std::shared_ptr<tb::TBBitmap> bitmap(UTBRendererBatcher::Singleton().CreateBitmap(map_size, map_size, (uint32_t*)rgb.get()));
|
||||
std::shared_ptr<tb::TBBitmap> bitmap(UTBRendererBatcher::Singleton().CreateBitmap(map_size, map_size, (uint32_t*)rgb));
|
||||
widget->SetAnimation(std::vector<std::pair<std::shared_ptr<tb::TBBitmap>, unsigned int>>(1, std::make_pair(std::move(bitmap), 1)));
|
||||
};
|
||||
|
||||
|
@ -91,16 +91,16 @@ private:
|
||||
uint64_t cost;
|
||||
uint32_t expected_city_id;
|
||||
|
||||
std::shared_ptr<uint8_t[]> elevationMap;
|
||||
std::shared_ptr<uint8_t[]> stabilityMap;
|
||||
std::shared_ptr<uint8_t[]> agricultureMap;
|
||||
std::shared_ptr<uint8_t[]> geothermalHeatingMap;
|
||||
std::shared_ptr<uint8_t[]> gemstoneMap;
|
||||
std::shared_ptr<uint8_t[]> woodTypeMap;
|
||||
std::shared_ptr<uint8_t[]> woodQuantityMap;
|
||||
std::shared_ptr<uint8_t[]> stoneTypeMap;
|
||||
std::shared_ptr<uint8_t[]> stoneQuantityMap;
|
||||
std::shared_ptr<uint8_t[]> manualMap;
|
||||
uint8_t *elevationMap;
|
||||
uint8_t *stabilityMap;
|
||||
uint8_t *agricultureMap;
|
||||
uint8_t *geothermalHeatingMap;
|
||||
uint8_t *gemstoneMap;
|
||||
uint8_t *woodTypeMap;
|
||||
uint8_t *woodQuantityMap;
|
||||
uint8_t *stoneTypeMap;
|
||||
uint8_t *stoneQuantityMap;
|
||||
uint8_t *manualMap;
|
||||
|
||||
int mouse_x;
|
||||
int mouse_y;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
#include <Urho3D/Resource/ResourceCache.h>
|
||||
#include <Urho3D/Core/Context.h>
|
||||
#include <Urho3D/UI/UI.h>
|
||||
|
Loading…
Reference in New Issue
Block a user