int parseArgument(char * arg) { if (strcmp(arg, "--debug") == 0 || strcmp(arg, "-d") == 0) { enableDebugMode(); return 0; } else { char * flag_name = strtok(arg, "="); char * flag_value = strtok(NULL, "="); int flag_intValue; if (strcmp(flag_name, "--timer") == 0 || strcmp(flag_name, "-t") == 0) { if (flag_value != NULL) flag_intValue = getInteger(flag_value); if (flag_intValue >= 1 && flag_intValue <= 1024) { enableTimer(); setTimeSlice(flag_intValue); return 0; } else if (flag_intValue != 0) { printf("Invalid arguement %d to timer flag. Timer value should be between 0 and 1024\n", flag_intValue); return -1; } else { disableTimer(); return 0; } } else { printf("Invalid arguement %s", arg); return -1; } } }
SimMovingShape::SimMovingShape() { state = Start; objectMask = -1; record.timeScale = 1.0f; record.forwardDelay = 0.0f; record.backwardDelay = 0.0f; record.startSoundId = 0; record.stopSoundId = 0; record.runningSoundId = 0; record.collisionDamage = 0; lVector.set(0.0f,0.0f,0.0f); setTimeSlice(1.0f/30.0f); }
C_GetTime::C_GetTime( EX_SCALE::TIME_SCALE unit, const bool slice ) :_timeUp( true ) { setTimeSlice( slice ); setTimeUnit( unit ); }