void be_attribute::GenerateVirtual ( be_Source& source, const DDS_StdString& className ) { ostream & os = source.Stream(); be_Tab tab(source); DDS_StdString responsibility = NameToString(name()); if (fieldType) { // PURE VIRTUAL GET ATTRIBUTE os << tab << "virtual " << GetSignature(AT_Declaration, className); os << " = 0;" << nl; // PURE VIRTUAL SET ATTRIBUTE if (!readonly()) { os << tab << "virtual " << SetSignature(AT_Declaration, className, pbtrue); os << " = 0;" << nl; } } }
void SetSignatureCurrPos(struct Tracker_Windows *window){ struct WBlocks *wblock=window->wblock; int curr_realline=wblock->curr_realline; Place *place= &wblock->reallines[curr_realline]->l.p; char *signaturestring = GFX_GetString(window,NULL,"New Time Signature: >"); if(signaturestring==NULL) return; Rational rational = create_rational_from_string(signaturestring); if (rational.is_valid()==false || rational.numerator<=0 || rational.denominator<=0) return; PlayStop(); Undo_Signatures_CurrPos(window); SetSignature(wblock->block,place,rational.get_ratio()); UpdateWBlockCoordinates(window, wblock); //UpdateWBlockWidths(window, wblock); //UpdateWSignatures(window,wblock); //DrawSignatures(window,wblock,curr_realline,curr_realline); wblock->block->is_dirty = true; //WBLOCK_DrawTempoColor(window,wblock,curr_realline,wblock->num_reallines); }
VMPrimitive::VMPrimitive(VMSymbol* signature) : VMInvokable(VMPrimitiveNumberOfFields) { //the only class that explicitly does this. SetClass(load_ptr(primitiveClass)); SetSignature(signature); routine = nullptr; empty = false; }
/*! Constructs a DefaultCatalog with given signature and language and reads the catalog from disk. InitCheck() will be B_OK if catalog could be loaded successfully, it will give an appropriate error-code otherwise. */ DefaultCatalog::DefaultCatalog(const entry_ref &catalogOwner, const char *language, uint32 fingerprint) : HashMapCatalog("", language, fingerprint) { // We created the catalog with an invalid signature, but we fix that now. SetSignature(catalogOwner); status_t status; // search for catalog living in sub-folder of app's folder: node_ref nref; nref.device = catalogOwner.device; nref.node = catalogOwner.directory; BDirectory appDir(&nref); BString catalogName("locale/"); catalogName << kCatFolder << "/" << fSignature << "/" << fLanguageName << kCatExtension; BPath catalogPath(&appDir, catalogName.String()); status = ReadFromFile(catalogPath.Path()); if (status != B_OK) { // search in data folders directory_which which[] = { B_USER_DATA_DIRECTORY, B_COMMON_DATA_DIRECTORY, B_SYSTEM_DATA_DIRECTORY }; for (size_t i = 0; i < sizeof(which) / sizeof(which[0]); i++) { BPath path; if (find_directory(which[i], &path) == B_OK) { BString catalogName(path.Path()); catalogName << "/locale/" << kCatFolder << "/" << fSignature << "/" << fLanguageName << kCatExtension; status = ReadFromFile(catalogName.String()); if (status == B_OK) break; } } } if (status != B_OK) { // give lowest priority to catalog embedded as resource in application // executable, so they can be overridden easily. status = ReadFromResource(catalogOwner); } fInitCheck = status; }
LPDRIVE_INFO CreateDriveInfoStructure( void ) /*++ Routine Description: Create a DRIVE_INFO object for the supplied drive. Arguments: None Return Value: LPDRIVE_INFO - Allocates and returns a pointer to a DRIVE_INFO object --*/ { LPDRIVE_INFO DriveInfo; // // Allocate a DRIVE_INFO object. // DriveInfo = AllocateObject( DRIVE_INFO, 1 ); DbgPointerAssert( DriveInfo ); if( DriveInfo == NULL ) { return NULL; } // // Initialize buffers with empty strings. // ZeroMemory( DriveInfo, sizeof(DRIVE_INFO) ); // // Set the signature // SetSignature( DriveInfo ); // // Mark Structure as invalid since it is not filled out yet. // DriveInfo->ValidDetails = FALSE; return DriveInfo; }
void Oauth::GetHeader(const wchar_t* cmd,const wchar_t* url,PairDataArray* res){ wstring key,data; SetTimeStamp(); SetNonce(); SetSignature(cmd,url); key=TEXT("Authorization"); GetOauthJoin(&data,','); data.insert(0,TEXT("OAuth ")); res->Insert(key.c_str(),data.c_str()); return; }
void CTrack_Player2::SetInfo(CTrack_Player* CTrack_Player) { mpCTrack_Player = CTrack_Player; // mfTempo = 60; SetSignature(giSignature4_4); miLast_Grid_Line_Allocated = 0; mpKSPlugIn = dynamic_cast<CKSPlugIn*>(GetPlugIn()); gpDSPEngine->SetRegionCallback(dynamic_cast<IRegionCallback*>(this)); }
void CMainFrame::handleVCard( const JID& jid, const VCard* vcard ) { GetContext()->m_VCards[jid]=*vcard; if(!m_pBuddyList) return; auto buddy=m_pBuddyList->FindBuddyItem(jid); if(!buddy) return; buddy->SetName(utf8dec(vcard->nickname())); buddy->SetSignature(utf8dec(vcard->desc())); GetContext()->GetHeaderManager().UpdateHeader(jid,vcard->photo().binval); }
int addSignature(int numerator, int denominator, int line,int counter,int dividor, int blocknum) { struct WBlocks *wblock=getWBlockFromNum(-1,blocknum); if(wblock==NULL) { RError("unknown block(%p)",blocknum); return -1; } Place dasplace = place(line,counter,dividor); struct Signatures *signature = SetSignature(wblock->block,&dasplace,ratio(numerator, denominator)); wblock->block->is_dirty = true; return ListFindElementPos3(&wblock->block->signatures->l,&signature->l); }
void be_attribute::GenerateSetStub (be_ClientImplementation & source) { DDS_StdString setArg ("_nval_"); be_AttStubGenerator stub ( enclosingScope, setOpKey, setOpKey, SetSignature ( AT_Implementation, StubClassname(), TRUE, setArg ), fieldType, pbtrue ); stub.Generate (source); }
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); }
void be_attribute::GenerateImpureRequestCall(be_ClientImplementation& source) { be_AttStubGenerator getStub ( enclosingScope, getOpKey, LocalName (), GetSignature (AT_Implementation, InterfaceBasename (), pbfalse), fieldType, FALSE ); getStub.Generate(source); if (!readonly()) { DDS_StdString setArg ("_nval_"); DDS_StdString setSignature = SetSignature ( AT_Implementation, InterfaceBasename(), FALSE, setArg ); be_AttStubGenerator setStub ( enclosingScope, setOpKey, LocalName(), setSignature, fieldType, pbtrue ); setStub.Generate(source); } }
int addSignature(int numerator, int denominator, Place place, int blocknum) { struct Tracker_Windows *window; struct WBlocks *wblock=getWBlockFromNumA(-1,&window,blocknum); if(wblock==NULL) { GFX_Message(NULL, "unknown block(%p)",blocknum); return -1; } if (!PlaceLegal(wblock->block, &place)) { GFX_Message(NULL, "Place %s is not legal", PlaceToString(&place)); return -1; } ADD_UNDO(Signatures_CurrPos(window)); struct Signatures *signature = SetSignature(wblock->block,&place,ratio(numerator, denominator)); window->must_redraw=true; return ListFindElementPos3(&wblock->block->signatures->l,&signature->l); }
// Note: This is in an ini file void Object::SetBasset(short basset) { m_CreateInfo.BaseAsset = basset; //get the radius from SSMetroid's radii parse system m_ObjectRadius = g_ServerMgr->BAssetRadii()->GetRadius(basset); //NB some of the sizes in the XML file appear to be incorrect - //I think we need to parse the 'RadiusAdjust' if it is positive //Also we may need to manually adjust some of the radii too //consider putting them into the database and allowing people //to edit them via the Client itself //see if this basset is a legal 3d asset AssetData *asset = g_ServerMgr->AssetList()->GetAssetData(basset); char *cat_name = (0); if (asset) cat_name = asset->m_CatName; if ((cat_name && (0 == strcmp(cat_name, "Effects") || 0 == strcmp(cat_name, "Icons") || 0 == strcmp(cat_name, "Backgrounds") )) || !cat_name) { //make this stick out like a sore thumb m_CreateInfo.BaseAsset = 3000; SetSignature(100000.0f); SetRadarRange(100000.0f); } #if 0 switch (m_CreateInfo.BaseAsset) { //planets case 461: m_ObjectRadius = 105900.0f; break; case 466: m_ObjectRadius = 35350.0f; break; case 475: m_ObjectRadius = 35300.0f; break; case 478: m_ObjectRadius = 105900.0f; break; case 1224: m_ObjectRadius = 120210.0f; break; case 1291: m_ObjectRadius = 35450.0f; break; case 1412: m_ObjectRadius = 4900.0f; break; case 1437: m_ObjectRadius = 40350.0f; break; //asteroids/moons case 253: m_ObjectRadius = 5000.0f; break; case 254: m_ObjectRadius = 8500.0f; break; case 252: m_ObjectRadius = 5230.0f; break; case 251: //metis m_ObjectRadius = 9150.0f; break; case 406: //RD base in Jupiter m_ObjectRadius = 2100.0f; break; //stargates case 48: case 63: case 142: case 1205: case 1207: case 1314: case 1461: case 1463: case 1882: m_ObjectRadius = 1800.0f; //Do the different types of gate have different radii? break; //stations case 47: m_ObjectRadius = 3450.0f; break; case 123: m_ObjectRadius = 5100.0f; break; case 128: m_ObjectRadius = 5100.0f; break; case 137: m_ObjectRadius = 3110.0f; break; case 166: m_ObjectRadius = 2340.0f; break; case 312: m_ObjectRadius = 4465.0f; break; case 372: m_ObjectRadius = 4200.0f; break; case 373: m_ObjectRadius = 2400.0f; break; case 375: m_ObjectRadius = 2725.0f; break; case 377: m_ObjectRadius = 3900.0f; break; case 379: m_ObjectRadius = 3680.0f; break; case 380: m_ObjectRadius = 11500.0f; break; case 404: m_ObjectRadius = 5580.0f; break; case 405: m_ObjectRadius = 4670.0f; break; case 407: m_ObjectRadius = 6260.0f; break; case 408: m_ObjectRadius = 9160.0f; break; case 413: m_ObjectRadius = 6050.0f; break; case 457: m_ObjectRadius = 23750.0f; break; case 496: m_ObjectRadius = 12000.0f; break; case 1031: m_ObjectRadius = 2350.0f; break; case 1035: m_ObjectRadius = 2480.0f; break; case 1040: m_ObjectRadius = 20100.0f; break; case 1217: m_ObjectRadius = 6150.0f; break; case 1218: m_ObjectRadius = 6400.0f; break; case 1220: m_ObjectRadius = 5550.0f; break; case 1221: m_ObjectRadius = 6200.0f; break; case 1262: m_ObjectRadius = 18625.0f; break; case 1316: m_ObjectRadius = 10300.0f; break; case 1525: m_ObjectRadius = 1870.0f; break; case 1529: m_ObjectRadius = 7050.0f; break; case 1997: m_ObjectRadius = 8555.0f; break; case 2206: m_ObjectRadius = 11250.0f; break; case 2330: m_ObjectRadius = 10600.0f; break; case 1216: m_ObjectRadius = 15850.0f; //Joves Fury break; //MOBs case 398: m_ObjectRadius = 1000.0f; break; case 2004: //tengu case 2005: m_ObjectRadius = 980.0f; break; default: break; } #endif }
LRESULT ClbWndProc( IN HWND hWnd, IN UINT message, IN WPARAM wParam, IN LPARAM lParam ) /*++ Routine Description: This function is the window procedure for the Clb custom control. Arguments: Standard window procedure parameters. Return Value: LRESULT - dependent on the supplied message. --*/ { BOOL Success; LPCLB_INFO ClbInfo; if( message == WM_NCCREATE ) { LONG Long; // // Save the original styles. // Long = SetWindowLong( hWnd, GWL_USERDATA, (( LPCREATESTRUCT ) lParam )->style ); DbgAssert( Long == 0 ); // // Get rid of any styles that are uninteresting to the Clb. // SetWindowLong( hWnd, GWL_STYLE, (( LPCREATESTRUCT ) lParam )->style & CLBS_CLB ); return TRUE; } if( message == WM_CREATE ) { // // Assert that there is no prior per window information associated // with this Clb. // DbgAssert( RestoreClbInfo( hWnd ) == NULL ); // // Restore the original styles. // (( LPCREATESTRUCT ) lParam )->style = GetWindowLong( hWnd, GWL_USERDATA ); // // Allocate a CLB_INFO object for this Clb and initialize the Clb // relevant fields. // ClbInfo = AllocateObject( CLB_INFO, 1 ); DbgPointerAssert( ClbInfo ); // // Set the number of columns to zero so that remainder of creation // understands the state of the Clb. // ClbInfo->Columns = 0; // // Create the header portion of the Clb. // Success = CreateHeader( hWnd, ClbInfo, ( LPCREATESTRUCT ) lParam ); DbgAssert( Success ); // // Create the list box portion of the Clb. // Success = CreateListBox( hWnd, ClbInfo, ( LPCREATESTRUCT ) lParam ); DbgAssert( Success ); // // Adjust the column number, widths based on the heading text. // Success = AdjustClbHeadings( hWnd, ClbInfo, (( LPCREATESTRUCT ) lParam )->lpszName ); DbgAssert( Success ); // // Everything was succesfully created so set the Clb's signature // and save it away as part of the per window data. // SetSignature( ClbInfo ); SaveClbInfo( ClbInfo ); return 0; } // // Get the ClbInfo object for this Clb and make sure that its already // been created i.e. WM_CREATE was already executed and thereby initialized // and saved a ClbInfo object. // ClbInfo = RestoreClbInfo( hWnd ); if( ClbInfo != NULL ) { // // Validate that this really is a ClbInfo object. // DbgAssert( CheckSignature( ClbInfo )); switch( message ) { case WM_DESTROY: { // // Delete the font used in the list box. // Success = DeleteObject( ClbInfo->hFontListBox ); DbgAssert( Success ); // // Delete the array of right habd edges. // Success = FreeObject( ClbInfo->Right ); DbgAssert( Success ); // // Delete the CLB_INFO object for this window. // Success = FreeObject( ClbInfo ); DbgAssert( Success ); SaveClbInfo ( ClbInfo ); return 0; } case WM_PAINT: { PAINTSTRUCT ps; RECT Rect; POINT Points[ 2 ]; HDC hDC; HPEN hPen; hDC = BeginPaint( hWnd, &ps ); DbgAssert( hDC == ps.hdc ); Success = GetClientRect( hWnd, &Rect ); DbgAssert( Success ); Points[ 0 ].x = 0; Points[ 0 ].y = ClbInfo->HeaderHeight + 1; Points[ 1 ].x = Rect.right - Rect.left; Points[ 1 ].y = ClbInfo->HeaderHeight + 1; hPen = GetStockObject( BLACK_PEN ); DbgHandleAssert( hPen ); hPen = SelectObject( hDC, hPen ); Success = Polyline( hDC, Points, NumberOfEntries( Points )); DbgAssert( Success ); hPen = SelectObject( hDC, hPen ); Success = DeleteObject( hPen ); DbgAssert( Success ); Success = EndPaint( hWnd, &ps ); DbgAssert( Success ); return 0; } case WM_COMMAND: switch( LOWORD( wParam )) { case ID_LISTBOX: switch( HIWORD( wParam )) { case LBN_DBLCLK: case LBN_KILLFOCUS: case LBN_SELCHANGE: { // // These messages come to ClbWndProc because it is the parent // of the list box, but they are really intended for the parent // of the Clb. // HWND hWndParent; // // Forward the message to the Clb's parent if it has a parent. // hWndParent = GetParent( hWnd ); DbgHandleAssert( hWndParent ); if( hWndParent != NULL ) { // // Replace the control id and handle with the Clb's. // LOWORD( wParam ) = GetDlgCtrlID( hWnd ); DbgAssert( LOWORD( wParam ) != 0 ); lParam = ( LPARAM ) hWnd; // // Forward the message... // return SendMessage( hWndParent, message, wParam, lParam ); } } } break; } break; // // Forward to listbox. // case LB_GETCURSEL: case LB_SETCURSEL: case LB_FINDSTRING: case LB_GETITEMDATA: case LB_RESETCONTENT: case WM_CHAR: case WM_GETDLGCODE: case WM_KILLFOCUS: return SendMessage( ClbInfo->hWndListBox, message, wParam, lParam ); case WM_SETFOCUS: { SetFocus( ClbInfo->hWndListBox ); return 0; } case WM_COMPAREITEM: { // // This message comes to ClbWndProc because it is the parent // of the list box, but is really intended for the parent // of the Clb. // HWND hWndParent; // // Forward the message to the Clb's parent if it has a parent. // hWndParent = GetParent( hWnd ); DbgHandleAssert( hWndParent ); if( hWndParent != NULL ) { int ControlId; LPCOMPAREITEMSTRUCT lpcis; lpcis = ( LPCOMPAREITEMSTRUCT ) lParam; ControlId = GetDlgCtrlID( hWnd ); DbgAssert( ControlId != 0 ); // // Modify the COMPAREITEMSTRUCT so that it refers to the Clb. // lpcis->CtlID = ControlId; lpcis->hwndItem = hWnd; // // Forward the message... // return SendMessage( hWndParent, message, ( WPARAM ) ControlId, lParam ); } break; } case WM_DELETEITEM: { LPDELETEITEMSTRUCT lpditms; LPCLB_ROW ClbRow; DWORD i; DbgAssert( wParam == ID_LISTBOX ); // // Retrieve the pointer to the DELETEITEMSTRUCT. // lpditms = ( LPDELETEITEMSTRUCT ) lParam; DbgAssert(( lpditms->CtlType == ODT_LISTBOX ) &&( lpditms->CtlID == ID_LISTBOX )); // // If there is no data, just return. // if( lpditms->itemData == 0 ) { return TRUE; } // // Retrieve the CLB_ROW object for this row. // ClbRow = ( LPCLB_ROW ) lpditms->itemData; // // For each column delete the string. // for( i = 0; i < ClbInfo->Columns; i++ ) { // // Strings were copied with _tcsdup so they must be // freed with free( ). // free( ClbRow->Strings[ i ].String ); } // // Free the CLB_STRING object. // Success = FreeObject( ClbRow->Strings ); DbgAssert( Success ); // // Free the CLB_ROW object. // Success = FreeObject( ClbRow ); DbgAssert( Success ); return TRUE; } case WM_DRAWITEM: { LPDRAWITEMSTRUCT lpdis; BOOL DrawFocus; DbgAssert( wParam == ID_LISTBOX ); // // Retrieve the pointer to the DRAWITEMSTRUCT. // lpdis = ( LPDRAWITEMSTRUCT ) lParam; DbgAssert(( lpdis->CtlType == ODT_LISTBOX ) &&( lpdis->CtlID == ID_LISTBOX )); // // If there is no data, just return. // if( lpdis->itemData == 0 ) { return TRUE; } if( lpdis->itemAction & ( ODA_DRAWENTIRE | ODA_SELECT )) { DWORD i; LPCLB_ROW ClbRow; COLORREF TextColor; COLORREF BkColor; // // Retrieve the CLB_ROW object for this row. // ClbRow = ( LPCLB_ROW ) lpdis->itemData; // // If the item is selected, set the selection colors. // if( lpdis->itemState & ODS_SELECTED ) { BkColor = COLOR_HIGHLIGHT; TextColor = COLOR_HIGHLIGHTTEXT; } else { BkColor = COLOR_WINDOW; TextColor = COLOR_WINDOWTEXT; } BkColor = GetSysColor( BkColor ); TextColor = GetSysColor( TextColor ); BkColor = SetBkColor( lpdis->hDC, BkColor ); DbgAssert( BkColor != CLR_INVALID ); TextColor = SetTextColor( lpdis->hDC, TextColor ); DbgAssert( TextColor != CLR_INVALID ); // // For each column display the text. // for( i = 0; i < ClbInfo->Columns; i++ ) { RECT ClipOpaqueRect; int x; int Left; UINT GdiErr; // // Depending on the format, adjust the alignment reference // point (x) and the clipping rectangles left edge so that // there are five pixels between each column. // switch( ClbRow->Strings[ i ].Format ) { case CLB_LEFT: if( i == 0 ) { x = 2; } else { x = ClbInfo->Right[ i - 1 ] + 2; } Left = x - 2; break; case CLB_RIGHT: if( i == 0 ) { Left = 0; } else { Left = ClbInfo->Right[ i - 1 ]; } x = ClbInfo->Right[ i ] - 3; break; default: DbgAssert( FALSE ); } // // Set the format for this column. // GdiErr = SetTextAlign( lpdis->hDC, ClbRow->Strings[ i ].Format | TA_TOP ); DbgAssert( GdiErr != GDI_ERROR ); // // Clip each string to its column width less two pixels // (for asthetics). // Success = SetRect( &ClipOpaqueRect, Left, lpdis->rcItem.top, ClbInfo->Right[ i ], lpdis->rcItem.bottom ); DbgAssert( Success ); Success = ExtTextOut( lpdis->hDC, x, lpdis->rcItem.top, ETO_CLIPPED | ETO_OPAQUE, &ClipOpaqueRect, ClbRow->Strings[ i ].String, ClbRow->Strings[ i ].Length, NULL ); DbgAssert( Success ); // // If the item has the focus, draw the focus rectangle. // DrawFocus = lpdis->itemState & ODS_FOCUS; } } else { // // If the Clb has the focus, display a focus rectangle // around the selected item. // DrawFocus = lpdis->itemAction & ODA_FOCUS; } // // If needed, toggle the focus rectangle. // if( DrawFocus ) { Success = DrawFocusRect( lpdis->hDC, &lpdis->rcItem ); DbgAssert( Success ); } return TRUE; } case WM_NOTIFY: { HD_NOTIFY * lpNot; HD_ITEM *pHDI; lpNot = (HD_NOTIFY *)lParam; pHDI = lpNot->pitem; switch( lpNot->hdr.code) { static DRAW_ERASE_LINE DrawEraseLine; static HPEN hPen; static HDC hDCClientListBox; HD_ITEM hdi; UINT iRight; UINT i; RECT ClientRectHeader; case HDN_BEGINTRACK: { RECT ClientRectListBox; // // Get thd HDC for the list box. // hDCClientListBox = GetDC( ClbInfo->hWndListBox ); DbgHandleAssert( hDCClientListBox ); // // Create the pen used to display the drag position and // select it into the in list box client area DC. Also set // the ROP2 code so that drawing with the pen twice in the // same place will erase it. This is what allows the // line to drag. // hPen = CreatePen( PS_DOT, 1, RGB( 255, 255, 255 )); DbgHandleAssert( hPen ); hPen = SelectObject( hDCClientListBox, hPen ); SetROP2( hDCClientListBox, R2_XORPEN ); // // Set up the DRAW_ERASE_LINE structure so that the drag line is // drawn from the top to the bottom of the list box at the // current drag position. // Success = GetClientRect( ClbInfo->hWndListBox, &ClientRectListBox ); DbgAssert( Success ); // // Draw the initial drag line from the top to the bottom // of the list box equivalent with the header edge grabbed // by the user. // DrawEraseLine.Draw.Src.x = ClbInfo->Right[ pHDI->cxy ]; DrawEraseLine.Draw.Src.y = 0; DrawEraseLine.Draw.Dst.x = ClbInfo->Right[ pHDI->cxy ]; DrawEraseLine.Draw.Dst.y = ClientRectListBox.bottom - ClientRectListBox.top; Success = DrawLine( hDCClientListBox, &DrawEraseLine ); DbgAssert( Success ); return 0; } case HDN_TRACK: { //DWORD Columns; // // Get new drag position. // iRight = 0; hdi.mask = HDI_WIDTH; for( i = 0; i < ClbInfo->Columns - 1; i++ ) { if (i != (UINT)lpNot->iItem) { Header_GetItem(ClbInfo->hWndHeader, i, &hdi); } else { hdi.cxy = pHDI->cxy; } iRight += hdi.cxy; ClbInfo->Right[i] = iRight; } GetClientRect( ClbInfo->hWndHeader, &ClientRectHeader ); ClbInfo->Right[i] = ClientRectHeader.right; // // Erase the old line and draw the new one at the new // drag position. // Success = RedrawVerticalLine( hDCClientListBox, ClbInfo->Right[lpNot->iItem], &DrawEraseLine ); DbgAssert( Success ); return 0; } case HDN_ENDTRACK: // // Replace the old pen and delete the one created // during HBN_BEGINDRAG. // hPen = SelectObject( hDCClientListBox, hPen ); Success = DeleteObject( hPen ); DbgAssert( Success ); // // Release the DC for the list box. // Success = ReleaseDC( ClbInfo->hWndListBox, hDCClientListBox ); DbgAssert( Success ); Success = RedrawWindow( hWnd, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN ); DbgAssert( Success ); return 0; } break; } case WM_SETTEXT: // // Adjust the column number and widths based on the heading text. // Success = AdjustClbHeadings( hWnd, ClbInfo, ( LPCWSTR ) lParam ); DbgAssert( Success ); return Success; case WM_SIZE: { HDWP hDWP; LONG Width; LONG Height; LONG Style; LONG VScrollWidth; Width = LOWORD( lParam ); Height = HIWORD( lParam ); hDWP = BeginDeferWindowPos( 2 ); DbgHandleAssert( hDWP ); // // Retrieve the list box's styles. // Style = GetWindowLong( ClbInfo->hWndListBox, GWL_STYLE ); // // If the list box has a vertical scroll bar compute its // width so that the header window's width can be adjusted // appropriately. // VScrollWidth = ( Style & WS_VSCROLL ) ? GetSystemMetrics( SM_CXVSCROLL ) + ( GetSystemMetrics( SM_CXBORDER ) * 2 ) : 0; // // Size the header window to the width of the Clb and its // default / original height. // hDWP = DeferWindowPos( hDWP, ClbInfo->hWndHeader, NULL, 0, 0, Width - VScrollWidth, ClbInfo->HeaderHeight, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER ); DbgHandleAssert( hDWP ); // // If the list box has a vertical scroll bar, bump the width // and height by two so that its border overwrites the Clb // border. This eliminates a double border (and a gap) between // the right and bottom edges of the scroll bar and the Clb. // if( Style & WS_VSCROLL ) { Height += 2; Width += 2; } // // Size the list box so that it is the size of the Clb less // the height of the header window less the height of the // border. // hDWP = DeferWindowPos( hDWP, ClbInfo->hWndListBox, NULL, 0, 0, Width, Height - ClbInfo->HeaderHeight - 3, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER ); DbgHandleAssert( hDWP ); Success = EndDeferWindowPos( hDWP ); DbgAssert( Success ); break; } } } return DefWindowProc( hWnd, message, wParam, lParam ); }
HRESULT CmineIGC::Initialize(ImissionIGC* pMission, Time now, const void* data, int dataSize) { ZRetailAssert (data && (dataSize > sizeof(DataMineBase))); { DataMineBase* dataMineBase = (DataMineBase*)data; if ((dataMineBase->exportF) && ((DataMineExport*)dataMineBase)->createNow) { m_time0 = now; } else { m_time0 = pMission->GetIgcSite()->ClientTimeFromServerTime(dataMineBase->time0); } TmodelIGC<ImineIGC>::Initialize(pMission, now, data, dataSize); IshipIGC* pshipLauncher; IclusterIGC* pcluster; DataMineTypeIGC* dataMineType; if (dataMineBase->exportF) { assert (dataSize >= sizeof(DataMineExport)); DataMineExport* dataMineExport = (DataMineExport*)dataMineBase; m_mineType = (ImineTypeIGC*)(pMission->GetExpendableType(dataMineExport->minetypeID)); assert (m_mineType); assert (m_mineType->GetObjectType() == OT_mineType); pcluster = pMission->GetCluster(dataMineExport->clusterID); assert (m_mineType); dataMineType = (DataMineTypeIGC*)(m_mineType->GetData()); pshipLauncher = pMission->GetShip(dataMineExport->launcherID); SetSide(pMission->GetSide(dataMineExport->sideID)); m_fraction = dataMineExport->fraction; } else { assert (dataSize == sizeof(DataMineIGC)); DataMineIGC* dataMine = (DataMineIGC*)dataMineBase; m_mineType = dataMine->pminetype; pcluster = dataMine->pcluster; assert (m_mineType); assert (m_mineType->GetObjectType() == OT_mineType); dataMineType = (DataMineTypeIGC*)(m_mineType->GetData()); pshipLauncher = dataMine->pshipLauncher; SetSide(dataMine->psideLauncher); m_fraction = 1.0f; } if (pshipLauncher && (dataMineType->launcherDef.price == 0)) { m_launcher = pshipLauncher; m_launcher->AddRef(); } assert (GetSide()); assert (pcluster); m_mineType->AddRef(); //Load the model for the mine LoadMine(dataMineType->textureName, 1.0f, dataMineType->radius, dataMineType->iconName, c_mtSeenBySide | c_mtPredictable | c_mtHitable | c_mtStatic); SetRadius(dataMineType->radius); SetSignature(dataMineType->signature); SetSecondaryName(dataMineType->launcherDef.name); { //lifespan == 0 => immortal mine that can hit until it gets terminated on the next update; this is bad assert (dataMineType->lifespan > 0.0f); m_timeExpire = m_time0 + dataMineType->lifespan; assert (m_timeExpire != m_time0); } SetMass(0.0f); m_mineID = dataMineBase->mineID; SetPosition(dataMineBase->p0); SetCluster(pcluster); pMission->AddMine(this); } return S_OK; }
void Oauth::SetHeader(const wchar_t* cmd,const wchar_t* url){ Init(); SetTimeStamp(); SetNonce(); SetSignature(cmd,url); }
BOOL InitializeSystemResourceLists( IN HREGKEY hRegKey ) /*++ Routine Description: InitializeSystemResourceLists recursively walks the resource map in the registry and builds the SYSTEM_RESOURCE lists. This is a data structure that links all resources of the same type together, as well as linking all resources belonging to a specific device/driver together. Lastly each resource is independently linked to the device/driver that owns it. This leds to a 'mesh' of linked lists with back pointers to the owning device/driver object. Arguments: hRegKey - Supplies a handle to a REGKEY object where the search is to continue. Return Value: BOOL - returns TRUE if the resource lists are succesfully built. --*/ { BOOL Success; HREGKEY hRegSubkey; DbgHandleAssert( hRegKey ); // // While there are still more device/driver resource descriptors... // while( QueryNextValue( hRegKey )) { PCM_FULL_RESOURCE_DESCRIPTOR FullResource; LPSYSTEM_RESOURCES SystemResource; LPDEVICE Device; LPTSTR Extension; DWORD Count; DWORD i; DWORD j; // // Based on the type of key, prepare to walk the list of // RESOURCE_DESCRIPTORS (the list may be one in length). // if( hRegKey->Type == REG_FULL_RESOURCE_DESCRIPTOR ) { Count = 1; FullResource = ( PCM_FULL_RESOURCE_DESCRIPTOR ) hRegKey->Data; } else if( hRegKey->Type == REG_RESOURCE_LIST ) { Count = (( PCM_RESOURCE_LIST ) hRegKey->Data )->Count; FullResource = (( PCM_RESOURCE_LIST ) hRegKey->Data )->List; } else { DbgAssert( FALSE ); continue; } // // Allocate a DEVICE object. // Device = AllocateObject( DEVICE, 1 ); DbgPointerAssert( Device ); if( Device == NULL ) { Success = DestroySystemResourceLists( _SystemResourceLists ); DbgAssert( Success ); return FALSE; } // // Allocate a buffer for the device/driver name. The maximum size of // the name will be the number of characters in both the key and // value name. // Device->Name = AllocateObject( TCHAR, _tcslen( hRegKey->Name ) + _tcslen( hRegKey->ValueName ) + sizeof( TCHAR ) ); DbgPointerAssert( Device->Name ); if( Device->Name == NULL ) { Success = DestroySystemResourceLists( _SystemResourceLists ); DbgAssert( Success ); return FALSE; } // // Rationalize the device name such that it is of the form Device.Raw // or Device.Translated. // Device->Name[ 0 ] = TEXT( '\0' ); if( ( _tcsnicmp( hRegKey->ValueName, TEXT( ".Raw" ), 4 ) == 0 ) || ( _tcsnicmp( hRegKey->ValueName, TEXT( ".Translated" ), 11 ) == 0 )) { _tcscpy( Device->Name, hRegKey->Name ); } _tcscat( Device->Name, hRegKey->ValueName ); // // Based on the device name, determine if the resource descriptors // should be added to the RAW or TRANSLATED lists. // if( Extension = _tcsstr( Device->Name, TEXT( ".Raw" ))) { SystemResource = &_SystemResourceLists[ RAW ]; } else if( Extension = _tcsstr( Device->Name, TEXT( ".Translated" ))) { SystemResource = &_SystemResourceLists[ TRANSLATED ]; } else { DbgAssert( FALSE ); Success = DestroySystemResourceLists( _SystemResourceLists ); DbgAssert( Success ); return FALSE; } // // Strip off the extension (.Raw or .Translated) from the device name. // Device->Name[ Extension - Device->Name ] = TEXT( '\0' ); // // Set the signature in the DEVICE object. // SetSignature( Device ); // // If the DEVICE object list is empty, add the device to the beginning // of the list else add it to the end of the list. // if( SystemResource->DeviceHead == NULL ) { SystemResource->DeviceHead = Device; SystemResource->DeviceTail = Device; } else { LPDEVICE ExistingDevice; // // See if the DEVICE object is already in the list. // ExistingDevice = SystemResource->DeviceHead; while( ExistingDevice ) { if( _tcsicmp( ExistingDevice->Name, Device->Name ) == 0 ) { break; } ExistingDevice = ExistingDevice->Next; } // // If the DEVICE object is not already in the list, add it else // free the DEICE object. // if( ExistingDevice == NULL ) { SystemResource->DeviceTail->Next = Device; SystemResource->DeviceTail = Device; } else { Success = FreeObject( Device ); DbgAssert( Success ); } } // // NULL terminate the DEVICE object list. // SystemResource->DeviceTail->Next = NULL; // // For each CM_FULL_RESOURCE DESCRIPTOR in the current value... // for( i = 0; i < Count; i++ ) { PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialResourceDescriptor; // // For each CM_PARTIAL_RESOURCE_DESCRIPTOR in the list... // for( j = 0; j < FullResource->PartialResourceList.Count; j++ ) { LPRESOURCE_DESCRIPTOR ResourceDescriptor; LPRESOURCE_DESCRIPTOR* Head; LPRESOURCE_DESCRIPTOR* Tail; // // Allocate a RESOURCE_DESCRIPTOR object. // ResourceDescriptor = AllocateObject( RESOURCE_DESCRIPTOR, 1 ); DbgPointerAssert( ResourceDescriptor ); if( ResourceDescriptor == NULL ) { Success = DestroySystemResourceLists( _SystemResourceLists ); DbgAssert( Success ); return FALSE; } // // Get a pointer to the current CM_PARTIAL_RESOURCE_DESCRIPTOR // in the current CM_FULLRESOURCE_DESCRIPTOR in the list. // PartialResourceDescriptor = &( FullResource[ i ].PartialResourceList.PartialDescriptors[ j ]); // // Based on the resource type grab the pointers to the head and // tail of the appropriate list. // switch( PartialResourceDescriptor->Type ) { case CmResourceTypePort: Head = &SystemResource->PortHead; Tail = &SystemResource->PortTail; break; case CmResourceTypeInterrupt: Head = &SystemResource->InterruptHead; Tail = &SystemResource->InterruptTail; break; case CmResourceTypeMemory: Head = &SystemResource->MemoryHead; Tail = &SystemResource->MemoryTail; break; case CmResourceTypeDma: Head = &SystemResource->DmaHead; Tail = &SystemResource->DmaTail; break; case CmResourceTypeDeviceSpecific: // // Since device specific data is not be collected, free the // associated RESOURCCE_DESCRIPTOR object. // Success = FreeObject( ResourceDescriptor ); DbgAssert( Success ); break; default: DbgPrintf(( L"Winmsd : Unknown PartialResourceDescriptor->Type == %1!d!\n", PartialResourceDescriptor->Type )); continue; } // // If the list is empty add the RESOURCE_DESCRIPTOR object to // the beginning of the list, else add it to the end. // if( *Head == NULL ) { *Head = ResourceDescriptor; *Tail = ResourceDescriptor; } else { ( *Tail )->NextSame = ResourceDescriptor; *Tail = ResourceDescriptor; } // // NULL terminate the list. // ( *Tail )->NextSame = NULL; // // Make a copy of the actual resource descriptor data. // CopyMemory( &ResourceDescriptor->CmResourceDescriptor, PartialResourceDescriptor, sizeof( CM_PARTIAL_RESOURCE_DESCRIPTOR ) ); // // Note the owner (device/driver) of this resource descriptor. // ResourceDescriptor->Owner = SystemResource->DeviceTail; // // The RESOURCE_DESCRIPTOR is complete so set its signature. // SetSignature( ResourceDescriptor ); // // Add the RESOURCE_DESCRIPTOR to the list of resources owned // by the current DEVICE. // if( SystemResource->DeviceTail->ResourceDescriptorHead == NULL ) { SystemResource->DeviceTail->ResourceDescriptorHead = ResourceDescriptor; SystemResource->DeviceTail->ResourceDescriptorTail = ResourceDescriptor; } else { SystemResource->DeviceTail->ResourceDescriptorTail->NextDiff = ResourceDescriptor; SystemResource->DeviceTail->ResourceDescriptorTail = ResourceDescriptor; } // // NULL terminate the list. // SystemResource->DeviceTail->ResourceDescriptorTail->NextDiff = NULL; } // // Get the next CM_FULL_RESOURCE_DESCRIPTOR from the list. // FullResource = ( PCM_FULL_RESOURCE_DESCRIPTOR )( PartialResourceDescriptor + 1 ); } } // // Traverse the list of keys in the resource descriptor portion of the // registry and continue building the lists. // while(( hRegSubkey = QueryNextSubkey( hRegKey )) != NULL ) { Success = InitializeSystemResourceLists( hRegSubkey ); DbgAssert( Success ); if( Success == FALSE ) { Success = DestroySystemResourceLists( _SystemResourceLists ); DbgAssert( Success ); return FALSE; } Success = CloseRegistryKey( hRegSubkey ); DbgAssert( Success ); if( Success == FALSE ) { Success = DestroySystemResourceLists( _SystemResourceLists ); DbgAssert( Success ); return FALSE; } } // // Set the signatures in both of the fully initialized lists. // SetSignature( &_SystemResourceLists[ RAW ]); SetSignature( &_SystemResourceLists[ TRANSLATED ]); return TRUE; }
void CTrack_Player2::HandleMsg(SMsg* pMsg) { switch(pMsg->iOpcode) { case Msg_Stack_Tracks:{ STrack_Stack sData = *(STrack_Stack*)pMsg->pDataIn; Stack_Tracks(sData); SanitizeScrollPaneAreaSize_Y(); // Update_Graphic(); break; } case Msg_Resize: { SanitizeScrollPaneAreaSize_Y(); Draw_Grid(); Update_Graphic(); break; } case Msg_Set_Grid: { Update_Zoom(); Draw_Grid(); Update_Graphic(); break; } case MsgGUIData: { SGUIData sData = *(SGUIData*)pMsg->pDataIn; switch( sData.iID){ case giParamID_Zoom: { Update_Zoom(); // Snap_To_Grid(); Draw_Grid(); Update_Graphic(); break; } case giParamID_Grid: { Draw_Grid(); break; } default: break; } break; } case MsgGlobalData: { SGlobalData sData = *(SGlobalData*)pMsg->pDataIn; switch( sData.iID){ case giParamID_KS_Tempo: { // mfTempo = (tfloat32)sData.iVal/ 10.0f; Update_Zoom(); Draw_Grid(); Update_Graphic(); break; } case giParamID_KS_Time_Signature: { SetSignature( sData.iVal); Update_Zoom(); Draw_Grid(); Update_Graphic(); break; } default: break; } break; } case Msg_Delete_All_Regions:{ STrackData sData = *(STrackData*)pMsg->pDataIn; mppTrack[sData.iTrack]->Delete_All_Regions(); break; } case Msg_Track_MouseDrop:{ tint32 iTrack = *(tint32*)pMsg->pDataIn; mppTrack[iTrack]->Handle_Mouse_Drop(ge::SPos(128,0)); break; } case Msg_Track_MouseDrag:{ tint32 iTrack = *(tint32*)pMsg->pDataIn; mppTrack[iTrack]->Handle_Drag_Region(ge::SPos(128,0)); break; } case Msg_Reset_Update_Play_Head_Size_Y:{ // Put playhead in front mpPane->RemoveControl(mpPlay_Line); mpPane->AddControl(mpPlay_Line, ge::SPos(0, 0)); // tint32 iSize = *(tint32*)pMsg->pDataIn; // Set_Play_Head_Size(iSize + 54); break; } } }
///////////////////////////////////////////////////////////////////////////// // CasteroidIGC HRESULT CasteroidIGC::Initialize(ImissionIGC* pMission, Time now, const void* data, int dataSize) { ZeroMemory(&m_builderseensides, sizeof(bool) * c_cSidesMax); //Imago 8/10 TmodelIGC<IasteroidIGC>::Initialize(pMission, now, data, dataSize); ZRetailAssert (data && (dataSize == sizeof(DataAsteroidIGC))); { DataAsteroidIGC* dataAsteroid = (DataAsteroidIGC*)data; m_asteroidDef = dataAsteroid->asteroidDef; IclusterIGC* cluster = pMission->GetCluster(dataAsteroid->clusterID); ZRetailAssert (cluster); { HRESULT rc = Load(0, m_asteroidDef.modelName, m_asteroidDef.textureName, m_asteroidDef.iconName, c_mtStatic | c_mtHitable | c_mtDamagable | c_mtSeenBySide | c_mtPredictable); assert (SUCCEEDED(rc)); SetRadius((float)m_asteroidDef.radius); SetPosition(dataAsteroid->position); { Orientation o(dataAsteroid->forward, dataAsteroid->up); SetOrientation(o); } // Turkey 01/2014 AME is bugged, rotation axis should be a normalized vector Rotation r = dataAsteroid->rotation; Vector axis = r.axis().Normalize(); r.axis(axis); SetRotation(r); SetSignature(dataAsteroid->signature); m_fraction = dataAsteroid->fraction; if (m_fraction > 1.0f) m_fraction = 1.0f; // Turkey 01/2014 AME is bugged, gives rocks 100.4% hitpoints (241/240) if (dataAsteroid->name[0] != '\0') SetName(dataAsteroid->name); else SetSecondaryName(dataAsteroid->name + 1); SetCluster(cluster); //Xynth #100 7/2010 Need to initialize oreseenbyside for all sides for (SideLinkIGC* psl = this->GetMission()->GetSides()->first(); psl != NULL; psl = psl->next()) { IsideIGC* pside = psl->data(); oreSeenBySide.Set(pside, 0.0); } m_lastUpdateOre = 0.0; //Xynth #132 7/2010 Should update first time this is mined m_inhibitUpdate = false; //Xynth #225 9/10 m_inhibitCounter = -1; #ifdef DEBUG { //Verify that there is no pre-existing asteroid with the same ID for (AsteroidLinkIGC* pal = pMission->GetAsteroids()->first(); (pal != NULL); pal = pal->next()) { assert (pal->data()->GetObjectID() != m_asteroidDef.asteroidID); } } #endif pMission->AddAsteroid(this); } } return S_OK; }
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; }
/************************************************************************* * AM-STD-VIEW-FACTORY *************************************************************************/ AmStdViewFactory::AmStdViewFactory() { SetSignature(DEFAULT_FACTORY_SIGNATURE); }
///////////////////////////////////////////////////////////////////////////// // CwarpIGC HRESULT CwarpIGC::Initialize(ImissionIGC* pMission, Time now, const void* data, int dataSize) { TmodelIGC<IwarpIGC>::Initialize(pMission, now, data, dataSize); ZRetailAssert (data && (dataSize == sizeof(DataWarpIGC))); { DataWarpIGC* dataWarp = (DataWarpIGC*)data; m_warpDef = dataWarp->warpDef; IclusterIGC* cluster = pMission->GetCluster(dataWarp->clusterID); ZRetailAssert (cluster); { // , use the real texture name HRESULT rc = LoadWarp(dataWarp->warpDef.textureName, dataWarp->warpDef.iconName, c_mtStatic | c_mtHitable | c_mtSeenBySide | c_mtPredictable); assert (SUCCEEDED(rc)); { SetRadius((float)m_warpDef.radius); SetPosition(dataWarp->position); SetVelocity(Vector::GetZero()); { Orientation o(dataWarp->forward); SetOrientation(o); } SetRotation(dataWarp->rotation); SetCluster(cluster); SetMass(0.0f); // KG- hack for unmovable alephs (to avoid a IGC file format change) // aleph name with a leading '*' denotes a fixed position aleph // so remove the '*' from the name and set m_bFixedPosition to true // Andon: Added mass limits to alephs. It checks for a leading '+' // and if found it searches for a ':' - It then takes everything after // this and turns it into a number. After that, it replaces the ':' with // a '(' and adds a ')' to the end. if (dataWarp->name[0] == '*') { m_bFixedPosition = true; if (dataWarp->name[1] == '+')//Andon: Added for if the aleph is both unmoved and mass limited { ZString name = dataWarp->name; int MassFind = name.Find(':',0); char* mass = &(dataWarp->name[MassFind+2]); m_MassLimit = atoi(mass); name.ReplaceAll(":" ,'('); //Replaces the : with a ( const char* alephname = &(name[2]); //Removes the leading '*+' char* newAlephName = new char[25]; const char* nameSuffix = ")"; //Adds a ) to the end strncpy(newAlephName, alephname, strlen(alephname)+1); strncat(newAlephName, nameSuffix, strlen(nameSuffix)+1); SetName(newAlephName); } else { SetName(&(dataWarp->name[1])); // skip the leading '*' m_MassLimit = -1; } } else if (dataWarp->name[0] == '+') { ZString name = dataWarp->name; int MassFind = name.Find(':',0); char* mass = &(dataWarp->name[MassFind+1]); m_MassLimit = atoi(mass); name.ReplaceAll(":" ,'('); //Replaces the : with a ( const char* alephname = &(name[1]);//Skip the leading '+' char* newAlephName = new char[25]; const char* nameSuffix = ")"; //Adds a ) to the end strncpy(newAlephName, alephname, strlen(alephname)+1); strncat(newAlephName, nameSuffix, strlen(nameSuffix)+1); SetName(newAlephName); } else { SetName(dataWarp->name); m_MassLimit = -1; } SetSignature(dataWarp->signature); pMission->AddWarp(this); } } } return S_OK; }
BOOL ServiceListProc(DWORD Param) /*++ Routine Description: ServiceListProc displays the lists of services or devices that are available on the system. Double clicking on one of these displayed services or devices causes a second dialog box to be displayed with detailed information. Arguments: Standard PROC entry. Return Value: BOOL - Depending on input message and processing options. --*/ { BOOL Success; LPENUM_SERVICE_STATUS Ess; static HSVC hSvc; DWORD ServiceType; DWORD Count; DWORD Widths[ ] = { 35, ( DWORD ) -1 }; // // By default the dialogs box is set-up to display services. // Change its labels if drivers are being displayed. // ServiceType = ( DWORD ) Param; DbgAssert( ( ServiceType == SERVICE_WIN32 ) || ( ServiceType == SERVICE_DRIVER )); // // Open the service controller for the supplied type of service. // hSvc = OpenSvc( ServiceType ); DbgHandleAssert( hSvc ); if( hSvc == NULL ) { return FALSE; } // // For each service/device of the supplied type, add it to the list. // while( Ess = QueryNextSvcEss( hSvc )) { LONG Index; DISPLAY_SERVICE DisplayService; // LPCLB_ROW ClbRow; //Ess = ( LPENUM_SERVICE_STATUS ) ClbRow->Data; // // Set up a DISPLAY_SERVICE object. // DisplayService.hSvc = hSvc; DisplayService.Ess = Ess; SetSignature( &DisplayService ); // // Display details about the selected service/device. // DisplayServiceProc( //( LPARAM ) &DisplayService (LPDISPLAY_SERVICE) &DisplayService ); PrintToFile((LPCTSTR)TEXT("\n"),IDC_SPACE,TRUE); }//end while return TRUE; }
HRESULT CprobeIGC::Initialize(ImissionIGC* pMission, Time now, const void* data, int dataSize) { assert (pMission); m_pMission = pMission; ZRetailAssert (data && (dataSize > sizeof(DataProbeBase))); { DataProbeBase* dataProbeBase = (DataProbeBase*)data; if ((dataProbeBase->exportF) && ((DataProbeExport*)dataProbeBase)->createNow) { m_time0 = now; } else { m_time0 = pMission->GetIgcSite()->ClientTimeFromServerTime(dataProbeBase->time0); } TmodelIGC<IprobeIGC>::Initialize(pMission, now, data, dataSize); IshipIGC* pshipLauncher; IsideIGC* pside; IclusterIGC* pcluster; if (dataProbeBase->exportF) { assert (dataSize == sizeof(DataProbeExport)); DataProbeExport* dataProbeExport = (DataProbeExport*)dataProbeBase; m_probeType = (IprobeTypeIGC*)(pMission->GetExpendableType(dataProbeExport->probetypeID)); pside = pMission->GetSide(dataProbeExport->sideID); pcluster = pMission->GetCluster(dataProbeExport->clusterID); pshipLauncher = pside->GetShip(dataProbeExport->shipID); if (m_probeType->HasCapability(c_eabmShootOnlyTarget)) m_target = pMission->GetModel(dataProbeExport->otTarget, dataProbeExport->oidTarget); } else { assert (dataSize == sizeof(DataProbeIGC)); DataProbeIGC* dataProbe = (DataProbeIGC*)dataProbeBase; m_probeType = dataProbe->pprobetype; pside = dataProbe->pside; pcluster = dataProbe->pcluster; pshipLauncher = dataProbe->pship; if (m_probeType->HasCapability(c_eabmShootOnlyTarget)) m_target = dataProbe->pmodelTarget; } assert (m_probeType); assert (m_probeType->GetObjectType() == OT_probeType); m_probeType->AddRef(); m_ammo = m_probeType->GetAmmo(); DataProbeTypeIGC* dataProbeType = (DataProbeTypeIGC*)(m_probeType->GetData()); m_projectileType = m_probeType->GetProjectileType(); if (m_projectileType) { m_projectileType->AddRef(); m_bSeenByAll = false; if (pshipLauncher && (dataProbeType->launcherDef.price == 0)) m_launcher = pshipLauncher; } assert (pcluster); //Load the model for the probe assert (iswalpha(dataProbeType->modelName[0])); HRESULT hr = Load(0, dataProbeType->modelName, dataProbeType->textureName, dataProbeType->iconName, c_mtDamagable | c_mtHitable | c_mtStatic | c_mtSeenBySide | c_mtPredictable | c_mtScanner); assert (SUCCEEDED(hr)); SetRadius(dataProbeType->radius); SetSignature(dataProbeType->signature); SetSide(pside); SetSecondaryName(dataProbeType->launcherDef.name); { //Parts get a random orientation Vector v = Vector::RandomDirection(); Orientation o(v); SetOrientation(o); } //lifespan == 0 => immortal probe that can hit until it gets terminated on the next update; this is bad assert (dataProbeType->lifespan > 0.0f); m_timeExpire = m_time0 + dataProbeType->lifespan; assert (m_timeExpire != m_time0); m_nextFire = m_time0 + (m_probeType->HasCapability(c_eabmQuickReady) ? 5.0f //5 second delay : 30.0f); //30 second delay before we start to shoot assert (GetSide()); SetMass(0.0f); m_probeID = dataProbeBase->probeID; SetPosition(dataProbeBase->p0); SetCluster(pcluster); pMission->AddProbe(this); if ((dataProbeType->dtRipcord >= 0.0f) && ((GetMyLastUpdate() - m_time0) >= dataProbeType->dtRipcord)) { pMission->GetIgcSite()->ActivateTeleportProbe(this); } // mmf 04/08 destroy any probe near aleph (warp) tip as this is viewed as an exploit as the enemy // often cannot delete it // // if (experimental game type) mmf const MissionParams* pmp = pMission->GetMissionParams(); if (pmp->bExperimental) { Vector dV, probeV, warpV, tipdistV; Vector bV, tipV; float warp_rad, distance; Orientation warp_orient; Rotation warp_rot; // loop through list of warps for (WarpLinkIGC* pwl = pcluster->GetWarps()->first(); (pwl != NULL); pwl = pwl->next()) { IwarpIGC* pwarp = pwl->data(); warp_rad = pwarp->GetRadius(); warp_orient = pwarp->GetOrientation(); warpV = pwarp->GetPosition(); probeV = this->GetPosition(); dV= warpV-probeV; distance = dV.Length(); warp_rot = pwarp->GetRotation(); // if rotating (i.e. rotation is other than 0 0 1 0) abort check if (!((warp_rot.x()==0) && (warp_rot.y()==0) && (warp_rot.z()==1) && (warp_rot.angle()==0))) break; if (distance < (warp_rad * 2) ) { // only check if close to tip if reasonably close to warp center bV = warp_orient.GetBackward(); tipV = warpV + (bV*warp_rad); tipdistV = tipV-probeV; distance = tipdistV.Length(); if (distance < 30) { debugf("Destroying probe as it was dropped too close (within 30) of aleph(warp) tip. dist = $f\n",distance); return S_FALSE; // this will destroy the probe } } } } // mmf end // mmf added code to detect tp drop near asteroid and if too close destroy it // leave ActivateTeleProbe code above so enemy is alerted to the drop even though it may be destroyed if (dataProbeType->dtRipcord >= 0.0f) // check to see if this is a teleprobe { Vector dV; float asteroid_rad, distance; // loop through list of asteroids for (AsteroidLinkIGC* pal = pcluster->GetAsteroids()->first(); (pal != NULL); pal = pal->next()) { asteroid_rad = (pal->data()->GetRadius()); dV=this->GetPosition() - pal->data()->GetPosition(); distance = dV.Length(); if (distance < (asteroid_rad-5)) { debugf("Teleprobe dropped too close to asteroid (within -5) destroying probe. dist = %f, asteroid rad = %f\n", distance,asteroid_rad); // this->Terminate(); should be terminated when missionigc processes S_FALSE return S_FALSE; } } } // mmf end } return S_OK; }
void LogEntry1Data::ResumeSyncSend(void) { if (!SyncSendPaused) { return; } SyncSendPaused = FALSE; if (SyncNumber == CERROR) { return; } // We just unpaused and we're assigned a record number... tell everybody // else all about ourselves. GAINEXCLUSIVEACCESS(); char Buffer[256]; CopyStringToBuffer(Buffer, Name); SetName(Buffer); CopyStringToBuffer(Buffer, Initials); SetInitials(Buffer); CopyStringToBuffer(Buffer, Password); SetPassword(Buffer); CopyStringToBuffer(Buffer, Surname); SetSurname(Buffer); CopyStringToBuffer(Buffer, Title); SetTitle(Buffer); CopyStringToBuffer(Buffer, RealName); SetRealName(Buffer); CopyStringToBuffer(Buffer, PhoneNumber); SetPhoneNumber(Buffer); CopyStringToBuffer(Buffer, ForwardAddr); SetForwardAddr(Buffer); CopyStringToBuffer(Buffer, ForwardAddrNode); SetForwardAddrNode(Buffer); CopyStringToBuffer(Buffer, ForwardAddrRegion); SetForwardAddrRegion(Buffer); CopyStringToBuffer(Buffer, PromptFormat); SetPromptFormat(Buffer); CopyStringToBuffer(Buffer, DateStamp); SetDateStamp(Buffer); CopyStringToBuffer(Buffer, VerboseDateStamp); SetVerboseDateStamp(Buffer); CopyStringToBuffer(Buffer, Signature); SetSignature(Buffer); CopyStringToBuffer(Buffer, NetPrefix); SetNetPrefix(Buffer); CopyStringToBuffer(Buffer, MailAddr1); SetMailAddr1(Buffer); CopyStringToBuffer(Buffer, MailAddr2); SetMailAddr2(Buffer); CopyStringToBuffer(Buffer, MailAddr3); SetMailAddr3(Buffer); CopyStringToBuffer(Buffer, Alias); SetAlias(Buffer); CopyStringToBuffer(Buffer, LocID); SetLocID(Buffer); CopyStringToBuffer(Buffer, MorePrompt); SetMorePrompt(Buffer); CopyStringToBuffer(Buffer, Occupation); SetOccupation(Buffer); CopyStringToBuffer(Buffer, WhereHear); SetWhereHear(Buffer); CopyStringToBuffer(Buffer, LastRoom); SetLastRoom(Buffer); CopyStringToBuffer(Buffer, LastHall); SetLastHall(Buffer); CopyStringToBuffer(Buffer, DefaultRoom); SetDefaultRoom(Buffer); CopyStringToBuffer(Buffer, DefaultHall); SetDefaultHall(Buffer); CopyStringToBuffer(Buffer, TermType); SetTermType(Buffer); RELEASEEXCLUSIVEACCESS(); SetBirthDate(BirthDate); SetFirstOn(FirstOn); SetSex(Sex); SetNulls(Nulls); SetWidth(Width); SetLinesPerScreen(LinesPerScreen); SetAttribute(ATTR_NORMAL, attributes[ATTR_NORMAL]); SetAttribute(ATTR_BLINK, attributes[ATTR_BLINK]); SetAttribute(ATTR_REVERSE, attributes[ATTR_REVERSE]); SetAttribute(ATTR_BOLD, attributes[ATTR_BOLD]); SetAttribute(ATTR_UNDERLINE, attributes[ATTR_UNDERLINE]); SetNumUserShow(NumUserShow); SetDefaultProtocol(DefaultProtocol); SetCallTime(CallTime); SetCallNumber(CallNumber); SetTotalTime(TotalTime); SetCredits(Credits); SetLogins(Logins); SetPosted(Posted); SetRead(Read); SetPasswordChangeTime(PasswordChangeTime); SetCallsToday(CallsToday); SetCallLimit(CallLimit); SetLastMessage(LastMessage); SetDL_Bytes(DL_Bytes); SetUL_Bytes(UL_Bytes); SetDL_Num(DL_Num); SetUL_Num(UL_Num); SetPoopcount(Poopcount); SetDungeoned(IsDungeoned()); SetForwardToNode(IsForwardToNode()); SetAutoNextHall(IsAutoNextHall()); SetEnterBorders(IsEnterBorders()); SetVerified(IsVerified()); SetSurnameLocked(IsSurnameLocked()); SetDefaultHallLocked(IsDefaultHallLocked()); SetPsycho(IsPsycho()); SetViewTitleSurname(IsViewTitleSurname()); SetViewSubjects(IsViewSubjects()); SetViewSignatures(IsViewSignatures()); SetOldIBMGraph(IsOldIBMGraph()); SetOldIBMANSI(IsOldIBMANSI()); SetOldIBMColor(IsOldIBMColor()); SetTwirly(IsTwirly()); SetAutoVerbose(IsAutoVerbose()); SetPauseBetweenMessages(IsPauseBetweenMessages()); SetMinibin(IsMinibin()); SetClearScreenBetweenMessages(IsClearScreenBetweenMessages()); SetViewRoomInfoLines(IsViewRoomInfoLines()); SetViewHallDescription(IsViewHallDescription()); SetVerboseContinue(IsVerboseContinue()); SetViewCensoredMessages(IsViewCensoredMessages()); SetViewBorders(IsViewBorders()); SetOut300(IsOut300()); SetUserSignatureLocked(IsUserSignatureLocked()); SetHideMessageExclusions(IsHideMessageExclusions()); SetDownload(IsDownload()); SetUpload(IsUpload()); SetChat(IsChat()); SetPrintFile(IsPrintFile()); SetSpellCheckMode(GetSpellCheckMode()); SetMakeRoom(IsMakeRoom()); SetVerboseLogOut(IsVerboseLogOut()); SetConfirmSave(IsConfirmSave()); SetConfirmAbort(IsConfirmAbort()); SetConfirmNoEO(IsConfirmNoEO()); SetUsePersonalHall(IsUsePersonalHall()); SetYouAreHere(IsYouAreHere()); SetIBMRoom(IsIBMRoom()); SetWideRoom(IsWideRoom()); SetMusic(IsMusic()); SetCheckApostropheS(IsCheckApostropheS()); SetCheckAllCaps(IsCheckAllCaps()); SetCheckDigits(IsCheckDigits()); SetExcludeEncryptedMessages(IsExcludeEncryptedMessages()); SetViewCommas(IsViewCommas()); SetPUnPauses(IsPUnPauses()); SetRoman(IsRoman()); SetSuperSysop(IsSuperSysop()); SetInuse(IsInuse()); SetUpperOnly(IsUpperOnly()); SetLinefeeds(IsLinefeeds()); SetExpert(IsExpert()); SetAide(IsAide()); SetTabs(IsTabs()); SetOldToo(IsOldToo()); SetProblem(IsProblem()); SetUnlisted(IsUnlisted()); SetPermanent(IsPermanent()); SetSysop(IsSysop()); SetNode(IsNode()); SetNetUser(IsNetUser()); SetAccounting(IsAccounting()); SetMail(IsMail()); SetViewRoomDesc(IsViewRoomDesc()); }