Subversion Repositories Kolibri OS

Rev

Rev 7427 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7427 Rev 7441
Line 2... Line 2...
2
 
2
 
Line 3... Line 3...
3
;add_object_in_list, (¢à¥¬. áâà.), (Object.FigData)
3
;add_object_in_list, (¢à¥¬. áâà.), (Object.FigData)
4
;       mov [Object.FigData], (tl_node_add(¢à¥¬. áâà.),tl_node_get_data)
4
;       mov [Object.FigData], (tl_node_add(¢à¥¬. áâà.),tl_node_get_data)
Line 5... Line 5...
5
 
5
 
Line 6... Line 6...
6
;draw_fig2d_litl, ___, pobj, (Object.FigData), ___, ___, ___
6
;draw_fig2d_litl, ___, pobj, (Object.FigData), fign, ___, ___, ___
7
 
7
 
8
struct Object
8
struct Object
9
        OType dd ?
9
        OType dd ?
Line 105... Line 105...
105
graf_margin_left   dd 3 ;margin in pixels
105
graf_margin_left   dd 3 ;margin in pixels
106
graf_margin_right  dd 3+6 ;margin in pixels
106
graf_margin_right  dd 3+6 ;margin in pixels
107
graf_margin_top    dd 3+9 ;margin in pixels
107
graf_margin_top    dd 3+9 ;margin in pixels
108
graf_margin_bot    dd 3+9 ;margin in pixels
108
graf_margin_bot    dd 3+9 ;margin in pixels
109
png_data dd ?
109
data_printed dd ? ;ç¨á«® ¢ë¯®«­¥­­ëå ª®¬ ­¤
110
png_size dd ?
110
data_all     dd ? ;ç¨á«® ¢á¥å ª®¬ ­¤
111
 
111
 
Line 112... Line 112...
112
;global variables:
112
;global variables:
113
ObjData Object
113
ObjData Object
114
FigData Figure ;¢à¥¬¥­­ ï áâàãªâãà  ¤«ï § ¯®«­¥­¨ï tree1
114
FigData Figure ;¢à¥¬¥­­ ï áâàãªâãà  ¤«ï § ¯®«­¥­¨ï tree1
115
PoiData Point
115
PoiData Point
Line 218... Line 218...
218
                mov [ebx+Object.FigData],eax
218
                mov [ebx+Object.FigData],eax
219
                push ecx
219
                push ecx
220
                        mov edi,eax
220
                        mov edi,eax
221
                        xor eax,eax
221
                        xor eax,eax
222
                        rep stosd ;clear memory
222
                        mov [data_all],eax ;å¨â஥ ­ ç «ì­®¥ ®¡­ã«¥­¨¥ áç¥â稪 
-
 
223
                        mov [data_printed],eax
-
 
224
                        rep stosd ;clear memory
223
                pop ecx
225
                pop ecx
224
 
226
 
Line 225... Line 227...
225
                mov edi,[ebx+Object.FigData]
227
                mov edi,[ebx+Object.FigData]
226
align 4
228
align 4
227
                .cycle0:
229
                .cycle0:
228
                        stdcall FigureInit,edi
230
                        stdcall FigureInit,edi
-
 
231
                        mov eax,[edi]
-
 
232
                        mov eax,[eax+Figure.PoiCount]
-
 
233
                        or eax,eax
-
 
234
                        jnz @f
-
 
235
                        	inc eax ;¬¨­¨¬ã¬ 1-­  ª®¬ ­¤ 
-
 
236
                        @@:
-
 
237
                        add [data_all],eax
229
                        cmp esi,[etxt]
238
                        cmp esi,[etxt]
230
                        jge .cycle0end
239
                        jge .cycle0end
231
                        add edi,4
240
                        add edi,4
232
                loop .cycle0
241
                loop .cycle0
233
                .cycle0end:
242
                .cycle0end:
234
                inc dword[ebx+Object.FigCount] ;???
243
                inc dword[ebx+Object.FigCount]
235
                or ecx,ecx
244
                or ecx,ecx
236
                jz @f
245
                jz @f
237
                        ;㬥­ìè ¥¬ ®¡ê¥¬ ¯ ¬ï⨠¢ë¤¥«¥­­ë© ¤«ï ª®¬ ­¤
