Skip to content

Commit

Permalink
Merge branch '0.57.1' into develop
Browse files Browse the repository at this point in the history
MinaciousGrace committed Nov 15, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 62c0e71 + c5a97e3 commit af2c86f
Showing 21 changed files with 217 additions and 42 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -103,3 +103,6 @@ tests/*.err
*.user
*.vdi
*.pch

nsis_strings_temp\.inc
BatchRecalc/*
4 changes: 2 additions & 2 deletions CMake/SMDefs.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Set up version numbers according to the new scheme.
set(SM_VERSION_MAJOR 0)
set(SM_VERSION_MINOR 56)
set(SM_VERSION_PATCH 2)
set(SM_VERSION_MINOR 57)
set(SM_VERSION_PATCH 1)
set(SM_VERSION_TRADITIONAL "${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}.${SM_VERSION_PATCH}")

execute_process(COMMAND git rev-parse --short HEAD
Binary file modified Data/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ local plotWidth, plotHeight = SCREEN_WIDTH,SCREEN_WIDTH*0.3
local plotX, plotY = SCREEN_CENTER_X, SCREEN_CENTER_Y
local dotDims, plotMargin = 2, 4
local judge = GetTimingDifficulty()
local maxOffset = 180*tst[judge]
local maxOffset = math.max(180, 180*tst[judge])

local o = Def.ActorFrame{
InitCommand=function(self)
@@ -22,7 +22,7 @@ local o = Def.ActorFrame{
elseif params.Name == "NextJudge" and judge < 9 then
judge = judge + 1
end
maxOffset = 180*tst[judge]
maxOffset = math.max(180, 180*tst[judge])
MESSAGEMAN:Broadcast("JudgeDisplayChanged")
end
}
@@ -42,9 +42,11 @@ end

local function plotOffset(nr,dv)
if dv == 1000 then -- 1000 denotes a miss for which we use a different marker
return Def.Quad{InitCommand=function(self)
self:xy(fitX(nr),fitY(tst[judge]*184)):zoomto(dotDims,dotDims):diffuse(offsetToJudgeColor(dv/1000)):valign(0)
end}
return Def.Quad{
InitCommand=function(self)
self:xy(fitX(nr),fitY(math.max(184, tst[judge]*184))):zoomto(dotDims,dotDims):diffuse(offsetToJudgeColor(dv/1000)):valign(0)
end
}
end
return Def.Quad{
InitCommand=function(self)
@@ -53,7 +55,7 @@ local function plotOffset(nr,dv)
JudgeDisplayChangedMessageCommand=function(self)
local pos = fitY(dv)
if math.abs(pos) > plotHeight/2 then
self:y(fitY(tst[judge]*184))
self:y(fitY(math.max(184, tst[judge]*184)))
else
self:y(pos)
end
Original file line number Diff line number Diff line change
@@ -484,19 +484,18 @@ t[#t+1] = LoadFont("Common Normal")..{
end
}

-- causes too many lockups to be worth it atm
-- t[#t+1] = Def.Quad{
-- InitCommand=function(self)
-- self:xy(frameX+offsetX,frameY+offsetY+288):zoomto(120,30):halign(0):diffusealpha(0)
-- end,
-- MouseLeftClickMessageCommand=function(self)
-- if update then
-- if getTabIndex() == 2 and getScoreForPlot() and getScoreForPlot():HasReplayData() then
-- SCREENMAN:AddNewScreenToTop("ScreenScoreTabOffsetPlot")
-- end
-- end
-- end
-- }
t[#t+1] = Def.Quad{
InitCommand=function(self)
self:xy(frameX+offsetX,frameY+offsetY+288):zoomto(120,30):halign(0):diffusealpha(0)
end,
MouseLeftClickMessageCommand=function(self)
if update then
if getTabIndex() == 2 and getScoreForPlot() and getScoreForPlot():HasReplayData() then
SCREENMAN:AddNewScreenToTop("ScreenScoreTabOffsetPlot")
end
end
end
}


return t
4 changes: 2 additions & 2 deletions Themes/Til Death/Scripts/WifeSundries.lua
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ ms.SkillSets = {
"Handstream",
"Stamina",
"JackSpeed",
"JackStamina",
"Chordjack",
"Technical"
}

@@ -72,7 +72,7 @@ ms.SkillSetsShort = {
"HS",
"Stam",
"Jack Speed",
"Jack Stam",
"Chordjack",
"Tech"
}

2 changes: 1 addition & 1 deletion Themes/Til Death/metrics.ini
Original file line number Diff line number Diff line change
@@ -248,7 +248,7 @@ CodeNextJudge="EffectUp"
CodePrevJudge="EffectDown"
CodePlotThickens="MenuLeft"
CodePlotTwist="MenuRight"
#CodeStarPlot64="MenuUp"
CodeStarPlot64="MenuUp"
CodeSheriffOfPlottingham="MenuDown"

[ScreenColorChange]
Binary file modified Themes/_fallback/Graphics/Common splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified extern/MinaCalc/MinaCalc.lib
Binary file not shown.
4 changes: 2 additions & 2 deletions src/GameConstantsAndTypes.cpp
Original file line number Diff line number Diff line change
@@ -232,7 +232,7 @@ static const char *SkillsetNames[] = {
"Handstream",
"Stamina",
"JackSpeed",
"JackStamina",
"Chordjack",
"Technical",
};
XToString(Skillset);
@@ -244,7 +244,7 @@ Skillset StringToSkillset(const RString &s) {
else if (s == "Handstream") return Skill_Jumpstream;
else if (s == "Stamina") return Skill_Stamina;
else if (s == "JackSpeed") return Skill_JackSpeed;
else if (s == "JackStamina") return Skill_JackStamina;
else if (s == "Chordjack") return Skill_Chordjack;
else if (s == "Technical") return Skill_Technical;

return Skill_Overall;
2 changes: 1 addition & 1 deletion src/GameConstantsAndTypes.h
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ enum Skillset {
Skill_Handstream,
Skill_Stamina,
Skill_JackSpeed,
Skill_JackStamina,
Skill_Chordjack,
Skill_Technical,
NUM_Skillset,
Skillset_Invalid,
2 changes: 1 addition & 1 deletion src/GameState.h
Original file line number Diff line number Diff line change
@@ -214,7 +214,7 @@ class GameState
bool m_bLoadingNextSong;
int GetLoadingCourseSongIndex() const;

RString GetEtternaVersion() { return "0.56.2-Experimental"; }
RString GetEtternaVersion() { return "0.57.1"; }
bool isplaylistcourse = false;
bool IsPlaylistCourse() { return isplaylistcourse; }
bool CountNotesSeparately();
12 changes: 4 additions & 8 deletions src/HighScore.cpp
Original file line number Diff line number Diff line change
@@ -618,9 +618,6 @@ bool HighScore::LoadReplayData() {
if (m_Impl->vNoteRowVector.size() > 4 && m_Impl->vOffsetVector.size() > 4)
return true;

// disable until presumed race condition crash is resolved -mina
return false;

string profiledir;
vector<int> vNoteRowVector;
vector<float> vOffsetVector;
@@ -643,7 +640,7 @@ bool HighScore::LoadReplayData() {
//loop until eof
while (getline(fileStream, line))
{
ss.str(line);
ss = stringstream(line);
//split line into tokens
while (ss >> buffer)
tokens.emplace_back(buffer);
@@ -669,8 +666,7 @@ bool HighScore::LoadReplayData() {
}

bool HighScore::HasReplayData() {
string profiledir = PROFILEMAN->GetProfileDir(ProfileSlot_Player1).substr(1);
string path = profiledir + "ReplayData/" + m_Impl->ScoreKey;
string path = REPLAY_DIR + m_Impl->ScoreKey;
return DoesFileExist(path);
}

@@ -1261,8 +1257,8 @@ class LunaHighScore: public Luna<HighScore>
ADD_METHOD( ConvertDpToWife );
ADD_METHOD( GetWifeScore );
ADD_METHOD( GetWifePoints );
ADD_METHOD( RescoreToWifeJudge );
ADD_METHOD( RescoreToDPJudge );
//ADD_METHOD( RescoreToWifeJudge );
//ADD_METHOD( RescoreToDPJudge );
ADD_METHOD( RescoreJudges );
ADD_METHOD( GetSkillsetSSR );
ADD_METHOD( GetMusicRate );
2 changes: 1 addition & 1 deletion src/InputFilter.cpp
Original file line number Diff line number Diff line change
@@ -252,7 +252,7 @@ void InputFilter::CheckButtonChange( ButtonState &bs, DeviceInput di, const std:
* If the input was coin, possibly apply distinct coin debounce in the else below. */
std::chrono::duration<float> timeDelta = now - bs.m_LastReportTime;
float delta = timeDelta.count();
if (! INPUTMAPPER->DeviceToGame(di, gi) || gi.button != GAME_BUTTON_COIN )
if (! INPUTMAPPER->DeviceToGame(di, gi) && di.button != MOUSE_WHEELDOWN && di.button != MOUSE_WHEELUP)
{
/* If the last IET_FIRST_PRESS or IET_RELEASE event was sent too recently,
* wait a while before sending it. */
2 changes: 1 addition & 1 deletion src/ProductInfo.inc
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@

!define PRODUCT_ID "Etterna"
; TODO: This needs to be updated with the git rev hash
!define PRODUCT_VER "v0.56.2-Experimental"
!define PRODUCT_VER "v0.57.1"
!define PRODUCT_DISPLAY "${PRODUCT_FAMILY} ${PRODUCT_VER}"
!define PRODUCT_BITMAP "ett"

153 changes: 153 additions & 0 deletions src/Profile.cpp
Original file line number Diff line number Diff line change
@@ -803,6 +803,7 @@ void Profile::HandleStatsPrefixChange(RString dir, bool require_signature)
}
}

