cinvoke-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cinvoke-svn] r130 - in trunk/skorpion: . assets assets/field server


From: will
Subject: [cinvoke-svn] r130 - in trunk/skorpion: . assets assets/field server
Date: 27 Nov 2006 22:34:25 -0500

Author: p
Date: 2006-11-27 22:34:24 -0500 (Mon, 27 Nov 2006)
New Revision: 130

Added:
   trunk/skorpion/assets/field/
   trunk/skorpion/assets/field/caust00.tga
   trunk/skorpion/assets/field/caust01.tga
   trunk/skorpion/assets/field/caust02.tga
   trunk/skorpion/assets/field/caust03.tga
   trunk/skorpion/assets/field/caust04.tga
   trunk/skorpion/assets/field/caust05.tga
   trunk/skorpion/assets/field/caust06.tga
   trunk/skorpion/assets/field/caust07.tga
   trunk/skorpion/assets/field/caust08.tga
   trunk/skorpion/assets/field/caust09.tga
   trunk/skorpion/assets/field/caust10.tga
   trunk/skorpion/assets/field/caust11.tga
   trunk/skorpion/assets/field/caust12.tga
   trunk/skorpion/assets/field/caust13.tga
   trunk/skorpion/assets/field/caust14.tga
   trunk/skorpion/assets/field/caust15.tga
   trunk/skorpion/assets/field/caust16.tga
   trunk/skorpion/assets/field/caust17.tga
   trunk/skorpion/assets/field/caust18.tga
   trunk/skorpion/assets/field/caust19.tga
   trunk/skorpion/assets/field/caust20.tga
   trunk/skorpion/assets/field/caust21.tga
   trunk/skorpion/assets/field/caust22.tga
   trunk/skorpion/assets/field/caust23.tga
   trunk/skorpion/assets/field/caust24.tga
   trunk/skorpion/assets/field/caust25.tga
   trunk/skorpion/assets/field/caust26.tga
   trunk/skorpion/assets/field/caust27.tga
   trunk/skorpion/assets/field/caust28.tga
   trunk/skorpion/assets/field/caust29.tga
   trunk/skorpion/assets/field/caust30.tga
   trunk/skorpion/assets/field/caust31.tga
Modified:
   trunk/skorpion/server/server.csproj
   trunk/skorpion/skorpion.cs
   trunk/skorpion/skorpion.nsi
Log:
make field shields waterish



Added: trunk/skorpion/assets/field/caust00.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust00.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust01.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust01.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust02.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust02.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust03.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust03.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust04.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust04.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust05.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust05.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust06.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust06.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust07.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust07.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust08.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust08.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust09.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust09.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust10.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust10.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust11.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust11.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust12.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust12.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust13.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust13.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust14.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust14.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust15.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust15.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust16.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust16.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust17.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust17.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust18.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust18.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust19.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust19.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust20.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust20.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust21.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust21.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust22.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust22.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust23.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust23.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust24.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust24.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust25.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust25.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust26.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust26.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust27.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust27.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust28.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust28.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust29.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust29.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust30.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust30.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/skorpion/assets/field/caust31.tga
===================================================================
(Binary files differ)


Property changes on: trunk/skorpion/assets/field/caust31.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: trunk/skorpion/server/server.csproj
===================================================================
--- trunk/skorpion/server/server.csproj 2006-11-23 07:50:16 UTC (rev 129)
+++ trunk/skorpion/server/server.csproj 2006-11-28 03:34:24 UTC (rev 130)
@@ -114,6 +114,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "network\Rules.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "network\Server.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -134,11 +139,6 @@
                     BuildAction = "Compile"
                 />
                 <File
-                    RelPath = "universe\Rules.cs"
-                    SubType = "Code"
-                    BuildAction = "Compile"
-                />
-                <File
                     RelPath = "universe\Universe.cs"
                     SubType = "Code"
                     BuildAction = "Compile"

Modified: trunk/skorpion/skorpion.cs
===================================================================
--- trunk/skorpion/skorpion.cs  2006-11-23 07:50:16 UTC (rev 129)
+++ trunk/skorpion/skorpion.cs  2006-11-28 03:34:24 UTC (rev 130)
@@ -21,6 +21,7 @@
 using System.Reflection;
 using Microsoft.DirectX;
 using Microsoft.DirectX.Direct3D;
