Merge remote-tracking branch 'origin/master' into hardware_skinning
This commit is contained in:
commit
c8e5238ce2
57
.appveyor.yml
Normal file
57
.appveyor.yml
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
environment:
|
||||||
|
DEPS_DIR: c:\\projects\dependencies
|
||||||
|
ASSETS_DIR: c:\\projects\stk-assets
|
||||||
|
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma2 -mx=9
|
||||||
|
|
||||||
|
os: Visual Studio 2015
|
||||||
|
clone_depth: 1
|
||||||
|
shallow_clone: true
|
||||||
|
|
||||||
|
platform:
|
||||||
|
- x86
|
||||||
|
#- x64
|
||||||
|
|
||||||
|
configuration:
|
||||||
|
- Debug
|
||||||
|
- Release
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
fast_finish: true
|
||||||
|
|
||||||
|
cache:
|
||||||
|
- '%DEPS_DIR%'
|
||||||
|
#- '%ASSETS_DIR%'
|
||||||
|
|
||||||
|
install:
|
||||||
|
- ps: >-
|
||||||
|
If(!(Test-Path "$env:DEPS_DIR")) {
|
||||||
|
Write-Host "Downloading dependencies";
|
||||||
|
Start-Process -FilePath "git" -ArgumentList "clone --branch master --single-branch --depth 1 https://github.com/supertuxkart/dependencies.git $env:DEPS_DIR" -Wait;
|
||||||
|
}
|
||||||
|
Else {
|
||||||
|
Write-Host "Updating dependencies";
|
||||||
|
Start-Process -FilePath "git" -ArgumentList "fetch --depth 1" -WorkingDirectory "$env:DEPS_DIR" -Wait;
|
||||||
|
}
|
||||||
|
Get-ChildItem $env:DEPS_DIR | Measure-Object -property length -sum
|
||||||
|
#- ps: >-
|
||||||
|
#If(!(Test-Path "$env:ASSETS_DIR")) {
|
||||||
|
# Write-Host "Downloading assets";
|
||||||
|
# Start-Process -FilePath "svn" -ArgumentList "checkout https://svn.code.sf.net/p/supertuxkart/code/stk-assets $env:ASSETS_DIR" -Wait;
|
||||||
|
#}
|
||||||
|
#Else {
|
||||||
|
# Write-Host "Updating assets";
|
||||||
|
# Start-Process -FilePath "svn" -ArgumentList "update" -WorkingDirectory "$env:ASSETS_DIR" -Wait;
|
||||||
|
#}
|
||||||
|
#Get-ChildItem $env:ASSETS_DIR | Measure-Object -property length -sum
|
||||||
|
|
||||||
|
before_build:
|
||||||
|
- ps: Copy-Item "${env:DEPS_DIR}\windows\dependencies" c:\projects\stk-code\dependencies –Recurse
|
||||||
|
- cmd: |
|
||||||
|
md build
|
||||||
|
cd build
|
||||||
|
if "%platform%"=="x86" set CMAKE_GENERATOR_NAME="Visual Studio 14 2015"
|
||||||
|
cmake -G %CMAKE_GENERATOR_NAME% -DCMAKE_BUILD_TYPE="%configuration%" .. -DCHECK_ASSETS=OFF
|
||||||
|
|
||||||
|
build:
|
||||||
|
parallel: true
|
||||||
|
project: build\ALL_BUILD.vcxproj
|
11
.travis.yml
11
.travis.yml
@ -14,8 +14,10 @@ matrix:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
matrix:
|
matrix:
|
||||||
- BUILD_TYPE="Debug"
|
- BUILD_TYPE="Debug" SERVER_ONLY="OFF"
|
||||||
- BUILD_TYPE="Release"
|
- BUILD_TYPE="Debug" SERVER_ONLY="ON"
|
||||||
|
- BUILD_TYPE="Release" SERVER_ONLY="OFF"
|
||||||
|
- BUILD_TYPE="Release" SERVER_ONLY="ON"
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
@ -39,8 +41,9 @@ addons:
|
|||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
# Unfortunately using all threads crashes g++: "g++: internal compiler error: Killed (program cc1plus)"
|
# Unfortunately using all threads crashes g++: "g++: internal compiler error: Killed (program cc1plus)"
|
||||||
|
# Use half of the available threads, gcc is memory hungry
|
||||||
- 'if [ ${CC} = "gcc" ]; then
|
- 'if [ ${CC} = "gcc" ]; then
|
||||||
export THREADS=4;
|
export THREADS=$((`nproc` / 2));
|
||||||
else
|
else
|
||||||
export THREADS=$((`nproc` + 1));
|
export THREADS=$((`nproc` + 1));
|
||||||
fi'
|
fi'
|
||||||
@ -50,7 +53,7 @@ before_script:
|
|||||||
script:
|
script:
|
||||||
- mkdir "build"
|
- mkdir "build"
|
||||||
- cd "build"
|
- cd "build"
|
||||||
- cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCHECK_ASSETS=off
|
- cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSERVER_ONLY=$SERVER_ONLY -DCHECK_ASSETS=off
|
||||||
- make VERBOSE=1 -j $THREADS
|
- make VERBOSE=1 -j $THREADS
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <libkern/OSByteOrder.h>
|
#include <libkern/OSByteOrder.h>
|
||||||
#define bswap_16(X) OSReadSwapInt16(&X,0)
|
#define bswap_16(X) OSReadSwapInt16(&X,0)
|
||||||
#define bswap_32(X) OSReadSwapInt32(&X,0)
|
#define bswap_32(X) OSReadSwapInt32(&X,0)
|
||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
|
||||||
#include <sys/endian.h>
|
#include <sys/endian.h>
|
||||||
#define bswap_16(X) bswap16(X)
|
#define bswap_16(X) bswap16(X)
|
||||||
#define bswap_32(X) bswap32(X)
|
#define bswap_32(X) bswap32(X)
|
||||||
|
@ -80,27 +80,45 @@ KartStatsWidget::KartStatsWidget(core::recti area, const int player_id,
|
|||||||
m_children.push_back(skill_bar);
|
m_children.push_back(skill_bar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setValues(props);
|
||||||
|
|
||||||
|
move(area.UpperLeftCorner.X, area.UpperLeftCorner.Y,
|
||||||
|
area.getWidth(), area.getHeight());
|
||||||
|
} // KartStatsWidget
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void KartStatsWidget::setValues(const KartProperties* props)
|
||||||
|
{
|
||||||
|
// Use kart properties computed for "hard" difficulty to show the user, so
|
||||||
|
// that properties don't change according to the the last used difficulty
|
||||||
|
// (And because this code uses arbitrary scaling factors to make them look
|
||||||
|
// nice and the arbitrary factors were optimised for hard difficulty)
|
||||||
|
RaceManager::Difficulty previous_difficulty = race_manager->getDifficulty();
|
||||||
|
race_manager->setDifficulty(RaceManager::DIFFICULTY_HARD);
|
||||||
|
KartProperties kp_computed;
|
||||||
|
kp_computed.copyForPlayer(props);
|
||||||
|
|
||||||
// Scale the values so they look better
|
// Scale the values so they look better
|
||||||
// The scaling factor and offset were found by trial and error.
|
// The scaling factor and offset were found by trial and error.
|
||||||
// It should look nice and you should be able to see the difference between
|
// It should look nice and you should be able to see the difference between
|
||||||
// different masses or velocities.
|
// different masses or velocities.
|
||||||
m_skills[SKILL_MASS]->setValue((int)
|
m_skills[SKILL_MASS]->setValue((int)
|
||||||
((props->getCombinedCharacteristic()->getMass() - 20) / 4));
|
((kp_computed.getCombinedCharacteristic()->getMass() - 20) / 4));
|
||||||
m_skills[SKILL_MASS]->setLabel(_("WEIGHT"));
|
m_skills[SKILL_MASS]->setLabel(_("WEIGHT"));
|
||||||
m_skills[SKILL_MASS]->m_properties[PROP_ID] = StringUtils::insertValues("@p%i_mass", m_player_id);
|
m_skills[SKILL_MASS]->m_properties[PROP_ID] = StringUtils::insertValues("@p%i_mass", m_player_id);
|
||||||
|
|
||||||
m_skills[SKILL_SPEED]->setValue((int)
|
m_skills[SKILL_SPEED]->setValue((int)
|
||||||
((props->getCombinedCharacteristic()->getEngineMaxSpeed() - 15) * 6));
|
((kp_computed.getCombinedCharacteristic()->getEngineMaxSpeed() - 15) * 6));
|
||||||
m_skills[SKILL_SPEED]->setLabel(_("SPEED"));
|
m_skills[SKILL_SPEED]->setLabel(_("SPEED"));
|
||||||
m_skills[SKILL_SPEED]->m_properties[PROP_ID] = StringUtils::insertValues("@p%i_speed", m_player_id);
|
m_skills[SKILL_SPEED]->m_properties[PROP_ID] = StringUtils::insertValues("@p%i_speed", m_player_id);
|
||||||
|
|
||||||
m_skills[SKILL_POWER]->setValue((int) ((props->getAvgPower() - 30) / 20));
|
m_skills[SKILL_POWER]->setValue((int)((kp_computed.getAvgPower() - 30) / 20));
|
||||||
m_skills[SKILL_POWER]->setLabel(_("POWER"));
|
m_skills[SKILL_POWER]->setLabel(_("POWER"));
|
||||||
m_skills[SKILL_POWER]->m_properties[PROP_ID] = StringUtils::insertValues("@p%i_power", m_player_id);
|
m_skills[SKILL_POWER]->m_properties[PROP_ID] = StringUtils::insertValues("@p%i_power", m_player_id);
|
||||||
|
|
||||||
move(area.UpperLeftCorner.X, area.UpperLeftCorner.Y,
|
race_manager->setDifficulty(previous_difficulty);
|
||||||
area.getWidth(), area.getHeight());
|
}
|
||||||
} // KartStatsWidget
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include "guiengine/widgets/progress_bar_widget.hpp"
|
#include "guiengine/widgets/progress_bar_widget.hpp"
|
||||||
#include "guiengine/widgets/skill_level_widget.hpp"
|
#include "guiengine/widgets/skill_level_widget.hpp"
|
||||||
|
|
||||||
|
class KartProperties;
|
||||||
|
|
||||||
namespace GUIEngine
|
namespace GUIEngine
|
||||||
{
|
{
|
||||||
@ -91,6 +92,8 @@ namespace GUIEngine
|
|||||||
* inside itself */
|
* inside itself */
|
||||||
void setSize(const int x, const int y, const int w, const int h);
|
void setSize(const int x, const int y, const int w, const int h);
|
||||||
|
|
||||||
|
void setValues(const KartProperties* props);
|
||||||
|
|
||||||
/** Change the value of the widget, it must be a percent. */
|
/** Change the value of the widget, it must be a percent. */
|
||||||
void setValue(Stats type, int value);
|
void setValue(Stats type, int value);
|
||||||
|
|
||||||
|
@ -545,6 +545,8 @@ public:
|
|||||||
bool getSkidEnabled() const;
|
bool getSkidEnabled() const;
|
||||||
|
|
||||||
/* <characteristics-end kpdefs> */
|
/* <characteristics-end kpdefs> */
|
||||||
|
|
||||||
|
LEAK_CHECK()
|
||||||
}; // KartProperties
|
}; // KartProperties
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -809,15 +809,10 @@ void KartSelectionScreen::updateKartStats(uint8_t widget_id,
|
|||||||
|
|
||||||
const KartProperties *kp =
|
const KartProperties *kp =
|
||||||
kart_properties_manager->getKart(selection);
|
kart_properties_manager->getKart(selection);
|
||||||
|
|
||||||
if (kp != NULL)
|
if (kp != NULL)
|
||||||
{
|
{
|
||||||
// Scale the values so they look better
|
w->setValues(kp);
|
||||||
w->setValue(KartStatsWidget::SKILL_MASS, (int)
|
|
||||||
((kp->getCombinedCharacteristic()->getMass() - 20) / 4));
|
|
||||||
w->setValue(KartStatsWidget::SKILL_SPEED, (int)
|
|
||||||
((kp->getCombinedCharacteristic()->getEngineMaxSpeed() - 15) * 6));
|
|
||||||
w->setValue(KartStatsWidget::SKILL_POWER, (int)
|
|
||||||
((kp->getAvgPower() - 30) / 20));
|
|
||||||
w->update(0);
|
w->update(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user