private void DrawPong(int x, int y) { int[] field_ntsc = new int[4] { 0, 0, 0, 0 }; AnalogTV.analogtv_lcp_to_ntsc(AnalogTV.ANALOGTV_WHITE_LEVEL, 0.0, 0.0, field_ntsc); AnalogTV.analogtv_draw_solid(this.inputPtr, AnalogTV.ANALOGTV_VIS_START, AnalogTV.ANALOGTV_VIS_END, AnalogTV.ANALOGTV_TOP, AnalogTV.ANALOGTV_BOT, field_ntsc); AnalogTV.analogtv_color(5, field_ntsc); if (IntPtr.Zero == this.pongBitmap) { AnalogTV.analogtv_draw_solid(this.inputPtr, AnalogTV.ANALOGTV_VIS_START + x, (int)(AnalogTV.ANALOGTV_VIS_START + x + this.pongWidth), AnalogTV.ANALOGTV_TOP + y, (int)(AnalogTV.ANALOGTV_TOP + y + this.pongHeight), field_ntsc); } else { AnalogTV.analogtv_draw_image(this.inputPtr, this.pongBitmap, AnalogTV.ANALOGTV_VIS_START + x, AnalogTV.ANALOGTV_TOP + y, this.pongWidth, this.pongHeight); } //AnalogTV.analogtv_reception_reallocate( this.recPtr, this.inputPtr ); }
private void PongViewer_Resize(object sender, EventArgs e) { if (IntPtr.Zero != this.tvPtr) { AnalogTV.analogtv_reconfigure(this.tvPtr); } }
private void PongViewer_Load(object sender, EventArgs e) { //this.Width = 640; //this.Height = 480; int[] ntsc = new int[4] { 0, 0, 0, 0 }; /* * this.pixels = new int[this.Width][]; * for( int i = 0 ; this.Height > i ; i++ ) { * this.pixels[i] = new int[this.Height]; * } */ //this.tvPtr = (AnalogTV.analogtv)Marshal.PtrToStructure( AnalogTV.analogtv_allocate(this.Handle),typeof(AnalogTV.analogtv) ); //this.inputPtr = (AnalogTV.analogtv_input)Marshal.PtrToStructure( AnalogTV.analogtv_input_allocate(),typeof(AnalogTV.analogtv_input) ); this.tvPtr = AnalogTV.analogtv_allocate(panel1.Handle); this.inputPtr = AnalogTV.analogtv_input_allocate(); //AnalogTV.analogtv_set_defaults( this.tvPtr ); AnalogTV.analogtv_setup_sync(inputPtr, 1, 0); //int[] field_ntsc = new int[4] { 0, 0, 0, 0 }; /* * AnalogTV.analogtv_lcp_to_ntsc( AnalogTV.ANALOGTV_BLACK_LEVEL, 0.0, 0.0, field_ntsc ); * * AnalogTV.analogtv_draw_solid( * inputPtr, * AnalogTV.ANALOGTV_VIS_START, * AnalogTV.ANALOGTV_VIS_END, * AnalogTV.ANALOGTV_TOP, * AnalogTV.ANALOGTV_BOT, * field_ntsc * ); * * AnalogTV.analogtv_lcp_to_ntsc( AnalogTV.ANALOGTV_BLACK_LEVEL, 0.0, 0.0, this.ntsc ); * AnalogTV.analogtv_draw_solid( inputPtr, AnalogTV.ANALOGTV_VIS_START, AnalogTV.ANALOGTV_VIS_END, AnalogTV.ANALOGTV_TOP, AnalogTV.ANALOGTV_BOT, this.ntsc ); */ this.recPtr = AnalogTV.analogtv_reception_allocate(2.0f, inputPtr); /* * Timer TPaint = new Timer(); * TPaint.Interval = 50; * TPaint.Tick += this.TPaint_Tick; * TPaint.Enabled = true; * TPaint.Start(); */ Timer TPong = new Timer(); TPong.Interval = 50; TPong.Tick += this.TPong_Tick; TPong.Enabled = true; TPong.Start(); }
public void SetPongImage(string pathIn) { if (IntPtr.Zero != this.pongBitmap) { AnalogTV.analogtv_free_imagefile(this.pongBitmap); } this.pongX = 0; this.pongY = 0; uint widthIn = 0, heightIn = 0; AnalogTV.analogtv_load_bitmap(pathIn, out this.pongBitmap, out widthIn, out heightIn); this.pongWidth = widthIn; this.pongHeight = heightIn; this.pongMaxX = AnalogTV.ANALOGTV_VIS_LEN - widthIn; this.pongMaxY = AnalogTV.ANALOGTV_VISLINES - heightIn; }
private void TPong_Tick(Object sender, EventArgs e) { if (this.pongMaxX < this.pongX || 0 > this.pongX) { this.pongXInc *= -1; } if (this.pongMaxY < this.pongY || 0 > this.pongY) { this.pongYInc *= -1; } this.pongX += this.pongXInc; this.pongY += this.pongYInc; this.DrawPong(this.pongX, this.pongY); AnalogTV.analogtv_reception_update(this.recPtr); AnalogTV.analogtv_draw(this.tvPtr, 0.04, ref this.recPtr, 1); }
public IEnumerator SentenceAnim() { yield return(new WaitForSeconds(1f)); sentence.DOFade(1, 4f).SetEase(Ease.Linear); sentence.transform.DOScale(1.15f, 8f); //Fade Effects LensDistortionBlur disto = sentenceCamera.GetComponent <LensDistortionBlur>(); DOTween.To(() => disto.Distortion, x => disto.Distortion = x, 0.7f, 4); AnalogTV tv = sentenceCamera.GetComponent <AnalogTV>(); DOTween.To(() => tv.Distortion, x => tv.Distortion = x, -0.5f, 4); UnityStandardAssets.ImageEffects.BloomOptimized bloom = sentenceCamera.GetComponent <UnityStandardAssets.ImageEffects.BloomOptimized>(); DOTween.To(() => bloom.intensity, x => bloom.intensity = x, 1f, 3); yield return(new WaitForSeconds(textDuration)); DOTween.To(() => disto.Distortion, x => disto.Distortion = x, 0f, 4); //End sentence.DOFade(0, 1f); Led led = sentenceCamera.GetComponent <Led>(); DOTween.To(() => led.Scale, x => led.Scale = x, 5, 1); sentenceCamera.GetComponent <Glitch>().enabled = true; SFX_Glitch.Play(); yield return(new WaitForSeconds(1)); inGameCanvas.SetActive(true); sentenceCamera.SetActive(false); background.DOFade(0, 3f); crosshairAlpha.DOFade(1, 3f); player.enabled = true; }