Skip to content

Commit

Permalink
clear some TODOs; render with blur on canvas load
Browse files Browse the repository at this point in the history
serge-rgb committed May 17, 2017
1 parent 597c68c commit 135ae5a
Showing 9 changed files with 11 additions and 24 deletions.
4 changes: 2 additions & 2 deletions Milton.iss
Original file line number Diff line number Diff line change
@@ -3,13 +3,13 @@

[Setup]
AppName=Milton
AppVersion=1.2.8
AppVersion=1.4.0
DefaultDirName={pf}\Milton
DefaultGroupName=Milton
;UninstallDisplayIcon={app}\Milton.exe
Compression=lzma2
SolidCompression=yes
OutputBaseFilename=MiltonSetup_1.2.8_x64
OutputBaseFilename=MiltonSetup_1.4.0_x64
;ArchitecturesAllowed=x64
;ArchitecturesInstallIn64BitMode=x64
ChangesAssociations=yes
6 changes: 0 additions & 6 deletions src/gui.cc
Original file line number Diff line number Diff line change
@@ -157,7 +157,6 @@ milton_imgui_tick(MiltonInput* input, PlatformState* platform_state, MiltonStat
if ( fname ) {
milton_set_canvas_file(milton_state, fname);
input->flags |= MiltonInputFlags_OPEN_FILE;
// TODO: Check if this line can be removed after switching to HW rendering.
}
}
if ( ImGui::MenuItem(LOC(save_milton_canvas_as_DOTS)) || save_requested ) {
@@ -400,7 +399,6 @@ milton_imgui_tick(MiltonInput* input, PlatformState* platform_state, MiltonStat
if ( ImGui::Checkbox("##select", &v) ) {
layer_toggle_visibility(layer);
input->flags |= (i32)MiltonInputFlags_FULL_REFRESH;
input->flags |= (i32)MiltonInputFlags_FAST_DRAW;
}
ImGui::PopID();
ImGui::SameLine();
@@ -442,9 +440,6 @@ milton_imgui_tick(MiltonInput* input, PlatformState* platform_state, MiltonStat
f32 alpha = canvas->working_layer->alpha;
if ( ImGui::SliderFloat("##opacity", &alpha, 0.0f, 1.0f) ) {
// Used the slider. Ask if it's OK to convert the binary format.
// TODO: If we are going with automatically
// promoting files to version 4, then we
// don't need to do this.
if ( milton_state->mlt_binary_version < 3 ) {
milton_log("Modified milton file from %d to 3\n", milton_state->mlt_binary_version);
milton_state->mlt_binary_version = 3;
@@ -1357,4 +1352,3 @@ gui_deactivate(MiltonGui* gui)
gui->owns_user_input = false;
gui->did_hit_button = false;
}

6 changes: 1 addition & 5 deletions src/milton.cc
Original file line number Diff line number Diff line change
@@ -442,11 +442,9 @@ milton_init(MiltonState* milton_state, i32 width, i32 height, PATH_CHAR* file_to
milton_state->block_width = 32;
#endif

// TODO: Do a bootstrap here.
milton_state->gui = arena_alloc_elem(&milton_state->root_arena, MiltonGui);
gui_init(&milton_state->root_arena, milton_state->gui);


milton_state->view = arena_alloc_elem(&milton_state->root_arena, CanvasView);
milton_set_default_view(milton_state);

@@ -596,7 +594,6 @@ milton_reset_canvas(MiltonState* milton_state)
milton_state->last_save_time = {};

// Clear history
// TODO: These arrays should use the arena.
release(&canvas->history);
release(&canvas->redo_stack);
release(&canvas->stroke_graveyard);
@@ -984,8 +981,8 @@ milton_update_and_render(MiltonState* milton_state, MiltonInput* input)
if ( input->flags & MiltonInputFlags_OPEN_FILE ) {
milton_load(milton_state);
upload_gui(milton_state);
input->flags |= MiltonInputFlags_FAST_DRAW;
do_full_redraw = true;
render_flags |= RenderDataFlags_WITH_BLUR;
}

if ( milton_state->flags & MiltonStateFlags_WORKER_NEEDS_MEMORY ) {
@@ -1499,4 +1496,3 @@ milton_update_and_render(MiltonState* milton_state, MiltonInput* input)
//milton_validate(milton_state);
ARENA_VALIDATE(&milton_state->root_arena);
}

2 changes: 1 addition & 1 deletion src/milton_configuration.h
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@
// Include the software renderer.
#define SOFTWARE_RENDERER_COMPILED 0
// NOTE: software renderer has accumulated some bit rot..
// TODO: Enable software renderer as a run time option?
// TODO: Remove software renderer from codebase.


// -- Esoteric and/or Stupid stuff.
4 changes: 2 additions & 2 deletions src/persist.cc
Original file line number Diff line number Diff line change
@@ -116,10 +116,10 @@ milton_load(MiltonState* milton_state)
READ(&milton_binary_version, sizeof(u32), 1, fd);

if (ok) {

if ( milton_binary_version < 4 ) {
if ( platform_dialog_yesno ("This file will be updated to the new version of Milton. Older versions won't be able to open it. Is this OK?", "File format change") ) {
milton_state->mlt_binary_version = MILTON_MINOR_VERSION;
milton_log("Updating this file to mlt version 4.\n");
} else {
ok = false;
handled = true;
@@ -486,7 +486,7 @@ milton_save(MiltonState* milton_state)
}
else {
// TODO: Fix this on macos
// milton_die_gracefully("Could not create file for saving! ");
milton_die_gracefully("Could not create file for saving! ");
return;
}
#undef WRITE
1 change: 0 additions & 1 deletion src/platform_unix.cc
Original file line number Diff line number Diff line change
@@ -68,7 +68,6 @@ platform_deallocate_internal(void* ptr)
munmap(ptr, size);
}

// TODO: haven't checked if platform_cursor_hide or platform_cursor_show work.
void
platform_cursor_hide()
{
3 changes: 0 additions & 3 deletions src/postproc.f.glsl
Original file line number Diff line number Diff line change
@@ -29,9 +29,6 @@ main()
vec2 coord = gl_FragCoord.xy / u_screen_size;


// TODO: When exporting to a transparent background, FXAA will blend-in the background color.
// Find a fix

out_color = texture(u_canvas, coord, 0);

out_color.rgb = FxaaPixelShader(
2 changes: 0 additions & 2 deletions src/sdl_milton.cc
Original file line number Diff line number Diff line change
@@ -518,8 +518,6 @@ milton_main(char* file_to_open)
#endif

milton_log("Running Milton\n");
// TODO: Set Milton to be DPI aware.

// Note: Possible crash regarding SDL_main entry point.
// Note: Event handling, File I/O and Threading are initialized by default
milton_log("Initializing SDL... ");
7 changes: 5 additions & 2 deletions src/stroke.h
Original file line number Diff line number Diff line change
@@ -4,7 +4,10 @@
#pragma once

#include "utils.h"
#include "hardware_renderer.h" // TODO: Really? Stroke.h includes hardware_renderer.h?
#include "hardware_renderer.h" // TODO: Stroke has a RenderElement
// member. Refactor to eliminate this
// dependency


struct Brush
{
@@ -24,4 +27,4 @@ struct Stroke
i32 layer_id;
Rect bounding_rect;
RenderElement render_element;
};
};

0 comments on commit 135ae5a

Please sign in to comment.