+// using Microsoft.DirectX.AudioVideoPlayback;
 
 namespace skorpion
 {
@@ -41,6 +42,7 @@
 
                public static ushort        Team                = 1;
                public static bool          Thrusters           = false;
+               public static bool          TexturedField       = true;
 
                public static bool          ClientStart         = true;
                public static string        ClientConnect       = "pleep.com";
@@ -50,7 +52,7 @@
 
                public static TimeSpan      ConsoleOpen         = new 
TimeSpan(0,0,0,0,500);
                public static TimeSpan      ClientKeyRepeat     = new 
TimeSpan(0,0,0,0,200);
-               public static TimeSpan      ClientACKRetry      = new 
TimeSpan(0,0,0,1,0);
+               public static TimeSpan      ClientACKRetry      = new 
TimeSpan(0,0,0,2,0);
                public static TimeSpan      ClientNetTimeout    = new 
TimeSpan(0,0,0,20,0);
                public static TimeSpan      ClientGameTimeout   = new 
TimeSpan(0,0,0,5,0);
                public static TimeSpan      ClientRefresh       = new 
TimeSpan(0,0,0,0,100);
@@ -98,11 +100,16 @@
                Material          iShipMaterial1;
                Material          iShipMaterial2;
                
+               DateTime          iFieldTexTime     = DateTime.Now;
+               int               iFieldTexIndex    = 0;
                VertexBuffer      iFieldVerts2      = null;
                VertexBuffer      iFieldVerts       = null;
                IndexBuffer       iFieldIndex       = null;
                IndexBuffer       iFieldBorderIndex = null;
                Material          iFieldMaterial;
+               Texture[]         iFieldTextures    = null;
+               Texture           iFieldTexture     = null;
+       //      Video             iFieldVideo       = null;
                
                VertexBuffer      iGoalVerts        = null;
                IndexBuffer       iGoalIndex1       = null;
@@ -283,6 +290,19 @@
                        return true;
                }
 