static const float ld_update = 0.02f;
ProfileLoadResult Profile::LoadAllFromDir( const RString &sDir, bool bRequireSignature, LoadingWindow* ld)
{
LOG->Trace( "Profile::LoadAllFromDir( %s )", sDir.c_str() );
@@ -825,6 +826,34 @@ ProfileLoadResult Profile::LoadAllFromDir( const RString &sDir, bool bRequireSig
ImportScoresToEtterna();
}

// move old profile specific replays to the new aggregate folder
RString oldreplaydir = sDir + "ReplayData/";

if (FILEMAN->IsADirectory(oldreplaydir)) {
vector<RString> replays;
GetDirListing(oldreplaydir, replays);

if (!replays.empty()) {
RageTimer ld_timer;
if (ld) {
ld_timer.Touch();
ld->SetIndeterminate(false);
ld->SetTotalWork(replays.size());
ld->SetText("Migrating replay data to new folder...");
}
int replayindex = 0;

for (auto r : replays) {
if (ld && ld_timer.Ago() > ld_update) {
ld_timer.Touch();
ld->SetProgress(replayindex);
++replayindex;
}
FILEMAN->Move(oldreplaydir + r, "Save/Replays/" + r);
}
}
}

CalculateStatsFromScores(ld);
return ProfileLoadResult_Success;
}
@@ -943,6 +972,130 @@ ProfileLoadResult Profile::LoadEttFromDir(RString dir) {
return LoadEttXmlFromNode(&xml);
}

