void FlightPathMovementGenerator::DoReset(Player* owner)
{
    if (!owner)
        return;

    if (!owner->isAlive())
        return;

    float playerFlightSpeed = 32.0f;

    // Add percentage from SPELL_AURA_MOD_TAXI_FLIGHT_SPEED.
    Unit::AuraEffectList const& mIncreaseTaxiFlightSpeed = owner->GetAuraEffectsByType(SPELL_AURA_MOD_TAXI_FLIGHT_SPEED);
    for (Unit::AuraEffectList::const_iterator i = mIncreaseTaxiFlightSpeed.begin(); i != mIncreaseTaxiFlightSpeed.end(); ++i)
        AddPct(playerFlightSpeed, (*i)->GetAmount());

    owner->getHostileRefManager().setOnlineOfflineState(false);
    owner->AddUnitState(UNIT_STATE_IN_FLIGHT);
    owner->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);

    Movement::MoveSplineInit init(*owner);
    uint32 end = GetPathAtMapEnd();
    for (uint32 i = GetCurrentNode(); i != end; ++i)
    {
        G3D::Vector3 vertice((*i_path)[i].x, (*i_path)[i].y, (*i_path)[i].z);
        init.Path().push_back(vertice);
    }
    init.SetFirstPointId(GetCurrentNode());
    init.SetFly();
    init.SetSmooth();
    init.SetWalk(true);
    init.SetVelocity(playerFlightSpeed);
    init.Launch();
}
void FlightPathMovementGenerator::ResendPathToOtherPlayers(Player& player)
{
    TaxiPathNodeList path = GetPath();
    uint32 pathEndPoint = GetPathAtMapEnd();
    uint32 traveltime = uint32(PLAYER_FLIGHT_SPEED * (path.GetTotalLength(GetCurrentNode(),pathEndPoint) 
            - player.GetDistance(path[GetCurrentNode()].x, path[GetCurrentNode()].y, path[GetCurrentNode()].z)));
    player.SendMonsterMoveByPath(path,
                                 GetCurrentNode(),
                                 pathEndPoint, 
                                 SplineFlags(SPLINEFLAG_WALKMODE|SPLINEFLAG_FLYING), 
                                 traveltime,
                                 true );
} 
void FlightPathMovementGenerator::Reset(Player & player)
{
    player.getHostileRefManager().setOnlineOfflineState(false);
    player.addUnitState(UNIT_STAT_TAXI_FLIGHT);
    player.SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
    Traveller<Player> traveller(player);
    // do not send movement, it was sent already
    i_destinationHolder.SetDestination(traveller, (*i_path)[i_currentNode].x, (*i_path)[i_currentNode].y, (*i_path)[i_currentNode].z, false);

    TaxiPathNodeList path = GetPath();
    uint32 pathEndPoint = GetPathAtMapEnd();
    uint32 traveltime = uint32(PLAYER_FLIGHT_SPEED * path.GetTotalLength(GetCurrentNode(),pathEndPoint));
    player.SendMonsterMoveByPath(path,GetCurrentNode(),pathEndPoint, SplineFlags(SPLINEFLAG_WALKMODE|SPLINEFLAG_FLYING), traveltime );
}
void FlightPathMovementGenerator::_Reset(Player & player)
{
    Movement::MoveSplineInit init(player);
    uint32 end = GetPathAtMapEnd();
    for (uint32 i = GetCurrentNode(); i != end; ++i)
    {
        G3D::Vector3 vertice((*i_path)[i].x,(*i_path)[i].y,(*i_path)[i].z);
        init.Path().push_back(vertice);
    }
    init.SetFirstPointId(GetCurrentNode());
    init.SetFly();
    init.SetVelocity(PLAYER_FLIGHT_SPEED);
    init.Launch();
}
示例#5
0
/*
 * IECopyImage - copy the current clipping rectangle to the clipboard
 *
 * 1) Copy the bitmap to the clipboard (so other apps can use it).
 * 2) Make a copy of the XOR bitmap and the AND bitmaps so that if
 *    screen colors are involved, they will be preserved.
 *    Later, we check the owner of the clipboard to see if we really
 *    want to use the XOR/AND bitmaps or not.
 */
