Add option to renderdoccmd replay to specify a loop count

This commit is contained in:
baldurk
2018-10-02 16:23:40 +01:00
parent 4937a9e4b9
commit 1c05c5e5d1
6 changed files with 32 additions and 15 deletions
+7 -4
View File
@@ -56,7 +56,8 @@ rdcarray<rdcstr> convertArgs(const std::vector<std::string> &args)
return ret;
}
void DisplayRendererPreview(IReplayController *renderer, uint32_t width, uint32_t height)
void DisplayRendererPreview(IReplayController *renderer, uint32_t width, uint32_t height,
uint32_t numLoops)
{
if(renderer == NULL)
return;
@@ -100,7 +101,7 @@ void DisplayRendererPreview(IReplayController *renderer, uint32_t width, uint32_
d.resourceId = id;
}
DisplayRendererPreview(renderer, d, width, height);
DisplayRendererPreview(renderer, d, width, height, numLoops);
}
std::map<std::string, Command *> commands;
@@ -517,6 +518,8 @@ struct ReplayCommand : public Command
parser.set_footer("<capture.rdc>");
parser.add<uint32_t>("width", 'w', "The preview window width.", false, 1280);
parser.add<uint32_t>("height", 'h', "The preview window height.", false, 720);
parser.add<uint32_t>("loops", 'l', "How many times to loop the replay, or 0 for indefinite.",
false, 0);
parser.add<string>("remote-host", 0,
"Instead of replaying locally, replay on this host over the network.", false);
parser.add<uint32_t>("remote-port", 0, "If --remote-host is set, use this port.", false,
@@ -574,7 +577,7 @@ struct ReplayCommand : public Command
if(status == ReplayStatus::Succeeded)
{
DisplayRendererPreview(renderer, parser.get<uint32_t>("width"),
parser.get<uint32_t>("height"));
parser.get<uint32_t>("height"), parser.get<uint32_t>("loops"));
remote->CloseCapture(renderer);
}
@@ -606,7 +609,7 @@ struct ReplayCommand : public Command
if(status == ReplayStatus::Succeeded)
{
DisplayRendererPreview(renderer, parser.get<uint32_t>("width"),
parser.get<uint32_t>("height"));
parser.get<uint32_t>("height"), parser.get<uint32_t>("loops"));
renderer->Shutdown();
}