Пример #1
0
void Check_List(int argc, char **argv)
{
	if (argc != 4)
		PrintErrorExit(argv[0], "list map : too many args");
	else
		if (strcmp(argv[3], "map"))
			PrintErrorExit(argv[0], "list map : Can only list map");
}
Пример #2
0
void Check_Compression(int argc, char **argv)
{
	if (argc > 3) {
		if (argc == 4)
			return;

		PrintErrorExit(argv[0], "compression");
	}
	PrintErrorExit(argv[0], "compression : missing lzo or zlib");
}
Пример #3
0
void Check_append_only(int argc, char **argv)
{
	if (argc > 4) {
		if (argc == 5)
			return;

		PrintErrorExit(argv[0], "Append Only");
	}
	PrintErrorExit(argv[0], "Append Only : missing Yes / No");
}
Пример #4
0
void Check_Unload(int argc, char **argv)
{
	if (argc > 3) {
		if (argc == 4)
			return;

		PrintErrorExit(argv[0], "unload");
	}
	PrintErrorExit(argv[0], "unload");
}
Пример #5
0
void Check_Close(int argc, char **argv)
{
	if (argc > 3) {
		if (!strcmp(argv[3], "map")) {
			if (argc == 4)
				return;
		}
		PrintErrorExit(argv[0], "close map");
	}
	PrintErrorExit(argv[0], "close map");
}
Пример #6
0
void Check_Open(int argc, char **argv)
{
	if (argc > 3) {
		if (!strcmp(argv[3], "map")) {
			if (argc == 4)
				return;
		}
		PrintErrorExit(argv[0], "open map");
	}
	PrintErrorExit(argv[0], "open map");
}
Пример #7
0
void Check_Empty(int argc, char **argv)
{
	if (argc > 3) {
		if (!strcmp(argv[3], "map")) {
			if (argc == 4)
				return;
		}
		PrintErrorExit(argv[0], "empty map");
	}
	PrintErrorExit(argv[0], "empty map");
}
Пример #8
0
void Check_delay(int argc, char **argv)
{
	if (argc > 4) {
		if (argc == 5) {
			if (atoi(argv[4]) >= 0)
				return;
			PrintErrorExit(argv[0], "delay: Negative value");
		}
		PrintErrorExit(argv[0], "delay");
	}
	PrintErrorExit(argv[0], "delay");
}
Пример #9
0
void Check_TapeAlert(int argc, char **argv)
{
	if (argc > 3) {
		if (!ishex(argv[3])) {
			fprintf(stderr, "Value not hexadecimal: %s\n", argv[3]);
			exit(1);
		}
		if (argc == 4)
			return;

		PrintErrorExit(argv[0], "TapeAlert");
	}
	PrintErrorExit(argv[0], "TapeAlert");
}
Пример #10
0
void Check_Load(int argc, char **argv)
{
	if (argc > 3) {
		if (!strcmp(argv[3], "map")) {
			if (argc == 5)
				return;

			PrintErrorExit(argv[0], "load map");
		}

		if (argc == 4)
			return;

		PrintErrorExit(argv[0], "load");
	}
	PrintErrorExit(argv[0], "load");
}
Пример #11
0
FireEffect::FireEffect(const Vector3f& position) {

    constexpr float minV = 0.886f;
    constexpr float maxV = minV + 0.2f;

    constexpr float range = 1.305f;

    SetMinVelocity(Vector3f(-range,minV,-range) );
    SetMaxVelocity(Vector3f(+range,maxV,+range));

    SetBaseParticleLifetime(1.5f);
    SetParticleLifetimeVariance(1.5f);

    SetBaseStartSize(0.70f);
    SetBaseEndSize(0.38f);
    SetStartSizeVariance(0.22f);
    SetEndSizeVariance(0.16f);

    SetStartColor(Color(1.0f,0.2f,0.0f,0.6f));
    SetEndColor(Color(1.0f,0.2f,0.0f,0.0f));

    SetBlendingMode(ADDITIVE_BLENDING_MODE);

    SetEmitPosition(position);
    SetEmitPositionVariance(Vector3f(0.05f));

    Texture* texture = Texture2D::Load("img/particle_post2.png");

    if(!texture) {
	PrintErrorExit();
    }

    texture->Bind();
    texture->SetTextureRepeat();
    texture->GenerateMipmap();
    texture->SetMinFilter(GL_LINEAR_MIPMAP_LINEAR);
    texture->SetMagFilter(GL_LINEAR);
    texture->Unbind();

    SetTexture(texture);

}
Пример #12
0
void Check_Params(int argc, char **argv)
{
	if (argc > 1) {
		if (!isnumeric(argv[1])) {
			fprintf(stderr, "DeviceNo not numeric: %s\n", argv[1]);
			exit(1);
		}
		if (argc > 2) {
			/* global commands */
			if (!strcmp(argv[2], "verbose")) {
				if (argc == 3)
					return;
				PrintErrorExit(argv[0], "verbose");
			}
			if (!strcmp(argv[2], "dump")) {
				if (argc == 3)
					return;
				PrintErrorExit(argv[0], "dump");
			}
			if (!strcmp(argv[2], "debug")) {
				if (argc == 3)
					return;
				PrintErrorExit(argv[0], "debug");
			}
			if (!strcmp(argv[2], "exit")) {
				if (argc == 3)
					return;
				PrintErrorExit(argv[0], "exit");
			}
			if (!strncasecmp(argv[2], "TapeAlert", 9)) {
				Check_TapeAlert(argc, argv);
				return;
			}

			/* Tape commands */
			if (!strncasecmp(argv[2], "load", 4)) {
				Check_Load(argc, argv);
				return;
			}
			if (!strncasecmp(argv[2], "unload", 6)) {
				Check_Unload(argc, argv);
				return;
			}
			if (!strncasecmp(argv[2], "delay", 5)) {
				Check_delay(argc, argv);
				return;
			}
			if (!strncasecmp(argv[2], "compression", 11)) {
				Check_Compression(argc, argv);
				return;
			}
			if (!strncasecmp(argv[2], "Append", 6)) {
				Check_append_only(argc, argv);
				return;
			}

			/* Library commands */
			if (!strcmp(argv[2], "add")) {
				if (argc == 4)
					return;
				PrintErrorExit(argv[0], "add slot");
			}
			if (!strcmp(argv[2], "online")) {
				if (argc == 3)
					return;
				PrintErrorExit(argv[0], "online");
			}
			if (!strcmp(argv[2], "offline")) {
				if (argc == 3)
					return;
				PrintErrorExit(argv[0], "offline");
			}
			if (!strcmp(argv[2], "list")) {
				Check_List(argc, argv);
				return;
			}
			if (!strcmp(argv[2], "empty")) {
				Check_Empty(argc, argv);
				return;
			}
			if (!strcmp(argv[2], "open")) {
				Check_Open(argc, argv);
				return;
			}
			if (!strcmp(argv[2], "close")) {
				Check_Close(argc, argv);
				return;
			}
			PrintErrorExit(argv[0], "check param");
		}
		PrintErrorExit(argv[0], "");
	}
	PrintErrorExit(argv[0], "");
}