public override void OnNewFrameFixed(Game game, NewFrameEventArgs args)
 {
     float one = 1;
     int now = game.platform.TimeMillisecondsFromStart();
     for (int i = 0; i < maxplayers; i++)
     {
         if (game.entities[i] == null)
         {
             continue;
         }
         if (game.entities[i].playerDrawInfo == null)
         {
             continue;
         }
         if (game.entities[i].networkPosition == null)
         {
             continue;
         }
         int kKey = i;
         Entity p = game.entities[i];
         if ((one * (now - p.networkPosition.LastUpdateMilliseconds) / 1000) > 2)
         {
             p.playerDrawInfo = null;
             p.networkPosition.PositionLoaded = false;
         }
     }
 }
示例#2
0
 public override void OnNewFrameFixed(Game game, NewFrameEventArgs args)
 {
     if (d_RailMapUtil == null)
     {
         this.d_RailMapUtil = new RailMapUtil();
         this.d_RailMapUtil.game = game;
     }
     RailOnNewFrame(game, args.GetDt());
 }
示例#3
0
 public override void OnNewFrameFixed(Game game, NewFrameEventArgs args)
 {
     for (int i = 0; i < game.entitiesCount; i++)
     {
         Entity entity = game.entities[i];
         if (entity == null) { continue; }
         if (entity.grenade == null) { continue; }
         UpdateGrenade(game, i, args.GetDt());
     }
 }
 public override void OnNewFrameFixed(Game game, NewFrameEventArgs args)
 {
     Packet_Item activeitem = game.d_Inventory.RightHand[game.ActiveMaterial];
     int activeblock = 0;
     if (activeitem != null) { activeblock = activeitem.BlockId; }
     if (activeblock != PreviousActiveMaterialBlock)
     {
         game.SendPacketClient(ClientPackets.ActiveMaterialSlot(game.ActiveMaterial));
     }
     PreviousActiveMaterialBlock = activeblock;
 }
 public override void OnNewFrameFixed(Game game, NewFrameEventArgs args)
 {
     if (game.guistate == GuiState.MapLoading)
     {
         return;
     }
     if (game.FollowId() == null)
     {
         UpdateBlockDamageToPlayer(game, args.GetDt());
     }
 }
    public override void OnNewFrame(Game game, NewFrameEventArgs args)
    {
        if (game.spawned && ((game.platform.TimeMillisecondsFromStart() - game.lastpositionsentMilliseconds) > 100))
        {
            game.lastpositionsentMilliseconds = game.platform.TimeMillisecondsFromStart();

            game.SendPacketClient(ClientPackets.PositionAndOrientation(game, game.LocalPlayerId,
                game.player.position.x, game.player.position.y, game.player.position.z,
                game.player.position.rotx, game.player.position.roty, game.player.position.rotz,
                game.localstance));
        }
    }
示例#7
0
 public override void OnNewFrameFixed(Game game, NewFrameEventArgs args)
 {
     if (game.FollowId() == null)
     {
         if (game.soundnow.value)
         {
             UpdateWalkSound(game, -1);
         }
         if (game.isplayeronground && game.controls.movedx != 0 || game.controls.movedy != 0)
         {
             UpdateWalkSound(game, args.GetDt());
         }
     }
 }
示例#8
0
 public override void OnNewFrameFixed(Game game, NewFrameEventArgs args)
 {
     if (game.reloadstartMilliseconds != 0
         && (game.one * (game.platform.TimeMillisecondsFromStart() - game.reloadstartMilliseconds) / 1000)
         > game.DeserializeFloat(game.blocktypes[game.reloadblock].ReloadDelayFloat))
     {
         {
             int loaded = game.TotalAmmo[game.reloadblock];
             loaded = MathCi.MinInt(game.blocktypes[game.reloadblock].AmmoMagazine, loaded);
             game.LoadedAmmo[game.reloadblock] = loaded;
             game.reloadstartMilliseconds = 0;
             game.reloadblock = -1;
         }
     }
 }
 public override void OnNewFrame(Game game, NewFrameEventArgs args)
 {
     if (game.guistate == GuiState.MapLoading)
     {
         return;
     }
     if (!started)
     {
         started = true;
         if (!game.issingleplayer)
         {
             skinserverResponse = new HttpResponseCi();
             game.platform.WebClientDownloadDataAsync("http://manicdigger.sourceforge.net/skinserver.txt", skinserverResponse);
         }
     }
     LoadPlayerTextures(game);
 }
