]> git.jsancho.org Git - lugaru.git/blobdiff - Source/GameDraw.cpp
bug fix from weapon clean up
[lugaru.git] / Source / GameDraw.cpp
index e8a999857b7a1982040876052fe660e2d81dc16d..f9250784564254750f0c01d42062d97d23805504 100644 (file)
@@ -2021,6 +2021,14 @@ vector<string> Game::ListCampaigns() {
 void Game::LoadCampaign() {
        if(!accountactive)
                return;
+       if(!Mainmenuitems[7]) {
+               ifstream test(ConvertFileName((":Data:Textures:"+accountactive->getCurrentCampaign()+":World.png").c_str()));
+               if(test.good()) {
+                       LoadTexture((":Data:Textures:"+accountactive->getCurrentCampaign()+":World.png").c_str(),&Mainmenuitems[7],0,0);
+               } else {
+                       LoadTexture(":Data:Textures:World.png",&Mainmenuitems[7],0,0);
+               }
+       }
        ifstream ipstream(ConvertFileName((":Data:Campaigns:"+accountactive->getCurrentCampaign()+".txt").c_str()));
        ipstream.ignore(256,':');
        ipstream >> campaignnumlevels;
@@ -2930,10 +2938,10 @@ void Game::DrawMenu()
                                                                //float linestartx,lineendx,linestarty,lineendy,offsetx,offsety;
                                                                linestart.x=(startx[j]+endx[j])/2;
                                                                linestart.y=(starty[j]+endy[j])/2;
-                                                               if(j>=NB_CAMPAIGN_MENU_ITEM+(accountactive?accountactive->getCampaignChoicesMade():0)){
-                                                                       linestart.x=(startx[6+(accountactive?accountactive->getCampaignChoicesMade():0)]+endx[6+(accountactive?accountactive->getCampaignChoicesMade():0)])/2;
-                                                                       linestart.y=(starty[6+(accountactive?accountactive->getCampaignChoicesMade():0)]+endy[6+(accountactive?accountactive->getCampaignChoicesMade():0)])/2;
-                                                               }
+                                                               //~ if(j>=NB_CAMPAIGN_MENU_ITEM-1+(accountactive?accountactive->getCampaignChoicesMade():0)){
+                                                                       //~ linestart.x=(startx[NB_CAMPAIGN_MENU_ITEM-1+(accountactive?accountactive->getCampaignChoicesMade():0)]+endx[NB_CAMPAIGN_MENU_ITEM-1+(accountactive?accountactive->getCampaignChoicesMade():0)])/2;
+                                                                       //~ linestart.y=(starty[NB_CAMPAIGN_MENU_ITEM-1+(accountactive?accountactive->getCampaignChoicesMade():0)]+endy[NB_CAMPAIGN_MENU_ITEM-1+(accountactive?accountactive->getCampaignChoicesMade():0)])/2;
+                                                               //~ } // what was this if for?
                                                                lineend.x=(startx[j+1]+endx[j+1])/2;
                                                                lineend.y=(starty[j+1]+endy[j+1])/2;
                                                                offset=lineend-linestart;