void IECopyImage( void )
{
    short       width;
    short       height;
    img_node    *node;

    node = GetCurrentNode();
    if( node == NULL ) {
        return;
    }

    if( !fEnableCutCopy ) {
        _wpi_setwrectvalues( &clipRect.rect, 0, 0, node->width, node->height );
        width = node->width;
        height = node->height;
    } else {
        width = _wpi_getwidthrect( clipRect.rect );
        height = _wpi_getheightrect( clipRect.rect );
    }

    copyImageToClipboard( width, height, node );

    if( !fEnableCutCopy ) {
        PrintHintTextByID( WIE_ENTIREIMAGECOPIED, NULL );
    } else {
        PrintHintTextByID( WIE_AREACOPIED, NULL );
        RedrawPrevClip( node->hwnd );
        fEnableCutCopy = FALSE;
    }

} /* IECopyImage */
void
nsFilteredContentIterator::Prev()
{
  if (mIsOutOfRange || !mCurrentIterator) {
    NS_ASSERTION(mCurrentIterator, "Missing iterator!");

    return;
  }

  // If we are switching directions then
  // we need to switch how we process the nodes
  if (mDirection != eBackward) {
    nsresult rv = SwitchDirections(false);
    if (NS_FAILED(rv)) {
      return;
    }
  }

  mCurrentIterator->Prev();

  if (mCurrentIterator->IsDone()) {
    return;
  }

  // If we can't get the current node then 
  // don't check to see if we can skip it
  nsINode *currentNode = mCurrentIterator->GetCurrentNode();

  nsCOMPtr<nsIDOMNode> node(do_QueryInterface(currentNode));
  CheckAdvNode(node, mDidSkip, eBackward);
}
示例#7
0
void EdgeMenuDialogBase::PickPreviousSibling()
{
    bool continueSearch = true;
    BrowserNode * previousNode = 0;
    BrowserNode * originalNode = GetCurrentNode();
    int originalDepth = originalNode->depth();
    BrowserNode * currentNode = originalNode;

    while (continueSearch)
    {
        QLOG_INFO() << "CurrentNode is: " << currentNode->get_name();
        previousNode = dynamic_cast<BrowserNode *>(currentNode->itemBelow());

        QLOG_INFO() << "Nodename is: " << previousNode->get_name() << " " << previousNode->depth();
        if (!previousNode)
            break;

        QLOG_INFO() << "Previous Node is: "<< previousNode->get_name();
        int previousDepth = previousNode->depth();
        bool sameType = originalNode->get_stype() == previousNode->get_stype();
        QLOG_INFO() << "PREVIOUS: " << "Origin level : " << originalDepth;
        QLOG_INFO() << "PREVIOUS: " << "Current level : " << previousDepth;
        bool sameLevel = originalDepth == previousDepth;

        if (sameLevel && sameType)
            continueSearch = false;

        currentNode = previousNode;
    }
    if (previousNode == 0)
        return;

    SaveData();
    FillGuiElements(previousNode);
}
//------------------------------------------------------------
void
nsFilteredContentIterator::Last()
{
  if (!mCurrentIterator) {
    NS_ERROR("Missing iterator!");

    return;
  }

  // If we are switching directions then
  // we need to switch how we process the nodes
  if (mDirection != eBackward) {
    mCurrentIterator = mIterator;
    mDirection       = eBackward;
    mIsOutOfRange    = false;
  }

  mCurrentIterator->Last();

  if (mCurrentIterator->IsDone()) {
    return;
  }

  nsINode *currentNode = mCurrentIterator->GetCurrentNode();
  nsCOMPtr<nsIDOMNode> node(do_QueryInterface(currentNode));

  bool didCross;
  CheckAdvNode(node, didCross, eBackward);
}
示例#9
0
void FlightPathMovementGenerator::Initialize(Player &player)
{
    player.getHostileRefManager().setOnlineOfflineState(false);
    player.AddUnitState(UNIT_STAT_IN_FLIGHT);
    player.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
    Traveller<Player> traveller(player);
    // do not send movement, it was sent already
    i_destinationHolder.SetDestination(traveller, (*i_path)[i_currentNode].x, (*i_path)[i_currentNode].y, (*i_path)[i_currentNode].z, false);

    // For preloading end grid
    InitEndGridInfo();
    TaxiPathNodeList path = GetPath();
    uint32 pathEndPoint = GetPathAtMapEnd();
    uint32 traveltime = uint32(32.0f*path.GetTotalLength(GetCurrentNode(),pathEndPoint));
    player.SetUnitMovementFlags(SPLINEFLAG_WALKING|SPLINEFLAG_FLYING);
    player.SendMonsterMoveByPath(path,GetCurrentNode(),pathEndPoint, traveltime);
}
void FlightPathMovementGenerator::Reset(Player & player)
{
    player.getHostileRefManager().setOnlineOfflineState(false);
    player.AddUnitState(UNIT_STAT_IN_FLIGHT);
    player.SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);

    Movement::MoveSplineInit init(player);
    uint32 end = GetPathAtMapEnd();
    for (uint32 i = GetCurrentNode(); i != end; ++i)
    {
        G3D::Vector3 vertice((*i_path)[i].x,(*i_path)[i].y,(*i_path)[i].z);
        init.Path().push_back(vertice);
    }
    init.SetFirstPointId(GetCurrentNode());
    init.SetFly();
    init.SetVelocity(32.0f);
    init.Launch();
}
void FlightPathMovementGenerator::DoReset(Player* player)
{
    player->AddUnitState(UNIT_STATE_IN_FLIGHT);
    player->CombatStopWithPets();
    player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_TAXI_FLIGHT);

    Movement::MoveSplineInit init(player);
    uint32 end = GetPathAtMapEnd();
    for (uint32 i = GetCurrentNode(); i != end; ++i)
    {
        G3D::Vector3 vertice(_path[i]->LocX, _path[i]->LocY, _path[i]->LocZ);
        init.Path().push_back(vertice);
    }
    init.SetFirstPointId(GetCurrentNode());
    init.SetFly();
    init.SetVelocity(PLAYER_FLIGHT_SPEED);
    init.Launch();
}
void FlightPathMovementGenerator::DoReset(Player* player)
{
    player->getHostileRefManager().setOnlineOfflineState(false);
    player->AddUnitState(UNIT_STATE_IN_FLIGHT);
    player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);

    Movement::MoveSplineInit init(player);
    uint32 end = GetPathAtMapEnd();
    for (uint32 i = GetCurrentNode(); i < end; ++i)
    {
        G3D::Vector3 vertice(i_path[i]->x, i_path[i]->y, i_path[i]->z);
        init.Path().push_back(vertice);
    }
    init.SetFirstPointId(GetCurrentNode());
    init.SetFly();
    init.SetVelocity(PLAYER_FLIGHT_SPEED);
    init.Launch();
}
nsINode *
nsFilteredContentIterator::GetCurrentNode()
{
  if (mIsOutOfRange || !mCurrentIterator) {
    return nsnull;
  }

  return mCurrentIterator->GetCurrentNode();
}
示例#14
0
/*
 * CutImage - cuts the current clipping rectangle to the clipboard
 */
