Beispiel #1
0
        /// <summary>
        /// Initialize subsystem
        /// </summary>
        /// <param name="api">Subsystem wrapper reference</param>
        /// <returns>True if successful</returns>
        public bool Initialize(RetroBlitAPI api)
        {
            mRetroBlitAPI = api;

            if (!VerifyInputManagerSettings())
            {
                Debug.LogError("InputManager is not setup properly for RetroBlit. Please import RetroBlit project as a complete project from the Asset Manager in order to also import the RetroBlit InputManager settings. Alternatively you can copy ProjectSettings/InputManager.asset from another RetroBlit project.");
                return(false);
            }

            mButtonCount = (int)Mathf.Log(BUTTON_LAST, 2) + 1;

            for (int i = 0; i < RetroBlitHW.HW_MAX_PLAYERS; i++)
            {
                mButtonCurrentState[i]  = new Dictionary <int, bool>();
                mButtonPreviousState[i] = new Dictionary <int, bool>();
            }

            for (int i = 0; i < MAX_TOUCHES; i++)
            {
                mPointer[i].Reset();
            }

            GetAllButtonStates(mButtonCurrentState);

            // Disable Unity mouse simulation with touches, we'll handle this ourselves.
            Input.simulateMouseWithTouches = false;

            return(true);
        }
        /// <summary>
        /// Initialize subsystem
        /// </summary>
        /// <param name="api">Subsystem wrapper reference</param>
        /// <returns>True if successful</returns>
        public bool Initialize(RetroBlitAPI api)
        {
            mPropIDPixelTexture          = Shader.PropertyToID("_PixelTexture");
            mPropIDPixelTextureSize      = Shader.PropertyToID("_PixelTextureSize");
            mPropIDPresentSize           = Shader.PropertyToID("_PresentSize");
            mPropIDSystemTexture         = Shader.PropertyToID("_SystemTexture");
            mPropIDSampleFactor          = Shader.PropertyToID("_SampleFactor");
            mPropIDScanlineIntensity     = Shader.PropertyToID("_ScanlineIntensity");
            mPropIDScanlineOffset        = Shader.PropertyToID("_ScanlineOffset");
            mPropIDScanlineLength        = Shader.PropertyToID("_ScanlineLength");
            mPropIDNearestEvenScanHeight = Shader.PropertyToID("_NearestEvenScanHeight");
            mPropIDDesaturationIntensity = Shader.PropertyToID("_DesaturationIntensity");
            mPropIDNoiseIntensity        = Shader.PropertyToID("_NoiseIntensity");
            mPropIDNoiseSeed             = Shader.PropertyToID("_NoiseSeed");
            mPropIDCurvatureIntensity    = Shader.PropertyToID("_CurvatureIntensity");
            mPropIDColorFade             = Shader.PropertyToID("_ColorFade");
            mPropIDColorFadeIntensity    = Shader.PropertyToID("_ColorFadeIntensity");
            mPropIDColorTint             = Shader.PropertyToID("_ColorTint");
            mPropIDColorTintIntensity    = Shader.PropertyToID("_ColorTintIntensity");
            mPropIDFizzleColor           = Shader.PropertyToID("_FizzleColor");
            mPropIDFizzleIntensity       = Shader.PropertyToID("_FizzleIntensity");
            mPropIDNegativeIntensity     = Shader.PropertyToID("_NegativeIntensity");
            mPropIDPixelateIntensity     = Shader.PropertyToID("_PixelateIntensity");

            mRetroBlitAPI = api;

            mCamera = Camera.main;

            if (RB.DisplaySize.width <= 0 || RB.DisplaySize.height <= 0)
            {
                return(false);
            }

            var material = mRetroBlitAPI.ResourceBucket.LoadMaterial("PresentMaterial");

            mPresentMaterial = new Material(material);

            material = mRetroBlitAPI.ResourceBucket.LoadMaterial("PresentRetroMaterial");
            mPresentRetroMaterial = new Material(material);

            material = mRetroBlitAPI.ResourceBucket.LoadMaterial("PresentRetroNoiseMaterial");
            mPresentRetroNoiseMaterial = new Material(material);

            mCurrentPresentMaterial = mPresentMaterial;

            /* Dummy camera exists only to keep Unity Editor IDE from complaining that nothing is rendering,
             * if this is not an editor build then we can destroy this camera */
#if !UNITY_EDITOR
            var dummyCamera = GameObject.Find("RetroBlitDummyCamera");
            if (dummyCamera != null)
            {
                Destroy(dummyCamera);
            }
#endif

            return(true);
        }
Beispiel #3
0
        /// <summary>
        /// Initialize the subsystem
        /// </summary>
        /// <param name="api">Reference to subsystem wrapper</param>
        /// <returns>True if successful</returns>
        public bool Initialize(RetroBlitAPI api)
        {
            for (int i = 0; i < MAX_SAMPLE_POINTS; i++)
            {
                mUpdateDeltas[i] = -1;
            }

            mRetroBlitAPI = api;
            return(true);
        }
Beispiel #4
0
#pragma warning restore 0414

        /// <summary>
        /// Initialize the subsystem
        /// </summary>
        /// <param name="api">Reference to subsystem wrapper</param>
        /// <returns>True if successful</returns>
        public bool Initialize(RetroBlitAPI api)
        {
            mRetroBlitAPI = api;

            for (int i = 0; i < mParams.Length; i++)
            {
                mParams[i] = new EffectParams();
            }

            EffectReset();

            return(true);
        }
Beispiel #5
0
        /// <summary>
        /// Initialize the subsystem
        /// </summary>
        /// <param name="api">Reference to subsystem wrapper</param>
        /// <returns>True if successful</returns>
        public bool Initialize(RetroBlitAPI api)
        {
            mRetroBlitAPI = api;

            var audioSourceObj = GameObject.Find("RetroBlitAudio");

            if (audioSourceObj == null)
            {
                Debug.Log("Can't find RetroBlitAudio!");
                return(false);
            }

            InitializeChannels();

            return(true);
        }