ProfileLoadResult Profile::EoBatchRecalc(const RString &sDir, LoadingWindow* ld) {
LOG->Trace("Profile::LoadAllFromDir( %s )", sDir.c_str());
ASSERT(sDir.Right(1) == "/");

InitAll();
LoadTypeFromDir(sDir);
// Not critical if this fails
LoadEditableDataFromDir(sDir);

RString batchdir = sDir;
vector<RString> profs;
GetDirListing(sDir, profs, false, true);

for (auto p : profs) {
if (p.Right(3) != "xml")
continue;

if (p.Right(11).MakeLower() == "etterna.xml" || p.Right(9).MakeLower() == "stats.xml")
continue;

RString profid = p.substr(p.find_last_of('/'));
RString newpath = "/BatchRecalc/" + profid;

// skip recalc unless batchfolder doesnt have an updated file
if (FILEMAN->IsAFile(newpath))
continue;

int iError;
unique_ptr<RageFileBasic> pFile(FILEMAN->Open(p, RageFile::READ, iError));
if (pFile.get() == NULL) {
LOG->Trace("Error opening %s: %s", p.c_str(), strerror(iError));
continue;
}

LOG->Trace("Loading %s", p.c_str());

XNode xml;
if (!XmlFileUtil::LoadFromFileShowErrors(xml, *pFile.get()))
continue;
LOG->Trace("Done.");

LoadEttXmlFromNodeForBatchRecalc(&xml, p);
CalculateStatsFromScores(ld);

SaveEttXmlToDirForBatchRecalc(newpath);
InitAll();
SCOREMAN->PurgeScores();
}

return ProfileLoadResult_Success;
}

ProfileLoadResult Profile::LoadEttXmlFromNodeForBatchRecalc(const XNode *xml, RString p) {
/* The placeholder stats.xml file has an <html> tag. Don't load it,
* but don't warn about it. */
if (xml->GetName() == "html")
return ProfileLoadResult_FailedNoProfile;

if (xml->GetName() != "Stats")
{
WARN_M(xml->GetName());
return ProfileLoadResult_FailedTampered;
}

const XNode* gen = xml->GetChild("GeneralData");
if (gen)
LoadEttGeneralDataFromNode(gen);

const XNode* favs = xml->GetChild("Favorites");
if (favs)
LoadFavoritesFromNode(favs);

const XNode* pmir = xml->GetChild("PermaMirror");
if (pmir)
LoadPermaMirrorFromNode(pmir);

const XNode* goals = xml->GetChild("ScoreGoals");
if (goals)
LoadScoreGoalsFromNode(goals);

const XNode* play = xml->GetChild("Playlists");
if (play)
LoadPlaylistsFromNode(play);

const XNode* scores = xml->GetChild("PlayerScores");
if (scores)
LoadEttScoresFromNode(scores);

return ProfileLoadResult_Success;
}

