@@ -670,8 +670,8 @@ void __fastcall DrawView(int StartX, int StartY)
670670 if ( zoomflag )
671671 DrawGame2 (StartX, StartY);
672672 else
673- DrawGame2 (StartX, StartY);
674- // DrawZoom (StartX, StartY);
673+ // DrawGame2(StartX, StartY);
674+ DrawZoom2 (StartX, StartY);
675675
676676 if ( automapflag )
677677 DrawAutomap ();
@@ -3061,11 +3061,96 @@ void __fastcall scrollrt_draw_e_flag(char *buffer, int x, int y, int a4, int a5,
30613061 cel_transparency_active = v10;
30623062 level_piece_id = v22;
30633063}
3064- // 69BEF8: using guessed type int light_table_index;
3065- // 69CF14: using guessed type int level_cel_block;
3066- // 69CF20: using guessed type char arch_draw_type;
3067- // 69CF94: using guessed type int cel_transparency_active;
3068- // 69CF98: using guessed type int level_piece_id;
3064+ void __fastcall DrawZoom2 (int x, int y)
3065+ {
3066+ int yofs = 143 ;
3067+ int posx = x - ScreenWidth / 64 ;
3068+ int posy = y - 1 ;
3069+ int offsetX = ScrollInfo._sxoff + 64 ;
3070+ int offsetY = ScrollInfo._syoff + yofs;
3071+ int HorCellDrawCount = ScreenWidth / 64 ;
3072+ switch (ScrollInfo._sdir )
3073+ {
3074+ case DIR_SW: {
3075+ offsetY = ScrollInfo._syoff + yofs - 32 ;
3076+ --posx;
3077+ --posy;
3078+ break ;
3079+ }
3080+ case DIR_W: {
3081+ offsetY = ScrollInfo._syoff + yofs - 32 ;
3082+ --posx;
3083+ --posy;
3084+ ++HorCellDrawCount;
3085+ break ;
3086+ }
3087+ case DIR_NW:
3088+ case DIR_N:
3089+ case DIR_NE:
3090+ {
3091+ ++HorCellDrawCount;
3092+ break ;
3093+ }
3094+ case DIR_E:
3095+ case DIR_SE: {
3096+ offsetX -= 64 ;
3097+ --posx;
3098+ ++posy;
3099+ ++HorCellDrawCount;
3100+ break ;
3101+ }
3102+ case DIR_OMNI: {
3103+ offsetX -= 64 ;
3104+ offsetY = ScrollInfo._syoff + yofs - 32 ;
3105+ posx -= 2 ;
3106+ ++HorCellDrawCount;
3107+ break ;
3108+ }
3109+ default :
3110+ break ;
3111+ }
3112+ int screenCellRow = 0 ;
3113+ gpBufEnd = (unsigned char *)gpBuffer + screen_y_times_width[160 ];
3114+ do {
3115+ scrollrt_draw_upper (posx, posy++, offsetX, offsetY, HorCellDrawCount, screenCellRow, 0 );
3116+ scrollrt_draw_upper (posx++, posy, offsetX - 32 , offsetY + 16 , HorCellDrawCount, screenCellRow, 1 );
3117+ offsetY += 32 ;
3118+ ++screenCellRow;
3119+ } while (offsetY <= WorkingHeight + 256 );
3120+ gpBufEnd = (unsigned char *)gpBuffer + screen_y_times_width[WorkingWidth + 32 ];
3121+ yofs -= 32 ;
3122+
3123+ for (int i = ScreenHeight - 1 ; i >= yofs; --i) {
3124+ for (int j = ScreenWidth - 1 ; j >= 0 ; --j) {
3125+ gpBuffer->row [i].pixels [j] = gpBuffer->row [i - yofs].pixels [j];
3126+ }
3127+ }
3128+
3129+ for (int i = ScreenHeight / 4 - 1 ; i >= 0 ; --i) {
3130+ for (int j = ScreenWidth / 4 - 1 ; j >= 0 ; --j) {
3131+ int hd2 = ScreenHeight >> 1 ;
3132+ int hd3 = ScreenHeight >> 1 ;
3133+ int wd2 = ScreenWidth >> 1 ;
3134+
3135+ gpBuffer->row [hd3 - i * 2 ].pixels [wd2 - j * 2 - 1 ] = gpBuffer->row [hd2 - i].pixels [wd2 - j];
3136+ gpBuffer->row [hd3 + i * 2 ].pixels [wd2 - j * 2 - 1 ] = gpBuffer->row [hd2 + i].pixels [wd2 - j];
3137+ gpBuffer->row [hd3 - i * 2 - 1 ].pixels [wd2 - j * 2 - 1 ] = gpBuffer->row [hd2 - i].pixels [wd2 - j];
3138+ gpBuffer->row [hd3 + i * 2 + 1 ].pixels [wd2 - j * 2 - 1 ] = gpBuffer->row [hd2 + i].pixels [wd2 - j];
3139+ gpBuffer->row [hd3 - i * 2 ].pixels [wd2 - j * 2 ] = gpBuffer->row [hd2 - i].pixels [wd2 - j];
3140+ gpBuffer->row [hd3 + i * 2 ].pixels [wd2 - j * 2 ] = gpBuffer->row [hd2 + i].pixels [wd2 - j];
3141+ gpBuffer->row [hd3 - i * 2 - 1 ].pixels [wd2 - j * 2 ] = gpBuffer->row [hd2 - i].pixels [wd2 - j];
3142+ gpBuffer->row [hd3 + i * 2 + 1 ].pixels [wd2 - j * 2 ] = gpBuffer->row [hd2 + i].pixels [wd2 - j];
3143+ gpBuffer->row [hd3 + i * 2 + 1 ].pixels [wd2 + j * 2 + 1 ] = gpBuffer->row [hd2 + i].pixels [wd2 + j];
3144+ gpBuffer->row [hd3 - i * 2 - 1 ].pixels [wd2 + j * 2 + 1 ] = gpBuffer->row [hd2 - i].pixels [wd2 + j];
3145+ gpBuffer->row [hd3 + i * 2 ].pixels [wd2 + j * 2 + 1 ] = gpBuffer->row [hd2 + i].pixels [wd2 + j];
3146+ gpBuffer->row [hd3 - i * 2 ].pixels [wd2 + j * 2 + 1 ] = gpBuffer->row [hd2 - i].pixels [wd2 + j];
3147+ gpBuffer->row [hd3 + i * 2 ].pixels [wd2 + j * 2 ] = gpBuffer->row [hd2 + i].pixels [wd2 + j];
3148+ gpBuffer->row [hd3 - i * 2 ].pixels [wd2 + j * 2 ] = gpBuffer->row [hd2 - i].pixels [wd2 + j];
3149+ gpBuffer->row [hd3 + i * 2 + 1 ].pixels [wd2 + j * 2 ] = gpBuffer->row [hd2 + i].pixels [wd2 + j];
3150+ gpBuffer->row [hd3 - i * 2 - 1 ].pixels [wd2 + j * 2 ] = gpBuffer->row [hd2 - i].pixels [wd2 + j];
3151+ }
3152+ }
3153+ }
30693154void __fastcall DrawZoom (int x, int y)
30703155{
30713156 int v2; // edi
0 commit comments