示例#10
0
 public override void OnNewFrameFixed(Game game, NewFrameEventArgs args)
 {
     if (game.guistate == GuiState.MapLoading)
     {
         return;
     }
     if (game.controls.freemove)
     {
         if (fallSoundPlaying)
         {
             SetFallSoundActive(game, false);
         }
         return;
     }
     if (game.FollowId() == null)
     {
         UpdateFallDamageToPlayer(game, args.GetDt());
     }
 }
示例#11
0
    public override void OnNewFrameFixed(Game game, NewFrameEventArgs args)
    {
        game.pushX = 0;
        game.pushY = 0;
        game.pushZ = 0;

        float LocalPlayerPositionX = game.player.position.x;
        float LocalPlayerPositionY = game.player.position.y;
        float LocalPlayerPositionZ = game.player.position.z;
        for (int i = 0; i < game.entitiesCount; i++)
        {
            Entity entity = game.entities[i];
            if (entity == null) { continue; }
            if (entity.push == null) { continue; }
            //Prevent players that aren't displayed from pushing
            if (entity.networkPosition != null && !entity.networkPosition.PositionLoaded) { continue; }
            float kposX = game.DeserializeFloat(entity.push.XFloat);
            float kposY = game.DeserializeFloat(entity.push.ZFloat);
            float kposZ = game.DeserializeFloat(entity.push.YFloat);
            if (entity.push.IsRelativeToPlayerPosition != 0)
            {
                kposX += LocalPlayerPositionX;
                kposY += LocalPlayerPositionY;
                kposZ += LocalPlayerPositionZ;
            }
            float dist = game.Dist(kposX, kposY, kposZ, LocalPlayerPositionX, LocalPlayerPositionY, LocalPlayerPositionZ);
            if (dist < game.DeserializeFloat(entity.push.RangeFloat))
            {
                float diffX = LocalPlayerPositionX - kposX;
                float diffY = LocalPlayerPositionY - kposY;
                float diffZ = LocalPlayerPositionZ - kposZ;
                game.pushX += diffX;
                game.pushY += diffY;
                game.pushZ += diffZ;
            }
        }
    }
示例#12
0
 public override void OnNewFrame(NewFrameEventArgs args)
 {
     l.OnNewFrame(args);
 }
示例#13
0
    public void OnNewFrame(NewFrameEventArgs args)
    {
        if (!initialized)
        {
            initialized = true;
            p.InitShaders();

            p.GlClearColorRgbaf(0, 0, 0, 1);
            p.GlEnableDepthTest();
        }
        viewportWidth = p.GetCanvasWidth();
        viewportHeight = p.GetCanvasHeight();
        DrawScene(args.GetDt());
        Animate(args.GetDt());
        loginClient.Update(p);
    }
示例#14
0
        /// <summary>
        /// Notifies clients about new frame.
        /// </summary>
        /// 
        /// <param name="bmp">New frame's image.</param>
        /// 
        private void OnNewFrame( Bitmap bmp )
        {
            var nf = NewFrame;
            var se = _stopEvent;
            if (nf == null || se == null || (se.WaitOne(0, false)))
            {
                bmp.Dispose();
                return;
            }

            _framesReceived++;
            _bytesReceived += bmp.Width * bmp.Height * ( Image.GetPixelFormatSize( bmp.PixelFormat ) >> 3 );
           
            var dae = new NewFrameEventArgs(bmp);
            nf.Invoke(this, dae);
            bmp.Dispose();       
           
            
        }
示例#15
0
 public override void OnNewFrame(Game game, NewFrameEventArgs args)
 {
     game.packetHandlers[Packet_ServerIdEnum.EntitySpawn] = spawn;
     game.packetHandlers[Packet_ServerIdEnum.EntityPosition] = position;
     game.packetHandlers[Packet_ServerIdEnum.EntityDespawn] = despawn;
 }
示例#16
0
 public abstract void OnNewFrame(NewFrameEventArgs args);
示例#17
0
 private void NewFrame(object sender, NewFrameEventArgs<int> args)
 {
     angle = args.Data;
     base.QueueDraw ();
 }
 public override void OnNewFrame(Game game, NewFrameEventArgs args)
 {
     float dt = args.GetDt();
     UpdateGraph(dt);
     UpdateTitleFps(dt);
     Draw();
 }
