update: add vertical and horizontal lines for align image

git-svn-id: svn://kolibrios.org@8090 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA
2020-10-02 15:21:56 +00:00
parent bf38c73d0a
commit 02edd3949b
2 changed files with 93 additions and 20 deletions

View File

@@ -4,18 +4,17 @@ use32
dd 1,start,i_end,mem,stacktop,openfile_path,sys_path
include 'lang.inc'
include '../../../programs/macros.inc'
include '../../../programs/proc32.inc'
include '../../../programs/KOSfuncs.inc'
include '../../../programs/load_img.inc'
include '../../../programs/develop/libraries/TinyGL/asm_fork/opengl_const.inc'
include '../../../programs/develop/libraries/libs-dev/libimg/libimg.inc'
include '../../../programs/develop/info3ds/info_fun_float.inc'
include '../../macros.inc'
include '../../proc32.inc'
include '../../KOSfuncs.inc'
include '../../load_img.inc'
include '../../develop/libraries/TinyGL/asm_fork/opengl_const.inc'
include '../../develop/libraries/TinyGL/asm_fork/zbuffer.inc'
include '../../develop/libraries/libs-dev/libimg/libimg.inc'
include '../../develop/info3ds/info_fun_float.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
caption db 'Image transform 10.06.20',0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
offs_zbuf_pbuf equ 24 ;const. from 'zbuffer.inc'
caption db 'Image transform 02.10.20',0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
BUF_STRUCT_SIZE equ 21
buf2d_data equ dword[edi] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0A0A6><EFBFBD><EFBFBD>
@@ -266,6 +265,24 @@ pushad
stdcall [buf2d_bit_blt], buf_0, [nav_x],[nav_y] ;,...
call points_draw
xor eax,eax
cmp [u_line_v],eax
je @f
mov eax,[u_line_v]
add eax,[nav_x]
stdcall [buf2d_line], buf_0, eax,0, eax,[buf_0.h], 0xffffff
inc eax
stdcall [buf2d_line], buf_0, eax,0, eax,[buf_0.h], 0
@@:
xor eax,eax
cmp [u_line_h],eax
je @f
mov eax,[u_line_h]
add eax,[nav_y]
stdcall [buf2d_line], buf_0, 0,eax, [buf_0.w],eax, 0xffffff
inc eax
stdcall [buf2d_line], buf_0, 0,eax, [buf_0.w],eax, 0
@@:
; *** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E0A0A7><EFBFBD><EFBFBD><><E4A0A9> ***
mov edi,txt_f_size.size
@@ -357,6 +374,18 @@ key:
call but_img_move_right
jmp .end0
@@:
cmp ah,104 ;H
jne @f
call set_user_line_h
mov byte[calc],1
jmp .end0
@@:
cmp ah,118 ;V
jne @f
call set_user_line_w
mov byte[calc],1
jmp .end0
@@:
mov ecx,eax
mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS
@@ -660,6 +689,48 @@ proc mouse_left_u uses eax ebx
ret
endp
align 4
set_user_line_h:
pushad
call buf_get_mouse_coord
cmp eax,-1
je .end0
mov [mouse_down_y],ebx
sub ebx,[nav_y]
cmp eax,[buf_i0.h]
jle @f
mov eax,[buf_i0.h]
@@:
cmp [u_line_h],ebx
jne @f
xor ebx,ebx ;line on/off
@@:
mov [u_line_h],ebx
.end0:
popad
ret
align 4
set_user_line_w:
pushad
call buf_get_mouse_coord
cmp eax,-1
je .end0
mov [mouse_down_x],eax
sub eax,[nav_x]
cmp eax,[buf_i0.w]
jle @f
mov eax,[buf_i0.w]
@@:
cmp [u_line_v],eax
jne @f
xor eax,eax ;line on/off
@@:
mov [u_line_v],eax
.end0:
popad
ret
align 4
proc but_new_file uses eax edi esi
xor eax,eax
@@ -715,6 +786,7 @@ proc calc_nav_params uses eax ecx edi
shr dword[nav_sy],1
xor ecx,ecx
mov [u_line_v],ecx
mov eax,[buf_i0.w]
@@:
inc ecx
@@ -723,6 +795,7 @@ proc calc_nav_params uses eax ecx edi
jg @b
mov [nav_wnd_zoom],ecx
xor ecx,ecx
mov [u_line_h],ecx
mov eax,[buf_i0.h]
@@:
inc ecx
@@ -878,10 +951,8 @@ proc but_open_file
;ᮧ<><E1AEA7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><EFBFBD><EFBFBD><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0A0A6><EFBFBD><EFBFBD>
mov edi,buf_ogl
mov eax,[buf_i0.w]
and eax, not 3
mov buf2d_w,eax
mov eax,[buf_i0.h]
and eax, not 3
mov buf2d_h,eax
cmp buf2d_data,0
jne @f
@@ -897,7 +968,7 @@ proc but_open_file
.end_2:
mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext
mov eax,[eax] ;eax -> ZBuffer
mov eax,[eax+offs_zbuf_pbuf] ;eax -> ZBuffer.pbuf
mov eax,[eax+ZBuffer.pbuf]
mov buf2d_data,eax
stdcall [buf2d_bit_blt], edi, 0,0, buf_i0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@@ -1115,7 +1186,7 @@ but_about:
ret
align 4
calc db 0
calc db 0 ;0 - <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBA2A0> <20><><EFBFBD><EFBFBD><EFBFBD>, 1 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
view_b db 0 ;0 - <20><><EFBFBD><E5AEA4><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, 1 - <20><><EFBFBD><EFBFBD><E1ACAE><><E0A5A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
trans_a db 0 ;0 - <20><EFBFBD><EFBFBD><E0A0A7><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E0A0A7><EFBFBD><EFBFBD>, 1 - <20><EFBFBD><EFBFBD><E0A0A7><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
@@ -1557,8 +1628,7 @@ buf_ogl: dd 0,0
align 16
i_end:
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
;sizeof.TinyGLContext = 28
ctx1 rb 28 ;sizeof.TinyGLContext = 28
TexObj dd 0 ;<3B><><EFBFBD>ᨢ 㪠<><E3AAA0><EFBFBD><E2A5AB> <20><><><E2A5AA><EFBFBD><EFBFBD><EFBFBD> (<28> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>砥 1 <20><>.)
nav_x_min dd 0 ;<3B><><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD>. x <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
nav_y_min dd 0 ;<3B><><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD>. y <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@@ -1576,6 +1646,8 @@ mouse_down_y dd ?
sel_act dd ? ;<3B><><20><><EFBFBD><EFBFBD><E0A0AD><EFBFBD> <20><><EFBFBD><><E0A5A4><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
sel_pt rb 8*sizeof.point2d ;<3B><><20><><EFBFBD> <20><EFBFBD><EBA1AE> 4-<2D><><E3A3AB>
last_time dd 0
u_line_v dd 0 ;<3B><><EFBFBD><EFBFBD><E2A8AA><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
u_line_h dd 0 ;<3B><><EFBFBD><E0A8A7>⠫쭠<E2A0AB> <20><><EFBFBD><EFBFBD><EFBFBD>
txt_buf rb 8
procinfo process_information
sc system_colors