Skip to content

Commit

Permalink
1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-rgb committed Mar 15, 2019
1 parent e6d5025 commit ac31c07
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 50 deletions.
8 changes: 4 additions & 4 deletions Milton.iss
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

[Setup]
AppName=Milton
AppVersion=1.5.1
AppVersion=1.6.0
DefaultDirName={pf}\Milton
DefaultGroupName=Milton
;UninstallDisplayIcon={app}\Milton.exe
Compression=lzma2
SolidCompression=yes
OutputBaseFilename=MiltonSetup_1.5.1_x64
;ArchitecturesAllowed=x64
;ArchitecturesInstallIn64BitMode=x64
OutputBaseFilename=MiltonSetup_1.6.0_x64
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
ChangesAssociations=yes

[Files]
Expand Down
2 changes: 1 addition & 1 deletion build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pushd build
if "%1"=="test" (
cl Milton.res ..\src\unity_tests.cc /MTd /Zi %includeFlags% %warnFlags% /FetestMilton.exe /wd4217 /link mincore.lib ..\third_party\bin\%platform%\SDL2.lib kernel32.lib OpenGL32.lib User32.lib gdi32.lib shell32.lib comdlg32.lib ole32.lib oleAut32.lib winmm.lib advapi32.lib version.lib
) else (
cl Milton.res ..\src\unity.cc /Od /MTd /Zi %includeFlags% %warnFlags% /Femilton.exe /wd4217 /link mincore.lib ..\third_party\bin\%platform%\SDL2.lib kernel32.lib OpenGL32.lib User32.lib gdi32.lib shell32.lib comdlg32.lib ole32.lib oleAut32.lib winmm.lib advapi32.lib version.lib
cl Milton.res ..\src\unity.cc /O2 /MTd /Zi %includeFlags% %warnFlags% /Femilton.exe /wd4217 /link mincore.lib ..\third_party\bin\%platform%\SDL2.lib kernel32.lib OpenGL32.lib User32.lib gdi32.lib shell32.lib comdlg32.lib ole32.lib oleAut32.lib winmm.lib advapi32.lib version.lib
)
:: ..\third_party\bin\%platform%\SDL2.lib
popd
2 changes: 1 addition & 1 deletion deploy.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if exist OUTPUT goto OUTPUT_EXISTS

set builddir=build\win64-msvc-debug-default
set builddir=build
set sdlbindir=third_party\bin

mkdir OUTPUT
Expand Down
47 changes: 5 additions & 42 deletions src/milton.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,48 +214,11 @@ stroke_append_point(Stroke* stroke, v2l canvas_point, f32 pressure)
b32 not_the_first = stroke->num_points >= 1;

// A point passes inspection if:
// a) it's the first point of this stroke
// b) it is being appended to the stroke and it didn't merge with the previous point.
b32 passed_inspection = true;

if ( passed_inspection && not_the_first ) {
i32 in_radius = (i32)(pressure * stroke->brush.radius);

// Limit the number of points we check so that we don't mess with the stroke too much.
int point_window = 4;
for ( i32 i = stroke->num_points - 1; passed_inspection && i >= 0; --i ) {
if ( i - stroke->num_points >= point_window ) {
break;
}
v2l stroke_point = stroke->points[i];
i32 stroke_radius = (i32)(stroke->brush.radius * stroke->pressures[i]);

// Pop every point that is contained by the new one, but don't leave it empty
if ( stroke_point_contains_point(canvas_point, in_radius, stroke_point, stroke_radius) ) {
if ( stroke->num_points > 1 ) {
--stroke->num_points;
} else {
break;
}
}
// Don't append this point if it's contained in a previous point.
else if ( stroke_point_contains_point(stroke_point, stroke_radius, canvas_point, in_radius) ) {
// If some other point in the past contains this point,
// then this point is invalid.
passed_inspection = false;
break;
}
}
}

// Cleared to be appended.
if ( passed_inspection ) {
// Add to current stroke.
if ( stroke->num_points < STROKE_MAX_POINTS ) {
int index = stroke->num_points++;
stroke->points[index] = canvas_point;
stroke->pressures[index] = pressure;
}
// Add to current stroke.
if ( stroke->num_points < STROKE_MAX_POINTS ) {
int index = stroke->num_points++;
stroke->points[index] = canvas_point;
stroke->pressures[index] = pressure;
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/milton_configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

#define MILTON_ZOOM_DEBUG 0

#define MILTON_DEBUG_SAVE 1

// Windows Options
#if defined(_WIN32)
// If 1, print to VS console. Debug messages always print to log file.
Expand Down

0 comments on commit ac31c07

Please sign in to comment.