Show
Ignore:
Timestamp:
09/01/10 17:07:59 (21 months ago)
Author:
Carsten
Message:

Revised classes ScrollInfoT and FontT, fixing bug #21.
Thanks to Luigi Auriemma for the report!

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cafu/trunk/Ca3DE/Client/ClientStateInGame.cpp

    r136 r144  
    405405            static ConVarT ShowPosition("showPos", false, ConVarT::FLAG_MAIN_EXE, "Toggles whether the current players position is shown."); 
    406406 
    407             if (ShowFrameRate.GetValueBool()) Font_f.Print(FrameSize.GetWidth()-100, FrameSize.GetHeight()-16, FrameSize.GetWidth(), FrameSize.GetHeight(), 0x00FFFFFF, "FPS %5.1f", 1.0f/FrameTime); 
     407            if (ShowFrameRate.GetValueBool()) Font_f.Print(FrameSize.GetWidth()-100, FrameSize.GetHeight()-16, FrameSize.GetWidth(), FrameSize.GetHeight(), 0x00FFFFFF, cf::va("FPS %5.1f", 1.0f/FrameTime)); 
    408408 
    409409            if (ShowPosition.GetValueBool()) 
     
    415415                //     LeafContents=World->GetCa3DEWorldP()->Map.Leaves[LeafNr].IsWaterLeaf ? 'w' : 'i'; 
    416416 
    417                 Font_f.Print(FrameSize.GetWidth()-130, 15, FrameSize.GetWidth(), FrameSize.GetHeight(), 0x00FFFFFF, "X %10.1f", OurEntityCurrentState->Origin.x); 
    418                 Font_f.Print(FrameSize.GetWidth()-130, 35, FrameSize.GetWidth(), FrameSize.GetHeight(), 0x00FFFFFF, "Y %10.1f", OurEntityCurrentState->Origin.y); 
    419                 Font_f.Print(FrameSize.GetWidth()-130, 55, FrameSize.GetWidth(), FrameSize.GetHeight(), 0x00FFFFFF, "Z %10.1f", OurEntityCurrentState->Origin.z); 
    420                 Font_f.Print(FrameSize.GetWidth()-130, 75, FrameSize.GetWidth(), FrameSize.GetHeight(), 0x00FFFFFF, "Hdg %8u", OurEntityCurrentState->Heading); 
    421              // Font_f.Print(FrameSize.GetWidth()-100, FrameSize.GetHeight()-32, FrameSize.GetWidth(), FrameSize.GetHeight(), 0x00FFFFFF, "L %4u %c", LeafNr, LeafContents); 
     417                Font_f.Print(FrameSize.GetWidth()-130, 15, FrameSize.GetWidth(), FrameSize.GetHeight(), 0x00FFFFFF, cf::va("X %10.1f", OurEntityCurrentState->Origin.x)); 
     418                Font_f.Print(FrameSize.GetWidth()-130, 35, FrameSize.GetWidth(), FrameSize.GetHeight(), 0x00FFFFFF, cf::va("Y %10.1f", OurEntityCurrentState->Origin.y)); 
     419                Font_f.Print(FrameSize.GetWidth()-130, 55, FrameSize.GetWidth(), FrameSize.GetHeight(), 0x00FFFFFF, cf::va("Z %10.1f", OurEntityCurrentState->Origin.z)); 
     420                Font_f.Print(FrameSize.GetWidth()-130, 75, FrameSize.GetWidth(), FrameSize.GetHeight(), 0x00FFFFFF, cf::va("Hdg %8u", OurEntityCurrentState->Heading)); 
     421             // Font_f.Print(FrameSize.GetWidth()-100, FrameSize.GetHeight()-32, FrameSize.GetWidth(), FrameSize.GetHeight(), 0x00FFFFFF, cf::va("L %4u %c", LeafNr, LeafContents)); 
    422422            } 
    423423 
     
    529529 
    530530            #ifdef DEBUG 
    531                 LoadingFont->Print(FrameSize.GetWidth()/2-34*CharWidth/2, FrameSize.GetHeight()*9/10+12, FrameSize.GetWidth(), FrameSize.GetHeight(), 0x00800000, "Version: %s [Debug build], %s", __DATE__, LoadingProgressText.c_str()); 
     531                LoadingFont->Print(FrameSize.GetWidth()/2-34*CharWidth/2, FrameSize.GetHeight()*9/10+12, FrameSize.GetWidth(), FrameSize.GetHeight(), 0x00800000, "Version: "__DATE__" [Debug build], "+LoadingProgressText); 
    532532            #else 
    533                 LoadingFont->Print(FrameSize.GetWidth()/2-20*CharWidth/2, FrameSize.GetHeight()*9/10+12, FrameSize.GetWidth(), FrameSize.GetHeight(), 0x00800000, "Version: %s", __DATE__); 
     533                LoadingFont->Print(FrameSize.GetWidth()/2-20*CharWidth/2, FrameSize.GetHeight()*9/10+12, FrameSize.GetWidth(), FrameSize.GetHeight(), 0x00800000, "Version: "__DATE__); 
    534534            #endif 
    535535 
    536536            if (LoadingProgressPercent>0) 
    537                 LoadingFont->Print(FrameSize.GetWidth()/2-10*CharWidth/2, FrameSize.GetHeight()*9/10+30, FrameSize.GetWidth(), FrameSize.GetHeight(), 0x00800000, "Loading... %.0f%%", LoadingProgressPercent*100.0f); 
     537                LoadingFont->Print(FrameSize.GetWidth()/2-10*CharWidth/2, FrameSize.GetHeight()*9/10+30, FrameSize.GetWidth(), FrameSize.GetHeight(), 0x00800000, cf::va("Loading... %.0f%%", LoadingProgressPercent*100.0f)); 
    538538            else 
    539539                LoadingFont->Print(FrameSize.GetWidth()/2-10*CharWidth/2, FrameSize.GetHeight()*9/10+30, FrameSize.GetWidth(), FrameSize.GetHeight(), 0x00800000, "Loading..."); 
     
    747747                        Client.NextState=ClientT::IDLE; 
    748748 
    749                 Console->Print(cf::va("Client with EntityID %u has left the game. Reason: %s\n", EntityID, Reason)); 
    750                 SystemScrollInfo.Print("Client with EntityID %u has left the game. Reason: %s", EntityID, Reason); 
     749                const std::string msg=cf::va("Client with EntityID %u has left the game. Reason: ", EntityID)+Reason+"\n"; 
     750 
     751                Console->Print(msg); 
     752                SystemScrollInfo.Print(msg); 
    751753                break; 
    752754            } 
    753755 
    754756            default: 
     757            { 
    755758                // Alle SC1_EntityUpdate-Messages sollten nach SC1_FrameInfo schon gelesen worden sein! 
    756759                cf::LogDebug(net, "SC1_???: WARNING: Unknown SC1_* in-game message type '%u' received!\n", MessageType); 
    757                 Console->Print(cf::va("WARNING: Unknown in-game message type '%3u' received!\n", MessageType)); 
    758                 SystemScrollInfo.Print("WARNING: Unknown in-game message type '%3u' received!", MessageType); 
     760 
     761                const std::string msg=cf::va("WARNING: Unknown in-game message type '%3u' received!\n", MessageType); 
     762 
     763                Console->Print(msg); 
     764                SystemScrollInfo.Print(msg); 
    759765                // assert(false); 
     766            } 
    760767        } 
    761768    }