public override void Initialize(_3DLayer layer) { this.Parent = layer; foreach (var element in m_Elements) { element.Initialize(); } }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { FSO.Content.Content.Init(GlobalSettings.Default.StartupPath, GraphicsDevice); base.Initialize(); GameFacade.SoundManager = new FSO.Client.Sound.SoundManager(); GameFacade.GameThread = Thread.CurrentThread; SceneMgr = new _3DLayer(); SceneMgr.Initialize(GraphicsDevice); GameFacade.Controller = new GameController(); GameFacade.Screens = uiLayer; GameFacade.Scenes = SceneMgr; GameFacade.GraphicsDevice = GraphicsDevice; GameFacade.Cursor = new CursorManager(this.Window); GameFacade.Cursor.Init(FSO.Content.Content.Get().GetPath("")); /** Init any computed values **/ GameFacade.Init(); GameFacade.Strings = new ContentStrings(); GameFacade.Controller.StartLoading(); GraphicsDevice.RasterizerState = new RasterizerState() { CullMode = CullMode.None }; //no culling until i find a good way to do this in xna4 (apparently recreating state obj is bad?) BassNet.Registration("*****@*****.**", "2X3163018312422"); Bass.BASS_Init(-1, 8000, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero, System.Guid.Empty); this.IsMouseVisible = true; this.IsFixedTimeStep = true; WorldContent.Init(this.Services, Content.RootDirectory); base.Screen.Layers.Add(SceneMgr); base.Screen.Layers.Add(uiLayer); GameFacade.LastUpdateState = base.Screen.State; if (!GlobalSettings.Default.Windowed) Graphics.ToggleFullScreen(); //var test = new IDE.TestEditor(); //test.Show(); }
public void Initialize(_3DLayer layer) { CenterPixel = TextureUtils.TextureFromColor(layer.Device, Color.Purple, 4, 4); }
public virtual void Initialize(_3DLayer layer) { Parent = layer; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { if (FSOEnvironment.DPIScaleFactor != 1 || FSOEnvironment.SoftwareDepth) { GlobalSettings.Default.GraphicsWidth = GraphicsDevice.Viewport.Width / FSOEnvironment.DPIScaleFactor; GlobalSettings.Default.GraphicsHeight = GraphicsDevice.Viewport.Height / FSOEnvironment.DPIScaleFactor; } OperatingSystem os = Environment.OSVersion; PlatformID pid = os.Platform; GameFacade.Linux = (pid == PlatformID.MacOSX || pid == PlatformID.Unix); FSO.Content.Content.Init(GlobalSettings.Default.StartupPath, GraphicsDevice); base.Initialize(); GameFacade.GameThread = Thread.CurrentThread; SceneMgr = new _3DLayer(); SceneMgr.Initialize(GraphicsDevice); GameFacade.Controller = new GameController(); GameFacade.Screens = uiLayer; GameFacade.Scenes = SceneMgr; GameFacade.GraphicsDevice = GraphicsDevice; GameFacade.GraphicsDeviceManager = Graphics; GameFacade.Cursor = new CursorManager(this.Window); if (!GameFacade.Linux) GameFacade.Cursor.Init(FSO.Content.Content.Get().GetPath("")); /** Init any computed values **/ GameFacade.Init(); //init audio now HITVM.Init(); GameFacade.Strings = new ContentStrings(); GameFacade.Controller.StartLoading(); GraphicsDevice.RasterizerState = new RasterizerState() { CullMode = CullMode.None }; try { var audioTest = new SoundEffect(new byte[2], 44100, AudioChannels.Mono); //initialises XAudio. audioTest.CreateInstance().Play(); } catch (Exception e) { //MessageBox.Show("Failed to initialize audio: \r\n\r\n" + e.StackTrace); } this.IsMouseVisible = true; this.IsFixedTimeStep = true; WorldContent.Init(this.Services, Content.RootDirectory); if (!FSOEnvironment.SoftwareKeyboard) AddTextInput(); base.Screen.Layers.Add(SceneMgr); base.Screen.Layers.Add(uiLayer); GameFacade.LastUpdateState = base.Screen.State; this.Window.Title = "FreeSO"; if (!GlobalSettings.Default.Windowed && !GameFacade.GraphicsDeviceManager.IsFullScreen) { GameFacade.GraphicsDeviceManager.ToggleFullScreen(); } }
/// <summary> /// Setup anything that needs a GraphicsDevice /// </summary> /// <param name="layer"></param> public override void Initialize(_3DLayer layer) { base.Initialize(layer); /** * Setup world state, this object acts as a facade * to world objects as well as providing various * state settings for the world and helper functions */ State = new WorldState(layer.Device, layer.Device.Viewport.Width/FSOEnvironment.DPIScaleFactor, layer.Device.Viewport.Height/FSOEnvironment.DPIScaleFactor, this); State.AmbientLight = new Texture2D(layer.Device, 256, 256); State._3D = new FSO.LotView.Utils._3DWorldBatch(State); State._2D = new FSO.LotView.Utils._2DWorldBatch(layer.Device, World2D.NUM_2D_BUFFERS, World2D.BUFFER_SURFACE_FORMATS, World2D.FORMAT_ALWAYS_DEPTHSTENCIL, World2D.SCROLL_BUFFER); State._2D.AmbientLight = State.AmbientLight; PPXDepthEngine.InitGD(layer.Device); if (FSOEnvironment.SoftwareDepth) PPXDepthEngine.InitScreenTargets(layer.Device); base.Camera = State.Camera; HasInitGPU = true; HasInit = HasInitGPU & HasInitBlueprint; }
private void Vitaboy_Load(object sender, EventArgs e) { try { Content.Content.Init("F:\\Games\\Maxis\\The Sims Online\\TSOClient\\", canvas.GraphicsDevice); } catch (Exception) { return; } Content.Content content; content = Content.Content.Get(); foreach (var binding in content.AvatarBindings.List()){ bindingsList.Items.Add(binding); } foreach (var outfit in content.AvatarOutfits.List()){ outfitList.Items.Add(outfit); } foreach (var animation in content.AvatarAnimations.List()){ animationsList.Items.Add(animation); } _3D = new _3DLayer(); Camera = new BasicCamera(canvas.GraphicsDevice, new Vector3(10.0f, 10.0f, 10.0f), new Vector3(5.0f, 5.0f, 5.0f), Vector3.Up); Scene = new _3DScene(canvas.GraphicsDevice, Camera); _3D.Add(Scene); canvas.Screen.Add(_3D); Animator = new Animator(); Scene.Add(Animator); }
public virtual void Initialize(_3DLayer layer) { }
/// <summary> /// Setup anything that needs a GraphicsDevice /// </summary> /// <param name="layer"></param> public override void Initialize(_3DLayer layer) { base.Initialize(layer); /** * Setup world state, this object acts as a facade * to world objects as well as providing various * state settings for the world and helper functions */ State = new WorldState(layer.Device, layer.Device.Viewport.Width, layer.Device.Viewport.Height, this); State._3D = new FSO.LotView.Utils._3DWorldBatch(State); State._2D = new FSO.LotView.Utils._2DWorldBatch(layer.Device, World2D.NUM_2D_BUFFERS, World2D.BUFFER_SURFACE_FORMATS); base.Camera = State.Camera; HasInitGPU = true; HasInit = HasInitGPU & HasInitBlueprint; _2DWorld.Initialize(layer); }