Skip to content

Commit

Permalink
Version to 1.0.7. Added buttons to set specific frame durations when …
Browse files Browse the repository at this point in the history
…overriding.
  • Loading branch information
bluescan committed Feb 23, 2020
1 parent 330d2ad commit 03494eb
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 6 deletions.
16 changes: 12 additions & 4 deletions Src/Dialogs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void TexView::ShowImageDetailsOverlay(bool* popen, float x, float y, float w, fl

void TexView::ShowCheatSheetPopup(bool* popen)
{
tVector2 windowPos = GetDialogOrigin(0);
tVector2 windowPos = GetDialogOrigin(4);
ImGui::SetNextWindowBgAlpha(0.80f);
ImGui::SetNextWindowSize(tVector2(300.0f, 400.0f));
ImGui::SetNextWindowPos(windowPos, ImGuiCond_FirstUseEver);
Expand Down Expand Up @@ -199,7 +199,7 @@ void TexView::ShowPropertyEditorWindow(bool* popen)

// We specify a default position/size in case there's no data in the .ini file. Typically this isn't required! We only
// do it to make the Demo applications a little more welcoming.
tVector2 windowPos = GetDialogOrigin(4);
tVector2 windowPos = GetDialogOrigin(0);
ImGui::SetNextWindowPos(windowPos, ImGuiCond_FirstUseEver);

if (!ImGui::Begin("Image Property Editor", popen, windowFlags))
Expand All @@ -210,7 +210,7 @@ void TexView::ShowPropertyEditorWindow(bool* popen)

if (!CurrImage)
{
ImGui::Text("No current image.");
ImGui::Text("No Images in Folder");
ImGui::End();
return;
}
Expand Down Expand Up @@ -321,6 +321,9 @@ void TexView::ShowPropertyEditorWindow(bool* popen)
}

int numParts = CurrImage->GetNumParts();
if ((numParts <= 1) && !fileTypeSectionDisplayed)
ImGui::Text("No Editable Image Properties Available");

if (numParts > 1)
{
if (fileTypeSectionDisplayed)
Expand All @@ -341,8 +344,13 @@ void TexView::ShowPropertyEditorWindow(bool* popen)
ImGui::Checkbox("Override Frame Duration", &CurrImage->PartDurationOverrideEnabled);
if (CurrImage->PartDurationOverrideEnabled)
{
ImGui::InputFloat("Frame Duration", &CurrImage->PartDurationOverride, 0.01f, 0.1f, "%.3f");
ImGui::InputFloat("Frame Duration", &CurrImage->PartDurationOverride, 0.01f, 0.1f, "%.4f");
tMath::tiClamp(CurrImage->PartDurationOverride, 0.0f, 60.0f);

if (ImGui::Button("1.0s")) CurrImage->PartDurationOverride = 1.0f; ImGui::SameLine();
if (ImGui::Button("0.5s")) CurrImage->PartDurationOverride = 0.5f; ImGui::SameLine();
if (ImGui::Button("30fps")) CurrImage->PartDurationOverride = 1.0f/30.0f; ImGui::SameLine();
if (ImGui::Button("60fps")) CurrImage->PartDurationOverride = 1.0f/60.0f;
}

ImGui::PopItemWidth();
Expand Down
2 changes: 1 addition & 1 deletion Src/TacitTexView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace TexView
tCommand::tParam ImageFileParam(1, "ImageFile", "File to open.");
int MajorVersion = 1;
int MinorVersion = 0;
int Revision = 6;
int Revision = 7;
NavLogBar NavBar;
tString ImagesDir;
tList<tStringItem> ImagesSubDirs;
Expand Down
2 changes: 1 addition & 1 deletion Tacent/Modules/Image/Inc/Image/tPicture.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class tPicture : public tLink<tPicture>
tString Filename;
tPixelFormat SrcPixelFormat = tPixelFormat::Invalid;
uint TextureID = 0;
float Duration = 1.0f/30.0f;
float Duration = 0.5f;

private:
static int GetCxFormat(tSystem::tFileType);
Expand Down
Binary file removed TestImages/FormatVariety/SkyBack.jpg
Binary file not shown.
Binary file removed TestImages/FormatVariety/SkyFront.jpg
Binary file not shown.
Binary file removed TestImages/FormatVariety/SkyTop.jpg
Binary file not shown.
Binary file added TestImages/FormatVariety/newcage.tga
Binary file not shown.

0 comments on commit 03494eb

Please sign in to comment.