Announcement

Collapse
No announcement yet.

DEBUG: DrawTransitionTile Crash

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • DEBUG: DrawTransitionTile Crash

    0x004693d3 [? DrawTransitionTile@TiledMap@@QAEXPAVaui_Surface@@A
    BVMapPoint@@HH@Z + 0x32b]
    0x004580b8 [?CalculateWrap@TiledMap@@QAEHPAVaui_Surface@@HH@Z + 0x292]
    0x00458f62 [?RepaintTiles@TiledMap@@QAEHPAUtagRECT@@@Z + 0xc1]
    0x0045bcae [?Refresh@TiledMap@@QAEHXZ + 0xa8]
    0x007dcedf [?WhackScreen@@YAXXZ + 0xe]
    0x0088f859 [? FogButton@ScenarioEditor@@SAXPAVaui_Control@@IIPAX
    @Z + 0x21]
    0x0073d999 [? MouseLDropInside@aui_Button@@MAEXPAUaui_MouseEvent
    @@@Z + 0x12c]
    0x00802fa0 [? MouseLDropInside@ctp2_Button@@UAEXPAUaui_MouseEven
    t@@@Z + 0x1d]
    0x00771f13 [? MouseDispatch@aui_Region@@QAEXPAUaui_MouseEvent@@H
    @Z + 0x2063]
    0x0076d779 [?HandleMouseEvent@aui_Region@@QAE?AW4AUI_ERRCODE@@ PAUaui_MouseEvent@@H@Z + 0x1ca]
    0x0076d697 [?HandleMouseEvent@aui_Region@@QAE?AW4AUI_ERRCODE@@ PAUaui_MouseEvent@@H@Z + 0xe8]
    0x007847d4 [?HandleMouseEvents@aui_UI@@QAE?AW4AUI_ERRCODE@@HPA Uaui_MouseEvent@@@Z + 0x135]
    0x007850e8 [?Process@aui_UI@@UAE?AW4AUI_ERRCODE@@XZ + 0x23]
    0x0040fdfe [?ProcessUI@CivApp@@QAEHIAAI@Z + 0x21f]
    0x00410190 [?Process@CivApp@@QAEHXZ + 0xa7]
    0x00408bef [?CivMain@@YGHPAUHINSTANCE__@@0PADH@Z + 0x400]
    0x00408616 [WinMain@16 + 0x74]
    0x009f5e4c [WinMainCRTStartup + 0x134]
    0x7c816fd7 [__onexitbegin + 0x7bc42c7f]
    I'm getting this crash log and when I did ctp2debug it took me to spritefile.cpp

    It might be my code, but outcommenting it didn't fix the problem. I also thought maybe it involved all the new city sprites I added but taking them out didn't help.

    I'm going to try an earlier revision to isolate it. But so far it appears only related to my Call2Civ mod

    which I guess is good news except that it could also mean that it will surface in a very late game.
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  • #2
    well I went back to 705 and to 700 and got the same crash. which I didn't before on 700 for sure. So I think maybe there is a corruption in my CTP2?
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

    Comment


    • #3
      i'm back up to 706 but i used an older version of my mod and now i don't get the crash. so somewhere i screwed up my mod and it generated this crash
      Formerly known as "E" on Apolyton

      See me at Civfanatics.com

      Comment


      • #4
        ok, now I'm confused

        I eliminated all the new mapicons I was adding for wonders and holycities and the game works fine with my mod.

        then i used the showcityicon and this time set a flag icon as the show city one and it still works.

        So it seems like my code is not the problem and i made sure the icons were all 16bit uncompressed so i don't think thats the problem.

        any other guesses as what it could be?


        Just in case here i sthe code I have:
        Code:
        void TiledMap::DrawCitySpecialIcons (aui_Surface *surf, MapPoint const & pos, sint32 owner, bool fog, RECT &rect, Unit unit)
        {
        
        	TileSet	*   tileSet     = GetTileSet();
        	POINT       iconDim     = tileSet->GetMapIconDimensions(MAPICON_RELIGION1);
            RECT		iconRect;
        
        	CityData *cityData = unit.GetData()->GetCityData();
        
        	iconRect.left   = rect.left - 5;
        	iconRect.right  = iconRect.left + iconDim.x + 1;
        	iconRect.top    = rect.bottom;
        	iconRect.bottom = rect.top + iconDim.y + 1;
        
          	if (iconRect.left < 0 || iconRect.top < 0 || 
        		iconRect.right >= surf->Width() ||
        		iconRect.bottom >= surf->Height())
        		return;
        
        	Pixel16     color       = GetPlayerColor(owner, fog);
        	sint32  cityIcon = 0;
        
        //Religion Icons
        		for(sint32 rb = 0; rb < g_theBuildingDB->NumRecords(); rb++){
        			if(cityData->GetImprovements() & ((uint64)1 << rb)){
        				if (g_theBuildingDB->Get(rb, g_player[owner]->GetGovernmentType())->GetIsReligionIconIndex(cityIcon))
        				{
        					DrawColorizedOverlay(tileSet->GetMapIconData(cityIcon), surf, iconRect.left, iconRect.top, color);
        					AddDirtyRectToMix(iconRect);
        					iconRect.left += iconDim.x;
        					iconRect.right += iconDim.x;
        				}
        			}
        		}
        
        
          		for(sint32 rw=0; rwNumRecords(); rw++)
        		{
        			if(cityData->GetBuiltWonders() & (uint64)1 << (uint64)rw)
        			{
        				if(g_theWonderDB->Get(rw, g_player[owner]->GetGovernmentType())->GetIsReligionIconIndex(cityIcon))
        				{
        					DrawColorizedOverlay(tileSet->GetMapIconData(cityIcon), surf, iconRect.left, iconRect.top, color);
        					AddDirtyRectToMix(iconRect);
        					iconRect.left += iconDim.x;
        					iconRect.right += iconDim.x;
        				}
        			}
        		}
        }
        and this one:
        (I know the tabs are off because I thought this check might be the problem even though I have it elsewhere)
        Code:
        void UnitActor::DrawCityImprovements(bool fogged)
        {
        
        	Unit	unit(GetUnitID());
        	sint32  cityIcon = 0;
        	
        	TileSet	*   tileSet =	g_tiledMap->GetTileSet();
        	
        	sint32	nudgeX = (sint32)((double)((k_ACTOR_CENTER_OFFSET_X) - 48) * g_tiledMap->GetScale()), 
        			nudgeY = (sint32)((double)((k_ACTOR_CENTER_OFFSET_Y) - 48) * g_tiledMap->GetScale());
        
        	if (unit.IsValid() && unit.IsCity()) {
        	for(sint32 b = 0; b < g_theBuildingDB->NumRecords(); b++){
        		if(unit.CD()->GetImprovements() & ((uint64)1 << b)){
        			if (g_theBuildingDB->Get(b, g_player[m_playerNum]->GetGovernmentType())->GetShowCityIconIndex(cityIcon)) 
        			{
        				if (g_tiledMap->GetZoomLevel() == k_ZOOM_LARGEST) {
        					if (fogged)
        						g_tiledMap->DrawBlendedOverlayIntoMix(tileSet->GetMapIconData(cityIcon), m_x + nudgeX, m_y + nudgeY, k_FOW_COLOR, k_FOW_BLEND_VALUE);
        					else
        							g_tiledMap->DrawColorizedOverlayIntoMix(tileSet->GetMapIconData(cityIcon), m_x + nudgeX, m_y + nudgeY, 0x0000);
        				} else {
        					if (fogged)
        						g_tiledMap->DrawBlendedOverlayScaledIntoMix(tileSet->GetMapIconData(cityIcon), m_x + nudgeX, m_y + nudgeY,
        								g_tiledMap->GetZoomTilePixelWidth(), 
        								g_tiledMap->GetZoomTileGridHeight(), k_FOW_COLOR, k_FOW_BLEND_VALUE);
        					else
        						g_tiledMap->DrawScaledOverlayIntoMix(tileSet->GetMapIconData(cityIcon), m_x + nudgeX, m_y + nudgeY,
        								g_tiledMap->GetZoomTilePixelWidth(), 
        								g_tiledMap->GetZoomTileGridHeight());
        				}
        				//nudgeX += 5;
        			}
        		}
        	}
        
        
          	for(sint32 i=0; iNumRecords(); i++)
        	{
        		if(unit.CD()->GetBuiltWonders() & (uint64)1 << (uint64)i)
        		{
        			if(g_theWonderDB->Get(i, g_player[m_playerNum]->GetGovernmentType())->GetShowCityIconIndex(cityIcon)) 
        			{
        				if (g_tiledMap->GetZoomLevel() == k_ZOOM_LARGEST) {
        					if (fogged)
        						g_tiledMap->DrawBlendedOverlayIntoMix(tileSet->GetMapIconData(cityIcon), m_x + nudgeX, m_y + nudgeY, k_FOW_COLOR, k_FOW_BLEND_VALUE);
        					else
        							g_tiledMap->DrawColorizedOverlayIntoMix(tileSet->GetMapIconData(cityIcon), m_x + nudgeX, m_y + nudgeY, 0x0000);
        				} else {
        					if (fogged)
        						g_tiledMap->DrawBlendedOverlayScaledIntoMix(tileSet->GetMapIconData(cityIcon), m_x + nudgeX, m_y + nudgeY,
        								g_tiledMap->GetZoomTilePixelWidth(), 
        								g_tiledMap->GetZoomTileGridHeight(), k_FOW_COLOR, k_FOW_BLEND_VALUE);
        					else
        						g_tiledMap->DrawScaledOverlayIntoMix(tileSet->GetMapIconData(cityIcon), m_x + nudgeX, m_y + nudgeY,
        								g_tiledMap->GetZoomTilePixelWidth(), 
        								g_tiledMap->GetZoomTileGridHeight());
        				}
        				//nudgeX += 5;
        			}
        		}
        	}
        	}
        /// */ end for loop
        }
        Formerly known as "E" on Apolyton

        See me at Civfanatics.com

        Comment


        • #5
          Originally posted by E
          ok, now I'm confused
          [...]
          Code:
          /// */ end for loop
          As you should be . Without including the code that is before the block you show here, there is no way of telling whether this is a single line // comment or an end of a /* comment. Please stop mixing these 2 comment styles in this way.

          Comment


          • #6
            i know, i know...but that was after about a day ofmesing with it and doing 50 compiles. so that was a brief shortcut to out commenting and testing then uncommenting etc.

            well i have a hunch on a possible source of the problem. my file names may have been similar to ones i use in uniticon.txt which could of caused confusion even though i thought they were case dependent. well on to further testing.
            Formerly known as "E" on Apolyton

            See me at Civfanatics.com

            Comment


            • #7
              Originally posted by E
              i know, i know...but that was after about a day ofmesing with it and doing 50 compiles. so that was a brief shortcut to out commenting and testing then uncommenting etc.
              E, if you don't work properly you may confuse people and that's not good idea.

              Originally posted by E well i have a hunch on a possible source of the problem. my file names may have been similar to ones i use in uniticon.txt which could of caused confusion even though i thought they were case dependent. well on to further testing.
              If you worked on a UNIX based file system then you would be right, but unfortunately for you; you are working on a windows system and its file system is case insensitive.

              -Martin
              Civ2 military advisor: "No complaints, Sir!"

              Comment


              • #8
                i think i fixed it. checking the iscapitol bool in citydata i found i had two if lines reveresed. didn't seem like it would be a problem bt after doing it it appears fixed
                Formerly known as "E" on Apolyton

                See me at Civfanatics.com

                Comment


                • #9
                  That did not fix it. I outcomment a the MAPICON stuff in building and Wonder and it still crashed.

                  Only out commenting the MAPICONS in concepticon.txt will stop the crash (but it did work on only have two new MAPICONS in ther and it worked with two wonders)

                  is there a MAPICON limit I don't know about? or is it something to do with a certain limit of a MAPICON's size?
                  Formerly known as "E" on Apolyton

                  See me at Civfanatics.com

                  Comment


                  • #10
                    this crash seems to be the latest hiccup for rev748

                    but unfortunately a search has yield that this is VERY OLD (2004!)

                    look:



                    so its not my code and we don't where it came from or what causes it
                    Formerly known as "E" on Apolyton

                    See me at Civfanatics.com

                    Comment


                    • #11
                      Wait I'm noticing thta error codes are different in the link Iposted its:

                      0x004487db [? DrawTransitionTile@

                      this thread its
                      0x004693d3 [? DrawTransitionTile@

                      and cap's crashes as well as my crash.txt for rev748 is:
                      0x00469521 [? DrawTransitionTile@


                      I guess they are different issues. what do those error codes mean?
                      Formerly known as "E" on Apolyton

                      See me at Civfanatics.com

                      Comment


                      • #12
                        I think this crash is the 'standard' crash you get any time somewhere in the code goes to a negative value when addressing the surface of the graphic map
                        Formerly known as "E" on Apolyton

                        See me at Civfanatics.com

                        Comment


                        • #13
                          Originally posted by E
                          I think this crash is the 'standard' crash you get any time somewhere in the code goes to a negative value when addressing the surface of the graphic map
                          E, you should stop making your assumptions. Making assumptions doesn't end well, but read for yourself.

                          Anyway it wasn't a question about whether somewhere went negative when addressing the surface of the graphic map. It was a case of using unowned memory. And that will fail at one or another place. And actually if you had used the debugger then you could have figured out that the problem can't be located inside the DrawTransitionTile method.

                          Well anyway, it is fixed.

                          -Martin
                          Last edited by Ekmek; July 9, 2007, 14:50.
                          Civ2 military advisor: "No complaints, Sir!"

                          Comment

                          Working...
                          X