@@ -57,10 +57,10 @@ void __cdecl InitAutomap()
5757 signed int v15; // edx
5858 int size; // [esp+Ch] [ebp-4h]
5959
60- int old_320 = ScreenWidth / 2 ;
61- int old_32 = ScreenWidth / 20 ;
62- int old_50 = 50 * 640 / ScreenWidth;
63- int old_5 = 5 * 640 / ScreenWidth;
60+ int old_320 = 320 ; // ScreenWidth / 2;
61+ int old_32 = 32 ; // ScreenWidth / 20;
62+ int old_50 = 50 ; // 50 * 640 / ScreenWidth;
63+ int old_5 = 5 ; // 5 * 640 / ScreenWidth;
6464
6565 v0 = old_50;
6666 v1 = 0 ;
@@ -322,6 +322,35 @@ int GetItemRarity(int index) {
322322 return GetItemRarity (index, NULL , false );
323323}
324324
325+ POINT adjustCoordsToZoom (int x, int y) {
326+ int targetHeight = GLOBAL_HEIGHT - GLOBAL_HEIGHT * globalScrollZoom / 200 ;
327+ int targetWidth = GLOBAL_WIDTH - GLOBAL_WIDTH * globalScrollZoom / 200 ;
328+ int widthDiff = GLOBAL_WIDTH - targetWidth;
329+ int heightDiff = GLOBAL_HEIGHT - targetHeight;
330+ int distToCenterX = abs (ScreenWidth / 2 - x);
331+ int distToCenterY = abs (ScreenHeight / 2 - y);
332+ if (x <= ScreenWidth / 2 ) {
333+ x = ScreenWidth / 2 - distToCenterX - distToCenterX * (globalScrollZoom) / 100 ;
334+ }
335+ else {
336+ x = ScreenWidth / 2 + distToCenterX + distToCenterX * (globalScrollZoom) / 100 ;
337+ }
338+
339+ if (y <= ScreenHeight / 2 ) {
340+ y = ScreenHeight / 2 - distToCenterY - distToCenterY * (globalScrollZoom) / 100 ;
341+ }
342+ else {
343+ y = ScreenHeight / 2 + distToCenterY + distToCenterY * (globalScrollZoom) / 100 ;
344+ }
345+
346+ POINT p;
347+ p.x = x;
348+ p.y = y;
349+ return p;
350+
351+
352+ }
353+
325354void AddItemToDrawQueue (int x, int y, int id) {
326355
327356 if (lootFilterBroken == false ) {
@@ -352,45 +381,11 @@ void AddItemToDrawQueue(int x, int y, int id) {
352381 if (lfd.show == false ) { return ; }
353382 int centerXOffset = GetTextWidth ((char *)lfd.name .c_str ()) ;
354383
355- int targetHeight = GLOBAL_HEIGHT - GLOBAL_HEIGHT * globalScrollZoom / 200 ;
356- int targetWidth = GLOBAL_WIDTH - GLOBAL_WIDTH * globalScrollZoom / 200 ;
357- int widthDiff = GLOBAL_WIDTH - targetWidth;
358- int heightDiff = GLOBAL_HEIGHT - targetHeight;
359-
360- // x += widthDiff/4;
361- // y += widthDiff/4;
362- std::stringstream ss;
363-
364-
365-
366- int distToCenterX = abs (ScreenWidth/2 -x);
367- int distToCenterY = abs (ScreenHeight / 2 - y);
368- if (x <= ScreenWidth / 2 ) {
369- x = ScreenWidth / 2 - distToCenterX - distToCenterX * (globalScrollZoom) / 100 ;
370- }
371- else {
372- x = ScreenWidth / 2 + distToCenterX + distToCenterX * (globalScrollZoom) / 100 ;
373- }
374-
375- if (y <= ScreenHeight / 2 ) {
376- y = ScreenHeight / 2 - distToCenterY - distToCenterY * (globalScrollZoom) / 100 ;
377- }
378- else {
379- y = ScreenHeight / 2 + distToCenterY + distToCenterY * (globalScrollZoom) / 100 ;
380- }
381-
382- x -= centerXOffset / 2 + 20 ;
383- y -= 193 ;
384-
385-
386-
387-
388- // ss << x << " " << y << " ";
389-
390- // NetSendCmdString(1 << myplr, ss.str().c_str());
391- // x += x globalScrollZoom / 100;
392- // y += y * globalScrollZoom / 100;
393- drawQ.push_back (drawingQueue (x, y, GetTextWidth ((char *)lfd.name .c_str ()), 13 , it->_ix , it->_iy , id, lfd.color2 , lfd.name , 1 , lfd.r , lfd.g ,lfd.b ));
384+ POINT p = adjustCoordsToZoom (x, y);
385+ x = p.x ; y = p.y ;
386+ x -= centerXOffset / 2 + 20 ;
387+ y -= 193 ;
388+ drawQ.push_back (drawingQueue (x, y, GetTextWidth ((char *)lfd.name .c_str ()), 13 , it->_ix , it->_iy , id, lfd.color2 , lfd.name , 1 , lfd.r , lfd.g ,lfd.b ));
394389}
395390
396391void HighlightItemsNameOnMap ()
@@ -1219,6 +1214,13 @@ void __cdecl DrawAutomapGame()
12191214 v0+=15 ;
12201215 }
12211216 PrintGameStr (8 , v0, " INFERNITY" , COL_RED);
1217+ v0 += 15 ;
1218+
1219+ int targetHeight = GLOBAL_HEIGHT - GLOBAL_HEIGHT * globalScrollZoom / 200 ;
1220+ int targetWidth = GLOBAL_WIDTH - GLOBAL_WIDTH * globalScrollZoom / 200 ;
1221+ std::stringstream res;
1222+ res << targetWidth << " x" << targetHeight;
1223+ PrintGameStr (8 , v0, (char *)res.str ().c_str (), COL_RED);
12221224}
12231225// 5CCB10: using guessed type char setlvlnum;
12241226// 5CF31D: using guessed type char setlevel;
0 commit comments