246
                        ;㬥­ìè ¥¬ ®¡ê¥¬ ¯ ¬ï⨠¢ë¤¥«¥­­ë© ¤«ï ª®¬ ­¤
238
                        sub [ebx+Object.FigCount],ecx
247
                        sub [ebx+Object.FigCount],ecx
239
                        mov eax,[ebx+Object.FigCount]
248
                        mov eax,[ebx+Object.FigCount]
240
                        shl eax,2
249
                        shl eax,2
241
                        stdcall mem.ReAlloc,[ebx+Object.FigData],eax
250
                        stdcall mem.ReAlloc,[ebx+Object.FigData],eax
242
                        mov [ebx+Object.FigData],eax
251
                        mov [ebx+Object.FigData],eax
243
                @@:
252
                @@:
-
 
253
                ;ãáâ ­®¢ª  áç¥â稪  ¨ ¯à®£à¥á¡ à  ­  25 %
-
 
254
                mov eax,[data_all]
-
 
255
                mov [pb.max],eax
-
 
256
                shr eax,2
-
 
257
                mov [data_printed],eax
-
 
258
                mov [pb.value],eax
Line 244... Line 259...
244
 
259
 
Line 245... Line 260...
245
                stdcall ObjCalculateScale,ebx
260
                stdcall ObjCalculateScale,ebx
246
 
261
 
Line 894... Line 909...
894
; äã­ªæ¨ï ¤«ï à¨á®¢ ­¨ï ¢ë¡à ­­®£® ®¡ê¥ªâ 
909
; äã­ªæ¨ï ¤«ï à¨á®¢ ­¨ï ¢ë¡à ­­®£® ®¡ê¥ªâ 
895
align 4
910
align 4
896
proc draw_obj2d, pobj:dword
911
proc draw_obj2d, pobj:dword
897
locals
912
locals
898
        CentrX dd ?
913
        data_draw dd ?
-
 
914
        CentrX dd ?
899
        CentrY dd ?
915
        CentrY dd ?
900
endl
916
endl
901
pushad
917
pushad
902
        mov ebx,[pobj]
918
        mov ebx,[pobj]
903
        stdcall [buf2d_clear], buf_0, [buf_0.color]
919
        stdcall [buf2d_clear], buf_0, [buf_0.color]
Line 932... Line 948...
932
                sar edx,1
948
                sar edx,1
933
                add edx,[graf_margin_left]
949
                add edx,[graf_margin_left]
934
                add edx,[ebx+Object.MCentrX]
950
                add edx,[ebx+Object.MCentrX]
935
                mov [CentrX],edx
951
                mov [CentrX],edx
936
align 4
952
                mov dword[data_draw],0
-
 
953
align 4
937
                .cycle0:
954
                .cycle0:
938
                        stdcall draw_fig2d_litl, buf_0,ebx,[edi],0,edx,eax
955
                        stdcall draw_fig2d_litl, buf_0,ebx,[edi],[data_draw],0,edx,eax
939
                        add edi,4
956
                        mov esi,[edi]
-
 
957
                        mov esi,[esi+Figure.PoiCount]
-
 
958
                        or esi,esi
-
 
959
                        jnz @f
-
 
960
                        inc esi
-
 
961
                        @@:
-
 
962
                        add [data_draw],esi
-
 
963
                        add edi,4
940
                        loop .cycle0
964
                        loop .cycle0
941
                stdcall [buf2d_flip_v], buf_0
965
                stdcall [buf2d_flip_v], buf_0
942
 
966
 
Line 943... Line 967...
943
        bt dword[opt_draw],0
967
        bt dword[opt_draw],0
Line 979... Line 1003...
979
endp
1003
endp
980
 
1004
 
Line 981... Line 1005...
981
;input:
1005
;input:
982
; pbuf - pointer to buffer 2d
1006
; pbuf - pointer to buffer 2d
-
 
1007
; pobj - 㪠§ â¥«ì ­  ®¡ê¥ªâ
-
 
1008
; pfig - 㪠§ â¥«ì ­  䨣ãàã
-
 