void CutImage( void )
{
    WPI_PRES    pres;
    WPI_PRES    mempres;
    HDC         memdc;
    HBITMAP     oldbitmap;
    short       width;
    short       height;
    img_node    *node;
    WPI_RECTDIM left;
    WPI_RECTDIM right;
    WPI_RECTDIM top;
    WPI_RECTDIM bottom;

    node = GetCurrentNode();

    if( node == NULL ) {
        return;
    }

    if( !fEnableCutCopy ) {
        _wpi_setwrectvalues( &clipRect.rect, 0, 0, node->width, node->height );
        width = node->width;
        height = node->height;
    } else {
        width = (short)_wpi_getwidthrect( clipRect.rect );
        height = (short)_wpi_getheightrect( clipRect.rect );
    }
    copyImageToClipboard( width, height, node );

    pres = _wpi_getpres( node->viewhwnd );
    mempres = _wpi_createcompatiblepres( pres, Instance, &memdc );
    _wpi_releasepres( node->viewhwnd, pres );

    oldbitmap = _wpi_selectbitmap( mempres, node->hxorbitmap );
    _wpi_getrectvalues( clipRect.rect, &left, &top, &right, &bottom );
    _wpi_patblt( mempres, left, top, width, height, WHITENESS );

    _wpi_getoldbitmap( mempres, oldbitmap );
    oldbitmap = _wpi_selectbitmap( mempres, node->handbitmap );
    _wpi_patblt( mempres, left, top, width, height, BLACKNESS );
    _wpi_getoldbitmap( mempres, oldbitmap );
    _wpi_deletecompatiblepres( mempres, memdc );

    InvalidateRect( node->viewhwnd, NULL, FALSE );
    RecordImage( node->hwnd );

    if( !fEnableCutCopy ) {
        PrintHintTextByID( WIE_ENTIREIMAGECUT, NULL );
    } else {
        PrintHintTextByID( WIE_AREACUT, NULL );
        fEnableCutCopy = FALSE;
    }
    BlowupImage( node->hwnd, NULL );

} /* CutImage */
示例#15
0
/*
 * ClearImage - clear the XOR and the AND bitmaps
 */
