Skip to content

Commit

Permalink
0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Pitto committed Oct 5, 2018
1 parent 4195a8e commit fc2c6e3
Show file tree
Hide file tree
Showing 6 changed files with 1,044 additions and 1,042 deletions.
26 changes: 19 additions & 7 deletions data/instructions.txt
Original file line number Diff line number Diff line change
@@ -1,34 +1,46 @@
F1..........Show / Hide help

DRAW TOOLS______________________________________________________________
A...........Direct Sel. tool - click & drag to select multiple nodes

A...........Direct Selection tool - click and drag to select multiple nodes
V...........Selection tool - click and drag to select multiple polygons
P...........Pen Tool
left mouse click to add points, right click to
automatically close path
SPACE.......Hand Tool - while pressed it's possible to drag the artwork
using the mouse
SPACE.......Hand Tool - while pressed it's possible to drag the artwork using the mouse
LEFT SHIFT..while pressed disable snapping to point or line

EDITING COMMANDS________________________________________________________

CANC........Delete selected polygon/s or nodes
VIEW COMMANDS___________________________________________________________

VIEW COMMANDS

Q...........Show / Hide Points
W...........Show / Hide Wireframe
C...........Show / Hide Centroids
B...........Show / Hide background Bitmap
X...........Show / Hide alpha Bitmap

FILE COMMANDS___________________________________________________________

S...........Save as .lpe file <- WILL OVERWRITE EXISTING FILE
E...........Exports as SVG file <- WILL OVERWRITE EXISTING FILE
CTRL + L....load .lpe file

DEBUG COMMANDS__________________________________________________________

D...........Show / Hide Polygon point's pointers Address
CTRL + R....Fill artwork with random polygons

Special thanks to:
D.J. Peters for his ImageScale function
Mr Swiss for his code review of the scanline algorithm

Stonemonkey, Muttonhead for their tips

the fill polygon (using scanline algorithm) function is a translation of a c snippet by Angad...
original source:
http://code-heaven.blogspot.it/2009/10/simple-c-program-for-scan-line-polygon.html
FB Low Poly Editor is created using FreeBasic language: www.freebasic.net
original source: http://code-heaven.blogspot.it/2009/10/simple-c-program-for-scan-line-polygon.html

FB Low Poly Editor is created using FreeBasic language: www.freebasic.net

16 changes: 16 additions & 0 deletions functions.bi
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ declare sub unmark_all_nodes ( array() as polygon_proto)
declare sub move_selected_node(x_offset as integer, y_offset as integer, array() as polygon_proto)
declare function delete_selected_node (node as point_proto ptr) as point_proto ptr
declare function count_selected_nodes (head as point_proto ptr) as integer
declare sub get_selection_bounds (user_mouse as mouse_proto ptr)

'_______________________________________________________________________

Expand Down Expand Up @@ -1582,3 +1583,18 @@ function count_selected_nodes (head as point_proto ptr) as integer
return i

end function

sub get_selection_bounds (user_mouse as mouse_proto ptr)

user_mouse->bounding_x1 = user_mouse->drag_x1
user_mouse->bounding_y1 = user_mouse->drag_y1
user_mouse->bounding_x2 = user_mouse->drag_x2
user_mouse->bounding_y2 = user_mouse->drag_y2
if user_mouse->bounding_x1 > user_mouse->bounding_x2 then
swap user_mouse->bounding_x1, user_mouse->bounding_x2
end if
if user_mouse->bounding_y1 > user_mouse->bounding_y2 then
swap user_mouse->bounding_y1, user_mouse->bounding_y2
end if

end sub
Binary file modified img/test.bmp
Binary file not shown.
34 changes: 7 additions & 27 deletions main.bas
Original file line number Diff line number Diff line change
Expand Up @@ -304,18 +304,8 @@ do
'selects single nodes
case input_direct_selection
if user_mouse.is_lbtn_released then


user_mouse.bounding_x1 = user_mouse.drag_x1
user_mouse.bounding_y1 = user_mouse.drag_y1
user_mouse.bounding_x2 = user_mouse.drag_x2
user_mouse.bounding_y2 = user_mouse.drag_y2
if user_mouse.bounding_x1 > user_mouse.bounding_x2 then
swap user_mouse.bounding_x1, user_mouse.bounding_x2
end if
if user_mouse.bounding_y1 > user_mouse.bounding_y2 then
swap user_mouse.bounding_y1, user_mouse.bounding_y2
end if

get_selection_bounds(@user_mouse)

unmark_all_nodes(polygons())
mark_selected_nodes ( user_mouse.bounding_x1, user_mouse.bounding_y1, _
Expand Down Expand Up @@ -348,16 +338,7 @@ do

case input_selection
if user_mouse.is_lbtn_released then
user_mouse.bounding_x1 = user_mouse.drag_x1
user_mouse.bounding_y1 = user_mouse.drag_y1
user_mouse.bounding_x2 = user_mouse.drag_x2
user_mouse.bounding_y2 = user_mouse.drag_y2
if user_mouse.bounding_x1 > user_mouse.bounding_x2 then
swap user_mouse.bounding_x1, user_mouse.bounding_x2
end if
if user_mouse.bounding_y1 > user_mouse.bounding_y2 then
swap user_mouse.bounding_y1, user_mouse.bounding_y2
end if
get_selection_bounds(@user_mouse)
for c = 0 to Ubound(polygons)-1
if polygons(c).centroid.x > user_mouse.bounding_x1 and _
polygons(c).centroid.y > user_mouse.bounding_y1 and _
Expand Down Expand Up @@ -514,11 +495,10 @@ do

case input_direct_selection

if (user_mouse.is_lbtn_pressed) then
line (user_mouse.x, user_mouse.y)-(user_mouse.old_x, user_mouse.old_y), C_ORANGE, B
end if


if (user_mouse.is_lbtn_pressed) then
line (user_mouse.x, user_mouse.y)-(user_mouse.old_x, user_mouse.old_y), C_ORANGE, B
end if

end select

draw_mouse_pointer ( user_mouse.x, user_mouse.y,_
Expand Down
Loading

0 comments on commit fc2c6e3

Please sign in to comment.