Browse Source

Swapped on-call to call-on

See Cakelisp commit for reasoning behind this. Emacs sexp-awareness
and macros to the rescue!

* Added more to the Blender failure comment to help resolve issues
  when trying to build models
* Converted tabs to spaces in some cake files
RelativeDependencies
Macoy Madson 11 months ago
parent
commit
06814e7491
  1. 2
      Dependencies/cakelisp
  2. 14
      src/AutoTest.cake
  3. 18
      src/Math.cake
  4. 76
      src/Ogre.cake
  5. 90
      src/OgreInitialize.cake
  6. 2
      src/Tracy.cake
  7. 10
      test/src/VocalGame.cake

2
Dependencies/cakelisp

@ -1 +1 @@
Subproject commit dc93eddbf8757e5faa33abeea308748ada94b503
Subproject commit ed10693994d3121bd58ec018ebb07f11352af706

14
src/AutoTest.cake

@ -14,21 +14,21 @@
(var functions-to-test (<> std::vector (<> std::pair std::string (* (const Token)))))
(var required-imports (<> std::vector (<> std::pair (* (const char)) (* (const Token)))))
(for-in definition-pair (& ObjectDefinitionPair) (field environment definitions)
(unless (!= (in std string npos) (on-call (field definition-pair first) find "test--"))
(unless (!= (in std string npos) (call-on find (field definition-pair first) "test--"))
(continue))
(on-call functions-to-test push_back (call (in std make_pair)
(call-on push_back functions-to-test (call (in std make_pair)
(field definition-pair first)
(field definition-pair second definitionInvocation)))
(on-call required-imports push_back (call (in std make_pair)
(call-on push_back required-imports (call (in std make_pair)
(path definition-pair . second . definitionInvocation > source)
(field definition-pair second definitionInvocation))))
(get-or-create-comptime-var total-tests-found int)
;; No more tests found this round. Exit, otherwise we'll get in an infinite modification loop
(when (= (deref total-tests-found) (on-call functions-to-test size))
(when (= (deref total-tests-found) (call-on size functions-to-test))
(return true))
(unless (on-call functions-to-test empty)
(unless (call-on empty functions-to-test)
;; We're copying this to the main def, so it's fine if it gets destroyed
(var test-body (<> std::vector Token))
@ -41,7 +41,7 @@
((token-splice-addr function-name-token))))))
(var main-definition (* (<> std::vector Token)) (new (<> std::vector Token)))
(on-call (field environment comptimeTokens) push_back main-definition)
(call-on push_back (field environment comptimeTokens) main-definition)
(for-in import-pair (& (<> std::pair (* (const char)) (* (const Token)))) required-imports
(var import-str Token (deref (field import-pair second)))
@ -56,7 +56,7 @@
(token-splice-array test-body)
(return num-errors)))
(set (deref total-tests-found) (on-call functions-to-test size))
(set (deref total-tests-found) (call-on size functions-to-test))
(unless (ReplaceAndEvaluateDefinition environment "main" (deref main-definition))
(return false))
(set was-code-modified true))

18
src/Math.cake

@ -188,28 +188,28 @@
(defgenerator output-aliased-c-function-invocation (&optional &rest arguments any)
(var invocation-name (& (const std::string)) (field (at (+ 1 startTokenIndex) tokens) contents))
;; TODO Hack: If I was referenced directly, don't do anything, because it's only for dependencies
(when (= 0 (on-call invocation-name compare
(when (= 0 (call-on compare invocation-name
"output-aliased-c-function-invocation"))
(return true))
(get-or-create-comptime-var c-function-aliases (<> std::unordered_map std::string std::string))
(def-type-alias FunctionAliasMap (<> std::unordered_map std::string std::string))
(var alias-func-pair (in FunctionAliasMap iterator)
(on-call-ptr c-function-aliases find invocation-name))
(unless (!= alias-func-pair (on-call-ptr c-function-aliases end))
(call-on-ptr find c-function-aliases invocation-name))
(unless (!= alias-func-pair (call-on-ptr end c-function-aliases))
(ErrorAtToken (at (+ 1 startTokenIndex) tokens)
"unknown function alias. This is likely a code error, as it should never have " \
"gotten this far")
(return false))
(var underlying-func-name (& (const std::string)) (path alias-func-pair > second))
;; (Logf "found %s, outputting %s\n" (on-call invocation-name c_str) (on-call underlying-func-name c_str))
;; (Logf "found %s, outputting %s\n" (call-on c_str invocation-name) (call-on c_str underlying-func-name))
(if arguments
(block
(var invocation-statement (const ([] CStatementOperation))
(array
(array KeywordNoSpace (on-call underlying-func-name c_str) -1)
(array KeywordNoSpace (call-on c_str underlying-func-name) -1)
(array OpenParen null -1)
(array ExpressionList null 1)
(array CloseParen null -1)
@ -220,7 +220,7 @@
(block
(var invocation-statement (const ([] CStatementOperation))
(array
(array KeywordNoSpace (on-call underlying-func-name c_str) -1)
(array KeywordNoSpace (call-on c_str underlying-func-name) -1)
(array OpenParen null -1)
(array CloseParen null -1)
(array SmartEndStatement null -1)))
@ -238,14 +238,14 @@
(get-or-create-comptime-var c-function-aliases (<> std::unordered_map std::string std::string))
(set (at (field alias contents) (deref c-function-aliases)) (field underlying-func-name contents))
;; (Logf "aliasing %s to %s\n" (on-call (field underlying-func-name contents) c_str)
;; (on-call (field alias contents) c_str))
;; (Logf "aliasing %s to %s\n" (call-on c_str (field underlying-func-name contents))
;; (call-on c_str (field alias contents)))
;; Upen encountering an invocation of our alias, run the aliased function output
;; In case the function already has references, resolve them now. Future invocations will be
;; handled immediately (because it'll be in the generators list)
(var evaluated-success bool
(registerEvaluateGenerator environment (on-call (field alias contents) c_str)
(registerEvaluateGenerator environment (call-on c_str (field alias contents))
(at "output-aliased-c-function-invocation" (field environment generators))))
(return evaluated-success))

76
src/Ogre.cake

@ -39,7 +39,7 @@
;; If false is returned, you should break from the main loop (an error has occurred)
(defun ogre-render-frame (&return bool)
(return (on-call-ptr g-ogre-root renderOneFrame)))
(return (call-on-ptr renderOneFrame g-ogre-root)))
;; I'd be happy if this goes away in the "real" language, but it seems necessary for C++ interop
(forward-declare
@ -64,9 +64,9 @@
;; Also notice the HBU_STATIC flag; since the HBU_WRITE_ONLY
;; bit would prohibit us from reading the data for importing.
(var mesh-v1 Ogre::v1::MeshPtr
(on-call (call (in Ogre v1 MeshManager getSingleton)) load
name Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME
Ogre::v1::HardwareBuffer::HBU_STATIC Ogre::v1::HardwareBuffer::HBU_STATIC))
(call-on load (call (in Ogre v1 MeshManager getSingleton))
name Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME
Ogre::v1::HardwareBuffer::HBU_STATIC Ogre::v1::HardwareBuffer::HBU_STATIC))
(var half-position bool true)
(var half-UVs bool true)
@ -76,22 +76,22 @@
(var mesh-name-v2 (const Ogre::String) (+ name (Ogre::String " Imported")))
;; Import the v1 mesh to v2
(var v2Mesh Ogre::MeshPtr
(on-call (call (in Ogre MeshManager getSingleton)) createByImportingV1
mesh-name-v2 Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
(on-call mesh-v1 get)
(call-on createByImportingV1 (call (in Ogre MeshManager getSingleton))
mesh-name-v2 Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
(call-on get mesh-v1)
half-position half-UVs use-Q-tangents))
;; We don't need the v1 mesh. Free CPU memory, get it out of the GPU.
;; Leave it loaded if you want to use athene with v1 Entity.
(on-call-ptr mesh-v1 unload)
(call-on-ptr unload mesh-v1)
;; Create an Item with the model we just imported.
;; Notice we use the name of the imported model. We could also use the overload
;; with the mesh pointer:
;; item = scene-manager->createItem( v2Mesh, Ogre::SCENE_DYNAMIC );
(var item (* Ogre::Item) (on-call-ptr scene-manager createItem
mesh-name-v2 Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME
Ogre::SCENE_DYNAMIC))
(var item (* Ogre::Item) (call-on-ptr createItem scene-manager
mesh-name-v2 Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME
Ogre::SCENE_DYNAMIC))
(var mesh-handle mesh-handle (array item))
(return mesh-handle))
@ -101,16 +101,16 @@
(var scene-manager (* (in Ogre SceneManager)) (ogre-get-scene-manager))
(var v2Mesh Ogre::MeshPtr
(on-call (call (in Ogre MeshManager getSingleton)) load
name Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME))
(call-on load (call (in Ogre MeshManager getSingleton))
name Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME))
;; Create an Item with the model we just imported.
;; Notice we use the name of the imported model. We could also use the overload
;; with the mesh pointer:
;; item = scene-manager->createItem( v2Mesh, Ogre::SCENE_DYNAMIC );
(var item (* Ogre::Item) (on-call-ptr scene-manager createItem
name Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME
Ogre::SCENE_DYNAMIC))
(var item (* Ogre::Item) (call-on-ptr createItem scene-manager
name Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME
Ogre::SCENE_DYNAMIC))
(var mesh-handle mesh-handle (array item))
(return mesh-handle))
@ -118,14 +118,14 @@
(defun ogre-node-from-item (mesh-handle mesh-handle &return scene-node)
(var new-scene-node scene-node (array null))
(var scene-manager (* (in Ogre SceneManager)) (ogre-get-scene-manager))
(var root-scene-node (* Ogre::SceneNode) (on-call-ptr scene-manager getRootSceneNode))
(var root-scene-node (* Ogre::SceneNode) (call-on-ptr getRootSceneNode scene-manager))
(when root-scene-node
;; WTF - this should work, but it's almost like the root scene node's vtable is wrong
;; Ogre::SceneNode* sceneNode = root-scene-node->createChildSceneNode(Ogre::SCENE_DYNAMIC);
(var scene-node (* Ogre::SceneNode)
(type-cast (on-call-ptr root-scene-node createChild) (* Ogre::SceneNode)))
(type-cast (call-on-ptr createChild root-scene-node) (* Ogre::SceneNode)))
(when scene-node
(on-call-ptr scene-node attachObject (field mesh-handle mesh-item))
(call-on-ptr attachObject scene-node (field mesh-handle mesh-item))
(set (field new-scene-node node) scene-node)))
(return new-scene-node))
@ -134,39 +134,39 @@
animation-name (* (const char))
&return OgreAnimationHandle)
(var skeleton (* (in Ogre SkeletonInstance))
(on-call-ptr (field mesh mesh-item) getSkeletonInstance))
(on-call-ptr skeleton addAnimationsFromSkeleton skeleton-name
(call-on-ptr getSkeletonInstance (field mesh mesh-item)))
(call-on-ptr addAnimationsFromSkeleton skeleton skeleton-name
(in Ogre ResourceGroupManager AUTODETECT_RESOURCE_GROUP_NAME))
(var animation (* (in Ogre SkeletonAnimation))
(on-call-ptr skeleton getAnimation animation-name))
(on-call-ptr animation setEnabled true)
(call-on-ptr getAnimation skeleton animation-name))
(call-on-ptr setEnabled animation true)
(return animation))
(defun ogre-animation-add-time (animation OgreAnimationHandle delta-time float)
(on-call-ptr animation addTime delta-time))
(call-on-ptr addTime animation delta-time))
(defun ogre-node-set-position (node (* scene-node) x float y float z float)
(on-call-ptr (path node > node) setPosition x y z))
(call-on-ptr setPosition (path node > node) x y z))
(defun ogre-create-light (&return scene-node)
(var new-light-node scene-node (array null))
(var scene-manager (* (in Ogre SceneManager)) (ogre-get-scene-manager))
(var root-scene-node (* Ogre::SceneNode) (on-call-ptr scene-manager getRootSceneNode))
(var root-scene-node (* Ogre::SceneNode) (call-on-ptr getRootSceneNode scene-manager))
(when root-scene-node
(var light (* (in Ogre Light)) (on-call-ptr scene-manager createLight))
(var light (* (in Ogre Light)) (call-on-ptr createLight scene-manager))
(var light-node (* (in Ogre SceneNode))
;; Required cast for VTable weirdness (See "WTF" comment)
(type-cast (on-call-ptr root-scene-node createChild) (* Ogre::SceneNode)))
(type-cast (call-on-ptr createChild root-scene-node) (* Ogre::SceneNode)))
(set (field new-light-node node) light-node)
(on-call-ptr light-node attachObject light)
(on-call-ptr light setPowerScale 1.0f)
(on-call-ptr light setType (in Ogre Light LT_DIRECTIONAL))
(on-call-ptr light setDirection (on-call (call (in Ogre Vector3) -1 -1 -1) normalisedCopy))
(call-on-ptr attachObject light-node light)
(call-on-ptr setPowerScale light 1.0f)
(call-on-ptr setType light (in Ogre Light LT_DIRECTIONAL))
(call-on-ptr setDirection light (call-on normalisedCopy (call (in Ogre Vector3) -1 -1 -1)))
(on-call-ptr scene-manager setAmbientLight
(call-on-ptr setAmbientLight scene-manager
(* (call (in Ogre ColourValue) 0.3f 0.5f 0.7f) 0.1f 0.75f)
(* (call (in Ogre ColourValue) 0.6f 0.45f 0.3f) 0.065f 0.75f)
(+ (negate (on-call-ptr light getDirection)) (* (in Ogre Vector3 UNIT_Y) 0.2f))))
(+ (negate (call-on-ptr getDirection light)) (* (in Ogre Vector3 UNIT_Y) 0.2f))))
(return new-light-node))
;; e.g. (negate 1) outputs (-1)
@ -233,10 +233,10 @@ Note that you can also build Ogre manually. This can be useful if you are portin
(build-ogre-on-failure "failed at Ogre dependencies Ninja install. This tool requires Ninja.")
(return false))
(unless (fileExists ogre-dependencies-dir-output)
(Logf "error: Expected Ogre dependencies to be in %s, but didn't find them\n"
ogre-dependencies-dir-output)
(return false)))
(unless (fileExists ogre-dependencies-dir-output)
(Logf "error: Expected Ogre dependencies to be in %s, but didn't find them\n"
ogre-dependencies-dir-output)
(return false)))
(var ogre-deps-softlink (* (const char)) "Dependencies/ogre-next/Dependencies")
(unless (fileExists ogre-deps-softlink)

90
src/OgreInitialize.cake

@ -51,14 +51,14 @@
(var resourcePath (in Ogre String) "data/")
(var config (in Ogre ConfigFile))
(on-call config load (+ resourcePath "resources2.cfg"))
(call-on load config (+ resourcePath "resources2.cfg"))
(var rootHlmsFolder (in Ogre String)
(+ resourcePath (on-call config getSetting "DoNotUseAsResource" "Hlms" "")))
(+ resourcePath (call-on getSetting config "DoNotUseAsResource" "Hlms" "")))
(cond ((on-call rootHlmsFolder empty)
(cond ((call-on empty rootHlmsFolder)
(set rootHlmsFolder "./"))
((!= (deref (- (on-call rootHlmsFolder end) 1)) '/')
((!= (deref (- (call-on end rootHlmsFolder) 1)) '/')
(set rootHlmsFolder (+ rootHlmsFolder "/"))))
;; At this point rootHlmsFolder should be a valid path to the Hlms data folder
@ -78,58 +78,58 @@
;; Get the path to all the subdirectories used by HlmsUnlit
(call (in Ogre HlmsUnlit getDefaultPaths) mainFolderPath libraryFoldersPaths)
(var archiveUnlit (* (in Ogre Archive))
(on-call archiveManager load (+ rootHlmsFolder mainFolderPath) "FileSystem" true))
(call-on load archiveManager (+ rootHlmsFolder mainFolderPath) "FileSystem" true))
(var archiveUnlitLibraryFolders (in Ogre ArchiveVec))
(set libraryFolderPathIt (on-call libraryFoldersPaths begin))
(set libraryFolderPathEn (on-call libraryFoldersPaths end))
(set libraryFolderPathIt (call-on begin libraryFoldersPaths))
(set libraryFolderPathEn (call-on end libraryFoldersPaths))
(while (!= libraryFolderPathIt libraryFolderPathEn)
(var archiveLibrary (* (in Ogre Archive))
(on-call archiveManager load
(call-on load archiveManager
(+ rootHlmsFolder (deref libraryFolderPathIt)) "FileSystem" true))
(on-call archiveUnlitLibraryFolders push_back archiveLibrary)
(call-on push_back archiveUnlitLibraryFolders archiveLibrary)
(incr libraryFolderPathIt))
;; Create and register the unlit Hlms
(set hlmsUnlit (ogre-new (call (type (in Ogre HlmsUnlit)) archiveUnlit
(addr archiveUnlitLibraryFolders))))
(on-call-ptr (on-call (call (in Ogre Root getSingleton)) getHlmsManager) registerHlms hlmsUnlit))
(call-on-ptr registerHlms (call-on getHlmsManager (call (in Ogre Root getSingleton))) hlmsUnlit))
(scope ;; Create & Register HlmsPbs
;; Do the same for HlmsPbs:
(call (in Ogre HlmsPbs getDefaultPaths) mainFolderPath libraryFoldersPaths)
(var archivePbs (* (in Ogre Archive))
(on-call archiveManager load
(call-on load archiveManager
(+ rootHlmsFolder mainFolderPath) "FileSystem" true))
;; Get the library archive(s)
(var archivePbsLibraryFolders (in Ogre ArchiveVec))
(set libraryFolderPathIt (on-call libraryFoldersPaths begin))
(set libraryFolderPathEn (on-call libraryFoldersPaths end))
(set libraryFolderPathIt (call-on begin libraryFoldersPaths))
(set libraryFolderPathEn (call-on end libraryFoldersPaths))
(while (!= libraryFolderPathIt libraryFolderPathEn)
(var archiveLibrary (* (in Ogre Archive))
(on-call archiveManager load
(call-on load archiveManager
(+ rootHlmsFolder (deref libraryFolderPathIt)) "FileSystem" true))
(on-call archivePbsLibraryFolders push_back archiveLibrary)
(call-on push_back archivePbsLibraryFolders archiveLibrary)
(incr libraryFolderPathIt))
;; Create and register
(set hlmsPbs (ogre-new (call (type (in Ogre HlmsPbs)) archivePbs
(addr archivePbsLibraryFolders))))
(on-call-ptr (on-call (call (in Ogre Root getSingleton)) getHlmsManager) registerHlms hlmsPbs))
(call-on-ptr registerHlms (call-on getHlmsManager (call (in Ogre Root getSingleton))) hlmsPbs))
(var renderSystem (* (in Ogre RenderSystem))
(on-call-ptr (call (in Ogre Root getSingletonPtr)) getRenderSystem))
(when (= (on-call-ptr renderSystem getName) "Direct3D11 Rendering Subsystem")
(call-on-ptr getRenderSystem (call (in Ogre Root getSingletonPtr))))
(when (= (call-on-ptr getName renderSystem) "Direct3D11 Rendering Subsystem")
;; Set lower limits 512kb instead of the default 4MB per Hlms in D3D 11.0
;; and below to avoid saturating AMD's discard limit (8MB) or
;; saturate the PCIE bus in some low end machines.
(var supportsNoOverwriteOnTextureBuffers bool)
(on-call-ptr renderSystem getCustomAttribute "MapNoOverwriteOnDynamicBufferSRV"
(call-on-ptr getCustomAttribute renderSystem "MapNoOverwriteOnDynamicBufferSRV"
(addr supportsNoOverwriteOnTextureBuffers))
(unless supportsNoOverwriteOnTextureBuffers
(on-call-ptr hlmsPbs setTextureBufferDefaultSize (* 512 1024))
(on-call-ptr hlmsUnlit setTextureBufferDefaultSize (* 512 1024)))))
(call-on-ptr setTextureBufferDefaultSize hlmsPbs (* 512 1024))
(call-on-ptr setTextureBufferDefaultSize hlmsUnlit (* 512 1024)))))
(defun ogre-initialize-internal (useCurrentWindow bool &return bool)
(var pluginsFolder (const (in Ogre String)) "./data/")
@ -155,18 +155,18 @@
;; Initialize Root
(var renderSystem (* (in Ogre RenderSystem))
(on-call-ptr g-ogre-root getRenderSystemByName "OpenGL 3+ Rendering Subsystem"))
(call-on-ptr getRenderSystemByName g-ogre-root "OpenGL 3+ Rendering Subsystem"))
(unless renderSystem
(printf "Render system not found!\n")
(return false))
;; renderSystem->setConfigOption("Display Frequency", "N/A");
(on-call-ptr renderSystem setConfigOption "Full Screen" "No")
(call-on-ptr setConfigOption renderSystem "Full Screen" "No")
;; renderSystem->setConfigOption("VSync", "Yes");
(on-call-ptr renderSystem setConfigOption "Video Mode" "1920 x 1080")
(on-call-ptr renderSystem setConfigOption "sRGB Gamma Conversion" "Yes")
(on-call-ptr g-ogre-root setRenderSystem renderSystem)
(set g-ogre-window (on-call-ptr g-ogre-root initialise
(call-on-ptr setConfigOption renderSystem "Video Mode" "1920 x 1080")
(call-on-ptr setConfigOption renderSystem "sRGB Gamma Conversion" "Yes")
(call-on-ptr setRenderSystem g-ogre-root renderSystem)
(set g-ogre-window (call-on-ptr initialise g-ogre-root
(not useCurrentWindow) ;; autoCreateWindow
"GameLib"))
@ -180,7 +180,7 @@
(set (at "currentGLContext" windowSettings) (call (type (in Ogre String)) "True"))
(var winWidth int 1920)
(var winHeight int 1080)
(set g-ogre-window (on-call-ptr g-ogre-root createRenderWindow "GameLib" winWidth winHeight
(set g-ogre-window (call-on-ptr createRenderWindow g-ogre-root "GameLib" winWidth winHeight
false ;; Fullscreen
(addr windowSettings)))
;; renderWindow->setVisible(true);
@ -190,48 +190,48 @@
;; Create SceneManager
(var numThreads (const size_t) 1u)
(set g-scene-manager (on-call-ptr g-ogre-root createSceneManager
(set g-scene-manager (call-on-ptr createSceneManager g-ogre-root
(in Ogre ST_GENERIC) numThreads "SceneManager"))
;; Create & setup camera
(var camera (* (in Ogre Camera)) (on-call-ptr g-scene-manager createCamera "Main Camera"))
(var camera (* (in Ogre Camera)) (call-on-ptr createCamera g-scene-manager "Main Camera"))
;; Position it at 500 in Z direction
(on-call-ptr camera setPosition (call (type (in Ogre Vector3)) 0 5 15))
(call-on-ptr setPosition camera (call (type (in Ogre Vector3)) 0 5 15))
;; Look back along -Z
(on-call-ptr camera lookAt (call (type (in Ogre Vector3)) 0 0 0))
(on-call-ptr camera setNearClipDistance 0.2f)
(on-call-ptr camera setFarClipDistance 1000.0f)
(on-call-ptr camera setAutoAspectRatio true)
(call-on-ptr lookAt camera (call (type (in Ogre Vector3)) 0 0 0))
(call-on-ptr setNearClipDistance camera 0.2f)
(call-on-ptr setFarClipDistance camera 1000.0f)
(call-on-ptr setAutoAspectRatio camera true)
;; Setup a basic compositor with a blue clear colour
(var compositorManager (* (in Ogre CompositorManager2))
(on-call-ptr g-ogre-root getCompositorManager2))
(call-on-ptr getCompositorManager2 g-ogre-root))
(var workspaceName (const (in Ogre String)) "Main Workspace")
;; const IdString definitionNameId = workspaceName;
;; TODO: This needs initializer parameters
(var-construct backgroundColour (const (in Ogre ColourValue)) 0.0302f 0.03f 0.03f)
(on-call-ptr compositorManager createBasicWorkspaceDef
(call-on-ptr createBasicWorkspaceDef compositorManager
workspaceName backgroundColour (call (in Ogre IdString)))
(on-call-ptr compositorManager addWorkspace
g-scene-manager (on-call-ptr g-ogre-window getTexture) camera workspaceName true)
(call-on-ptr addWorkspace compositorManager
g-scene-manager (call-on-ptr getTexture g-ogre-window) camera workspaceName true)
(var resource-group-manager (& (in Ogre ResourceGroupManager))
(call (in Ogre ResourceGroupManager getSingleton)))
(on-call resource-group-manager addResourceLocation
(call-on addResourceLocation resource-group-manager
"data/Models" "FileSystem" "Models")
(on-call resource-group-manager addResourceLocation
(call-on addResourceLocation resource-group-manager
"data/Materials/Textures" "FileSystem" "Textures")
(scope ;; Materials
;; I had to read https://forums.ogre3d.org/viewtopic.php?f=5&t=94769 before figuring out
;; groups needed to be initialized and loaded in order to work (at least, materials do)
(on-call resource-group-manager createResourceGroup "Materials")
(on-call resource-group-manager addResourceLocation
(call-on createResourceGroup resource-group-manager "Materials")
(call-on addResourceLocation resource-group-manager
"data/Materials" "FileSystem" "Materials")
(on-call resource-group-manager initialiseResourceGroup "Materials"
(call-on initialiseResourceGroup resource-group-manager "Materials"
true) ;; changeLocaleTemporarily: See comment above initialiseResourceGroup
(on-call resource-group-manager loadResourceGroup "Materials"))
(call-on loadResourceGroup resource-group-manager "Materials"))
;; (call (in Ogre WindowEventUtilities addWindowEventListener)
;; g-ogre-window (addr g_myWindowEventListener))

2
src/Tracy.cake

@ -12,7 +12,7 @@
(ZoneScopedN "main")
(printf "Waiting for profiler to connect...\n")
(while (not (on-call (call (in tracy GetProfiler)) IsConnected))
(while (not (call-on IsConnected (call (in tracy GetProfiler))))
(ZoneScopedN "wait for profiler")
(sleep 1))

10
test/src/VocalGame.cake

@ -740,7 +740,7 @@
;; configurations don't need to rebuild assets. Probably better to just leave asset building to
;; another executable
(var cache-reference-filename ([] MAX_PATH_LENGTH char) (array 0))
(unless (outputFilenameFromSourceFilename (on-call (field manager buildOutputDir) c_str)
(unless (outputFilenameFromSourceFilename (call-on c_str (field manager buildOutputDir))
blend-asset
"txt" ;; Add to end of file for type
cache-reference-filename (sizeof cache-reference-filename))
@ -757,7 +757,11 @@
"--python" "tools/BlenderToOgre.py"
"--" model-output-dir)
(Log "Asset-Building: failed to build 3D asset. Is Blender on your path? Is blender2ogre set
up on your Blender default preferences? See https://github.com/OGRECave/blender2ogre for setup\n")
up on your Blender default preferences? See https://github.com/OGRECave/blender2ogre for setup\n
You may need to copy blender2ogre to your new blender version, e.g.:\n\n
cp -r Dependencies/blender2ogre/io_ogre ~/.config/blender/[version]\n\n
Or, open your new version of Blender and select 'Copy settings from [previous version]'\n
on the splash screen.")
(free (type-cast model-output-dir (* void)))
(return false))
@ -776,7 +780,7 @@
(scope ;; Textures
(var texture-assets ([] (* (const char))) (array "Monkey_Texture"))
(var texture-process-results (<> std::vector int))
(on-call texture-process-results resize (array-size texture-assets))
(call-on resize texture-process-results (array-size texture-assets))
(var max-num-processes int 4)
(var num-processes-running int 0)
(var i int 0)

Loading…
Cancel
Save