Compare commits

...
Author SHA1 Message Date
asarium fe6640fe8b Upload nightly builds to FTP instead of BinTray 2017-04-25 10:36:55 +02:00
m!m 21cc93ffd6 Merge pull request #1340 from asarium/fix/bintrayKeys
Update BinTray API keys
2017-04-24 20:32:38 +02:00
m!m c06ed08e74 Merge pull request #1338 from MageKing17/bugfix/duplicate-percent-signs
Get rid of duplicate percent signs in the statistics screen.
2017-04-24 20:02:47 +02:00
asarium 89a9932ac5 Update BinTray API keys
While searching for the cause of the rate-limiting of our BinTray
organization, I revoked the API key used by the CI servers in case the
key got compromised somehow. These are the updated keys which should
allow us to upload nightly builds again.

@chief1983 and I are working on a nightly solution which does not
require BinTray but until that works we need these updated keys.
2017-04-24 19:49:22 +02:00
MageKing17 d5d33379a3 Get rid of duplicate percent signs in the statistics screen.
The problem was caused by an oversight in 07107ce9b2 (namely, that changing some strings from being passed directly to string-formatting to being passed as arguments to a "%s" format-specifier meant that "%%" was no longer needed to get a plain "%" out the other side).
2017-04-23 10:42:25 -07:00
m!m 8850efce7f Merge pull request #1333 from oldlaptop/openbsd
Fix the build on OpenBSD
2017-04-16 10:34:56 +02:00
oldlaptop 4b36e3c379 add platform check for std::is_trivially_copyable
Yes, the template instantiation appears necessary for cmake to
 detect the type. If there's a better type for it than int, I'm
 open to suggestions.
2017-04-15 22:06:47 -04:00
oldlaptop 8f76537b02 s/_L/L_State
The iterator known as _L, besides having an absurdly poor name,
 clashes with standard headers on OpenBSD -current at the time
 of writing. This commit is the minimum needed to build on
 OpenBSD with an updated C++ standard library.
2017-04-13 09:06:48 -04:00
m!m 36ae38a532 Merge pull request #1330 from niffiwan/fix/1329
Tweak autodraw shield bar positions
2017-04-04 09:47:25 +02:00
niffiwan bcf49b9630 Fix const var names & style 2017-04-04 17:10:03 +10:00
niffiwan 654f3545fc Tweak autodraw shield bar positions
See #1329, this makes the rear shields slightly further away from the
front, so that the model clip area matches the area where the shields
are drawn.
2017-04-03 20:10:05 +10:00
10 changed files with 96 additions and 53 deletions

No files matched your search

