MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / cHermiteCatmullSpline

Function cHermiteCatmullSpline

source/modes/ConsoleCommands.cpp:354–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352}
353
354Command::Result cHermiteCatmullSpline(const Command::ArgumentList_t& args, ConsoleInterface& c, AbstractModeManager&)
355{
356 //TODO: only works on larger maps with coordinates > 10
357 if(args.size() < 5)
358 {
359 c.print("\nERROR: You need to specify at least two coordinate's pair.\n");
360 return Command::Result::INVALID_ARGUMENT;
361 }
362
363
364 CameraManager* cm = ODFrameListener::getSingleton().getCameraManager();
365 std::size_t numPairs = (args.size() - 1) / 2;
366
367 cm->resetHCSNodes(numPairs);
368 for(std::size_t i = 1; i < args.size() - 1; i +=2)
369 {
370 int a = Helper::toInt(args[i]);
371 int b = Helper::toInt(args[i + 1]);
372 //TODO: Why are the points specified as integers?
373 cm->addHCSNodes(a, b);
374 c.print("Adding nodes: " + args[i] + ", " + args[i + 1]);
375 }
376
377 cm->setCatmullSplineMode(true);
378 return Command::Result::SUCCESS;
379}
380
381Command::Result cSrvAddGold(const Command::ArgumentList_t& args, ConsoleInterface& c, GameMap& gameMap)
382{

Callers

nothing calls this directly

Calls 6

toIntFunction · 0.85
getCameraManagerMethod · 0.80
resetHCSNodesMethod · 0.80
addHCSNodesMethod · 0.80
setCatmullSplineModeMethod · 0.80
printMethod · 0.45

Tested by

no test coverage detected