示例#19
0
 void SourceNewFrame(object sender, NewFrameEventArgs eventArgs)
 {
     var bm = (Bitmap)eventArgs.Frame.Clone();
     NewFrame?.Invoke(this, new NewFrameEventArgs(bm));
     bm.Dispose();
 }
示例#20
0
 public override void OnNewFrameFixed(Game game, NewFrameEventArgs args)
 {
     lines = new DrawWireframeCube();
 }
示例#21
0
    internal void GotoDraw2d(float dt)
    {
        SetAmbientLight(Game.ColorFromArgb(255, 255, 255, 255));
        Draw2d(dt);

        NewFrameEventArgs args_ = new NewFrameEventArgs();
        args_.SetDt(dt);
        for (int i = 0; i < clientmodsCount; i++)
        {
            clientmods[i].OnNewFrame(this, args_);
        }

        mouseleftclick = mouserightclick = false;
        mouseleftdeclick = mouserightdeclick = false;
        if ((!issingleplayer)
            || (issingleplayer && platform.SinglePlayerServerLoaded())
            || (!platform.SinglePlayerServerAvailable()))
        {
            if (!startedconnecting)
            {
                startedconnecting = true;
                Connect__();
            }
        }
    }
示例#22
0
    internal void FrameTick(float dt)
    {
        NewFrameEventArgs args_ = new NewFrameEventArgs();
        args_.SetDt(dt);
        for (int i = 0; i < clientmodsCount; i++)
        {
            clientmods[i].OnNewFrameFixed(this, args_);
        }
        for (int i = 0; i < entitiesCount; i++)
        {
            Entity e = entities[i];
            if (e == null) { continue; }
            for (int k = 0; k < e.scriptsCount; k++)
            {
                e.scripts[k].OnNewFrameFixed(this, i, dt);
            }
        }
        RevertSpeculative(dt);

        if (guistate == GuiState.MapLoading) { return; }

        float orientationX = platform.MathSin(player.position.roty);
        float orientationY = 0;
        float orientationZ = -platform.MathCos(player.position.roty);
        platform.AudioUpdateListener(EyesPosX(), EyesPosY(), EyesPosZ(), orientationX, orientationY, orientationZ);

        playervelocity.X = player.position.x - lastplayerpositionX;
        playervelocity.Y = player.position.y - lastplayerpositionY;
        playervelocity.Z = player.position.z - lastplayerpositionZ;
        playervelocity.X *= 75;
        playervelocity.Y *= 75;
        playervelocity.Z *= 75;
        lastplayerpositionX = player.position.x;
        lastplayerpositionY = player.position.y;
        lastplayerpositionZ = player.position.z;
    }
示例#23
0
 public virtual void OnNewFrameFixed(Game game, NewFrameEventArgs args) { }
