From d1b2b4706fda920569383014b38fc14040f04985 Mon Sep 17 00:00:00 2001
From: IgorA <IgorA@kolibrios.org>
Date: Mon, 11 Oct 2010 12:07:55 +0000
Subject: [PATCH] fixed assignment of colors in some functions, red and blue
 swapped. Now the color match on a system functions

git-svn-id: svn://kolibrios.org@1653 a494cfbc-eb01-0410-851d-a64ba20cac60
---
 .../develop/libraries/buf2d/trunk/about.htm   |  1 +
 .../develop/libraries/buf2d/trunk/buf2d.asm   | 48 +++++++++----------
 programs/games/nu_pogodi/trunk/nu_pogod.ini   | 10 ++--
 3 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/programs/develop/libraries/buf2d/trunk/about.htm b/programs/develop/libraries/buf2d/trunk/about.htm
index 51f5c9c0ae..221e057cd5 100644
--- a/programs/develop/libraries/buf2d/trunk/about.htm
+++ b/programs/develop/libraries/buf2d/trunk/about.htm
@@ -261,5 +261,6 @@ import_buf2d_lib:
 <p>30.09.10 - ��������� ������� buf2d_rect_by_size.</p>
 <p>04.10.10 - ��������� ������� buf2d_filled_rect_by_size, ���������� ������� buf_bit_blt_alpha.</p>
 <p>07.10.10 - ���������� ������� buf_bit_blt (��� ������� ���������� ����������� �� ��������� ������� ���� ������ ���������� ��������� ������� ������).</p>
+<p>11.10.10 - ���������� ������� ������ � ��������� ��������, ������� � ����� ����� ������� �������. ������ ����� ��������� � ��������� ���������.</p>
  </body>
 </html>
\ No newline at end of file
diff --git a/programs/develop/libraries/buf2d/trunk/buf2d.asm b/programs/develop/libraries/buf2d/trunk/buf2d.asm
index 2d45e54294..ad9c8dba99 100644
--- a/programs/develop/libraries/buf2d/trunk/buf2d.asm
+++ b/programs/develop/libraries/buf2d/trunk/buf2d.asm
@@ -998,7 +998,7 @@ endl
 	ret
 endp
 
-;�ᮢ���� ��ਧ��⠫쭮� �����, ��⮬� ��� ��ࠬ��� coord_y0
+;�ᮢ���� ��ਧ��⠫쭮� �����, ��⮬� ��� ��ࠬ��� coord_y1
 align 4
 proc buf_line_h, buf_struc:dword, coord_x0:dword, coord_y0:dword, coord_x1:dword, color:dword
 	pushad
@@ -1544,24 +1544,6 @@ combine_colors:
 	mov cl,byte[esi+3] ;pro
 	xor ch,ch
 	sub bx,cx ;256-pro
-	;---red---
-	xor ah,ah
-	mov al,byte[esi+2]
-	imul ax,bx
-	xor dh,dh
-	mov dl,byte[edi+2]
-	imul dx,cx
-	add ax,dx
-	mov byte[edi+2],ah
-	;---green---
-	xor ah,ah
-	mov al,byte[esi+1]
-	imul ax,bx
-	xor dh,dh
-	mov dl,byte[edi+1]
-	imul dx,cx
-	add ax,dx
-	mov byte[edi+1],ah
 	;---blye---
 	xor ah,ah
 	mov al,byte[esi]
@@ -1571,6 +1553,24 @@ combine_colors:
 	imul dx,cx
 	add ax,dx
 	mov byte[edi],ah
+	;---green---
+	xor ah,ah
+	mov al,byte[esi+1]
+	imul ax,bx
+	xor dh,dh
+	mov dl,byte[edi+1]
+	imul dx,cx
+	add ax,dx
+	mov byte[edi+1],ah
+	;---red---
+	xor ah,ah
+	mov al,byte[esi+2]
+	imul ax,bx
+	xor dh,dh
+	mov dl,byte[edi+2]
+	imul dx,cx
+	add ax,dx
+	mov byte[edi+2],ah
 
 	pop dx cx bx ax
 	ret
@@ -1674,16 +1674,16 @@ combine_colors_2:
 	mov si,0x00ff ;---get transparent---
 	sub si,cx ;256-pro
 
-	;---blye---
+		;---blye---
 		mov al,bl
 		xor ah,ah
 		shr ebx,8
 		imul ax,si
 		xor dh,dh
-		mov dl,byte[edi+2]
+		mov dl,byte[edi]
 		imul dx,cx
 		add ax,dx
-		mov byte[edi+2],ah
+		mov byte[edi],ah
 		;---green---
 		mov al,bl
 		xor ah,ah
@@ -1699,10 +1699,10 @@ combine_colors_2:
 		xor ah,ah
 		imul ax,si
 		xor dh,dh
-		mov dl,byte[edi]
+		mov dl,byte[edi+2]
 		imul dx,cx
 		add ax,dx
-		mov byte[edi],ah
+		mov byte[edi+2],ah
 
 	pop si dx cx ebx ax
 	ret
diff --git a/programs/games/nu_pogodi/trunk/nu_pogod.ini b/programs/games/nu_pogodi/trunk/nu_pogod.ini
index 09edb3364c..6e7244b5b6 100644
--- a/programs/games/nu_pogodi/trunk/nu_pogod.ini
+++ b/programs/games/nu_pogodi/trunk/nu_pogod.ini
@@ -14,9 +14,9 @@ delay_min=15
 [Colors]
 background=255,255,255 ;���� ����
 shadows=200,200,200 ;���� �����
-unit=64,0,0 ;���� ������
-objects=64,64,128 ;���� ����������� ���������
-lost=0,208,208 ;���� ����������� ���������
-dec0=0,0,128
-dec1=128,128,208
+unit=0,0,64 ;���� ������
+objects=128,64,64 ;���� ����������� ���������
+lost=208,208,0 ;���� ����������� ���������
+dec0=128,0,0
+dec1=208,128,128
 dec2=0,128,0
\ No newline at end of file