bool Profile::SaveEttXmlToDirForBatchRecalc(RString p) const {
LOG->Trace("Saving Etterna Profile to: %s", p.c_str());
unique_ptr<XNode> xml(SaveEttXmlCreateNode());
// Save Etterna.xml
RString fn = p;
{
RString sError;
RageFile f;
if (!f.Open(fn, RageFile::WRITE))
{
LuaHelpers::ReportScriptErrorFmt("Couldn't open %s for writing: %s", fn.c_str(), f.GetError().c_str());
return false;
}

if (g_bProfileDataCompress)
{
RageFileObjGzip gzip(&f);
gzip.Start();
if (!XmlFileUtil::SaveToFile(xml.get(), gzip, "", false))
return false;

if (gzip.Finish() == -1)
return false;
}
else
{
if (!XmlFileUtil::SaveToFile(xml.get(), f, "", false))
return false;
}
}

return true;
}

void Profile::LoadTypeFromDir(const RString &dir)
{
5 changes: 5 additions & 0 deletions src/Profile.h
Original file line number Diff line number Diff line change
@@ -378,6 +378,11 @@ class Profile
void LoadEttGeneralDataFromNode(const XNode* pNode);
void LoadEttScoresFromNode(const XNode* pNode);

// Batch recalc stuff
ProfileLoadResult EoBatchRecalc(const RString & sDir, LoadingWindow * ld);
ProfileLoadResult LoadEttXmlFromNodeForBatchRecalc(const XNode * xml, RString p);
bool SaveEttXmlToDirForBatchRecalc(RString p) const;

bool SaveEttXmlToDir(RString sDir) const;
XNode* SaveEttGeneralDataCreateNode() const;
XNode* SaveEttScoresCreateNode() const;
4 changes: 4 additions & 0 deletions src/ProfileManager.cpp
Original file line number Diff line number Diff line change
@@ -361,6 +361,10 @@ void ProfileManager::RefreshLocalProfilesFromDisk(LoadingWindow* ld)
add_category_to_global_list(categorized_profiles[ProfileType_Normal]);
add_category_to_global_list(categorized_profiles[ProfileType_Test]);
FOREACH(DirAndProfile, g_vLocalProfile, curr)
{
//curr->profile.EoBatchRecalc(curr->sDir, ld);
}
FOREACH(DirAndProfile, g_vLocalProfile, curr)
{
curr->profile.LoadAllFromDir(curr->sDir, PREFSMAN->m_bSignProfileData, ld);
}
18 changes: 15 additions & 3 deletions src/ScoreManager.cpp
Original file line number Diff line number Diff line change
@@ -80,6 +80,18 @@ const vector<HighScore*> ScoresAtRate::GetScores() const {
}
*/

void ScoreManager::PurgeScores() {
TopSSRs.clear();
TopSSRs.shrink_to_fit();

AllScores.clear();
AllScores.shrink_to_fit();

ScoresByKey.clear();

pscores.clear();
}

void ScoreManager::RatingOverTime() {
auto compdate = [](HighScore* a, HighScore* b) { return (a->GetDateTime() < b->GetDateTime()); };

@@ -331,7 +343,7 @@ void ScoreManager::CalcPlayerRating(float& prating, float* pskillsets) {
vector<float> skillz;
FOREACH_ENUM(Skillset, ss) {
// actually skip overall, and jack stamina for now
if (ss == Skill_Overall || ss == Skill_JackStamina)
if (ss == Skill_Overall)
continue;

SortTopSSRPtrs(ss);
@@ -343,8 +355,8 @@ void ScoreManager::CalcPlayerRating(float& prating, float* pskillsets) {
sort(skillz.begin(), skillz.end());

float skillsetsum = 0.f;
for (auto& n : skillz)
skillsetsum += n;
for (size_t i = 1; i < skillz.size(); ++i) // drop the lowest skillset
skillsetsum += skillz[i];

prating = skillsetsum / 6.f;
}
1 change: 1 addition & 0 deletions src/ScoreManager.h
Original file line number Diff line number Diff line change
@@ -132,6 +132,7 @@ class ScoreManager
void AddToKeyedIndex(HighScore* hs) { ScoresByKey.emplace(hs->GetScoreKey(), hs); }

void SetAllTopScores();
void PurgeScores();
private:
unordered_map<string, ScoresForChart> pscores; // Profile scores

2 changes: 1 addition & 1 deletion stepmania.nsi
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@

; don't forget to change this before releasing a new version.
; wish this could be automated, but it requires "X.Y.Z.a" format. -aj
VIProductVersion "0.56.2.0"
VIProductVersion "0.57.1.0"
VIAddVersionKey "ProductName" "${PRODUCT_ID}"
VIAddVersionKey "FileVersion" "${PRODUCT_VER}"
VIAddVersionKey "FileDescription" "${PRODUCT_ID} Installer"

0 comments on commit af2c86f

Please sign in to comment.