示例#24
0
        // Worker thread
        private void WorkerThread()
        {
            // buffer to read stream
            var buffer = new byte[BufSize];
            var encoding = new ASCIIEncoding();
            var res = ReasonToFinishPlaying.StoppedByUser;
            while (!_stopEvent.WaitOne(0, false) && !MainForm.ShuttingDown)
            {
                // reset reload event
                _reloadEvent.Reset();

                // HTTP web request
                HttpWebRequest request = null;
                // web responce
                WebResponse response = null;
                // stream for MJPEG downloading
                Stream stream = null;
                // boundary betweeen images (string and binary versions)

                try
                {
                    // create request
                    request = (HttpWebRequest)WebRequest.Create(_source);
                    // set user agent
                    if (_userAgent != null)
                    {
                        request.UserAgent = _userAgent;
                    }

                    // set proxy
                    if (_proxy != null)
                    {
                        request.Proxy = _proxy;
                    }

                    if (_usehttp10)
                        request.ProtocolVersion = HttpVersion.Version10;

                    // set timeout value for the request
                    request.Timeout = request.ServicePoint.ConnectionLeaseTimeout = request.ServicePoint.MaxIdleTime = _requestTimeout;
                    request.AllowAutoRedirect = true;

                    // set login and password
                    if ((_login != null) && (_password != null) && (_login != string.Empty))
                        request.Credentials = new NetworkCredential(_login, _password);
                    // set connection group name
                    if (_useSeparateConnectionGroup)
                        request.ConnectionGroupName = GetHashCode().ToString();
                    // get response
                    response = request.GetResponse();

                    // get response stream
                    stream = response.GetResponseStream();
                    stream.ReadTimeout = _requestTimeout;

                    byte[] boundary = encoding.GetBytes("--myboundary");
                    byte[] sep = encoding.GetBytes("\r\n\r\n");

                    // loop

                    int startPacket = -1;
                    int endPacket = -1;
                    int ttl = 0;

                    bool hasaudio = false;

                    while ((!_stopEvent.WaitOne(0, false)) && (!_reloadEvent.WaitOne(0, false)))
                    {

                        int read;
                        if ((read = stream.Read(buffer, ttl, ReadSize)) == 0)
                            throw new ApplicationException();

                        ttl += read;

                        if (startPacket==-1)
                        {
                            startPacket = ByteArrayUtils.Find(buffer, boundary, 0, ttl);
                        }
                        else
                        {
                            if (endPacket == -1)
                            {
                                endPacket = ByteArrayUtils.Find(buffer, boundary, startPacket + boundary.Length, ttl-(startPacket + boundary.Length));
                            }
                        }

                        var nf = NewFrame;

                        if (startPacket>-1 && endPacket>startPacket)
                        {
                            int br = ByteArrayUtils.Find(buffer, sep, startPacket, 100);

                            if (br != -1)
                            {
                                var arr = new byte[br];
                                System.Array.Copy(buffer, startPacket, arr, 0, br - startPacket);
                                string s = Encoding.ASCII.GetString(arr);
                                int k = s.IndexOf("Content-type: ", StringComparison.Ordinal);
                                if (k!=-1)
                                {
                                    s = s.Substring(k+14);
                                    s = s.Substring(0,s.IndexOf("\r\n", StringComparison.Ordinal));
                                    s = s.Trim();
                                }
                                switch (s)
                                {
                                    case "image/jpeg":
                                        try
                                        {

                                            using (var ms = new MemoryStream(buffer, br + 4, endPacket - br - 8))
                                            {
                                                using (var bmp = (Bitmap)Image.FromStream(ms))
                                                {
                                                    var dae = new NewFrameEventArgs(bmp);
                                                    nf.Invoke(this, dae);
                                                }
                                            }
                                        }
                                        catch (Exception ex)
                                        {
                                            //sometimes corrupted packets come through...
                                            MainForm.LogExceptionToFile(ex,"KinectNetwork");
                                        }

                                        break;
                                    case "audio/raw":
                                        if (!hasaudio)
                                        {
                                            hasaudio = true;
                                            //fixed 16khz 1 channel format
                                            RecordingFormat = new WaveFormat(16000, 16, 1);

                                            _waveProvider = new BufferedWaveProvider(RecordingFormat) { DiscardOnBufferOverflow = true, BufferDuration = TimeSpan.FromMilliseconds(500) };

                                            _sampleChannel = new SampleChannel(_waveProvider);
                                            _sampleChannel.PreVolumeMeter +=SampleChannelPreVolumeMeter;
                                            if (HasAudioStream != null)
                                            {
                                                HasAudioStream(this, EventArgs.Empty);
                                                HasAudioStream = null;
                                            }
                                        }

                                        var da = DataAvailable;
                                        if (da != null)
                                        {
                                            int l = endPacket - br - 8;
                                            var data = new byte[l];
                                            int d;
                                            using (var ms = new MemoryStream(buffer, br+4, l))
                                            {
                                                d = ms.Read(data, 0, l);
                                            }
                                            if (d > 0)
                                            {
                                                _waveProvider.AddSamples(data, 0, data.Length);

                                                if (Listening)
                                                {
                                                    WaveOutProvider.AddSamples(data, 0, data.Length);
                                                }

                                                //forces processing of volume level without piping it out
                                                var sampleBuffer = new float[data.Length];
                                                int r = _sampleChannel.Read(sampleBuffer, 0, data.Length);

                                                da(this, new DataAvailableEventArgs((byte[]) data.Clone(),r));
                                            }
                                        }

                                        break;
                                    case "alert/text":
                                        // code to handle alert notifications goes here
                                        if (AlertHandler != null)
                                        {
                                            int dl = endPacket - br - 8;
                                            var data2 = new byte[dl];
                                            using (var ms = new MemoryStream(buffer, br + 4, dl))
                                            {
                                                ms.Read(data2, 0, dl);
                                            }
                                            string alerttype = Encoding.ASCII.GetString(data2);
                                            AlertHandler(this, new AlertEventArgs(alerttype));
                                        }
                                        break;
                                }
                            }

                            ttl -= endPacket;
                            System.Array.Copy(buffer, endPacket, buffer, 0, ttl);
                            startPacket = -1;
                            endPacket = -1;
                        }

                    }
                }
                catch (ApplicationException)
                {
                    // do nothing for Application Exception, which we raised on our own
                    // wait for a while before the next try
                    Thread.Sleep(250);
                }
                catch (ThreadAbortException)
                {
                    break;
                }
                catch (Exception ex)
                {
                    // provide information to clients
                    MainForm.LogExceptionToFile(ex, "KinectNetwork");
                    res = ReasonToFinishPlaying.DeviceLost;
                    break;
                    // wait for a while before the next try
                    //Thread.Sleep(250);
                }
                finally
                {
                    request?.Abort();
                    stream?.Flush();
                    stream?.Close();
                    response?.Close();
                }

                // need to stop ?
                if (_stopEvent.WaitOne(0, false))
                    break;
            }

            PlayingFinished?.Invoke(this, new PlayingFinishedEventArgs(res));
        }
