Use macro to register ccmds

This commit is contained in:
2025-03-11 09:11:45 +01:00
parent 9571e136b3
commit 34a691fa68
4 changed files with 92 additions and 5 deletions

View File

@@ -15,9 +15,10 @@ class Mode
public static function setVideoMode(width:Int, height:Int, fs:Int = null){
getWindow().resize(width,height);
}
public static var cvMatSetVideoMode:CCmd = ConVar.registerCCmd("mat_setvideomode",(args:Array<String>)->{
setVideoMode(Std.parseInt(args[0]), Std.parseInt(args[1]), Std.parseInt(args[2]));
});
@:command("mat_setvideomode")
public static function cCmdMatSetVideoMode(args:Array<String>){
Mode.setVideoMode(Std.parseInt(args[0]), Std.parseInt(args[1]), Std.parseInt(args[2]));
}
public static function switchFsMode(toState:Int = 0){
if(toState == 0){
if(Lib.current.stage.displayState != StageDisplayState.FULL_SCREEN_INTERACTIVE){