Merge branch 'master' of https://github.com/oy/teeworlds into DDRace

Conflicts:
	bam.lua
	scripts/make_release.py
This commit is contained in:
Shereef Marzouk 2011-12-14 17:01:47 +02:00
commit c496bf3c4e
6 changed files with 136 additions and 53 deletions

152
bam.lua
View file

@ -349,7 +349,7 @@ release_sql_settings.debug = 0
release_sql_settings.optimize = 1
release_sql_settings.cc.defines:Add("CONF_RELEASE", "CONF_SQL")
if platform == "macosx" and arch == "ia32" then
if platform == "macosx" then
debug_settings_ppc = debug_settings:Copy()
debug_settings_ppc.config_name = "debug_ppc"
debug_settings_ppc.config_ext = "_ppc_d"
@ -378,54 +378,116 @@ if platform == "macosx" and arch == "ia32" then
release_sql_settings_ppc.link.flags:Add("-arch ppc")
release_sql_settings_ppc.cc.defines:Add("CONF_RELEASE", "CONF_SQL")
debug_settings_x86 = debug_settings:Copy()
debug_settings_x86.config_name = "debug_x86"
debug_settings_x86.config_ext = "_x86_d"
debug_settings_x86.cc.flags:Add("-arch i386")
debug_settings_x86.link.flags:Add("-arch i386")
debug_settings_x86.cc.defines:Add("CONF_DEBUG")
debug_sql_settings_x86 = debug_sql_settings:Copy()
debug_sql_settings_x86.config_name = "sql_debug_x86"
debug_sql_settings_x86.config_ext = "_sql_x86_d"
debug_sql_settings_x86.cc.flags:Add("-arch i386")
debug_sql_settings_x86.link.flags:Add("-arch i386")
debug_sql_settings_x86.cc.defines:Add("CONF_DEBUG", "CONF_SQL")
release_settings_x86 = release_settings:Copy()
release_settings_x86.config_name = "release_x86"
release_settings_x86.config_ext = "_x86"
release_settings_x86.cc.flags:Add("-arch i386")
release_settings_x86.link.flags:Add("-arch i386")
release_settings_x86.cc.defines:Add("CONF_RELEASE")
release_sql_settings_x86 = release_sql_settings:Copy()
release_sql_settings_x86.config_name = "sql_release_x86"
release_sql_settings_x86.config_ext = "_sql_x86"
release_sql_settings_x86.cc.flags:Add("-arch i386")
release_sql_settings_x86.link.flags:Add("-arch i386")
release_sql_settings_x86.cc.defines:Add("CONF_RELEASE", "CONF_SQL")
ppc_d = build(debug_settings_ppc)
x86_d = build(debug_settings_x86)
sql_ppc_d = build(debug_sql_settings_ppc)
sql_x86_d = build(debug_sql_settings_x86)
ppc_r = build(release_settings_ppc)
x86_r = build(release_settings_x86)
sql_ppc_d = build(debug_sql_settings_ppc)
sql_ppc_r = build(release_sql_settings_ppc)
sql_x86_r = build(release_sql_settings_x86)
DefaultTarget("game_debug_x86")
PseudoTarget("release", ppc_r, x86_r)
PseudoTarget("sql_release", sql_ppc_r, sql_x86_r)
PseudoTarget("debug", ppc_d, x86_d)
PseudoTarget("sql_debug", sql_ppc_d, sql_x86_d)
PseudoTarget("server_release", "server_release_x86", "server_release_ppc")
PseudoTarget("server_sql_release", "server_sql_release_x86", "server_sql_release_ppc")
PseudoTarget("server_debug", "server_debug_x86", "server_debug_ppc")
PseudoTarget("server_sql_debug", "server_sql_debug_x86", "server_sql_debug_ppc")
PseudoTarget("client_release", "client_release_x86", "client_release_ppc")
PseudoTarget("client_debug", "client_debug_x86", "client_debug_ppc")
if arch == "ia32" or arch == "amd64" then
debug_settings_x86 = debug_settings:Copy()
debug_settings_x86.config_name = "debug_x86"
debug_settings_x86.config_ext = "_x86_d"
debug_settings_x86.cc.flags:Add("-arch i386")
debug_settings_x86.link.flags:Add("-arch i386")
debug_settings_x86.cc.defines:Add("CONF_DEBUG")
debug_sql_settings_x86 = debug_sql_settings:Copy()
debug_sql_settings_x86.config_name = "sql_debug_x86"
debug_sql_settings_x86.config_ext = "_sql_x86_d"
debug_sql_settings_x86.cc.flags:Add("-arch i386")
debug_sql_settings_x86.link.flags:Add("-arch i386")
debug_sql_settings_x86.cc.defines:Add("CONF_DEBUG", "CONF_SQL")
release_settings_x86 = release_settings:Copy()
release_settings_x86.config_name = "release_x86"
release_settings_x86.config_ext = "_x86"
release_settings_x86.cc.flags:Add("-arch i386")
release_settings_x86.link.flags:Add("-arch i386")
release_settings_x86.cc.defines:Add("CONF_RELEASE")
release_sql_settings_x86 = release_sql_settings:Copy()
release_sql_settings_x86.config_name = "sql_release_x86"
release_sql_settings_x86.config_ext = "_sql_x86"
release_sql_settings_x86.cc.flags:Add("-arch i386")
release_sql_settings_x86.link.flags:Add("-arch i386")
release_sql_settings_x86.cc.defines:Add("CONF_RELEASE", "CONF_SQL")
x86_d = build(debug_settings_x86)
sql_x86_d = build(debug_sql_settings_x86)
x86_r = build(release_settings_x86)
sql_x86_r = build(release_sql_settings_x86)
end
if arch == "amd64" then
debug_settings_x86_64 = debug_settings:Copy()
debug_settings_x86_64.config_name = "debug_x86_64"
debug_settings_x86_64.config_ext = "_x86_64_d"
debug_settings_x86_64.cc.flags:Add("-arch x86_64")
debug_settings_x86_64.link.flags:Add("-arch x86_64")
debug_settings_x86_64.cc.defines:Add("CONF_DEBUG")
debug_sql_settings_x86_64 = debug_sql_settings:Copy()
debug_sql_settings_x86_64.config_name = "sql_debug_x86_64"
debug_sql_settings_x86_64.config_ext = "_sql_x86_64_d"
debug_sql_settings_x86_64.cc.flags:Add("-arch x86_64")
debug_sql_settings_x86_64.link.flags:Add("-arch x86_64")
debug_sql_settings_x86_64.cc.defines:Add("CONF_DEBUG", "CONF_SQL")
release_settings_x86_64 = release_settings:Copy()
release_settings_x86_64.config_name = "release_x86_64"
release_settings_x86_64.config_ext = "_x86_64"
release_settings_x86_64.cc.flags:Add("-arch x86_64")
release_settings_x86_64.link.flags:Add("-arch x86_64")
release_settings_x86_64.cc.defines:Add("CONF_RELEASE")
release_sql_settings_x86_64 = release_sql_settings:Copy()
release_sql_settings_x86_64.config_name = "sql_release_x86_64"
release_sql_settings_x86_64.config_ext = "_sql_x86_64"
release_sql_settings_x86_64.cc.flags:Add("-arch x86_64")
release_sql_settings_x86_64.link.flags:Add("-arch x86_64")
release_sql_settings_x86_64.cc.defines:Add("CONF_RELEASE", "CONF_SQL")
x86_d = build(debug_settings_x86_64)
sql_x86_d = build(debug_sql_settings_x86_64)
x86_r = build(release_settings_x86_64)
sql_x86_r = build(release_sql_settings_x86_64)
end
DefaultTarget("game_debug_x86")
if arch == "ia32" then
PseudoTarget("release", ppc_r, x86_r)
PseudoTarget("debug", ppc_d, x86_d)
PseudoTarget("server_release", "server_release_x86", "server_release_ppc")
PseudoTarget("server_debug", "server_debug_x86", "server_debug_ppc")
PseudoTarget("client_release", "client_release_x86", "client_release_ppc")
PseudoTarget("client_debug", "client_debug_x86", "client_debug_ppc")
PseudoTarget("sql_release", sql_ppc_r, sql_x86_r)
PseudoTarget("sql_debug", sql_ppc_d, sql_x86_d)
PseudoTarget("server_sql_release", "server_sql_release_x86", "server_sql_release_ppc")
PseudoTarget("server_sql_debug", "server_sql_debug_x86", "server_sql_debug_ppc")
elseif arch == "amd64" then
PseudoTarget("release", ppc_r, x86_r, x86_64_r)
PseudoTarget("debug", ppc_d, x86_d, x86_64_d)
PseudoTarget("server_release", "server_release_x86", "server_release_x86_64", "server_release_ppc")
PseudoTarget("server_debug", "server_debug_x86", "server_release_x86_64", "server_debug_ppc")
PseudoTarget("client_release", "client_release_x86", "server_release_x86_64", "client_release_ppc")
PseudoTarget("client_debug", "client_debug_x86", "server_release_x86_64", "client_debug_ppc")
PseudoTarget("sql_release", sql_ppc_r, sql_x86_r, sql_x86_64_r)
PseudoTarget("sql_debug", sql_ppc_d, sql_x86_d, sql_x86_64_r)
PseudoTarget("server_sql_release", "server_sql_release_x86", "server_sql_release_x86_64", "server_sql_release_ppc")
PseudoTarget("server_sql_debug", "server_sql_debug_x86", "server_sql_debug_x86_64", "server_sql_debug_ppc")
else
PseudoTarget("release", ppc_r)
PseudoTarget("debug", ppc_d)
PseudoTarget("server_release", "server_release_ppc")
PseudoTarget("server_debug", "server_debug_ppc")
PseudoTarget("client_release", "client_release_ppc")
PseudoTarget("client_debug", "client_debug_ppc")
PseudoTarget("sql_release", sql_ppc_r)
PseudoTarget("sql_debug", sql_ppc_d)
PseudoTarget("server_sql_release", "server_sql_release_ppc")
PseudoTarget("server_sql_debug", "server_sql_debug_ppc")
end
else
build(debug_settings)
build(debug_sql_settings)