1009
; fign - ­®¬¥à 䨣ãàë
983
;description:
1010
;description:
984
; äã­ªæ¨ï ¤«ï à¨á®¢ ­¨ï ®¡ê¥ªâ  ¯® ç áâï¬
1011
; äã­ªæ¨ï ¤«ï à¨á®¢ ­¨ï ®¡ê¥ªâ  ¯® ç áâï¬
985
align 4
1012
align 4
986
proc draw_fig2d_litl, pbuf:dword, pobj:dword, pfig:dword, Scale:dword, CentrX:dword, CentrY:dword
1013
proc draw_fig2d_litl, pbuf:dword, pobj:dword, pfig:dword, fign:dword,\
-
 
1014
	Scale:dword, CentrX:dword, CentrY:dword
987
locals
1015
locals
-
 
1016
        line_col dd ? ;figure color
988
        PervX dd 0 ;pervios point coord X
1017
		PervX dd 0 ;pervios point coord X
989
        PervY dd 0 ;pervios point coord Y
1018
        PervY dd 0 ;pervios point coord Y
990
        GrafX dd ? ;active point coord X
1019
        GrafX dd ? ;active point coord X
991
        GrafY dd ? ;active point coord Y
1020
        GrafY dd ? ;active point coord Y
992
endl
1021
endl
Line 1009... Line 1038...
1009
                fmul qword[eax]
1038
                fmul qword[eax]
1010
                lea eax,[edx+Object.WScale]
1039
                lea eax,[edx+Object.WScale]
1011
        @@:
1040
        @@:
1012
        fmul qword[eax]
1041
        fmul qword[eax]
1013
align 4
1042
        mov esi,[fign]
-
 
1043
align 4
1014
        .cycle0:
1044
        .cycle0:
1015
                fld qword[edi+Point.CoordX]
1045
                fld qword[edi+Point.CoordX]
1016
                fsub qword[edx+Object.MinX]
1046
                fsub qword[edx+Object.MinX]
1017
                fmul st0,st1
1047
                fmul st0,st1
1018
                fiadd dword[CentrX]
1048
                fiadd dword[CentrX]
Line 1023... Line 1053...
1023
                fiadd dword[CentrY]
1053
                fiadd dword[CentrY]
1024
                fistp dword[ebp-4]
1054
                fistp dword[ebp-4]
1025
                stdcall [buf2d_set_pixel], [pbuf], [GrafX],[GrafY], 0xff0000
1055
                stdcall [buf2d_set_pixel], [pbuf], [GrafX],[GrafY], 0xff0000
1026
                cmp ecx,[ebx+Figure.PoiCount]
1056
                cmp ecx,[ebx+Figure.PoiCount]
1027
                je @f
1057
                je .end0
1028
                        stdcall [buf2d_line_sm], [pbuf], [PervX],[PervY], [GrafX],[GrafY], 0x80
1058
                        ;®¯à¥¤¥«¥­¨¥ 梥â 
1029
                        ;sub esp,24
1059
                        cmp esi,[data_printed]
1030
                        ;call [buf2d_line]
1060
                        jl @f
1031
                        stdcall [buf2d_line], [pbuf], [PervX],[PervY], [GrafX],[GrafY], 0x80
1061
                        mov [line_col],0x80 ;if not printed
1032
                @@:
1062
                        jmp .end1
-
 
1063
                        @@:
1033
                mov eax,[GrafX]
1064
                        mov [line_col],0xff0000 ;if was printed
-
 
1065
                        .end1:
-
 
1066
                        stdcall [buf2d_line_sm], [pbuf], [PervX],[PervY], [GrafX],[GrafY], [line_col]
-
 
1067
                        stdcall [buf2d_line], [pbuf], [PervX],[PervY], [GrafX],[GrafY], [line_col]
-
 
1068
                .end0:
-
 
1069
                mov eax,[GrafX]
1034
                mov [PervX],eax
1070
                mov [PervX],eax
1035
                mov eax,[GrafY]
1071
                mov eax,[GrafY]
1036
                mov [PervY],eax
1072
                mov [PervY],eax
1037
                add edi,sizeof.Point
1073
                add edi,sizeof.Point
1038
        ;;loop .cycle0
1074
                inc esi
-
 
1075
        ;;loop .cycle0
1039
                dec ecx
1076
                dec ecx
1040
        jnz .cycle0
1077
        jnz .cycle0
1041
        ffree st0
1078
        ffree st0
1042
        fincstp
1079
        fincstp
1043
 
1080