 |
Blamite Game Engine - blam!
00453.06.08.26.0624.blamite
The core library for the Blamite Game Engine.
|
Go to the documentation of this file. 1 #include "../console.h"
3 #include <Strings/components/resources/strings/strings.h>
4 #include <Strings/components/utils/converters/converters.h>
21 name =
"render_model_performance_test";
23 syntax =
"render_model_performance_test <tag> <count> <distance> [y] [disable gizmos]";
28 BlamResult
Execute(std::vector<std::string> arguments)
30 if (arguments.size() < 3)
32 return BlamResult::Error_Command_WrongArgumentCount;
35 std::string tag_path = arguments.at(0);
36 int count = BlamStrings::Converters::StringToInt(arguments.at(1), 0);
37 float distance = BlamStrings::Converters::StringToFloat(arguments.at(2), 1.0f);
39 bool disable_gizmos =
false;
41 if (arguments.size() >= 4)
43 y = BlamStrings::Converters::StringToFloat(arguments.at(3),
y);
46 if (arguments.size() >= 5)
48 disable_gizmos = BlamStrings::Converters::StringToBool(arguments.at(4), disable_gizmos);
57 if (load_result == BlamResult::Error_FileNotFound)
61 return BlamResult::Success_OK;
63 else if (BR_FAILED(load_result))
67 +
": " + ERROR_TEXT(load_result));
68 return BlamResult::Success_OK;
78 return BlamResult::Success_OK;
86 return BlamResult::Success_OK;
89 std::vector<BlamWorldObject_Tag*> new_objects = std::vector<BlamWorldObject_Tag*>();
91 int length = sqrt(count) / 2;
93 for (
int x = -length;
x < length;
x++)
95 for (
int z = -length; z < length; z++)
99 if (
object &&
object->ValidateTagData())
101 new_objects.push_back(
object);
102 object->
SetPosition(BlamVector3(
x * distance,
y, z * distance));
106 if (
object)
delete object;
117 object->SetTransformEnabled(
false);
123 return BlamResult::Success_OK;
BLAM BlamWorldState * GetWorldState()
Retrieves the current world state.
Definition: world.cpp:56
void AddObject(BlamWorldObject *object)
Definition: BlamWorldState.cpp:107
std::string description
An optional description of the command. Shown when using the classify command.
Definition: console.h:36
Class used to represent a console command.
Definition: console.h:33
bool UsingBgfx()
Definition: bgfx.cpp:63
BLAM BlamResult LoadTagFromFile(std::string tag_path, bool reload_if_already_loaded=true)
Loads a tag from the engine's tag directory (default is '.
Definition: tag_io.cpp:319
BlamWorldObject_Tag * CreateTagObject(BlamTagData *tag_data, bool add_to_world=true)
Definition: BlamWorldState.cpp:258
Class representing a tag-based world object.
Definition: world_objects.h:278
font DisplayOffset y
Definition: README.txt:68
std::string name
The name of the console command.
Definition: console.h:35
BLAM BlamTagData * GetTagData(std::string tag_path)
Retrieves information for a given tag.
Definition: tags.cpp:81
std::string syntax
The syntax information for the command. Shown to the user when using the help command with an argumen...
Definition: console.h:37
BlamCommandType type
The type of command this is. See #Blam::Resources::Console::BlamCommandType for more information.
Definition: console.h:40
void SetPosition(BlamVector3 position)
Definition: BlamWorldObject.cpp:233
BLAM void LogEventForce(std::string message)
Forcibly logs a message to the log and/or console.
Definition: aliases.cpp:262
config GlyphExtraSpacing x
Definition: README.txt:30
Class used to contain and access tag data.
Definition: tags.h:125
Namespace for things relating to the debug console.
Definition: abort.hpp:5
Class representing a world state.
Definition: world_objects.h:715
@ Builtin
A command that is hard-coded into the engine.