View file

@ -93,9 +93,16 @@ if include_src:
shutil.copy("configure.lua", package_dir)
if use_bundle:
os.system("lipo -create -output "+name+"-Server "+name+"-Server"+"_ppc "+name+"-Server"+"_x86")
os.system("lipo -create -output "+name+" "+name+"_ppc "+name+"_x86")
os.system("lipo -create -output serverlaunch serverlaunch_ppc serverlaunch_x86")
bins = [name, name+'-Server', 'serverlaunch']
platforms = ('x86', 'x86_64', 'ppc')
for bin in bins:
to_lipo = []
for p in platforms:
fname = bin+'_'+p
if os.path.isfile(fname):
to_lipo.append(fname)
if to_lipo:
os.system("lipo -create -output "+bin+" "+" ".join(to_lipo))
# create Teeworlds appfolder
clientbundle_content_dir = os.path.join(package_dir, "DDRace.app/Contents")

View file

@ -381,6 +381,8 @@ int CGraphics_OpenGL::LoadTexture(const char *pFilename, int StorageType, int St
ID = LoadTextureRaw(Img.m_Width, Img.m_Height, Img.m_Format, Img.m_pData, StoreFormat, Flags);
mem_free(Img.m_pData);
if(ID != m_InvalidTexture && g_Config.m_Debug)
dbg_msg("graphics/texture", "loaded %s", pFilename);
return ID;
}