+16 -12
View File
@@ -23,6 +23,19 @@ addons:
build_command: "ci/travis/script.sh"
# must match TRAVIS_BRANCH check below
branch_pattern: coverity_scan
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
# also note that fork's don't get access to secure keys
# you have to test using a branch in the main repo
- secure: "C3wF967ZeliwwP1vC12EMIBOaC568n26Z/cPnwzn317ve59DWH3YSfPZVgvt08GzmaXITGGsJvPB+qxfGoKvQzYE4O1B73q81RpUe5pB3IhF+ThQ91VfQZIRJR5xEGJaLINUlHTTZGX5jxlkVO9wAcauVj/s3b8sQ3dvUZauPvk="
# These declarations set INDIEGAMES_USER and INDIEGAMES_PASSWORD for uploading nightly builds to the indiegames server
- secure: "XoXAeHm9sHS3Gc9TZxOWzHSODk1JTAqrgoGMN43ZwRir/EJdbPubtPt00U0+QZZLbtJlbWX0SbblL87dS6kpAsXU9b+7O98bjM018PycIykAwAz2wZDIKfk/PFHuLrohnYxWYfdFGQuYNjeA4JsT5x6FAd3X3IUIKo4N6AJVswU="
- secure: "PKvVA/dbTEa72/XNRoAmNop2X/LI20wi0aNFyop0+iVE9HngzqdNEuXnDaXlpXhBNay7+ef8NSjsUjfNfsWoFwatOrysDofgumbJI4ro21LsCscZlapXCvWWUv6iu/WU17o1HtwCpwbUWx1G3LX0vnlIFqA/9o/R+nu7t8LVXUo="
# These declarations set FS2DOWNLOADS_USER and FS2DOWNLOADS_PASSWORD
- secure: "IkmyBK4fRKLCN2FK7f0DVIb2ZFmK2IhhIlrbkGB5gPBbPAiAT+WIohIN1HbEL5bCwfupv4QGLk+cXPV99KphCTORS8mDGBrrE8FYqE+W/qyWF5pv+FpDFClsyA9ZVo9gTHFYIiCkS39CCOG1lPbNvFlOpqLvSrxS7Gg74tDzUPw="
- secure: "Jq5dCE/+1i7J06+Cp7XBqpT6yxJnK5MaEzqhuMheLdXYdWa42ak4trV5M0SkTs+5A824oilIncezPhdsoiI/QvLdSDutxNRlAv/607KqOnMuviDRu5WPMFiiVp8Ajnbzw9osRJjjrm3Wcbeo+W0zzl70hTR6QRTG4CoDD0LB2u4="
deploy:
- provider: releases
api_key:
@@ -34,21 +47,12 @@ deploy:
condition: '"$RELEASE_BUILD" == true'
tags: true
- provider: bintray
user: sirknightly
key:
secure: "CZtvDW/zPf1Nxru21i8Wd+9hgiBRA8VowWBX0gmCOGgRq9WHISttKQQmBWGHuyVZ3rYvtE4Va2bR+2qRN+TFNkUUuOCOQkdBJTCal9nS3G/LprEmsOashG0Q5PTfMMBnlKzKxaxGJW6UhFj2GySmHEAjsFLVpuNWGJeeZgZQ3UE="
file: ci/bintray.json
- provider: script
script: scripts/deploy.sh staging
on:
condition: '"$NIGHTLY_BUILD" == true'
tags: true
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
# also note that fork's don't get access to secure keys
# you have to test using a branch in the main repo
- secure: "C3wF967ZeliwwP1vC12EMIBOaC568n26Z/cPnwzn317ve59DWH3YSfPZVgvt08GzmaXITGGsJvPB+qxfGoKvQzYE4O1B73q81RpUe5pB3IhF+ThQ91VfQZIRJR5xEGJaLINUlHTTZGX5jxlkVO9wAcauVj/s3b8sQ3dvUZauPvk="
matrix:
include:
# note that gcc Debug MUST be 1st for Coverity
+20 -10
View File
@@ -4,6 +4,8 @@ configuration:
- Release
clone_depth: 10
environment:
INDIEGAMES_USER:
secure: qYjBh+lgEf+DktbBh4rpDQ==
matrix:
- BuildID: 0
CMAKE_GENERATOR: Visual Studio 12 2013
@@ -25,15 +27,23 @@ deploy:
on:
ReleaseBuild: true # deploy on release push only
- provider: BinTray
username: sirknightly
api_key:
secure: pYWqfiZhIWvFYdjVWPXNaHobmnkXIWa4+LwoiyMTEiu4Z0CiCAW0ZrMfTKVkORKz
subject: scp-fs2open
repo: FSO
package: nightly
version: $(VersionName)
publish: true
override: true
- provider: FTP
protocol: sftp
host: scp.indiegames.us:22
username: $(INDIEGAMES_USER)
password:
secure: U9TBaMEMZyAWE52oudZ30Q==
folder: /home/$(INDIEGAMES_USER)/public_html/builds/nightly/$(VersionName)/
on:
NightlyBuild: true # deploy on nightly push only
- provider: FTP
protocol: ftp
host: swc.fs2downloads.com:21
username:
secure: p0kIQ+ZucNpwP/kfijXQSQ==
password:
secure: 7mbQOfwTIkMbsF4hG1onow==
folder: /swc.fs2downloads.com/builds/nightly/$(VersionName)"
on:
NightlyBuild: true # deploy on nightly push only
+13
View File
@@ -0,0 +1,13 @@
#!/usr/bin/env sh
set -x
set -e
set -u
for file in /tmp/builds/*; do
# Upload to indiegames
curl -k "sftp://scp.indiegames.us:22/home/$INDIEGAMES_USER/public_html/builds/nightly/$VERSION_NAME/" --user "$INDIEGAMES_USER:$INDIEGAMES_PASSWORD" -T "$file" --ftp-create-dirs
# Upload to fs2downloads
curl -k "ftp://swc.fs2downloads.com:21/swc.fs2downloads.com/builds/nightly/$VERSION_NAME/" --user "$FS2DOWNLOADS_USER:$FS2DOWNLOADS_PASSWORD" -T "$file" --ftp-create-dirs
done
+10
View File
@@ -7,6 +7,7 @@ include(CheckLibraryExists)
include(CheckPrototypeDefinition)
include(CheckStructHasMember)
include(CheckSymbolExists)
include(CheckCXXSymbolExists)
include(CheckTypeSize)
CHECK_INCLUDE_FILE("execinfo.h" HAVE_EXECINFO_H)
@@ -14,10 +15,19 @@ CHECK_INCLUDE_FILE_CXX("cxxabi.h" HAVE_CXXAPI_H)
CHECK_TYPE_SIZE("max_align_t" MAX_ALIGN_T)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_REQUIRED_FLAGS "-std=c++11") # required for g++ <= 5
endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_EXTRA_INCLUDE_FILES "cstddef")
CHECK_TYPE_SIZE("std::max_align_t" STD_MAX_ALIGN_T LANGUAGE CXX)
set(CMAKE_EXTRA_INCLUDE_FILES "type_traits")
CHECK_TYPE_SIZE("std::is_trivially_copyable<int>" STD_IS_TRIVIALLY_COPYABLE LANGUAGE CXX)
set(CMAKE_EXTRA_INCLUDE_FILES)
set(CMAKE_REQUIRED_FLAGS)
CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP)
CHECK_FUNCTION_EXISTS(strncasecmp HAVE_STRNCASECMP)
+2
View File
@@ -8,6 +8,8 @@
#cmakedefine HAVE_MAX_ALIGN_T
#cmakedefine HAVE_STD_MAX_ALIGN_T
#cmakedefine HAVE_STD_IS_TRIVIALLY_COPYABLE
#cmakedefine01 IS_64BIT
#cmakedefine01 HAVE_STRCASECMP
+6 -4
View File
@@ -590,14 +590,16 @@ void HudGaugeShield::showShields(object *objp, int mode)
vm_angles_2_matrix(&object_orient, &rot_angles);
gr_screen.clip_width = 112;
gr_screen.clip_height = 93;
const int CLIP_WIDTH = 112;
const int CLIP_HEIGHT = 93;
gr_screen.clip_width = CLIP_WIDTH;
gr_screen.clip_height = CLIP_HEIGHT;
//Fire it up
if(g3_yourself)
g3_start_frame(1);
hud_save_restore_camera_data(1);
setClip(sx, sy, 112, 93);
setClip(sx, sy, CLIP_WIDTH, CLIP_HEIGHT);
//if(!digitus_improbus)
g3_set_view_matrix( &sip->closeup_pos, &vmd_identity_matrix, sip->closeup_zoom * 2.5f);
@@ -707,7 +709,7 @@ void HudGaugeShield::showShields(object *objp, int mode)
//Ugh, draw four shield quadrants
static const int TRI_EDGE = 6;
static const int BAR_LENGTH = 112;
static const int BAR_HEIGHT = 54;
static const int BAR_HEIGHT = 63;
static const int BAR_WIDTH = 6;
static const int SHIELD_OFFSET = BAR_WIDTH + TRI_EDGE + 3;
+3 -1
View File
@@ -5,6 +5,7 @@
#define FS2_OPEN_ADE_H
#include "globalincs/pstypes.h"
#include "platformChecks.h"
extern "C" {
#include <lauxlib.h>
@@ -226,8 +227,9 @@ template<class StoreType>
class ade_obj: public ade_lib_handle {
public:
// Make sure that the stored type is compatible with our requirements
#ifdef HAVE_STD_IS_TRIVIALLY_COPYABLE
static_assert(std::is_trivially_copyable<StoreType>::value, "ADE object types must be trivially copyable!");
#endif
ade_obj(const char* in_name, const char* in_desc, const ade_lib_handle* in_deriv = NULL) {
ade_table_entry ate;
+9 -9
View File
@@ -97,39 +97,39 @@ LuaTable::iterator LuaTable::end() {
return iterator(); // Empty iterator
}
LuaTableIterator::LuaTableIterator(const LuaTable& t) : _L(t.getLuaState()) {
_stackTop = lua_gettop(_L);
LuaTableIterator::LuaTableIterator(const LuaTable& t) : _luaState(t.getLuaState()) {
_stackTop = lua_gettop(_luaState);
t.pushValue();
lua_pushnil(_L);
lua_pushnil(_luaState);
toNextElement();
}
LuaTableIterator::~LuaTableIterator() {
lua_settop(_L, _stackTop);
lua_settop(_luaState, _stackTop);
}
bool LuaTableIterator::hasElement() {
return _hasElement;
}
void LuaTableIterator::toNextElement() {
auto ret = lua_next(_L, -2);
auto ret = lua_next(_luaState, -2);
_hasElement = ret != 0;
if (_hasElement) {
LuaValue key;
key.setReference(UniqueLuaReference::create(_L, -2));
key.setReference(UniqueLuaReference::create(_luaState, -2));
LuaValue value;
value.setReference(UniqueLuaReference::create(_L, -1));
value.setReference(UniqueLuaReference::create(_luaState, -1));
_currentVal = std::make_pair(key, value);
// Remove value from stack
lua_pop(_L, 1);
lua_pop(_luaState, 1);
}
}
std::pair<LuaValue, LuaValue> LuaTableIterator::getElement() {
return _currentVal;
}
}
}
+1 -1
View File
@@ -19,7 +19,7 @@ class LuaTable;
* be in the exact same state when you call the next method of this class.
*/
class LuaTableIterator {
lua_State* _L = nullptr;
lua_State* _luaState = nullptr;
int _stackTop = 0;
+16 -16
View File
@@ -53,9 +53,9 @@ void show_stats_label(int stage, int sx, int sy, int dy)
sy += dy;
gr_printf_menu(sx,sy,"%s", XSTR( "Primary friendly hits", 118));
sy += dy;
gr_printf_menu(sx,sy,"%s", XSTR( "Primary hit %%", 119));
gr_printf_menu(sx,sy,"%s", XSTR( "Primary hit %", 119));
sy += dy;
gr_printf_menu(sx,sy,"%s", XSTR( "Primary friendly hit %%", 120));
gr_printf_menu(sx,sy,"%s", XSTR( "Primary friendly hit %", 120));
sy += 2*dy;
gr_printf_menu(sx,sy,"%s", XSTR( "Secondary weapon shots", 121));
@@ -64,9 +64,9 @@ void show_stats_label(int stage, int sx, int sy, int dy)
sy += dy;
gr_printf_menu(sx,sy,"%s", XSTR( "Secondary friendly hits", 123));
sy += dy;
gr_printf_menu(sx,sy,"%s", XSTR( "Secondary hit %%", 124));
gr_printf_menu(sx,sy,"%s", XSTR( "Secondary hit %", 124));
sy += dy;
gr_printf_menu(sx,sy,"%s", XSTR( "Secondary friendly hit %%", 125));
gr_printf_menu(sx,sy,"%s", XSTR( "Secondary friendly hit %", 125));
sy += 2*dy;
gr_printf_menu(sx,sy,"%s", XSTR( "Assists", 126));
@@ -93,9 +93,9 @@ void show_stats_label(int stage, int sx, int sy, int dy)
sy += dy;
gr_printf_menu(sx,sy,"%s", XSTR( "Primary friendly hits", 118));
sy += dy;
gr_printf_menu(sx,sy,"%s", XSTR( "Primary hit %%", 119));
gr_printf_menu(sx,sy,"%s", XSTR( "Primary hit %", 119));
sy += dy;
gr_printf_menu(sx,sy,"%s", XSTR( "Primary friendly hit %%", 120));
gr_printf_menu(sx,sy,"%s", XSTR( "Primary friendly hit %", 120));
sy += 2*dy;
gr_printf_menu(sx,sy,"%s", XSTR( "Secondary weapon shots", 121));
@@ -104,9 +104,9 @@ void show_stats_label(int stage, int sx, int sy, int dy)
sy += dy;
gr_printf_menu(sx,sy,"%s", XSTR( "Secondary friendly hits", 123));
sy += dy;
gr_printf_menu(sx,sy,"%s", XSTR( "Secondary hit %%", 124));
gr_printf_menu(sx,sy,"%s", XSTR( "Secondary hit %", 124));
sy += dy;
gr_printf_menu(sx,sy,"%s", XSTR( "Secondary friendly hit %%", 125));
gr_printf_menu(sx,sy,"%s", XSTR( "Secondary friendly hit %", 125));
sy += 2*dy;
gr_printf_menu(sx,sy,"%s", XSTR( "Assists", 126));
@@ -153,13 +153,13 @@ void show_stats_numbers(int stage, int sx, int sy, int dy,int add_mission)
if(Active_player->stats.mp_shots_fired>0)
pct=(float)100.0*((float)Active_player->stats.mp_shots_hit/(float)Active_player->stats.mp_shots_fired);
else pct=(float)0.0;
sprintf(text,"%d",(int)pct); strcat_s(text," %%");
sprintf(text,"%d",(int)pct); strcat_s(text," %");
gr_printf_menu(sx,sy,"%s", text);
sy += dy;
if(Active_player->stats.mp_shots_fired>0)
pct=(float)100.0*((float)Active_player->stats.mp_bonehead_hits/(float)Active_player->stats.mp_shots_fired);
else pct=(float)0.0;
sprintf(text,"%d",(int)pct); strcat_s(text," %%");
sprintf(text,"%d",(int)pct); strcat_s(text," %");
gr_printf_menu(sx,sy,"%s", text);
sy += 2*dy;
@@ -176,13 +176,13 @@ void show_stats_numbers(int stage, int sx, int sy, int dy,int add_mission)
if(Active_player->stats.ms_shots_fired>0)
pct=(float)100.0*((float)Active_player->stats.ms_shots_hit/(float)Active_player->stats.ms_shots_fired);
else pct=(float)0.0;
sprintf(text,"%d",(int)pct); strcat_s(text," %%");
sprintf(text,"%d",(int)pct); strcat_s(text," %");
gr_printf_menu(sx,sy,"%s", text);
sy += dy;
if(Active_player->stats.ms_shots_fired>0)
pct=(float)100.0*((float)Active_player->stats.ms_bonehead_hits/(float)Active_player->stats.ms_shots_fired);
else pct=(float)0.0;
sprintf(text,"%d",(int)pct); strcat_s(text," %%");
sprintf(text,"%d",(int)pct); strcat_s(text," %");
gr_printf_menu(sx,sy,"%s", text);
sy += 2*dy;
@@ -237,13 +237,13 @@ void show_stats_numbers(int stage, int sx, int sy, int dy,int add_mission)
if((Active_player->stats.p_shots_fired + add.p_shots_fired)>0)
pct=(float)100.0*((float)(Active_player->stats.p_shots_hit+add.p_shots_hit)/(float)(Active_player->stats.p_shots_fired + add.p_shots_fired));
else pct=(float)0.0;
sprintf(text,"%d",(int)pct); strcat_s(text," %%");
sprintf(text,"%d",(int)pct); strcat_s(text," %");
gr_printf_menu(sx,sy,"%s", text);
sy += dy;
if((Active_player->stats.p_bonehead_hits + add.p_bonehead_hits)>0)
pct=(float)100.0*((float)(Active_player->stats.p_bonehead_hits+add.p_bonehead_hits)/(float)(Active_player->stats.p_shots_fired + add.p_shots_fired));
else pct=(float)0.0;
sprintf(text,"%d",(int)pct); strcat_s(text," %%");
sprintf(text,"%d",(int)pct); strcat_s(text," %");
gr_printf_menu(sx,sy,"%s", text);
sy += 2*dy;
@@ -260,13 +260,13 @@ void show_stats_numbers(int stage, int sx, int sy, int dy,int add_mission)
if((Active_player->stats.s_shots_fired+add.s_shots_fired)>0)
pct=(float)100.0*((float)(Active_player->stats.s_shots_hit + add.s_shots_hit)/(float)(Active_player->stats.s_shots_fired + add.s_shots_fired));
else pct=(float)0.0;
sprintf(text,"%d",(int)pct); strcat_s(text," %%");
sprintf(text,"%d",(int)pct); strcat_s(text," %");
gr_printf_menu(sx,sy,"%s", text);
sy += dy;
if((Active_player->stats.s_bonehead_hits + add.s_bonehead_hits)>0)
pct=(float)100.0*((float)(Active_player->stats.s_bonehead_hits+add.s_bonehead_hits)/(float)(Active_player->stats.s_shots_fired+add.s_shots_fired));
else pct=(float)0.0;
sprintf(text,"%d",(int)pct); strcat_s(text," %%");
sprintf(text,"%d",(int)pct); strcat_s(text," %");
gr_printf_menu(sx,sy,"%s", text);
sy += 2*dy;