+               /*
+               public void FieldVideoReadyToRender(object sender, 
TextureRenderEventArgs e)
+               {
+                       iFieldTexture = e.Texture;
+               }
+
+               public void FieldVideoEnding(object sender, EventArgs e)
+               {
+                       iFieldVideo.Stop();
+               //      iFieldVideo.Play();
+               }
+               */
+
                public void RestoreDeviceObjects(object sender, EventArgs e)
                {
                        // ship text
@@ -352,33 +372,62 @@
 
                        iGoalMaterial1 = new Material();
                        Color gc1 = Color.DarkViolet;
-                       iGoalMaterial1.Emissive = gc1;
-                       iGoalMaterial1.Diffuse  = Color.White;
+                       iGoalMaterial1.Emissive = Color.FromArgb(gc1.R + 40, 
gc1.G + 40, gc1.B + 40);
+                       gc1 = Color.White;
+                       iGoalMaterial1.Diffuse  = Color.FromArgb(64, gc1.R, 
gc1.G, gc1.B);
 
                        iGoalMaterial2 = new Material();
                        Color gc2 = Color.Pink;
                        iGoalMaterial2.Emissive = gc2;
-                       iGoalMaterial2.Diffuse  = Color.White;
+                       gc2 = Color.White;
+                       iGoalMaterial2.Diffuse  = Color.FromArgb(64, gc2.R, 
gc2.G, gc2.B);
 
                        // goal
-                       iGoalVerts = new VertexBuffer(typeof(PCVertex), 8, 
iDevice, Usage.WriteOnly, PCVertex.Format, Pool.Default);
-                       PCVertex[] gv = (PCVertex[])iGoalVerts.Lock(0, 0);
-                       gv[0].p = Universe.FieldDefintion.GoalA;
-                       gv[1].p = Universe.FieldDefintion.GoalB;
-                       gv[2].p = Universe.FieldDefintion.GoalC;
-                       gv[3].p = Universe.FieldDefintion.GoalD;
-                       gv[4].p = Universe.FieldDefintion.Goal2A;
-                       gv[5].p = Universe.FieldDefintion.Goal2B;
-                       gv[6].p = Universe.FieldDefintion.Goal2C;
-                       gv[7].p = Universe.FieldDefintion.Goal2D;
-                       for (int i=0; i<8; i++) 
-                       { 
-                               if (i<4) gv[i].color = 
Color.FromArgb(45+(i%4)*8, gc1.R, gc1.G, gc1.B).ToArgb();
-                               else     gv[i].color = 
Color.FromArgb(45+(i%4)*8, gc2.R, gc2.G, gc2.B).ToArgb();
+                       if (!ClientConfig.TexturedField)
+                       {
+                               iGoalVerts = new VertexBuffer(typeof(PCVertex), 
8, iDevice, Usage.WriteOnly, PCVertex.Format, Pool.Default);
+                               PCVertex[] gv = (PCVertex[])iGoalVerts.Lock(0, 
0);
+                               gv[0].p = Universe.FieldDefintion.GoalA;
+                               gv[1].p = Universe.FieldDefintion.GoalB;
+                               gv[2].p = Universe.FieldDefintion.GoalC;
+                               gv[3].p = Universe.FieldDefintion.GoalD;
+                               gv[4].p = Universe.FieldDefintion.Goal2A;
+                               gv[5].p = Universe.FieldDefintion.Goal2B;
+                               gv[6].p = Universe.FieldDefintion.Goal2C;
+                               gv[7].p = Universe.FieldDefintion.Goal2D;
+                               for (int i=0; i<8; i++) 
+                               { 
+                                       if (i<4) gv[i].color = 
Color.FromArgb(45+(i%4)*8, gc1.R, gc1.G, gc1.B).ToArgb();
+                                       else     gv[i].color = 
Color.FromArgb(45+(i%4)*8, gc2.R, gc2.G, gc2.B).ToArgb();
+                               }
+
+                               iGoalVerts.Unlock();
                        }
+                       else
+                       {
+                               iGoalVerts = new 
VertexBuffer(typeof(CustomVertex.PositionTextured), 8, iDevice, 
Usage.WriteOnly, CustomVertex.PositionTextured.Format, Pool.Default);
+                               CustomVertex.PositionTextured[] gv = 
(CustomVertex.PositionTextured[])iGoalVerts.Lock(0, 0);
+                               gv[0].Position = new 
Microsoft.DirectX.Vector3(Universe.FieldDefintion.GoalA.X, 
Universe.FieldDefintion.GoalA.Y, Universe.FieldDefintion.GoalA.Z);
+                               gv[1].Position = new 
Microsoft.DirectX.Vector3(Universe.FieldDefintion.GoalB.X, 
Universe.FieldDefintion.GoalB.Y, Universe.FieldDefintion.GoalB.Z);
+                               gv[2].Position = new 
Microsoft.DirectX.Vector3(Universe.FieldDefintion.GoalC.X, 
Universe.FieldDefintion.GoalC.Y, Universe.FieldDefintion.GoalC.Z);
+                               gv[3].Position = new 
Microsoft.DirectX.Vector3(Universe.FieldDefintion.GoalD.X, 
Universe.FieldDefintion.GoalD.Y, Universe.FieldDefintion.GoalD.Z);
+                               gv[4].Position = new 
Microsoft.DirectX.Vector3(Universe.FieldDefintion.Goal2A.X, 
Universe.FieldDefintion.Goal2A.Y, Universe.FieldDefintion.Goal2A.Z);
+                               gv[5].Position = new 
Microsoft.DirectX.Vector3(Universe.FieldDefintion.Goal2B.X, 
Universe.FieldDefintion.Goal2B.Y, Universe.FieldDefintion.Goal2B.Z);
+                               gv[6].Position = new 
Microsoft.DirectX.Vector3(Universe.FieldDefintion.Goal2C.X, 
Universe.FieldDefintion.Goal2C.Y, Universe.FieldDefintion.Goal2C.Z);
+                               gv[7].Position = new 
Microsoft.DirectX.Vector3(Universe.FieldDefintion.Goal2D.X, 
Universe.FieldDefintion.Goal2D.Y, Universe.FieldDefintion.Goal2D.Z);
 
-                       iGoalVerts.Unlock();
+                               gv[0].Tu = 0; gv[0].Tv = 0;
+                               gv[1].Tu = 0; gv[1].Tv = 2;
+                               gv[2].Tu = 1; gv[2].Tv = 2;
+                               gv[3].Tu = 1; gv[3].Tv = 0;
+                               gv[4].Tu = 0; gv[4].Tv = 0;
+                               gv[5].Tu = 0; gv[5].Tv = 2;
+                               gv[6].Tu = 1; gv[6].Tv = 2;
+                               gv[7].Tu = 1; gv[7].Tv = 0;
 
+                               iGoalVerts.Unlock();
+                       }
+
                        Int16[] goalIndex1 = { 0,1,2, 3,0,2 };
                        iGoalIndex1 = ConstructIndexBuffer(goalIndex1);
                        Int16[] goalBorderIndex1 = { 0,1, 1,2, 2,3, 3,0 };
@@ -390,9 +439,10 @@
                        iGoalBorderIndex2 = 
ConstructIndexBuffer(goalBorderIndex2);
 
                        iFieldMaterial = new Material();
-                       Color fc = Color.MediumAquamarine;
+                       Color fc = Color.White;
+                       iFieldMaterial.Diffuse = Color.FromArgb(64, fc.R, fc.G, 
fc.B);
+                       fc = Color.Aquamarine;
                        iFieldMaterial.Emissive = fc;
-                       iFieldMaterial.Diffuse  = Color.White;
 
                        // field
                        iFieldVerts2 = new 
VertexBuffer(typeof(CustomVertex.PositionTextured), 8, iDevice, 
Usage.WriteOnly, CustomVertex.PositionTextured.Format, Pool.Default);
@@ -405,8 +455,38 @@
                        v2[5].Position = new 
Microsoft.DirectX.Vector3(Universe.FieldDefintion.F.X, 
Universe.FieldDefintion.F.Y, Universe.FieldDefintion.F.Z);
                        v2[6].Position = new 
Microsoft.DirectX.Vector3(Universe.FieldDefintion.G.X, 
Universe.FieldDefintion.G.Y, Universe.FieldDefintion.G.Z);
                        v2[7].Position = new 
Microsoft.DirectX.Vector3(Universe.FieldDefintion.H.X, 
Universe.FieldDefintion.H.Y, Universe.FieldDefintion.H.Z);
+
+                       v2[1].Tu = 0; v2[1].Tv = 0;
+                       v2[2].Tu = 8; v2[2].Tv = 0;
+                       v2[5].Tu = 0; v2[5].Tv = 16;
+                       v2[6].Tu = 8; v2[6].Tv = 16;
                        iFieldVerts2.Unlock();
 
+                       if (ClientConfig.TexturedField) 
+                       {
+                               /*
+                               iFieldTexture = TextureLoader.FromFile(iDevice, 
".\\assets\\skorpion\\default.jpg");
+                               if (iFieldVideo != null) 
+                               {
+                                       iFieldVideo.Stop();
+                                       iFieldVideo.Dispose();
+                                       iFieldVideo = null;
+                               }
+                               iFieldVideo = 
Video.FromFile(".\\assets\\caustics.mpeg");
+                               iFieldVideo.Ending += new 
EventHandler(this.FieldVideoEnding);
+                               iFieldVideo.TextureReadyToRender += new 
TextureRenderEventHandler(this.FieldVideoReadyToRender);
+                               // iFieldVideo.RenderToTexture(iDevice);
+                               // iFieldVideo.Play();
+                               */
+
+                               iFieldTextures = new Texture[32];
+                               for (int ii = 0; ii < 32; ii++)
+                               {
+                                       string name = 
string.Format(".\\assets\\field\\Caust{0:D2}.tga", ii);
+                                       iFieldTextures[ii] = 
TextureLoader.FromFile(iDevice, name);
+                               }
+                       }
+
                        iFieldVerts = new VertexBuffer(typeof(PCVertex), 8, 
iDevice, Usage.WriteOnly, PCVertex.Format, Pool.Default);
                        PCVertex[] v = (PCVertex[])iFieldVerts.Lock(0, 0);
                        v[0].p = Universe.FieldDefintion.A;
@@ -678,8 +758,10 @@
                        
                        // draw ball(s) ?
                        // should sort entitys by type
-                       iDevice.TextureState[0].ColorOperation = 
TextureOperation.SelectArg1;
+                       iDevice.RenderState.Lighting = true;
+                       iDevice.TextureState[0].ColorOperation = 
TextureOperation.Modulate;
                        iDevice.TextureState[0].ColorArgument1 = 
TextureArgument.Diffuse;
+                       iDevice.TextureState[0].ColorArgument2 = 
TextureArgument.Diffuse;
                        iDevice.Material = iBallMaterial;
 
                        foreach(Entity e in GlobalState.Client.ThisFrame.Values)
@@ -695,69 +777,153 @@
                        iDevice.RenderState.DestinationBlend = 
Blend.InvSourceAlpha;
 
                        // draw field
-                       iDevice.Transform.World = Matrix.Identity;
-                       iDevice.Material = iFieldMaterial;
-                       iDevice.Indices = iFieldBorderIndex;
-                       iDevice.VertexFormat = PCVertex.Format;
-                       iDevice.RenderState.Lighting = false;
-                       iDevice.RenderState.AlphaBlendEnable = true;
-                       iDevice.RenderState.ZBufferWriteEnable = false;
-                       iDevice.TextureState[0].ColorOperation = 
TextureOperation.SelectArg1;
-                       iDevice.TextureState[0].ColorArgument1 = 
TextureArgument.Diffuse;
-                       iDevice.TextureState[0].ColorArgument2 = 
TextureArgument.TextureColor;
-                       iDevice.TextureState[0].AlphaOperation = 
TextureOperation.SelectArg1;
-                       iDevice.TextureState[0].AlphaArgument1 = 
TextureArgument.Diffuse;
-                       iDevice.TextureState[0].AlphaArgument2 = 
TextureArgument.TextureColor;
-                       iDevice.SetStreamSource(0, iFieldVerts, 0, 
PCVertex.StrideSize);
-                       iDevice.DrawIndexedPrimitives(PrimitiveType.LineList, 
0, 0, 8, 0, 4);
+                       if (ClientConfig.TexturedField)
+                       {
+                               iDevice.Transform.World = Matrix.Identity;
+                               iDevice.Material = iFieldMaterial;
+                               iDevice.Indices = iFieldBorderIndex;
+                               iDevice.VertexFormat = 
CustomVertex.PositionTextured.Format;
+                               iDevice.RenderState.Lighting = true;
+                               iDevice.RenderState.AlphaBlendEnable = true;
+                               iDevice.RenderState.ZBufferWriteEnable = false;
+                               iDevice.TextureState[0].ColorOperation = 
TextureOperation.SelectArg1;
+                               iDevice.TextureState[0].ColorArgument1 = 
TextureArgument.Diffuse;
+                               iDevice.TextureState[0].ColorArgument2 = 
TextureArgument.TextureColor;
+                               iDevice.TextureState[0].AlphaOperation = 
TextureOperation.SelectArg1;
+                               iDevice.TextureState[0].AlphaArgument1 = 
TextureArgument.Diffuse;
+                               iDevice.TextureState[0].AlphaArgument2 = 
TextureArgument.TextureColor;
+                               iDevice.SetStreamSource(0, iFieldVerts, 0, 
PCVertex.StrideSize);
+                               // 
iDevice.DrawIndexedPrimitives(PrimitiveType.LineList, 0, 0, 8, 0, 4);
 
-                       iDevice.RenderState.CullMode = Cull.None;               
        
-                       iDevice.TextureState[0].ColorOperation = 
TextureOperation.SelectArg1;
-                       iDevice.TextureState[0].ColorArgument1 = 
TextureArgument.Diffuse;
-                       iDevice.TextureState[0].ColorArgument2 = 
TextureArgument.TextureColor;
-                       iDevice.TextureState[0].AlphaOperation = 
TextureOperation.SelectArg1;
-                       iDevice.TextureState[0].AlphaArgument1 = 
TextureArgument.Diffuse;
-                   iDevice.TextureState[0].AlphaArgument2 = 
TextureArgument.TextureColor;
-                       iDevice.Indices = iFieldIndex;
-                       
iDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 8, 0, 2);
-                       iDevice.RenderState.ZBufferWriteEnable = true;
-                       iDevice.RenderState.AlphaBlendEnable = false;
-                       iDevice.RenderState.Lighting = true;
+                               iDevice.VertexFormat = 
CustomVertex.PositionTextured.Format;
+                               iDevice.SetStreamSource(0, iFieldVerts2, 0, 
CustomVertex.PositionTextured.StrideSize);
+                               iDevice.RenderState.CullMode = Cull.None;
+                               iDevice.TextureState[0].ColorOperation = 
TextureOperation.Modulate;
+                               iDevice.TextureState[0].ColorArgument1 = 
TextureArgument.Diffuse;
+                               iDevice.TextureState[0].ColorArgument2 = 
TextureArgument.TextureColor;
+                               iDevice.TextureState[0].AlphaOperation = 
TextureOperation.SelectArg1;
+                               iDevice.TextureState[0].AlphaArgument1 = 
TextureArgument.Diffuse;
+                               iDevice.TextureState[0].AlphaArgument2 = 
TextureArgument.TextureColor;
+                               iDevice.Indices = iFieldIndex;
+                               
+                               // iDevice.SetTexture(0, iFieldTexture);
+                               if (DateTime.Now.Subtract(new 
TimeSpan(0,0,0,0,32)) > iFieldTexTime)
+                               {
+                                       iFieldTexIndex = (iFieldTexIndex + 1) % 
32;
+                                       iFieldTexTime = DateTime.Now;
+                               }
+                               iDevice.SetTexture(0, 
iFieldTextures[iFieldTexIndex]);
 
+                               
iDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 8, 0, 2);
+                               iDevice.RenderState.ZBufferWriteEnable = true;
+                               iDevice.RenderState.AlphaBlendEnable = false;
+                               iDevice.RenderState.Lighting = true;
+                       }
+                       else
+                       {
+                               iDevice.Transform.World = Matrix.Identity;
+                               iDevice.Material = iFieldMaterial;
+                               iDevice.Indices = iFieldBorderIndex;
+                               iDevice.VertexFormat = PCVertex.Format;
+                               iDevice.RenderState.Lighting = false;
+                               iDevice.RenderState.AlphaBlendEnable = true;
+                               iDevice.RenderState.ZBufferWriteEnable = false;
+                               iDevice.TextureState[0].ColorOperation = 
TextureOperation.SelectArg1;
+                               iDevice.TextureState[0].ColorArgument1 = 
TextureArgument.Diffuse;
+                               iDevice.TextureState[0].ColorArgument2 = 
TextureArgument.TextureColor;
+                               iDevice.TextureState[0].AlphaOperation = 
TextureOperation.SelectArg1;
+                               iDevice.TextureState[0].AlphaArgument1 = 
TextureArgument.Diffuse;
+                               iDevice.TextureState[0].AlphaArgument2 = 
TextureArgument.TextureColor;
+                               iDevice.SetStreamSource(0, iFieldVerts, 0, 
PCVertex.StrideSize);
+                               
iDevice.DrawIndexedPrimitives(PrimitiveType.LineList, 0, 0, 8, 0, 4);
+
+                               iDevice.RenderState.CullMode = Cull.None;       
                
+                               iDevice.TextureState[0].ColorOperation = 
TextureOperation.SelectArg1;
+                               iDevice.TextureState[0].ColorArgument1 = 
TextureArgument.Diffuse;
+                               iDevice.TextureState[0].ColorArgument2 = 
TextureArgument.TextureColor;
+                               iDevice.TextureState[0].AlphaOperation = 
TextureOperation.SelectArg1;
+                               iDevice.TextureState[0].AlphaArgument1 = 
TextureArgument.Diffuse;
+                               iDevice.TextureState[0].AlphaArgument2 = 
TextureArgument.TextureColor;
+                               iDevice.Indices = iFieldIndex;
+                               
iDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 8, 0, 2);
+                               iDevice.RenderState.ZBufferWriteEnable = true;
+                               iDevice.RenderState.AlphaBlendEnable = false;
+                               iDevice.RenderState.Lighting = true;
+                       }
+
                        // draw goals
