Mercurial > mm7
comparison UI/UiGame.cpp @ 2169:5b27c035a241
small cleaning
author | Ritor1 |
---|---|
date | Mon, 20 Jan 2014 00:02:22 +0600 |
parents | 00bd098f6435 |
children | f0b5ca2dfb73 |
comparison
equal
deleted
inserted
replaced
2168:7cd99cb12911 | 2169:5b27c035a241 |
---|---|
1954 for (uint i = 0; i < (uint)pIndoor->pMapOutlines->uNumOutlines; ++i) | 1954 for (uint i = 0; i < (uint)pIndoor->pMapOutlines->uNumOutlines; ++i) |
1955 { | 1955 { |
1956 BLVMapOutline* pOutline = &pIndoor->pMapOutlines->pOutlines[i]; | 1956 BLVMapOutline* pOutline = &pIndoor->pMapOutlines->pOutlines[i]; |
1957 BLVFace* pFace1 = pIndoor->pFaces + pOutline->uFace1ID; | 1957 BLVFace* pFace1 = pIndoor->pFaces + pOutline->uFace1ID; |
1958 BLVFace* pFace2 = pIndoor->pFaces + pOutline->uFace2ID; | 1958 BLVFace* pFace2 = pIndoor->pFaces + pOutline->uFace2ID; |
1959 //v9 = pIndoor->pFaces[pMapVertex->uFace1ID].uAttributes; | |
1960 //v10 = pIndoor->pFaces[pMapVertex->uFace2ID].uAttributes; | |
1961 if (pFace1->Visible() && pFace2->Visible()) | 1959 if (pFace1->Visible() && pFace2->Visible()) |
1962 { | 1960 { |
1963 if ( pOutline->uFlags & 1 ) | 1961 if ( pOutline->uFlags & 1 ) |
1964 goto LABEL_15; | 1962 { |
1963 if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 && | |
1964 (pFace1->Clickable() || pFace2->Clickable()) && | |
1965 (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID)) | |
1966 { | |
1967 if (uNumBlueFacesInBLVMinimap < 49) | |
1968 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i; | |
1969 } | |
1970 else | |
1971 { | |
1972 pX = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); | |
1973 pY = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
1974 pZ = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); | |
1975 pW = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
1976 v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8; | |
1977 if ( v15 > 100 ) | |
1978 v15 = 100; | |
1979 pRenderer->RasterLine2D(pX, pY, pZ, pW, viewparams->pPalette[-v15 + 200]); | |
1980 } | |
1981 continue; | |
1982 } | |
1965 if (pFace1->uAttributes & 0x80 || pFace2->uAttributes & 0x80) | 1983 if (pFace1->uAttributes & 0x80 || pFace2->uAttributes & 0x80) |
1966 goto LABEL_ABC; | 1984 { |
1967 } | 1985 pOutline->uFlags = pOutline->uFlags | 1; |
1968 continue; | 1986 pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8); |
1969 | 1987 if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 && |
1970 LABEL_ABC: | 1988 (pFace1->Clickable() || pFace2->Clickable()) && |
1971 pOutline->uFlags = pOutline->uFlags | 1; | 1989 (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID)) |
1972 pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8); | 1990 { |
1973 | 1991 if (uNumBlueFacesInBLVMinimap < 49) |
1974 LABEL_15: | 1992 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i; |
1975 //v12 = &pIndoor->pFaces[pOutline->uFace1ID]; | 1993 } |
1976 if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 && | 1994 else |
1977 (pFace1->Clickable() || pFace2->Clickable()) && | 1995 { |
1978 (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID)) | 1996 pX = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); |
1979 { | 1997 pY = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); |
1980 if (uNumBlueFacesInBLVMinimap < 49) | 1998 pZ = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); |
1981 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i; | 1999 pW = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); |
1982 } | 2000 v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8; |
1983 else | 2001 if ( v15 > 100 ) |
1984 { | 2002 v15 = 100; |
1985 long long _a = (uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x); | 2003 pRenderer->RasterLine2D(pX, pY, pZ, pW, viewparams->pPalette[-v15 + 200]); |
1986 uint _b = ((unsigned int)((unsigned __int64)_a >> 16) << 16); | 2004 } |
1987 int _c = ((signed int)(_b - uZoom * pParty->vPosition.x) >> 16); | 2005 continue; |
1988 pX = uCenterX + fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x) << 16) - uZoom, pParty->vPosition.x); | 2006 } |
1989 pY = uCenterY - fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].y) << 16) - uZoom, pParty->vPosition.y); | |
1990 pZ = uCenterX + fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x) << 16) - uZoom, pParty->vPosition.x); | |
1991 pW = uCenterY - fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y) << 16) - uZoom, pParty->vPosition.y); | |
1992 v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8; | |
1993 if ( v15 > 100 ) | |
1994 v15 = 100; | |
1995 //if ( i == 1000 )//pY < 0 && pW > 16 ) | |
1996 //__debugbreak(); | |
1997 pRenderer->RasterLine2D(pX, pY, pZ, pW, viewparams->pPalette[-v15 + 200]); | |
1998 } | 2007 } |
1999 } | 2008 } |
2000 | 2009 |
2001 for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i) | 2010 for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i) |
2002 { | 2011 { |
2003 BLVMapOutline* pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]]; | 2012 BLVMapOutline* pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]]; |
2004 pX = uCenterX + fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex1ID].x) << 16) - uZoom, pParty->vPosition.x); | 2013 pX = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex1ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); |
2005 pY = uCenterY - fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex1ID].y) << 16) - uZoom, pParty->vPosition.y); | 2014 pY = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex1ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); |
2006 pZ = uCenterX + fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex2ID].x) << 16) - uZoom, pParty->vPosition.x); | 2015 pZ = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex2ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); |
2007 pW = uCenterY - fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex2ID].y) << 16) - uZoom, pParty->vPosition.y); | 2016 pW = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex2ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); |
2008 pRenderer->RasterLine2D(pX, pY, pZ, pW, ui_game_minimap_outline_color); | 2017 pRenderer->RasterLine2D(pX, pY, pZ, pW, ui_game_minimap_outline_color); |
2009 } | 2018 } |
2010 } | 2019 } |
2011 | 2020 |
2012 //draw arrow on the minimap(include. Ritor1) | 2021 //draw arrow on the minimap(include. Ritor1) |