Ver código fonte

Add `Debug::Tracer tracer` stack variable to main so that TraceMessageBus works (#503) (#505)

Signed-off-by: rgba16f <[email protected]>

Signed-off-by: rgba16f <[email protected]>
rgba16f 2 anos atrás
pai
commit
6e9e09cabd

+ 5 - 0
Gem/Code/Source/Automation/ScriptReporter.h

@@ -146,6 +146,11 @@ namespace AtomSampleViewer
         //! Records all the information about a single test script.
         struct ScriptReport : public AZ::Debug::TraceMessageBus::Handler
         {
+            ScriptReport()
+            {
+                AZ::Debug::TraceMessageBus::Handler::BusConnect();
+            }
+
             ~ScriptReport()
             {
                 AZ::Debug::TraceMessageBus::Handler::BusDisconnect();

+ 1 - 0
Standalone/Platform/Common/AtomSampleViewerApplication.cpp

@@ -331,6 +331,7 @@ namespace AtomSampleViewer
 
     int RunGameCommon(int argc, char** argv, AZStd::function<void()> customRunCode)
     {
+        const AZ::Debug::Trace tracer;
         AtomSampleViewer::AtomSampleViewerApplication app(&argc, &argv);
 
         const AzGameFramework::GameApplication::StartupParameters gameAppParams;