示例#25
0
 private static void HandleFrame(object sender, NewFrameEventArgs camera, string webcamIdHash)
 {
     if (camera?.Frame != null)
     {
         using (var ms = new MemoryStream())
         {
             camera.Frame.Save(ms, ImageFormat.Jpeg);
             var imageBytes = ms.ToArray();
             _Frames[webcamIdHash] = imageBytes;
         }
     }
 }
示例#26
0
    // Todo: cubic interpolation
    public override void OnNewFrame(Game game, NewFrameEventArgs args)
    {
        float dt = args.GetDt();
        if (playingTime == -1)
        {
            return;
        }
        playingTime += dt;
        float playingDist = playingTime * playingSpeed;

        UpdateAvi(dt);

        float distA = 0;
        int foundPoint = -1;
        for (int i = 0; i < cameraPointsCount - 1; i++)
        {
            CameraPoint a = cameraPoints[i];
            CameraPoint b = cameraPoints[i + 1];
            float dist = Distance(a, b);
            if (playingDist >= distA && playingDist < distA + dist)
            {
                foundPoint = i;
                break;
            }
            distA += dist;
        }
        if (foundPoint == -1)
        {
            Stop();
            return;
        }
        {
            CameraPoint a = cameraPoints[foundPoint];
            CameraPoint b = cameraPoints[foundPoint + 1];
            CameraPoint aminus = a;
            CameraPoint bplus = b;
            if (foundPoint -1 >= 0)
            {
                aminus = cameraPoints[foundPoint - 1];
            }
            if (foundPoint + 2 < cameraPointsCount)
            {
                bplus = cameraPoints[foundPoint + 2];
            }

            float t = (playingDist - distA) / Distance(a, b);
            float x = q(t, aminus.positionGlX, a.positionGlX, b.positionGlX, bplus.positionGlX);
            float y = q(t, aminus.positionGlY, a.positionGlY, b.positionGlY, bplus.positionGlY);
            float z = q(t, aminus.positionGlZ, a.positionGlZ, b.positionGlZ, bplus.positionGlZ);
            m.SetLocalPosition(x, y, z);

            float orientx = q(t, aminus.orientationGlX, a.orientationGlX, b.orientationGlX, bplus.orientationGlX);
            float orienty = q(t, aminus.orientationGlY, a.orientationGlY, b.orientationGlY, bplus.orientationGlY);
            float orientz = q(t, aminus.orientationGlZ, a.orientationGlZ, b.orientationGlZ, bplus.orientationGlZ);
            m.SetLocalOrientation(orientx, orienty, orientz);
        }
    }
示例#27
0
文件: Form1.cs 项目: haivido/Vido
 void capture2_NewFrame(ICapture sender, NewFrameEventArgs e)
 {
     pictureBox2.Image = e.Bitmap;
 }
示例#28
0
 public override void OnNewFrameFixed(Game game, NewFrameEventArgs args)
 {
     if (game.guistate != GuiState.CraftingRecipes)
     {
         return;
     }
     CraftingMouse(game);
 }
