@ -3,6 +3,7 @@
# include "control.h"
# include "diablo.h"
# include "engine/render/scrollrt.h"
# include "options.h"
# include "utils/ui_fwd.h"
using namespace devilution ;
@ -14,7 +15,7 @@ TEST(Scroll_rt, calc_tiles_in_view_original)
gnScreenWidth = 640 ;
gnScreenHeight = 480 ;
gnViewportHeight = gnScreenHeight - 128 ;
zoomflag = true ;
sgOptions . Graphics . zoom . SetValue ( false ) ;
int columns = 0 ;
int rows = 0 ;
TilesInView ( & columns , & rows ) ;
@ -27,7 +28,7 @@ TEST(Scroll_rt, calc_tiles_in_view_original_zoom)
gnScreenWidth = 640 ;
gnScreenHeight = 480 ;
gnViewportHeight = gnScreenHeight - 128 ;
zoomflag = false ;
sgOptions . Graphics . zoom . SetValue ( true ) ;
int columns = 0 ;
int rows = 0 ;
TilesInView ( & columns , & rows ) ;
@ -40,7 +41,7 @@ TEST(Scroll_rt, calc_tiles_in_view_960_540)
gnScreenWidth = 960 ;
gnScreenHeight = 540 ;
gnViewportHeight = gnScreenHeight ;
zoomflag = true ;
sgOptions . Graphics . zoom . SetValue ( false ) ;
int columns = 0 ;
int rows = 0 ;
TilesInView ( & columns , & rows ) ;
@ -53,7 +54,7 @@ TEST(Scroll_rt, calc_tiles_in_view_640_512)
gnScreenWidth = 640 ;
gnScreenHeight = 512 ;
gnViewportHeight = gnScreenHeight - 128 ;
zoomflag = true ;
sgOptions . Graphics . zoom . SetValue ( false ) ;
int columns = 0 ;
int rows = 0 ;
TilesInView ( & columns , & rows ) ;
@ -66,7 +67,7 @@ TEST(Scroll_rt, calc_tiles_in_view_768_480_zoom)
gnScreenWidth = 768 ;
gnScreenHeight = 480 ;
gnViewportHeight = gnScreenHeight ;
zoomflag = false ;
sgOptions . Graphics . zoom . SetValue ( true ) ;
int columns = 0 ;
int rows = 0 ;
TilesInView ( & columns , & rows ) ;
@ -81,7 +82,7 @@ TEST(Scroll_rt, calc_tile_offset_original)
gnScreenWidth = 640 ;
gnScreenHeight = 480 ;
gnViewportHeight = gnScreenHeight - 128 ;
zoomflag = true ;
sgOptions . Graphics . zoom . SetValue ( false ) ;
int x = 0 ;
int y = 0 ;
CalcTileOffset ( & x , & y ) ;
@ -94,7 +95,7 @@ TEST(Scroll_rt, calc_tile_offset_original_zoom)
gnScreenWidth = 640 ;
gnScreenHeight = 480 ;
gnViewportHeight = gnScreenHeight - 128 ;
zoomflag = false ;
sgOptions . Graphics . zoom . SetValue ( true ) ;
int x = 0 ;
int y = 0 ;
CalcTileOffset ( & x , & y ) ;
@ -107,7 +108,7 @@ TEST(Scroll_rt, calc_tile_offset_960_540)
gnScreenWidth = 960 ;
gnScreenHeight = 540 ;
gnViewportHeight = gnScreenHeight ;
zoomflag = true ;
sgOptions . Graphics . zoom . SetValue ( false ) ;
int x = 0 ;
int y = 0 ;
CalcTileOffset ( & x , & y ) ;
@ -120,7 +121,7 @@ TEST(Scroll_rt, calc_tile_offset_853_480)
gnScreenWidth = 853 ;
gnScreenHeight = 480 ;
gnViewportHeight = gnScreenHeight ;
zoomflag = true ;
sgOptions . Graphics . zoom . SetValue ( false ) ;
int x = 0 ;
int y = 0 ;
CalcTileOffset ( & x , & y ) ;
@ -133,7 +134,7 @@ TEST(Scroll_rt, calc_tile_offset_768_480_zoom)
gnScreenWidth = 768 ;
gnScreenHeight = 480 ;
gnViewportHeight = gnScreenHeight ;
zoomflag = false ;
sgOptions . Graphics . zoom . SetValue ( true ) ;
int x = 0 ;
int y = 0 ;
CalcTileOffset ( & x , & y ) ;
@ -146,7 +147,7 @@ TEST(Scroll_rt, calc_tile_offset_768_480_zoom)
TEST ( Scroll_rt , calc_tiles_covered_by_panel_original )
{
gnScreenWidth = 640 ;
zoomflag = true ;
sgOptions . Graphics . zoom . SetValue ( false ) ;
CalculatePanelAreas ( ) ;
EXPECT_EQ ( RowsCoveredByPanel ( ) , 0 ) ;
}
@ -154,7 +155,7 @@ TEST(Scroll_rt, calc_tiles_covered_by_panel_original)
TEST ( Scroll_rt , calc_tiles_covered_by_panel_960 )
{
gnScreenWidth = 960 ;
zoomflag = true ;
sgOptions . Graphics . zoom . SetValue ( false ) ;
CalculatePanelAreas ( ) ;
EXPECT_EQ ( RowsCoveredByPanel ( ) , 4 ) ;
}
@ -162,7 +163,7 @@ TEST(Scroll_rt, calc_tiles_covered_by_panel_960)
TEST ( Scroll_rt , calc_tiles_covered_by_panel_960_zoom )
{
gnScreenWidth = 960 ;
zoomflag = false ;
sgOptions . Graphics . zoom . SetValue ( true ) ;
CalculatePanelAreas ( ) ;
EXPECT_EQ ( RowsCoveredByPanel ( ) , 2 ) ;
}