/////////////////// // Load a font int CFont::Load(const std::string& fontname, bool _colour) { // Load the font LOAD_IMAGE_WITHALPHA(bmpFont, fontname); // Set the color key for this alpha surface SetColorKey(bmpFont.get(), 255, 0, 255); Colorize = _colour; bmpWhite = gfxCreateSurfaceAlpha(bmpFont.get()->w, bmpFont.get()->h); bmpGreen = gfxCreateSurfaceAlpha(bmpFont.get()->w, bmpFont.get()->h); // Calculate the width of each character and number of characters Parse(); // Pre-calculate some colours f_white = tLX->clNormalLabel; f_green = tLX->clChatText; // Precache some common font colors (but only if this font should be colorized) if (Colorize) { PreCalculate(bmpWhite, f_white); PreCalculate(bmpGreen, f_green); } return true; }
// start processing of jobs void rcrackiThread::rcrackiThreadEntryPoint() { #if GPU if(gpu != 0 && cudaGetDevice(&cudaDevId) == CUDA_SUCCESS) { cudaBuffCount = 0x2000; cudaChainSize = 100; cudaDeviceProp deviceProp; if(cudaGetDeviceProperties(&deviceProp, cudaDevId) == CUDA_SUCCESS) { switch(deviceProp.major) { case 1: ; break; case 2: cudaBuffCount = 0x4000; cudaChainSize = 200; break; } } cudaBuffCount = rcuda::GetChainsBufferSize(cudaBuffCount); } else #endif cudaDevId = -1; if (falseAlarmChecker) { if (falseAlarmCheckerO) { CheckAlarmO(); } else { CheckAlarm(); } } else { PreCalculate(); } }
void pEngine::setToDefault() { char buf[128],fname[128]; position.Set(0,0,0); size = 0.0f; maxRPM = 8000; idleRPM = 1110; mass = 0.0f; // Physical attribs #ifdef OBS sprintf(buf,"%s.rolling_friction_coeff",path); rollingFrictionCoeff=info->GetFloat(buf); #endif torqueReaction=1.0f; maxTorque=468; SetInertia(0.35f); #ifdef OBS sprintf(buf,"%s.inertia.final_drive",path); inertiaDriveShaft=info->GetFloat(buf); #endif friction=0.0f; brakingCoeff=3.3f; //flags|=HAS_STARTER; // if(info->GetInt(buf,1)) // flags|=START_STALLED; // sprintf(buf,"%s.starter_torque",path); starterTorque=90.0f; stallRPM=400.0f; stallRPM=1250.0f; autoClutchRPM=1250.0f; //flags|=AUTOMATIC; flags|=AUTOCLUTCH_ACTIVE; PreCalculate(); }
Ray::Ray() : m_origin(glm::vec3(0.0f)), m_direction(glm::vec3(0.0f, 0.0f, 1.0f)) { PreCalculate(); }
Ray::Ray(const glm::vec3& o, const glm::vec3& d) : m_origin(o), m_direction(d) { PreCalculate(); }