// Constructor // // (other items were commented in a header). // --------------------------------------------------------------------------- // EXPORT_C CFepLayoutChoiceList::CFepLayoutChoiceList(CFepUiLayout* aUiLayout, TInt aControlId) :CFepLayoutPopupWnd(TSize(0,0), aUiLayout, aControlId) { SetControlType(ECtrlPopupChoiceList); iSubItemSkinID = KAknsIIDNone; iBackgroundSkinID = KAknsIIDNone; }
EXPORT_C CBubbleCtrl::CBubbleCtrl(const TRect& aRect, CFepUiLayout* aUiLayout, TInt aCtrlId) :CFepUiBaseCtrl(aRect,aUiLayout,aCtrlId), iForgroundBmp(NULL), iForgroundBmpMask(NULL), iShowing(EFalse), iTextColorIndex(KDefaultTextColorIndex) { SetControlType(ECtrlButton); SetHidenFlag(ETrue); }
CJTable::CJTable(void) { m_iValue = 0; m_iExtent = 0; m_iColumnCount = 1; m_iCellWidth = 0; m_iCellHeight = 0; m_iRowMargin = 0; m_iColMargin = 0; m_iSelectedItemID = 0; SetControlType( CTRL_TABLE ); }
/* ============================================================================ * ParseArgs: Parses the argument list and performs actions. * ========================================================================= */ static void ParseArgs(int args, const char *argv[], struct CEN64Device *device) { int i; /* TODO: getops or something sensible. */ for (i = 0; i < args; i++) { const char *arg = argv[i]; while (*arg == ' '); /* Accept -, --, and / */ if (*arg == '-') { arg++; if (*arg == '-') arg++; } else if (*arg == '/') arg++; /* Set Controller Type. */ if (!strcmp(arg, "controller")) { if (++i >= args) { printf("-controller: Missing argument; ignoring.\n"); continue; } SetControlType(device->pif, argv[i]); } /* Set backing EEPROM file. */ if (!strcmp(arg, "eeprom")) { if (++i >= args) { printf("-eeprom: Missing argument; ignoring.\n"); continue; } SetEEPROMFile(device->pif, argv[i]); } /* Set backing SRAM file. */ if (!strcmp(arg, "sram")) { if (++i >= args) { printf("-sram: Missing argument; ignoring.\n"); continue; } SetSRAMFile(device->rom, argv[i]); } } }
CSlot::CSlot(void) { m_bClicked = false; m_pIcon = NULL; m_pDragItem = NULL; m_pCommand = NULL; m_bDragAvailable = false; m_iWidth = 40; m_iHeight = 40; m_dwTooltipType = 0; SetControlType( CTRL_SLOT ); }
BOOL CClickInfoSettingsDlg::OnInitDialog() { CDialog::OnInitDialog(); CString csTitle; csTitle.LoadString(IDD_DIALOG_CLICK_INFO_SETTINGS); SetWindowText(csTitle); DWORD dwIds []= { IDC_CALL_LBL_CLICK_APP_NAME, IDC_CALL_LBL_CLICK_CONTROL_NAME, IDC_CALL_LBL_CLICK_CONTROL_TYPE, IDC_CALL_LBL_POSITION, IDC_CALL_LBL_SIZE, IDC_CALL_LBL_X, IDC_CALL_LBL_Y, IDC_CALL_LBL_WIDTH, IDC_CALL_LBL_HEIGHT, IDOK, IDCANCEL, -1 }; MfcUtils::Localize(this, dwIds); CString csAppName = m_pLcElementInfoCopy->GetProcessName(); m_edtAppName.SetWindowText(csAppName); CString csControlName = m_pLcElementInfoCopy->GetName(); StringManipulation::DecodeXmlSpecialCharacters(csControlName); m_edtCtrlName.SetWindowText(csControlName); SetControlType(m_pLcElementInfoCopy->GetAccType()); CString csText; csText.Format(_T("%d"), m_pLcElementInfoCopy->GetPtLocation().x); m_edtX.SetWindowText(csText); csText.Format(_T("%d"), m_pLcElementInfoCopy->GetPtLocation().y); m_edtY.SetWindowText(csText); csText.Format(_T("%d"), m_pLcElementInfoCopy->GetPtSize().x); m_edtWidth.SetWindowText(csText); csText.Format(_T("%d"), m_pLcElementInfoCopy->GetPtSize().y); m_edtHeight.SetWindowText(csText); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void CObject::Initialize (ubyte nType, ubyte nId, short nCreator, short nSegment, const CFixVector& vPos, const CFixMatrix& mOrient, fix xSize, ubyte cType, ubyte mType, ubyte rType) { SetSignature (gameData.objs.nNextSignature++); SetType (nType); SetId (nId); SetLastPos (vPos); SetSize (xSize); SetCreator ((sbyte) nCreator); SetOrient (&mOrient); SetControlType (cType); SetMovementType (mType); SetRenderType (rType); SetContainsType (-1); SetLifeLeft ( ((gameData.app.nGameMode & GM_ENTROPY) && (nType == OBJ_POWERUP) && (nId == POW_HOARD_ORB) && (extraGameInfo [1].entropy.nVirusLifespan > 0)) ? I2X (extraGameInfo [1].entropy.nVirusLifespan) : IMMORTAL_TIME); SetAttachedObj (-1); SetShields (I2X (20)); SetSegment (-1); //set to zero by memset, above LinkToSeg (nSegment); }
CTPane::CTPane(void) { SetControlType( CTRL_PANE ); }
static int InitializePoll (CMenu& menu, int& key, int nCurItem, int nState) { if (nState) return nCurItem; paletteManager.LoadEffect (); switch (loadOp) { case 0: /*---*/PrintLog ("Creating default tracker list\n"); tracker.CreateList (); break; case 1: /*---*/PrintLog ("Loading ban list\n"); banList.Load (); break; case 2: /*---*/PrintLog ("Initializing control types\n"); SetControlType (); break; case 3: /*---*/PrintLog ("Initializing keyboard\n"); KeyInit (); break; case 4: /*---*/PrintLog ("Initializing joystick\n"); DoJoystickInit (); break; case 5: int i; if ((i = FindArg ("-xcontrol")) > 0) externalControls.Init (strtol (pszArgList [i+1], NULL, 0), strtol (pszArgList [i+2], NULL, 0)); break; case 6: /*---*/PrintLog ("Initializing movies\n"); if (FindArg ("-nohires") || FindArg ("-nohighres") || !GrVideoModeOK (MENU_HIRES_MODE)) gameOpts->movies.bHires = gameStates.menus.bHires = gameStates.menus.bHiresAvailable = 0; else gameStates.menus.bHires = gameStates.menus.bHiresAvailable = 1; movieManager.InitLibs (); //init movie libraries break; case 7: BMInit (); break; case 8: /*---*/PrintLog ("Initializing sound\n"); audio.Setup (1); break; case 9: /*---*/PrintLog ("Loading hoard data\n"); LoadHoardData (); break; case 10: error_init (ShowInGameWarning, NULL); break; case 11: break; g3_init (); case 12: /*---*/PrintLog ("Initializing texture merge buffer\n"); TexMergeInit (100); // 100 cache bitmaps break; case 13: InitPowerupTables (); break; case 14: LoadGameBackground (); atexit (CloseGame); break; case 15: InitThreads (); break; case 16: PiggyInitMemory (); break; case 17: if (!FindArg ("-nomouse")) MouseInit (); break; case 18: /*---*/PrintLog ("Enabling TrackIR support\n"); TIRLoad (); break; } loadOp++; if (gameStates.app.bProgressBars && gameOpts->menus.nStyle) { if (loadOp == InitGaugeSize ()) key = -2; else { menu [0].m_value++; menu [0].m_bRebuild = 1; key = 0; } } paletteManager.LoadEffect (); return nCurItem; }
int CObject::Create (ubyte nType, ubyte nId, short nCreator, short nSegment, const CFixVector& vPos, const CFixMatrix& mOrient, fix xSize, ubyte cType, ubyte mType, ubyte rType) { #if DBG if (nType == OBJ_WEAPON) { nType = nType; if ((nCreator >= 0) && (OBJECTS [nCreator].info.nType == OBJ_ROBOT)) nType = nType; if (nId == FLARE_ID) nType = nType; if (gameData.objs.bIsMissile [(int) nId]) nType = nType; } else if (nType == OBJ_ROBOT) { #if 0 if (ROBOTINFO ((int) nId).bossFlag && (BOSS_COUNT >= MAX_BOSS_COUNT)) return -1; #endif } else if (nType == OBJ_HOSTAGE) nType = nType; else if (nType == OBJ_FIREBALL) nType = nType; else if (nType == OBJ_REACTOR) nType = nType; else if (nType == OBJ_DEBRIS) nType = nType; else if (nType == OBJ_MARKER) nType = nType; else if (nType == OBJ_PLAYER) nType = nType; else if (nType == OBJ_POWERUP) nType = nType; #endif SetSegment (FindSegByPos (vPos, nSegment, 1, 0)); if ((Segment () < 0) || (Segment () > gameData.segs.nLastSegment)) return -1; if (nType == OBJ_DEBRIS) { if (gameData.objs.nDebris >= gameStates.render.detail.nMaxDebrisObjects) return -1; } // Zero out object structure to keep weird bugs from happening in uninitialized fields. m_nId = OBJ_IDX (this); SetSignature (gameData.objs.nNextSignature++); SetType (nType); SetId (nId); SetLastPos (vPos); SetPos (&vPos); SetSize (xSize); SetCreator ((sbyte) nCreator); SetOrient (&mOrient); SetControlType (cType); SetMovementType (mType); SetRenderType (rType); SetContainsType (-1); SetLifeLeft ( ((gameData.app.nGameMode & GM_ENTROPY) && (nType == OBJ_POWERUP) && (nId == POW_HOARD_ORB) && (extraGameInfo [1].entropy.nVirusLifespan > 0)) ? I2X (extraGameInfo [1].entropy.nVirusLifespan) : IMMORTAL_TIME); SetAttachedObj (-1); m_xCreationTime = gameData.time.xGame; #if 0 if (GetControlType () == CT_POWERUP) CPowerupInfo::SetCount (1); // Init physics info for this CObject if (GetMovementType () == MT_PHYSICS) m_vStartVel.SetZero (); if (GetRenderType () == RT_POLYOBJ) CPolyObjInfo::SetTexOverride (-1); if (GetType () == OBJ_WEAPON) { CPhysicsInfo::SetFlags (CPhysInfo.GetFlags () | WI_persistent (m_info.nId) * PF_PERSISTENT); CLaserInfo::SetCreationTime (gameData.time.xGame); CLaserInfo::SetLastHitObj (0); CLaserInfo::SetScale (I2X (1)); } else if (GetType () == OBJ_DEBRIS) gameData.objs.nDebris++; if (GetControlType () == CT_POWERUP) CPowerupInfo::SetCreationTime (gameData.time.xGame); else if (GetControlType () == CT_EXPLOSION) { CAttachedInfo::SetPrev (-1); CAttachedInfo::SetNext (-1); CAttachedInfo::SetParent (-1); } #endif Link (); LinkToSeg (nSegment); return m_nId; }
int ControlsReadAll (void) { int i; int bSlideOn, bBankOn; int nBankSensMod; fix pitchTime, headingTime; fix mouseAxis [3]; int nMouseButtons; int bUseMouse, bUseJoystick; Controls [0].cyclePrimaryCount = 0; Controls [0].cycleSecondaryCount = 0; Controls [0].toggleIconsCount = 0; Controls [0].zoomDownCount = 0; Controls [0].headlightCount = 0; Controls [0].fireFlareDownCount = 0; Controls [0].dropBombDownCount = 0; Controls [0].automapDownCount = 0; Controls [0].rearViewDownCount = 0; gameStates.input.bControlsSkipFrame = 1; if (ControlsCapSampleRate ()) return 1; gameStates.input.bControlsSkipFrame = 0; ControlsResetControls (); gameStates.input.bKeepSlackTime = 1; nBankSensMod = kcFrameCount; nMouseButtons = 0; bUseMouse = 0; bSlideOn = 0; bBankOn = 0; #ifdef FAST_EVENTPOLL if (!gameOpts->legacy.bInput) event_poll (SDL_ALLEVENTS); //why poll 2 dozen times in the following code when input polling calls all necessary input handlers anyway? #endif SetControlType (); bUseJoystick = gameOpts->input.joystick.bUse && ControlsReadJoystick ((int *) &joyAxis [0]); if (gameOpts->input.mouse.bUse) if (gameStates.input.bCybermouseActive) { // ReadOWL (kc_external_control); // CybermouseAdjust (); } else if (gameStates.input.nMouseType == CONTROL_CYBERMAN) bUseMouse = ControlsReadCyberman ((int *) &mouseAxis [0], &nMouseButtons); else bUseMouse = ControlsReadMouse ((int *) &mouseAxis [0], &nMouseButtons); else { mouseAxis [0] = mouseAxis [1] = mouseAxis [2] = 0; nMouseButtons = 0; bUseMouse = 0; } pitchTime = headingTime = 0; memset (Controls + 1, 0, 3 * sizeof (tControlInfo)); for (i = 0; i < 3; i++) { ControlsDoKeyboard (&bSlideOn, &bBankOn, &pitchTime, &headingTime, (int *) &gameStates.input.nCruiseSpeed, i); if (bUseJoystick) ControlsDoJoystick (&bSlideOn, &bBankOn, &pitchTime, &headingTime, (int *) &gameStates.input.nCruiseSpeed, i); if (bUseMouse) ControlsDoMouse ((int *) &mouseAxis [0], nMouseButtons, &bSlideOn, &bBankOn, &pitchTime, &headingTime, (int *) &gameStates.input.nCruiseSpeed, i); Controls [0].pitchTime = Controls [1].pitchTime + Controls [2].pitchTime + Controls [3].pitchTime; Controls [0].headingTime = Controls [1].headingTime + Controls [2].headingTime + Controls [3].headingTime; Controls [0].bankTime = Controls [1].bankTime + Controls [2].bankTime + Controls [3].bankTime; if (i == 1) { ControlsDoSlideBank (bSlideOn, bBankOn, pitchTime, headingTime); } } if (gameOpts->input.bUseHotKeys) ControlsDoD2XKeys (&bSlideOn, &bBankOn, &pitchTime, &headingTime, (int *) &gameStates.input.nCruiseSpeed, i); #ifdef WIN32 if (ControlsReadTrackIR ()) ControlsDoTrackIR (); #endif if (gameStates.input.nCruiseSpeed > I2X (100)) gameStates.input.nCruiseSpeed = I2X (100); else if (gameStates.input.nCruiseSpeed < 0) gameStates.input.nCruiseSpeed = 0; if (!Controls [0].forwardThrustTime) Controls [0].forwardThrustTime = FixMul (gameStates.input.nCruiseSpeed,gameStates.input.kcPollTime) /100; #if 0 //LIMIT_CONTROLS_FPS if (nBankSensMod > 2) { Controls [0].bankTime *= 2; Controls [0].bankTime /= nBankSensMod; } #endif //----------- Clamp values between -gameStates.input.kcPollTime and gameStates.input.kcPollTime if (gameStates.input.kcPollTime > F1_0) { #if TRACE con_printf (1, "Bogus frame time of %.2f seconds\n", X2F (gameStates.input.kcPollTime)); #endif gameStates.input.kcPollTime = F1_0; } #if 0 Controls [0].verticalThrustTime /= kcFrameCount; Controls [0].sidewaysThrustTime /= kcFrameCount; Controls [0].forwardThrustTime /= kcFrameCount; Controls [0].headingTime /= kcFrameCount; Controls [0].pitchTime /= kcFrameCount; Controls [0].bankTime /= kcFrameCount; #endif KCCLAMP (Controls [0].verticalThrustTime, nMaxTurnRate); KCCLAMP (Controls [0].sidewaysThrustTime, nMaxTurnRate); KCCLAMP (Controls [0].forwardThrustTime, nMaxTurnRate); if (ControlsLimitTurnRate (bUseMouse)) { if (Controls [1].headingTime || Controls [2].headingTime) { KCCLAMP (Controls [0].headingTime, nMaxTurnRate); } if (Controls [1].pitchTime || Controls [2].pitchTime) { KCCLAMP (Controls [0].pitchTime, nMaxTurnRate / FASTPITCH); } if (Controls [1].bankTime || Controls [2].bankTime) { KCCLAMP (Controls [0].bankTime, nMaxTurnRate); } } else { KCCLAMP (Controls [0].headingTime, nMaxTurnRate); KCCLAMP (Controls [0].pitchTime, nMaxTurnRate / FASTPITCH); KCCLAMP (Controls [0].bankTime, nMaxTurnRate); } if (gameStates.render.nZoomFactor > F1_0) { int r = (gameStates.render.nZoomFactor * 100) / F1_0; Controls [0].headingTime = (Controls [0].headingTime * 100) / r; Controls [0].pitchTime = (Controls [0].pitchTime * 100) / r; Controls [0].bankTime = (Controls [0].bankTime * 100) / r; #if DBG r = (int) ((double) gameStates.render.nZoomFactor * 100.0 / (double) F1_0); HUDMessage (0, "x %d.%02d", r / 100, r % 100); #endif } // KCCLAMP (Controls [0].afterburnerTime, gameStates.input.kcPollTime); #if DBG if (gameStates.input.keys.pressed [KEY_DELETE]) memset (&Controls, 0, sizeof (tControlInfo)); #endif gameStates.input.bKeepSlackTime = 0; kcFrameCount = 0; gameStates.input.kcPollTime = 0; return 0; }
// --------------------------------------------------------------------------- // CFepUiLayoutRootCtrl::CFepUiLayoutRootCtrl // Constructor // --------------------------------------------------------------------------- // CFepUiLayoutRootCtrl::CFepUiLayoutRootCtrl(CFepUiLayout* aUiLayout): CControlGroup(aUiLayout,KRootControlId) { SetControlType(ECtrlWndBasedCtrl|ControlType()); SetMaskBkCol(KTransparentColor); }