void ClearImage( void )
{
    WPI_PRES            pres;
    WPI_PRES            xorpres;
    WPI_PRES            andpres;
    HDC                 xormemdc;
    HDC                 andmemdc;
    HBITMAP             oldxor;
    HBITMAP             oldand;
    img_node            *node;
    WPI_RECT            clear_area;
    IMGED_DIM           left;
    IMGED_DIM           top;
    IMGED_DIM           right;
    IMGED_DIM           bottom;
    int                 width;
    int                 height;

    node = GetCurrentNode();
    if( node == NULL ) {
        return;
    }

    if( DoesRectExist( &clear_area ) ) {
        SetRectExists( FALSE );
    } else {
        _wpi_setwrectvalues( &clear_area, 0, 0, node->width, node->height );
    }

    pres = _wpi_getpres( HWND_DESKTOP );
    xorpres = _wpi_createcompatiblepres( pres, Instance, &xormemdc );
    andpres = _wpi_createcompatiblepres( pres, Instance, &andmemdc );
    _wpi_releasepres( HWND_DESKTOP, pres );

    oldxor = _wpi_selectobject( xorpres, node->hxorbitmap );
    oldand = _wpi_selectobject( andpres, node->handbitmap );

    _wpi_getwrectvalues( clear_area, &left, &top, &right, &bottom );
    width = _wpi_getwidthrect( clear_area );
    height = _wpi_getheightrect( clear_area );

    _wpi_patblt( xorpres, left, top, width, height, WHITENESS );
    _wpi_patblt( andpres, left, top, width, height, BLACKNESS );

    _wpi_selectobject( xorpres, oldxor );
    _wpi_selectobject( andpres, oldand );
    _wpi_deletecompatiblepres( xorpres, xormemdc );
    _wpi_deletecompatiblepres( andpres, andmemdc );

    InvalidateRect( node->viewhwnd, NULL, TRUE );
    RecordImage( node->hwnd );
    BlowupImage( node->hwnd, NULL );
    PrintHintTextByID( WIE_AREACLEARED, NULL );

} /* ClearImage */
void FlightPathMovementGenerator::Reset(Player & player)
{
    player.getHostileRefManager().setOnlineOfflineState(false);
    player.addUnitState(UNIT_STAT_TAXI_FLIGHT);
    player.SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
    Traveller<Player> traveller(player);
    // do not send movement, it was sent already
    i_destinationHolder.SetDestination(traveller, (*i_path)[i_currentNode].x, (*i_path)[i_currentNode].y, (*i_path)[i_currentNode].z, false);

    player.SendMonsterMoveByPath(GetPath(),GetCurrentNode(),GetPathAtMapEnd(), SplineFlags(SPLINEFLAG_WALKMODE|SPLINEFLAG_FLYING));
}
示例#17
0
TGeoVolume* KVGeoNavigator::GetCurrentDetectorNameAndVolume(KVString& detector_name, Bool_t& multilayer)
{
   // Returns the name of the current detector (if we are inside a detector)
   // and whether it is a multilayer or simple detector.
   // Returns 0x0 if we are not inside a detector volume.
   //
   // N.B. the returned volume corresponds to the *whole* detector (even if it has several layers).
   // For a multilayer detector, GetCurrentVolume() returns the volume for the current layer.
   //
   // See ExtractDetectorNameFromPath(KVString&) for details on detector name formatting.

//    Info("GetCurrentDetectorNameAndVolume","now i am in %s on node %s with path %s and matrix:",
//         fCurrentVolume->GetName(),fCurrentNode->GetName(),fCurrentPath.Data());
//    fCurrentMatrix.Print();

   multilayer = kFALSE;
   fCurrentDetectorNode = 0;
   TString volNom = GetCurrentVolume()->GetName();
   TGeoVolume* detector_volume = 0;
   if (volNom.BeginsWith("DET_")) {
      // simple detector
      fCurrentDetectorNode = GetCurrentNode();
      detector_volume = GetCurrentVolume();
   } else {
      // have we hit 1 layer of a multilayer detector?
      TGeoVolume* mother_vol = GetCurrentNode()->GetMotherVolume();
      if (mother_vol) {
         TString mom = mother_vol->GetName();
         if (mom.BeginsWith("DET_")) {
            // it *is* a multilayer detector (youpi! :-)
            if (fMotherNode) { // this is the node corresponding to the whole detector,
               fCurrentDetectorNode = fMotherNode;
               detector_volume = mother_vol;
               multilayer = kTRUE;
            }
         }
      }
   }
   if (detector_volume) ExtractDetectorNameFromPath(detector_name);
   return detector_volume;
}
void FlightPathMovementGenerator::DoReset(Player* player)
{
    player->getHostileRefManager().setOnlineOfflineState(false);
    player->AddUnitState(UNIT_STATE_IN_FLIGHT);
    player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_TAXI_FLIGHT);

    Movement::MoveSplineInit init(player);
    uint32 end = GetPathAtMapEnd();
    for (uint32 i = GetCurrentNode(); i != end; ++i)
    {
        G3D::Vector3 vertice(i_path[i]->Loc.X, i_path[i]->Loc.Y, i_path[i]->Loc.Z);
        init.Path().push_back(vertice);
    }
    init.SetFirstPointId(GetCurrentNode());
    init.SetFly();
    init.SetSmooth();
    init.SetUncompressed();
    init.SetWalk(true);
    init.SetVelocity(PLAYER_FLIGHT_SPEED);
    init.Launch();
}
void FlightPathMovementGenerator::Initialize(Player &player)
{
    player.getHostilRefManager().setOnlineOfflineState(false);
    player.addUnitState(UNIT_STAT_IN_FLIGHT);
    player.SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
    LoadPath(player);
    Traveller<Player> traveller(player);
    // do not send movement, it was sent already
    i_destinationHolder.SetDestination(traveller, i_path[i_currentNode].x, i_path[i_currentNode].y, i_path[i_currentNode].z, false);

    player.SendMonsterMoveByPath(GetPath(),GetCurrentNode(),GetPathAtMapEnd(),MOVEMENTFLAG_WALK_MODE|MOVEMENTFLAG_ONTRANSPORT);
}
void FlightPathMovementGenerator::Initialize(Player &player)
{
    player.getHostileRefManager().setOnlineOfflineState(false);
    player.AddUnitState(UNIT_STAT_IN_FLIGHT);
    player.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
    Traveller<Player> traveller(player);
    // do not send movement, it was sent already
    i_destinationHolder.SetDestination(traveller, (*i_path)[i_currentNode].x, (*i_path)[i_currentNode].y, (*i_path)[i_currentNode].z, false);
    // For preloading end grid
    InitEndGridInfo();
    player.SendMonsterMoveByPath(GetPath(), GetCurrentNode(), GetPathAtMapEnd());
}
示例#21
0
/*
 * BlowupImage - stretch the view window into the window given by hwnd
 */
