mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
- Big Maps Radarmap creation (interim fix) (by Buggler)
o interim fix for radar map sti creation based on DBrot bigger overview code; only works when map editor resolution >= 1680x1050 & map size <= 360x360 o will revert to old radarmap generation (top left 160x160) if condition not satisfied due to current method uses video buffer of overhead map git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5755 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+48
-12
@@ -143,11 +143,27 @@ UINT32 MapUtilScreenHandle(void)
|
|||||||
iOffsetVertical = (SCREEN_HEIGHT - 160) / 2 - 160;// Vertical start position of the overview map
|
iOffsetVertical = (SCREEN_HEIGHT - 160) / 2 - 160;// Vertical start position of the overview map
|
||||||
InitNewOverheadDB((UINT8)giCurrentTilesetID);
|
InitNewOverheadDB((UINT8)giCurrentTilesetID);
|
||||||
gfOverheadMapDirty = TRUE;
|
gfOverheadMapDirty = TRUE;
|
||||||
RenderOverheadMap(0, (WORLD_COLS/2), iOffsetHorizontal, iOffsetVertical, iOffsetHorizontal+640, iOffsetVertical+320, TRUE);
|
|
||||||
|
//Buggler: interim code for radar map sti creation <= 360x360 based on DBrot bigger overview code
|
||||||
|
if(iResolution >= _1680x1050 && WORLD_COLS <= 360)
|
||||||
|
RenderOverheadMap(0, (WORLD_COLS/2), iOffsetHorizontal, iOffsetVertical, iOffsetHorizontal + (640 * WORLD_COLS / OLD_WORLD_COLS), iOffsetVertical + (320 * WORLD_ROWS / OLD_WORLD_ROWS), TRUE);
|
||||||
|
else
|
||||||
|
RenderOverheadMap(0, (WORLD_COLS/2), iOffsetHorizontal, iOffsetVertical, iOffsetHorizontal+640, iOffsetVertical+320, TRUE);
|
||||||
|
|
||||||
TrashOverheadMap();
|
TrashOverheadMap();
|
||||||
// OK, NOW PROCESS OVERHEAD MAP ( SHOUIDL BE ON THE FRAMEBUFFER )
|
// OK, NOW PROCESS OVERHEAD MAP ( SHOULD BE ON THE FRAMEBUFFER )
|
||||||
gdXStep = (FLOAT)640 / (FLOAT)MINIMAP_X_SIZE;
|
//Buggler: interim code for radar map sti creation <= 360x360 based on DBrot bigger overview code
|
||||||
gdYStep = (FLOAT)320 / (FLOAT)MINIMAP_Y_SIZE;
|
if(iResolution >= _1680x1050 && WORLD_COLS <= 360)
|
||||||
|
{
|
||||||
|
gdXStep = (FLOAT)(640 * WORLD_COLS / OLD_WORLD_COLS) / (FLOAT)MINIMAP_X_SIZE;
|
||||||
|
gdYStep = (FLOAT)(320 * WORLD_ROWS / OLD_WORLD_ROWS) / (FLOAT)MINIMAP_Y_SIZE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gdXStep = (FLOAT)640 / (FLOAT)MINIMAP_X_SIZE;
|
||||||
|
gdYStep = (FLOAT)320 / (FLOAT)MINIMAP_Y_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
dStartX = iOffsetHorizontal;
|
dStartX = iOffsetHorizontal;
|
||||||
dStartY = iOffsetVertical;
|
dStartY = iOffsetVertical;
|
||||||
// Adjust if we are using a restricted map...
|
// Adjust if we are using a restricted map...
|
||||||
@@ -190,18 +206,38 @@ UINT32 MapUtilScreenHandle(void)
|
|||||||
{
|
{
|
||||||
for ( iWindowY = iSubY1; iWindowY < iSubY2; iWindowY++ )
|
for ( iWindowY = iSubY1; iWindowY < iSubY2; iWindowY++ )
|
||||||
{
|
{
|
||||||
if ( iWindowX >= iOffsetHorizontal && iWindowX < (iOffsetHorizontal+640) && iWindowY >= iOffsetVertical && iWindowY < (iOffsetVertical+320) )
|
//Buggler: interim code for radar map sti creation <= 360x360 based on DBrot bigger overview code
|
||||||
|
if(iResolution >= _1680x1050 && WORLD_COLS <= 360)
|
||||||
{
|
{
|
||||||
s16BPPSrc = pSrcBuf[ ( iWindowY * (uiSrcPitchBYTES/2) ) + iWindowX ];
|
if ( iWindowX >= iOffsetHorizontal && iWindowX < (iOffsetHorizontal + (640 * WORLD_COLS / OLD_WORLD_COLS)) && iWindowY >= iOffsetVertical && iWindowY < (iOffsetVertical + (320 * WORLD_ROWS / OLD_WORLD_ROWS)) )
|
||||||
|
{
|
||||||
|
s16BPPSrc = pSrcBuf[ ( iWindowY * (uiSrcPitchBYTES/2) ) + iWindowX ];
|
||||||
|
|
||||||
uiRGBColor = GetRGBColor( s16BPPSrc );
|
uiRGBColor = GetRGBColor( s16BPPSrc );
|
||||||
|
|
||||||
bR += SGPGetRValue( uiRGBColor );
|
bR += SGPGetRValue( uiRGBColor );
|
||||||
bG += SGPGetGValue( uiRGBColor );
|
bG += SGPGetGValue( uiRGBColor );
|
||||||
bB += SGPGetBValue( uiRGBColor );
|
bB += SGPGetBValue( uiRGBColor );
|
||||||
|
|
||||||
// Average!
|
// Average!
|
||||||
iCount++;
|
iCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( iWindowX >= iOffsetHorizontal && iWindowX < (iOffsetHorizontal + 640) && iWindowY >= iOffsetVertical && iWindowY < (iOffsetVertical + 320) )
|
||||||
|
{
|
||||||
|
s16BPPSrc = pSrcBuf[ ( iWindowY * (uiSrcPitchBYTES/2) ) + iWindowX ];
|
||||||
|
|
||||||
|
uiRGBColor = GetRGBColor( s16BPPSrc );
|
||||||
|
|
||||||
|
bR += SGPGetRValue( uiRGBColor );
|
||||||
|
bG += SGPGetGValue( uiRGBColor );
|
||||||
|
bB += SGPGetBValue( uiRGBColor );
|
||||||
|
|
||||||
|
// Average!
|
||||||
|
iCount++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user