From 1c2d34b3417a1b5530e782df0b2234a7cd2dce08 Mon Sep 17 00:00:00 2001 From: ZblCoder Date: Wed, 25 Feb 2015 22:06:51 +0000 Subject: [PATCH] LaserTank: Fix bugs Fix start position to 15 level Fix draw window and fix resize Fix mouse position git-svn-id: svn://kolibrios.org@5474 a494cfbc-eb01-0410-851d-a64ba20cac60 --- data/common/games/LaserTank/data.lvl | Bin 12292 -> 12292 bytes programs/games/LaserTank/trunk/LaserTank.cpp | 56 ++++++++++++------ programs/games/LaserTank/trunk/image.cpp | 4 +- .../games/LaserTank/trunk/smalllibc/func.h | 2 +- .../LaserTank/trunk/smalllibc/kosSyst.cpp | 8 +-- 5 files changed, 46 insertions(+), 24 deletions(-) diff --git a/data/common/games/LaserTank/data.lvl b/data/common/games/LaserTank/data.lvl index 175bc9ca667fccca2d085e3c382075cd3a71eb8c..a118dadec77457ba7625a939d872606264ce77d5 100644 GIT binary patch delta 14 VcmZokXi3mode = DRAW_ALPHA) + if (this->mode == DRAW_ALPHA) { newPixel.r = di((double)(pixel.r * (1 - alpha) + addPixel.r * alpha)); newPixel.g = di((double)(pixel.g * (1 - alpha) + addPixel.g * alpha)); newPixel.b = di((double)(pixel.b * (1 - alpha) + addPixel.b * alpha)); } else - if (this->mode = DRAW_ALPHA_ADD) + if (this->mode == DRAW_ALPHA_ADD) { newPixel.r = di(min(255, (double)(pixel.r * (1 - alpha) + addPixel.r * alpha))); newPixel.g = di(min(255, (double)(pixel.g * (1 - alpha) + addPixel.g * alpha))); diff --git a/programs/games/LaserTank/trunk/smalllibc/func.h b/programs/games/LaserTank/trunk/smalllibc/func.h index 3ab4fe6c6b..8bc186b8aa 100644 --- a/programs/games/LaserTank/trunk/smalllibc/func.h +++ b/programs/games/LaserTank/trunk/smalllibc/func.h @@ -3,7 +3,7 @@ #include "kosSyst.h" #include "kosFile.h" -#include "mcsmemm.H" +#include "mcsmemm.h" #include diff --git a/programs/games/LaserTank/trunk/smalllibc/kosSyst.cpp b/programs/games/LaserTank/trunk/smalllibc/kosSyst.cpp index d81634ef92..ba4d969803 100644 --- a/programs/games/LaserTank/trunk/smalllibc/kosSyst.cpp +++ b/programs/games/LaserTank/trunk/smalllibc/kosSyst.cpp @@ -315,7 +315,6 @@ void kos_WriteTextToWindow( kos_sysfunc4(arg2, textPtr, arg1, textLen); } - // функция 5 пауза, в сотых долях секунды void kos_Pause( Dword value ) { @@ -328,7 +327,6 @@ void kos_Pause( Dword value ) } } - // функция 7 нарисовать изображение void kos_PutImage( RGB * imagePtr, Word sizeX, Word sizeY, Word x, Word y ) { @@ -517,9 +515,11 @@ void kos_GetMouseState( Dword & buttons, int & cursorX, int & cursorY ) // kos_ProcessInfo( &sPI ); // + int left = (int)((sPI.processInfo.x_size - 384) / 2); + int top = sPI.processInfo.y_size - 384 - left; buttons = mB; - cursorX = curX - sPI.processInfo.x_start; - cursorY = curY - sPI.processInfo.y_start; + cursorX = curX - sPI.processInfo.x_start - left; + cursorY = curY - sPI.processInfo.y_start - top; }