build game

This commit is contained in:
Михаил Капелько committed 2026-10-21 17:37:21 +03:00
1 parent 47f9eb904a
commit f3ea773c79
3 files changed
+2 -93

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
version: 4
output:
game/ver-mac/src/dialect.swift:
ver-mac/src/dialect.swift:
type: swift
ChkgfxComponent:
+1 -19
View File
@@ -1,27 +1,9 @@
version: 4
output:
game/ver-mac/src/dialect.swift:
ver-mac/src/dialect.swift:
type: swift
ChkgfxComponent:
type: component
shoulds:
didLaunch:
1. Only once during the first setup:
if:
c.recentField == F.didSetup &&
c.didLaunch == false
then:
c.didLaunch = true
ChkgfxContext:
type: context
fields:
didClickLoadModel: Bool
didLaunch: Bool
didSetup: Bool
RenderContext:
type: context
fields:
-73
View File
@@ -123,7 +123,6 @@ public struct F {
public static let count = "count"
public static let countText = "countText"
public static let didClickIncrement = "didClickIncrement"
public static let didClickLoadModel = "didClickLoadModel"
public static let didLaunch = "didLaunch"
public static let didPrepareGL = "didPrepareGL"
public static let didSetup = "didSetup"
@@ -132,44 +131,6 @@ public struct F {
public static let willDeinit = "willDeinit"
}
public struct ChkgfxContext: DialectContext {
public var didClickLoadModel = Bool()
public var didLaunch = Bool()
public var didSetup = Bool()
public var recentField = ""
public func field<T>(_ name: String) -> T {
if (name == "didClickLoadModel") {
return didClickLoadModel as! T
}
else if (name == "didLaunch") {
return didLaunch as! T
}
else if (name == "didSetup") {
return didSetup as! T
}
return "unknown-field-name" as! T
}
public mutating func setField(
_ name: String,
_ value: Any
) {
if (name == "didClickLoadModel") {
didClickLoadModel = value as! Bool
}
else if (name == "didLaunch") {
didLaunch = value as! Bool
}
else if (name == "didSetup") {
didSetup = value as! Bool
}
}
}
public struct RenderContext: DialectContext {
public var backingPixelSize = [Int32]()
public var didClickIncrement = Bool()
@@ -295,13 +256,6 @@ public struct RootContext: DialectContext {
}
}
public func chkgfxSet(
_ key: String,
_ value: Any
) {
ChkgfxComponent.singleton!.ctrl.set(key, value)
}
public func renderSet(
_ key: String,
_ value: Any
@@ -316,24 +270,6 @@ public func rootSet(
RootComponent.singleton!.ctrl.set(key, value)
}
func chkgfxShouldResetDidLaunch(_ c: ChkgfxContext) -> ChkgfxContext {
var c = c
/* 1. Only once during the first setup */
if
c.recentField == F.didSetup &&
c.didLaunch == false
{
c.didLaunch = true
c.recentField = F.didLaunch
return c
}
c.recentField = DIALECT_CONTEXT_RECENT_FIELD_NONE
return c
}
func renderShouldResetDidLaunch(_ c: RenderContext) -> RenderContext {
var c = c
@@ -458,15 +394,6 @@ func rootShouldResetDidLaunch(_ c: RootContext) -> RootContext {
return c
}
func chkgfxRegisterShoulds(_ ctrl: DialectController) {
[
chkgfxShouldResetDidLaunch,
].forEach { f in
ctrl.registerFunction { c in f(c as! ChkgfxContext) }
}
}
func renderRegisterShoulds(_ ctrl: DialectController) {
[
renderShouldResetDidLaunch,