bump to 1.1.0

This commit is contained in:
Stepland 2019-04-09 23:07:22 +02:00
parent a84ab84ed1
commit d795cc7599
4 changed files with 39 additions and 13 deletions

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.7)
project(FEIS)
project(FEIS VERSION 1.1.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@ -15,7 +15,7 @@ if (WIN32)
SET(GCC_COVERAGE_LINK_FLAGS "${GCC_COVERAGE_LINK_FLAGS} -mwindows")
endif(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}" )
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS}")
set(imgui include/imgui/imgui.cpp
@ -26,13 +26,13 @@ set(imgui include/imgui/imgui.cpp
include/imgui/imgui_demo.cpp)
set(SOURCE_FILES
${imgui}
main.cpp
Marker.cpp
Fumen.cpp
Note.cpp
Chart.cpp
EditorState.cpp
${imgui}
include/tinyfiledialogs.c
Toolbox.cpp
Toolbox.h
@ -57,7 +57,13 @@ set(SOURCE_FILES
EditorStateActions.cpp
EditorStateActions.h
Widgets/DensityGraph.cpp
Widgets/DensityGraph.h Widgets/LinearView.cpp Widgets/LinearView.h Widgets/Playfield.cpp Widgets/Playfield.h Widgets/BlankScreen.cpp Widgets/BlankScreen.h)
Widgets/DensityGraph.h
Widgets/LinearView.cpp
Widgets/LinearView.h
Widgets/Playfield.cpp
Widgets/Playfield.h
Widgets/BlankScreen.cpp
Widgets/BlankScreen.h)
#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${FEIS_SOURCE_DIR}/cmake")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})

View File

@ -46,17 +46,22 @@ void EditorState::reloadMusic() {
playbackPosition = sf::seconds(-(fumen.offset));
previousPos = playbackPosition;
reloadPreviewEnd();
}
void EditorState::reloadPreviewEnd() {
if (music) {
if (chart) {
previewEnd = sf::seconds(std::max(music->getDuration().asSeconds(),fumen.getChartRuntime(chart->ref)-fumen.offset)+2.f);
previewEnd = sf::seconds(
std::max(music->getDuration().asSeconds(), fumen.getChartRuntime(chart->ref) - fumen.offset) + 2.f);
} else {
previewEnd = sf::seconds(std::max(-fumen.offset,music->getDuration().asSeconds()));
previewEnd = sf::seconds(std::max(-fumen.offset, music->getDuration().asSeconds()));
}
} else {
if (chart) {
previewEnd = sf::seconds(std::max(fumen.getChartRuntime(chart->ref)-fumen.offset,2.f));
previewEnd = sf::seconds(std::max(fumen.getChartRuntime(chart->ref) - fumen.offset, 2.f));
} else {
previewEnd = sf::seconds(std::max(-fumen.offset,2.f));
previewEnd = sf::seconds(std::max(-fumen.offset, 2.f));
}
}
}
@ -83,6 +88,8 @@ void EditorState::reloadAlbumCover() {
void EditorState::setPlaybackAndMusicPosition(sf::Time newPosition) {
reloadPreviewEnd();
if (newPosition.asSeconds() < -fumen.offset) {
newPosition = sf::seconds(-fumen.offset);
} else if (newPosition > previewEnd) {
@ -337,7 +344,6 @@ void EditorState::displayTimeline() {
float height = io.DisplaySize.y * 0.9f;
// checking if we need to recompute the densities
if (chart) {
if (chart->densityGraph.should_recompute) {
chart->densityGraph.should_recompute = false;
@ -556,6 +562,11 @@ void EditorState::setMusicVolume(int newMusicVolume) {
}
}
const sf::Time &EditorState::getPreviewEnd() {
reloadPreviewEnd();
return previewEnd;
}
void ESHelper::save(EditorState& ed) {
try {
ed.fumen.autoSaveAsMemon();

View File

@ -63,8 +63,15 @@ public:
sf::Time previousPos;
sf::Time playbackPosition;
private:
sf::Time previewEnd; // sf::Time at which the chart preview stops, can be after the end of the audio
public:
const sf::Time &getPreviewEnd();
public:
void setPlaybackAndMusicPosition(sf::Time newPosition);
float getBeats () {return getBeatsAt(playbackPosition.asSeconds());};
@ -77,12 +84,12 @@ public:
float ticksToSeconds (int ticks) {return (60.f * ticks)/(fumen.BPM * getResolution());};
float getChartRuntime () {return previewEnd.asSeconds() + fumen.offset;};
float getChartRuntime () {return getPreviewEnd().asSeconds() + fumen.offset;};
void reloadFromFumen();
void reloadMusic();
void reloadPlaybackPositionAndPreviewEnd();
void reloadAlbumCover();
void reloadPreviewEnd();
bool showPlayfield = true;
bool showProperties;

View File

@ -14,6 +14,8 @@
int main(int argc, char** argv) {
// TODO : Make the playfield not appear when there's no chart selected
// TODO : Make the linear preview display the end of the chart
// TODO : Make the linear preview timebar height movable
// Création de la fenêtre
sf::RenderWindow window(sf::VideoMode(800, 600), "FEIS");
@ -394,9 +396,9 @@ int main(int argc, char** argv) {
}
}
if (editorState->playbackPosition >= editorState->previewEnd) {
if (editorState->playbackPosition > editorState->getPreviewEnd()) {
editorState->playing = false;
editorState->playbackPosition = editorState->previewEnd;
editorState->playbackPosition = editorState->getPreviewEnd();
}
} else {
if (editorState->music) {