diff --git a/SamTFE/Sources/GameMP/Computer.cpp b/SamTFE/Sources/GameMP/Computer.cpp index 74cb41cf..f200e1f6 100644 --- a/SamTFE/Sources/GameMP/Computer.cpp +++ b/SamTFE/Sources/GameMP/Computer.cpp @@ -535,7 +535,7 @@ void PrintButton(CDrawPort *pdp, INDEX iButton) return; } _pGame->LCDSetDrawport(&dpButton); - _pGame->LCDRenderCompGrid(); + _pGame->LCDRenderGrid(); _pGame->LCDRenderClouds2(); _pGame->LCDScreenBoxOpenLeft(_colBoxes); @@ -755,7 +755,7 @@ void RenderMessageStats(CDrawPort *pdp) { CSessionProperties *psp = (CSessionProperties *)_pNetwork->GetSessionProperties(); ULONG ulLevelMask = psp->sp_ulLevelsMask; - //INDEX iLevel = -1; + INDEX iLevel = -1; if (psp->sp_bCooperative) { extern void RenderMap( CDrawPort *pdp, ULONG ulLevelMask, CProgressHookInfo *pphi); if (pdp->Lock()) { @@ -793,7 +793,7 @@ void RenderMessageImage(CDrawPort *pdp) CCompMessage &cm = _acmMessages[_iActiveMessage]; if (cm.cm_itImage == CCompMessage::IT_STATISTICS) { - _pGame->LCDRenderCompGrid(); + _pGame->LCDRenderGrid(); } _pGame->LCDRenderClouds2(); _pGame->LCDScreenBox(_colBoxes); @@ -1244,22 +1244,16 @@ void CGame::ComputerRender(CDrawPort *pdp) MarkCurrentRead(); // get current time and alpha value - //FLOAT tmNow = (FLOAT)tvNow.GetSeconds(); - //ULONG ulA = NormFloatToByte(fComputerFadeValue); + FLOAT tmNow = (FLOAT)tvNow.GetSeconds(); + ULONG ulA = NormFloatToByte(fComputerFadeValue); _colLight = LCDFadedColor(C_WHITE|255); - #ifdef FIRST_ENCOUNTER // First Encounter - _colMedium = LCDFadedColor(SE_COL_GREEN_LIGHT|255); - _colDark = LCDFadedColor(LerpColor(SE_COL_GREEN_DARK, SE_COL_GREEN_LIGHT, 0.5f)|255); - _colBoxes = LCDFadedColor(LerpColor(SE_COL_GREEN_DARK, SE_COL_GREEN_LIGHT, 0.5f)|255); - #else // Second Encounter - _colMedium = LCDFadedColor(SE_COL_BLUE_LIGHT|255); - _colDark = LCDFadedColor(LerpColor(SE_COL_BLUE_DARK, SE_COL_BLUE_LIGHT, 0.5f)|255); - _colBoxes = LCDFadedColor(LerpColor(SE_COL_BLUE_DARK, SE_COL_BLUE_LIGHT, 0.5f)|255); - #endif + _colMedium = LCDFadedColor(C_GREEN|255); + _colDark = LCDFadedColor(LerpColor(C_dGREEN, C_GREEN, 0.5f)|255); + _colBoxes = LCDFadedColor(LerpColor(C_dGREEN, C_GREEN, 0.5f)|255); // background - LCDRenderCloudsForComp(); + LCDRenderClouds1(); // dpComp.DrawLine( 0, pixSizeJ-1, pixSizeI, pixSizeJ-1, C_GREEN|ulA); // all done @@ -1269,7 +1263,7 @@ void CGame::ComputerRender(CDrawPort *pdp) CDrawPort dpTitle(&dpComp, _boxTitle); if (dpTitle.Lock()) { LCDSetDrawport(&dpTitle); - LCDRenderCompGrid(); + LCDRenderGrid(); LCDRenderClouds2(); LCDScreenBoxOpenLeft(_colBoxes); PrintTitle(&dpTitle); @@ -1280,7 +1274,7 @@ void CGame::ComputerRender(CDrawPort *pdp) CDrawPort dpExit(&dpComp, _boxExit); if (dpExit.Lock()) { LCDSetDrawport(&dpExit); - LCDRenderCompGrid(); + LCDRenderGrid(); LCDRenderClouds2(); LCDScreenBoxOpenRight(_colBoxes); PrintExit(&dpExit); @@ -1295,7 +1289,7 @@ void CGame::ComputerRender(CDrawPort *pdp) CDrawPort dpMsgList(&dpComp, _boxMsgList); if (dpMsgList.Lock()) { LCDSetDrawport(&dpMsgList); - LCDRenderCompGrid(); + LCDRenderGrid(); LCDRenderClouds2(); LCDScreenBox(_colBoxes); PrintMessageList(&dpMsgList); @@ -1305,7 +1299,7 @@ void CGame::ComputerRender(CDrawPort *pdp) CDrawPort dpMsgText(&dpComp, _boxMsgText); if (dpMsgText.Lock()) { LCDSetDrawport(&dpMsgText); - LCDRenderCompGrid(); + LCDRenderGrid(); LCDRenderClouds2(); LCDScreenBox(_colBoxes); PrintMessageText(&dpMsgText); diff --git a/SamTFE/Sources/GameMP/Console.cpp b/SamTFE/Sources/GameMP/Console.cpp index 4b3373ca..3d9f0ae5 100644 --- a/SamTFE/Sources/GameMP/Console.cpp +++ b/SamTFE/Sources/GameMP/Console.cpp @@ -163,8 +163,8 @@ void CGame::ConsoleRender(CDrawPort *pdp) if( iBackwardLine>1) Swap( colLight, colDark); PIX pixLineSpacing = _pfdConsoleFont->fd_pixCharHeight + _pfdConsoleFont->fd_pixLineSpacing; - LCDRenderCloudsForComp(); - //LCDRenderGrid(); + LCDRenderClouds1(); + LCDRenderGrid(); LCDRenderClouds2(); #ifdef FIRST_ENCOUNTER // First Encounter dpConsole.DrawLine( 0, pixSizeJ-1, pixSizeI, pixSizeJ-1, LCDFadedColor(SE_COL_GREEN_NEUTRAL|255)); diff --git a/SamTFE/Sources/GameMP/Game.cpp b/SamTFE/Sources/GameMP/Game.cpp index 70ab89a6..8b4cc7a5 100644 --- a/SamTFE/Sources/GameMP/Game.cpp +++ b/SamTFE/Sources/GameMP/Game.cpp @@ -3196,35 +3196,6 @@ void TiledTextureSE( PIXaabbox2D &_boxScreen, FLOAT fStretch, const MEX2D &vScre void CGame::LCDInit(void) { - try { - _toBcgClouds.SetData_t(CTFILENAME("Textures\\General\\Background6.tex")); -#ifdef FIRST_ENCOUNTER - _toPointer.SetData_t(CTFILENAME("Textures\\General\\Pointer.tex")); - _toBcgGrid.SetData_t(CTFILENAME("Textures\\General\\Grid16x16-dot.tex")); -#else - _toPointer.SetData_t(CTFILENAME("TexturesMP\\General\\Pointer.tex")); - _toBcgGrid.SetData_t(CTFILENAME("TexturesMP\\General\\grid.tex")); - _toBackdrop.SetData_t(CTFILENAME("TexturesMP\\General\\MenuBack.tex")); - // thoses are not in original TFE datas and must be added externaly (with SE1_10.gro or a minimal versio of it) - _toSamU.SetData_t(CTFILENAME("TexturesMP\\General\\SamU.tex")); - _toSamD.SetData_t(CTFILENAME("TexturesMP\\General\\SamD.tex")); - _toLeftU.SetData_t(CTFILENAME("TexturesMP\\General\\LeftU.tex")); - _toLeftD.SetData_t(CTFILENAME("TexturesMP\\General\\LeftD.tex")); - // force constant textures - ((CTextureData*)_toBackdrop .GetData())->Force(TEX_CONSTANT); - ((CTextureData*)_toSamU .GetData())->Force(TEX_CONSTANT); - ((CTextureData*)_toSamD .GetData())->Force(TEX_CONSTANT); - ((CTextureData*)_toLeftU .GetData())->Force(TEX_CONSTANT); - ((CTextureData*)_toLeftD .GetData())->Force(TEX_CONSTANT); -#endif - ((CTextureData*)_toBcgClouds.GetData())->Force(TEX_CONSTANT); - ((CTextureData*)_toPointer .GetData())->Force(TEX_CONSTANT); - ((CTextureData*)_toBcgGrid .GetData())->Force(TEX_CONSTANT); - - - } catch (const char *strError) { - FatalError("%s\n", strError); - } ::_LCDInit(); } void CGame::LCDEnd(void) @@ -3233,73 +3204,35 @@ void CGame::LCDEnd(void) } void CGame::LCDPrepare(FLOAT fFade) { - // get current time and alpha value - _tmNow_SE = (FLOAT)_pTimer->GetHighPrecisionTimer().GetSeconds(); - _ulA_SE = NormFloatToByte(fFade); - ::_LCDPrepare(fFade); } void CGame::LCDSetDrawport(CDrawPort *pdp) { - _pdp_SE = pdp; - _pixSizeI_SE = _pdp_SE->GetWidth(); - _pixSizeJ_SE = _pdp_SE->GetHeight(); - _boxScreen_SE = PIXaabbox2D ( PIX2D(0,0), PIX2D(_pixSizeI_SE, _pixSizeJ_SE)); - - if (pdp->dp_SizeIOverRasterSizeI==1.0f) { - _bPopup = FALSE; - } else { - _bPopup = TRUE; - } - ::_LCDSetDrawport(pdp); } void CGame::LCDDrawBox(PIX pixUL, PIX pixDR, const PIXaabbox2D &box, COLOR col) { - #ifdef FIRST_ENCOUNTER // First Encounter - col = SE_COL_GREEN_NEUTRAL|255; - #else // Second Encounter - col = SE_COL_BLUE_NEUTRAL|255; - #endif - ::_LCDDrawBox(pixUL, pixDR, box, col); } void CGame::LCDScreenBox(COLOR col) { - #ifdef FIRST_ENCOUNTER // First Encounter - col = SE_COL_GREEN_NEUTRAL|255; - #else // Second Encounter - col = SE_COL_BLUE_NEUTRAL|255; - #endif - ::_LCDScreenBox(col); } void CGame::LCDScreenBoxOpenLeft(COLOR col) { - #ifdef FIRST_ENCOUNTER // First Encounter - col = SE_COL_GREEN_NEUTRAL|255; - #else // Second Encounter - col = SE_COL_BLUE_NEUTRAL|255; - #endif - ::_LCDScreenBoxOpenLeft(col); } void CGame::LCDScreenBoxOpenRight(COLOR col) { - #ifdef FIRST_ENCOUNTER // First Encounter - col = SE_COL_GREEN_NEUTRAL|255; - #else // Second Encounter - col = SE_COL_BLUE_NEUTRAL|255; - #endif - ::_LCDScreenBoxOpenRight(col); } void CGame::LCDRenderClouds1(void) { #ifdef FIRST_ENCOUNTER - LCDRenderCloudsForComp(); - LCDRenderCompGrid(); + //LCDRenderCloudsForComp(); + //LCDRenderCompGrid(); + ::_LCDRenderClouds1(); #else _pdp_SE->PutTexture(&_toBackdrop, _boxScreen_SE, C_WHITE|255); @@ -3379,42 +3312,15 @@ void CGame::LCDRenderCloudsForComp(void) } void CGame::LCDRenderClouds2(void) { - NOTHING; + ::_LCDRenderClouds2(); } void CGame::LCDRenderGrid(void) { - NOTHING; -} -void CGame::LCDRenderCompGrid(void) -{ - MEXaabbox2D boxBcgGrid; - TiledTextureSE(_boxScreen_SE, 0.5f*_pdp_SE->GetWidth()/(_pdp_SE->dp_SizeIOverRasterSizeI*640.0f), MEX2D(0,0), boxBcgGrid); - #ifdef FIRST_ENCOUNTER // First Encounter - _pdp_SE->PutTexture(&_toBcgGrid, _boxScreen_SE, boxBcgGrid, SE_COL_GREEN_NEUTRAL|_ulA_SE>>1); - #else // Second Encounter - _pdp_SE->PutTexture(&_toBcgGrid, _boxScreen_SE, boxBcgGrid, SE_COL_BLUE_NEUTRAL|_ulA_SE>>1); - #endif + ::_LCDRenderGrid(); } void CGame::LCDDrawPointer(PIX pixI, PIX pixJ) { - CDisplayMode dmCurrent; - _pGfx->GetCurrentDisplayMode(dmCurrent); - if (dmCurrent.IsFullScreen()) { - while (ShowCursor(FALSE) >= 0); - } else { - if (!_pInput->IsInputEnabled()) { - while (ShowCursor(TRUE) < 0); - } - return; - } - PIX pixSizeI = _toPointer.GetWidth(); - PIX pixSizeJ = _toPointer.GetHeight(); - pixI-=1; - pixJ-=1; - _pdp_SE->PutTexture( &_toPointer, PIXaabbox2D( PIX2D(pixI, pixJ), PIX2D(pixI+pixSizeI, pixJ+pixSizeJ)), - LCDFadedColor(C_WHITE|255)); - - //::_LCDDrawPointer(pixI, pixJ); + ::_LCDDrawPointer(pixI, pixJ); } COLOR CGame::LCDGetColor(COLOR colDefault, const char *strName) {