void BlowupImage( HWND hmdiwnd, WPI_PRES pres )
{
    HDC         memdc;
    WPI_PRES    mempres;
    WPI_RECT    client;
    HBITMAP     oldbitmap;
    HBITMAP     newbitmap;
    HWND        hwnd;
    img_node    *node;
    BOOL        new_pres;

    if( hmdiwnd != NULL ) {
        hwnd = hmdiwnd;
    } else {
        node = GetCurrentNode();
        if( node == NULL ) {
            return;
        }
        hwnd = node->hwnd;
    }

    newbitmap = EnlargeImage( hwnd );
    if( newbitmap == NULL ) {
        return;
    }

    new_pres = FALSE;
    if( pres == (WPI_PRES)NULL ) {
        pres = _wpi_getpres( hwnd );
        new_pres = TRUE;
    }
    mempres = _wpi_createcompatiblepres( pres, Instance, &memdc );
    oldbitmap = _wpi_selectobject( mempres, newbitmap );

    if( ImgedConfigInfo.grid_on ) {
        showGrid( hwnd, mempres );
    } else {
        GetClientRect( hwnd, &client );
        _wpi_bitblt( pres, 0, 0, _wpi_getwidthrect( client ),
                     _wpi_getheightrect( client ), mempres, 0, 0, SRCCOPY );
        RedrawPrevClip( hwnd );   // Redraw if there was a clip region specified.
    }

    _wpi_selectobject( mempres, oldbitmap );
    _wpi_deletebitmap( newbitmap );
    _wpi_deletecompatiblepres( mempres, memdc );

    if( new_pres ) {
        _wpi_releasepres( hwnd, pres );
    }

} /* BlowupImage */
示例#22
0
/*
 * PlaceAndPaste - find out where the image is to be placed and then paste it there
 */
