2021-04-14 02:38:54 +02:00
|
|
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
|
|
|
using MLEM.Data.Content;
|
|
|
|
|
using MLEM.Font;
|
2021-04-02 17:12:27 +02:00
|
|
|
|
using MLEM.Startup;
|
|
|
|
|
|
2022-12-13 13:11:36 +01:00
|
|
|
|
namespace Tests;
|
2021-04-02 17:12:27 +02:00
|
|
|
|
|
2022-10-27 10:22:25 +02:00
|
|
|
|
public class TestGame : MlemGame {
|
2021-04-02 17:12:27 +02:00
|
|
|
|
|
2022-10-27 10:22:25 +02:00
|
|
|
|
public RawContentManager RawContent { get; private set; }
|
2021-04-02 17:12:27 +02:00
|
|
|
|
|
2024-09-02 19:55:28 +02:00
|
|
|
|
private TestGame() {
|
|
|
|
|
#if KNI
|
|
|
|
|
// allow textures larger than 4096x4096 for our texture packer tests
|
|
|
|
|
this.GraphicsDeviceManager.GraphicsProfile = GraphicsProfile.FL11_0;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
2021-04-02 17:12:27 +02:00
|
|
|
|
|
2022-10-27 10:22:25 +02:00
|
|
|
|
protected override void LoadContent() {
|
|
|
|
|
base.LoadContent();
|
|
|
|
|
this.RawContent = new RawContentManager(this.Services, this.Content.RootDirectory);
|
2024-09-02 19:55:28 +02:00
|
|
|
|
// we use precompiled fonts and kni uses a different asset compilation system, so we just have both stored
|
|
|
|
|
this.UiSystem.Style.Font = new GenericSpriteFont(MlemGame.LoadContent<SpriteFont>(
|
|
|
|
|
#if KNI
|
|
|
|
|
"TestFontKni"
|
|
|
|
|
#else
|
|
|
|
|
"TestFont"
|
|
|
|
|
#endif
|
|
|
|
|
));
|
2022-10-27 10:22:25 +02:00
|
|
|
|
}
|
2021-04-02 17:12:27 +02:00
|
|
|
|
|
2022-10-27 10:22:25 +02:00
|
|
|
|
public static TestGame Create() {
|
|
|
|
|
var game = new TestGame();
|
|
|
|
|
game.RunOneFrame();
|
|
|
|
|
return game;
|
2021-04-02 17:12:27 +02:00
|
|
|
|
}
|
2022-10-27 10:22:25 +02:00
|
|
|
|
|
2022-06-17 18:23:47 +02:00
|
|
|
|
}
|