src/gfx.cpp
changeset 7120 e31767effc16
parent 7111 269c76b5b987
child 7122 0607a15aedc0
equal deleted inserted replaced
7119:8ec832426743 7120:e31767effc16
    16 #include "variables.h"
    16 #include "variables.h"
    17 #include "table/control_codes.h"
    17 #include "table/control_codes.h"
    18 #include "fontcache.h"
    18 #include "fontcache.h"
    19 #include "genworld.h"
    19 #include "genworld.h"
    20 #include "debug.h"
    20 #include "debug.h"
       
    21 #include "zoom.hpp"
    21 
    22 
    22 #ifdef _DEBUG
    23 #ifdef _DEBUG
    23 bool _dbg_screen_rect;
    24 bool _dbg_screen_rect;
    24 #endif
    25 #endif
    25 
    26 
   151 	const DrawPixelInfo* dpi = _cur_dpi;
   152 	const DrawPixelInfo* dpi = _cur_dpi;
   152 	Pixel *dst;
   153 	Pixel *dst;
   153 	const int otop = top;
   154 	const int otop = top;
   154 	const int oleft = left;
   155 	const int oleft = left;
   155 
   156 
   156 	if (dpi->zoom != 0) return;
   157 	if (dpi->zoom != ZOOM_LVL_NORMAL) return;
   157 	if (left > right || top > bottom) return;
   158 	if (left > right || top > bottom) return;
   158 	if (right < dpi->left || left >= dpi->left + dpi->width) return;
   159 	if (right < dpi->left || left >= dpi->left + dpi->width) return;
   159 	if (bottom < dpi->top || top >= dpi->top + dpi->height) return;
   160 	if (bottom < dpi->top || top >= dpi->top + dpi->height) return;
   160 
   161 
   161 	if ( (left -= dpi->left) < 0) left = 0;
   162 	if ( (left -= dpi->left) < 0) left = 0;
  1442 
  1443 
  1443 	if (sprite->info & 8) {
  1444 	if (sprite->info & 8) {
  1444 		/* tile blit */
  1445 		/* tile blit */
  1445 		start_y = 0;
  1446 		start_y = 0;
  1446 
  1447 
  1447 		if (dpi->zoom > 0) {
  1448 		if (dpi->zoom > ZOOM_LVL_NORMAL) {
  1448 			start_y += bp.height & ~zoom_mask;
  1449 			start_y += bp.height & ~zoom_mask;
  1449 			bp.height &= zoom_mask;
  1450 			bp.height &= zoom_mask;
  1450 			if (bp.height == 0) return;
  1451 			if (bp.height == 0) return;
  1451 			y &= zoom_mask;
  1452 			y &= zoom_mask;
  1452 		}
  1453 		}
  1944  * get some nasty results */
  1945  * get some nasty results */
  1945 bool FillDrawPixelInfo(DrawPixelInfo *n, int left, int top, int width, int height)
  1946 bool FillDrawPixelInfo(DrawPixelInfo *n, int left, int top, int width, int height)
  1946 {
  1947 {
  1947 	const DrawPixelInfo *o = _cur_dpi;
  1948 	const DrawPixelInfo *o = _cur_dpi;
  1948 
  1949 
  1949 	n->zoom = 0;
  1950 	n->zoom = ZOOM_LVL_NORMAL;
  1950 
  1951 
  1951 	assert(width > 0);
  1952 	assert(width > 0);
  1952 	assert(height > 0);
  1953 	assert(height > 0);
  1953 
  1954 
  1954 	if ((left -= o->left) < 0) {
  1955 	if ((left -= o->left) < 0) {