void LoadModel() { game = new Game(); game.SetPlatform(new GamePlatformNative()); d = new AnimatedModelRenderer(); AnimatedModel model = new AnimatedModel(); try { model = AnimatedModelSerializer.Deserialize(game.GetPlatform(), richTextBox1.Text); } catch { } if (model != null) { d.Start(game, model); } }
void DrawTestModel(Game game, float deltaTime) { if (!game.ENABLE_DRAW_TEST_CHARACTER) { return; } if (testmodel == null) { testmodel = new AnimatedModelRenderer(); byte[] data = game.GetFile("player.txt"); int dataLength = game.GetFileLength("player.txt"); string dataString = game.platform.StringFromUtf8ByteArray(data, dataLength); AnimatedModel model = AnimatedModelSerializer.Deserialize(game.platform, dataString); testmodel.Start(game, model); } game.GLPushMatrix(); game.GLTranslate(game.map.MapSizeX / 2, game.blockheight(game.map.MapSizeX / 2, game.map.MapSizeY / 2 - 2, 128), game.map.MapSizeY / 2 - 2); game.platform.BindTexture2d(game.GetTexture("mineplayer.png")); testmodel.Render(deltaTime, 0, true, true, 1); game.GLPopMatrix(); }
void LoadModel() { game = new Game(); game.SetPlatform(new GamePlatformNative()); d = new AnimatedModelRenderer(); AnimatedModel model = new AnimatedModel(); try { model = AnimatedModelSerializer.Deserialize(game.GetPlatform(), richTextBox1.Text); modelLoaded = true; } catch (Exception ex) { modelLoaded = false; model = null; richTextBox2.Text = "Error in LoadModel():" + Environment.NewLine + ex.ToString(); } if (model != null) { d.Start(game, model); } }