void PlaceAndPaste( void )
{
    HBITMAP         hbitmap;
    WPI_POINT       pointsize;
    img_node        *node;
    WPI_POINT       pt;
    unsigned long   format;
    int             bm_width;
    int             bm_height;

    format = 0;
    node = GetCurrentNode();
    if( node == NULL ) {
        return;
    }

    if( !_wpi_isclipboardformatavailable( Instance, CF_BITMAP, &format ) ) {
        PrintHintTextByID( WIE_NOBITMAPINCLIPBOARD, NULL );
        return;
    }

    pointsize = GetPointSize( node->hwnd );
    if( fEnableCutCopy ) {
        RedrawPrevClip( node->hwnd );
        PasteImage( NULL, pointsize, node->hwnd );
        fEnableCutCopy = FALSE;
        return;
    }

    prevToolType = SetToolType( IMGED_PASTE );
    pointCursor = _wpi_loadcursor( Instance, POINT_CUR );
    prevCursor = _wpi_setcursor( pointCursor );

    _wpi_openclipboard( Instance, HMainWindow );
    hbitmap = _wpi_getclipboarddata( Instance, CF_BITMAP );
    _wpi_getbitmapdim( hbitmap, &bm_width, &bm_height );
    _wpi_closeclipboard( Instance );

    dragWidth = (short)(bm_width * pointsize.x);
    dragHeight = (short)(bm_height * pointsize.y);
    WriteSetSizeText( WIE_CLIPBOARDBITMAPSIZE, bm_width, bm_height);

    _wpi_getcursorpos( &pt );
    _wpi_screentoclient( node->hwnd, &pt );
    pt.x = pt.x / pointsize.x;
    pt.y = pt.y / pointsize.y;
    _wpi_setcapture( node->hwnd );
    firstTime = true;
    DragClipBitmap( node->hwnd, &pt, pointsize );

} /* PlaceAndPaste */
示例#23
0
void IEInvalidateNode( img_node *node )
{
    HWND        hwnd;

    if( node == NULL ) {
        node = GetCurrentNode();
        if( node == NULL ) {
            return;
        }
    }

    hwnd = node->hwnd;

    InvalidateRect( hwnd, NULL, FALSE );
}
示例#24
0
void FlightPathMovementGenerator::Initialize(Player &player)
{
    // Random handlers used for quests etc. - best would be to add FlightPathMovementGenerator::Initialize to sub-script class (Feanor)
    if( player.m_taxi.GetTaxiDestination() == 158 || player.m_taxi.GetTaxiDestination() == 243 )
        player.SetDisplayId(16587);

    player.getHostileRefManager().setOnlineOfflineState(false);
    player.addUnitState(UNIT_STAT_IN_FLIGHT);
    player.SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
    LoadPath(player);
    Traveller<Player> traveller(player);
    // do not send movement, it was sent already
    i_destinationHolder.SetDestination(traveller, i_path[i_currentNode].x, i_path[i_currentNode].y, i_path[i_currentNode].z, false);

    player.SendMonsterMoveByPath(GetPath(),GetCurrentNode(),GetPathAtMapEnd(), SplineFlags(SPLINEFLAG_WALKMODE|SPLINEFLAG_FLYING));
}
示例#25
0
/*
 * MaximizeCurrentChild - make the current edit window as large as it can possibly be
 */