-                       iDevice.Transform.World = Matrix.Identity;
-                       iDevice.Material = iGoalMaterial1;
-                       iDevice.VertexFormat = PCVertex.Format;
-                       iDevice.RenderState.Lighting = false;
-                       iDevice.RenderState.AlphaBlendEnable = true;
-                       iDevice.RenderState.ZBufferWriteEnable = false;
-                       iDevice.TextureState[0].ColorOperation = 
TextureOperation.SelectArg1;
-                       iDevice.TextureState[0].ColorArgument1 = 
TextureArgument.Diffuse;
-                       iDevice.TextureState[0].ColorArgument2 = 
TextureArgument.TextureColor;
-                       iDevice.TextureState[0].AlphaOperation = 
TextureOperation.SelectArg1;
-                       iDevice.TextureState[0].AlphaArgument1 = 
TextureArgument.Diffuse;
-                       iDevice.TextureState[0].AlphaArgument2 = 
TextureArgument.TextureColor;
-                       iDevice.SetStreamSource(0, iGoalVerts, 0, 
PCVertex.StrideSize);
-                       iDevice.Indices = iGoalBorderIndex1;
-                       iDevice.DrawIndexedPrimitives(PrimitiveType.LineList, 
0, 0, 8, 0, 4);
-                       iDevice.Indices = iGoalBorderIndex2;
-                       iDevice.Material = iGoalMaterial2;
-                       iDevice.DrawIndexedPrimitives(PrimitiveType.LineList, 
0, 0, 8, 0, 4);
+                       if (ClientConfig.TexturedField)
+                       {
+                               iDevice.Transform.World = Matrix.Identity;
+                               iDevice.Material = iGoalMaterial1;
+                               iDevice.VertexFormat = 
CustomVertex.PositionTextured.Format;
+                               iDevice.RenderState.Lighting = true;
+                               iDevice.RenderState.AlphaBlendEnable = true;
+                               iDevice.RenderState.ZBufferWriteEnable = false;
+                               iDevice.TextureState[0].ColorOperation = 
TextureOperation.SelectArg1;
+                               iDevice.TextureState[0].ColorArgument1 = 
TextureArgument.Diffuse;
+                               iDevice.TextureState[0].ColorArgument2 = 
TextureArgument.TextureColor;
+                               iDevice.TextureState[0].AlphaOperation = 
TextureOperation.SelectArg1;
+                               iDevice.TextureState[0].AlphaArgument1 = 
TextureArgument.Diffuse;
+                               iDevice.TextureState[0].AlphaArgument2 = 
TextureArgument.TextureColor;
+                               iDevice.SetStreamSource(0, iGoalVerts, 0, 
CustomVertex.PositionTextured.StrideSize);
+                               iDevice.Indices = iGoalBorderIndex1;
+                               
//iDevice.DrawIndexedPrimitives(PrimitiveType.LineList, 0, 0, 8, 0, 4);
+                               iDevice.Indices = iGoalBorderIndex2;
+                               iDevice.Material = iGoalMaterial2;
+                               
//iDevice.DrawIndexedPrimitives(PrimitiveType.LineList, 0, 0, 8, 0, 4);
 
-                       iDevice.RenderState.CullMode = Cull.None;               
        
-                       iDevice.TextureState[0].ColorOperation = 
TextureOperation.SelectArg1;
-                       iDevice.TextureState[0].ColorArgument1 = 
TextureArgument.Diffuse;
-                       iDevice.TextureState[0].ColorArgument2 = 
TextureArgument.TextureColor;
-                       iDevice.TextureState[0].AlphaOperation = 
TextureOperation.SelectArg1;
-                       iDevice.TextureState[0].AlphaArgument1 = 
TextureArgument.Diffuse;
-                       iDevice.TextureState[0].AlphaArgument2 = 
TextureArgument.TextureColor;
+                               iDevice.RenderState.CullMode = Cull.None;       
                
+                               iDevice.TextureState[0].ColorOperation = 
TextureOperation.Modulate;
+                               iDevice.TextureState[0].ColorArgument1 = 
TextureArgument.Diffuse;
+                               iDevice.TextureState[0].ColorArgument2 = 
TextureArgument.TextureColor;
+                               iDevice.TextureState[0].AlphaOperation = 
TextureOperation.SelectArg1;
+                               iDevice.TextureState[0].AlphaArgument1 = 
TextureArgument.Diffuse;
+                               iDevice.TextureState[0].AlphaArgument2 = 
TextureArgument.TextureColor;
+                       //      iDevice.SetTexture(0, iFieldTexture);
 
-                       iDevice.Indices = iGoalIndex2;
-                       
iDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 8, 0, 2);
-                       iDevice.Indices = iGoalIndex1;
-                       iDevice.Material = iGoalMaterial1;
-                       
iDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 8, 0, 2);
+                               iDevice.Indices = iGoalIndex2;
+                               
iDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 8, 0, 2);
+                               iDevice.Indices = iGoalIndex1;
+                               iDevice.Material = iGoalMaterial1;
+                               
iDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 8, 0, 2);
+                       }       
+                       else
+                       {
+                               iDevice.Transform.World = Matrix.Identity;
+                               iDevice.Material = iGoalMaterial1;
+                               iDevice.VertexFormat = PCVertex.Format;
+                               iDevice.RenderState.Lighting = false;
+                               iDevice.RenderState.AlphaBlendEnable = true;
+                               iDevice.RenderState.ZBufferWriteEnable = false;
+                               iDevice.TextureState[0].ColorOperation = 
TextureOperation.SelectArg1;
+                               iDevice.TextureState[0].ColorArgument1 = 
TextureArgument.Diffuse;
+                               iDevice.TextureState[0].ColorArgument2 = 
TextureArgument.TextureColor;
+                               iDevice.TextureState[0].AlphaOperation = 
TextureOperation.SelectArg1;
+                               iDevice.TextureState[0].AlphaArgument1 = 
TextureArgument.Diffuse;
+                               iDevice.TextureState[0].AlphaArgument2 = 
TextureArgument.TextureColor;
+                               iDevice.SetStreamSource(0, iGoalVerts, 0, 
PCVertex.StrideSize);
+                               iDevice.Indices = iGoalBorderIndex1;
+                               
iDevice.DrawIndexedPrimitives(PrimitiveType.LineList, 0, 0, 8, 0, 4);
+                               iDevice.Indices = iGoalBorderIndex2;
+                               iDevice.Material = iGoalMaterial2;
+                               
iDevice.DrawIndexedPrimitives(PrimitiveType.LineList, 0, 0, 8, 0, 4);
 
+                               iDevice.RenderState.CullMode = Cull.None;       
                
+                               iDevice.TextureState[0].ColorOperation = 
TextureOperation.SelectArg1;
+                               iDevice.TextureState[0].ColorArgument1 = 
TextureArgument.Diffuse;
+                               iDevice.TextureState[0].ColorArgument2 = 
TextureArgument.TextureColor;
+                               iDevice.TextureState[0].AlphaOperation = 
TextureOperation.SelectArg1;
+                               iDevice.TextureState[0].AlphaArgument1 = 
TextureArgument.Diffuse;
+                               iDevice.TextureState[0].AlphaArgument2 = 
TextureArgument.TextureColor;
+
+                               iDevice.Indices = iGoalIndex2;
+                               
iDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 8, 0, 2);
+                               iDevice.Indices = iGoalIndex1;
+                               iDevice.Material = iGoalMaterial1;
+                               
iDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 8, 0, 2);
+                       }
+
                        iDevice.RenderState.ZBufferWriteEnable = true;
                        iDevice.RenderState.AlphaBlendEnable = false;
                        iDevice.RenderState.Lighting = true;
@@ -777,7 +943,8 @@
 
                        bool drawme = false;
                        ushort myteam = 0;
-                       foreach(Entity e in 
GlobalState.Client.ThisFrame.Values) {
+                       foreach(Entity e in 
GlobalState.Client.ThisFrame.Values) 
+                       {
                                if (e.ID == Me.ID) 
                                {
                                        drawme = true;

Modified: trunk/skorpion/skorpion.nsi
===================================================================
--- trunk/skorpion/skorpion.nsi 2006-11-23 07:50:16 UTC (rev 129)
+++ trunk/skorpion/skorpion.nsi 2006-11-28 03:34:24 UTC (rev 130)
@@ -11,6 +11,8 @@
 
 IfFileExists "$WINDIR\Microsoft.NET\DirectX for Managed 
Code\1.0.2907.0\Microsoft.DirectX.Direct3DX.dll" MainInstall
 
+IfFileExists "$WINDIR\Microsoft.NET\Managed 
DirectX\v9.02.2904\Microsoft.DirectX.Direct3DX.dll" MainInstall
+
 SetOutPath "$WINDIR\Temp"
 File "mdxredist_2902.msi"
 ExecWait '"msiexec" /i $\"$WINDIR\Temp\mdxredist_2902.msi$\"'
@@ -33,6 +35,9 @@
 File assets\skorpion\default.jpg
 File assets\skorpion\skorpion.obj
 
+SetOutPath "$INSTDIR\assets\field"
+File "assets\field\*.tga"
+
 WriteRegStr HKCR "ssb6006" "" "URL:SSB6006 Protocol"
 WriteRegStr HKCR "ssb6006" "URL Protocol" ""
 WriteRegStr HKCR "ssb6006\DefaultIcon" "" "skorpion.exe"





reply via email to

[Prev in Thread] Current Thread [Next in Thread]