From f9e3adeff5139e0d46171d936edc39c03c3c428e Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Fri, 4 Nov 2016 10:43:03 +0000 Subject: [PATCH] DrawBufer::Init() prevent case when zoom=0 git-svn-id: svn://kolibrios.org@6672 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/lib/draw_buf.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/programs/cmm/lib/draw_buf.h b/programs/cmm/lib/draw_buf.h index de5151709b..47abb5fb88 100644 --- a/programs/cmm/lib/draw_buf.h +++ b/programs/cmm/lib/draw_buf.h @@ -6,11 +6,11 @@ #include "../lib/kolibri.h" #endif -dword buf_data; +unsigned buf_data; struct DrawBufer { - int bufx, bufy, bufw, bufh; + unsigned bufx, bufy, bufw, bufh; byte zoom; void Init(); @@ -25,6 +25,7 @@ struct DrawBufer { void DrawBufer::Init(int i_bufx, i_bufy, i_bufw, i_bufh) { + if (!zoom) zoom = 1; bufx = i_bufx; bufy = i_bufy; bufw = i_bufw * zoom; @@ -35,14 +36,14 @@ void DrawBufer::Init(int i_bufx, i_bufy, i_bufw, i_bufh) ESDWORD[buf_data+4] = bufh; } -void DrawBufer::Fill(dword fill_color) +void DrawBufer::Fill(unsigned fill_color) { - int i; - int max_i = bufw * bufh * 4 + buf_data + 8; + unsigned i; + unsigned max_i = bufw * bufh * 4 + buf_data + 8; for (i=buf_data+8; i