示例#29
0
    public override void OnNewFrameFixed(Game game, NewFrameEventArgs args)
    {
        float one = 1;
        float dt = args.GetDt();

        if (game.guistate == GuiState.MapLoading) { return; }

        bool angleup = false;
        bool angledown = false;
        float overheadcameraanglemovearea = one * 5 / 100;
        float overheadcameraspeed = 3;
        game.controls.wantsjump = game.guistate == GuiState.Normal && game.GuiTyping == TypingState.None && game.keyboardState[game.GetKey(GlKeys.Space)];
        game.controls.wantsjumphalf = false;
        game.controls.shiftkeydown = game.guistate == GuiState.Normal && game.GuiTyping == TypingState.None && game.keyboardState[game.GetKey(GlKeys.ShiftLeft)];
        game.controls.movedx = 0;
        game.controls.movedy = 0;
        game.controls.moveup = false;
        game.controls.movedown = false;
        if (game.guistate == GuiState.Normal)
        {
            if (game.GuiTyping == TypingState.None)
            {
                if (game.reachedwall_1blockhigh && (game.AutoJumpEnabled || (!game.platform.IsMousePointerLocked())))
                {
                    game.controls.wantsjump = true;
                }
                if (game.reachedHalfBlock)
                {
                    game.controls.wantsjumphalf = true;
                }
                if (game.overheadcamera)
                {
                    CameraMove m = new CameraMove();
                    if (game.keyboardState[game.GetKey(GlKeys.A)]) { game.overheadcameraK.TurnRight(dt * overheadcameraspeed); }
                    if (game.keyboardState[game.GetKey(GlKeys.D)]) { game.overheadcameraK.TurnLeft(dt * overheadcameraspeed); }
                    if (game.keyboardState[game.GetKey(GlKeys.W)]) { angleup = true; }
                    if (game.keyboardState[game.GetKey(GlKeys.S)]) { angledown = true; }
                    game.overheadcameraK.Center.X = game.player.position.x;
                    game.overheadcameraK.Center.Y = game.player.position.y;
                    game.overheadcameraK.Center.Z = game.player.position.z;
                    m.Distance = game.overheadcameradistance;
                    m.AngleUp = angleup;
                    m.AngleDown = angledown;
                    game.overheadcameraK.Move(m, dt);
                    float toDest = game.Dist(game.player.position.x, game.player.position.y, game.player.position.z,
                    game.playerdestination.X + one / 2, game.playerdestination.Y - one / 2, game.playerdestination.Z + one / 2);
                    if (toDest >= 1)
                    {
                        game.controls.movedy += 1;
                        if (game.reachedwall)
                        {
                            game.controls.wantsjump = true;
                        }
                        //player orientation
                        float qX = game.playerdestination.X - game.player.position.x;
                        float qY = game.playerdestination.Y - game.player.position.y;
                        float qZ = game.playerdestination.Z - game.player.position.z;
                        float angle = game.VectorAngleGet(qX, qY, qZ);
                        game.player.position.roty = Game.GetPi() / 2 + angle;
                        game.player.position.rotx = Game.GetPi();
                    }
                }
                else if (game.enable_move)
                {
                    if (game.keyboardState[game.GetKey(GlKeys.W)]) { game.controls.movedy += 1; }
                    if (game.keyboardState[game.GetKey(GlKeys.S)]) { game.controls.movedy += -1; }
                    if (game.keyboardState[game.GetKey(GlKeys.A)]) { game.controls.movedx += -1; game.localplayeranimationhint.leanleft = true; game.localstance = 1; }
                    else { game.localplayeranimationhint.leanleft = false; }
                    if (game.keyboardState[game.GetKey(GlKeys.D)]) { game.controls.movedx += 1; game.localplayeranimationhint.leanright = true; game.localstance = 2; }
                    else { game.localplayeranimationhint.leanright = false; }
                    if (!game.localplayeranimationhint.leanleft && !game.localplayeranimationhint.leanright) { game.localstance = 0; }

                    game.controls.movedx += game.touchMoveDx;
                    game.controls.movedy += game.touchMoveDy;
                }
            }
            if (game.controls.freemove || game.SwimmingEyes())
            {
                if (game.GuiTyping == TypingState.None && game.keyboardState[game.GetKey(GlKeys.Space)])
                {
                    game.controls.moveup = true;
                }
                if (game.GuiTyping == TypingState.None && game.keyboardState[game.GetKey(GlKeys.ControlLeft)])
                {
                    game.controls.movedown = true;
                }
            }
        }
    }
示例#30
0
void FinalVideo_NewFrame(object sender, NewFrameEventArgs eventArgs)
{
    Bitmap video = (Bitmap)eventArgs.Frame.Clone();
    pictureBox1.Image = video;

}