Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.11 KB | None | 0 0
  1. idImageManager::ImageFromFile
  2.     *_name = 0x05c72e20 "fms/_missionshots/previewshot_gatehouse_2014-01-29_19.24"
  3. idMaterial::ParseStage
  4.     src.buffer = 0x05c8f2e0 "material fms/_missionshots/previewshot_gatehouse_2014-01-29_19.24 // IMPLICITLY GENERATED\n{\n\t{\n\tblend blend\n\tcolored\n\tmap \"fms/_missionshots/previewshot_gatehouse_2014-01-29_19.24\"\n\tclamp\n\t}\n}\n"
  5. idMaterial::ParseStage (diff function same name)
  6.     src.buffer = 0x05c8f2e0 "material fms/_missionshots/previewshot_gatehouse_2014-01-29_19.24 // IMPLICITLY GENERATED\n{\n\t{\n\tblend blend\n\tcolored\n\tmap \"fms/_missionshots/previewshot_gatehouse_2014-01-29_19.24\"\n\tclamp\n\t}\n}\n"
  7. idMaterial::Parse
  8.     *text = 0x05c8f2e0 "material fms/_missionshots/previewshot_gatehouse_2014-01-29_19.24 // IMPLICITLY GENERATED\n{\n\t{\n\tblend blend\n\tcolored\n\tmap \"fms/_missionshots/previewshot_gatehouse_2014-01-29_19.24\"\n\tclamp\n\t}\n}\n"
  9. idDeclLocal::ParseLocal
  10.     This function has no parameters
  11.     idMaterial::Parse called with declText as parameter
  12.     declText = 0x05c8f2e0 "material fms/_missionshots/previewshot_gatehouse_2014-01-29_19.24 // IMPLICITLY GENERATED\n{\n\t{\n\tblend blend\n\tcolored\n\tmap \"fms/_missionshots/previewshot_gatehouse_2014-01-29_19.24\"\n\tclamp\n\t}\n}\n"
  13.     declText is from the function GetText()
  14. idDeclLocal::GetText
  15.     void idDeclLocal::GetText( char *text ) const {
  16.         HuffmanDecompressText( text, textLength, (byte *)textSource, compressedLength );
  17.    
  18. }
  19.     textSource is a class member of idDeclLocal
  20.  
  21. So it's obviously reading the compressed file and getting the incorrect file name for that
  22. So I searched for "IMPLICITLY GENERATED" in the solution and found
  23.  
  24. bool idMaterial::SetDefaultText( void ) {
  25.     // if there exists an image with the same name
  26.     //if ( 1 ) { //fileSystem->ReadFile( GetName(), NULL ) != -1 ) {
  27.     char generated[2048];
  28.     idStr::snPrintf( generated, sizeof( generated ),
  29.                     "material %s // IMPLICITLY GENERATED\n"
  30.                     "{\n"
  31.                     "\t"    "{\n"
  32.                     "\t"    "blend blend\n"
  33.                     "\t"    "colored\n"
  34.                     "\t"    "map \"%s\"\n"
  35.                     "\t"    "clamp\n"
  36.                     "\t"    "}\n"
  37.                     "}\n", GetName(), GetName() );
  38.     SetText( generated );
  39.  
  40.     return true;
  41. }
  42.  
  43. So it is probably returning the incorrect name from GetName()
  44.  
  45. (Virtual functions are a pain to debug)
  46.  
  47. GetName is from idDecl::GetName
  48. GetName( void ) const { return base->GetName(); }
  49. base is class idDeclBase* but again that's an abstract class
  50. The abstract class is actually idDeclLocal:
  51.  
  52. const char *idDeclLocal::GetName( void ) const {
  53.     return name.c_str();
  54. }
  55.  
  56. ?name.c_str()
  57. 0x758b5653 "\aÑ\xe"
  58.  
  59. So that doesn't give us anything, let's go into the idStr::snPrintf function
  60.  
  61. This is putting the wrong file paths in
  62. So something to do with setting the name of the idDeclLocal?
  63.  
  64. Did a search of the solution with various breakpoints, name is being set in line 1703 of DeclManager.cpp
  65.  
  66.  
  67. decl->name = canonicalName; where canonicalName is the incorrect filename
  68.  
  69. It is being called in the function idDeclManagerLocal::FindTypeWithoutParsing where name is 0x18f75b60 "fms/_missionshots/previewshot_gatehouse_2014-01-29_19.24.32859"
  70. Called from *idDeclManagerLocal::FindType where name is again incorrect
  71. Called from *idDeclManagerLocal::FindMaterial where name is incorrect
  72. Called from idWinBackground::Set where name is incorrect
  73. Called from Script_Set where src is incorrect (in GuiScript.cpp)
  74. Called from idGuiScript::Execute
  75.  
  76. So again this is where it's reading from the script...
  77.  
  78. void CDownloadMenu::UpdateScreenshotItemVisibility(idUserInterface* gui)
  79.  
  80. mods[19]->screenshots = [27] { shared_ptr {filename="fms/_missionshots/previewshot_gatehouse_2014-01-29_19.23.20420.jpg" serverRelativeUrl="screenshots/gatehouse_2014-01-29_19.23.20420.jpg" } [1 strong ref] [default], shared_ptr {filename="fms/_missionshots/previewshot_gatehouse_2014-01-29_19.24.32859.jpg" serverRelativeUrl="screenshots/gatehouse_2014-01-29_19.24.32859.jpg" } [1 strong ref] [default], shared_ptr {filename="fms/_missionshots/previewshot_gatehouse_2014-01-29_19.26.03889.jpg" serverRelativeUrl="screenshots/gatehouse_2014-01-29_19.26.03889.jpg" } [1 strong ref] [default], shared_ptr {filename="fms/_missionshots/previewshot_gatehouse_2014-01-29_19.27.13786.jpg" serverRelativeUrl="screenshots/gatehouse_2014-01-29_19.27.13786.jpg" } [1 strong ref] [default], shared_ptr {filename="fms/_missionshots/previewshot_gatehouse_2014-01-29_19.29.52540.jpg" serverRelativeUrl="screenshots/gatehouse_2014-01-29_19.29.52540.jpg" } [1 strong ref] [default], shared_ptr {filename="fms/_missionshots/previewshot_gatehouse_2014-01-29_19.30.18716.jpg" serverRelativeUrl="screenshots/gatehouse_2014-01-29_19.30.18716.jpg" } [1 strong ref] [default], shared_ptr {filename="fms/_missionshots/previewshot_gatehouse_2014-01-29_19.31.04791.jpg" serverRelativeUrl="screenshots/gatehouse_2014-01-29_19.31.04791.jpg" } [1 strong ref] [default], ... }
  81. Here the names are correct!!
  82.  
  83. Control+F screenshots
  84.  
  85. in void CDownloadMenu::UpdateNextScreenshotData(idUserInterface* gui, int nextScreenshotNum)
  86.  
  87. MissionScreenshot& screenshotInfo = *mods[missionIndex]->screenshots[nextScreenshotNum];
  88. gui->SetStateInt("av_mission_cur_screenshot_num", nextScreenshotNum);
  89.  
  90. // Load next screenshot path, remove image extension
  91. idStr path = screenshotInfo.filename;
  92. path.StripFileExtension();
  93.  
  94. gui->SetStateString("av_mission_next_screenshot", path);
  95.  
  96. path = "fms/_missionshots/previewshot_gatehouse_2014-01-29_19.24.32859.jpg"
  97. path.StripFileExtension();
  98. gui->SetStateString("av_mission_next_screenshot", path)
  99.  
  100. Now path is "fms/_missionshots/previewshot_gatehouse_2014-01-29_19.24.32859" which is correct?
  101.  
  102. in void CDownloadMenu::PerformScreenshotStep(idUserInterface* gui, int step it's also correct
  103.  
  104. The gui script being called is titled "onStartFadeToNextScreenshot"
  105.  
  106. In idWindow::RunNamedEvent if we change:
  107.     RunScriptList(namedEvents[i]->mEvent);
  108.  
  109. To:
  110.     if (namedEvents[i]->mName == "onStartFadeToNextScreenshot") {
  111.     }
  112.     else {
  113.         RunScriptList(namedEvents[i]->mEvent);
  114.     }
  115.  
  116. The screenshots fail to load altogether, but debugging the content of the script seems difficult
  117.  
  118. Currently i'm modifying the code to debug onStartFadeToNextScreenshot easier
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement