Subversion Repositories Kolibri OS

Rev

Rev 6357 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;----------------------------------------------------------
  2. ;input:
  3. ; eax - start X
  4. ; ebx - start Y
  5. ; ecx - size X
  6. ; edx - size Y
  7. ; esi - colos styles (1...7)
  8. draw_volume_rectangle:
  9.         mov     [line_x],eax
  10.         mov     [line_y],ebx
  11.         mov     [line_size_x],ecx
  12.         mov     [line_size_y],edx
  13.         cmp     esi,1
  14.         jne     no_volume_light_rectangle
  15.  
  16.         ;mov esi,dword[syscolors+20]
  17.         mov     [color_rectangle],0xc7cbcf ;esi
  18.         mov     [color_line1],0xaeabae
  19.         mov     [color_line2],0xffffff
  20.         mov     [color_line3],0xc7cbcf ;esi
  21.         jmp     exit_colors
  22. ;----------------------------------------------------------
  23. no_volume_light_rectangle:
  24.         cmp     esi,2
  25.         jne     no_pressed_rectangle
  26.  
  27.         mov     [color_rectangle],0x666666
  28.         mov     [color_line1],0xaeabae
  29.         mov     [color_line2],0x666666
  30.         mov     [color_line3],0x666666
  31.         jmp     exit_colors
  32. ;----------------------------------------------------------
  33. no_pressed_rectangle:
  34.         cmp     esi,3
  35.         jne     no_pressed_panel
  36.  
  37.         mov esi,dword[syscolors+20]
  38.         mov     [color_rectangle],esi
  39.         mov     [color_line1],0xaeabae
  40.         mov     [color_line2],7000
  41.         mov     [color_line3],0xffffff
  42.         jmp     exit_colors
  43. ;----------------------------------------------------------
  44. no_pressed_panel:
  45.         cmp     esi,4
  46.         jne     no_pressed_light_panel
  47.  
  48.         mov     [color_rectangle],0xffffff
  49.         mov     [color_line1],0xaeabae
  50.         mov     [color_line2],7000
  51.         mov     [color_line3],0xffffff
  52.         jmp     exit_colors
  53. ;----------------------------------------------------------
  54. no_pressed_light_panel:
  55.         cmp     esi,5
  56.         jne     no_light_pressed_rectangle
  57.  
  58.         mov     [color_rectangle],0x666666
  59.         mov     [color_line1],0xaeabae
  60.         mov     [color_line2],0x666666
  61.         mov     [color_line3],0x666666
  62.         jmp     exit_colors
  63. ;----------------------------------------------------------
  64. no_light_pressed_rectangle:
  65.         cmp     esi,6
  66.         jne     no_work_rectangle
  67.  
  68.         mov esi,dword[syscolors+20]
  69.         mov [color_rectangle],esi
  70.         mov     [color_line1],0xaeabae
  71.         mov     [color_line2],esi
  72.         mov     [color_line3],esi
  73.         jmp     exit_colors
  74. ;----------------------------------------------------------
  75. no_work_rectangle:
  76.         cmp     esi,7
  77.         jne     no_work_rectangle_2
  78.  
  79.         mov esi,dword[syscolors+20]
  80.         mov     [color_rectangle],esi
  81.         mov     [color_line1],esi
  82.         mov     [color_line2],esi
  83.         mov     [color_line3],esi
  84.         jmp     exit_colors
  85. ;----------------------------------------------------------
  86. no_work_rectangle_2:
  87. exit_colors:
  88. ;draw   rectangle
  89.         mov     ebx,[line_x]
  90.         mov     ecx,[line_y]
  91.         shl     ebx,16
  92.         shl     ecx,16
  93.         add     ebx,[line_size_x]
  94.         add     ecx,[line_size_y]
  95.         mov     edx,[color_rectangle]
  96.         mcall SF_DRAW_RECT
  97. ;line   1
  98.         mov     edx,[color_line1]
  99.         mov     ebx,[line_x]
  100.         mov     ecx,[line_y]
  101.         shl     ebx,16
  102.         shl     ecx,16
  103.         add     ebx,[line_x]
  104.         add     ecx,[line_y]
  105.         add     ebx,[line_size_x]
  106.         call    draw_line
  107. ;line   2
  108.         mov     edx,[color_line1]
  109.         mov     ebx,[line_x]
  110.         mov     ecx,[line_y]
  111.         shl     ebx,16
  112.         shl     ecx,16
  113.         add     ebx,[line_x]
  114.         add     ecx,[line_y]
  115.         add     ecx,[line_size_y]
  116.         call    draw_line
  117. ;line   3
  118.         mov     edx,[color_line1]
  119.         mov     ebx,[line_x]
  120.         mov     ecx,[line_y]
  121.         add     ecx,[line_size_y]
  122.         shl     ebx,16
  123.         shl     ecx,16
  124.         add     ebx,[line_x]
  125.         add     ecx,[line_y]
  126.         add     ebx,[line_size_x]
  127.         add     ecx,[line_size_y]
  128.         call    draw_line
  129. ;line   4
  130.         mov     edx,[color_line1]
  131.         mov     ebx,[line_x]
  132.         mov     ecx,[line_y]
  133.         add     ebx,[line_size_x]
  134.         shl     ebx,16
  135.         shl     ecx,16
  136.         add     ebx,[line_x]
  137.         add     ecx,[line_y]
  138.         add     ebx,[line_size_x]
  139.         add     ecx,[line_size_y]
  140.         call    draw_line
  141. ;light  line    1
  142.         mov     edx,[color_line2]
  143.         mov     ebx,[line_x]
  144.         mov     ecx,[line_y]
  145.         inc     ebx
  146.         inc     ecx
  147.         shl     ebx,16
  148.         shl     ecx,16
  149.         add     ebx,[line_x]
  150.         add     ecx,[line_y]
  151.         add     ebx,[line_size_x]
  152.         dec     ebx
  153.         inc     ecx
  154.         call    draw_line
  155. ;light  line    2
  156.         mov     edx,[color_line2]
  157.         mov     ebx,[line_x]
  158.         mov     ecx,[line_y]
  159.         inc     ebx
  160.         inc     ecx
  161.         shl     ebx,16
  162.         shl     ecx,16
  163.         add     ebx,[line_x]
  164.         add     ecx,[line_y]
  165.         add     ecx,[line_size_y]
  166.         dec     ecx
  167.         inc     ebx
  168.         call    draw_line
  169. ;light  line    3
  170.         mov     edx,[color_line3]
  171.         mov     ebx,[line_x]
  172.         mov     ecx,[line_y]
  173.         add     ebx,[line_size_x]
  174.         dec     ebx
  175.         inc     ecx
  176.         shl     ebx,16
  177.         shl     ecx,16
  178.         add     ebx,[line_x]
  179.         add     ecx,[line_y]
  180.         add     ebx,[line_size_x]
  181.         add     ecx,[line_size_y]
  182.         dec     ebx
  183.         dec     ecx
  184.         call    draw_line
  185. ;light  line    4
  186.         mov     edx,[color_line3]
  187.         mov     ebx,[line_x]
  188.         mov     ecx,[line_y]
  189.         add     ecx,[line_size_y]
  190.         inc     ebx
  191.         dec     ecx
  192.         shl     ebx,16
  193.         shl     ecx,16
  194.         add     ebx,[line_x]
  195.         add     ecx,[line_y]
  196.         add     ecx,[line_size_y]
  197.         add     ebx,[line_size_x]
  198.         dec     ecx
  199.         dec     ebx
  200.         call    draw_line
  201.         ret
  202. ;----------------------------------------------------------
  203. rectangle:
  204. no_light_rectangle:
  205.         mov     [line_x],eax
  206.         mov     [line_y],ebx
  207.         mov     [line_size_x],ecx
  208.         mov     [line_size_y],edx
  209.         mov     edx,esi
  210.         mov     ebx,[line_x]
  211.         mov     ecx,[line_y]
  212.         shl     ebx,16
  213.         shl     ecx,16
  214.         add     ebx,[line_size_x]
  215.         add     ecx,[line_size_y]
  216.         mcall SF_DRAW_RECT
  217.         ret
  218. ;----------------------------------------------------------
  219. draw_conture:
  220.         mov     [line_x],eax
  221.         mov     [line_y],ebx
  222.         mov     [line_size_x],ecx
  223.         mov     [line_size_y],edx
  224.         mov     [color_line1],0xaeabae
  225. ;line   1
  226.         mov     edx,[color_line1]
  227.         mov     ebx,[line_x]
  228.         mov     ecx,[line_y]
  229.         shl     ebx,16
  230.         shl     ecx,16
  231.         add     ebx,[line_x]
  232.         add     ecx,[line_y]
  233.         add     ebx,[line_size_x]
  234.         call    draw_line
  235. ;line   2
  236.         mov     edx,[color_line1]
  237.         mov     ebx,[line_x]
  238.         mov     ecx,[line_y]
  239.         shl     ebx,16
  240.         shl     ecx,16
  241.         add     ebx,[line_x]
  242.         add     ecx,[line_y]
  243.         add     ecx,[line_size_y]
  244.         call    draw_line
  245. ;line   3
  246.         mov     edx,[color_line1]
  247.         mov     ebx,[line_x]
  248.         mov     ecx,[line_y]
  249.         add     ecx,[line_size_y]
  250.         shl     ebx,16
  251.         shl     ecx,16
  252.         add     ebx,[line_x]
  253.         add     ecx,[line_y]
  254.         add     ebx,[line_size_x]
  255.         add     ecx,[line_size_y]
  256.         call    draw_line
  257. ;line   4
  258.         mov     edx,[color_line1]
  259.         mov     ebx,[line_x]
  260.         mov     ecx,[line_y]
  261.         add     ebx,[line_size_x]
  262.         shl     ebx,16
  263.         shl     ecx,16
  264.         add     ebx,[line_x]
  265.         add     ecx,[line_y]
  266.         add     ebx,[line_size_x]
  267.         add     ecx,[line_size_y]
  268.         call    draw_line
  269.         ret
  270. ;----------------------------------------------------------
  271. columnus:
  272.         sub     eax,ecx
  273.         jns     no_columnus
  274.         neg     eax
  275.         cmp     eax,esi
  276.         ja      no_columnus
  277.         sub     ebx,edx
  278.         jns     no_columnus
  279.         neg     ebx
  280.         cmp     ebx,edi
  281.         ja      no_columnus
  282.         mov     eax,1
  283.         jmp     columnus_true
  284. no_columnus:
  285.         xor     eax,eax
  286. columnus_true:
  287.         ret
  288. ;----------------------------------------------------------
  289. print_text:
  290.         mov     [text_x],eax
  291.         mov     [text_y],ebx
  292.         mov     ebx,[text_x]
  293.         shl     ebx,16
  294.         add     ebx,[text_y]
  295.         mcall SF_DRAW_TEXT
  296.         ret
  297. ;----------------------------------------------------------
  298. draw_line:
  299.         mcall SF_DRAW_LINE
  300.         ret
  301. ;----------------------------------------------------------
  302. ;lightlin 12508927
  303. ;lines 5669590
  304. ;workpan 9350879
  305. ;btnpress 9089258
  306. line_x          dd      0
  307. line_y          dd      0
  308. line_size_x     dd      0
  309. line_size_y     dd      0
  310. color_line1     dd      0
  311. color_line2     dd      0
  312. color_line3     dd      0
  313. color_rectangle dd      0
  314. ;--------------------
  315. text_x          dd      0
  316. text_y          dd      0
  317. ;--------------------