Commit d39564dc authored by Jörg Frings-Fürst's avatar Jörg Frings-Fürst

New upstream version 120.2.2

parent 5b8fd43c
This diff is collapsed.
#!/bin/sh
# find the cpu type for SDL
sdl_cpu="`uname -p`"
if [ "${sdl_cpu}" == "i386" ]
then
# OSX 10.4 for intel uses ppc SDL
os_version="`/usr/sbin/system_profiler SPSoftwareDataType -detailLevel mini | egrep '(System Version): ' | cut -d: -f2-`"
os_version="${os_version#*10.}"
os_version="${os_version%.*}"
if [ "${os_version}" == "4" ]
then
sdl_cpu="ppc"
fi
fi
framework_path="${0%/*}"
if [ "${framework_path:0:1}" != "/" ]
then
framework_path="`pwd`"
fi
framework_path="${framework_path}/../Frameworks"
# remake the link every time. The bundle might have been moved to a new system.
ln -f -s "${framework_path}/SDL-${sdl_cpu}.framework" "${framework_path}/SDL.framework"
# execute the game
"${0}.`uname -p`"
# open the console if the game crashed
if [ "$?" != "0" ]
then
/usr/bin/osascript <<-EOF
tell application "Console" to activate
EOF
fi
# Makefile to build bundle applications for Mac OS X
# bundle makes a bundle designed to work on the system it was build on
# bundle_dist makes a bundle, which should work on all supported systems (custom config needed)
# Variables:
# CXXHOST CXX for host system. Only used when crosscompiling.
# BINARY_PPC path to the binary for PPC
# BINARY_i386 path to the binary for i386 (default $(PROGDIR)/$(PROG))
# SDL_PPC path to SDL.framwork for PPC
# SDL_i386 path to SDL.framwork for i386 (default ../Frameworks/SDL.framework)
# The name of the project is simutrans => thus we want to build the default bundle under simutrans
PROGNAME = $(PROG)
ifeq ($(PROGNAME),sim)
PROGNAME := "simutrans"
endif
CXXHOST ?= $(CXX)
BINARY_i386 ?= "$(PROGDIR)/$(PROG).app/Contents/MacOS/$(PROG)"
SDL_i386 ?= "../Frameworks/SDL.framework"
.PHONY: bundle bundle_dist
"OSX/getversion": OSX/getversion.cc simversion.h
@echo "===> Building $@"
$(Q)$(CXXHOST) "OSX/getversion.cc" -o $@
bundle: all "OSX/getversion"
@echo "===> Building bundle"
$(Q)rm -fr "$(PROGDIR)/$(PROG).app"
$(Q)mkdir -p "$(PROGDIR)/$(PROG).app/Contents/MacOS"
$(Q)mkdir -p "$(PROGDIR)/$(PROG).app/Contents/Resources"
$(Q)cp "$(PROGDIR)/$(PROG)" "$(PROGDIR)/$(PROG).app/Contents/MacOS/$(PROG)"
$(Q)cp "OSX/simutrans.icns" "$(PROGDIR)/$(PROG).app/Contents/Resources/$(PROG).icns"
$(Q)echo "APPL????" > "$(PROGDIR)/$(PROG).app/Contents/PkgInfo"
$(Q)OSX/plistgen.sh "$(PROGDIR)/$(PROG).app" "$(PROG)"
bundle_dist: bundle
@echo "===> Changing bundle to be distributable"
$(Q)mkdir -p "$(PROGDIR)/$(PROG).app/Contents/Frameworks"
$(Q)cp "$(BINARY_i386)" "$(PROGDIR)/$(PROG).app/Contents/MacOS/$(PROG).i386"
$(Q)cp "$(BINARY_PPC)" "$(PROGDIR)/$(PROG).app/Contents/MacOS/$(PROG).ppc"
$(Q)cp "OSX/binary_picker.sh" "$(PROGDIR)/$(PROG).app/Contents/MacOS/$(PROG)"
$(Q)cp -r "$(SDL_PPC)" "$(PROGDIR)/$(PROG).app/Contents/Frameworks/SDL-ppc.framework"
$(Q)cp -r "$(SDL_i386)" "$(PROGDIR)/$(PROG).app/Contents/Frameworks/SDL-i386.framework"
#!/bin/sh
date=`date +%Y`
PROG="$2"
COPYRIGHT="Copyright 1997-${date} by the simutrans team"
if [ -z "$3" ]; then
VERSION="`OSX/getversion`"
else
VERSION=$3
fi
echo "Executable $PROG"
echo "$VERSION"
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"
\"http://www.apple.com/DTDs/Prop$
<plist version=\"1.0\">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>${PROG}</string>
<key>CFBundleExecutable</key>
<string>${PROG}</string>
<key>CFBundleGetInfoString</key>
<string>${VERSION}, ${COPYRIGHT}</string>
<key>CFBundleIconFile</key>
<string>${PROG}.icns</string>
<key>CFBundleIdentifier</key>
<string>org.${PROG}.${PROG}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PROG}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${VERSION}</string>
<key>CFBundleVersion</key>
<string>${VERSION}</string>
<key>NSHumanReadableCopyright</key>
<string>${COPYRIGHT}</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>" > "$1"/Contents/Info.plist
#!/bin/sh
"${0}.`uname -p`"
if [ "$?" != "0" ]
then
/usr/bin/osascript <<-EOF
tell application "Console" to activate
EOF
fi
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true/PM</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
This diff is collapsed.
......@@ -10,28 +10,28 @@
#include "../dataobj/koord.h"
#include "../dataobj/koord3d.h"
class bruecke_besch_t;
class bridge_desc_t;
class grund_t;
class karte_ptr_t;
class player_t; // Hajo: 22-Nov-01: Added forward declaration
class weg_besch_t;
class way_desc_t;
class tool_selector_t;
/**
* Bridge management: builds bridges, manages list of available bridge types
* Bridges should not be built directly but always by calling brueckenbauer_t::baue().
* Bridges should not be built directly but always by calling bridge_builder_t::build().
*/
class brueckenbauer_t {
class bridge_builder_t {
private:
brueckenbauer_t() {} ///< private -> no instance please
bridge_builder_t() {} ///< private -> no instance please
static karte_ptr_t welt;
static bool is_blocked(koord3d pos, ribi_t::ribi check_ribi, const char *&error_msg);
static bool is_monorail_junction(koord3d pos, player_t *player, const bruecke_besch_t *besch, const char *&error_msg);
static bool is_monorail_junction(koord3d pos, player_t *player, const bridge_desc_t *desc, const char *&error_msg);
public:
/**
* Finds the position of the end of the bridge. Does all kind of checks.
......@@ -42,14 +42,14 @@ public:
* @param sp active player, needed to check scenario conditions
* @param pos the position of the start of the bridge
* @param zv desired direction of the bridge
* @param besch the description of the bridge
* @param desc the description of the bridge
* @param error_msg an error message when the search fails.
* @param bridge_height on success, the height of the bridge that we can build
* @param ai_bridge if this bridge is being built by an AI
* @param min_length the minimum length of the bridge.
* @return the position of the other end of the bridge or koord3d::invalid if no possible end is found
*/
static koord3d finde_ende(player_t *player, koord3d pos, const koord zv, const bruecke_besch_t *besch, const char *&error_msg, sint8 &bridge_height, bool ai_bridge=false, uint32 min_length=0, bool high_bridge = false );
static koord3d find_end_pos(player_t *player, koord3d pos, const koord zv, const bridge_desc_t *desc, const char *&error_msg, sint8 &bridge_height, bool ai_bridge=false, uint32 min_length=0, bool high_bridge = false );
/**
* Checks whether given tile @p gr is suitable for placing bridge ramp.
......@@ -58,7 +58,7 @@ public:
* @param gr the ground to check.
* @return true, if bridge ramp can be built here.
*/
static bool ist_ende_ok(player_t *player, const grund_t *gr, waytype_t wt, ribi_t::ribi r );
static bool can_place_ramp(player_t *player, const grund_t *gr, waytype_t wt, ribi_t::ribi r );
/**
* Checks if a bridge starts on @p gr
......@@ -74,38 +74,38 @@ public:
* @param sp the player wanting to build the bridge
* @param end the position of the ramp
* @param zv direction the bridge will face
* @param besch the bridge description.
* @param desc the bridge description.
*/
static void baue_auffahrt(player_t *player, koord3d end, ribi_t::ribi ribi_neu, hang_t::typ weg_hang, const bruecke_besch_t *besch);
static void build_ramp(player_t *player, koord3d end, ribi_t::ribi ribi_neu, slope_t::type weg_hang, const bridge_desc_t *desc);
/**
* Actually builds the bridge without checks.
* Therefore checks should be done before in
* brueckenbauer_t::baue().
* bridge_builder_t::build().
*
* @param sp the master builder of the bridge.
* @param start start position.
* @param end end position
* @param zv direction the bridge will face
* @param bridge_height the height above start.z that the bridge will have
* @param besch bridge description.
* @param weg_besch description of the way to be built on the bridge
* @param desc bridge description.
* @param way_desc description of the way to be built on the bridge
*/
static void baue_bruecke(player_t *player, const koord3d start, const koord3d end, koord zv, sint8 bridge_height, const bruecke_besch_t *besch, const weg_besch_t *weg_besch);
static void build_bridge(player_t *player, const koord3d start, const koord3d end, koord zv, sint8 bridge_height, const bridge_desc_t *desc, const way_desc_t *way_desc);
/**
* Registers a new bridge type and adds it to the list of build tools.
*
* @param besch Description of the bridge to register.
* @param desc Description of the bridge to register.
*/
static void register_besch(bruecke_besch_t *besch);
static void register_desc(bridge_desc_t *desc);
/**
* Method to retrieve bridge descriptor
* @param name name of the bridge
* @return bridge descriptor or NULL if not found
*/
static const bruecke_besch_t *get_besch(const char *name);
static const bridge_desc_t *get_desc(const char *name);
/**
* Builds the bridge and performs all checks.
......@@ -113,10 +113,10 @@ public:
*
* @param sp The player wanting to build the bridge.
* @param pos the start of the bridge.
* @param besch Description of the bridge to build
* @param desc Description of the bridge to build
* @return NULL on success or error message otherwise
*/
static const char *baue( player_t *player, const koord3d pos, const bruecke_besch_t *besch);
static const char *build( player_t *player, const koord3d pos, const bridge_desc_t *desc);
/**
* Removes a bridge
......@@ -134,7 +134,7 @@ public:
* @param time current in-game time
* @return bridge descriptor or NULL
*/
static const bruecke_besch_t *find_bridge(const waytype_t wtyp, const sint32 min_speed,const uint16 time);
static const bridge_desc_t *find_bridge(const waytype_t wtyp, const sint32 min_speed,const uint16 time);
/**
* Fill menu with icons for all ways of the given waytype
......@@ -143,6 +143,11 @@ public:
* @param welt the current world
*/
static void fill_menu(tool_selector_t *tool_selector, const waytype_t wtyp, sint16 sound_ok);
/**
* Returns a list with available bridge types.
*/
static const vector_tpl<const bridge_desc_t *>& get_available_bridges(const waytype_t wtyp);
};
#endif
This diff is collapsed.
......@@ -5,16 +5,16 @@
* (see licence.txt)
*/
#ifndef fabrikbauer_t_h
#define fabrikbauer_t_h
#ifndef factory_builder_t_h
#define factory_builder_t_h
#include "../tpl/stringhashtable_tpl.h"
#include "../tpl/weighted_vector_tpl.h"
#include "../dataobj/koord3d.h"
class haus_besch_t;
class ware_besch_t;
class fabrik_besch_t;
class building_desc_t;
class goods_desc_t;
class factory_desc_t;
class stadt_t;
class karte_ptr_t;
class player_t;
......@@ -23,74 +23,74 @@ class fabrik_t;
/**
* This class builds factories. Never construct factories directly
* but always by calling fabrikbauer_t::baue() (for a single factory)
* or fabrikbauer_t::baue_hierachie() (for a full chain of suppliers).
* but always by calling factory_builder_t::build() (for a single factory)
* or factory_builder_t::baue_hierachie() (for a full chain of suppliers).
*/
class fabrikbauer_t
class factory_builder_t
{
private:
static karte_ptr_t welt;
/**
* @class fabs_to_crossconnect_t
* @class factories_to_crossconnect_t
* Used for cross-connection checks between factories.
* This is necessary for finding producers for factory supply.
*/
class fabs_to_crossconnect_t {
class factories_to_crossconnect_t {
public:
fabrik_t *fab; ///< The factory
sint32 demand; ///< To how many factories this factory needs to connect to
fabs_to_crossconnect_t() { fab = NULL; demand = 0; }
fabs_to_crossconnect_t(fabrik_t *f, sint32 d) { fab = f; demand = d; }
factories_to_crossconnect_t() { fab = NULL; demand = 0; }
factories_to_crossconnect_t(fabrik_t *f, sint32 d) { fab = f; demand = d; }
bool operator == (const fabs_to_crossconnect_t& x) const { return fab == x.fab; }
bool operator != (const fabs_to_crossconnect_t& x) const { return fab != x.fab; }
bool operator == (const factories_to_crossconnect_t& x) const { return fab == x.fab; }
bool operator != (const factories_to_crossconnect_t& x) const { return fab != x.fab; }
};
/// Table of all factories that can be built
static stringhashtable_tpl<const fabrik_besch_t