void MaximizeCurrentChild( void )
{
    short       max_width;
    short       max_height;
    WPI_POINT   max_pt_size;
    WPI_RECT    client;
    WPI_RECT    rect;
    WPI_RECT    rc;
    img_node    *node;
    short       x_adjustment;
    short       y_adjustment;

    node = GetCurrentNode();
    if( node == NULL ) {
        return;
    }

    GetClientRect( node->hwnd, &rc );
    GetWindowRect( node->hwnd, &rect );

    x_adjustment = _wpi_getwidthrect( rect ) - _wpi_getwidthrect( rc );
    y_adjustment = _wpi_getheightrect( rect ) - _wpi_getheightrect( rc );

    GetClientRect( ClientWindow, &client );
    max_width = (short)_wpi_getwidthrect( client );
    max_height = (short)_wpi_getheightrect( client );

    max_pt_size.x = max_width / node->width;
    max_pt_size.y = max_height / node->height;

    if( ImgedConfigInfo.square_grid ) {
        if( max_pt_size.x > max_pt_size.y )
            max_pt_size.x = max_pt_size.y;
        max_pt_size.y = max_pt_size.x;
    }

    if( max_pt_size.x <= pointSize.x && max_pt_size.y <= pointSize.y ) {
        return;
    }

    max_width = max_pt_size.x * node->width + x_adjustment;
    max_height = max_pt_size.y * node->height + y_adjustment;

    SetWindowPos( node->hwnd, HWND_TOP, 0, 0, max_width, max_height,
                  SWP_SIZE | SWP_MOVE | SWP_ZORDER | SWP_SHOWWINDOW );

} /* MaximizeCurrentChild */
示例#26
0
/*
 * SaveFile - Saves the image file (bitmap, cursor or icon).
 */
bool SaveFile( short how )
{
    img_node    *node;
    img_node    *rootnode;
    char        new_name[ _MAX_PATH ];
    bool        ok;

    ok = false;
    node = GetCurrentNode();
    if( node == NULL )
        return( ok );
    rootnode = GetImageNode( node->hwnd );

    if( rootnode == NULL )
        return( ok );

    if( strnicmp(rootnode->fname, "(Untitled)", 10) == 0 ) {
        how = SB_SAVE_AS;
    }

    if( how == SB_SAVE_AS ) {
        if( !getSaveFName(new_name, rootnode->imgtype) ) {
            return( ok );
        }
        for( node = rootnode; node != NULL; node = node->nexticon ) {
            strcpy( node->fname, new_name );
        }
    }

    checkForExt( rootnode );

    switch( rootnode->imgtype ) {
    case BITMAP_IMG:
        ok = saveBitmapFile( rootnode );
        if( !ok )
            MessageBox(HMainWindow, "Error trying to save file!", "Error", MB_OK | MB_ICONEXCLAMATION);
        break;
    case ICON_IMG:
    case CURSOR_IMG:
        ok = saveImageFile( rootnode );
        if( !ok )
            MessageBox(HMainWindow, "Error trying to save file!", "Error", MB_OK | MB_ICONEXCLAMATION);
        break;
    }
    return( ok );
} /* SaveFile */
示例#27
0
/*
 * IEGetCurrentImageNode
 */
