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"); }
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"); }
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"); }
void Check_Unload(int argc, char **argv) { if (argc > 3) { if (argc == 4) return; PrintErrorExit(argv[0], "unload"); } PrintErrorExit(argv[0], "unload"); }
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"); }
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"); }
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"); }
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"); }
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"); }
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"); }
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); }
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], ""); }