示例#1
0
        //-- Add Stage
        private void button1_Click(object sender, EventArgs e)
        {
            if (!bInitialized)
            {
                return;
            }

            OpenFileDialog d = new OpenFileDialog();

            d.InitialDirectory = CoreGlobals.getSaveLoadPaths().mParticleEffectDirectory;
            d.Filter           = "TGA Texture (*.tga)|*.tga";
            if (d.ShowDialog() == DialogResult.OK)
            {
                EditorCore.CoreGlobals.getSaveLoadPaths().mParticleEffectDirectory = Path.GetDirectoryName(d.FileName);

                TextureStage newTexture = new TextureStage();

                String           filePath = d.FileName;
                ResourcePathInfo pathInfo = new ResourcePathInfo(d.FileName);

                newTexture.file = pathInfo.RelativePath;

                //-- strip out the stupid art directory -
                //-- ResourcePathInfo should cooler and do this for you
                if (mArtFolder.Length > 0)
                {
                    newTexture.file = newTexture.file.Substring(mArtFolder.Length);
                }

                newTexture.weight = 1.0f;
                data.Textures.Add(newTexture);

                refreshListBox(false);
                getModifiedData();

                //-- select the new item
                int selectedItem = listView1.Items.Count - 1;
                if (selectedItem < 0)
                {
                    selectedItem = 0;
                }
                selectItem(selectedItem);
            }
        }
示例#2
0
 public void SetTextureStageState(int stage, TextureStage type, int value)
 {
     int res = Interop.Calli(comPointer, stage, (int)type, value,(*(IntPtr**)comPointer)[67]);
     if( res < 0 ) { throw new SharpDXException( res ); }
 }
示例#3
0
		private void LoadMaterialTextureMatrix(float[] materialRegisters, TextureStage textureStage)
		{
			float[] matrix = GetMaterialTextureMatrix(materialRegisters, textureStage);

			// need texture uv transform
			// TODO: idConsole.WriteLine("TODO: LoadMaterialTextureMatrix");

			/*qglMatrixMode(GL_TEXTURE);
			qglLoadMatrixf(matrix);
			qglMatrixMode(GL_MODELVIEW);*/
		}
示例#4
0
		private float[] GetMaterialTextureMatrix(float[] materialRegisters, TextureStage textureStage)
		{
			float[] matrix = new float[16];

			matrix[0] = materialRegisters[textureStage.Matrix[0, 0]];
			matrix[4] = materialRegisters[textureStage.Matrix[0, 1]];
			matrix[8] = 0;
			matrix[12] = materialRegisters[textureStage.Matrix[0, 2]];

			// we attempt to keep scrolls from generating incredibly large texture values, but
			// center rotations and center scales can still generate offsets that need to be > 1
			if((matrix[12] < -40) || (matrix[12] > 40))
			{
				matrix[12] -= (int) matrix[12];
			}

			matrix[1] = materialRegisters[textureStage.Matrix[1, 0]];
			matrix[5] = materialRegisters[textureStage.Matrix[1, 1]];
			matrix[9] = 0;
			matrix[13] = materialRegisters[textureStage.Matrix[1, 2]];

			if((matrix[13] < -40) || (matrix[13] > 40))
			{
				matrix[13] -= (int) matrix[13];
			}

			matrix[2] = 0;
			matrix[6] = 0;
			matrix[10] = 1;
			matrix[14] = 0;

			matrix[3] = 0;
			matrix[7] = 0;
			matrix[11] = 0;
			matrix[15] = 1;

			return matrix;
		}
示例#5
0
		/// <summary>
		/// Handles generating a cinematic frame if needed.
		/// </summary>
		/// <param name="texture"></param>
		/// <param name="registers"></param>
		private void BindVariableStageImage(TextureStage texture, float[] registers)
		{
			/* TODO: if(texture.IsCinematic == true)*/
			if(false)
			{
				idConsole.Warning("TODO: BindVariableStageImage cinematic");
				/*cinData_t	cin;

				if ( r_skipDynamicTextures.GetBool() ) {
					globalImages->defaultImage->Bind();
					return;
				}

				// offset time by shaderParm[7] (FIXME: make the time offset a parameter of the shader?)
				// We make no attempt to optimize for multiple identical cinematics being in view, or
				// for cinematics going at a lower framerate than the renderer.
				cin = texture->cinematic->ImageForTime( (int)(1000 * ( backEnd.viewDef->floatTime + backEnd.viewDef->renderView.shaderParms[11] ) ) );

				if ( cin.image ) {
					globalImages->cinematicImage->UploadScratch( cin.image, cin.imageWidth, cin.imageHeight );
				} else {
					globalImages->blackImage->Bind();
				}*/
			}
			else
			{
				//FIXME: see why image is invalid
				if(texture.Image != null)
				{
					texture.Image.Bind();
				}
			}
		}
 public void SetTextureStageState(int stage, TextureStage type, int value)
 {
     device.SetTextureStageState(stage, type, value);
 }
示例#7
0
 private void SetTextureStageState(int stage, TextureStage type, TextureOperation value)
 {
     SetTextureStageState(stage, type, (int)value);
 }
示例#8
0
 private void SetTextureStageState(int stage, TextureStage type, TextureArgument value)
 {
     SetTextureStageState(stage, type, (int)value);
 }
示例#9
0
 private void SetTextureStageState( int stage, TextureStage type, int value )
 {
     // can only set fixed-function texture stage state
     if ( stage >= 8 )
         return;
     
     var oldVal = ActiveD3D9Device.GetTextureStageState( stage, type );
     if (oldVal == value)
         return;
         
     ActiveD3D9Device.SetTextureStageState(stage, type, value);
 }
 private Result GetTextureStageState(IntPtr devicePointer, int stage, TextureStage type, IntPtr value)
 {
     throw new NotImplementedException();
 }
示例#11
0
 public int GetTextureStageState(int stage, TextureStage type)
 {
     return(_device.GetTextureStageState(stage, type));
 }
 public void SetTextureStageState(int stage, TextureStage type, int value)
 {
     device.SetTextureStageState(stage, type, value);
 }