static img_node *IEGetCurrentImageNode( void )
{
    img_node    *node;
    img_node    *root;

    node = GetCurrentNode();
    if( node == NULL ) {
        return( NULL );
    }

    root = GetImageNode( node->hwnd );
    if( root == NULL ) {
        return( NULL );
    }

    return( root );

} /* IEGetCurrentImageNode */
示例#28
0
/*
 * FillArea - Fills the area.
 */
void FillArea( WPI_POINT *pt, int mousebutton )
{
    WPI_POINT   devicept;
    COLORREF    colour;
    wie_clrtype type;
    img_node    *node;

    devicept.x = pt->x / pointSize.x;
    devicept.y = pt->y / pointSize.y;
    colour = GetSelectedColour( mousebutton, NULL, &type );

    FillXorAnd(colour, &devicept, type);
    node = GetCurrentNode();
    InvalidateRect( node->viewhwnd, NULL, FALSE );
    BlowupImage( node->hwnd, NULL );
#ifdef __OS2_PM__
    currentMouseButton = currentMouseButton;    // just to suppres complaints
#endif
} /* FillArea */
示例#29
0
/*
 * ConvertToDIBitmap - convert the device dependent bitmap to a DI bitmap
 */
void ConvertToDIBitmap( HBITMAP hbitmap )
{
    HDC         hdc;
    BITMAPINFO  *bmi;
    BYTE        *bits;
    BITMAP      bm;
    img_node    *node;

    /*
     * Fill the info structure with information about the current image
     * we are editing.
     */
    node = GetCurrentNode();
    bmi = GetDIBitmapInfo( node );

    GetObject( hbitmap, sizeof( BITMAP ), &bm );
    /*
     * Replace the fields on the info header with values for *this* bitmap.
     */
    bmi->bmiHeader.biWidth = bm.bmWidth;
    bmi->bmiHeader.biHeight = bm.bmHeight;
#if 0
    if( bmi->bmiHeader.bmWidth > 32 ) {
        bmi->bmiHeader.biSizeImage = BITS_INTO_BYTES( bmi->bmiHeader.biBitCount * bm.bmWidth, bm.bmHeight );
    } else {
        bmi->bmiHeader.biSizeImage = BITS_TO_BYTES( bmi->bmiHeader.biBitCount * bm.bmWidth, bm.bmHeight );
    }
#else
    bmi->bmiHeader.biSizeImage = BITS_TO_BYTES( bmi->bmiHeader.biBitCount * bm.bmWidth, bm.bmHeight );
#endif
    bits = MemAlloc( bmi->bmiHeader.biSizeImage );

    hdc = GetDC( NULL );
    GetDIBits( hdc, hbitmap, 0, bmi->bmiHeader.biHeight, bits, bmi, DIB_RGB_COLORS );
    SetDIBits( hdc, hbitmap, 0, bmi->bmiHeader.biHeight, bits, bmi, DIB_RGB_COLORS );

    ReleaseDC( NULL, hdc );

    FreeDIBitmapInfo( bmi );
    MemFree( bits );

} /* ConvertToDIBitmap */
//------------------------------------------------------------
nsresult 
nsFilteredContentIterator::SwitchDirections(bool aChangeToForward)
{
  nsINode *node = mCurrentIterator->GetCurrentNode();

  if (aChangeToForward) {
    mCurrentIterator = mPreIterator;
    mDirection       = eForward;
  } else {
    mCurrentIterator = mIterator;
    mDirection       = eBackward;
  }

  if (node) {
    nsresult rv = mCurrentIterator->PositionAt(node);
    if (NS_FAILED(rv)) {
      mIsOutOfRange = true;
      return rv;
    }
  }
  return NS_OK;
}