View file

@ -6,6 +6,7 @@
#include <engine/console.h>
#include <engine/graphics.h>
#include <engine/storage.h>
#include <engine/shared/config.h>
#include <engine/shared/linereader.h>
#include "countryflags.h"
@ -72,8 +73,11 @@ void CCountryFlags::LoadCountryflagsIndexfile()
str_copy(CountryFlag.m_aCountryCodeString, aOrigin, sizeof(CountryFlag.m_aCountryCodeString));
CountryFlag.m_Texture = Graphics()->LoadTextureRaw(Info.m_Width, Info.m_Height, Info.m_Format, Info.m_pData, Info.m_Format, 0);
mem_free(Info.m_pData);
str_format(aBuf, sizeof(aBuf), "loaded country flag '%s'", aOrigin);
Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "countryflags", aBuf);
if(g_Config.m_Debug)
{
str_format(aBuf, sizeof(aBuf), "loaded country flag '%s'", aOrigin);
Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "countryflags", aBuf);
}
m_aCountryFlags.add(CountryFlag);
}
io_close(File);

View file

@ -7,6 +7,7 @@
#include <engine/graphics.h>
#include <engine/storage.h>
#include <engine/shared/config.h>
#include "skins.h"
@ -103,8 +104,11 @@ int CSkins::SkinScan(const char *pName, int IsDir, int DirType, void *pUser)
// set skin data
str_copy(Skin.m_aName, pName, min((int)sizeof(Skin.m_aName),l-3));
str_format(aBuf, sizeof(aBuf), "load skin %s", Skin.m_aName);
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "game", aBuf);
if(g_Config.m_Debug)
{
str_format(aBuf, sizeof(aBuf), "load skin %s", Skin.m_aName);
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "game", aBuf);
}
pSelf->m_aSkins.add(Skin);
return 0;

View file

@ -568,7 +568,7 @@ void CCharacter::OnPredictedInput(CNetObj_PlayerInput *pNewInput)
mem_copy(&m_Input, pNewInput, sizeof(m_Input));
m_NumInputs++;
// or are not allowed to aim in the center
// it is not allowed to aim in the center
if(m_Input.m_TargetX == 0 && m_Input.m_TargetY == 0)
m_Input.m_TargetY = -1;
}
@ -578,6 +578,10 @@ void CCharacter::OnDirectInput(CNetObj_PlayerInput *pNewInput)
mem_copy(&m_LatestPrevInput, &m_LatestInput, sizeof(m_LatestInput));
mem_copy(&m_LatestInput, pNewInput, sizeof(m_LatestInput));
// it is not allowed to aim in the center
if(m_LatestInput.m_TargetX == 0 && m_LatestInput.m_TargetY == 0)
m_LatestInput.m_TargetY = -1;
if(m_NumInputs > 2 && m_pPlayer->GetTeam() != TEAM_SPECTATORS)
{
HandleWeaponSwitch();