Compare commits

...

340 Commits

Author SHA1 Message Date
kaetemi 422977be8c Merge with develop
--HG--
branch : build_pipeline_v3
10 years ago
kaetemi 797144c783 Max rewrite adjustments
--HG--
branch : build_pipeline_v3
11 years ago
kaetemi 3dbde05bdf Merge with default
--HG--
branch : build_pipeline_v3
11 years ago
kaetemi e74df88404 Adjustments to max rewrite tool
--HG--
branch : build_pipeline_v3
11 years ago
kaetemi d9042ad040 Merge with default
--HG--
branch : build_pipeline_v3
11 years ago
kaetemi de449a90a0 Merge with default
--HG--
branch : build_pipeline_v3
11 years ago
kaetemi 19e474b497 Merge with default
--HG--
branch : build_pipeline_v3
12 years ago
kaetemi 2866fc4b01 Merge with default
--HG--
branch : build_pipeline_v3
12 years ago
kaetemi f94021ac92 Merge with default
--HG--
branch : build_pipeline_v3
12 years ago
kaetemi b926c64de6 Merge with default
--HG--
branch : build_pipeline_v3
12 years ago
kaetemi ef72bfc828 Merge with default
--HG--
branch : build_pipeline_v3
12 years ago
kaetemi 91a8acfd72 Merge with default
--HG--
branch : build_pipeline_v3
12 years ago
kaetemi 58028ce6a5 Merge with default
--HG--
branch : build_pipeline_v3
12 years ago
kaetemi b74292e34f Merge with default
--HG--
branch : build_pipeline_v3
12 years ago
kaetemi ce798c4bf1 Merge with default
--HG--
branch : build_pipeline_v3
12 years ago
kaetemi ae467715a8 Merged: From default to build_pipeline_v3
--HG--
branch : build_pipeline_v3
12 years ago
kaetemi 433cf02624 Added: #1440 Initial code for shape export
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 5e1cab83f5 Removed: #1440 Duplicate project
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 4cc4eb431f Changed: #1440 Remove old code
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 3cdda9cd1d Changed: #1440 Disable compilation of max file library
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi edd73a2493 Changed: #1440 Asset path rewrite configuration
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 2e2013abec Changed: #1440 Typo
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 979c9b56d8 Added: #1440 Replace xref paths and more renaming rules
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 6083dfd829 Added: #1440 Additional filename rewriting rules
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 523ad30655 Changed: #1440 Fallback to filename only instead of using fallback texture
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 45cca62041 Changed: #1440 Also make it work with certain irregular format differences
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi a26ec41392 Added: #1440 Convert Map Extender to Unwrap UVW modifier
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 9a707b0c95 Changed: #1440 Some additional rules
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 8d91f412b4 Added: #1440 Rewrite chunks containing asset paths
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 5361e3cc3d Added: #1440 Initial asset path rewriting code
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 77f5547f15 Added: #1440 Handle some more unknown chunks
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 30954ec397 Changed: #1440 Additional superclass dummies
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 67c245ffcb Added: #1440 Max file scanner
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 7a8b6fc1f8 Added: #1440 File map initialization for asset path rewriting tool
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 7fd3252564 Changed: #1440 Typos
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi acf6a8981f Merged: build_pipeline_v3
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 80e17db602 Added: #1440 Initial tool to fix asset paths
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi dd50972c0c Changed: #1440 Simplify AppData interface
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 534d0bdca9 Added: #1440 PolyObject triangulation and obj test exporter
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 4f544bf916 Added: #1440 Parser for CEditablePoly
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 9db385c94c Added: #1440 Parser for CEditableMesh
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 9c7a3921ea Added: #1440 Poly face info to string
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 3a6b7fc130 Added: #1440 Extended parser for GeomObject
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 3f6de020c0 Added: #1440 Same filter for toStringLocal
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 6af13cafd4 Added: #1440 Parse filter for out of order parsing tricks
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi e5cd5eb497 Added: #1440 Dummy classes for editable mesh, poly and patch
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi b6ec41f53d Added: #1440 Parser for PolyObject faces
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 56fbd0bbb8 Added: #1440 Description of the bitfield used in faces
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 3a09142dc7 Added: #1440 Some notes on PolyObject format
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi fe82439b97 Changed: #1440 Typo
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 89df4ad8f7 Added: #1440 Serialization types for different geometry buffers
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi a8a6be68d5 Changed: #1440 Use more specific structures
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 6e8e6ab86a Added: #1440 Basic export of a TriObject to obj
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 58d57d3304 Changed: #1440 Simplify
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 1161178d2a Added: #1440 Node graph printout
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 15f52ccfac Added: #1440 Parse INode
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi f5d2048f7c Added: #1440 Extended parser for CTrackViewNode
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 028c5381d1 Added: #1440 Base parser for CTrackViewNode
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 359ee113a7 Changed: #1440 Removed parse level
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 76b33139e2 Added: #1440 Parse scene references
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 7eb1eb3313 Added: #1440 Skeleton for scene parser
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 444b71ba92 Changed: #1440 Handle the unknown identifiers safely
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi dce3e67b73 Added: #1440 Parse references
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 72d587fb51 Added: #1440 Pointer to CScene storage
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 1f49f906ba Added: #1440 INode
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 228b787513 Changed: #1440 Take both superclassid and classid into account in the scene class registry
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 12690604ee Added: #1440 Initial parsing of references
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi c037ac9334 Added: #1440 CStorageArray template
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi a4654cdf28 Changed: #1440 Read AppData chunk into Animatable
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi c61fee7a85 Added: #1440 More superclass dummies
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 543f729d42 Added: #1440 More superclass dummies
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 143d8392f1 Added: #1440 More superclass dummy descriptions
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi bf38e47579 Added: #1440 Dummy descriptions for encountered unimplemented superclasses
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi e9fcadb737 Changed: #1440 Constness
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 6ee389a1cf Changed: #1440 Constness
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 3184ce4edc Added: #1440 First registration to the class registry
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi e9a179b203 Added: #1440 Initial class descriptions
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 6520b793ad Added: #1440 Skeleton for superclasses
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 9775de10ea Changed: #1440 Make template for unknown classes so they can be based on the superclasses
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 96ebef489d Added: #1440 Implementation for CSceneClass
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 2cf7892854 Added: #1440 CSceneClass interface and comments
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi ca9a7ab913 Changed: #1440 Additional tests
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 5fd3d7f275 Changed: #1440 Stricter code
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 49aff3b7d7 Added: #1440 Test for AppData, which works
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi c8f3d2cb9b Added: #1440 Functionality for AppData
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 396fe01197 Added: #1440 Extended parser for AppData
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 492a1701cb Added: #1440 Extended parser for AppData entries
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 6f1125b97a Added: #1440 Parser for AppData
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi fa32c4d664 Added: #1440 Additional output
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 0b9cbf147e Added: #1440 More useful print output
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 28e4b2c76c Added: #1440 Parser for scene container
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi dee1431c97 Added: #1440 Parser for unknown scene classes
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 0286e6bf72 Added: #1440 Internal DllDirectory indices
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi b175f4e8bc Added: #1440 Test code for writing the storage back to a stream, which works
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 39feef9c8b Added: #1440 Some comments
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi ab57e97782 Added: #1440 Functionality between ClassDirectory3 and DllDirectory
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi f56e7e2b18 Added: #1440 Initial link between ClassDirectory3 and DllDirectory
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 8946674dd0 Added: #1440 Initial functionality for DllDirectory
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi c1279c1a6e Added: #1440 Plugin descriptions
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 847ca01fb6 Added: #1440 Functionality for ClassDirectory3
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 6fc37e7338 Added: #1440 Extended parser for ClassDirectory3
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 2042692ad1 Added: #1440 Clean duplicate unparsed data after parsing
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 93365f8618 Added: #1440 Unparser for DllDirectory
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 33f548341a Added: #1440 Extended parser for DllDirectory
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi dc0e9a513e Changed: #1440 Parse function instead of serialized handler
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 8cacf5f386 Added: #1440 Parser skeleton for Scene
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi a50cbe9a5f Changed: #1440 Print container indices
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 90956e39d9 Changed: #1440 Some useful stuff
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 8a1b32561d Added: #1440 Parser for config, 0x20a0
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 546334a261 Added: #1440 Parser for Config, ConfigScript
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 7fa54f1164 Added: #1440 Parser for ClassData
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 7266711002 Added: #1440 Parser for ClassDirectory3
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 8410019c50 Added: #1440 Parser for DllDirectory
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 274ed370af Added: #1440 Templates for storage values
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi cfb1d808cc Added: #1440 Raw data to string
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 635092b0db Added: #1440 Simple library for serializing max storage through an IStream
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 9beb31bac4 Added: #1440 Write functionality for storage stream
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi a90d76361c Added: #1440 Serial function for class id
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 4b1a310dfb Added: #1440 Max file utility library
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 4e35b4f551 Added: #1440 Additional utility functions for class id
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi c6bf6be172 Added: #1440 Basic support for 64 bit formatted chunk headers
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 4e27c6f4b4 Added: #1440 Comments
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi e4709fcddd Added: #1440 More types to read
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 08c7c6bf6e Added: #1440 Simple interface to parse the max file into an easy to use tree structure
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 544660d8b3 Added: #1440 NeL IStream interface to gsflib with max specific features
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 15602bb2c6 Added: #1440 Temporary experimental tool related to max files
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 5ef33b6210 Added: #1440 More path rewriting rules
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 44218214bb Added: #1440 Experimental tool for finding missing assets refered to in max files
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 67084cea1b Added: #1440 Additional build stats
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 38eb6f56fc Changed: #1440 Put the actual project and plugin values into the metadata storage request for appending errors
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi b53c2aad26 Added: #1440 Placeholder error logging code
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 7292685545 Added: #1440 Send tool errors from slave to master
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 5e168b210a Added: #1440 Pipeline projects for objects bnp
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi a46cbdc332 Changed: Don't do EOL changes for database.xml and msg.xml
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 0b74f250d9 Removed: Useless data
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi bc1adf6d78 Added: Tool unbuild_interface
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 9598559d87 Added: #1440 Configuration for gamedev and data_common bnp
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 4ec3c5086f Added: #1440 Pipeline process for bnp_make
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi b1f9270037 Added: #1440 Syntax to get configuration value and macro from another project
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 5b30621b8a Changed: Simplify the command
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi f7bbae2074 Changed: Make sure the sorting of files is still the same as when grabbing the files from a single directory in the bnp_make tool
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi e3852e0e08 Added: #1440 Some initial code for the bnp process
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 9da45fc9f0 Changed: #1440 Simplify reading the configuration
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 55e24e4cdb Added: Tool bnp_make can now accept multiple input directories
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 87e66338a8 Added: #1440 Parse the error log
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 448eabc06e Added: #1440 Some comments
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 41c85b16d3 Changed: #1440 Forgot something
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi cfd3e9b7a1 Added: #1440 Allow wildcard in output parameter in depend log, use when input includes other files to depend all the outputs on the included files as well
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 5f650cff5a Added: #1440 Support for processes where the input files include other input files that are not known in advance
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 40f10b6765 Changed: #1440 Some possible issue with negative values
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi aa5c4c16f3 Added: #1440 Dependencies between projects
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi ab873d8d0b Added: #1440 Base for PackageBNP plugin
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi e00aa170c0 Added: #1440 More package configuration
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 4033e53da7 Added: #1440 Initial package project
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi f8f95d47c5 Added: #1440 A proper way to run child processes
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi df9ce91f19 Changed: Disabled some old code
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 5fc4a3b622 Changed: #1440 Typos
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi a01eeb9a45 Added: #1440 TextureDDS plugin using tga2dds tool
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 3b9d2ee306 Changed: #1440 Fixed missing break;
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi f62a688317 Added: #1440 Write directory dependencies from the tool logger. Write depend and error log in tga2dds tool
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 81d1f162b8 Added: #1440 Initial configuration for dds convert process
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 32d53ce3e3 Changed: #1440 Cleanup interface build configuration
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi c807a1eab5 Changed: #1440 Some cleanup
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 8f389a0957 Added: #1440 Utility function for running console tools
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi f9bddebfd8 Reverted: #1440 Previous commit. Re-added files after failed builds also are in the added cache
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 42fd339d73 Changed: #1440 Don't use the added since last successful build cache in this case
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 7fb8ccca88 Added: #1440 Detect added input files for output files that were built in a non-successful build
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 23a4326229 Added: #1440 Abort now possible while plugin is working
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi a28341d04c Added: #1440 Parse depend log and write depend meta files
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi c5f144c886 Changed: #1440 Don't flush depend logs on every write
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 6cd84d1ec5 Changed: #1440 Return a different temporary directory every time
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 31744c25cc Changed: #1440 Write the depend log
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 7d38c69820 Added: #1440 Enum for build and runtime dependencies for the tool dependency logger
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 7def04c28e Added: #1440 Utility function for creating output path structures
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi d3c1988edb Added: #1440 Initial code for build_interface process
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 656db83196 Added: #1440 Call the build plugin
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi d4a0a6df98 Added: #1440 The build thread on the slave where the plugin will be called from
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi b09e65a178 Added: #1440 Interface to start the build
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi fbdc15ae96 Changed: #1440 Move functions to plugin interface
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 56cb277921 Added: #1440 Base for plugin interface to the new functions
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi c9d3d4acce Changed: #1440 Fixed sheet loading checksum initialization issue
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi c7c82f850d Added: #1440 The rest of the needsToBeRebuilt function
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi cce3439b8b Added: #1440 Entry for runtime dependencies in the depend file
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 48e6bd4290 Added: #1440 More of the needsToBeRebuilt function
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi fc6e3c0cab Changed: #1440 Some details
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi c2b2272799 Added: #1440 Implementation notes
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 8416e73aa8 Changed: #1440 Simplify
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 51de16b492 Added: #1440 Implementation notes
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi de2006f467 Added: #1440 Implementation of another part of the needsToBeRebuilt function
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 5fbdda3f64 Added: #1440 Some notes
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi cefc026b1c Added: #1440 Depend metafile
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi fc268d8765 Added: #1440 Pseudocode
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi a79c8a158b Added: #1440 First part of the complete needsToBeRebuilt function
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 1daada31d5 Added: #1440 Output meta file
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 5114cfecec Added: #1440 Implementation notes pseudo code
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 84f7ee9a27 Added: #1440 Implementation notes
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 640b809383 Added: #1440 Initial code too check if files with unknown outputs need to be rebuilt
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi fe18d358c1 Changed: #1440 Restructure functions
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi fa019ede3b Added: #1440 The needsToBeRebuilt function
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 81d513870e Added: #1440 Some more implementation notes
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 8ee835c5e6 Added: #1440 Build listing of added, changed and removed input and output files
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 68a7b12ec8 Changed: #1440 Store status cache of output and dependencies seperately
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi d407c92630 Added: #1440 More implementation comments
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 342c8a9e5f Added: #1440 Some implementation comments
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi d55cd36610 Added: #1440 Slave gets the removed files
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi fffba58a57 Added: #1440 Additional sanity checks on removed file listing
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 959d43bb1c Added: #1440 Function to list known removed files
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 7cdd522f51 Added: #1440 Mutex while initializing file status cache
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 6ce855c1b6 Added: #1440 Slave functions for getting the file status from the plugin
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi e7e0006556 Added: #1440 Additional debug and info messages
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 7b07cb180f Added: #1440 Update the status of the last successful build's output files
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 1c3d8e6609 Added: #1440 Storage functions for process result metadata
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 60fdb1c23e Added: #1440 Read previous successful process result
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi f9de7ed616 Added: #1440 Placeholder function for reading previous process run results
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi be30ccea4d Added: #1440 Send requested status updates from the master to the slave cache
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi b4619055d6 Added: #1440 File status cache for initial file status update
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi b159cd2502 Changed: #1440 Correct encoding for generated itf. Change pipeline config for Linux
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 70c7dd27cd Added: #1440 Build task finished result handling
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 11038a8832 Changed: #1440 Removed delay when connecting slave during master abort
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 53de2641b9 Changed: #1440 Removed dummy process from pipeline project
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 1cbcba202c Changed: #1440 Nicely handle abort button hammering
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi cae3ef87cd Changed: #1440 Handle more exit cases
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 6e8a115eb3 Changed: #1440 Safely handle slave connections during abort
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 9f701b7957 Changed: #1440 Handle disconnect during abort
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 2e43e90980 Changed: #1440 Fix a bug on exit and handle disconnection between master and slave during build status update
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 6f55028ffa Changed: #1440 Clear update flags
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 289cfecf73 Changed: #1440 Correctly lookup in the slaves map
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi aff9193e48 Added: #1440 Initial handling of build abort
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 3c236fc336 Added: #1440 Set active process
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 24190edcf7 Added: #1440 Begin status update
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 64e23f346b Added: #1440 Additional sanity check
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 9dfb99e3b7 Added: #1440 Set active slave task
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi d28d23645e Added: #1440 Initial code for beginning the build task
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi e54956bf0f Changed: #1440 Some comments and naming
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi aae321f9e7 Changed: #1440 Moved some more filepath functions
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 08acf2b63b Changed: #1440 Moved more metadata utility functions
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi b1547fe1d5 Changed: #1440 Moved some metadata utility functions
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 521e760de2 Changed: #1440 Moved some filepath functions
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 71cd3be857 Added: #1440 Project output meta file format
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi b0a4c2c321 Changed: #1440 Allow updating of file status from slave. This is only allowed for files that are output by the active slave process plugin
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi c3ff262e49 Changed: #1440 Avoid possible race condition on exit
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi d9272d06d9 Added: Flags in case slave disconnects during status update request
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 2af323cf46 Changed: Run tasks for slave on master on seperate thread to avoid blocking
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 9bc5ee2399 Added: Some comments
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 3384e1290d Merged: From default to build_pipeline_v3
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 841dcfe712 Added: #1440 Test function for status listing on slave
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 2f9e304b2f Added: #1440 Read status and remove metadata. Use a more sane standardizePath function
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi e9db66a811 Merged: From default to build_pipeline_v3
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi c4460098f1 Changed: #1440 Return list of removed files as well
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi b6127aa582 Added: #1440 Track file removal
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi f5dafabc12 Added: A comment
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 3a7ca88796 Changed: New default configuration values for pipeline
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 7552c02ecd Fixed: Pipeline plugin compile error on Windows
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi d4565d1cf8 Merged: From default to build_pipeline_v3
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi f931258f83 Merged: From default to build_pipeline_v3
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 78d7ca6226 Merged: From default to pipeline_v3
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi cd79f8abee Merged: From default to pipeline_v3
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 64bbaf00c2 Merged: From default (eol revision) to pipeline_v3
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 3acb9620a5 Merged: From default to pipeline_v3
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi d007b6814c Remove: Temporary ignores.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 967a12d34f Merge: From default to build_pipeline_v3.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi d6bd0134b0 Fixed: Some compile settings for pipeline project.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 8af717e33e Added: Find 3ds Max 7 SDK.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi da9aa4c9db Changed: Allow compiling max plugins without the other tools.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi@kaevm.localdomain 53667165b0 Changed: Allow compiling max plugins without the other tools.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi ff84eb30e3 Added: #1440 Configuration for compiling and running pipeline service on Linux.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi fa22fa3ae5 Merge: From default to build_pipeline_v3
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 200c987e72 Merge: From default to build_pipeline_v3
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 8cc89676d7 Added: #1440 Some comments
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 085170e607 Added: #1440 Initial CRC32 verification for workspace sheets
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi f953c72dbb Added: #1440 Comment
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 724a3b82b8 Changed: #1440 Wait 3s for retrying slave build state
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 4d47d78eae Changed: #1440 Some debugging and info display
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 9e39a5ffef Added: #1440 Process dependencies
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi b389f36f7e Merge: From default to build_pipeline_v3
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 64723b3234 Added: #1440 Build and abort commands
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi eb7a1b8ce5 Changed: #1440 Id struct change
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 369d73e7f6 Added: #1440 Test command for task queue loading
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 1585931251 Merge: From default to build_pipeline_v3
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 05b9119d72 Added: #1440 Queue control
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 49bfc5584b Added: #1440 Build task queue
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi c03597dd73 Merge: From default to build_pipeline_v3
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 1837054f5f Added: #1440 Configuration of multiple custom data directories
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi e1d4f16939 Merge: From default to build_pipeline_v3
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi eeae925a05 Added: #1440 Send available plugin handlers on slave to master
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi f32f82a385 Added: #1440 Plugin process handler identifier
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 0400a422f0 Changed: #1440
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi d0c477cbf0 Changed: #1440 Some cleanup
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi ccd232eec8 Added: #1440 Some more debug info
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 0cd3a76a3e Added: #1440 Informational flags and other debug tools
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 54eda8ebef Added: #1440 Master command for reloading workspace sheets on all pipeline services
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 369e1fc6fc Changed: #1440 Modified some logging
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 22d9c67d9e Changed: #1440 Modified some logging
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 91add4e0f2 Changed: #1440 Change some parameter names
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 55911f694a Added: #1440 Command for testing master status update from slave
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 98c9ffff88 Added: #1440 Slave request to master for ensuring database status is up to date for given paths
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 809cbe6c5a Added: #1440 Initial process data dependency listing
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi c6a2534c98 Changed: #1440 Remove redundant text
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 6274912902 Added: #1440 Example cfg for master and slave pipeline service
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 4196ceff00 Added: #1440 Module shells for master and slave
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi fed5c05538 Added: #1440 Automatic standardization of paths in pipeline configuration sheets
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 0df1dbcb45 Merge: From default to build_pipeline_v3.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 3dcb119c41 Changed: #1440 Renamed some sheet values
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 252989fc69 Added: #1440 Project value macros
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 5345ca742d Added: #1440 Pipeline project value parsing initial code
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 80b37c6918 Added: #1440 Class for pipeline project sheet
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 9417b09f51 Added: #1440 List process plugins
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi dd2e2b2e5b Added: #1440 Some temporary ignores
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 31785b7ab8 Changed: #1440 Separation of process handler and process info
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi d114c38eda Added: #1440 Make pipeline plugin configuration part of workspace to allow different plugins being installed on different machines
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 7eacbe6706 Added: CMake projects for pipeline
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 84cbcf8ec4 Merge: From default to build_pipeline_v3.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 0b21fea025 Changed: Reduce sheet log.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi cd57b6e2e5 Changed: Simplified pipeline project configuration format.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 17f0f1fa43 Merge: Default to build pipeline branch.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 47f4d0b7e9 Changed: Replaced some mutexes.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 8bdfa294eb Added: Get temp directory of current project.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 90cc3bda2c Added: Task manager dump commands to pipeline service.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi e9ac3fbdd9 Added: Command tasks.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 10f7ac32be Added: Plugin process class registration.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi a007f7f2c9 Added: Access to config file from pipeline plugin.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 1802d9c091 Added: Pipeline interface class for plugins to request information from the pipeline service.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 811b8e3736 Added: Seperated pipeline projects.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 725ca56387 Changed: Allow build_interface to continue on bad input images, lower error to warning.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 5c37f2cc1b Changed: Allow waiting for database status update.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi b2d9a2fa3d Added: Output file dependencies for build_interface.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 5454f8a724 Added: Tool logger error logging in build_interface.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi a665277784 Added: Function to request status updates of specified paths.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 3d8be0c891 Added: Tool logger and path macros.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi ade48ff193 Added: Use filesize as extra reference.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 8ca684f32a Update: Database file status generation done.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 7a70e86104 Added: Todo comments.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 5d02bcff33 Changed: Safely handle exit during status update.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 9bd3b473fa Added: File status update runnable task.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 3fe8c02aa5 Added: Content database status update command.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 5dfa3ea35a Added: Initial pipeline service.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 0b56f77736 Added: Georges sheets for pipeline.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 2facd0f706 Added: Useful ignores.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi 6a330d7c97 Changed: Cleanup bad data.
--HG--
branch : build_pipeline_v3
13 years ago
kaetemi df19099715 Create branch for build pipeline v3.
--HG--
branch : build_pipeline_v3
13 years ago

@ -5,6 +5,9 @@
**/database.xml = BIN
**/msg.xml = BIN
**/database.xml = BIN
**/msg.xml = BIN
**.txt = native
**.xml = native

@ -0,0 +1,217 @@
# - Try to find GLib2
# Once done this will define
#
# GLIB2_FOUND - system has GLib2
# GLIB2_INCLUDE_DIRS - the GLib2 include directory
# GLIB2_LIBRARIES - Link these to use GLib2
#
# HAVE_GLIB_GREGEX_H glib has gregex.h header and
# supports g_regex_match_simple
#
# Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
# Copyright (c) 2006 Philippe Bernery <philippe.bernery@gmail.com>
# Copyright (c) 2007 Daniel Gollub <dgollub@suse.de>
# Copyright (c) 2007 Alban Browaeys <prahal@yahoo.com>
# Copyright (c) 2008 Michael Bell <michael.bell@web.de>
# Copyright (c) 2008 Bjoern Ricks <bjoern.ricks@googlemail.com>
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
IF (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS )
# in cache already
SET(GLIB2_FOUND TRUE)
ELSE (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS )
INCLUDE(FindPkgConfig)
## Glib
IF ( GLIB2_FIND_REQUIRED )
SET( _pkgconfig_REQUIRED "REQUIRED" )
ELSE ( GLIB2_FIND_REQUIRED )
SET( _pkgconfig_REQUIRED "" )
ENDIF ( GLIB2_FIND_REQUIRED )
IF ( GLIB2_MIN_VERSION )
PKG_SEARCH_MODULE( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0>=${GLIB2_MIN_VERSION} )
ELSE ( GLIB2_MIN_VERSION )
PKG_SEARCH_MODULE( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0 )
ENDIF ( GLIB2_MIN_VERSION )
IF ( PKG_CONFIG_FOUND )
IF ( GLIB2_FOUND )
SET ( GLIB2_CORE_FOUND TRUE )
ELSE ( GLIB2_FOUND )
SET ( GLIB2_CORE_FOUND FALSE )
ENDIF ( GLIB2_FOUND )
ENDIF ( PKG_CONFIG_FOUND )
# Look for glib2 include dir and libraries w/o pkgconfig
IF ( NOT GLIB2_FOUND AND NOT PKG_CONFIG_FOUND )
FIND_PATH(
_glibconfig_include_DIR
NAMES
glibconfig.h
PATHS
/opt/gnome/lib64
/opt/gnome/lib
/opt/lib/
/opt/local/lib
/sw/lib/
/usr/lib64
/usr/lib
/usr/local/include
${CMAKE_LIBRARY_PATH}
PATH_SUFFIXES
glib-2.0/include
)
FIND_PATH(
_glib2_include_DIR
NAMES
glib.h
PATHS
/opt/gnome/include
/opt/local/include
/sw/include
/usr/include
/usr/local/include
PATH_SUFFIXES
glib-2.0
)
#MESSAGE(STATUS "Glib headers: ${_glib2_include_DIR}")
FIND_LIBRARY(
_glib2_link_DIR
NAMES
glib-2.0
glib
PATHS
/opt/gnome/lib
/opt/local/lib
/sw/lib
/usr/lib
/usr/local/lib
)
IF ( _glib2_include_DIR AND _glib2_link_DIR )
SET ( _glib2_FOUND TRUE )
ENDIF ( _glib2_include_DIR AND _glib2_link_DIR )
IF ( _glib2_FOUND )
SET ( GLIB2_INCLUDE_DIRS ${_glib2_include_DIR} ${_glibconfig_include_DIR} )
SET ( GLIB2_LIBRARIES ${_glib2_link_DIR} )
SET ( GLIB2_CORE_FOUND TRUE )
ELSE ( _glib2_FOUND )
SET ( GLIB2_CORE_FOUND FALSE )
ENDIF ( _glib2_FOUND )
# Handle dependencies
# libintl
IF ( NOT LIBINTL_FOUND )
FIND_PATH(LIBINTL_INCLUDE_DIR
NAMES
libintl.h
PATHS
/opt/gnome/include
/opt/local/include
/sw/include
/usr/include
/usr/local/include
)
FIND_LIBRARY(LIBINTL_LIBRARY
NAMES
intl
PATHS
/opt/gnome/lib
/opt/local/lib
/sw/lib
/usr/local/lib
/usr/lib
)
IF (LIBINTL_LIBRARY AND LIBINTL_INCLUDE_DIR)
SET (LIBINTL_FOUND TRUE)
ENDIF (LIBINTL_LIBRARY AND LIBINTL_INCLUDE_DIR)
ENDIF ( NOT LIBINTL_FOUND )
# libiconv
IF ( NOT LIBICONV_FOUND )
FIND_PATH(LIBICONV_INCLUDE_DIR
NAMES
iconv.h
PATHS
/opt/gnome/include
/opt/local/include
/opt/local/include
/sw/include
/sw/include
/usr/local/include
/usr/include
PATH_SUFFIXES
glib-2.0
)
FIND_LIBRARY(LIBICONV_LIBRARY
NAMES
iconv
PATHS
/opt/gnome/lib
/opt/local/lib
/sw/lib
/usr/lib
/usr/local/lib
)
IF (LIBICONV_LIBRARY AND LIBICONV_INCLUDE_DIR)
SET (LIBICONV_FOUND TRUE)
ENDIF (LIBICONV_LIBRARY AND LIBICONV_INCLUDE_DIR)
ENDIF ( NOT LIBICONV_FOUND )
IF (LIBINTL_FOUND)
SET (GLIB2_LIBRARIES ${GLIB2_LIBRARIES} ${LIBINTL_LIBRARY})
SET (GLIB2_INCLUDE_DIRS ${GLIB2_INCLUDE_DIRS} ${LIBINTL_INCLUDE_DIR})
ENDIF (LIBINTL_FOUND)
IF (LIBICONV_FOUND)
SET (GLIB2_LIBRARIES ${GLIB2_LIBRARIES} ${LIBICONV_LIBRARY})
SET (GLIB2_INCLUDE_DIRS ${GLIB2_INCLUDE_DIRS} ${LIBICONV_INCLUDE_DIR})
ENDIF (LIBICONV_FOUND)
ENDIF ( NOT GLIB2_FOUND AND NOT PKG_CONFIG_FOUND )
##
IF (GLIB2_CORE_FOUND AND GLIB2_INCLUDE_DIRS AND GLIB2_LIBRARIES)
SET (GLIB2_FOUND TRUE)
ENDIF (GLIB2_CORE_FOUND AND GLIB2_INCLUDE_DIRS AND GLIB2_LIBRARIES)
IF (GLIB2_FOUND)
IF (NOT GLIB2_FIND_QUIETLY)
MESSAGE (STATUS "Found GLib2: ${GLIB2_LIBRARIES} ${GLIB2_INCLUDE_DIRS}")
ENDIF (NOT GLIB2_FIND_QUIETLY)
ELSE (GLIB2_FOUND)
IF (GLIB2_FIND_REQUIRED)
MESSAGE (SEND_ERROR "Could not find GLib2")
ENDIF (GLIB2_FIND_REQUIRED)
ENDIF (GLIB2_FOUND)
# show the GLIB2_INCLUDE_DIRS and GLIB2_LIBRARIES variables only in the advanced view
MARK_AS_ADVANCED(GLIB2_INCLUDE_DIRS GLIB2_LIBRARIES)
MARK_AS_ADVANCED(LIBICONV_INCLUDE_DIR LIBICONV_LIBRARY)
MARK_AS_ADVANCED(LIBINTL_INCLUDE_DIR LIBINTL_LIBRARY)
ENDIF (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS)
IF ( GLIB2_FOUND )
# Check if system has a newer version of glib
# which supports g_regex_match_simple
INCLUDE( CheckIncludeFiles )
SET( CMAKE_REQUIRED_INCLUDES ${GLIB2_INCLUDE_DIRS} )
CHECK_INCLUDE_FILES ( glib/gregex.h HAVE_GLIB_GREGEX_H )
# Reset CMAKE_REQUIRED_INCLUDES
SET( CMAKE_REQUIRED_INCLUDES "" )
ENDIF( GLIB2_FOUND )

@ -0,0 +1,57 @@
# - Try to find libGSF
#
# Once done this will define
#
# LIBGSF_FOUND - System has LibGSF
# LIBGSF_INCLUDE_DIR - The LibGSF include directory
# LIBGSF_LIBRARIES - The libraries needed to use LibGSF
# LIBGSF_DEFINITIONS - Compiler switches required for using LibGSF
# LIBGSF_GSF_EXECUTABLE - The archive utility
# LIBGSF_GSFOFFICETHUMBNAILER_EXECUTABLE - The office files thumbnailer for the GNOME desktop
# LIBGSF_GSFVBADUMP_EXECUTABLE - The utility to extract Visual Basic for Applications macros
# Copyright (c) 2009, Pau Garcia i Quiles <pgquiles@elpauer.org>
# Based off FindLibXml2.cmake from CMake 2.6.4 by Alexander Neundorf <neundorf@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
IF (LIBGSF_INCLUDE_DIR AND LIBGSF_LIBRARIES)
# in cache already
SET(LIBGSF_FIND_QUIETLY TRUE)
ENDIF (LIBGSF_INCLUDE_DIR AND LIBGSF_LIBRARIES)
IF (NOT WIN32)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(PC_LIBGSF libgsf-1)
SET(LIBGSF_DEFINITIONS ${PC_LIBGSF_CFLAGS_OTHER})
ENDIF (NOT WIN32)
FIND_PATH(LIBGSF_INCLUDE_DIR gsf/gsf.h
HINTS
${PC_LIBGSF_INCLUDEDIR}
${PC_LIBGSF_INCLUDE_DIRS}
PATH_SUFFIXES libgsf-1
)
FIND_LIBRARY(LIBGSF_LIBRARIES NAMES gsf-1 libgsf-1
HINTS
${PC_LIBGSF_LIBDIR}
${PC_LIBGSF_LIBRARY_DIRS}
)
FIND_PROGRAM(LIBGSF_GSF_EXECUTABLE gsf)
FIND_PROGRAM(LIBGSF_GSFOFFICETHUMBNAILER_EXECUTABLE gsf-office-thumbnailer)
FIND_PROGRAM(LIBGSF_GSFVBADUMP_EXECUTABLE gsf-vba-dump)
INCLUDE(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBGSF_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBGSF DEFAULT_MSG LIBGSF_LIBRARIES LIBGSF_INCLUDE_DIR)
MARK_AS_ADVANCED(LIBGSF_INCLUDE_DIR LIBGSF_LIBRARIES LIBGSF_GSF_EXECUTABLE LIBGSF_GSFOFFICETHUMBNAILER_EXECUTABLE LIBGSF_GSFVBADUMP_EXECUTABLE )

@ -337,7 +337,7 @@ MACRO(NL_SETUP_NEL_DEFAULT_OPTIONS)
OPTION(WITH_NEL_MAXPLUGIN "Build NeL 3dsMax Plugin" OFF)
OPTION(WITH_NEL_SAMPLES "Build NeL Samples" ON )
OPTION(WITH_NEL_TESTS "Build NeL Unit Tests" ON )
OPTION(WITH_NEL_PIPELINE "Build NeL Pipeline" ON )
OPTION(WITH_LIBOVR "With LibOVR support" OFF)
OPTION(WITH_LIBVR "With LibVR support" OFF)
OPTION(WITH_PERFHUD "With NVIDIA PerfHUD support" OFF)

@ -23,6 +23,7 @@
namespace NLMISC
{
class IStream;
// ***************************************************************************
/**
@ -52,6 +53,13 @@ public:
//CClassId& operator=(const CClassId &o) { Uid = o.Uid; return *this;}
operator uint64() const {return Uid;}
inline uint32 a() const { return (uint32)(Uid >> 32); }
inline uint32 b() const { return (uint32)(Uid & 0xFFFFFFFFL); }
inline void setA(uint32 a) { Uid = ((uint64)a<<32) | (Uid & 0xFFFFFFFFL); }
inline void setB(uint32 b) { Uid = (Uid & 0xFFFFFFFF00000000L) | b; }
void serial(NLMISC::IStream &s);
std::string toString() const;
};
/**

@ -0,0 +1,196 @@
/**
* \file tool_logger.h
* \brief CToolLogger
* \date 2012-02-19 10:33GMT
* \author Jan Boon (Kaetemi)
* Tool logger is fully implemented in header so small tools do not
* need to link to this library unnecessarily.
* NOTE: Needs to be changed not to use time_nl and string_common.
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RYZOM CORE PIPELINE; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_TOOL_LOGGER_H
#define PIPELINE_TOOL_LOGGER_H
#include <nel/misc/types_nl.h>
// STL includes
#include <string>
#include <stdio.h>
#include <stdlib.h>
// NeL includes
#include <nel/misc/time_nl.h>
#include <nel/misc/string_common.h>
// Project includes
namespace PIPELINE {
#ifdef ERROR
#undef ERROR
#endif
enum TError
{
ERROR,
WARNING,
MESSAGE,
};
enum TDepend
{
BUILD,
DIRECTORY,
RUNTIME,
};
const std::string s_ErrorHeader = "type\tpath\ttime\terror";
const std::string s_DependHeader = "type\toutput_file\tinput_file";
/**
* \brief CToolLogger
* \date 2012-02-19 10:33GMT
* \author Jan Boon (Kaetemi)
* CToolLogger
*/
class CToolLogger
{
private:
FILE *m_ErrorLog;
FILE *m_DependLog;
public:
inline CToolLogger()
{
}
inline ~CToolLogger()
{
release();
}
inline void initError(const std::string &errorLog)
{
releaseError();
m_ErrorLog = fopen(errorLog.c_str(), "wt");
fwrite(s_ErrorHeader.c_str(), 1, s_ErrorHeader.length(), m_ErrorLog);
fwrite("\n", 1, 1, m_ErrorLog);
fflush(m_ErrorLog);
}
inline void initDepend(const std::string &dependLog)
{
releaseDepend();
m_DependLog = fopen(dependLog.c_str(), "wt");
fwrite(s_DependHeader.c_str(), 1, s_DependHeader.length(), m_DependLog);
fwrite("\n", 1, 1, m_DependLog);
// fflush(m_DependLog);
}
inline void writeError(TError type, const std::string &path, const std::string &error)
{
if (m_ErrorLog)
{
switch (type)
{
case ERROR:
fwrite("ERROR", 1, 5, m_ErrorLog);
break;
case WARNING:
fwrite("WARNING", 1, 7, m_ErrorLog);
break;
case MESSAGE:
fwrite("MESSAGE", 1, 7, m_ErrorLog);
break;
}
fwrite("\t", 1, 1, m_ErrorLog);
fwrite(path.c_str(), 1, path.length(), m_ErrorLog);
fwrite("\t", 1, 1, m_ErrorLog);
std::string time = NLMISC::toString(NLMISC::CTime::getSecondsSince1970());
fwrite(time.c_str(), 1, time.length(), m_ErrorLog);
fwrite("\t", 1, 1, m_ErrorLog);
fwrite(error.c_str(), 1, error.length(), m_ErrorLog);
fwrite("\n", 1, 1, m_ErrorLog);
fflush(m_ErrorLog);
}
}
/// inputFile can only be file. [? May be not-yet-existing file for expected input for future build runs. ?] Directories are handled on process level. [? You should call this before calling writeError on inputFile, so the error is also linked from the outputFile. ?]
inline void writeDepend(TDepend type, const std::string &outputFile, const std::string &inputFile)
{
if (m_DependLog)
{
switch (type)
{
case BUILD:
fwrite("BUILD", 1, 5, m_DependLog);
break;
case DIRECTORY:
fwrite("DIRECTORY", 1, 9, m_DependLog);
break;
case RUNTIME:
fwrite("RUNTIME", 1, 7, m_DependLog);
break;
}
fwrite("\t", 1, 1, m_DependLog);
fwrite(outputFile.c_str(), 1, outputFile.length(), m_DependLog);
fwrite("\t", 1, 1, m_DependLog);
fwrite(inputFile.c_str(), 1, inputFile.length(), m_DependLog);
fwrite("\n", 1, 1, m_DependLog);
// fflush(m_DependLog);
}
}
inline void releaseError()
{
if (m_ErrorLog)
{
fflush(m_ErrorLog);
fclose(m_ErrorLog);
m_ErrorLog = NULL;
}
}
inline void releaseDepend()
{
if (m_DependLog)
{
fflush(m_DependLog);
fclose(m_DependLog);
m_DependLog = NULL;
}
}
inline void release()
{
releaseError();
releaseDepend();
}
}; /* class CToolLogger */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_TOOL_LOGGER_H */
/* end of file */

@ -18,7 +18,10 @@
#include "nel/misc/class_id.h"
#include <sstream>
#include <iomanip>
#include "nel/misc/stream.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
@ -30,6 +33,39 @@ namespace NLMISC
const CClassId CClassId::Null(0);
void CClassId::serial(NLMISC::IStream &s)
{
// s.serial(Uid);
// Backwards.
uint32 va = a();
uint32 vb = b();
s.serial(va);
s.serial(vb);
setA(va);
setB(vb);
}
std::string CClassId::toString() const
{
std::stringstream ss;
ss << "(0x";
{
std::stringstream ss1;
ss1 << std::hex << std::setfill('0');
ss1 << std::setw(8) << a();
ss << ss1.str();
}
ss << ", 0x";
{
std::stringstream ss1;
ss1 << std::hex << std::setfill('0');
ss1 << std::setw(8) << b();
ss << ss1.str();
}
ss << ")";
return ss.str();
}
}

@ -501,6 +501,7 @@ void CFileDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *mes
if (_NeedHeader)
{
const char *hs = HeaderString();
// TODO: I think strlen(hs), 1 should be swapped (might have influence on "t" usage).
fwrite (hs, strlen (hs), 1, _FilePointer);
_NeedHeader = false;
}

@ -0,0 +1,48 @@
/**
* \file tool_logger.cpp
* \brief CToolLogger
* \date 2012-02-19 10:33GMT
* \author Jan Boon (Kaetemi)
* CToolLogger
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RYZOM CORE PIPELINE; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "nel/misc/tool_logger.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
// Tool logger is fully implemented in header so small tools do not need to link to this library unnecessarily.
void dummmmmmmyyyyyyyyyyyyyyyyy_tool_logger_cpp() { }
} /* namespace PIPELINE */
/* end of file */

@ -1,5 +1,7 @@
FILE(GLOB SRC *.cpp *.h)
SOURCE_GROUP("" FILES ${SRC})
ADD_EXECUTABLE(build_interface ${SRC})
TARGET_LINK_LIBRARIES(build_interface nelmisc)

@ -43,10 +43,16 @@ bool CNelExport::exportMesh (const char *sPath, INode& node, TimeValue time)
{
DWORD dwRetVal = GetTempPathA(MAX_PATH, tempPathBuffer);
if (dwRetVal > MAX_PATH || (dwRetVal == 0))
{
ToolLogger.writeError(PIPELINE::ERROR, "*", "GetTempPath failed");
nlerror("GetTempPath failed");
}
UINT uRetVal = GetTempFileNameA(tempPathBuffer, TEXT("_nel_export_mesh_"), 0, tempFileName);
if (uRetVal == 0)
{
ToolLogger.writeError(PIPELINE::ERROR, "*", "GetTempFileName failed");
nlerror("GetTempFileName failed");
}
// Eval the object a time
ObjectState os = node.EvalWorldState(time);
@ -118,6 +124,7 @@ bool CNelExport::exportMesh (const char *sPath, INode& node, TimeValue time)
catch (...)
{
nlwarning("Shape serialization failed!");
ToolLogger.writeError(PIPELINE::ERROR, "*", "Shape serialization failed");
try
{
file.close();
@ -132,6 +139,7 @@ bool CNelExport::exportMesh (const char *sPath, INode& node, TimeValue time)
else
{
nlwarning("Failed to create file %s", tempFileName);
ToolLogger.writeError(PIPELINE::ERROR, "*", "Failed to create temporary shape file");
if (_TerminateOnFileOpenIssues)
nelExportTerminateProcess();
}
@ -148,6 +156,7 @@ bool CNelExport::exportMesh (const char *sPath, INode& node, TimeValue time)
catch (...)
{
nlwarning("Failed to delete pShape pointer! Something might be wrong.");
ToolLogger.writeError(PIPELINE::ERROR, "*", "Failed to delete pShape pointer");
remove(tempFileName);
bRet = false;
}
@ -174,6 +183,7 @@ bool CNelExport::exportMesh (const char *sPath, INode& node, TimeValue time)
else
{
nlwarning("Failed to open file: %s", tempFileName);
ToolLogger.writeError(PIPELINE::ERROR, "*", "Failed to open temp shape file");
if (_TerminateOnFileOpenIssues)
nelExportTerminateProcess();
}
@ -181,6 +191,7 @@ bool CNelExport::exportMesh (const char *sPath, INode& node, TimeValue time)
catch (...)
{
nlwarning("Failed to verify shape. Must crash now.");
ToolLogger.writeError(PIPELINE::ERROR, "*", "Failed to verify shape");
remove(tempFileName);
bRet = false;
}
@ -191,11 +202,13 @@ bool CNelExport::exportMesh (const char *sPath, INode& node, TimeValue time)
catch (...)
{
nlwarning("Fatal exception at CNelExport::exportMesh.");
ToolLogger.writeError(PIPELINE::ERROR, "*", "Fatal exception at CNelExport::exportMesh");
bRet = false;
}
if (bRet)
{
ToolLogger.writeDepend(PIPELINE::BUILD, sPath, "*");
try
{
remove(sPath);

@ -63,6 +63,13 @@ def_visible_primitive ( set_file_modification_date, "NeLSetFileModificationDate
def_visible_primitive ( force_quit_on_msg_displayer, "NelForceQuitOnMsgDisplayer");
def_visible_primitive ( force_quit_right_now, "NelForceQuitRightNow");
def_visible_primitive(tool_logger_init_error, "NelToolLoggerInitError");
def_visible_primitive(tool_logger_init_depend, "NelToolLoggerInitDepend");
def_visible_primitive(tool_logger_write_error, "NelToolLoggerWriteError");
def_visible_primitive(tool_logger_write_depend, "NelToolLoggerWriteDepend");
def_visible_primitive(tool_logger_release_error, "NelToolLoggerReleaseError");
def_visible_primitive(tool_logger_release_depend, "NelToolLoggerReleaseDepend");
char *sExportShapeErrorMsg = "NeLExportShape [Object] [Filename.shape]";
char *sExportShapeExErrorMsg = "NeLExportShapeEx [Object] [Filename.shape] [bShadow] [bExportLighting] [sLightmapPath] [nLightingLimit] [fLumelSize] [nOverSampling] [bExcludeNonSelected] [bShowLumel]";
char *sExportAnimationErrorMsg = "NelExportAnimation [node array] [Filename.anim] [bool_scene_animation]";
@ -114,10 +121,12 @@ Value* export_shape_cf (Value** arg_list, int count)
}
catch (Exception &e)
{
ToolLogger.writeError(PIPELINE::ERROR, "*", e.what());
nlwarning ("ERROR (NelExportShape) %s", e.what());
}
catch (...)
{
ToolLogger.writeError(PIPELINE::ERROR, "*", "Exception");
nlwarning ("ERROR (NelExportShape) catch (...)");
}
nlinfo("ret");
@ -189,10 +198,12 @@ Value* export_shape_ex_cf (Value** arg_list, int count)
}
catch (Exception &e)
{
ToolLogger.writeError(PIPELINE::ERROR, "*", e.what());
nlwarning ("ERROR (NelExportShapeEx) %s", e.what());
}
catch (...)
{
ToolLogger.writeError(PIPELINE::ERROR, "*", "Exception");
nlwarning ("ERROR (NelExportShapeEx) catch (...)");
}
nlinfo("ret");
@ -987,6 +998,68 @@ Value* force_quit_right_now_cf(Value** arg_list, int count)
return &true_value;
}
Value* tool_logger_init_error_cf(Value** arg_list, int count)
{
check_arg_count(NelToolLoggerInitError, 1, count);
type_check(arg_list[0], String, "");
ToolLogger.initError(arg_list[0]->to_string());
return &true_value;
}
Value* tool_logger_init_depend_cf(Value** arg_list, int count)
{
check_arg_count(NelToolLoggerInitDepend, 1, count);
type_check(arg_list[0], String, "");
ToolLogger.initDepend(arg_list[0]->to_string());
return &true_value;
}
Value* tool_logger_write_error_cf(Value** arg_list, int count)
{
check_arg_count(NelToolLoggerWriteError, 3, count);
type_check(arg_list[0], String, "");
type_check(arg_list[1], String, "");
type_check(arg_list[2], String, "");
// TYPE, PATH, MESSAGE
std::string type = arg_list[0]->to_string();
ToolLogger.writeError(type == "MESSAGE" ? PIPELINE::MESSAGE : type == "WARNING" ? PIPELINE::WARNING : PIPELINE::ERROR, arg_list[1]->to_string(), arg_list[2]->to_string());
return &true_value;
}
Value* tool_logger_write_depend_cf(Value** arg_list, int count)
{
check_arg_count(NelToolLoggerWriteDepend, 3, count);
type_check(arg_list[0], String, "");
type_check(arg_list[1], String, "");
type_check(arg_list[2], String, "");
// TYPE, OUTPUT, INPUT
std::string type = arg_list[0]->to_string();
ToolLogger.writeDepend(type == "RUNTIME" ? PIPELINE::RUNTIME : type == "DIRECTORY" ? PIPELINE::DIRECTORY : PIPELINE::BUILD, arg_list[1]->to_string(), arg_list[2]->to_string());
return &true_value;
}
Value* tool_logger_release_error_cf(Value** arg_list, int count)
{
ToolLogger.releaseError();
return &true_value;
}
Value* tool_logger_release_depend_cf(Value** arg_list, int count)
{
ToolLogger.releaseDepend();
return &true_value;
}
/*===========================================================================*\
| MAXScript Plugin Initialization
\*===========================================================================*/

@ -2015,6 +2015,7 @@ void CExportNel::deleteLM(INode& ZeNode)
if (!CFile::deleteFile(sSaveName))
{
nlwarning("Failed to delete file %s.", sSaveName.c_str());
ToolLogger.writeError(PIPELINE::ERROR, sSaveName.c_str(), "Failed to delete previously built lightmap");
}
}
}
@ -2278,6 +2279,7 @@ bool CExportNel::calculateLM( CMesh::CMeshBuild *pZeMeshBuild, CMeshBase::CMeshB
thetext = "Warning ";
thetext += ZeNode.GetName();
thetext = "have all faces NOT mapped (UV2)";
ToolLogger.writeError(PIPELINE::ERROR, "*", thetext);
if (gOptions.FeedBack != NULL)
{
gOptions.FeedBack->setLine (11, thetext);
@ -2328,6 +2330,8 @@ bool CExportNel::calculateLM( CMesh::CMeshBuild *pZeMeshBuild, CMeshBase::CMeshB
sTmp += ZeNode.GetName();
sTmp += " has mapping problem";
ToolLogger.writeError(PIPELINE::ERROR, "*", sTmp);
// Script trace
mprintf ((sTmp+"\n").c_str());
@ -2596,6 +2600,7 @@ bool CExportNel::calculateLM( CMesh::CMeshBuild *pZeMeshBuild, CMeshBase::CMeshB
nlinfo("DELETE %s", sLMName.c_str());
if (!CFile::deleteFile(sLMName))
{
ToolLogger.writeError(PIPELINE::ERROR, sLMName, "Failed to delete previously built lightmap");
nlwarning("Failed to delete file %s", sLMName.c_str());
}
}
@ -2612,6 +2617,8 @@ bool CExportNel::calculateLM( CMesh::CMeshBuild *pZeMeshBuild, CMeshBase::CMeshB
// cust copy to 32 bits
LightMap.copyColToBitmap32 (pLightMap, j);
ToolLogger.writeDepend(PIPELINE::BUILD, sSaveName, "*");
COFile f( sSaveName );
try
{
@ -2630,6 +2637,7 @@ bool CExportNel::calculateLM( CMesh::CMeshBuild *pZeMeshBuild, CMeshBase::CMeshB
}
catch(Exception &e)
{
ToolLogger.writeError(PIPELINE::ERROR, sSaveName, "Cannot write the lightmap file");
if (gOptions.FeedBack != NULL)
{
char message[512];

@ -28,6 +28,9 @@
#include "nel/3d/animation_time.h"
#include "nel/3d/animation_time.h"
#include "nel/pacs/collision_mesh_build.h"
#include "nel/misc/tool_logger.h"
extern PIPELINE::CToolLogger ToolLogger;
#define UVGEN_MISSING (-1)
#define UVGEN_REFLEXION (-2)

@ -25,6 +25,11 @@
#endif
#include "export_nel.h"
#include "export_appdata.h"
#include <nel/misc/tool_logger.h>
// ***************************************************************************
PIPELINE::CToolLogger ToolLogger;
// ***************************************************************************

@ -25,10 +25,13 @@
#include "../s3tc_compressor_lib/s3tc_compressor.h"
#include <sstream>
#include "nel/misc/tool_logger.h"
using namespace NLMISC;
using namespace std;
PIPELINE::CToolLogger ToolLogger;
#define TGA8 8
#define TGA16 16
@ -208,7 +211,7 @@ void writeInstructions()
cout<<"extension \"_usercolor\""<<endl;
cout<<"ex : pic.tga, the associated user color file must be : pic_usercolor.tga"<<endl;
cout<<endl;
cout<<"syntax : tga2dds <input> [-o <output.dds>] [-a <algo>] [-m]"<<endl;
cout<<"syntax : tga2dds <input> [-o <output.dds>] [-a <algo>] [-m] [-d dependLog] [-e errorLog]"<<endl;
cout<<endl;
cout<<"with"<<endl;
cout<<"algo : 1 for DXTC1 (no alpha)"<<endl;
@ -250,6 +253,8 @@ string OptOutputFileName;
uint8 OptAlgo = NOT_DEFINED;
bool OptMipMap = false;
uint Reduce = 0;
bool ForceSkipCheck = false;
bool CheckUserColor = true;
bool parseOptions(int argc, char **argv)
{
for(sint i=2;i<argc;i++)
@ -313,6 +318,20 @@ bool parseOptions(int argc, char **argv)
Reduce = 7;
else if(!strcmp(argv[i], "-r8"))
Reduce = 8;
else if(!strcmp(argv[i], "-d"))
{
++i;
ToolLogger.initDepend(argv[i]);
}
else if(!strcmp(argv[i], "-e"))
{
++i;
ToolLogger.initError(argv[i]);
}
else if(!strcmp(argv[i], "-f"))
ForceSkipCheck = true;
else if(!strcmp(argv[i], "-nousercolor"))
CheckUserColor = false;
// What is this option?
else
{
@ -386,6 +405,8 @@ int main(int argc, char **argv)
if(!parseOptions(argc, argv))
{
writeInstructions();
ToolLogger.writeError(PIPELINE::ERROR, "", "Invalid settings");
ToolLogger.release();
return 0;
}
@ -398,23 +419,33 @@ int main(int argc, char **argv)
std::string inputFileName(argv[1]);
if(inputFileName.find("_usercolor")<inputFileName.length())
{
ToolLogger.writeError(PIPELINE::ERROR, inputFileName, "User color cannot be converted directly, it is the source file for a channel of another dds file");
ToolLogger.release();
return 0;
}
NLMISC::CIFile input;
if(!input.open(inputFileName))
{
cerr<<"Can't open input file "<<inputFileName<<endl;
ToolLogger.writeError(PIPELINE::ERROR, inputFileName, "Can't open input file");
ToolLogger.release();
return 1;
}
uint8 imageDepth = picTga.load(input);
if(imageDepth==0)
{
cerr<<"Can't load file : "<<inputFileName<<endl;
ToolLogger.writeError(PIPELINE::ERROR, inputFileName, "Can't load file");
ToolLogger.release();
return 1;
}
if(imageDepth!=16 && imageDepth!=24 && imageDepth!=32 && imageDepth!=8)
{
cerr<<"Image not supported : "<<imageDepth<<endl;
stringstream ss;
ss << "Image depth not supported: " << imageDepth;
cerr << ss.str() << endl;
ToolLogger.writeError(PIPELINE::ERROR, inputFileName, ss.str());
ToolLogger.release();
return 1;
}
input.close();
@ -448,11 +479,15 @@ int main(int argc, char **argv)
algo = DXT5;
}
ToolLogger.writeDepend(PIPELINE::BUILD, outputFileName, inputFileName);
// Data check
//===========
if(dataCheck(inputFileName,outputFileName, OptAlgo, OptMipMap))
if(!ForceSkipCheck && dataCheck(inputFileName,outputFileName, OptAlgo, OptMipMap))
{
cout<<outputFileName<<" : a recent dds file already exists"<<endl;
ToolLogger.writeError(PIPELINE::WARNING, outputFileName, "A more recent dds file already exists, this file may not have been built correctly");
ToolLogger.release();
return 0;
}
@ -503,8 +538,10 @@ int main(int argc, char **argv)
// Reading second Tga for user color, don't complain if _usercolor is missing
NLMISC::CIFile input2;
if (CPath::exists(userColorFileName) && input2.open(userColorFileName))
if (CheckUserColor && CPath::exists(userColorFileName) && input2.open(userColorFileName))
{
ToolLogger.writeDepend(PIPELINE::BUILD, outputFileName, userColorFileName);
picTga2.load(input2);
uint32 height2 = picTga2.getHeight();
uint32 width2 = picTga2.getWidth();
@ -610,6 +647,8 @@ int main(int argc, char **argv)
if(!output.open(outputFileName))
{
cerr<<"Can't open output file "<<outputFileName<<endl;
ToolLogger.writeError(PIPELINE::ERROR, outputFileName, "Can't open output file");
ToolLogger.release();
return 1;
}
try
@ -636,6 +675,8 @@ int main(int argc, char **argv)
catch(const NLMISC::EWriteError &e)
{
cerr<<e.what()<<endl;
ToolLogger.writeError(PIPELINE::ERROR, outputFileName, std::string("Write error: ") + e.what());
ToolLogger.release();
return 1;
}
@ -672,6 +713,8 @@ int main(int argc, char **argv)
if(!output.open(outputFileName))
{
cerr<<"Can't open output file "<<outputFileName<<endl;
ToolLogger.writeError(PIPELINE::ERROR, outputFileName, "Can't open output file");
ToolLogger.release();
return 1;
}
try
@ -682,11 +725,14 @@ int main(int argc, char **argv)
catch(const NLMISC::EWriteError &e)
{
cerr<<e.what()<<endl;
ToolLogger.writeError(PIPELINE::ERROR, outputFileName, std::string("Write error: ") + e.what());
ToolLogger.release();
return 1;
}
output.close();
}
ToolLogger.release();
return 0;
}

@ -0,0 +1,11 @@
FILE(GLOB SRC *.cpp *.h)
SOURCE_GROUP("" FILES ${SRC})
ADD_EXECUTABLE(unbuild_interface ${SRC})
TARGET_LINK_LIBRARIES(unbuild_interface nelmisc)
NL_DEFAULT_PROPS(unbuild_interface "NeL, Tools, 3D: unbuild_interface")
NL_ADD_RUNTIME_FLAGS(unbuild_interface)
INSTALL(TARGETS unbuild_interface RUNTIME DESTINATION bin COMPONENT tools3d)

@ -0,0 +1,155 @@
/**
* \file unbuild_interface.cpp
* \brief Unbuild Interface
* \date 2009-03-14 13:25GMT
* \author Jan Boon (Kaetemi)
* Unbuild Interface
*/
/*
* Copyright (C) 2009 by authors
*
* This file is part of NEVRAX NEL.
* NEVRAX NEL is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 2 of the License,
* or (at your option) any later version.
*
* NEVRAX NEL is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NEVRAX NEL; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
// STL includes
#include <vector>
#include <string>
#include <map>
#include <iostream>
#include <fstream>
// NeL includes
#include <nel/misc/common.h>
#include <nel/misc/file.h>
#include <nel/misc/bitmap.h>
#include <nel/misc/log.h>
#include <nel/misc/path.h>
#include <nel/misc/uv.h>
#include <nel/misc/vector_h.h>
// Project includes
// ...
using namespace std;
using namespace NLMISC;
namespace {
} /* anonymous namespace */
int main(int nNbArg, char **ppArgs)
{
// create debug stuff
createDebug();
// verify all params
if (nNbArg < 3)
{
nlinfo("ERROR : Wrong number of arguments\n");
nlinfo("USAGE : unbuild_interface <in_tga_name> <out_path_maps>\n");
return EXIT_FAILURE;
}
string in_tga_name = string(ppArgs[1]);
if (!CFile::fileExists(in_tga_name))
{
nlerrornoex("File %s does not exist", in_tga_name.c_str());
return EXIT_FAILURE;
}
string in_txt_name = in_tga_name.substr(0, in_tga_name.size() - 4) + ".txt";
if (!CFile::fileExists(in_txt_name))
{
nlerrornoex("File %s does not exist", in_txt_name.c_str());
return EXIT_FAILURE;
}
string out_path_maps = ppArgs[2];
if (!CFile::isDirectory(out_path_maps))
{
nlerrornoex("Directory %s does not exist", out_path_maps.c_str());
return EXIT_FAILURE;
}
// read in the tga
CBitmap in_bitmap;
try
{
CIFile in_file;
in_file.open(in_tga_name);
in_bitmap.load(in_file);
in_file.close();
}
catch (NLMISC::Exception &e)
{
nlerrornoex("(NLMISC::Exception : %s", e.what());
return EXIT_FAILURE;
}
// read maps infos from txt
try
{
ifstream in_file;
in_file.open(in_txt_name.c_str());
string line;
vector<string> line_expl;
line_expl.reserve(5);
while (getline(in_file, line))
{
// parse from file
line_expl.clear();
explode<string>(line, " ", line_expl, false);
nlassertex((line_expl.size() == 5), ("Bad line entry count"));
CVectorH vh; // x, y, z, w;
if (!fromString(line_expl[1], vh.x)
|| !fromString(line_expl[2], vh.y)
|| !fromString(line_expl[3], vh.z)
|| !fromString(line_expl[4], vh.w))
nlerror("Bad line formatting '%s'", line.c_str());
vh.x *= (float)in_bitmap.getWidth();
nlassertex((vh.x == (float)(int)vh.x), ("Bad coordinate"));
vh.y *= (float)in_bitmap.getHeight();
nlassertex((vh.y == (float)(int)vh.y), ("Bad coordinate"));
vh.z *= (float)in_bitmap.getWidth();
nlassertex((vh.z == (float)(int)vh.z), ("Bad coordinate"));
vh.w *= (float)in_bitmap.getHeight();
nlassertex((vh.w == (float)(int)vh.w), ("Bad coordinate"));
nlinfo("%s %f %f %f %f", line_expl[0].c_str(), vh.x, vh.y, vh.z, vh.w);
// write to tga
CBitmap out_bitmap;
out_bitmap.resize((sint32)vh.z - (sint32)vh.x, (sint32)vh.w - (sint32)vh.y, CBitmap::RGBA, true);
out_bitmap.blit(in_bitmap, (sint)vh.x, (sint)vh.y, (sint)vh.z - (sint)vh.x, (sint)vh.w - (sint)vh.y, 0, 0);
COFile out_file;
if (out_file.open(out_path_maps + "/" + line_expl[0]))
{
out_bitmap.writeTGA(out_file, 32);
out_file.close();
}
else nlerror("Cannot write tga file '%s/%s'", out_path_maps.c_str(), line_expl[0].c_str());
}
in_file.close();
}
catch (std::exception &e)
{
nlerrornoex("std::exception : %s", e.what());
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
/* end of file */

@ -28,4 +28,8 @@ IF(WITH_NEL_TOOLS)
IF(WITH_NEL_TESTS)
ADD_SUBDIRECTORY(nel_unit_test)
ENDIF(WITH_NEL_TESTS)
IF(WITH_NEL_PIPELINE)
ADD_SUBDIRECTORY(pipeline)
ENDIF(WITH_NEL_PIPELINE)
ENDIF(WITH_NEL_TOOLS)

@ -32,11 +32,13 @@
#include "nel/misc/path.h"
#include "nel/misc/algo.h"
#include "nel/misc/common.h"
#include "nel/misc/tool_logger.h"
using namespace std;
using namespace NLMISC;
PIPELINE::CToolLogger ToolLogger;
// ---------------------------------------------------------------------------
class CWildCard
@ -249,6 +251,8 @@ struct BNPHeader
string gDestBNPFile;
BNPHeader gBNPHeader;
std::vector<std::string> gDirectories;
bool gNoRecurse = false;
// ---------------------------------------------------------------------------
void append(const string &filename1, const string &filename2, uint32 sizeToRead)
@ -275,13 +279,16 @@ bool i_comp(const string &s0, const string &s1)
return nlstricmp (CFile::getFilename(s0).c_str(), CFile::getFilename(s1).c_str()) < 0;
}
void packSubRecurse ()
void packSubRecurse(const std::vector<std::string> &directories)
{
vector<string> pathContent;
string cp = CPath::getCurrentPath();
printf ("Treating directory : %s\n", cp.c_str());
CPath::getPathContent(cp, true, false, true, pathContent);
for (std::vector<std::string>::const_iterator it = gDirectories.begin(), end = gDirectories.end(); it != end; ++it)
{
printf("Treating directory : %s\n", (*it).c_str());
ToolLogger.writeDepend(PIPELINE::DIRECTORY, gDestBNPFile, *it);
CPath::getPathContent(*it, !gNoRecurse, false, true, pathContent);
}
// Sort filename
sort (pathContent.begin(), pathContent.end(), i_comp);
@ -294,6 +301,7 @@ void packSubRecurse ()
BNPFile ftmp;
// Check if we can read the source file
ToolLogger.writeDepend(PIPELINE::BUILD, gDestBNPFile, pathContent[i]);
FILE *f = fopen (pathContent[i].c_str(), "rb");
if (f != NULL)
{
@ -309,11 +317,19 @@ void packSubRecurse ()
else
{
printf("error cannot open %s\n", pathContent[i].c_str());
ToolLogger.writeError(PIPELINE::WARNING, pathContent[i], "Cannot open file");
}
}
}
}
void packSubRecurse()
{
std::vector<std::string> directories;
directories.push_back(CPath::getCurrentPath());
packSubRecurse(directories);
}
// ---------------------------------------------------------------------------
void unpack (const string &dirName)
{
@ -347,6 +363,7 @@ void usage()
{
printf ("USAGE : \n");
printf (" bnp_make /p <directory_name> [<destination_path>] [<destination_filename>] [option] ... [option]\n");
printf (" bnp_make /p <bnp_filepath> -dir directory_name [-dir ...] [option] ... [option]\n");
printf (" option : \n");
printf (" -if wildcard : add the file if it matches the wilcard (at least one 'if' conditions must be met for a file to be adding)\n");
printf (" -ifnot wildcard : add the file if it doesn't match the wilcard (all the 'ifnot' conditions must be met for a file to be adding)\n");
@ -383,6 +400,26 @@ uint readOptions (int nNbArg, char **ppArgs)
WildCards.push_back (card);
optionCount += 2;
}
if ((strcmp (ppArgs[i], "-dependlog") == 0) && ((i+1)<(uint)nNbArg))
{
ToolLogger.initDepend(string(ppArgs[i+1]));
optionCount += 2;
}
if ((strcmp (ppArgs[i], "-errorlog") == 0) && ((i+1)<(uint)nNbArg))
{
ToolLogger.initError(string(ppArgs[i+1]));
optionCount += 2;
}
if ((strcmp (ppArgs[i], "-dir") == 0) && ((i+1)<(uint)nNbArg))
{
gDirectories.push_back(string(ppArgs[i+1]));
optionCount += 2;
}
if ((strcmp (ppArgs[i], "-norecurse") == 0))
{
gNoRecurse = true;
optionCount += 1;
}
}
return optionCount;
}
@ -398,15 +435,37 @@ int main (int nNbArg, char **ppArgs)
return -1;
}
if ((strcmp(ppArgs[1], "/p") == 0) || (strcmp(ppArgs[1], "/P") == 0) ||
(strcmp(ppArgs[1], "-p") == 0) || (strcmp(ppArgs[1], "-P") == 0))
bool cmdPack = (strcmp(ppArgs[1], "/p") == 0) || (strcmp(ppArgs[1], "/P") == 0) ||
(strcmp(ppArgs[1], "-p") == 0) || (strcmp(ppArgs[1], "-P") == 0);
if (cmdPack)
{
// Pack a directory
uint count = readOptions (nNbArg, ppArgs);
// Read options
uint count = readOptions(nNbArg, ppArgs);
nNbArg -= count;
}
// Read options
if (cmdPack && gDirectories.size() > 0)
{
if (nNbArg < 3)
{
usage();
return -1;
}
gDestBNPFile = ppArgs[2];
remove(gDestBNPFile.c_str());
gBNPHeader.OffsetFromBeginning = 0;
packSubRecurse(gDirectories);
gBNPHeader.append(gDestBNPFile);
return 0;
}
if (cmdPack && gDirectories.size() == 0)
{
string sCurDir;
if (nNbArg >= 4)

@ -0,0 +1,4 @@
SUBDIRS(
max
max_dump
max_rewrite_assets)

@ -0,0 +1,39 @@
FIND_PACKAGE(LIBGSF)
IF (NOT (LIBGSF_INCLUDE_DIR AND LIBGSF_LIBRARIES))
MESSAGE(FATAL_ERROR "LIBGSF not found!")
ENDIF (NOT (LIBGSF_INCLUDE_DIR AND LIBGSF_LIBRARIES))
FIND_PACKAGE(GLIB2)
if (NOT GLIB2_FOUND)
MESSAGE(FATAL_ERROR "GLIB2 not found!")
ENDIF (NOT GLIB2_FOUND)
INCLUDE_DIRECTORIES(${GLIB2_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${LIBGSF_INCLUDE_DIR})
FILE(GLOB SRCS *.cpp builtin/*.cpp builtin/storage/*.cpp update1/*.cpp epoly/*.cpp)
FILE(GLOB HDRS *.h builtin/*.h builtin/storage/*.h update1/*.h epoly/*.h)
NL_TARGET_LIB(pipeline_max
${SRCS}
${HDRS}
)
TARGET_LINK_LIBRARIES(pipeline_max
${LIBGSF_LIBRARIES}
${GLIB2_LIBRARIES}
nelmisc
)
SET_TARGET_PROPERTIES(pipeline_max PROPERTIES LINK_INTERFACE_LIBRARIES "")
NL_DEFAULT_PROPS(pipeline_max "NeL, Tools, Pipeline: Max (Library)")
NL_ADD_LIB_SUFFIX(pipeline_max)
NL_ADD_RUNTIME_FLAGS(pipeline_max)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS pipeline_max LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)

@ -0,0 +1,173 @@
/**
* \file animatable.cpp
* \brief CAnimatable
* \date 2012-08-22 08:52GMT
* \author Jan Boon (Kaetemi)
* CAnimatable
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "animatable.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
#include "storage/app_data.h"
using namespace std;
// using namespace NLMISC;
#define PBM_ANIMATABLE_UNKNOWN2140_CHUNK_ID 0x2140
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CAnimatable::CAnimatable(CScene *scene) : CSceneClass(scene), m_AppData(NULL)
{
}
CAnimatable::~CAnimatable()
{
if (!m_ChunksOwnsPointers)
{
delete m_Unknown2140;
m_Unknown2140 = NULL;
delete m_AppData;
m_AppData = NULL;
}
}
const ucstring CAnimatable::DisplayName = ucstring("Animatable");
const char *CAnimatable::InternalName = "Animatable";
const char *CAnimatable::InternalNameUnknown = "AnimatableUnknown";
const NLMISC::CClassId CAnimatable::ClassId = NLMISC::CClassId(0x3101497b, 0x24af711b); /* Not official, please correct */
const TSClassId CAnimatable::SuperClassId = 0x77a60fbd; /* Not official, please correct */
const CAnimatableClassDesc AnimatableClassDesc(&DllPluginDescBuiltin);
const CAnimatableSuperClassDesc AnimatableSuperClassDesc(&AnimatableClassDesc);
void CAnimatable::parse(uint16 version, uint filter)
{
CSceneClass::parse(version);
if (!m_ChunksOwnsPointers)
{
m_Unknown2140 = getChunk(PBM_ANIMATABLE_UNKNOWN2140_CHUNK_ID);
if (m_Unknown2140)
{
// nldebug("Found unknown 0x2140");
// TODO: Put std::cout code here
}
m_AppData = static_cast<STORAGE::CAppData *>(getChunk(PMBS_APP_DATA_CHUNK_ID));
}
}
void CAnimatable::clean()
{
CSceneClass::clean();
if (m_AppData) m_AppData->clean();
}
void CAnimatable::build(uint16 version, uint filter)
{
CSceneClass::build(version);
if (m_Unknown2140)
{
putChunk(PBM_ANIMATABLE_UNKNOWN2140_CHUNK_ID, m_Unknown2140);
}
if (m_AppData)
{
if (m_AppData->entries().size() == 0)
{
// Discard appdata if it has no entries
delete m_AppData;
m_AppData = NULL;
}
else
{
putChunk(PMBS_APP_DATA_CHUNK_ID, m_AppData);
}
}
}
void CAnimatable::disown()
{
m_Unknown2140 = NULL;
m_AppData = NULL;
CSceneClass::disown();
}
void CAnimatable::init()
{
CSceneClass::init();
}
bool CAnimatable::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return CSceneClass::inherits(classId);
}
const ISceneClassDesc *CAnimatable::classDesc() const
{
return &AnimatableClassDesc;
}
void CAnimatable::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{
CSceneClass::toStringLocal(ostream, pad);
if (m_AppData && m_AppData->entries().size() != 0)
{
ostream << "\n" << pad << "AppData: ";
m_AppData->toString(ostream, pad + "\t");
}
}
STORAGE::CAppData *CAnimatable::appData()
{
if (m_ChunksOwnsPointers) { nlerror("Not parsed"); return NULL; }
if (!m_AppData)
{
m_AppData = new STORAGE::CAppData();
m_AppData->init();
}
return m_AppData;
}
IStorageObject *CAnimatable::createChunkById(uint16 id, bool container)
{
switch (id)
{
case PMBS_APP_DATA_CHUNK_ID:
return new STORAGE::CAppData;
}
return CSceneClass::createChunkById(id, container);
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,103 @@
/**
* \file animatable.h
* \brief CAnimatable
* \date 2012-08-22 08:52GMT
* \author Jan Boon (Kaetemi)
* CAnimatable
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_ANIMATABLE_H
#define PIPELINE_ANIMATABLE_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "../scene.h"
#include "../scene_class.h"
#include "../super_class_desc.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
namespace STORAGE {
class CAppData;
}
/**
* \brief CAnimatable
* \date 2012-08-22 08:52GMT
* \author Jan Boon (Kaetemi)
* This scene class owns the AppData chunk
*/
class CAnimatable : public CSceneClass
{
public:
CAnimatable(CScene *scene);
virtual ~CAnimatable();
// class desc
static const ucstring DisplayName;
static const char *InternalName;
static const char *InternalNameUnknown;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
// inherited
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
// public
STORAGE::CAppData *appData();
protected:
// inherited
virtual IStorageObject *createChunkById(uint16 id, bool container);
private:
IStorageObject *m_Unknown2140;
STORAGE::CAppData *m_AppData;
}; /* class CAnimatable */
typedef CSceneClassDesc<CAnimatable> CAnimatableClassDesc;
extern const CAnimatableClassDesc AnimatableClassDesc;
typedef CSuperClassDesc<CAnimatable> CAnimatableSuperClassDesc;
extern const CAnimatableSuperClassDesc AnimatableSuperClassDesc;
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_ANIMATABLE_H */
/* end of file */

@ -0,0 +1,113 @@
/**
* \file base_object.cpp
* \brief CBaseObject
* \date 2012-08-22 08:53GMT
* \author Jan Boon (Kaetemi)
* CBaseObject
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "base_object.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CBaseObject::CBaseObject(CScene *scene) : CReferenceTarget(scene)
{
}
CBaseObject::~CBaseObject()
{
}
const ucstring CBaseObject::DisplayName = ucstring("BaseObject");
const char *CBaseObject::InternalName = "BaseObject";
// const char *CBaseObject::InternalNameUnknown = "BaseObjectUnknown";
const NLMISC::CClassId CBaseObject::ClassId = NLMISC::CClassId(0x71c8167a, 0x5a9f57b2); /* Not official, please correct */
const TSClassId CBaseObject::SuperClassId = CReferenceTarget::SuperClassId;
const CBaseObjectClassDesc BaseObjectClassDesc(&DllPluginDescBuiltin);
// const CBaseObjectSuperClassDesc BaseObjectSuperClassDesc(&BaseObjectClassDesc);
void CBaseObject::parse(uint16 version, uint filter)
{
CReferenceTarget::parse(version);
}
void CBaseObject::clean()
{
CReferenceTarget::clean();
}
void CBaseObject::build(uint16 version, uint filter)
{
CReferenceTarget::build(version);
}
void CBaseObject::disown()
{
CReferenceTarget::disown();
}
void CBaseObject::init()
{
CReferenceTarget::init();
}
bool CBaseObject::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return CReferenceTarget::inherits(classId);
}
const ISceneClassDesc *CBaseObject::classDesc() const
{
return &BaseObjectClassDesc;
}
void CBaseObject::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{
CReferenceTarget::toStringLocal(ostream, pad);
}
IStorageObject *CBaseObject::createChunkById(uint16 id, bool container)
{
return CReferenceTarget::createChunkById(id, container);
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,89 @@
/**
* \file base_object.h
* \brief CBaseObject
* \date 2012-08-22 08:53GMT
* \author Jan Boon (Kaetemi)
* CBaseObject
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_BASE_OBJECT_H
#define PIPELINE_BASE_OBJECT_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "reference_target.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CBaseObject
* \date 2012-08-22 08:53GMT
* \author Jan Boon (Kaetemi)
* CBaseObject
*/
class CBaseObject : public CReferenceTarget
{
public:
CBaseObject(CScene *scene);
virtual ~CBaseObject();
// class desc
static const ucstring DisplayName;
static const char *InternalName;
// static const char *InternalNameUnknown;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
// inherited
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
protected:
// inherited
virtual IStorageObject *createChunkById(uint16 id, bool container);
}; /* class CBaseObject */
typedef CSceneClassDesc<CBaseObject> CBaseObjectClassDesc;
extern const CBaseObjectClassDesc BaseObjectClassDesc;
// typedef CSuperClassDesc<CBaseObject> CBaseObjectSuperClassDesc;
// extern const CBaseObjectSuperClassDesc BaseObjectSuperClassDesc;
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_BASE_OBJECT_H */
/* end of file */

@ -0,0 +1,59 @@
/**
* \file bitmap_tex.cpp
* \brief CBitmapTex
* \date 2012-08-22 08:56GMT
* \author Jan Boon (Kaetemi)
* CBitmapTex
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "bitmap_tex.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CBitmapTex::CBitmapTex(CScene *scene) : CTexmap(scene)
{
}
CBitmapTex::~CBitmapTex()
{
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,63 @@
/**
* \file bitmap_tex.h
* \brief CBitmapTex
* \date 2012-08-22 08:56GMT
* \author Jan Boon (Kaetemi)
* CBitmapTex
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_BITMAP_TEX_H
#define PIPELINE_BITMAP_TEX_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "texmap.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CBitmapTex
* \date 2012-08-22 08:56GMT
* \author Jan Boon (Kaetemi)
* CBitmapTex
*/
class CBitmapTex : public CTexmap
{
public:
CBitmapTex(CScene *scene);
virtual ~CBitmapTex();
}; /* class CBitmapTex */
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_BITMAP_TEX_H */
/* end of file */

@ -0,0 +1,338 @@
/**
* \file builtin.cpp
* \brief CBuiltin
* \date 2012-08-22 09:42GMT
* \author Jan Boon (Kaetemi)
* CBuiltin
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "builtin.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
#include "../scene_class_registry.h"
#include "animatable.h"
#include "reference_maker.h"
#include "reference_target.h"
#include "scene_impl.h"
#include "i_node.h"
#include "node_impl.h"
#include "root_node.h"
#include "track_view_node.h"
#include "base_object.h"
#include "object.h"
#include "geom_object.h"
#include "tri_object.h"
#include "poly_object.h"
#include "patch_object.h"
#include "editable_patch.h"
// using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
namespace {
// 0x0 - invalid, default to reftarget
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000000> CNullSuperClassDesc;
const CNullSuperClassDesc NullSuperClassDesc(&ReferenceTargetClassDesc, "NullSuperClassUnknown");
// 0x9003 bezier float control, subclass under control???; control is under reftarget
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00009003> CControlFloatSuperClassDesc;
const CControlFloatSuperClassDesc ControlFloatSuperClassDesc(&ReferenceTargetClassDesc, "ControlFloatSuperClassUnknown");
// 0x8 param block, under reftarget directly
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000008> CParamBlockSuperClassDesc;
const CParamBlockSuperClassDesc ParamBlockSuperClassDesc(&ReferenceTargetClassDesc, "ParamBlockSuperClassUnknown");
// 0xc20 uv gen, sub of mtlbase
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000c20> CUVGenSuperClassDesc;
const CUVGenSuperClassDesc UVGenSuperClassDesc(&ReferenceTargetClassDesc, "UVGenSuperClassUnknown");
// 0x82 param block 2, under reftarget directly
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000082> CParamBlock2SuperClassDesc;
const CParamBlock2SuperClassDesc ParamBlock2SuperClassDesc(&ReferenceTargetClassDesc, "ParamBlock2SuperClassUnknown");
// 0xc40 output, textureoutput???, under mtlbase
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000c40> CTextureOutputSuperClassDesc;
const CTextureOutputSuperClassDesc TextureOutputSuperClassDesc(&ReferenceTargetClassDesc, "TextureOutputSuperClassUnknown");
// 0xc10 texmap, under mtlbase
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000c10> CTexmapSuperClassDesc;
const CTexmapSuperClassDesc TexmapSuperClassDesc(&ReferenceTargetClassDesc, "TexmapSuperClassUnknown");
// 0x1080 texmap_container, 'Texmaps' under reftarget directly
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00001080> CTexmapContainerSuperClassDesc;
const CTexmapContainerSuperClassDesc TexmapContainerSuperClassDesc(&ReferenceTargetClassDesc, "TexmapContainerSuperClassUnknown");
// 0x10b0, shader, under baseshader, under special_Fx
typedef CSuperClassDescUnknown<CReferenceTarget, 0x000010b0> CShaderSuperClassDesc;
const CShaderSuperClassDesc ShaderSuperClassDesc(&ReferenceTargetClassDesc, "ShaderSuperClassUnknown");
// 0x1110, sampler, under special_fx
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00001110> CSamplerSuperClassDesc;
const CSamplerSuperClassDesc SamplerSuperClassDesc(&ReferenceTargetClassDesc, "SamplerSuperClassUnknown");
// 0xc00, mtl 'materials', under mtlbase
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000c00> CMtlSuperClassDesc;
const CMtlSuperClassDesc MtlSuperClassDesc(&ReferenceTargetClassDesc, "MtlSuperClassUnknown");
// 0xd00, soundobj, under reftarget directly
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000d00> CSoundObjSuperClassDesc;
const CSoundObjSuperClassDesc SoundObjSuperClassDesc(&ReferenceTargetClassDesc, "SoundObjSuperClassUnknown");
/*
// 0x1, node; under reftarget directly; classid 1 is node, 2 is rootnode
typedef CSuperClassDescUnknown<CReferenceTarget, > CNodeSuperClassDesc;
const CNodeSuperClassDesc NodeSuperClassDesc(&ReferenceTargetClassDesc, "NodeSuperClassUnknown");
*/
// 0x900b, controlposition, under control???
typedef CSuperClassDescUnknown<CReferenceTarget, 0x0000900b> CControlPositionSuperClassDesc;
const CControlPositionSuperClassDesc ControlPositionSuperClassDesc(&ReferenceTargetClassDesc, "ControlPositionSuperClassUnknown");
// 0x900c, controlrotation, under control???
typedef CSuperClassDescUnknown<CReferenceTarget, 0x0000900c> CControlRotationSuperClassDesc;
const CControlRotationSuperClassDesc ControlRotationSuperClassDesc(&ReferenceTargetClassDesc, "ControlRotationSuperClassUnknown");
// 0x900d, control_scale, under control???
typedef CSuperClassDescUnknown<CReferenceTarget, 0x0000900d> CControlScaleSuperClassDesc;
const CControlScaleSuperClassDesc ControlScaleSuperClassDesc(&ReferenceTargetClassDesc, "ControlScaleSuperClassUnknown");
// 0x9008, pos/rot/scale; controltransform; matrix3; under control???
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00009008> CControlTransformSuperClassDesc;
const CControlTransformSuperClassDesc ControlTransformSuperClassDesc(&ReferenceTargetClassDesc, "ControlTransformSuperClassUnknown");
// 0x810 - osmodifier, under modifier (physique etc, necessary for skinning)
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000810> COSModifierSuperClassDesc;
const COSModifierSuperClassDesc OSModifierSuperClassDesc(&ReferenceTargetClassDesc, "OSModifierSuperClassUnknown");
// 0x9010 - master point controller
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00009010> CMasterPointControllerSuperClassDesc;
const CMasterPointControllerSuperClassDesc MasterPointControllerSuperClassDesc(&ReferenceTargetClassDesc, "MasterPointControllerSuperClassUnknown");
/*
// 0x10 - geom object
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000010> CGeomObjectSuperClassDesc;
const CGeomObjectSuperClassDesc GeomObjectSuperClassDesc(&ReferenceTargetClassDesc, "GeomObjectSuperClassUnknown");
*/
// 0x10f0 - layer, under reftarget directly
typedef CSuperClassDescUnknown<CReferenceTarget, 0x000010f0> CLayerSuperClassDesc;
const CLayerSuperClassDesc LayerSuperClassDesc(&ReferenceTargetClassDesc, "LayerSuperClassUnknown");
/*
// 0x60 - object???, under base object
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000060> CObjectSuperClassDesc;
const CObjectSuperClassDesc ObjectSuperClassDesc(&ReferenceTargetClassDesc, "ObjectSuperClassUnknown");
*/
// 0x50 helperobject, under object...
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000050> CHelperObjectSuperClassDesc;
const CHelperObjectSuperClassDesc HelperObjectSuperClassDesc(&ReferenceTargetClassDesc, "HelperObjectSuperClassUnknown");
// 0x10a0 filterkernel, under specialfx (example: area filter)
typedef CSuperClassDescUnknown<CReferenceTarget, 0x000010a0> CFilterKernelSuperClassDesc;
const CFilterKernelSuperClassDesc FilterKernelSuperClassDesc(&ReferenceTargetClassDesc, "FilterKernelSuperClassUnknown");
// 0xf00 - renderer ,direct sub of reftarget
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000f00> CRendererSuperClassDesc;
const CRendererSuperClassDesc RendererSuperClassDesc(&ReferenceTargetClassDesc, "RendererSuperClassUnknown");
// 0x9005 - control point3 (also color), under control???
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00009005> CControlPoint3SuperClassDesc;
const CControlPoint3SuperClassDesc ControlPoint3SuperClassDesc(&ReferenceTargetClassDesc, "ControlPoint3SuperClassUnknown");
// 0x1010 - atmospheric, under special effects
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00001010> CAtmosphericSuperClassDesc;
const CAtmosphericSuperClassDesc AtmosphericSuperClassDesc(&ReferenceTargetClassDesc, "AtmosphericSuperClassUnknown");
// 0x9011 - control master block 'block control', under control???
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00009011> CControlMasterBlockSuperClassDesc;
const CControlMasterBlockSuperClassDesc ControlMasterBlockSuperClassDesc(&ReferenceTargetClassDesc, "ControlMasterBlockSuperClassUnknown");
// 0xfffffe00 - grid reference, not sure where, probably directly under reftarget
typedef CSuperClassDescUnknown<CReferenceTarget, 0xfffffe00> CGridReferenceSuperClassDesc;
const CGridReferenceSuperClassDesc GridReferenceSuperClassDesc(&ReferenceTargetClassDesc, "GridReferenceSuperClassUnknown");
// 0x1090 - render effect, possibly under special fx
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00001090> CRenderEffectSuperClassDesc;
const CRenderEffectSuperClassDesc RenderEffectSuperClassDesc(&ReferenceTargetClassDesc, "RenderEffectSuperClassUnknown");
// 0x10d0 - shadow type, directly under ref target
typedef CSuperClassDescUnknown<CReferenceTarget, 0x000010d0> CShadowTypeSuperClassDesc;
const CShadowTypeSuperClassDesc ShadowTypeSuperClassDesc(&ReferenceTargetClassDesc, "ShadowTypeSuperClassUnknown");
// 0x1160 - CustAttrib, directly under ref target
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00001160> CCustAttribSuperClassDesc;
const CCustAttribSuperClassDesc CustAttribSuperClassDesc(&ReferenceTargetClassDesc, "CustAttribSuperClassUnknown");
// 0x9012 - point4list, controlpoint4, also rgba, under controll???
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00009012> CControlPoint4SuperClassDesc;
const CControlPoint4SuperClassDesc ControlPoint4SuperClassDesc(&ReferenceTargetClassDesc, "ControlPoint4SuperClassUnknown");
// 0xb60 - userdatatype, deprecated, don't care
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000b60> CUserDataTypeSuperClassDesc;
const CUserDataTypeSuperClassDesc UserDataTypeSuperClassDesc(&ReferenceTargetClassDesc, "UserDataTypeSuperClassUnknown");
// 0x900f - usertype, don't care
typedef CSuperClassDescUnknown<CReferenceTarget, 0x0000900f> CUserTypeSuperClassDesc;
const CUserTypeSuperClassDesc UserTypeSuperClassDesc(&ReferenceTargetClassDesc, "UserTypeSuperClassUnknown");
// 0x40 - shape object (text, ...)
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000040> CShapeObjectSuperClassDesc;
const CShapeObjectSuperClassDesc ShapeObjectSuperClassDesc(&GeomObjectClassDesc, "ShapeObjectSuperClassUnknown");
// 0x30 - light object (omni, ...)
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000030> CLightObjectSuperClassDesc;
const CLightObjectSuperClassDesc LightObjectSuperClassDesc(&ObjectClassDesc, "LightObjectSuperClassUnknown");
// 0x20 camera - (target, ...)
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000020> CCameraObjectSuperClassDesc;
const CCameraObjectSuperClassDesc CameraObjectSuperClassDesc(&ObjectClassDesc, "CameraObjectSuperClassUnknown");
// Creating superclass 0x820 (FFD Binding) (0xd6636ea2, 0x9aa42bf3) that does not exist = WSM, sub of modifier (under baseobj)
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000820> CWSModifierSuperClassDesc;
const CWSModifierSuperClassDesc WSModifierSuperClassDesc(&BaseObjectClassDesc, "WSModifierSuperClassUnknown");
// Creating superclass 0x830 (FFD(Cyl)) (0xfa4700be, 0xbbe85051) that does not exist = WSMObject, sub of object
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000830> CWSMObjectSuperClassDesc;
const CWSMObjectSuperClassDesc WSMObjectSuperClassDesc(&ObjectClassDesc, "WSMObjectSuperClassUnknown");
// Creating superclass 0xc30 (Placement) (0x00000100, 0x00000000) that does not exist | xyzgen, sub of mtlbase
typedef CSuperClassDescUnknown<CReferenceTarget, 0x00000c30> CXYZGenSuperClassDesc;
const CXYZGenSuperClassDesc XYZGenSuperClassDesc(&ReferenceTargetClassDesc, "XYZGenSuperClassUnknown");
} /* anonymous namespace */
CBuiltin::CBuiltin()
{
}
CBuiltin::~CBuiltin()
{
}
void CBuiltin::registerClasses(CSceneClassRegistry *registry)
{
// invalid
registry->add(&NullSuperClassDesc);
// available
registry->add(&AnimatableClassDesc);
registry->add(&AnimatableSuperClassDesc);
registry->add(&ReferenceMakerClassDesc);
registry->add(&ReferenceMakerSuperClassDesc);
registry->add(&ReferenceTargetClassDesc);
registry->add(&ReferenceTargetSuperClassDesc);
// scene (inh ReferenceMaker)
registry->add(&SceneImplClassDesc);
// node (inh ReferenceTarget)
registry->add(&NodeSuperClassDesc);
registry->add(&NodeClassDesc);
{
registry->add(&NodeImplClassDesc);
registry->add(&RootNodeClassDesc);
}
// tvnode (inh ReferenceTarget)
registry->add(&TrackViewNodeClassDesc);
// object (inh ReferenceMaker)
registry->add(&BaseObjectClassDesc);
{
registry->add(&ObjectSuperClassDesc);
registry->add(&ObjectClassDesc);
{
registry->add(&GeomObjectSuperClassDesc);
registry->add(&GeomObjectClassDesc);
{
registry->add(&TriObjectClassDesc);
registry->add(&PolyObjectClassDesc);
registry->add(&PatchObjectClassDesc);
{
registry->add(&EditablePatchClassDesc);
}
}
}
}
// unimplemented
registry->add(&ControlFloatSuperClassDesc);
registry->add(&ParamBlockSuperClassDesc);
registry->add(&UVGenSuperClassDesc);
registry->add(&ParamBlock2SuperClassDesc);
registry->add(&TextureOutputSuperClassDesc);
registry->add(&TexmapSuperClassDesc);
registry->add(&TexmapContainerSuperClassDesc);
registry->add(&ShaderSuperClassDesc);
registry->add(&SamplerSuperClassDesc);
registry->add(&MtlSuperClassDesc);
registry->add(&SoundObjSuperClassDesc);
// registry->add(&NodeSuperClassDesc);
registry->add(&ControlPositionSuperClassDesc);
registry->add(&ControlRotationSuperClassDesc);
registry->add(&ControlScaleSuperClassDesc);
registry->add(&ControlTransformSuperClassDesc);
registry->add(&OSModifierSuperClassDesc);
registry->add(&MasterPointControllerSuperClassDesc);
//registry->add(&GeomObjectSuperClassDesc);
registry->add(&LayerSuperClassDesc);
//registry->add(&ObjectSuperClassDesc);
registry->add(&HelperObjectSuperClassDesc);
registry->add(&FilterKernelSuperClassDesc);
registry->add(&RendererSuperClassDesc);
registry->add(&ControlPoint3SuperClassDesc);
registry->add(&AtmosphericSuperClassDesc);
registry->add(&ControlMasterBlockSuperClassDesc);
registry->add(&GridReferenceSuperClassDesc);
registry->add(&RenderEffectSuperClassDesc);
registry->add(&ShadowTypeSuperClassDesc);
registry->add(&CustAttribSuperClassDesc);
registry->add(&ControlPoint4SuperClassDesc);
registry->add(&UserDataTypeSuperClassDesc);
registry->add(&UserTypeSuperClassDesc);
registry->add(&ShapeObjectSuperClassDesc);
registry->add(&LightObjectSuperClassDesc);
registry->add(&CameraObjectSuperClassDesc);
registry->add(&WSModifierSuperClassDesc);
registry->add(&WSMObjectSuperClassDesc);
registry->add(&XYZGenSuperClassDesc);
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,68 @@
/**
* \file builtin.h
* \brief CBuiltin
* \date 2012-08-22 09:42GMT
* \author Jan Boon (Kaetemi)
* CBuiltin
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_BUILTIN_H
#define PIPELINE_BUILTIN_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
namespace PIPELINE {
namespace MAX {
class CSceneClassRegistry;
namespace BUILTIN {
/**
* \brief CBuiltin
* \date 2012-08-22 09:42GMT
* \author Jan Boon (Kaetemi)
* CBuiltin
*/
class CBuiltin
{
public:
static void registerClasses(CSceneClassRegistry *registry);
private:
CBuiltin();
virtual ~CBuiltin();
}; /* class CBuiltin */
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_BUILTIN_H */
/* end of file */

@ -0,0 +1,111 @@
/**
* \file editable_patch.cpp
* \brief CEditablePatch
* \date 2012-08-26 12:12GMT
* \author Jan Boon (Kaetemi)
* CEditablePatch
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "editable_patch.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
// using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CEditablePatch::CEditablePatch(CScene *scene) : CPatchObject(scene)
{
}
CEditablePatch::~CEditablePatch()
{
}
const ucstring CEditablePatch::DisplayName = ucstring("EditablePatch");
const char *CEditablePatch::InternalName = "EditablePatch";
const NLMISC::CClassId CEditablePatch::ClassId = NLMISC::CClassId(0x00001030, 0x00000000);
const TSClassId CEditablePatch::SuperClassId = CPatchObject::SuperClassId;
const CEditablePatchClassDesc EditablePatchClassDesc(&DllPluginDescBuiltin);
void CEditablePatch::parse(uint16 version, uint filter)
{
CPatchObject::parse(version);
}
void CEditablePatch::clean()
{
CPatchObject::clean();
}
void CEditablePatch::build(uint16 version, uint filter)
{
CPatchObject::build(version);
}
void CEditablePatch::disown()
{
CPatchObject::disown();
}
void CEditablePatch::init()
{
CPatchObject::init();
}
bool CEditablePatch::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return CPatchObject::inherits(classId);
}
const ISceneClassDesc *CEditablePatch::classDesc() const
{
return &EditablePatchClassDesc;
}
void CEditablePatch::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{
CPatchObject::toStringLocal(ostream, pad);
}
IStorageObject *CEditablePatch::createChunkById(uint16 id, bool container)
{
return CPatchObject::createChunkById(id, container);
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,86 @@
/**
* \file editable_patch.h
* \brief CEditablePatch
* \date 2012-08-26 12:12GMT
* \author Jan Boon (Kaetemi)
* CEditablePatch
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_EDITABLE_PATCH_H
#define PIPELINE_EDITABLE_PATCH_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "patch_object.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CEditablePatch
* \date 2012-08-26 12:12GMT
* \author Jan Boon (Kaetemi)
* CEditablePatch
*/
class CEditablePatch : public CPatchObject
{
public:
CEditablePatch(CScene *scene);
virtual ~CEditablePatch();
// class desc
static const ucstring DisplayName;
static const char *InternalName;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
// inherited
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
protected:
// inherited
virtual IStorageObject *createChunkById(uint16 id, bool container);
}; /* class CEditablePatch */
typedef CSceneClassDesc<CEditablePatch> CEditablePatchClassDesc;
extern const CEditablePatchClassDesc EditablePatchClassDesc;
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_EDITABLE_PATCH_H */
/* end of file */

@ -0,0 +1,269 @@
/**
* \file geom_object.cpp
* \brief CGeomGeomObject
* \date 2012-08-22 08:58GMT
* \author Jan Boon (Kaetemi)
* CGeomGeomObject
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "geom_object.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
// using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
#define PMB_GEOM_UNKNOWN0900_CHUNK_ID 0x0900
#define PMB_GEOM_BUFFERS_CHUNK_ID 0x08fe
CGeomObject::CGeomObject(CScene *scene) : CObject(scene), m_Unknown0900(NULL), m_GeomBuffers(NULL)
{
}
CGeomObject::~CGeomObject()
{
if (!m_ChunksOwnsPointers)
{
m_Unknown0900 = NULL;
m_GeomBuffers = NULL;
}
}
const ucstring CGeomObject::DisplayName = ucstring("GeomObject");
const char *CGeomObject::InternalName = "GeomObject";
const char *CGeomObject::InternalNameUnknown = "GeomObjectUnknown";
const NLMISC::CClassId CGeomObject::ClassId = NLMISC::CClassId(0x37097c44, 0x38aa3f24); /* Not official, please correct */
const TSClassId CGeomObject::SuperClassId = 0x00000010;
const CGeomObjectClassDesc GeomObjectClassDesc(&DllPluginDescBuiltin);
const CGeomObjectSuperClassDesc GeomObjectSuperClassDesc(&GeomObjectClassDesc);
void CGeomObject::parse(uint16 version, uint filter)
{
if (filter == 0)
{
CObject::parse(version);
}
else if (filter == PMB_GEOM_OBJECT_PARSE_FILTER)
{
if (!m_ChunksOwnsPointers)
{
m_Unknown0900 = getChunk(PMB_GEOM_UNKNOWN0900_CHUNK_ID);
m_GeomBuffers = static_cast<STORAGE::CGeomBuffers *>(getChunk(PMB_GEOM_BUFFERS_CHUNK_ID));
}
}
}
void CGeomObject::clean()
{
CObject::clean();
}
void CGeomObject::build(uint16 version, uint filter)
{
if (filter == 0)
{
CObject::build(version);
}
else if (filter == PMB_GEOM_OBJECT_PARSE_FILTER)
{
if (m_Unknown0900) putChunk(PMB_GEOM_UNKNOWN0900_CHUNK_ID, m_Unknown0900);
if (m_GeomBuffers) putChunk(PMB_GEOM_BUFFERS_CHUNK_ID, m_GeomBuffers);
}
}
void CGeomObject::disown()
{
m_Unknown0900 = NULL;
m_GeomBuffers = NULL;
CObject::disown();
}
void CGeomObject::init()
{
CObject::init();
}
bool CGeomObject::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return CObject::inherits(classId);
}
const ISceneClassDesc *CGeomObject::classDesc() const
{
return &GeomObjectClassDesc;
}
void CGeomObject::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{
if (filter == 0)
{
CObject::toStringLocal(ostream, pad);
}
else if (filter == PMB_GEOM_OBJECT_PARSE_FILTER)
{
std::string padpad = pad + "\t";
if (m_Unknown0900)
{
ostream << "\n" << pad << "GeomObject Unknown 0x0900: ";
m_Unknown0900->toString(ostream, padpad);
}
if (m_GeomBuffers)
{
ostream << "\n" << pad << "GeomBuffers: ";
m_GeomBuffers->toString(ostream, padpad);
}
}
}
inline uint32 rrsub(uint32 v, uint32 size)
{
if (v) return v - 1;
return size - 1;
}
inline uint32 rradd(uint32 v, uint32 size)
{
uint32 vp = v + 1;
if (vp != size) return vp;
return 0;
}
void CGeomObject::triangulatePolyFace(std::vector<STORAGE::CGeomTriIndex> &triangles, const STORAGE::CGeomPolyFaceInfo &polyFace)
{
nlassert(polyFace.Vertices.size() >= 3);
nlassert(polyFace.Triangulation.size() == polyFace.Vertices.size() - 3);
uint nbVert = polyFace.Vertices.size();
uint nbCuts = polyFace.Triangulation.size();
uint nbTriangles = 0;
// This code creates a matrix, aka a table, of all possible paths
// that can be traveled to get directly from one vertex to another
// over an egde.
// Outer edges of the polygon are one-way, backwards.
// Cut edges can be traveled both ways.
// Each edge direction can only be traveled by one triangle.
// Ingenious, if I may say so myself.
// Bad performance by std::vector, though.
std::vector<std::vector<bool> > from_to;
from_to.resize(nbVert);
for (uint i = 0; i < nbVert; ++i)
{
from_to[i].resize(nbVert);
for (uint j = 0; j < nbVert; ++j)
{
from_to[i][j] = false;
}
// Can travel backwards over the outer edge
from_to[i][rrsub(i, nbVert)] = true;
}
for (uint i = 0; i < nbCuts; ++i)
{
// Can travel both ways over cuts, but the first direction is handled directly!
// from_to[polyFace.Triangulation[i].first][polyFace.Triangulation[i].second] = true;
from_to[polyFace.Triangulation[i].second][polyFace.Triangulation[i].first] = true;
}
// Triangulate all cuts, this assumes cuts are in the direction
// of a triangle that is not already handled by another cut...
for (uint i = 0; i < nbCuts; ++i)
{
uint32 a = polyFace.Triangulation[i].first;
uint32 b = polyFace.Triangulation[i].second;
// from_to[polyFace.Triangulation[i].first][polyFace.Triangulation[i].second] = false; // handled!
// Try to find a path that works
for (uint c = 0; c < nbVert; ++c)
{
// Can we make a triangle
if (from_to[b][c] && from_to[c][a])
{
STORAGE::CGeomTriIndex tri;
tri.a = polyFace.Vertices[c];
tri.b = polyFace.Vertices[b];
tri.c = polyFace.Vertices[a];
triangles.push_back(tri);
++nbTriangles;
// nldebug("add tri from cut");
from_to[b][c] = false;
from_to[c][a] = false;
break;
}
}
}
// Find... The Last Triangle
for (uint a = 0; a < nbVert; ++a)
{
uint b = rrsub(a, nbVert);
// Can we still travel backwards over the outer edge?
if (from_to[a][b])
{
for (uint c = 0; c < nbVert; ++c)
{
// Can we make a triangle
if (from_to[b][c] && from_to[c][a])
{
STORAGE::CGeomTriIndex tri;
tri.a = polyFace.Vertices[c];
tri.b = polyFace.Vertices[b];
tri.c = polyFace.Vertices[a];
triangles.push_back(tri);
++nbTriangles;
// nldebug("add final tri");
from_to[b][c] = false;
from_to[c][a] = false;
break;
}
}
}
}
// nldebug("triangles: %i", nbTriangles);
// nldebug("cuts: %i", nbCuts);
nlassert(nbTriangles == nbCuts + 1);
}
IStorageObject *CGeomObject::createChunkById(uint16 id, bool container)
{
switch (id)
{
case PMB_GEOM_UNKNOWN0900_CHUNK_ID:
return new CStorageArray<sint32>();
case PMB_GEOM_BUFFERS_CHUNK_ID:
return new STORAGE::CGeomBuffers();
}
return CObject::createChunkById(id, container);
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,103 @@
/**
* \file geom_object.h
* \brief CGeomGeomObject
* \date 2012-08-22 08:58GMT
* \author Jan Boon (Kaetemi)
* CGeomGeomObject
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_GEOM_OBJECT_H
#define PIPELINE_GEOM_OBJECT_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "object.h"
#include "storage/geom_buffers.h"
/// Must be passed to the parse and build functions by
/// inheriting classes to parse the actual geom object.
#define PMB_GEOM_OBJECT_PARSE_FILTER 0x432a4da6
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CGeomGeomObject
* \date 2012-08-22 08:58GMT
* \author Jan Boon (Kaetemi)
* CGeomGeomObject
*/
class CGeomObject : public CObject
{
public:
CGeomObject(CScene *scene);
virtual ~CGeomObject();
// class desc
static const ucstring DisplayName;
static const char *InternalName;
static const char *InternalNameUnknown;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
// inherited
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
static void triangulatePolyFace(std::vector<STORAGE::CGeomTriIndex> &triangles, const STORAGE::CGeomPolyFaceInfo &polyFace);
// read access
inline STORAGE::CGeomBuffers *geomBuffers() const { return m_GeomBuffers; }
protected:
// inherited
virtual IStorageObject *createChunkById(uint16 id, bool container);
private:
IStorageObject *m_Unknown0900;
STORAGE::CGeomBuffers *m_GeomBuffers;
}; /* class CGeomObject */
typedef CSceneClassDesc<CGeomObject> CGeomObjectClassDesc;
extern const CGeomObjectClassDesc GeomObjectClassDesc;
typedef CSuperClassDesc<CGeomObject> CGeomObjectSuperClassDesc;
extern const CGeomObjectSuperClassDesc GeomObjectSuperClassDesc;
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_GEOM_OBJECT_H */
/* end of file */

@ -0,0 +1,218 @@
/**
* \file i_node.cpp
* \brief INode
* \date 2012-08-22 19:45GMT
* \author Jan Boon (Kaetemi)
* INode
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "i_node.h"
// STL includes
#include <iomanip>
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
INode::INode(CScene *scene) : CReferenceTarget(scene)
{
}
INode::~INode()
{
}
const ucstring INode::DisplayName = ucstring("Node Interface");
const char *INode::InternalName = "Node";
const char *INode::InternalNameUnknown = "NodeUnknown";
const NLMISC::CClassId INode::ClassId = NLMISC::CClassId(0x8f5b13, 0x624d477d); /* Not official, please correct */
const TSClassId INode::SuperClassId = 0x00000001;
const CNodeClassDesc NodeClassDesc(&DllPluginDescBuiltin);
const CNodeSuperClassDesc NodeSuperClassDesc(&NodeClassDesc);
void INode::parse(uint16 version, uint filter)
{
CReferenceTarget::parse(version);
}
void INode::clean()
{
CReferenceTarget::clean();
}
void INode::build(uint16 version, uint filter)
{
CReferenceTarget::build(version);
}
void INode::disown()
{
CReferenceTarget::disown();
}
void INode::init()
{
CReferenceTarget::init();
}
bool INode::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return CReferenceTarget::inherits(classId);
}
const ISceneClassDesc *INode::classDesc() const
{
return &NodeClassDesc;
}
void INode::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{
CReferenceTarget::toStringLocal(ostream, pad);
// Print the implied connected children
ostream << "\n" << pad << "Children: IMPLICIT { ";
uint i = 0;
for (std::set<NLMISC::CRefPtr<INode> >::iterator it = m_Children.begin(), end = m_Children.end(); it != end; ++it)
{
INode *node = (*it);
nlassert(node);
if (node)
{
ostream << "\n" << pad << "\t" << i << ": <ptr=0x";
{
std::stringstream ss;
ss << std::hex << std::setfill('0');
ss << std::setw(16) << (uint64)(void *)node;
ostream << ss.str();
}
ostream << "> ";
ostream << "(" << ucstring(node->classDesc()->displayName()).toUtf8() << ", " << node->classDesc()->classId().toString() << ") ";
ostream << node->userName().toUtf8() << " ";
}
else
{
ostream << "\n" << pad << "\t" << i << ": NULL ";
}
++i;
}
ostream << "} ";
}
INode *INode::parent()
{
nlerror("Unkown node class, cannot get parent node");
return NULL;
}
void INode::setParent(INode *node)
{
nlerror("Unkown node class, cannot set parent node");
}
void INode::addChild(INode *node)
{
m_Children.insert(node);
}
void INode::removeChild(INode *node)
{
m_Children.erase(node);
}
const ucstring &INode::userName() const
{
static const ucstring v = ucstring("Invalid INode");
return v;
}
INode *INode::find(const ucstring &userName) const
{
ucstring unl = NLMISC::toLower(userName);
for (std::set<NLMISC::CRefPtr<INode> >::iterator it = m_Children.begin(), end = m_Children.end(); it != end; ++it)
{
INode *node = (*it);
nlassert(node);
if (NLMISC::toLower(node->userName()) == unl)
return node;
}
return NULL;
}
void INode::dumpNodes(std::ostream &ostream, const std::string &pad) const
{
ostream << "<ptr=0x";
{
std::stringstream ss;
ss << std::hex << std::setfill('0');
ss << std::setw(16) << (uint64)(void *)this;
ostream << ss.str();
}
ostream << "> " << userName().toUtf8() << " [" << m_Children.size() << "] { ";
CReferenceMaker *object = getReference(1);
if (object) // TODO: Implement!
{
ostream << "\n" << pad << "Object: ";
ostream << "<ptr=0x";
{
std::stringstream ss;
ss << std::hex << std::setfill('0');
ss << std::setw(16) << (uint64)(void *)object;
ostream << ss.str();
}
ostream << "> ";
ostream << ucstring(object->classDesc()->displayName()).toUtf8() << " ";
}
uint i = 0 ;
std::string padpad = pad + "\t";
for (std::set<NLMISC::CRefPtr<INode> >::iterator it = m_Children.begin(), end = m_Children.end(); it != end; ++it)
{
INode *node = (*it);
nlassert(node);
ostream << "\n" << pad << i << ": ";
node->dumpNodes(ostream, padpad);
++i;
}
ostream << "} ";
}
IStorageObject *INode::createChunkById(uint16 id, bool container)
{
return CReferenceTarget::createChunkById(id, container);
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,107 @@
/**
* \file i_node.h
* \brief INode
* \date 2012-08-22 19:45GMT
* \author Jan Boon (Kaetemi)
* INode
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_I_NODE_H
#define PIPELINE_I_NODE_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "reference_target.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief INode
* \date 2012-08-22 19:45GMT
* \author Jan Boon (Kaetemi)
* INode
*/
class INode : public CReferenceTarget
{
public:
INode(CScene *scene);
virtual ~INode();
// class desc
static const ucstring DisplayName;
static const char *InternalName;
static const char *InternalNameUnknown;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
// inherited
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
// node interface
virtual INode *parent();
virtual void setParent(INode *node);
virtual void addChild(INode *node);
virtual void removeChild(INode *node); // does not delete
virtual const ucstring &userName() const;
INode *find(const ucstring &userName) const;
// dump
void dumpNodes(std::ostream &ostream, const std::string &pad = "") const;
// read access
/// The children that are linked to this node by the parent tag
inline const std::set<NLMISC::CRefPtr<INode> > &children() const { return m_Children; }
protected:
// inherited
virtual IStorageObject *createChunkById(uint16 id, bool container);
protected:
std::set<NLMISC::CRefPtr<INode> > m_Children;
}; /* class INode */
typedef CSceneClassDesc<INode> CNodeClassDesc;
extern const CNodeClassDesc NodeClassDesc;
typedef CSuperClassDesc<INode> CNodeSuperClassDesc;
extern const CNodeSuperClassDesc NodeSuperClassDesc;
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_I_NODE_H */
/* end of file */

@ -0,0 +1,59 @@
/**
* \file modifier.cpp
* \brief CModifier
* \date 2012-08-22 08:59GMT
* \author Jan Boon (Kaetemi)
* CModifier
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "modifier.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CModifier::CModifier(CScene *scene) : CBaseObject(scene)
{
}
CModifier::~CModifier()
{
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,63 @@
/**
* \file modifier.h
* \brief CModifier
* \date 2012-08-22 08:59GMT
* \author Jan Boon (Kaetemi)
* CModifier
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_MODIFIER_H
#define PIPELINE_MODIFIER_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "base_object.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CModifier
* \date 2012-08-22 08:59GMT
* \author Jan Boon (Kaetemi)
* CModifier
*/
class CModifier : public CBaseObject
{
public:
CModifier(CScene *scene);
virtual ~CModifier();
}; /* class CModifier */
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_MODIFIER_H */
/* end of file */

@ -0,0 +1,59 @@
/**
* \file mtl.cpp
* \brief CMtl
* \date 2012-08-22 08:54GMT
* \author Jan Boon (Kaetemi)
* CMtl
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "mtl.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CMtl::CMtl(CScene *scene) : CMtlBase(scene)
{
}
CMtl::~CMtl()
{
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,63 @@
/**
* \file mtl.h
* \brief CMtl
* \date 2012-08-22 08:54GMT
* \author Jan Boon (Kaetemi)
* CMtl
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_MTL_H
#define PIPELINE_MTL_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "mtl_base.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CMtl
* \date 2012-08-22 08:54GMT
* \author Jan Boon (Kaetemi)
* CMtl
*/
class CMtl : public CMtlBase
{
public:
CMtl(CScene *scene);
virtual ~CMtl();
}; /* class CMtl */
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_MTL_H */
/* end of file */

@ -0,0 +1,59 @@
/**
* \file mtl_base.cpp
* \brief CMtlBase
* \date 2012-08-22 08:53GMT
* \author Jan Boon (Kaetemi)
* CMtlBase
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "mtl_base.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CMtlBase::CMtlBase(CScene *scene) : CReferenceTarget(scene)
{
}
CMtlBase::~CMtlBase()
{
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,63 @@
/**
* \file mtl_base.h
* \brief CMtlBase
* \date 2012-08-22 08:53GMT
* \author Jan Boon (Kaetemi)
* CMtlBase
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_MTL_BASE_H
#define PIPELINE_MTL_BASE_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "reference_target.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CMtlBase
* \date 2012-08-22 08:53GMT
* \author Jan Boon (Kaetemi)
* CMtlBase
*/
class CMtlBase : public CReferenceTarget
{
public:
CMtlBase(CScene *scene);
virtual ~CMtlBase();
}; /* class CMtlBase */
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_MTL_BASE_H */
/* end of file */

@ -0,0 +1,59 @@
/**
* \file multi_mtl.cpp
* \brief CMultiMtl
* \date 2012-08-22 08:55GMT
* \author Jan Boon (Kaetemi)
* CMultiMtl
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "multi_mtl.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CMultiMtl::CMultiMtl()
{
}
CMultiMtl::~CMultiMtl()
{
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,67 @@
/**
* \file multi_mtl.h
* \brief CMultiMtl
* \date 2012-08-22 08:55GMT
* \author Jan Boon (Kaetemi)
* CMultiMtl
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_MULTI_MTL_H
#define PIPELINE_MULTI_MTL_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CMultiMtl
* \date 2012-08-22 08:55GMT
* \author Jan Boon (Kaetemi)
* CMultiMtl
*/
class CMultiMtl
{
protected:
// pointers
// ...
// instances
// ...
public:
CMultiMtl();
virtual ~CMultiMtl();
}; /* class CMultiMtl */
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_MULTI_MTL_H */
/* end of file */

@ -0,0 +1,195 @@
/**
* \file node_impl.cpp
* \brief CNodeImpl
* \date 2012-08-22 20:01GMT
* \author Jan Boon (Kaetemi)
* CNodeImpl
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "node_impl.h"
// STL includes
#include <iomanip>
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
#define PMB_NODE_VERSION_CHUNK_ID 0x09ce
#define PMB_NODE_PARENT_CHUNK_ID 0x0960
#define PMB_NODE_NAME_CHUNK_ID 0x0962
CNodeImpl::CNodeImpl(CScene *scene) : INode(scene), m_NodeVersion(0), m_ParentFlags(0), m_UserName(ucstring("Untitled Node"))
{
}
CNodeImpl::~CNodeImpl()
{
}
const ucstring CNodeImpl::DisplayName = ucstring("Node");
const char *CNodeImpl::InternalName = "NodeImpl";
const NLMISC::CClassId CNodeImpl::ClassId = NLMISC::CClassId(0x00000001, 0x00000000);
const TSClassId CNodeImpl::SuperClassId = INode::SuperClassId;
const CNodeImplClassDesc NodeImplClassDesc(&DllPluginDescBuiltin);
void CNodeImpl::parse(uint16 version, uint filter)
{
INode::parse(version);
if (!m_ChunksOwnsPointers)
{
m_NodeVersion = getChunkValue<uint32>(PMB_NODE_VERSION_CHUNK_ID);
CStorageArray<uint32> *parent = static_cast<CStorageArray<uint32> *>(getChunk(PMB_NODE_PARENT_CHUNK_ID));
nlassert(parent);
nlassert(parent->Value.size() == 2);
setParent(dynamic_cast<INode *>(container()->getByStorageIndex((sint32)parent->Value[0])));
nlassert(m_Parent);
m_ParentFlags = parent->Value[1];
m_ArchivedChunks.push_back(parent);
m_UserName = getChunkValue<ucstring>(PMB_NODE_NAME_CHUNK_ID);
}
}
void CNodeImpl::clean()
{
INode::clean();
}
void CNodeImpl::build(uint16 version, uint filter)
{
INode::build(version);
putChunkValue(PMB_NODE_VERSION_CHUNK_ID, m_NodeVersion);
CStorageArray<uint32> *parent = new CStorageArray<uint32>();
parent->Value.resize(2);
parent->Value[0] = container()->getOrCreateStorageIndex(m_Parent);
parent->Value[1] = m_ParentFlags;
m_ArchivedChunks.push_back(parent);
putChunk(PMB_NODE_PARENT_CHUNK_ID, parent);
putChunkValue(PMB_NODE_NAME_CHUNK_ID, m_UserName);
}
void CNodeImpl::disown()
{
m_NodeVersion = 0;
setParent(NULL);
m_ParentFlags = 0;
m_UserName = ucstring("Untitled Node");
INode::disown();
}
void CNodeImpl::init()
{
INode::init();
}
bool CNodeImpl::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return INode::inherits(classId);
}
const ISceneClassDesc *CNodeImpl::classDesc() const
{
return &NodeImplClassDesc;
}
void CNodeImpl::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{
INode::toStringLocal(ostream, pad);
ostream << "\n" << pad << "NodeVersion: " << m_NodeVersion;
ostream << "\n" << pad << "Parent: ";
INode *parent = m_Parent;
nlassert(parent);
if (parent)
{
ostream << "<ptr=0x";
{
std::stringstream ss;
ss << std::hex << std::setfill('0');
ss << std::setw(16) << (uint64)(void *)parent;
ostream << ss.str();
}
ostream << "> ";
ostream << "(" << ucstring(parent->classDesc()->displayName()).toUtf8() << ", " << parent->classDesc()->classId().toString() << ") ";
ostream << parent->userName().toUtf8();
}
else
{
ostream << "NULL";
}
ostream << "\n" << pad << "ParentFlags: " << m_ParentFlags;
ostream << "\n" << pad << "UserName: " << m_UserName.toUtf8() << " ";
}
INode *CNodeImpl::parent()
{
return m_Parent;
}
void CNodeImpl::setParent(INode *node)
{
if (m_Parent) m_Parent->removeChild(this);
m_Parent = node;
if (node) node->addChild(this);
}
const ucstring &CNodeImpl::userName() const
{
return m_UserName;
}
IStorageObject *CNodeImpl::createChunkById(uint16 id, bool container)
{
switch (id)
{
case PMB_NODE_VERSION_CHUNK_ID:
return new CStorageValue<uint32>();
case PMB_NODE_PARENT_CHUNK_ID:
return new CStorageArray<uint32>();
case PMB_NODE_NAME_CHUNK_ID:
return new CStorageValue<ucstring>();
}
return INode::createChunkById(id, container);
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,102 @@
/**
* \file node_impl.h
* \brief CNodeImpl
* \date 2012-08-22 20:01GMT
* \author Jan Boon (Kaetemi)
* CNodeImpl
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_NODE_IMPL_H
#define PIPELINE_NODE_IMPL_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "i_node.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CNodeImpl
* \date 2012-08-22 20:01GMT
* \author Jan Boon (Kaetemi)
* CNodeImpl
*/
class CNodeImpl : public INode
{
public:
CNodeImpl(CScene *scene);
virtual ~CNodeImpl();
// class desc
static const ucstring DisplayName;
static const char *InternalName;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
// inherited
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
// node interface
virtual INode *parent();
virtual void setParent(INode *node);
// virtual void addChild(INode *node);
// virtual void removeChild(INode *node); // does not delete
virtual const ucstring &userName() const;
// read access
inline uint32 nodeVersion() const { return m_NodeVersion; }
protected:
// inherited
virtual IStorageObject *createChunkById(uint16 id, bool container);
private:
uint32 m_NodeVersion;
NLMISC::CRefPtr<INode> m_Parent;
uint32 m_ParentFlags;
ucstring m_UserName;
}; /* class CNodeImpl */
typedef CSceneClassDesc<CNodeImpl> CNodeImplClassDesc;
extern const CNodeImplClassDesc NodeImplClassDesc;
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_NODE_IMPL_H */
/* end of file */

@ -0,0 +1,113 @@
/**
* \file object.cpp
* \brief CObject
* \date 2012-08-22 09:13GMT
* \author Jan Boon (Kaetemi)
* CObject
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "object.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CObject::CObject(CScene *scene) : CBaseObject(scene)
{
}
CObject::~CObject()
{
}
const ucstring CObject::DisplayName = ucstring("Object");
const char *CObject::InternalName = "Object";
const char *CObject::InternalNameUnknown = "ObjectUnknown";
const NLMISC::CClassId CObject::ClassId = NLMISC::CClassId(0x14021ed1, 0x33837a80); /* Not official, please correct */
const TSClassId CObject::SuperClassId = 0x00000060;
const CObjectClassDesc ObjectClassDesc(&DllPluginDescBuiltin);
const CObjectSuperClassDesc ObjectSuperClassDesc(&ObjectClassDesc);
void CObject::parse(uint16 version, uint filter)
{
CBaseObject::parse(version);
}
void CObject::clean()
{
CBaseObject::clean();
}
void CObject::build(uint16 version, uint filter)
{
CBaseObject::build(version);
}
void CObject::disown()
{
CBaseObject::disown();
}
void CObject::init()
{
CBaseObject::init();
}
bool CObject::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return CBaseObject::inherits(classId);
}
const ISceneClassDesc *CObject::classDesc() const
{
return &ObjectClassDesc;
}
void CObject::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{
CBaseObject::toStringLocal(ostream, pad);
}
IStorageObject *CObject::createChunkById(uint16 id, bool container)
{
return CBaseObject::createChunkById(id, container);
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,89 @@
/**
* \file object.h
* \brief CObject
* \date 2012-08-22 09:13GMT
* \author Jan Boon (Kaetemi)
* CObject
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_OBJECT_H
#define PIPELINE_OBJECT_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "base_object.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CObject
* \date 2012-08-22 09:13GMT
* \author Jan Boon (Kaetemi)
* CObject
*/
class CObject : public CBaseObject
{
public:
CObject(CScene *scene);
virtual ~CObject();
// class desc
static const ucstring DisplayName;
static const char *InternalName;
static const char *InternalNameUnknown;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
// inherited
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
protected:
// inherited
virtual IStorageObject *createChunkById(uint16 id, bool container);
}; /* class CObject */
typedef CSceneClassDesc<CObject> CObjectClassDesc;
extern const CObjectClassDesc ObjectClassDesc;
typedef CSuperClassDesc<CObject> CObjectSuperClassDesc;
extern const CObjectSuperClassDesc ObjectSuperClassDesc;
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_OBJECT_H */
/* end of file */

@ -0,0 +1,59 @@
/**
* \file param_block.cpp
* \brief CParamBlock
* \date 2012-08-22 08:57GMT
* \author Jan Boon (Kaetemi)
* CParamBlock
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "param_block.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CParamBlock::CParamBlock(CScene *scene) : CReferenceTarget(scene)
{
}
CParamBlock::~CParamBlock()
{
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,63 @@
/**
* \file param_block.h
* \brief CParamBlock
* \date 2012-08-22 08:57GMT
* \author Jan Boon (Kaetemi)
* CParamBlock
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_PARAM_BLOCK_H
#define PIPELINE_PARAM_BLOCK_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "reference_target.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CParamBlock
* \date 2012-08-22 08:57GMT
* \author Jan Boon (Kaetemi)
* CParamBlock
*/
class CParamBlock : public CReferenceTarget
{
public:
CParamBlock(CScene *scene);
virtual ~CParamBlock();
}; /* class CParamBlock */
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_PARAM_BLOCK_H */
/* end of file */

@ -0,0 +1,59 @@
/**
* \file param_block_2.cpp
* \brief CParamBlock2
* \date 2012-08-22 08:57GMT
* \author Jan Boon (Kaetemi)
* CParamBlock2
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "param_block_2.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CParamBlock2::CParamBlock2(CScene *scene) : CReferenceTarget(scene)
{
}
CParamBlock2::~CParamBlock2()
{
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,63 @@
/**
* \file param_block_2.h
* \brief CParamBlock2
* \date 2012-08-22 08:57GMT
* \author Jan Boon (Kaetemi)
* CParamBlock2
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_PARAM_BLOCK_2_H
#define PIPELINE_PARAM_BLOCK_2_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "reference_target.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CParamBlock2
* \date 2012-08-22 08:57GMT
* \author Jan Boon (Kaetemi)
* CParamBlock2
*/
class CParamBlock2 : public CReferenceTarget
{
public:
CParamBlock2(CScene *scene);
virtual ~CParamBlock2();
}; /* class CParamBlock2 */
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_PARAM_BLOCK_2_H */
/* end of file */

@ -0,0 +1,111 @@
/**
* \file patch_object.cpp
* \brief CPatchObject
* \date 2012-08-22 08:58GMT
* \author Jan Boon (Kaetemi)
* CPatchObject
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "patch_object.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
// using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CPatchObject::CPatchObject(CScene *scene) : CGeomObject(scene)
{
}
CPatchObject::~CPatchObject()
{
}
const ucstring CPatchObject::DisplayName = ucstring("PatchObject");
const char *CPatchObject::InternalName = "PatchObject";
const NLMISC::CClassId CPatchObject::ClassId = NLMISC::CClassId(0xd0a6b36, 0x7dce4b64); /* Not official, please correct */
const TSClassId CPatchObject::SuperClassId = CGeomObject::SuperClassId;
const CPatchObjectClassDesc PatchObjectClassDesc(&DllPluginDescBuiltin);
void CPatchObject::parse(uint16 version, uint filter)
{
CGeomObject::parse(version);
}
void CPatchObject::clean()
{
CGeomObject::clean();
}
void CPatchObject::build(uint16 version, uint filter)
{
CGeomObject::build(version);
}
void CPatchObject::disown()
{
CGeomObject::disown();
}
void CPatchObject::init()
{
CGeomObject::init();
}
bool CPatchObject::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return CGeomObject::inherits(classId);
}
const ISceneClassDesc *CPatchObject::classDesc() const
{
return &PatchObjectClassDesc;
}
void CPatchObject::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{
CGeomObject::toStringLocal(ostream, pad);
}
IStorageObject *CPatchObject::createChunkById(uint16 id, bool container)
{
return CGeomObject::createChunkById(id, container);
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,90 @@
/**
* \file patch_object.h
* \brief CPatchObject
* \date 2012-08-22 08:58GMT
* \author Jan Boon (Kaetemi)
* CPatchObject
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_PATCH_OBJECT_H
#define PIPELINE_PATCH_OBJECT_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "geom_object.h"
/// Must be passed to the parse and build functions by
/// inheriting classes to parse the actual patch object.
#define PMB_PATCH_OBJECT_PARSE_FILTER 0x2a611c9
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CPatchObject
* \date 2012-08-22 08:58GMT
* \author Jan Boon (Kaetemi)
* CPatchObject
*/
class CPatchObject : public CGeomObject
{
public:
CPatchObject(CScene *scene);
virtual ~CPatchObject();
// class desc
static const ucstring DisplayName;
static const char *InternalName;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
// inherited
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
protected:
// inherited
virtual IStorageObject *createChunkById(uint16 id, bool container);
}; /* class CPatchObject */
typedef CSceneClassDesc<CPatchObject> CPatchObjectClassDesc;
extern const CPatchObjectClassDesc PatchObjectClassDesc;
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_PATCH_OBJECT_H */
/* end of file */

@ -0,0 +1,147 @@
/**
* \file poly_object.cpp
* \brief CPolyObject
* \date 2012-08-22 08:58GMT
* \author Jan Boon (Kaetemi)
* CPolyObject
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "poly_object.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CPolyObject::CPolyObject(CScene *scene) : CGeomObject(scene)
{
}
CPolyObject::~CPolyObject()
{
}
const ucstring CPolyObject::DisplayName = ucstring("PolyObject");
const char *CPolyObject::InternalName = "PolyObject";
const NLMISC::CClassId CPolyObject::ClassId = NLMISC::CClassId(0x59772461, 0x6e1141e8); /* Not official, please correct */
const TSClassId CPolyObject::SuperClassId = CGeomObject::SuperClassId;
const CPolyObjectClassDesc PolyObjectClassDesc(&DllPluginDescBuiltin);
void CPolyObject::parse(uint16 version, uint filter)
{
if (filter == 0)
{
CGeomObject::parse(version);
}
else if (filter == PMB_POLY_OBJECT_PARSE_FILTER)
{
if (!m_ChunksOwnsPointers)
{
CGeomObject::parse(version, PMB_GEOM_OBJECT_PARSE_FILTER);
// 0x0906
// 0x0908
// 0x090a
// 0x090c
}
}
}
void CPolyObject::clean()
{
CGeomObject::clean();
}
void CPolyObject::build(uint16 version, uint filter)
{
if (filter == 0)
{
CGeomObject::build(version);
}
else if (filter == PMB_POLY_OBJECT_PARSE_FILTER)
{
CGeomObject::build(version, PMB_GEOM_OBJECT_PARSE_FILTER);
// 0x0906
// 0x0908
// 0x090a
// 0x090c
}
}
void CPolyObject::disown()
{
CGeomObject::disown();
}
void CPolyObject::init()
{
CGeomObject::init();
}
bool CPolyObject::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return CGeomObject::inherits(classId);
}
const ISceneClassDesc *CPolyObject::classDesc() const
{
return &PolyObjectClassDesc;
}
void CPolyObject::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{
if (filter == 0)
{
CGeomObject::toStringLocal(ostream, pad);
}
else if (filter == PMB_POLY_OBJECT_PARSE_FILTER)
{
CGeomObject::toStringLocal(ostream, pad, PMB_GEOM_OBJECT_PARSE_FILTER);
// 0x0906
// 0x0908
// 0x090a
// 0x090c
}
}
IStorageObject *CPolyObject::createChunkById(uint16 id, bool container)
{
return CGeomObject::createChunkById(id, container);
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,90 @@
/**
* \file poly_object.h
* \brief CPolyObject
* \date 2012-08-22 08:58GMT
* \author Jan Boon (Kaetemi)
* CPolyObject
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_POLY_OBJECT_H
#define PIPELINE_POLY_OBJECT_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "geom_object.h"
/// Must be passed to the parse and build functions by
/// inheriting classes to parse the actual poly object.
#define PMB_POLY_OBJECT_PARSE_FILTER 0x127d3a04
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CPolyObject
* \date 2012-08-22 08:58GMT
* \author Jan Boon (Kaetemi)
* CPolyObject
*/
class CPolyObject : public CGeomObject
{
public:
CPolyObject(CScene *scene);
virtual ~CPolyObject();
// class desc
static const ucstring DisplayName;
static const char *InternalName;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
// inherited
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
protected:
// inherited
virtual IStorageObject *createChunkById(uint16 id, bool container);
}; /* class CPolyObject */
typedef CSceneClassDesc<CPolyObject> CPolyObjectClassDesc;
extern const CPolyObjectClassDesc PolyObjectClassDesc;
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_POLY_OBJECT_H */
/* end of file */

@ -0,0 +1,320 @@
/**
* \file reference_maker.cpp
* \brief CReferenceMaker
* \date 2012-08-22 08:52GMT
* \author Jan Boon (Kaetemi)
* CReferenceMaker
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "reference_maker.h"
// STL includes
#include <iomanip>
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
// Elevate warnings to errors in this file for stricter reading
#undef nlwarning
#define nlwarning nlerror
// Elevate debug to error in this file for debugging
// #undef nldebug
// #define nldebug nlerror
// Chunk identifiers
#define PMB_REFERENCES_2034_CHUNK_ID 0x2034
#define PMB_REFERENCES_2035_CHUNK_ID 0x2035
#define PMB_204B_EQUALS_2E_CHUNK_ID 0x204B
#define PMB_UNKNOWN2045_CHUNK_ID 0x2045
#define PMB_UNKNOWN2047_CHUNK_ID 0x2047
#define PMB_UNKNOWN21B0_CHUNK_ID 0x21B0
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CReferenceMaker::CReferenceMaker(CScene *scene) : CAnimatable(scene), m_ReferenceMap(false), m_204B_Equals_2E(NULL), m_References2035Value0(0), m_Unknown2045(NULL), m_Unknown2047(NULL), m_Unknown21B0(NULL)
{
}
CReferenceMaker::~CReferenceMaker()
{
if (!m_ChunksOwnsPointers)
{
delete m_204B_Equals_2E;
m_204B_Equals_2E = NULL;
delete m_Unknown2045;
m_Unknown2045 = NULL;
delete m_Unknown2047;
m_Unknown2047 = NULL;
delete m_Unknown21B0;
m_Unknown21B0 = NULL;
}
}
const ucstring CReferenceMaker::DisplayName = ucstring("ReferenceMaker");
const char *CReferenceMaker::InternalName = "ReferenceMaker";
const char *CReferenceMaker::InternalNameUnknown = "ReferenceMakerUnknown";
const NLMISC::CClassId CReferenceMaker::ClassId = NLMISC::CClassId(0x2ec43d15, 0x10a270ad); /* Not official, please correct */
const TSClassId CReferenceMaker::SuperClassId = 0x00000100;
const CReferenceMakerClassDesc ReferenceMakerClassDesc(&DllPluginDescBuiltin);
const CReferenceMakerSuperClassDesc ReferenceMakerSuperClassDesc(&ReferenceMakerClassDesc);
void CReferenceMaker::parse(uint16 version, uint filter)
{
CAnimatable::parse(version);
if (!m_ChunksOwnsPointers)
{
CStorageArray<sint32> *references2034 = static_cast<CStorageArray<sint32> *>(getChunk(PMB_REFERENCES_2034_CHUNK_ID));
CStorageArray<sint32> *references2035 = static_cast<CStorageArray<sint32> *>(getChunk(PMB_REFERENCES_2035_CHUNK_ID));
if (references2034) nlassert(references2035 == NULL); // Apparently, there can be only one.
if (references2035) nlassert(references2034 == NULL);
m_204B_Equals_2E = static_cast<CStorageValue<uint8> *>(getChunk(PMB_204B_EQUALS_2E_CHUNK_ID));
if (m_204B_Equals_2E) nlassert(m_204B_Equals_2E->Value == 0x2e); // Really, let me know when it has another value.
// Parse contents
if (references2034)
{
m_ReferenceMap = false; // NOTE: Plugins may check after parse if they parsed with the correct type, to find a pattern
m_ArchivedChunks.push_back(references2034);
for (std::vector<sint32>::size_type i = 0; i < references2034->Value.size(); ++i)
{
if (references2034->Value[i] > 0)
{
CReferenceMaker *referenceMaker = dynamic_cast<CReferenceMaker *>(container()->getByStorageIndex(references2034->Value[i]));
if (!referenceMaker) nlerror("Reference maker %s %s, 0x%x is not a reference maker", ucstring(container()->getByStorageIndex(references2034->Value[i])->classDesc()->displayName()).toUtf8().c_str(), container()->getByStorageIndex(references2034->Value[i])->classDesc()->classId().toString().c_str(), container()->getByStorageIndex(references2034->Value[i])->classDesc()->superClassId());
setReference(i, referenceMaker);
}
}
}
if (references2035)
{
m_ReferenceMap = true;
m_ArchivedChunks.push_back(references2035);
std::vector<sint32>::iterator it = references2035->Value.begin();
m_References2035Value0 = (*it);
++it;
std::vector<sint32>::iterator end = references2035->Value.end();
while (it != end)
{
sint32 index = (*it);
++it;
sint32 referenceindex = (*it);
++it;
CReferenceMaker *referenceMaker = dynamic_cast<CReferenceMaker *>(container()->getByStorageIndex(referenceindex));
if (!referenceMaker) nlerror("Reference maker %s, 0x%x is not a reference maker", container()->getByStorageIndex(referenceindex)->classDesc()->classId().toString().c_str(), container()->getByStorageIndex(referenceindex)->classDesc()->superClassId());
setReference(index, referenceMaker);
}
}
m_Unknown2045 = static_cast<CStorageRaw *>(getChunk(PMB_UNKNOWN2045_CHUNK_ID)); // not sure if this is part of maker or target
m_Unknown2047 = static_cast<CStorageRaw *>(getChunk(PMB_UNKNOWN2047_CHUNK_ID)); // not sure if this is part of maker or target
m_Unknown21B0 = static_cast<CStorageRaw *>(getChunk(PMB_UNKNOWN21B0_CHUNK_ID)); // not sure if this is part of maker or target
}
}
void CReferenceMaker::clean()
{
CAnimatable::clean(); // Nothing to do here, m_ArchivedChunks is cleaned (deleted) for us!
}
void CReferenceMaker::build(uint16 version, uint filter)
{
CAnimatable::build(version);
// TODO: Build contents
//if (m_References2034) putChunk(PMB_REFERENCES_2034_CHUNK_ID, m_References2034);
//if (m_References2035) putChunk(PMB_REFERENCES_2035_CHUNK_ID, m_References2035);
if (!m_ReferenceMap)
{
CStorageArray<sint32> *references2034 = new CStorageArray<sint32>();
uint nb = nbReferences();
references2034->Value.resize(nb);
for (uint i = 0; i < nb; ++i)
{
CReferenceMaker *referenceMaker = getReference(i);
if (referenceMaker) references2034->Value[i] = container()->getOrCreateStorageIndex(referenceMaker);
else references2034->Value[i] = -1;
}
putChunk(PMB_REFERENCES_2034_CHUNK_ID, references2034);
m_ArchivedChunks.push_back(references2034);
}
else
{
CStorageArray<sint32> *references2035 = new CStorageArray<sint32>();
uint nb = nbReferences();
references2035->Value.push_back(m_References2035Value0);
for (uint i = 0; i < nb; ++i)
{
CReferenceMaker *referenceMaker = getReference(i);
if (referenceMaker)
{
references2035->Value.push_back(i);
references2035->Value.push_back(container()->getOrCreateStorageIndex(referenceMaker));
}
}
putChunk(PMB_REFERENCES_2035_CHUNK_ID, references2035);
m_ArchivedChunks.push_back(references2035);
}
if (m_204B_Equals_2E) putChunk(PMB_204B_EQUALS_2E_CHUNK_ID, m_204B_Equals_2E);
if (m_Unknown2045) putChunk(PMB_UNKNOWN2045_CHUNK_ID, m_Unknown2045);
if (m_Unknown2047) putChunk(PMB_UNKNOWN2047_CHUNK_ID, m_Unknown2047);
if (m_Unknown21B0) putChunk(PMB_UNKNOWN21B0_CHUNK_ID, m_Unknown21B0);
}
void CReferenceMaker::disown()
{
m_References.clear();
m_ReferenceMap = false;
m_References2035Value0 = 0;
m_204B_Equals_2E = NULL;
m_Unknown2045 = NULL;
m_Unknown2047 = NULL;
m_Unknown21B0 = NULL;
CAnimatable::disown();
}
void CReferenceMaker::init()
{
CAnimatable::init();
}
bool CReferenceMaker::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return CAnimatable::inherits(classId);
}
const ISceneClassDesc *CReferenceMaker::classDesc() const
{
return &ReferenceMakerClassDesc;
}
void CReferenceMaker::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{
CAnimatable::toStringLocal(ostream, pad);
uint nb = nbReferences();
if (nb)
{
if (!m_ReferenceMap) ostream << "\n" << pad << "References 0x2034: ";
else ostream << "\n" << pad << "References 0x2035: ";
std::string padpad = pad + "\t";
ostream << "PARSED ";
if (!m_References.size()) ostream << "VIRTUAL ";
ostream << "{ ";
for (uint i = 0; i < nb; ++i)
{
CReferenceMaker *referenceMaker = getReference(i);
if (referenceMaker)
{
ostream << "\n" << padpad << i << ": <ptr=0x";
{
std::stringstream ss;
ss << std::hex << std::setfill('0');
ss << std::setw(16) << (uint64)(void *)referenceMaker;
ostream << ss.str();
}
ostream << "> ";
ostream << "(" << ucstring(referenceMaker->classDesc()->displayName()).toUtf8() << ", " << referenceMaker->classDesc()->classId().toString() << ") ";
}
}
ostream << "} ";
}
if (m_204B_Equals_2E)
{
ostream << "\n" << pad << "0x204B Equals 0x2E (46): ";
m_204B_Equals_2E->toString(ostream, pad + "\t");
}
if (m_Unknown2045)
{
ostream << "\n" << pad << "Unknown 0x2045: ";
m_Unknown2045->toString(ostream, pad + "\t");
}
if (m_Unknown2047)
{
ostream << "\n" << pad << "Unknown 0x2047: ";
m_Unknown2047->toString(ostream, pad + "\t");
}
if (m_Unknown21B0)
{
ostream << "\n" << pad << "Unknown 0x21B0: ";
m_Unknown21B0->toString(ostream, pad + "\t");
}
}
CReferenceMaker *CReferenceMaker::getReference(uint index) const
{
if (m_References.size() <= index) return NULL;
return m_References[index];
}
void CReferenceMaker::setReference(uint index, CReferenceMaker *reference)
{
if (m_References.size() <= index) m_References.resize(index + 1);
m_References[index] = reference;
}
uint CReferenceMaker::nbReferences() const
{
return m_References.size();
}
IStorageObject *CReferenceMaker::createChunkById(uint16 id, bool container)
{
switch (id)
{
case PMB_REFERENCES_2034_CHUNK_ID:
return new CStorageArray<sint32>();
case PMB_REFERENCES_2035_CHUNK_ID:
return new CStorageArray<sint32>();
case PMB_204B_EQUALS_2E_CHUNK_ID:
return new CStorageValue<uint8>();
case PMB_UNKNOWN21B0_CHUNK_ID:
return new CStorageRaw();
}
return CAnimatable::createChunkById(id, container);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,110 @@
/**
* \file reference_maker.h
* \brief CReferenceMaker
* \date 2012-08-22 08:52GMT
* \author Jan Boon (Kaetemi)
* CReferenceMaker
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_REFERENCE_MAKER_H
#define PIPELINE_REFERENCE_MAKER_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "../storage_array.h"
#include "animatable.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CReferenceMaker
* \date 2012-08-22 08:52GMT
* \author Jan Boon (Kaetemi)
* This class implements references
*/
class CReferenceMaker : public CAnimatable
{
public:
CReferenceMaker(CScene *scene);
virtual ~CReferenceMaker();
// class desc
static const ucstring DisplayName;
static const char *InternalName;
static const char *InternalNameUnknown;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
// inherited
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
// child classes should inherit, default implementation stores in a vector
/// Get a reference
virtual CReferenceMaker *getReference(uint index) const;
virtual void setReference(uint index, CReferenceMaker *reference);
virtual uint nbReferences() const;
protected:
// inherited
virtual IStorageObject *createChunkById(uint16 id, bool container);
/// Storage method
bool m_ReferenceMap;
private:
CStorageValue<uint8> *m_204B_Equals_2E;
/// Default implementation, should preferably not use this, no direct read access will be provided
std::vector<NLMISC::CRefPtr<CReferenceMaker> > m_References;
/// Unknown value
uint32 m_References2035Value0;
CStorageRaw *m_Unknown2045;
CStorageRaw *m_Unknown2047;
CStorageRaw *m_Unknown21B0;
}; /* class CReferenceMaker */
typedef CSceneClassDesc<CReferenceMaker> CReferenceMakerClassDesc;
extern const CReferenceMakerClassDesc ReferenceMakerClassDesc;
typedef CSuperClassDesc<CReferenceMaker> CReferenceMakerSuperClassDesc;
extern const CReferenceMakerSuperClassDesc ReferenceMakerSuperClassDesc;
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_REFERENCE_MAKER_H */
/* end of file */

@ -0,0 +1,113 @@
/**
* \file reference_target.cpp
* \brief CReferenceTarget
* \date 2012-08-22 08:53GMT
* \author Jan Boon (Kaetemi)
* CReferenceTarget
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "reference_target.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CReferenceTarget::CReferenceTarget(CScene *scene) : CReferenceMaker(scene)
{
}
CReferenceTarget::~CReferenceTarget()
{
}
const ucstring CReferenceTarget::DisplayName = ucstring("ReferenceTarget");
const char *CReferenceTarget::InternalName = "ReferenceTarget";
const char *CReferenceTarget::InternalNameUnknown = "ReferenceTargetUnknown";
const NLMISC::CClassId CReferenceTarget::ClassId = NLMISC::CClassId(0x5d545dd9, 0xa422e4); /* Not official, please correct */
const TSClassId CReferenceTarget::SuperClassId = 0x00000200;
const CReferenceTargetClassDesc ReferenceTargetClassDesc(&DllPluginDescBuiltin);
const CReferenceTargetSuperClassDesc ReferenceTargetSuperClassDesc(&ReferenceTargetClassDesc);
void CReferenceTarget::parse(uint16 version, uint filter)
{
CReferenceMaker::parse(version);
}
void CReferenceTarget::clean()
{
CReferenceMaker::clean();
}
void CReferenceTarget::build(uint16 version, uint filter)
{
CReferenceMaker::build(version);
}
void CReferenceTarget::disown()
{
CReferenceMaker::disown();
}
void CReferenceTarget::init()
{
CReferenceMaker::init();
}
bool CReferenceTarget::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return CReferenceMaker::inherits(classId);
}
const ISceneClassDesc *CReferenceTarget::classDesc() const
{
return &ReferenceTargetClassDesc;
}
void CReferenceTarget::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{
CReferenceMaker::toStringLocal(ostream, pad);
}
IStorageObject *CReferenceTarget::createChunkById(uint16 id, bool container)
{
return CReferenceMaker::createChunkById(id, container);
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,90 @@
/**
* \file reference_target.h
* \brief CReferenceTarget
* \date 2012-08-22 08:53GMT
* \author Jan Boon (Kaetemi)
* CReferenceTarget
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_REFERENCE_TARGET_H
#define PIPELINE_REFERENCE_TARGET_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "reference_maker.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CReferenceTarget
* \date 2012-08-22 08:53GMT
* \author Jan Boon (Kaetemi)
* Dummy class, supposed to send or receive events or something.
* Nice for copy pasting the basic class layout.
*/
class CReferenceTarget : public CReferenceMaker
{
public:
CReferenceTarget(CScene *scene);
virtual ~CReferenceTarget();
// class desc
static const ucstring DisplayName;
static const char *InternalName;
static const char *InternalNameUnknown;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
// inherited
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
protected:
// inherited
virtual IStorageObject *createChunkById(uint16 id, bool container);
}; /* class CReferenceTarget */
typedef CSceneClassDesc<CReferenceTarget> CReferenceTargetClassDesc;
extern const CReferenceTargetClassDesc ReferenceTargetClassDesc;
typedef CSuperClassDesc<CReferenceTarget> CReferenceTargetSuperClassDesc;
extern const CReferenceTargetSuperClassDesc ReferenceTargetSuperClassDesc;
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_REFERENCE_TARGET_H */
/* end of file */

@ -0,0 +1,117 @@
/**
* \file root_node.cpp
* \brief CRootNode
* \date 2012-08-22 19:45GMT
* \author Jan Boon (Kaetemi)
* CRootNode
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "root_node.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CRootNode::CRootNode(CScene *scene) : INode(scene)
{
}
CRootNode::~CRootNode()
{
}
const ucstring CRootNode::DisplayName = ucstring("RootNode");
const char *CRootNode::InternalName = "RootNode";
const NLMISC::CClassId CRootNode::ClassId = NLMISC::CClassId(0x00000002, 0x00000000);
const TSClassId CRootNode::SuperClassId = INode::SuperClassId;
const CRootNodeClassDesc RootNodeClassDesc(&DllPluginDescBuiltin);
void CRootNode::parse(uint16 version, uint filter)
{
INode::parse(version);
}
void CRootNode::clean()
{
INode::clean();
}
void CRootNode::build(uint16 version, uint filter)
{
INode::build(version);
}
void CRootNode::disown()
{
INode::disown();
}
void CRootNode::init()
{
INode::init();
}
bool CRootNode::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return INode::inherits(classId);
}
const ISceneClassDesc *CRootNode::classDesc() const
{
return &RootNodeClassDesc;
}
void CRootNode::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{
INode::toStringLocal(ostream, pad);
}
const ucstring &CRootNode::userName() const
{
static const ucstring v = ucstring("Root Node");
return v;
}
IStorageObject *CRootNode::createChunkById(uint16 id, bool container)
{
return INode::createChunkById(id, container);
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,89 @@
/**
* \file root_node.h
* \brief CRootNode
* \date 2012-08-22 19:45GMT
* \author Jan Boon (Kaetemi)
* CRootNode
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_ROOT_NODE_H
#define PIPELINE_ROOT_NODE_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "i_node.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CRootNode
* \date 2012-08-22 20:01GMT
* \author Jan Boon (Kaetemi)
* CRootNode
*/
class CRootNode : public INode
{
public:
CRootNode(CScene *scene);
virtual ~CRootNode();
// class desc
static const ucstring DisplayName;
static const char *InternalName;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
// inherited
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
// node interface
virtual const ucstring &userName() const;
protected:
// inherited
virtual IStorageObject *createChunkById(uint16 id, bool container);
}; /* class CRootNode */
typedef CSceneClassDesc<CRootNode> CRootNodeClassDesc;
extern const CRootNodeClassDesc RootNodeClassDesc;
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_ROOT_NODE_H */
/* end of file */

@ -0,0 +1,209 @@
/**
* \file scene_impl.cpp
* \brief CSceneImpl
* \date 2012-08-24 12:33GMT
* \author Jan Boon (Kaetemi)
* CSceneImpl
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "scene_impl.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CSceneImpl::CSceneImpl(CScene *scene) : CReferenceMaker(scene)
{
}
CSceneImpl::~CSceneImpl()
{
}
const ucstring CSceneImpl::DisplayName = ucstring("Scene");
const char *CSceneImpl::InternalName = "SceneImpl";
const NLMISC::CClassId CSceneImpl::ClassId = NLMISC::CClassId(0x00002222, 0x00000000);
const TSClassId CSceneImpl::SuperClassId = CReferenceMaker::SuperClassId;
const CSceneImplClassDesc SceneImplClassDesc(&DllPluginDescBuiltin);
void CSceneImpl::parse(uint16 version, uint filter)
{
CReferenceMaker::parse(version);
nlassert(m_MaterialEditor);
nlassert(m_MtlBaseLib);
nlassert(m_Sound);
nlassert(m_RootNode);
nlassert(m_RenderEnvironment);
nlassert(m_NamedSelSetList);
nlassert(m_TrackViewNode);
nlassert(m_GridReference);
nlassert(m_RenderEffects);
nlassert(m_ShadowMap);
nlassert(m_LayerManager);
if (version > Version3) nlassert(m_TrackSetList);
}
void CSceneImpl::clean()
{
CReferenceMaker::clean();
}
void CSceneImpl::build(uint16 version, uint filter)
{
CReferenceMaker::build(version);
}
void CSceneImpl::disown()
{
CReferenceMaker::disown();
}
void CSceneImpl::init()
{
CReferenceMaker::init();
}
bool CSceneImpl::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return CReferenceMaker::inherits(classId);
}
const ISceneClassDesc *CSceneImpl::classDesc() const
{
return &SceneImplClassDesc;
}
void CSceneImpl::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{
CReferenceMaker::toStringLocal(ostream, pad);
}
CReferenceMaker *CSceneImpl::getReference(uint index) const
{
switch (index)
{
case 0:
return m_MaterialEditor;
case 1:
return m_MtlBaseLib;
case 2:
return m_Sound;
case 3:
return m_RootNode;
case 4:
return m_RenderEnvironment;
case 5:
return m_NamedSelSetList;
case 6:
return m_TrackViewNode;
case 7:
return m_GridReference;
case 8:
return m_RenderEffects;
case 9:
return m_ShadowMap;
case 10:
return m_LayerManager;
case 11:
return m_TrackSetList;
default:
if (index > 0)
nlerror("Invalid index %i", index);
return NULL;
}
}
void CSceneImpl::setReference(uint index, CReferenceMaker *reference)
{
switch (index)
{
case 0:
m_MaterialEditor = reference;
break;
case 1:
m_MtlBaseLib = reference;
break;
case 2:
m_Sound = reference;
break;
case 3:
m_RootNode = dynamic_cast<CRootNode *>(reference);
break;
case 4:
m_RenderEnvironment = reference;
break;
case 5:
m_NamedSelSetList = reference;
break;
case 6:
m_TrackViewNode = dynamic_cast<CTrackViewNode *>(reference);
break;
case 7:
m_GridReference = reference;
break;
case 8:
m_RenderEffects = reference;
break;
case 9:
m_ShadowMap = reference;
break;
case 10:
m_LayerManager = reference;
break;
case 11:
m_TrackSetList = reference;
break;
default:
nlerror("Unknown reference index %i entry <ptr=0x%x> (%s, 0x%x)", index, (uint32)(uint64)(void *)reference, reference->classDesc()->classId().toString().c_str(), reference->classDesc()->superClassId());
break;
}
}
uint CSceneImpl::nbReferences() const
{
return m_TrackSetList ? 12 : 11;
}
IStorageObject *CSceneImpl::createChunkById(uint16 id, bool container)
{
return CReferenceMaker::createChunkById(id, container);
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,112 @@
/**
* \file scene_impl.h
* \brief CSceneImpl
* \date 2012-08-24 12:33GMT
* \author Jan Boon (Kaetemi)
* CSceneImpl
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_SCENE_IMPL_H
#define PIPELINE_SCENE_IMPL_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "reference_maker.h"
#include "root_node.h"
#include "track_view_node.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CSceneImpl
* \date 2012-08-22 08:53GMT
* \author Jan Boon (Kaetemi)
* Scene implementation
*/
class CSceneImpl : public CReferenceMaker
{
public:
CSceneImpl(CScene *scene);
virtual ~CSceneImpl();
// class desc
static const ucstring DisplayName;
static const char *InternalName;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
// inherited
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
// reference maker
virtual CReferenceMaker *getReference(uint index) const;
virtual void setReference(uint index, CReferenceMaker *reference);
virtual uint nbReferences() const;
// read access
inline CRootNode *rootNode() const { return m_RootNode; }
inline CTrackViewNode *trackViewNode() const { return m_TrackViewNode; }
protected:
// inherited
virtual IStorageObject *createChunkById(uint16 id, bool container);
private:
NLMISC::CRefPtr<CReferenceMaker> m_MaterialEditor;
NLMISC::CRefPtr<CReferenceMaker> m_MtlBaseLib;
NLMISC::CRefPtr<CReferenceMaker> m_Sound;
NLMISC::CRefPtr<CRootNode> m_RootNode;
NLMISC::CRefPtr<CReferenceMaker> m_RenderEnvironment;
NLMISC::CRefPtr<CReferenceMaker> m_NamedSelSetList;
NLMISC::CRefPtr<CTrackViewNode> m_TrackViewNode;
NLMISC::CRefPtr<CReferenceMaker> m_GridReference;
NLMISC::CRefPtr<CReferenceMaker> m_RenderEffects;
NLMISC::CRefPtr<CReferenceMaker> m_ShadowMap;
NLMISC::CRefPtr<CReferenceMaker> m_LayerManager;
NLMISC::CRefPtr<CReferenceMaker> m_TrackSetList; // Does not exist in R3
}; /* class CSceneImpl */
typedef CSceneClassDesc<CSceneImpl> CSceneImplClassDesc;
extern const CSceneImplClassDesc SceneImplClassDesc;
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_SCENE_IMPL_H */
/* end of file */

@ -0,0 +1,59 @@
/**
* \file std_mat.cpp
* \brief CStdMat
* \date 2012-08-22 08:55GMT
* \author Jan Boon (Kaetemi)
* CStdMat
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "std_mat.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CStdMat::CStdMat(CScene *scene) : CMtl(scene)
{
}
CStdMat::~CStdMat()
{
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,63 @@
/**
* \file std_mat.h
* \brief CStdMat
* \date 2012-08-22 08:55GMT
* \author Jan Boon (Kaetemi)
* CStdMat
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_STD_MAT_H
#define PIPELINE_STD_MAT_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "mtl.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CStdMat
* \date 2012-08-22 08:55GMT
* \author Jan Boon (Kaetemi)
* CStdMat
*/
class CStdMat : public CMtl
{
public:
CStdMat(CScene *scene);
virtual ~CStdMat();
}; /* class CStdMat */
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_STD_MAT_H */
/* end of file */

@ -0,0 +1,59 @@
/**
* \file std_mat_2.cpp
* \brief CStdMat2
* \date 2012-08-22 08:55GMT
* \author Jan Boon (Kaetemi)
* CStdMat2
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "std_mat_2.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CStdMat2::CStdMat2(CScene *scene) : CStdMat(scene)
{
}
CStdMat2::~CStdMat2()
{
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,68 @@
/**
* \file std_mat_2.h
* \brief CStdMat2
* \date 2012-08-22 08:55GMT
* \author Jan Boon (Kaetemi)
* CStdMat2
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_STD_MAT_2_H
#define PIPELINE_STD_MAT_2_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "std_mat.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CStdMat2
* \date 2012-08-22 08:55GMT
* \author Jan Boon (Kaetemi)
* CStdMat2
*/
class CStdMat2 : public CStdMat
{
protected:
// pointers
// ...
// instances
// ...
public:
CStdMat2(CScene *scene);
virtual ~CStdMat2();
}; /* class CStdMat2 */
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_STD_MAT_2_H */
/* end of file */

@ -0,0 +1,507 @@
/**
* \file app_data.cpp
* \brief CAppData
* \date 2012-08-21 11:47GMT
* \author Jan Boon (Kaetemi)
* CAppData
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "app_data.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
namespace STORAGE {
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
#define PMBS_APP_DATA_PARSE 1
// Elevate warnings to errors in this file for stricter reading
#undef nlwarning
#define nlwarning nlerror
// Elevate debug to error in this file for debugging
// #undef nldebug
// #define nldebug nlerror
// Chunk identifiers
#define PMBS_APP_DATA_HEADER_CHUNK_ID 0x0100
#define PMBS_APP_DATA_ENTRY_CHUNK_ID 0x0110
#define PMBS_APP_DATA_ENTRY_KEY_CHUNK_ID 0x0120
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CAppData::TKey::TKey(NLMISC::CClassId classId, TSClassId superClassId, uint32 subId) : ClassId(classId), SuperClassId(superClassId), SubId(subId)
{
}
bool CAppData::TKey::operator<(const CAppData::TKey &right) const
{
if (ClassId < right.ClassId)
return true;
if (ClassId > right.ClassId)
return false;
if (SuperClassId < right.SuperClassId)
return true;
if (SuperClassId > right.SuperClassId)
return false;
if (SubId < right.SubId)
return true;
if (SubId > right.SubId)
return false;
return false;
}
bool CAppData::TKey::operator>(const CAppData::TKey &right) const
{
if (ClassId > right.ClassId)
return true;
if (ClassId < right.ClassId)
return false;
if (SuperClassId > right.SuperClassId)
return true;
if (SuperClassId < right.SuperClassId)
return false;
if (SubId > right.SubId)
return true;
if (SubId < right.SubId)
return false;
return false;
}
bool CAppData::TKey::operator==(const CAppData::TKey &right) const
{
return ClassId == right.ClassId && SuperClassId == right.SuperClassId && SubId == right.SubId;
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CAppData::CAppData()
{
}
CAppData::~CAppData()
{
if (!m_ChunksOwnsPointers)
{
for (TMap::const_iterator subit = m_Entries.begin(), subend = m_Entries.end(); subit != subend; ++subit)
delete subit->second;
m_Entries.clear();
}
}
std::string CAppData::className() const
{
return "AppData";
}
void CAppData::toString(std::ostream &ostream, const std::string &pad) const
{
if (m_ChunksOwnsPointers)
{
CStorageContainer::toString(ostream, pad);
}
else
{
ostream << "(" << className() << ") [" << m_Entries.size() << "] PARSED { ";
std::string padpad = pad + "\t";
uint subi = 0;
for (TMap::const_iterator subit = m_Entries.begin(), subend = m_Entries.end(); subit != subend; ++subit)
{
ostream << "\n" << pad << "Entries[" << subi << "]: ";
subit->second->toString(ostream, padpad);
++subi;
}
ostream << "} ";
}
}
void CAppData::parse(uint16 version, uint filter)
{
#if PMBS_APP_DATA_PARSE
// Cannot be parsed yet
if (!m_ChunksOwnsPointers) { nlerror("Already parsed"); return; }
// First parse all the child nodes
CStorageContainer::parse(version);
// Verify
if (m_Chunks.size() < 2) { nlwarning("Bad container size %i", m_Chunks.size()); disown(); return; }
// Header
TStorageObjectContainer::iterator it = m_Chunks.begin();
if (it->first != PMBS_APP_DATA_HEADER_CHUNK_ID) { nlwarning("Bad id %x, expected %x", (uint32)it->first, PMBS_APP_DATA_HEADER_CHUNK_ID); disown(); return; }
uint32 headerSize = static_cast<CStorageValue<uint32> *>(it->second)->Value;
++it;
// Entries
for (TStorageObjectContainer::iterator end = m_Chunks.end(); it != end; ++it)
{
if (it->first != PMBS_APP_DATA_ENTRY_CHUNK_ID) { nlwarning("Bad id %x, expected %x", (uint32)it->first, PMBS_APP_DATA_ENTRY_CHUNK_ID); disown(); return; }
CAppDataEntry *entry = static_cast<CAppDataEntry *>(it->second);
TKey key(entry->key()->ClassId, entry->key()->SuperClassId, entry->key()->SubId);
if (m_Entries.find(key) != m_Entries.end()) { nlwarning("Duplicate entry"); disown(); return; }
m_Entries[key] = entry;
}
// Verify or fail
if (m_Entries.size() != headerSize) { nlwarning("Entry count %i does not match header %i", m_Entries.size(), headerSize); disown(); return; }
// Take local ownership
m_ChunksOwnsPointers = false;
#else
CStorageContainer::parse(version);
#endif
}
void CAppData::clean()
{
#if PMBS_APP_DATA_PARSE
if (m_ChunksOwnsPointers) { nldebug("Not parsed, or disowned"); return; } // Must have local ownership
if (m_Chunks.size() == 0) { nlwarning("Already cleaned (or did not build due to coding error)"); return; } // Already cleaned
if (m_Chunks.begin()->first != PMBS_APP_DATA_HEADER_CHUNK_ID) { nlerror("Bad id %x, expected %x", (uint32)m_Chunks.begin()->first, PMBS_APP_DATA_HEADER_CHUNK_ID); return; } // Cannot happen, because we won't have local ownership if parsing failed
delete m_Chunks.begin()->second; // Delete the header chunk, since we own it
m_Chunks.clear(); // Clear the remaining chunks
// Clean raw storage
for (TMap::const_iterator subit = m_Entries.begin(), subend = m_Entries.end(); subit != subend; ++subit)
subit->second->clean();
#else
CStorageContainer::clean();
#endif
}
void CAppData::build(uint16 version, uint filter)
{
#if PMBS_APP_DATA_PARSE
// Must be clean first
if (!m_ChunksOwnsPointers && m_Chunks.size() != 0) { nlerror("Not cleaned"); return; }
if (m_Chunks.size() != 0) { nldebug("Not parsed, or disowned"); return; }
// Set up the header in the chunks container
CStorageValue<uint32> *headerSize = new CStorageValue<uint32>(); // Owned locally, not by m_Chunks
headerSize->Value = m_Entries.size();
m_Chunks.push_back(TStorageObjectWithId(PMBS_APP_DATA_HEADER_CHUNK_ID, headerSize));
// Set up the entries
for (TMap::iterator it = m_Entries.begin(), end = m_Entries.end(); it != end; ++it)
m_Chunks.push_back(TStorageObjectWithId(PMBS_APP_DATA_ENTRY_CHUNK_ID, it->second));
// Rebuild raw storage
CStorageContainer::build(version);
#else
CStorageContainer::build(version);
#endif
}
void CAppData::disown()
{
#if PMBS_APP_DATA_PARSE
if (m_ChunksOwnsPointers) { nldebug("Not parsed"); }
if (!m_ChunksOwnsPointers && (m_Chunks.size() != (m_Entries.size() + 1))) { nlerror("Not built"); return; } // If chunks is not the owner, built chunks must match the parsed data
// NOTE: m_Chunks must be valid at this point!
// Disown locally
m_Entries.clear();
// Give ownership back
m_ChunksOwnsPointers = true;
// Disown all the child chunks
CStorageContainer::disown();
#else
CStorageContainer::disown();
#endif
}
void CAppData::init()
{
// Cannot be init yet
if (!m_ChunksOwnsPointers) { nlerror("Already parsed"); return; }
if (m_Chunks.size() != 0) { nlerror("Already built or serialized"); return; }
// We own this
m_ChunksOwnsPointers = false;
}
/*
const uint8 *CAppData::read(NLMISC::CClassId classId, TSClassId superClassId, uint32 subId, uint32 &size) const
{
if (m_ChunksOwnsPointers) { nlwarning("Not parsed"); return NULL; }
TKey key(classId, superClassId, subId);
TMap::const_iterator it = m_Entries.find(key);
if (it == m_Entries.end()) { nldebug("Trying to read non-existant key, this is allowed, returning NULL"); return NULL; }
size = it->second->value()->Value.size();
return &it->second->value()->Value[0];
}
uint8 *CAppData::lock(NLMISC::CClassId classId, TSClassId superClassId, uint32 subId, uint32 capacity)
{
if (m_ChunksOwnsPointers) { nlwarning("Not parsed"); return NULL; }
TKey key(classId, superClassId, subId);
TMap::const_iterator it = m_Entries.find(key);
CAppDataEntry *appDataEntry;
if (it == m_Entries.end())
{
appDataEntry = new CAppDataEntry();
m_Entries[key] = appDataEntry;
appDataEntry->key()->ClassId = classId;
appDataEntry->key()->SuperClassId = superClassId;
appDataEntry->key()->SubId = subId;
}
else
{
appDataEntry = it->second;
}
appDataEntry->key()->Size = capacity;
appDataEntry->value()->Value.resize(capacity);
return &appDataEntry->value()->Value[0];
}
void CAppData::unlock(NLMISC::CClassId classId, TSClassId superClassId, uint32 subId, uint32 size)
{
if (m_ChunksOwnsPointers) { nlwarning("Not parsed"); return; }
TKey key(classId, superClassId, subId);
TMap::const_iterator it = m_Entries.find(key);
if (it == m_Entries.end()) { nlerror("Unlocking non-existant key"); return; }
CAppDataEntry *appDataEntry = it->second;
appDataEntry->key()->Size = size;
appDataEntry->value()->Value.resize(size);
}
void CAppData::fill(NLMISC::CClassId classId, TSClassId superClassId, uint32 subId, uint8 *buffer, uint32 size)
{
uint8 *dest = lock(classId, superClassId, subId, size);
memcpy(dest, buffer, size);
// Internally not necessary, since we sent the correct size.
// Outside classes should unlock in case the implementation changes.
// unlock(classId, superClassId, subId, size);
}
*/
void CAppData::erase(NLMISC::CClassId classId, TSClassId superClassId, uint32 subId)
{
if (m_ChunksOwnsPointers) { nlwarning("Not parsed"); return; }
TKey key(classId, superClassId, subId);
TMap::const_iterator it = m_Entries.find(key);
if (it == m_Entries.end()) { nldebug("Trying to erase non-existant key, this is allowed, doing nothing"); return; }
m_Entries.erase(key);
}
IStorageObject *CAppData::createChunkById(uint16 id, bool container)
{
switch (id)
{
case PMBS_APP_DATA_HEADER_CHUNK_ID:
nlassert(!container);
return new CStorageValue<uint32>();
break;
case PMBS_APP_DATA_ENTRY_CHUNK_ID:
nlassert(container);
return new CAppDataEntry();
break;
}
return CStorageContainer::createChunkById(id, container);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CAppDataEntryKey::CAppDataEntryKey()
{
}
CAppDataEntryKey::~CAppDataEntryKey()
{
}
std::string CAppDataEntryKey::className() const
{
return "AppDataEntryKey";
}
void CAppDataEntryKey::serial(NLMISC::IStream &stream)
{
stream.serial(ClassId);
stream.serial(SuperClassId);
stream.serial(SubId);
stream.serial(Size);
}
void CAppDataEntryKey::toString(std::ostream &ostream, const std::string &pad) const
{
ostream << "(" << className() << ") { ";
ostream << "\n" << pad << "ClassId: " << NLMISC::toString(ClassId);
ostream << "\n" << pad << "SuperClassId: " << SuperClassId;
ostream << "\n" << pad << "SubId: " << SubId;
ostream << "\n" << pad << "Size: " << Size;
ostream << " } ";
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CAppDataEntry::CAppDataEntry() : m_Key(NULL), m_Raw(NULL), m_Value(NULL)
{
}
CAppDataEntry::~CAppDataEntry()
{
delete m_Value;
m_Value = NULL;
}
std::string CAppDataEntry::className() const
{
return "AppDataEntry";
}
void CAppDataEntry::toString(std::ostream &ostream, const std::string &pad) const
{
if (m_Key && m_Value)
{
ostream << "(" << className() << ") [" << m_Chunks.size() << "] PARSED { ";
std::string padpad = pad + "\t";
ostream << "\n" << pad << "Key: ";
m_Key->toString(ostream, padpad);
ostream << "\n" << pad << "Value: ";
m_Value->toString(ostream, padpad);
ostream << "} ";
}
else
{
CStorageContainer::toString(ostream, pad);
}
}
void CAppDataEntry::parse(uint16 version, uint filter)
{
// CStorageContainer::parse(version);
// if (!m_ChunksOwnsPointers) { nlwarning("Already parsed"); return; }
if (m_Chunks.size() != 2) { nlwarning("Bad container size"); disown(); return; }
TStorageObjectContainer::iterator it = m_Chunks.begin();
if (it->first != PMBS_APP_DATA_ENTRY_KEY_CHUNK_ID) { nlwarning("Bad id %x, expected %x", (uint32)it->first, PMBS_APP_DATA_ENTRY_KEY_CHUNK_ID); disown(); return; }
m_Key = static_cast<CAppDataEntryKey *>(it->second);
++it;
if (it->first != PMBS_APP_DATA_ENTRY_VALUE_CHUNK_ID) { nlwarning("Bad id %x, expected %x", (uint32)it->first, PMBS_APP_DATA_ENTRY_VALUE_CHUNK_ID); disown(); return; }
m_Raw = static_cast<CStorageRaw *>(it->second);
// m_ChunksOwnsPointers = false;
nlassert(m_ChunksOwnsPointers); // Never set false here
}
void CAppDataEntry::clean()
{
// CStorageContainer::clean();
if (m_Value)
{
nlassert(m_Raw);
m_Raw->Value.resize(0);
m_Key->Size = 0xFFFFFFFF;
}
}
void CAppDataEntry::build(uint16 version, uint filter)
{
// CStorageContainer::build(version);
if (m_Value)
{
nlassert(m_Raw);
NLMISC::CMemStream mem;
m_Value->serial(mem);
m_Raw->setSize(mem.getPos());
mem.invert();
m_Raw->serial(mem);
m_Key->Size = m_Raw->Value.size();
}
}
void CAppDataEntry::disown()
{
// CStorageContainer::disown();
if (m_Chunks.size() != 2) { nlerror("Not built"); return; } // Built chunks must match the parsed data
m_Key = NULL;
m_Raw = NULL;
delete m_Value;
m_Value = NULL;
}
void CAppDataEntry::init()
{
nlassert(m_Chunks.size() == 0);
m_Key = new CAppDataEntryKey();
m_Chunks.push_back(TStorageObjectWithId(PMBS_APP_DATA_ENTRY_KEY_CHUNK_ID, m_Key));
m_Raw = new CStorageRaw();
m_Chunks.push_back(TStorageObjectWithId(PMBS_APP_DATA_ENTRY_VALUE_CHUNK_ID, m_Raw));
}
IStorageObject *CAppDataEntry::createChunkById(uint16 id, bool container)
{
switch (id)
{
case PMBS_APP_DATA_ENTRY_KEY_CHUNK_ID:
nlassert(!container);
return new CAppDataEntryKey();
case PMBS_APP_DATA_ENTRY_VALUE_CHUNK_ID:
nlassert(!container);
return new CStorageRaw();
}
return CStorageContainer::createChunkById(id, container);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
} /* namespace STORAGE */
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,275 @@
/**
* \file app_data.h
* \brief CAppData
* \date 2012-08-21 11:47GMT
* \author Jan Boon (Kaetemi)
* CAppData
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_APP_DATA_H
#define PIPELINE_APP_DATA_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
#include <nel/misc/class_id.h>
#include <nel/misc/mem_stream.h>
// Project includes
#include "../../typedefs.h"
#include "../../storage_object.h"
#include "../../storage_value.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
namespace STORAGE {
#define PMBS_APP_DATA_CHUNK_ID 0x2150
#define PMBS_APP_DATA_ENTRY_VALUE_CHUNK_ID 0x0130
class CAppDataEntry;
/**
* \brief CAppData
* \date 2012-08-21 11:47GMT
* \author Jan Boon (Kaetemi)
* This implements the AppData chunk in the storage
*/
class CAppData : public CStorageContainer
{
public:
struct TKey
{
TKey(NLMISC::CClassId classId, TSClassId superClassId, uint32 subId);
NLMISC::CClassId ClassId;
TSClassId SuperClassId;
uint32 SubId;
bool operator<(const TKey &right) const;
bool operator>(const TKey &right) const;
bool operator==(const TKey &right) const;
};
typedef std::map<TKey, CAppDataEntry *> TMap;
public:
CAppData();
virtual ~CAppData();
// inherited
virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
// init
/// Initialize a new instance of this chunk
void init();
// public // TODO: Simplify using templates and returning a specialized storage object, auto-converted to the requested type.
/*/// Gets a pointer to an appdata chunk buffer. Returns NULL if it does not exist. Size is returned in the size parameter.
const uint8 *read(NLMISC::CClassId classId, TSClassId superClassId, uint32 subId, uint32 &size) const;
/// Locks a pointer to an appdata chunk buffer for writing to with specified capacity. May return NULL if this chunk is unparsable or no memory can be allocated.
uint8 *lock(NLMISC::CClassId classId, TSClassId superClassId, uint32 subId, uint32 capacity);
/// Unlocks a pointer to an appdata chunk buffer, setting the final written size.
void unlock(NLMISC::CClassId classId, TSClassId superClassId, uint32 subId, uint32 size);
/// Fills an appdata chunk buffer with specified data, which will be copied.
void fill(NLMISC::CClassId classId, TSClassId superClassId, uint32 subId, uint8 *buffer, uint32 size);
/// Erases an appdata chunk.
void erase(NLMISC::CClassId classId, TSClassId superClassId, uint32 subId);*/
// public
/// Gets an appdata chunk storage object, returns NULL if it does not exist
template <typename T>
T *get(NLMISC::CClassId classId, TSClassId superClassId, uint32 subId);
/// Gets or creates a chunk storage object
template <typename T>
T *getOrCreate(NLMISC::CClassId classId, TSClassId superClassId, uint32 subId);
/// Erases an appdata chunk.
void erase(NLMISC::CClassId classId, TSClassId superClassId, uint32 subId);
// read access
/// Return the entries map, do not modify directly
inline const TMap &entries() const { return m_Entries; }
protected:
virtual IStorageObject *createChunkById(uint16 id, bool container);
private:
TMap m_Entries;
}; /* class CAppData */
/**
* \brief CAppDataEntryKey
* \date 2012-08-18 18:01GMT
* \author Jan Boon (Kaetemi)
* CAppDataEntryKey
*/
class CAppDataEntryKey : public IStorageObject
{
public:
CAppDataEntryKey();
virtual ~CAppDataEntryKey();
// public data
NLMISC::CClassId ClassId;
TSClassId SuperClassId;
uint32 SubId;
uint32 Size;
// inherited
virtual std::string className() const;
virtual void serial(NLMISC::IStream &stream);
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
}; /* class CAppDataEntryKey */
/**
* \brief CAppDataEntry
* \date 2012-08-21 11:47GMT
* \author Jan Boon (Kaetemi)
* This implements an entry in the AppData chunk in the storage
*/
class CAppDataEntry : public CStorageContainer
{
public:
friend class CAppData;
public:
CAppDataEntry();
virtual ~CAppDataEntry();
// inherited
virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
// public
// Initializes a new entry
void init();
// Returns the key
inline CAppDataEntryKey *key() { return m_Key; }
// Returns the value
template <typename T>
T *value();
protected:
virtual IStorageObject *createChunkById(uint16 id, bool container);
private:
CAppDataEntryKey *m_Key;
CStorageRaw *m_Raw;
IStorageObject *m_Value;
}; /* class CAppDataEntry */
template <typename T>
T *CAppDataEntry::value()
{
if (m_Value)
{
T *result = dynamic_cast<T *>(m_Value);
if (result)
{
return result;
}
else
{
nlwarning("AppData value has already been cast to another type, recasting, the previous chunk becomes invalid, this may not be intended");
NLMISC::CMemStream mem;
m_Value->serial(mem);
result = new T();
result->setSize(mem.getPos());
mem.invert();
delete m_Value;
m_Value = result;
result->serial(mem);
return result;
}
}
else
{
nlassert(!m_Value);
nlassert(m_Raw);
// nldebug("Casting raw to user type");
NLMISC::CMemStream mem;
m_Raw->serial(mem);
T *result = new T();
result->setSize(mem.getPos());
// nldebug("Read %i", mem.getPos());
mem.invert();
m_Raw->Value.resize(0);
m_Key->Size = 0xFFFFFFFF;
m_Value = result;
result->serial(mem);
// nldebug("Wrote %i", mem.getPos());
return result;
}
}
template <typename T>
T *CAppData::get(NLMISC::CClassId classId, TSClassId superClassId, uint32 subId)
{
if (m_ChunksOwnsPointers) { nlwarning("Not parsed"); return NULL; }
TKey key(classId, superClassId, subId);
TMap::const_iterator it = m_Entries.find(key);
if (it == m_Entries.end()) { nldebug("Trying to read non-existant key, this is allowed, returning NULL"); return NULL; }
return it->second->value<T>();
}
template <typename T>
T *CAppData::getOrCreate(NLMISC::CClassId classId, TSClassId superClassId, uint32 subId)
{
if (m_ChunksOwnsPointers) { nlwarning("Not parsed"); return NULL; }
TKey key(classId, superClassId, subId);
TMap::const_iterator it = m_Entries.find(key);
CAppDataEntry *appDataEntry;
if (it == m_Entries.end())
{
appDataEntry = new CAppDataEntry();
appDataEntry->init();
m_Entries[key] = appDataEntry;
appDataEntry->key()->ClassId = classId;
appDataEntry->key()->SuperClassId = superClassId;
appDataEntry->key()->SubId = subId;
}
else
{
appDataEntry = it->second;
}
return appDataEntry->value<T>();
}
} /* namespace STORAGE */
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_APP_DATA_H */
/* end of file */

@ -0,0 +1,332 @@
/**
* \file geom_buffers.cpp
* \brief CGeomBuffers
* \date 2012-08-25 07:55GMT
* \author Jan Boon (Kaetemi)
* CGeomBuffers
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "geom_buffers.h"
// STL includes
#include <sstream>
// NeL includes
// #include <nel/misc/debug.h>s
// Project includes
#include "../../storage_array.h"
// using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
namespace STORAGE {
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
#define PMBS_GEOM_BUFFERS_PARSE 0
// Elevate warnings to errors in this file for stricter reading
#undef nlwarning
#define nlwarning nlerror
// Elevate debug to error in this file for debugging
// #undef nldebug
// #define nldebug nlerror
// Chunk identifiers
#define PMBS_GEOM_BUFFERS_TRI_A_VERTEX_CHUNK_ID 0x0914
#define PMBS_GEOM_BUFFERS_TRI_A_INDEX_CHUNK_ID 0x0912
#define PMBS_GEOM_BUFFERS_TRI_B_VERTEX_CHUNK_ID 0x0916
#define PMBS_GEOM_BUFFERS_TRI_B_INDEX_CHUNK_ID 0x0918
#define PMBS_GEOM_BUFFERS_TRI_C_VERTEX_CHUNK_ID 0x0938
#define PMBS_GEOM_BUFFERS_TRI_C_INDEX_CHUNK_ID 0x0942
#define PBMS_GEOM_BUFFERS_POLY_A_VERTEX_CHUNK_ID 0x0100
#define PBMS_GEOM_BUFFERS_POLY_A_EDGE_CHUNK_ID 0x010a
#define PBMS_GEOM_BUFFERS_POLY_A_FACE_CHUNK_ID 0x011a
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
void CGeomTriIndex::serial(NLMISC::IStream &stream)
{
stream.serial(a);
stream.serial(b);
stream.serial(c);
}
std::string CGeomTriIndex::toString() const
{
std::stringstream ss;
ss << a << " " << b << " " << c;
return ss.str();
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
void CGeomTriIndexInfo::serial(NLMISC::IStream &stream)
{
stream.serial(a);
stream.serial(b);
stream.serial(c);
stream.serial(alwaysOne);
stream.serial(smoothingGroups);
}
std::string CGeomTriIndexInfo::toString() const
{
std::stringstream ss;
ss << a << " " << b << " " << c << ", " << alwaysOne << " " << smoothingGroups;
return ss.str();
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
void CGeomPolyVertexInfo::serial(NLMISC::IStream &stream)
{
stream.serial(i1);
stream.serial(v);
}
std::string CGeomPolyVertexInfo::toString() const
{
std::stringstream ss;
ss << "0x" << NLMISC::toString("%x", i1) << ", " << v.toString();
return ss.str();
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
void CGeomPolyEdgeInfo::serial(NLMISC::IStream &stream)
{
stream.serial(i1);
stream.serial(a);
stream.serial(b);
}
std::string CGeomPolyEdgeInfo::toString() const
{
std::stringstream ss;
ss << "0x" << NLMISC::toString("%x", i1) << ", " << a << " " << b;
return ss.str();
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CGeomPolyFaceInfo::CGeomPolyFaceInfo() : I1(0), Material(0), SmoothingGroups(0)
{
}
void CGeomPolyFaceInfo::serial(NLMISC::IStream &stream)
{
// nldebug("go");
stream.serialCont(Vertices);
// nldebug("%i vertices", Vertices.size());
uint16 bitfield;
if (!stream.isReading())
{
/*nldebug("writing");*/
bitfield = 0x0000;
if (I1) bitfield |= 0x0001;
// bitfield |= 0x0002;
// bitfield |= 0x0004;
if (Material) bitfield |= 0x0008;
if (SmoothingGroups) bitfield |= 0x0010;
if (Triangulation.size()) bitfield |= 0x0020;
// bitfield |= 0x0040;
// bitfield |= 0x0080;
}
stream.serial(bitfield);
// nldebug("bitfield 0x%x", (uint32)bitfield);
if (bitfield & 0x0001) { /*nldebug("i1");*/ stream.serial(I1); nlassert(I1); bitfield &= ~0x0001; }
else I1 = 0;
if (bitfield & 0x0008) { /*nldebug("material");*/ stream.serial(Material); nlassert(Material); bitfield &= ~0x0008; }
else Material = 0;
if (bitfield & 0x0010) { /*nldebug("smoothing");*/ stream.serial(SmoothingGroups); nlassert(SmoothingGroups); bitfield &= ~0x0010; }
else SmoothingGroups = 0;
if (bitfield & 0x0020)
{
/*nldebug("triangles");*/
if (stream.isReading()) Triangulation.resize(Vertices.size() - 3);
else nlassert(Triangulation.size() == Vertices.size() - 3);
for (std::vector<std::pair<uint32, uint32> >::size_type i = 0; i < Triangulation.size(); ++i)
{
stream.serial(Triangulation[i].first);
/*nldebug("cut from %i", Triangulation[i].first);*/
nlassert(Triangulation[i].first < Vertices.size());
stream.serial(Triangulation[i].second);
/*nldebug("to %i", Triangulation[i].second);*/
nlassert(Triangulation[i].second < Vertices.size());
}
nlassert(Triangulation.size());
bitfield &= ~0x0020;
}
if (bitfield) nlerror("Remaining bitfield value 0x%x, please debug and implement", (uint32)bitfield);
}
std::string CGeomPolyFaceInfo::toString() const
{
std::stringstream ss;
ss << "( ";
for (std::vector<uint32>::size_type i = 0; i < Vertices.size(); ++i)
{
ss << Vertices[i] << " ";
}
ss << ")";
if (I1) ss << ", I1: " << "0x" << NLMISC::toString("%x", I1);
if (Material) ss << ", M: " << Material;
if (SmoothingGroups) ss << ", S: " << SmoothingGroups;
if (Triangulation.size())
{
ss << ", ( ";
for (std::vector<std::pair<uint32, uint32> >::size_type i = 0; i < Triangulation.size(); ++i)
{
ss << Triangulation[i].first << ":" << Triangulation[i].second << " ";
}
ss << ")";
}
ss << " ";
return ss.str();
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CGeomBuffers::CGeomBuffers()
{
}
CGeomBuffers::~CGeomBuffers()
{
}
std::string CGeomBuffers::className() const
{
return "GeomBuffers";
}
void CGeomBuffers::toString(std::ostream &ostream, const std::string &pad) const
{
CStorageContainer::toString(ostream, pad);
}
void CGeomBuffers::parse(uint16 version, uint filter)
{
#if PMBS_GEOM_BUFFERS_PARSE
CStorageContainer::parse(version);
#else
CStorageContainer::parse(version);
#endif
}
void CGeomBuffers::clean()
{
#if PMBS_GEOM_BUFFERS_PARSE
CStorageContainer::clean();
#else
CStorageContainer::clean();
#endif
}
void CGeomBuffers::build(uint16 version, uint filter)
{
#if PMBS_GEOM_BUFFERS_PARSE
CStorageContainer::build(version);
#else
CStorageContainer::build(version);
#endif
}
void CGeomBuffers::disown()
{
#if PMBS_GEOM_BUFFERS_PARSE
CStorageContainer::disown();
#else
CStorageContainer::disown();
#endif
}
IStorageObject *CGeomBuffers::createChunkById(uint16 id, bool container)
{
#if PMBS_GEOM_BUFFERS_PARSE
switch (id)
{
// nlassert(!container);
// return new CStorageArray<float>();
//case PBMS_GEOM_BUFFERS_POLY_A_INDEX_B_CHUNK_ID:
// nlassert(!container);
// return new CStorageArray<uint32>();
case PBMS_GEOM_BUFFERS_POLY_A_VERTEX_CHUNK_ID:
nlassert(!container);
return new CStorageArraySizePre<CGeomPolyVertexInfo>();
case PBMS_GEOM_BUFFERS_POLY_A_EDGE_CHUNK_ID:
nlassert(!container);
return new CStorageArraySizePre<CGeomPolyEdgeInfo>();
case PBMS_GEOM_BUFFERS_POLY_A_FACE_CHUNK_ID:
nlassert(!container);
return new CStorageArrayDynSize<CGeomPolyFaceInfo>();
case PMBS_GEOM_BUFFERS_TRI_B_INDEX_CHUNK_ID:
case PMBS_GEOM_BUFFERS_TRI_C_INDEX_CHUNK_ID:
nlassert(!container);
return new CStorageArray<CGeomTriIndex>(); // nb: parse should check if the sizes match with tri_a size (which is the master index buffer)
case PMBS_GEOM_BUFFERS_TRI_A_INDEX_CHUNK_ID:
nlassert(!container);
return new CStorageArraySizePre<CGeomTriIndexInfo>();
case PMBS_GEOM_BUFFERS_TRI_A_VERTEX_CHUNK_ID:
case PMBS_GEOM_BUFFERS_TRI_B_VERTEX_CHUNK_ID:
case PMBS_GEOM_BUFFERS_TRI_C_VERTEX_CHUNK_ID:
nlassert(!container);
return new CStorageArraySizePre<NLMISC::CVector>();
}
#endif
return CStorageContainer::createChunkById(id, container);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
} /* namespace STORAGE */
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,134 @@
/**
* \file geom_buffers.h
* \brief CGeomBuffers
* \date 2012-08-25 07:55GMT
* \author Jan Boon (Kaetemi)
* CGeomBuffers
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_GEOM_BUFFERS_H
#define PIPELINE_GEOM_BUFFERS_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
#include <nel/misc/vector.h>
// Project includes
#include "../../storage_object.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
namespace STORAGE {
struct CGeomTriIndex
{
uint32 a;
uint32 b;
uint32 c;
void serial(NLMISC::IStream &stream);
std::string toString() const;
};
struct CGeomTriIndexInfo
{
uint32 a;
uint32 b;
uint32 c;
uint32 alwaysOne;
uint32 smoothingGroups;
void serial(NLMISC::IStream &stream);
std::string toString() const;
};
struct CGeomPolyVertexInfo
{
uint32 i1;
NLMISC::CVector v;
void serial(NLMISC::IStream &stream);
std::string toString() const;
};
struct CGeomPolyEdgeInfo
{
uint32 i1;
uint32 a;
uint32 b;
void serial(NLMISC::IStream &stream);
std::string toString() const;
};
struct CGeomPolyFaceInfo
{
CGeomPolyFaceInfo();
/// Vertex indices in the vertex buffer
std::vector<uint32> Vertices;
// Bitfield (implicitly stored)
/// Unknown 01 00 01 00
uint32 I1;
// Unknown?
// Unknown?
/// Material index in multi-submat
uint16 Material;
/// Bitfield with smoothing groups
uint32 SmoothingGroups;
/// Cuts at local vertex index to local vertex index
std::vector<std::pair<uint32, uint32> > Triangulation;
void serial(NLMISC::IStream &stream);
std::string toString() const;
};
/**
* \brief CGeomBuffers
* \date 2012-08-25 07:55GMT
* \author Jan Boon (Kaetemi)
* CGeomBuffers
*/
class CGeomBuffers : public CStorageContainer
{
public:
CGeomBuffers();
virtual ~CGeomBuffers();
// inherited
virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
protected:
virtual IStorageObject *createChunkById(uint16 id, bool container);
}; /* class CGeomBuffers */
} /* namespace STORAGE */
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_GEOM_BUFFERS_H */
/* end of file */

@ -0,0 +1,59 @@
/**
* \file super_class_unknown.cpp
* \brief CSuperClassUnknown
* \date 2012-08-22 08:59GMT
* \author Jan Boon (Kaetemi)
* CSuperClassUnknown
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "super_class_unknown.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CSuperClassUnknown::CSuperClassUnknown()
{
}
CSuperClassUnknown::~CSuperClassUnknown()
{
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,67 @@
/**
* \file super_class_unknown.h
* \brief CSuperClassUnknown
* \date 2012-08-22 08:59GMT
* \author Jan Boon (Kaetemi)
* CSuperClassUnknown
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_SUPER_CLASS_UNKNOWN_H
#define PIPELINE_SUPER_CLASS_UNKNOWN_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CSuperClassUnknown
* \date 2012-08-22 08:59GMT
* \author Jan Boon (Kaetemi)
* CSuperClassUnknown
*/
class CSuperClassUnknown
{
protected:
// pointers
// ...
// instances
// ...
public:
CSuperClassUnknown();
virtual ~CSuperClassUnknown();
}; /* class CSuperClassUnknown */
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_SUPER_CLASS_UNKNOWN_H */
/* end of file */

@ -0,0 +1,59 @@
/**
* \file texmap.cpp
* \brief CTexmap
* \date 2012-08-22 08:56GMT
* \author Jan Boon (Kaetemi)
* CTexmap
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "texmap.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CTexmap::CTexmap(CScene *scene) : CMtlBase(scene)
{
}
CTexmap::~CTexmap()
{
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,63 @@
/**
* \file texmap.h
* \brief CTexmap
* \date 2012-08-22 08:56GMT
* \author Jan Boon (Kaetemi)
* CTexmap
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_TEXMAP_H
#define PIPELINE_TEXMAP_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "mtl_base.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CTexmap
* \date 2012-08-22 08:56GMT
* \author Jan Boon (Kaetemi)
* CTexmap
*/
class CTexmap : public CMtlBase
{
public:
CTexmap(CScene *scene);
virtual ~CTexmap();
}; /* class CTexmap */
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_TEXMAP_H */
/* end of file */

@ -0,0 +1,192 @@
/**
* \file track_view_node.cpp
* \brief CTrackViewNode
* \date 2012-08-24 09:44GMT
* \author Jan Boon (Kaetemi)
* CTrackViewNode
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "track_view_node.h"
// STL includes
#include <iomanip>
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
#define PMB_TVNODE_EMPTY0140_CHUNK_ID 0x0140
#define PMB_TVNODE_EMPTY0150_CHUNK_ID 0x0150
#define PMB_TVNODE_DISPLAYNAME_CHUNK_ID 0x0110
#define PMB_TVNODE_IDENTIFIER_CHUNK_ID 0x0120
#define PMB_TVNODE_ISNOTNODE_CHUNK_ID 0x0130
CTrackViewNode::CTrackViewNode(CScene *scene) : CReferenceTarget(scene), m_Empty0140(NULL), m_Empty0150(NULL)
{
}
CTrackViewNode::~CTrackViewNode()
{
}
const ucstring CTrackViewNode::DisplayName = ucstring("TVNode");
const char *CTrackViewNode::InternalName = "TrackViewNode";
const NLMISC::CClassId CTrackViewNode::ClassId = NLMISC::CClassId(0x8d73b8aa, 0x90f2ee71);
const TSClassId CTrackViewNode::SuperClassId = CReferenceTarget::SuperClassId;
const CTrackViewNodeClassDesc TrackViewNodeClassDesc(&DllPluginDescBuiltin);
void CTrackViewNode::parse(uint16 version, uint filter)
{
CReferenceTarget::parse(version);
if (!m_ChunksOwnsPointers)
{
// Read unknown chunks
m_Empty0140 = static_cast<CStorageRaw *>(getChunk(PMB_TVNODE_EMPTY0140_CHUNK_ID));
if (m_Empty0140) nlassert(m_Empty0140->Value.empty());
m_Empty0150 = static_cast<CStorageRaw *>(getChunk(PMB_TVNODE_EMPTY0150_CHUNK_ID));
if (m_Empty0150) nlassert(m_Empty0140->Value.empty());
// Read child nodes
for (std::vector<TChild>::size_type i = 0; i < m_Children.size(); ++i)
{
m_Children[i].DisplayName = getChunkValue<ucstring>(PMB_TVNODE_DISPLAYNAME_CHUNK_ID);
m_Children[i].Identifier = getChunkValue<NLMISC::CClassId>(PMB_TVNODE_IDENTIFIER_CHUNK_ID);
m_Children[i].IsNotAnotherNode = getChunkValue<sint32>(PMB_TVNODE_ISNOTNODE_CHUNK_ID);
}
}
}
void CTrackViewNode::clean()
{
CReferenceTarget::clean();
}
void CTrackViewNode::build(uint16 version, uint filter)
{
CReferenceTarget::build(version);
// Write unknown chunks
if (m_Empty0140) putChunk(PMB_TVNODE_EMPTY0140_CHUNK_ID, m_Empty0140);
if (m_Empty0150) putChunk(PMB_TVNODE_EMPTY0150_CHUNK_ID, m_Empty0150);
// Write child nodes
for (std::vector<TChild>::size_type i = 0; i < m_Children.size(); ++i)
{
putChunkValue(PMB_TVNODE_DISPLAYNAME_CHUNK_ID, m_Children[i].DisplayName);
putChunkValue(PMB_TVNODE_IDENTIFIER_CHUNK_ID, m_Children[i].Identifier);
putChunkValue(PMB_TVNODE_ISNOTNODE_CHUNK_ID, m_Children[i].IsNotAnotherNode);
}
}
void CTrackViewNode::disown()
{
m_Children.clear();
CReferenceTarget::disown();
}
void CTrackViewNode::init()
{
CReferenceTarget::init();
}
bool CTrackViewNode::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return CReferenceTarget::inherits(classId);
}
const ISceneClassDesc *CTrackViewNode::classDesc() const
{
return &TrackViewNodeClassDesc;
}
void CTrackViewNode::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{
CReferenceTarget::toStringLocal(ostream, pad);
if (m_Empty0140) ostream << "\n" << pad << "Empty 0x0140 ";
if (m_Empty0150) ostream << "\n" << pad << "Empty 0x0150 ";
// std::string padpad = pad + "\t";
for (std::vector<TChild>::size_type i = 0; i < m_Children.size(); ++i)
{
CReferenceMaker *referenceMaker = m_Children[i].Reference;
nlassert(referenceMaker);
ostream << "\n" << pad << i << ": <ptr=0x";
{
std::stringstream ss;
ss << std::hex << std::setfill('0');
ss << std::setw(16) << (uint64)(void *)referenceMaker;
ostream << ss.str();
}
ostream << "> ";
ostream << "(" << ucstring(referenceMaker->classDesc()->displayName()).toUtf8() << ", " << referenceMaker->classDesc()->classId().toString() << ") ";
ostream << "(" << m_Children[i].DisplayName.toUtf8() << ", " << m_Children[i].Identifier.toString() << ", " << (m_Children[i].IsNotAnotherNode ? "ENTRY" : "TVNODE") << ") ";
}
}
CReferenceMaker *CTrackViewNode::getReference(uint index) const
{
if (m_Children.size() <= index) return NULL;
return m_Children[index].Reference;
}
void CTrackViewNode::setReference(uint index, CReferenceMaker *reference)
{
if (m_Children.size() <= index) m_Children.resize(index + 1);
m_Children[index].Reference = reference;
}
uint CTrackViewNode::nbReferences() const
{
return m_Children.size();
}
IStorageObject *CTrackViewNode::createChunkById(uint16 id, bool container)
{
switch (id)
{
case PMB_TVNODE_DISPLAYNAME_CHUNK_ID:
return new CStorageValue<ucstring>();
case PMB_TVNODE_IDENTIFIER_CHUNK_ID:
return new CStorageValue<NLMISC::CClassId>();
case PMB_TVNODE_ISNOTNODE_CHUNK_ID:
return new CStorageValue<sint32>();
}
return CReferenceTarget::createChunkById(id, container);
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,109 @@
/**
* \file track_view_node.h
* \brief CTrackViewNode
* \date 2012-08-24 09:44GMT
* \author Jan Boon (Kaetemi)
* CTrackViewNode
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_TRACK_VIEW_NODE_H
#define PIPELINE_TRACK_VIEW_NODE_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "reference_target.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CTrackViewNode
* \date 2012-08-24 09:44GMT
* \author Jan Boon (Kaetemi)
* TVNode
*/
class CTrackViewNode : public CReferenceTarget
{
public:
struct TChild
{
TChild() : IsNotAnotherNode(0) { }
NLMISC::CRefPtr<CReferenceMaker> Reference;
ucstring DisplayName;
NLMISC::CClassId Identifier;
sint32 IsNotAnotherNode;
};
CTrackViewNode(CScene *scene);
virtual ~CTrackViewNode();
// class desc
static const ucstring DisplayName;
static const char *InternalName;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
// inherited
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
// reference maker
virtual CReferenceMaker *getReference(uint index) const;
virtual void setReference(uint index, CReferenceMaker *reference);
virtual uint nbReferences() const;
// read access
inline const std::vector<TChild> &children() const { return m_Children; }
protected:
// inherited
virtual IStorageObject *createChunkById(uint16 id, bool container);
private:
CStorageRaw *m_Empty0140;
CStorageRaw *m_Empty0150;
std::vector<TChild> m_Children;
}; /* class CTrackViewNode */
typedef CSceneClassDesc<CTrackViewNode> CTrackViewNodeClassDesc;
extern const CTrackViewNodeClassDesc TrackViewNodeClassDesc;
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_TRACK_VIEW_NODE_H */
/* end of file */

@ -0,0 +1,147 @@
/**
* \file tri_object.cpp
* \brief CTriObject
* \date 2012-08-22 08:58GMT
* \author Jan Boon (Kaetemi)
* CTriObject
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "tri_object.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CTriObject::CTriObject(CScene *scene) : CGeomObject(scene)
{
}
CTriObject::~CTriObject()
{
}
const ucstring CTriObject::DisplayName = ucstring("TriObject");
const char *CTriObject::InternalName = "TriObject";
const NLMISC::CClassId CTriObject::ClassId = NLMISC::CClassId(0x4553fa6, 0x30f8421e); /* Not official, please correct */
const TSClassId CTriObject::SuperClassId = CGeomObject::SuperClassId;
const CTriObjectClassDesc TriObjectClassDesc(&DllPluginDescBuiltin);
void CTriObject::parse(uint16 version, uint filter)
{
if (filter == 0)
{
CGeomObject::parse(version);
}
else if (filter == PMB_TRI_OBJECT_PARSE_FILTER)
{
if (!m_ChunksOwnsPointers)
{
CGeomObject::parse(version, PMB_GEOM_OBJECT_PARSE_FILTER);
// 0x0901
// 0x0902
// 0x0904
// 0x0903
}
}
}
void CTriObject::clean()
{
CGeomObject::clean();
}
void CTriObject::build(uint16 version, uint filter)
{
if (filter == 0)
{
CGeomObject::build(version);
}
else if (filter == PMB_TRI_OBJECT_PARSE_FILTER)
{
CGeomObject::build(version, PMB_GEOM_OBJECT_PARSE_FILTER);
// 0x0901
// 0x0902
// 0x0904
// 0x0903
}
}
void CTriObject::disown()
{
CGeomObject::disown();
}
void CTriObject::init()
{
CGeomObject::init();
}
bool CTriObject::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return CGeomObject::inherits(classId);
}
const ISceneClassDesc *CTriObject::classDesc() const
{
return &TriObjectClassDesc;
}
void CTriObject::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{
if (filter == 0)
{
CGeomObject::toStringLocal(ostream, pad);
}
else if (filter == PMB_TRI_OBJECT_PARSE_FILTER)
{
CGeomObject::toStringLocal(ostream, pad, PMB_GEOM_OBJECT_PARSE_FILTER);
// 0x0901
// 0x0902
// 0x0904
// 0x0903
}
}
IStorageObject *CTriObject::createChunkById(uint16 id, bool container)
{
return CGeomObject::createChunkById(id, container);
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,90 @@
/**
* \file tri_object.h
* \brief CTriObject
* \date 2012-08-22 08:58GMT
* \author Jan Boon (Kaetemi)
* CTriObject
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_TRI_OBJECT_H
#define PIPELINE_TRI_OBJECT_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "geom_object.h"
/// Must be passed to the parse and build functions by
/// inheriting classes to parse the actual tri object.
#define PMB_TRI_OBJECT_PARSE_FILTER 0x38f55e43
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CTriObject
* \date 2012-08-22 08:58GMT
* \author Jan Boon (Kaetemi)
* CTriObject
*/
class CTriObject : public CGeomObject
{
public:
CTriObject(CScene *scene);
virtual ~CTriObject();
// class desc
static const ucstring DisplayName;
static const char *InternalName;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
// inherited
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
protected:
// inherited
virtual IStorageObject *createChunkById(uint16 id, bool container);
}; /* class CTriObject */
typedef CSceneClassDesc<CTriObject> CTriObjectClassDesc;
extern const CTriObjectClassDesc TriObjectClassDesc;
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_TRI_OBJECT_H */
/* end of file */

@ -0,0 +1,203 @@
/**
* \file class_data.cpp
* \brief CClassData
* \date 2012-08-18 19:24GMT
* \author Jan Boon (Kaetemi)
* CClassData
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "class_data.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CClassData::CClassData()
{
}
CClassData::~CClassData()
{
}
std::string CClassData::className() const
{
return "ClassData";
}
void CClassData::toString(std::ostream &ostream, const std::string &pad) const
{
CStorageContainer::toString(ostream, pad);
}
void CClassData::parse(uint16 version, uint filter)
{
CStorageContainer::parse(version);
}
void CClassData::clean()
{
CStorageContainer::clean();
}
void CClassData::build(uint16 version, uint filter)
{
CStorageContainer::build(version);
}
void CClassData::disown()
{
CStorageContainer::disown();
}
IStorageObject *CClassData::createChunkById(uint16 id, bool container)
{
if (container)
{
switch (id)
{
case 0x2100: // ClassDataEntry
return new CClassDataEntry();
}
}
return CStorageContainer::createChunkById(id, container);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CClassDataEntry::CClassDataEntry()
{
}
CClassDataEntry::~CClassDataEntry()
{
}
std::string CClassDataEntry::className() const
{
return "ClassDataEntry";
}
void CClassDataEntry::toString(std::ostream &ostream, const std::string &pad) const
{
CStorageContainer::toString(ostream, pad);
}
void CClassDataEntry::parse(uint16 version, uint filter)
{
CStorageContainer::parse(version);
}
void CClassDataEntry::clean()
{
CStorageContainer::clean();
}
void CClassDataEntry::build(uint16 version, uint filter)
{
CStorageContainer::build(version);
}
void CClassDataEntry::disown()
{
CStorageContainer::disown();
}
IStorageObject *CClassDataEntry::createChunkById(uint16 id, bool container)
{
if (!container)
{
switch (id)
{
case 0x2110: // ClassDataHeader
return new CClassDataHeader();
}
}
switch (id)
{
case 0x2120: // ClassDataBody: Depends on the ClassDataHeader: TODO
return CStorageContainer::createChunkById(id, container);
}
return CStorageContainer::createChunkById(id, container);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CClassDataHeader::CClassDataHeader()
{
}
CClassDataHeader::~CClassDataHeader()
{
}
std::string CClassDataHeader::className() const
{
return "ClassDataHeader";
}
void CClassDataHeader::serial(NLMISC::IStream &stream)
{
stream.serial(ClassID);
stream.serial(SuperClassID);
}
void CClassDataHeader::toString(std::ostream &ostream, const std::string &pad) const
{
ostream << "(" << className() << ") { ";
ostream << "\n" << pad << "ClassID: " << NLMISC::toString(ClassID);
ostream << "\n" << pad << "SuperClassID: " << SuperClassID;
ostream << " } ";
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,122 @@
/**
* \file class_data.h
* \brief CClassData
* \date 2012-08-18 19:24GMT
* \author Jan Boon (Kaetemi)
* CClassData
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_CLASS_DATA_H
#define PIPELINE_CLASS_DATA_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
#include <nel/misc/class_id.h>
// Project includes
#include "storage_object.h"
#include "storage_value.h"
namespace PIPELINE {
namespace MAX {
/**
* \brief CClassData
* \date 2012-08-18 19:24GMT
* \author Jan Boon (Kaetemi)
* CClassData
*/
class CClassData : public CStorageContainer
{
public:
CClassData();
virtual ~CClassData();
// inherited
virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
protected:
virtual IStorageObject *createChunkById(uint16 id, bool container);
}; /* class CClassData */
/**
* \brief CClassDataEntry
* \date 2012-08-18 18:01GMT
* \author Jan Boon (Kaetemi)
* CClassDataEntry
*/
class CClassDataEntry : public CStorageContainer
{
public:
CClassDataEntry();
virtual ~CClassDataEntry();
// inherited
virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
protected:
virtual IStorageObject *createChunkById(uint16 id, bool container);
}; /* class CClassDataEntry */
/**
* \brief CClassDataHeader
* \date 2012-08-18 18:01GMT
* \author Jan Boon (Kaetemi)
* CClassDataHeader
*/
class CClassDataHeader : public IStorageObject
{
public:
CClassDataHeader();
virtual ~CClassDataHeader();
// public data
NLMISC::CClassId ClassID;
uint32 SuperClassID;
// inherited
virtual std::string className() const;
virtual void serial(NLMISC::IStream &stream);
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
}; /* class CClassDataHeader */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_CLASS_DATA_H */
/* end of file */

@ -0,0 +1,430 @@
/**
* \file class_directory_3.cpp
* \brief CClassDirectory3
* \date 2012-08-18 18:01GMT
* \author Jan Boon (Kaetemi)
* CClassDirectory3
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "class_directory_3.h"
// STL includes
#include <iomanip>
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
#include "dll_directory.h"
// using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CClassDirectory3::CClassDirectory3(CDllDirectory *dllDirectory) : m_DllDirectory(dllDirectory)
{
}
// Parallel to CDllDirectory
CClassDirectory3::~CClassDirectory3()
{
// Delete m_ChunkCache and m_Entries when !m_ChunksOwnsPointers
if (!m_ChunksOwnsPointers)
{
for (TStorageObjectContainer::iterator it = m_ChunkCache.begin(), end = m_ChunkCache.end(); it != end; ++it)
{
delete it->second;
}
for (std::vector<CClassEntry *>::iterator subit = m_Entries.begin(), subend = m_Entries.end(); subit != subend; ++subit)
{
delete (*subit);
}
}
m_ChunkCache.clear();
m_Entries.clear();
m_ClassIdToIndex.clear();
}
std::string CClassDirectory3::className() const
{
return "ClassDirectory3";
}
// Parallel to CDllDirectory
void CClassDirectory3::toString(std::ostream &ostream, const std::string &pad) const
{
if (m_ChunksOwnsPointers)
{
CStorageContainer::toString(ostream, pad);
}
else
{
ostream << "(" << className() << ") [" << m_Chunks.size() << "] PARSED { ";
std::string padpad = pad + "\t";
sint i = 0;
for (TStorageObjectContainer::const_iterator it = m_ChunkCache.begin(), end = m_ChunkCache.end(); it != end; ++it)
{
uint16 id = it->first;
switch (id)
{
case 0x2040: // ClassEntry
{
uint subi = 0;
for (std::vector<CClassEntry *>::const_iterator subit = m_Entries.begin(), subend = m_Entries.end(); subit != subend; ++subit)
{
ostream << "\n" << pad << "Entries[" << subi << "]: ";
(*subit)->toString(ostream, padpad);
++subi;
}
}
break;
default:
std::stringstream ss;
ss << std::hex << std::setfill('0');
ss << std::setw(4) << it->first;
ostream << "\n" << pad << "0x" << ss.str() << ": ";
it->second->toString(ostream, padpad);
++i;
break;
}
}
ostream << "} ";
}
}
// Parallel to CDllDirectory
void CClassDirectory3::parse(uint16 version, uint filter)
{
// Ensure not yet parsed
nlassert(m_ChunkCache.empty());
nlassert(m_Entries.empty());
// Parse entries first
CStorageContainer::parse(version);
// Initialize
uint16 lastCached = 0xFFFF;
bool parsedDllEntry = false;
// Parse chunks
for (TStorageObjectContainer::iterator it = m_Chunks.begin(), end = m_Chunks.end(); it != end; ++it)
{
uint16 id = it->first;
switch (id)
{
case 0x2040: // ClassEntry
{
if (parsedDllEntry && (lastCached != id))
throw EStorageParse(); // There were chunks inbetween
if (!parsedDllEntry)
{
m_ChunkCache.push_back(TStorageObjectWithId(id, NULL)); // Dummy entry to know the location
lastCached = id;
parsedDllEntry = true;
}
CClassEntry *classEntry = static_cast<CClassEntry *>(it->second);
m_ClassIdToIndex[classEntry->classId()] = m_Entries.size();
m_Entries.push_back(classEntry);
break;
}
default:
m_ChunkCache.push_back(*it); // Dummy entry to know the location
lastCached = id;
break;
}
}
// Now ownership of the pointers lies in m_ChunkCache and m_Entries
m_ChunksOwnsPointers = false;
}
// Parallel to CDllDirectory
void CClassDirectory3::clean()
{
// Ensure parsed
nlassert(!m_ChunksOwnsPointers);
// Clear m_Chunks
m_Chunks.clear();
// Clean chunks
for (TStorageObjectContainer::iterator it = m_ChunkCache.begin(), end = m_ChunkCache.end(); it != end; ++it)
{
if (it->second != NULL && it->second->isContainer())
{
static_cast<CStorageContainer *>(it->second)->clean();
}
}
for (std::vector<CClassEntry *>::iterator subit = m_Entries.begin(), subend = m_Entries.end(); subit != subend; ++subit)
{
(*subit)->clean();
}
}
// Parallel to CDllDirectory
void CClassDirectory3::build(uint16 version, uint filter)
{
// Ensure parsed
nlassert(!m_ChunksOwnsPointers);
// Initialize
nlassert(m_Chunks.empty());
// Set up the m_Chunks list, when (CClassEntry::ID, NULL) is found write out all of the entries.
for (TStorageObjectContainer::iterator it = m_ChunkCache.begin(), end = m_ChunkCache.end(); it != end; ++it)
{
uint16 id = it->first;
switch (id)
{
case 0x2040: // ClassEntry
for (std::vector<CClassEntry *>::iterator subit = m_Entries.begin(), subend = m_Entries.end(); subit != subend; ++subit)
m_Chunks.push_back(TStorageObjectWithId(id, (*subit)));
break;
default:
m_Chunks.push_back(*it);
break;
}
}
// Build the entries last (after m_Chunks is built)
CStorageContainer::build(version);
// NOTE: Ownership remains with m_ChunkCache and m_Entries
}
// Parallel to CDllDirectory
void CClassDirectory3::disown()
{
m_ChunkCache.clear();
m_Entries.clear();
m_ClassIdToIndex.clear();
// Ownership goes back to m_Chunks
m_ChunksOwnsPointers = true;
// Disown child chunks
CStorageContainer::disown();
}
// Parallel to CDllDirectory
const CClassEntry *CClassDirectory3::get(uint16 index) const
{
nlassert(!m_ChunksOwnsPointers);
if (index >= m_Entries.size()) { nlerror("Index 0x%x is above the number of entries %i", (uint32)index, (uint32)m_Entries.size()); return NULL; }
return m_Entries[index];
}
// Parallel to CDllDirectory
void CClassDirectory3::reset()
{
nlassert(!m_ChunksOwnsPointers);
for (std::vector<CClassEntry *>::iterator subit = m_Entries.begin(), subend = m_Entries.end(); subit != subend; ++subit)
{
delete (*subit);
}
m_Entries.clear();
m_ClassIdToIndex.clear();
}
// Parallel to CDllDirectory
uint16 CClassDirectory3::getOrCreateIndex(const ISceneClassDesc *sceneClassDesc)
{
nlassert(!m_ChunksOwnsPointers);
std::map<NLMISC::CClassId, uint16>::iterator it = m_ClassIdToIndex.find(sceneClassDesc->classId());
// Return existing index
if (it != m_ClassIdToIndex.end())
return it->second;
// Create new entry
CClassEntry *classEntry = new CClassEntry(m_DllDirectory, sceneClassDesc);
uint16 index = m_Entries.size();
m_ClassIdToIndex[classEntry->classId()] = index;
m_Entries.push_back(classEntry);
return index;
}
IStorageObject *CClassDirectory3::createChunkById(uint16 id, bool container)
{
if (container)
{
switch (id)
{
case 0x2040: // ClassEntry
return new CClassEntry();
}
}
return CStorageContainer::createChunkById(id, container);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
// Entries[13]: (ClassEntry) [2] {
// 0 0x2060: (ClassEntryHeader) {
// DllIndex: -2
// ClassID: (0x222b9eb9, 0x64c75fec)
// SuperClassID: 3072 }
// 1 0x2042: (CStorageValue) { NeL Material } }
CClassEntry::CClassEntry() : m_Header(NULL), m_Name(NULL)
{
}
CClassEntry::CClassEntry(CDllDirectory *dllDirectory, const ISceneClassDesc *sceneClassDesc) : m_Header(new CClassEntryHeader()), m_Name(new CStorageValue<ucstring>())
{
m_Chunks.push_back(TStorageObjectWithId(0x2060, m_Header));
m_Chunks.push_back(TStorageObjectWithId(0x2042, m_Name));
m_Header->DllIndex = dllDirectory->getOrCreateIndex(sceneClassDesc->dllPluginDesc());
m_Header->ClassId = sceneClassDesc->classId();
m_Header->SuperClassId = sceneClassDesc->superClassId();
m_Name->Value = sceneClassDesc->displayName();
}
CClassEntry::~CClassEntry()
{
}
std::string CClassEntry::className() const
{
return "ClassEntry";
}
void CClassEntry::toString(std::ostream &ostream, const std::string &pad) const
{
if (m_Header && m_Name)
{
ostream << "(" << className() << ") [" << m_Chunks.size() << "] PARSED { ";
std::string padpad = pad + "\t";
ostream << "\n" << pad << "Header: ";
m_Header->toString(ostream, padpad);
ostream << "\n" << pad << "Name: " << m_Name->Value.toUtf8();
ostream << " } ";
}
else
{
CStorageContainer::toString(ostream, pad);
}
}
void CClassEntry::parse(uint16 version, uint filter)
{
// CStorageContainer::parse(version);
nlassert(m_ChunksOwnsPointers);
nlassert(m_Chunks.size() == 2);
TStorageObjectContainer::iterator it = m_Chunks.begin();
nlassert(it->first == 0x2060); // ClassEntryHeader
m_Header = static_cast<CClassEntryHeader *>(it->second);
++it;
nlassert(it->first == 0x2042); // ClassEntryName
m_Name = static_cast<CStorageValue<ucstring> *>(it->second);
// ++it;
}
void CClassEntry::clean()
{
// Nothing to do here! (m_Chunks retains ownership)
// CStorageContainer::clean();
}
void CClassEntry::build(uint16 version, uint filter)
{
// Nothing to do here!
// CStorageContainer::build(version);
}
void CClassEntry::disown()
{
// CStorageContainer::disown();
m_Header = NULL;
m_Name = NULL;
nlassert(m_ChunksOwnsPointers);
}
IStorageObject *CClassEntry::createChunkById(uint16 id, bool container)
{
if (!container)
{
switch (id)
{
case 0x2060: // ClassEntryHeader
return new CClassEntryHeader();
case 0x2042: // ClassEntryName
return new CStorageValue<ucstring>();
}
}
return CStorageContainer::createChunkById(id, container);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CClassEntryHeader::CClassEntryHeader()
{
}
CClassEntryHeader::~CClassEntryHeader()
{
}
std::string CClassEntryHeader::className() const
{
return "ClassEntryHeader";
}
void CClassEntryHeader::serial(NLMISC::IStream &stream)
{
stream.serial(DllIndex);
stream.serial(ClassId);
stream.serial(SuperClassId);
}
void CClassEntryHeader::toString(std::ostream &ostream, const std::string &pad) const
{
ostream << "(" << className() << ") { ";
ostream << "\n" << pad << "DllIndex: " << DllIndex;
ostream << "\n" << pad << "ClassId: " << NLMISC::toString(ClassId);
ostream << "\n" << pad << "SuperClassId: " << SuperClassId;
ostream << " } ";
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,160 @@
/**
* \file class_directory_3.h
* \brief CClassDirectory3
* \date 2012-08-18 18:01GMT
* \author Jan Boon (Kaetemi)
* CClassDirectory3
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_CLASS_DIRECTORY_3_H
#define PIPELINE_CLASS_DIRECTORY_3_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
#include <nel/misc/class_id.h>
#include <nel/misc/ucstring.h>
// Project includes
#include "storage_object.h"
#include "storage_value.h"
#include "scene_class.h"
namespace PIPELINE {
namespace MAX {
class CDllDirectory;
class CClassEntry;
/**
* \brief CClassDirectory3
* \date 2012-08-18 18:01GMT
* \author Jan Boon (Kaetemi)
* This class is used for parsing the local class indices in a max file,
* both reading and writing is supported. It is not used at runtime,
* and should be reset when no longer necessary. Plugins have their own
* static copy of the actual ISceneClassDesc. This class only contains
* CClassEntry instances, which should not be used directly.
*/
class CClassDirectory3 : public CStorageContainer
{
public:
CClassDirectory3(CDllDirectory *dllDirectory);
virtual ~CClassDirectory3();
// inherited
virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
// public
// Get a class entry corresponding to a chunk index, pointers become invalid after reset
const CClassEntry *get(uint16 index) const;
// Reset the class directory, all class entry pointers become invalid, use class id and scene class registry
void reset();
// Get or create the chunk index for a class by class description
uint16 getOrCreateIndex(const ISceneClassDesc *sceneClassDesc);
protected:
virtual IStorageObject *createChunkById(uint16 id, bool container);
private:
TStorageObjectContainer m_ChunkCache;
std::vector<CClassEntry *> m_Entries;
std::map<NLMISC::CClassId, uint16> m_ClassIdToIndex;
CDllDirectory *m_DllDirectory;
}; /* class CClassDirectory3 */
/**
* \brief CClassEntryHeader
* \date 2012-08-18 18:01GMT
* \author Jan Boon (Kaetemi)
* CClassEntryHeader
*/
class CClassEntryHeader : public IStorageObject
{
public:
CClassEntryHeader();
virtual ~CClassEntryHeader();
// public data
sint32 DllIndex;
NLMISC::CClassId ClassId;
uint32 SuperClassId;
// inherited
virtual std::string className() const;
virtual void serial(NLMISC::IStream &stream);
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
}; /* class CClassEntryHeader */
/**
* \brief CClassEntry
* \date 2012-08-18 18:01GMT
* \author Jan Boon (Kaetemi)
* CClassEntry
*/
class CClassEntry : public CStorageContainer
{
public:
CClassEntry();
CClassEntry(CDllDirectory *dllDirectory, const ISceneClassDesc *sceneClassDesc);
virtual ~CClassEntry();
// inherited
virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
// read access
const ucstring &displayName() const { return m_Name->Value; }
sint32 dllIndex() const { return m_Header->DllIndex; }
NLMISC::CClassId classId() const { return m_Header->ClassId; }
uint32 superClassId() const { return m_Header->SuperClassId; }
// debug
void overrideClassId(NLMISC::CClassId classId) { m_Header->ClassId = classId; }
protected:
virtual IStorageObject *createChunkById(uint16 id, bool container);
CClassEntryHeader *m_Header;
CStorageValue<ucstring> *m_Name;
}; /* class CClassEntry */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_CLASS_DIRECTORY_3_H */
/* end of file */

@ -0,0 +1,553 @@
/**
* \file config.cpp
* \brief CConfig
* \date 2012-08-18 19:25GMT
* \author Jan Boon (Kaetemi)
* CConfig
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "config.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
#include <nel/misc/vector.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CConfig::CConfig()
{
}
CConfig::~CConfig()
{
}
std::string CConfig::className() const
{
return "Config";
}
void CConfig::toString(std::ostream &ostream, const std::string &pad) const
{
CStorageContainer::toString(ostream, pad);
}
void CConfig::parse(uint16 version, uint filter)
{
CStorageContainer::parse(version);
}
void CConfig::clean()
{
CStorageContainer::clean();
}
void CConfig::build(uint16 version, uint filter)
{
CStorageContainer::build(version);
}
void CConfig::disown()
{
CStorageContainer::disown();
}
IStorageObject *CConfig::createChunkById(uint16 id, bool container)
{
if (container)
{
switch (id)
{
case 0x20a0: // unknown
return new CConfig20a0();
case 0x2180: // CConfigScript
return new CConfigScript();
}
}
else
{
switch (id)
{
case 0x2090: // unknown; known values: 1 (m3), 0 (m9, m2008, m2010)
return new CStorageValue<sint32>();
}
}
return CStorageContainer::createChunkById(id, container);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CConfig20a0::CConfig20a0()
{
}
CConfig20a0::~CConfig20a0()
{
}
std::string CConfig20a0::className() const
{
return "Config20a0";
}
void CConfig20a0::toString(std::ostream &ostream, const std::string &pad) const
{
CStorageContainer::toString(ostream, pad);
}
void CConfig20a0::parse(uint16 version, uint filter)
{
CStorageContainer::parse(version);
}
void CConfig20a0::clean()
{
CStorageContainer::clean();
}
void CConfig20a0::build(uint16 version, uint filter)
{
CStorageContainer::build(version);
}
void CConfig20a0::disown()
{
CStorageContainer::disown();
}
IStorageObject *CConfig20a0::createChunkById(uint16 id, bool container)
{
if (container)
{
switch (id)
{
case 0x0110: // CConfig20a0Entry
return new CConfig20a0Entry();
}
}
else
{
switch (id)
{
case 0x0100: // CConfig20a0Header: Number of entries
return new CStorageValue<sint32>();
}
}
return CStorageContainer::createChunkById(id, container);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CConfig20a0Entry::CConfig20a0Entry()
{
}
CConfig20a0Entry::~CConfig20a0Entry()
{
}
std::string CConfig20a0Entry::className() const
{
return "Config20a0Entry";
}
void CConfig20a0Entry::toString(std::ostream &ostream, const std::string &pad) const
{
CStorageContainer::toString(ostream, pad);
}
void CConfig20a0Entry::parse(uint16 version, uint filter)
{
CStorageContainer::parse(version);
}
void CConfig20a0Entry::clean()
{
CStorageContainer::clean();
}
void CConfig20a0Entry::build(uint16 version, uint filter)
{
CStorageContainer::build(version);
}
void CConfig20a0Entry::disown()
{
CStorageContainer::disown();
}
IStorageObject *CConfig20a0Entry::createChunkById(uint16 id, bool container)
{
if (container)
{
switch (id)
{
case 0x0300: // unknown, contains 0x0100 with 4 bytes int value
return CStorageContainer::createChunkById(id, container);
}
}
else
{
switch (id)
{
case 0x0100: // unknown
case 0x0110: // unknown
case 0x0120: // unknown
case 0x0130: // unknown
case 0x0140: // unknown
case 0x0150: // unknown
case 0x0160: // unknown
case 0x0161: // unknown
case 0x0170: // unknown
case 0x0180: // unknown
case 0x0190: // unknown
case 0x0200: // unknown
case 0x0210: // unknown
case 0x0220: // unknown
case 0x0230: // unknown
case 0x0240: // unknown
case 0x0250: // unknown
case 0x0270: // unknown
case 0x0280: // unknown
case 0x0310: // unknown
case 0x0320: // unknown
return new CStorageValue<sint32>();
case 0x0260: // unknown
return new CStorageValue<sint64>();
case 0x0330: // unknown, 16 bytes
return CStorageContainer::createChunkById(id, container);
case 0x0290: // unknown
case 0x0390: // unknown
return new CStorageValue<ucstring>();
}
}
return CStorageContainer::createChunkById(id, container);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CConfigScript::CConfigScript()
{
}
CConfigScript::~CConfigScript()
{
}
std::string CConfigScript::className() const
{
return "ConfigScript";
}
void CConfigScript::toString(std::ostream &ostream, const std::string &pad) const
{
CStorageContainer::toString(ostream, pad);
}
void CConfigScript::parse(uint16 version, uint filter)
{
CStorageContainer::parse(version);
}
void CConfigScript::clean()
{
CStorageContainer::clean();
}
void CConfigScript::build(uint16 version, uint filter)
{
CStorageContainer::build(version);
}
void CConfigScript::disown()
{
CStorageContainer::disown();
}
IStorageObject *CConfigScript::createChunkById(uint16 id, bool container)
{
if (container)
{
switch (id)
{
case 0x0040: // ConfigScriptEntry
return new CConfigScriptEntry();
}
}
return CStorageContainer::createChunkById(id, container);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CConfigScriptEntry::CConfigScriptEntry()
{
}
CConfigScriptEntry::~CConfigScriptEntry()
{
}
std::string CConfigScriptEntry::className() const
{
return "ConfigScriptEntry";
}
void CConfigScriptEntry::toString(std::ostream &ostream, const std::string &pad) const
{
CStorageContainer::toString(ostream, pad);
}
void CConfigScriptEntry::parse(uint16 version, uint filter)
{
CStorageContainer::parse(version);
}
void CConfigScriptEntry::clean()
{
CStorageContainer::clean();
}
void CConfigScriptEntry::build(uint16 version, uint filter)
{
CStorageContainer::build(version);
}
void CConfigScriptEntry::disown()
{
CStorageContainer::disown();
}
IStorageObject *CConfigScriptEntry::createChunkById(uint16 id, bool container)
{
if (container)
{
switch (id)
{
case 0x0007: // ConfigScriptMetaContainer
return new CConfigScriptMetaContainer();
}
}
else
{
switch (id)
{
case 0x0050: // ConfigScriptHeader
return new CConfigScriptHeader();
}
}
return CStorageContainer::createChunkById(id, container);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CConfigScriptHeader::CConfigScriptHeader()
{
}
CConfigScriptHeader::~CConfigScriptHeader()
{
}
std::string CConfigScriptHeader::className() const
{
return "ConfigScriptHeader";
}
void CConfigScriptHeader::serial(NLMISC::IStream &stream)
{
stream.serial(SuperClassID);
stream.serial(ClassID);
}
void CConfigScriptHeader::toString(std::ostream &ostream, const std::string &pad) const
{
ostream << "(" << className() << ") { ";
ostream << "\n" << pad << "SuperClassID: " << SuperClassID;
ostream << "\n" << pad << "ClassID: " << NLMISC::toString(ClassID);
ostream << " } ";
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CConfigScriptMetaContainer::CConfigScriptMetaContainer()
{
}
CConfigScriptMetaContainer::~CConfigScriptMetaContainer()
{
}
std::string CConfigScriptMetaContainer::className() const
{
return "ConfigScriptMetaContainer";
}
void CConfigScriptMetaContainer::toString(std::ostream &ostream, const std::string &pad) const
{
CStorageContainer::toString(ostream, pad);
}
void CConfigScriptMetaContainer::parse(uint16 version, uint filter)
{
CStorageContainer::parse(version);
}
void CConfigScriptMetaContainer::clean()
{
CStorageContainer::clean();
}
void CConfigScriptMetaContainer::build(uint16 version, uint filter)
{
CStorageContainer::build(version);
}
void CConfigScriptMetaContainer::disown()
{
CStorageContainer::disown();
}
IStorageObject *CConfigScriptMetaContainer::createChunkById(uint16 id, bool container)
{
if (container)
{
switch (id)
{
case 0x0007: // ConfigScriptMetaContainer
return new CConfigScriptMetaContainer();
}
}
else
{
switch (id)
{
case 0x0001: // type: boolean (stored in four bytes, yes)
return new CStorageValue<uint32>();
case 0x0002: // ???
nlerror("0x0002 found, please implement");
break;
case 0x0003: // type: integer (not sure if signed)
return new CStorageValue<sint32>();
case 0x0004: // type: float
return new CStorageValue<float>();
case 0x0005: // type: string (same format as the meta string)
case 0x0006: // ConfigScriptMetaString
return new CConfigScriptMetaString();
case 0x0008: // type: color (stored as 3 float vector)
return new CStorageValue<NLMISC::CVector>;
case 0x0060: // ConfigScriptMetaContainerHeader (contains the number of entries, amusingly)
return new CStorageValue<uint32>();
}
}
return CStorageContainer::createChunkById(id, container);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CConfigScriptMetaString::CConfigScriptMetaString()
{
}
CConfigScriptMetaString::~CConfigScriptMetaString()
{
}
std::string CConfigScriptMetaString::className() const
{
return "ConfigScriptMetaString";
}
void CConfigScriptMetaString::serial(NLMISC::IStream &stream)
{
if (stream.isReading())
{
uint32 size;
stream.serial(size);
Value.resize(size - 1);
}
else
{
uint32 size = Value.size() + 1;
stream.serial(size);
}
stream.serialBuffer(static_cast<uint8 *>(static_cast<void *>(&Value[0])), Value.size());
uint8 endByte = 0;
stream.serial(endByte);
nlassert(endByte == 0);
}
void CConfigScriptMetaString::toString(std::ostream &ostream, const std::string &pad) const
{
ostream << "(" << className() << ") { " << Value << " } ";
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,245 @@
/**
* \file config.h
* \brief CConfig
* \date 2012-08-18 19:25GMT
* \author Jan Boon (Kaetemi)
* CConfig
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_CONFIG_H
#define PIPELINE_CONFIG_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
#include <nel/misc/class_id.h>
// Project includes
#include "storage_object.h"
#include "storage_value.h"
namespace PIPELINE {
namespace MAX {
/**
* \brief CConfig
* \date 2012-08-18 19:25GMT
* \author Jan Boon (Kaetemi)
* CConfig
*/
class CConfig : public CStorageContainer
{
public:
CConfig();
virtual ~CConfig();
// inherited
virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
protected:
virtual IStorageObject *createChunkById(uint16 id, bool container);
}; /* class CConfig */
/**
* \brief CConfig20a0
* \date 2012-08-18 19:25GMT
* \author Jan Boon (Kaetemi)
* CConfig
*/
class CConfig20a0 : public CStorageContainer
{
public:
CConfig20a0();
virtual ~CConfig20a0();
// inherited
virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
protected:
virtual IStorageObject *createChunkById(uint16 id, bool container);
}; /* class CConfig20a0 */
/**
* \brief CConfig20a0Entry
* \date 2012-08-18 19:25GMT
* \author Jan Boon (Kaetemi)
* CConfig20a0Entry
*/
class CConfig20a0Entry : public CStorageContainer
{
public:
CConfig20a0Entry();
virtual ~CConfig20a0Entry();
// inherited
virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
protected:
virtual IStorageObject *createChunkById(uint16 id, bool container);
}; /* class CConfig20a0Entry */
/**
* \brief CConfigScript
* \date 2012-08-18 19:25GMT
* \author Jan Boon (Kaetemi)
* CConfig
*/
class CConfigScript : public CStorageContainer
{
public:
CConfigScript();
virtual ~CConfigScript();
// inherited
virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
protected:
virtual IStorageObject *createChunkById(uint16 id, bool container);
}; /* class CConfigScript */
/**
* \brief CConfigScriptEntry
* \date 2012-08-18 19:25GMT
* \author Jan Boon (Kaetemi)
* CConfig
*/
class CConfigScriptEntry : public CStorageContainer
{
public:
CConfigScriptEntry();
virtual ~CConfigScriptEntry();
// inherited
virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
protected:
virtual IStorageObject *createChunkById(uint16 id, bool container);
}; /* class CConfigScriptEntry */
/**
* \brief CConfigScriptHeader
* \date 2012-08-18 19:25GMT
* \author Jan Boon (Kaetemi)
* CConfigScriptHeader
*/
class CConfigScriptHeader : public IStorageObject
{
public:
CConfigScriptHeader();
virtual ~CConfigScriptHeader();
// public data
uint32 SuperClassID;
NLMISC::CClassId ClassID;
// inherited
virtual std::string className() const;
virtual void serial(NLMISC::IStream &stream);
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
}; /* class CConfigScriptHeader */
/**
* \brief CConfigScriptMetaContainer
* \date 2012-08-18 19:25GMT
* \author Jan Boon (Kaetemi)
* CConfigScriptMetaContainer
* This is totally hilarious.
*/
class CConfigScriptMetaContainer : public CStorageContainer
{
public:
CConfigScriptMetaContainer();
virtual ~CConfigScriptMetaContainer();
// inherited
virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
protected:
virtual IStorageObject *createChunkById(uint16 id, bool container);
}; /* class CConfigScriptMetaContainer */
/**
* \brief CConfigScriptMetaString
* \date 2012-08-18 19:25GMT
* \author Jan Boon (Kaetemi)
* CConfigScriptMetaString
*/
class CConfigScriptMetaString : public IStorageObject
{
public:
CConfigScriptMetaString();
virtual ~CConfigScriptMetaString();
// public data
std::string Value;
// inherited
virtual std::string className() const;
virtual void serial(NLMISC::IStream &stream);
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
}; /* class CConfigScriptMetaString */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_CONFIG_H */
/* end of file */

@ -0,0 +1,55 @@
/**
* \file derived_object.cpp
* \brief CDerivedObject
* \date 2012-08-26 12:04GMT
* \author Jan Boon (Kaetemi)
* CDerivedObject
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "derived_object.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
CDerivedObject::CDerivedObject()
{
}
CDerivedObject::~CDerivedObject()
{
}
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,63 @@
/**
* \file derived_object.h
* \brief CDerivedObject
* \date 2012-08-26 12:04GMT
* \author Jan Boon (Kaetemi)
* CDerivedObject
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_DERIVED_OBJECT_H
#define PIPELINE_DERIVED_OBJECT_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
namespace PIPELINE {
/**
* \brief CDerivedObject
* \date 2012-08-26 12:04GMT
* \author Jan Boon (Kaetemi)
* CDerivedObject
*/
class CDerivedObject
{
protected:
// pointers
// ...
// instances
// ...
public:
CDerivedObject();
virtual ~CDerivedObject();
}; /* class CDerivedObject */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_DERIVED_OBJECT_H */
/* end of file */

@ -0,0 +1,420 @@
/**
* \file dll_directory.cpp
* \brief CDllDirectory
* \date 2012-08-18 09:01GMT
* \author Jan Boon (Kaetemi)
* CDllDirectory
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "dll_directory.h"
// STL includes
#include <iomanip>
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CDllDirectory::CDllDirectory() : m_DllEntryBuiltin(&DllPluginDescBuiltin), m_DllEntryScript(&DllPluginDescScript)
{
}
// Parallel to CClassDirectory3
CDllDirectory::~CDllDirectory()
{
// Delete m_ChunkCache and m_Entries when !m_ChunksOwnsPointers
if (!m_ChunksOwnsPointers)
{
for (TStorageObjectContainer::iterator it = m_ChunkCache.begin(), end = m_ChunkCache.end(); it != end; ++it)
{
delete it->second;
}
for (std::vector<CDllEntry *>::iterator subit = m_Entries.begin(), subend = m_Entries.end(); subit != subend; ++subit)
{
delete (*subit);
}
}
m_ChunkCache.clear();
m_Entries.clear();
}
std::string CDllDirectory::className() const
{
return "DllDirectory";
}
// Parallel to CClassDirectory3
void CDllDirectory::toString(std::ostream &ostream, const std::string &pad) const
{
if (m_ChunksOwnsPointers)
{
CStorageContainer::toString(ostream, pad);
}
else
{
ostream << "(" << className() << ") [" << m_Chunks.size() << "] PARSED { ";
std::string padpad = pad + "\t";
sint i = 0;
for (TStorageObjectContainer::const_iterator it = m_ChunkCache.begin(), end = m_ChunkCache.end(); it != end; ++it)
{
uint16 id = it->first;
switch (id)
{
case 0x2038: // DllEntry
{
uint subi = 0;
for (std::vector<CDllEntry *>::const_iterator subit = m_Entries.begin(), subend = m_Entries.end(); subit != subend; ++subit)
{
ostream << "\n" << pad << "Entries[" << subi << "]: ";
(*subit)->toString(ostream, padpad);
++subi;
}
}
break;
default:
std::stringstream ss;
ss << std::hex << std::setfill('0');
ss << std::setw(4) << it->first;
ostream << "\n" << pad << "0x" << ss.str() << ": ";
it->second->toString(ostream, padpad);
++i;
break;
}
}
ostream << "} ";
}
}
// Parallel to CClassDirectory3
void CDllDirectory::parse(uint16 version, uint filter)
{
// Ensure not yet parsed
nlassert(m_ChunkCache.empty());
nlassert(m_Entries.empty());
// Parse entries first
CStorageContainer::parse(version);
// Initialize
addInternalIndices();
uint16 lastCached = 0xFFFF;
bool parsedDllEntry = false;
// Parse chunks
for (TStorageObjectContainer::iterator it = m_Chunks.begin(), end = m_Chunks.end(); it != end; ++it)
{
uint16 id = it->first;
switch (id)
{
case 0x2038: // DllEntry
{
if (parsedDllEntry && (lastCached != id))
throw EStorageParse(); // There were chunks inbetween
if (!parsedDllEntry)
{
m_ChunkCache.push_back(TStorageObjectWithId(id, NULL)); // Dummy entry to know the location
lastCached = id;
parsedDllEntry = true;
}
CDllEntry *dllEntry = static_cast<CDllEntry *>(it->second);
m_InternalNameToIndex[NLMISC::toLower(dllEntry->dllFilename())] = m_Entries.size();
m_Entries.push_back(dllEntry);
}
break;
default:
m_ChunkCache.push_back(*it); // Dummy entry to know the location
lastCached = id;
break;
}
}
// Now ownership of the pointers lies in m_ChunkCache and m_Entries
m_ChunksOwnsPointers = false;
}
// Parallel to CClassDirectory3
void CDllDirectory::clean()
{
// Ensure parsed
nlassert(!m_ChunksOwnsPointers);
// Clear m_Chunks
m_Chunks.clear();
// Clean chunks
for (TStorageObjectContainer::iterator it = m_ChunkCache.begin(), end = m_ChunkCache.end(); it != end; ++it)
{
if (it->second != NULL && it->second->isContainer())
{
static_cast<CStorageContainer *>(it->second)->clean();
}
}
for (std::vector<CDllEntry *>::iterator subit = m_Entries.begin(), subend = m_Entries.end(); subit != subend; ++subit)
{
(*subit)->clean();
}
}
// Parallel to CClassDirectory3
void CDllDirectory::build(uint16 version, uint filter)
{
// Ensure parsed
nlassert(!m_ChunksOwnsPointers);
// Initialize
nlassert(m_Chunks.empty());
// Set up the m_Chunks list, when (CDllEntry::ID, NULL) is found write out all of the entries.
for (TStorageObjectContainer::iterator it = m_ChunkCache.begin(), end = m_ChunkCache.end(); it != end; ++it)
{
uint16 id = it->first;
switch (id)
{
case 0x2038: // DllEntry
for (std::vector<CDllEntry *>::iterator subit = m_Entries.begin(), subend = m_Entries.end(); subit != subend; ++subit)
m_Chunks.push_back(TStorageObjectWithId(id, (*subit)));
break;
default:
m_Chunks.push_back(*it);
break;
}
}
// Build the entries last (after m_Chunks is built)
CStorageContainer::build(version);
// NOTE: Ownership remains with m_ChunkCache and m_Entries
}
// Parallel to CClassDirectory3
void CDllDirectory::disown()
{
m_ChunkCache.clear();
m_Entries.clear();
m_InternalNameToIndex.clear();
// Ownership goes back to m_Chunks
m_ChunksOwnsPointers = true;
// Disown child chunks
CStorageContainer::disown();
}
// Parallel to CClassDirectory3
const CDllEntry *CDllDirectory::get(sint32 index) const
{
nlassert(!m_ChunksOwnsPointers);
if (index < 0)
{
// Handle internal dummy values
switch (index)
{
case -1:
return &m_DllEntryBuiltin;
case -2:
return &m_DllEntryScript;
default:
nlerror("Bad dll entry index");
}
}
else
{
nlassert(index < (sint32)m_Entries.size());
return m_Entries[index];
}
nlassert(false);
return NULL;
}
// Parallel to CClassDirectory3
void CDllDirectory::reset()
{
nlassert(!m_ChunksOwnsPointers);
for (std::vector<CDllEntry *>::iterator subit = m_Entries.begin(), subend = m_Entries.end(); subit != subend; ++subit)
{
delete (*subit);
}
m_Entries.clear();
m_InternalNameToIndex.clear();
addInternalIndices();
}
// Parallel to CClassDirectory3
sint32 CDllDirectory::getOrCreateIndex(const IDllPluginDescInternal *dllPluginDesc)
{
nlassert(!m_ChunksOwnsPointers);
std::map<ucstring, sint32>::iterator it = m_InternalNameToIndex.find(NLMISC::toLower(ucstring(dllPluginDesc->internalName())));
// Return existing index
if (it != m_InternalNameToIndex.end())
return it->second;
// Create new entry
CDllEntry *dllEntry = new CDllEntry(dllPluginDesc);
sint32 index = m_Entries.size();
m_InternalNameToIndex[NLMISC::toLower(dllEntry->dllFilename())] = index;
m_Entries.push_back(dllEntry);
return index;
}
void CDllDirectory::addInternalIndices()
{
m_InternalNameToIndex[NLMISC::toLower(ucstring(DllPluginDescBuiltin.internalName()))] = -1;
m_InternalNameToIndex[NLMISC::toLower(ucstring(DllPluginDescScript.internalName()))] = -2;
}
IStorageObject *CDllDirectory::createChunkById(uint16 id, bool container)
{
if (container)
{
switch (id)
{
case 0x2038: // DllEntry
return new CDllEntry();
}
}
else
{
switch (id)
{
case 0x21C0: // DllDirectoryHeader
return new CStorageValue<uint32>();
}
}
return CStorageContainer::createChunkById(id, container);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
// Entries[5]: (DllEntry) [2] PARSED {
// DllDescription: ...
// DllFilename: ... }
CDllEntry::CDllEntry() : m_DllDescription(NULL), m_DllFilename(NULL)
{
}
CDllEntry::CDllEntry(const IDllPluginDescInternal *dllPluginDesc) : m_DllDescription(new CStorageValue<ucstring>()), m_DllFilename(new CStorageValue<ucstring>())
{
m_Chunks.push_back(TStorageObjectWithId(0x2039, m_DllDescription));
m_Chunks.push_back(TStorageObjectWithId(0x2037, m_DllFilename));
m_DllDescription->Value = dllPluginDesc->displayName();
m_DllFilename->Value = dllPluginDesc->internalName();
}
CDllEntry::~CDllEntry()
{
}
std::string CDllEntry::className() const
{
return "DllEntry";
}
void CDllEntry::toString(std::ostream &ostream, const std::string &pad) const
{
if (m_DllDescription && m_DllFilename)
{
ostream << "(" << className() << ") [" << m_Chunks.size() << "] PARSED { ";
std::string padpad = pad + "\t";
ostream << "\n" << pad << "DllDescription: " << m_DllDescription->Value.toUtf8();
ostream << "\n" << pad << "DllFilename: " << m_DllFilename->Value.toUtf8();
ostream << " } ";
}
else
{
CStorageContainer::toString(ostream, pad);
}
}
void CDllEntry::parse(uint16 version, uint filter)
{
// CStorageContainer::parse(version);
nlassert(m_ChunksOwnsPointers);
nlassert(m_Chunks.size() == 2);
TStorageObjectContainer::iterator it = m_Chunks.begin();
nlassert(it->first == 0x2039); // DllDescription
m_DllDescription = static_cast<CStorageValue<ucstring> *>(it->second);
++it;
nlassert(it->first == 0x2037); // DllFilename
m_DllFilename = static_cast<CStorageValue<ucstring> *>(it->second);
// ++it;
}
void CDllEntry::clean()
{
// Nothing to do here! (m_Chunks retains ownership)
// CStorageContainer::clean();
}
void CDllEntry::build(uint16 version, uint filter)
{
// Nothing to do here!
// CStorageContainer::build(version);
}
void CDllEntry::disown()
{
// CStorageContainer::disown();
m_DllDescription = NULL;
m_DllFilename = NULL;
nlassert(m_ChunksOwnsPointers);
}
IStorageObject *CDllEntry::createChunkById(uint16 id, bool container)
{
if (!container)
{
switch (id)
{
case 0x2039: // DllDescription
case 0x2037: // DllFilename
return new CStorageValue<ucstring>();
}
}
return CStorageContainer::createChunkById(id, container);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,135 @@
/**
* \file dll_directory.h
* \brief CDllDirectory
* \date 2012-08-18 09:01GMT
* \author Jan Boon (Kaetemi)
* CDllDirectory
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_DLL_DIRECTORY_H
#define PIPELINE_DLL_DIRECTORY_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "storage_object.h"
#include "storage_value.h"
#include "dll_plugin_desc.h"
namespace PIPELINE {
namespace MAX {
/**
* \brief CDllEntry
* \date 2012-08-18 09:01GMT
* \author Jan Boon (Kaetemi)
* CDllEntry
*/
class CDllEntry : public CStorageContainer
{
public:
CDllEntry();
CDllEntry(const IDllPluginDescInternal *dllPluginDesc);
virtual ~CDllEntry();
// inherited
virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
// read access
const ucstring &dllDescription() const { return m_DllDescription->Value; }
const ucstring &dllFilename() const { return m_DllFilename->Value; }
// debug
void overrideDllFilename(const ucstring &dllFilename) { m_DllFilename->Value = dllFilename; }
protected:
virtual IStorageObject *createChunkById(uint16 id, bool container);
CStorageValue<ucstring> *m_DllDescription;
CStorageValue<ucstring> *m_DllFilename;
}; /* class CDllDirectory */
/**
* \brief CDllDirectory
* \date 2012-08-18 09:01GMT
* \author Jan Boon (Kaetemi)
* This class is used for parsing the local dll indices in a max file,
* both reading and writing is supported. It is not used at runtime,
* and should be reset when no longer necessary. Plugins have their own
* copy of the actual IDllPluginDescInternal. This class only contains
* CDllEntry instances, which should not be used directly. The instance
* of this class used to parse the max file should be kept, as there
* might be chunks that were not parsed, which should be rewritten to
* the stream.
*/
class CDllDirectory : public CStorageContainer
{
public:
CDllDirectory();
virtual ~CDllDirectory();
// inherited
virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
// public
// Get a dll entry corresponding to a chunk index, pointers become invalid after reset
const CDllEntry *get(sint32 index) const;
// Reset the dll directory, all dll entry pointers become invalid, use internal name and dll plugin registry
void reset();
// Get or create the chunk index for a dll by dll plugin description
sint32 getOrCreateIndex(const IDllPluginDescInternal *dllPluginDesc);
private:
void addInternalIndices();
protected:
virtual IStorageObject *createChunkById(uint16 id, bool container);
private:
TStorageObjectContainer m_ChunkCache;
std::vector<CDllEntry *> m_Entries;
std::map<ucstring, sint32> m_InternalNameToIndex;
const CDllEntry m_DllEntryBuiltin;
const CDllEntry m_DllEntryScript;
}; /* class CDllDirectory */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_DLL_DIRECTORY_H */
/* end of file */

@ -0,0 +1,75 @@
/**
* \file dll_plugin_desc.cpp
* \brief CDllPluginDesc
* \date 2012-08-20 09:59GMT
* \author Jan Boon (Kaetemi)
* CDllPluginDesc
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "dll_plugin_desc.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
// using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
const ucchar *CDllPluginDescBuiltin::displayName() const
{
static const ucstring value = ucstring("Builtin");
return value.c_str();
}
const ucchar *CDllPluginDescBuiltin::internalName() const
{
static const ucstring value = ucstring("Builtin");
return value.c_str();
}
const CDllPluginDescBuiltin DllPluginDescBuiltin;
const ucchar *CDllPluginDescScript::displayName() const
{
static const ucstring value = ucstring("Script");
return value.c_str();
}
const ucchar *CDllPluginDescScript::internalName() const
{
static const ucstring value = ucstring("Script");
return value.c_str();
}
const CDllPluginDescScript DllPluginDescScript;
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,109 @@
/**
* \file dll_plugin_desc.h
* \brief CDllPluginDesc
* \date 2012-08-20 09:59GMT
* \author Jan Boon (Kaetemi)
* CDllPluginDesc
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_DLL_PLUGIN_DESC_H
#define PIPELINE_DLL_PLUGIN_DESC_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
#include <nel/misc/ucstring.h>
// Project includes
namespace PIPELINE {
namespace MAX {
/**
* \brief IDllPluginDescInternal
* \date 2012-08-20 09:59GMT
* \author Jan Boon (Kaetemi)
* Used for internal plugin descriptions that have no actual plugin
* associated with them.
*/
class IDllPluginDescInternal
{
public:
virtual const ucchar *displayName() const = 0;
virtual const ucchar *internalName() const = 0;
}; /* class IDllPluginDescInternal */
/**
* \brief IDllPluginDesc
* \date 2012-08-20 09:59GMT
* \author Jan Boon (Kaetemi)
* Inherit from this when making a plugin
*/
class IDllPluginDesc : public IDllPluginDescInternal
{
public:
// virtual const ucchar *displayName() const = 0;
// virtual const ucchar *internalName() const = 0;
// TODO: list scene classes
}; /* class IDllPluginDesc */
/**
* \brief CDllPluginDescBuiltin
* \date 2012-08-20 09:59GMT
* \author Jan Boon (Kaetemi)
* Use only internally for builtin classes
* TODO: Move to separate header?
*/
class CDllPluginDescBuiltin : public IDllPluginDescInternal
{
public:
virtual const ucchar *displayName() const;
virtual const ucchar *internalName() const;
}; /* class CDllPluginDescBuiltin */
extern const CDllPluginDescBuiltin DllPluginDescBuiltin;
/**
* \brief CDllPluginDescScript
* \date 2012-08-20 09:59GMT
* \author Jan Boon (Kaetemi)
* Use only internally for scripts
* TODO: Move to separate header?
*/
class CDllPluginDescScript : public IDllPluginDescInternal
{
public:
virtual const ucchar *displayName() const;
virtual const ucchar *internalName() const;
}; /* class CDllPluginDescScript */
extern const CDllPluginDescScript DllPluginDescScript;
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_DLL_PLUGIN_DESC_H */
/* end of file */

@ -0,0 +1,158 @@
/**
* \file editable_poly.cpp
* \brief CEditablePoly
* \date 2012-08-26 12:02GMT
* \author Jan Boon (Kaetemi)
* CEditablePoly
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "editable_poly.h"
// STL includes
#include <iomanip>
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
#include "epoly.h"
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace EPOLY {
CEditablePoly::CEditablePoly(CScene *scene) : CPolyObject(scene)
{
}
CEditablePoly::~CEditablePoly()
{
if (!m_ChunksOwnsPointers)
{
for (TStorageObjectContainer::iterator it = m_EditablePolyUnknown.begin(), end = m_EditablePolyUnknown.end(); it != end; ++it)
delete it->second;
m_EditablePolyUnknown.clear();
}
}
const ucstring CEditablePoly::DisplayName = ucstring("EditablePoly");
const char *CEditablePoly::InternalName = "EditablePoly";
const NLMISC::CClassId CEditablePoly::ClassId = NLMISC::CClassId(0x1bf8338d, 0x192f6098);
const TSClassId CEditablePoly::SuperClassId = CPolyObject::SuperClassId;
const CEditablePolyClassDesc EditablePolyClassDesc(&DllPluginDescEPoly);
void CEditablePoly::parse(uint16 version, uint filter)
{
CPolyObject::parse(version);
IStorageObject *so;
so = getChunk(0x4039);
if (so) m_EditablePolyUnknown.push_back(TStorageObjectWithId(0x4039, so));
so = getChunk(0x403a);
if (so) m_EditablePolyUnknown.push_back(TStorageObjectWithId(0x403a, so));
for (; ; )
{ // note: also in editable mesh, copy paste or related somehow? / use a common parser class inbetween?
so = getChunk(0x3003);
if (so) m_EditablePolyUnknown.push_back(TStorageObjectWithId(0x3003, so));
else break;
so = getChunk(0x3004);
if (so) m_EditablePolyUnknown.push_back(TStorageObjectWithId(0x3004, so));
}
so = getChunk(0x3002);
if (so) m_EditablePolyUnknown.push_back(TStorageObjectWithId(0x3002, so));
so = getChunk(0x4038);
if (so) m_EditablePolyUnknown.push_back(TStorageObjectWithId(0x4038, so));
CPolyObject::parse(version, PMB_POLY_OBJECT_PARSE_FILTER);
}
void CEditablePoly::clean()
{
CPolyObject::clean();
}
void CEditablePoly::build(uint16 version, uint filter)
{
CPolyObject::build(version);
for (TStorageObjectContainer::iterator it = m_EditablePolyUnknown.begin(), end = m_EditablePolyUnknown.end(); it != end; ++it)
putChunk(it->first, it->second);
CPolyObject::build(version, PMB_POLY_OBJECT_PARSE_FILTER);
}
void CEditablePoly::disown()
{
m_EditablePolyUnknown.clear();
CPolyObject::disown();
}
void CEditablePoly::init()
{
CPolyObject::init();
}
bool CEditablePoly::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return CPolyObject::inherits(classId);
}
const ISceneClassDesc *CEditablePoly::classDesc() const
{
return &EditablePolyClassDesc;
}
void CEditablePoly::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{
CPolyObject::toStringLocal(ostream, pad);
std::string padpad = pad + "\t";
sint i = 0;
for (TStorageObjectContainer::const_iterator it = m_EditablePolyUnknown.begin(), end = m_EditablePolyUnknown.end(); it != end; ++it)
{
std::stringstream ss;
ss << std::hex << std::setfill('0');
ss << std::setw(4) << it->first;
ostream << "\n" << pad << "EditablePolyUnkown[" << i << "] 0x" << ss.str() << ": ";
it->second->toString(ostream, padpad);
++i;
}
CPolyObject::toStringLocal(ostream, pad, PMB_POLY_OBJECT_PARSE_FILTER);
}
IStorageObject *CEditablePoly::createChunkById(uint16 id, bool container)
{
return CPolyObject::createChunkById(id, container);
}
} /* namespace EPOLY */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,89 @@
/**
* \file editable_poly.h
* \brief CEditablePoly
* \date 2012-08-26 12:02GMT
* \author Jan Boon (Kaetemi)
* CEditablePoly
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_EDITABLE_POLY_H
#define PIPELINE_EDITABLE_POLY_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "../builtin/poly_object.h"
namespace PIPELINE {
namespace MAX {
namespace EPOLY {
/**
* \brief CEditablePoly
* \date 2012-08-26 12:02GMT
* \author Jan Boon (Kaetemi)
* CEditablePoly
*/
class CEditablePoly : public PIPELINE::MAX::BUILTIN::CPolyObject
{
public:
CEditablePoly(CScene *scene);
virtual ~CEditablePoly();
// class desc
static const ucstring DisplayName;
static const char *InternalName;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
// inherited
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
protected:
// inherited
virtual IStorageObject *createChunkById(uint16 id, bool container);
private:
TStorageObjectContainer m_EditablePolyUnknown;
}; /* class CEditablePoly */
typedef CSceneClassDesc<CEditablePoly> CEditablePolyClassDesc;
extern const CEditablePolyClassDesc EditablePolyClassDesc;
} /* namespace EPOLY */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_EDITABLE_POLY_H */
/* end of file */

@ -0,0 +1,81 @@
/**
* \file epoly.cpp
* \brief CEPoly
* \date 2012-08-26 12:03GMT
* \author Jan Boon (Kaetemi)
* CEPoly
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "epoly.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
#include "../scene_class_registry.h"
#include "editable_poly.h"
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace EPOLY {
CEPoly::CEPoly()
{
}
CEPoly::~CEPoly()
{
}
void CEPoly::registerClasses(CSceneClassRegistry *registry)
{
registry->add(&EditablePolyClassDesc);
}
const ucchar *CDllPluginDescEPoly::displayName() const
{
static const ucstring value = ucstring("Editable Poly Object (Ryzom Core)");
return value.c_str();
}
const ucchar *CDllPluginDescEPoly::internalName() const
{
static const ucstring value = ucstring("EPoly.dlo");
return value.c_str();
}
const CDllPluginDescEPoly DllPluginDescEPoly;
} /* namespace EPOLY */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,84 @@
/**
* \file epoly.h
* \brief CEPoly
* \date 2012-08-26 12:03GMT
* \author Jan Boon (Kaetemi)
* CEPoly
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_EPOLY_H
#define PIPELINE_EPOLY_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "../dll_plugin_desc.h"
namespace PIPELINE {
namespace MAX {
class CSceneClassRegistry;
namespace EPOLY {
/**
* \brief CEPoly
* \date 2012-08-26 12:03GMT
* \author Jan Boon (Kaetemi)
* CEPoly
*/
class CEPoly
{
public:
static void registerClasses(CSceneClassRegistry *registry);
public:
CEPoly();
virtual ~CEPoly();
}; /* class CEPoly */
/**
* \brief CDllPluginDescEPoly
* \date 2012-08-26 12:03GMT
* \author Jan Boon (Kaetemi)
* CDllPluginDescEPoly
*/
class CDllPluginDescEPoly : public IDllPluginDescInternal
{
public:
virtual const ucchar *displayName() const;
virtual const ucchar *internalName() const;
}; /* class CDllPluginDescScript */
extern const CDllPluginDescEPoly DllPluginDescEPoly;
} /* namespace EPOLY */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_EPOLY_H */
/* end of file */

@ -0,0 +1,237 @@
/**
* \file scene.cpp
* \brief CScene
* \date 2012-08-18 19:25GMT
* \author Jan Boon (Kaetemi)
* CScene
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "scene.h"
// STL includes
#include <iostream>
// NeL includes
// #include <nel/misc/debug.h>
#include <nel/misc/ucstring.h>
// Project includes
#include "dll_directory.h"
#include "class_directory_3.h"
#include "scene_class_registry.h"
#include "scene_class_unknown.h"
#include "builtin/scene_impl.h"
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CScene::CScene(const CSceneClassRegistry *sceneClassRegistry, CDllDirectory *dllDirectory, CClassDirectory3 *classDirectory3) : m_SceneClassRegistry(sceneClassRegistry), m_DllDirectory(dllDirectory), m_ClassDirectory3(classDirectory3)
{
}
CScene::~CScene()
{
}
std::string CScene::className() const
{
return "Scene";
}
void CScene::toString(std::ostream &ostream, const std::string &pad) const
{
CStorageContainer::toString(ostream, pad);
}
void CScene::parse(uint16 version, uint filter)
{
CStorageContainer::parse(version);
nlassert(m_Chunks.size() == 1);
}
void CScene::clean()
{
CStorageContainer::clean();
}
void CScene::build(uint16 version, uint filter)
{
nlassert(m_Chunks.size() == 1);
CStorageContainer::build(this->version());
}
void CScene::disown()
{
CStorageContainer::disown();
}
uint16 CScene::version()
{
nlassert(m_Chunks.size() == 1);
return m_Chunks.begin()->first;
}
CSceneClassContainer *CScene::container()
{
nlassert(m_Chunks.size() == 1);
return static_cast<CSceneClassContainer *>(m_Chunks.begin()->second);
}
IStorageObject *CScene::createChunkById(uint16 id, bool container)
{
if (container)
{
// Return the scene class container. There can be only one.
return new CSceneClassContainer(this, m_SceneClassRegistry, m_DllDirectory, m_ClassDirectory3);
}
return CStorageContainer::createChunkById(id, container);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CSceneClassContainer::CSceneClassContainer(CScene *scene, const CSceneClassRegistry *sceneClassRegistry, CDllDirectory *dllDirectory, CClassDirectory3 *classDirectory3) : m_Scene(scene), m_SceneClassRegistry(sceneClassRegistry), m_DllDirectory(dllDirectory), m_ClassDirectory3(classDirectory3), m_BuiltinScene(NULL)
{
}
CSceneClassContainer::~CSceneClassContainer()
{
}
std::string CSceneClassContainer::className() const
{
return "SceneClassContainer";
}
void CSceneClassContainer::toString(std::ostream &ostream, const std::string &pad) const
{
CStorageContainer::toString(ostream, pad);
}
void CSceneClassContainer::parse(uint16 version, uint filter)
{
// Temporary 'readonly' implementation, not modifying m_Chunks!
m_StorageObjectByIndex.resize(m_Chunks.size());
TStorageObjectIterator it = m_Chunks.begin();
for (std::vector<CSceneClass *>::size_type i = 0; i < m_StorageObjectByIndex.size(); ++i)
{
m_StorageObjectByIndex[i] = static_cast<CSceneClass *>(it->second);
++it;
}
CSceneClass *builtinScene = m_StorageObjectByIndex[m_StorageObjectByIndex.size() - 1];
nlassert(builtinScene);
m_BuiltinScene = dynamic_cast<BUILTIN::CSceneImpl *>(builtinScene);
nlassert(m_BuiltinScene);
CStorageContainer::parse(version);
}
void CSceneClassContainer::clean()
{
// Temporary 'readonly' implementation, not modifying m_Chunks!
CStorageContainer::clean();
}
void CSceneClassContainer::build(uint16 version, uint filter)
{
// Temporary 'readonly' implementation, not modifying m_Chunks!
for (std::vector<CSceneClass *>::size_type i = 0; i < m_StorageObjectByIndex.size(); ++i)
{
m_StorageObjectToIndex[m_StorageObjectByIndex[i]] = i;
}
CStorageContainer::build(version);
}
void CSceneClassContainer::disown()
{
// Temporary 'readonly' implementation, not modifying m_Chunks!
CStorageContainer::disown();
}
CSceneClass *CSceneClassContainer::getByStorageIndex(uint32 index) const
{
// Temporary 'readonly' implementation, not modifying m_Chunks!
if (index >= m_StorageObjectByIndex.size()) { nlerror("Index %i is outside size %i", index, m_StorageObjectByIndex.size()); return NULL; }
return m_StorageObjectByIndex[index];
}
uint32 CSceneClassContainer::getOrCreateStorageIndex(CSceneClass *storageObject)
{
// Temporary 'readonly' implementation, not modifying m_Chunks!
return m_StorageObjectToIndex[storageObject];
}
IStorageObject *CSceneClassContainer::createChunkById(uint16 id, bool container)
{
// nldebug("Scene class id %x (%i)", (uint32)id, (uint32)id);
switch (id)
{
// Known unknown special identifiers...
case 0x2032:
return m_SceneClassRegistry->createUnknown(m_Scene, 0x0, NLMISC::CClassId(0x29263a68, 0x405f22f5), ucstring("OSM Derived"), ucstring("Internal"), ucstring("Internal"));
case 0x2033:
return m_SceneClassRegistry->createUnknown(m_Scene, 0x0, NLMISC::CClassId(0x4ec13906, 0x5578130e), ucstring("WSM Derived"), ucstring("Internal"), ucstring("Internal"));
// return new CSceneClass(m_Scene); // TODO: Make dummy dllentry and classentry for these...
// return static_cast<IStorageObject *>(new CSceneClassUnknown<CSceneClass>(dllEntry, classEntry));
}
const CClassEntry *classEntry = m_ClassDirectory3->get(id);
CSceneClass *sceneClass = m_SceneClassRegistry->create(m_Scene, classEntry->superClassId(), classEntry->classId());
if (sceneClass)
{
return static_cast<IStorageObject *>(sceneClass);
}
else
{
const CDllEntry *dllEntry = m_DllDirectory->get(classEntry->dllIndex());
sceneClass = m_SceneClassRegistry->createUnknown(m_Scene, classEntry->superClassId(), classEntry->classId(), classEntry->displayName(), dllEntry->dllFilename(), dllEntry->dllDescription());
if (sceneClass)
{
return static_cast<IStorageObject *>(sceneClass);
}
else
{
// Create an invalid unknown scene class
return static_cast<IStorageObject *>(new CSceneClassUnknown<CSceneClass>(m_Scene,classEntry->classId(), classEntry->superClassId(), classEntry->displayName(), "SceneClassUnknown", dllEntry->dllFilename(), dllEntry->dllDescription()));
}
}
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,146 @@
/**
* \file scene.h
* \brief CScene
* \date 2012-08-18 19:25GMT
* \author Jan Boon (Kaetemi)
* CScene
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_SCENE_H
#define PIPELINE_SCENE_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
#include <nel/misc/class_id.h>
// Project includes
#include "storage_object.h"
#include "storage_value.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
class CSceneImpl;
}
class CSceneClass;
// Registry containing available scene classes
class CSceneClassRegistry;
// Storage
class CDllDirectory;
class CClassDirectory3;
class CSceneClassContainer;
/**
* \brief CScene
* \date 2012-08-19 19:25GMT
* \author Jan Boon (Kaetemi)
* CScene
*/
class CScene : public CStorageContainer
{
public:
CScene(const CSceneClassRegistry *sceneClassRegistry, CDllDirectory *dllDirectory, CClassDirectory3 *classDirectory3);
virtual ~CScene();
// inherited
virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
// public
uint16 version();
CSceneClassContainer *container();
protected:
virtual IStorageObject *createChunkById(uint16 id, bool container);
private:
const CSceneClassRegistry *m_SceneClassRegistry;
CDllDirectory *m_DllDirectory;
CClassDirectory3 *m_ClassDirectory3;
}; /* class CScene */
/**
* \brief CSceneClassContainer
* \date 2012-08-19 19:25GMT
* \author Jan Boon (Kaetemi)
* CSceneClassContainer
*/
class CSceneClassContainer : public CStorageContainer
{
public:
CSceneClassContainer(CScene *scene, const CSceneClassRegistry *sceneClassRegistry, CDllDirectory *dllDirectory, CClassDirectory3 *classDirectory3);
virtual ~CSceneClassContainer();
// inherited
virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
/// Use while parsing to get an object by it's index
CSceneClass *getByStorageIndex(uint32 index) const;
/// Use while building to get an index for an object
uint32 getOrCreateStorageIndex(CSceneClass *storageObject);
/// TODO: Evaluate the references tree to build new indexes.
protected:
virtual IStorageObject *createChunkById(uint16 id, bool container);
public:
/// Return the single instance of the builtin scene class
inline BUILTIN::CSceneImpl *scene() const { return m_BuiltinScene; }
private:
CScene *m_Scene;
const CSceneClassRegistry *m_SceneClassRegistry;
CDllDirectory *m_DllDirectory;
CClassDirectory3 *m_ClassDirectory3;
std::vector<CSceneClass *> m_StorageObjectByIndex;
std::map<CSceneClass *, uint32> m_StorageObjectToIndex;
BUILTIN::CSceneImpl *m_BuiltinScene;
}; /* class CSceneClassContainer */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_SCENE_H */
/* end of file */

@ -0,0 +1,288 @@
/**
* \file scene_class.cpp
* \brief CSceneClass
* \date 2012-08-20 09:07GMT
* \author Jan Boon (Kaetemi)
* CSceneClass
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "scene_class.h"
// STL includes
#include <iomanip>
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
// Elevate warnings to errors in this file for stricter reading
#undef nlwarning
#define nlwarning nlerror
// Elevate debug to error in this file for debugging
// #undef nldebug
// #define nldebug nlerror
// Chunk identifiers
// #define ...
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CSceneClass::CSceneClass(CScene *scene) : m_Scene(scene)
{
}
CSceneClass::~CSceneClass()
{
if (!m_ChunksOwnsPointers)
{
for (TStorageObjectContainer::iterator it = m_OrphanedChunks.begin(), end = m_OrphanedChunks.end(); it != end; ++it)
delete it->second;
m_OrphanedChunks.clear();
for (std::vector<IStorageObject *>::iterator it = m_ArchivedChunks.begin(), end = m_ArchivedChunks.end(); it != end; ++it)
delete (*it);
m_ArchivedChunks.clear();
}
}
std::string CSceneClass::className() const
{
return classDesc()->internalName();
}
void CSceneClass::toString(std::ostream &ostream, const std::string &pad) const
{
if (m_ChunksOwnsPointers)
{
CStorageContainer::toString(ostream, pad);
}
else
{
ostream << "<ptr=0x";
{
std::stringstream ss;
ss << std::hex << std::setfill('0');
ss << std::setw(16) << (uint64)(void *)this;
ostream << ss.str();
}
ostream << "> ";
ostream << "(" << className() << ": " << ucstring(classDesc()->displayName()).toUtf8() << ", " << classDesc()->classId().toString() << ", 0x";
{
std::stringstream ss;
ss << std::hex << std::setfill('0');
ss << std::setw(8) << classDesc()->superClassId();
ostream << ss.str();
}
ostream << ", " << ucstring(classDesc()->dllPluginDesc()->internalName()).toUtf8() << ") [" << m_OrphanedChunks.size() << "] { ";
toStringLocal(ostream, pad);
// Append orphans
std::string padpad = pad + "\t";
sint i = 0;
for (TStorageObjectContainer::const_iterator it = m_OrphanedChunks.begin(), end = m_OrphanedChunks.end(); it != end; ++it)
{
std::stringstream ss;
ss << std::hex << std::setfill('0');
ss << std::setw(4) << it->first;
ostream << "\n" << pad << "Orphan[" << i << "] 0x" << ss.str() << ": ";
it->second->toString(ostream, padpad);
++i;
}
ostream << "} ";
}
}
void CSceneClass::parse(uint16 version, uint filter)
{
// Cannot be parsed yet
if (!m_ChunksOwnsPointers) { nlerror("Already parsed"); return; } // Already parsed, illegal to call twice
// Parse all child chunks
CStorageContainer::parse(version);
// Orphanize all child chunk
m_OrphanedChunks.insert(m_OrphanedChunks.end(), m_Chunks.begin(), m_Chunks.end());
// Take ownership
m_ChunksOwnsPointers = false;
// Inheriting classes take control from here on, they should check
// m_ChunksOwnsPointers to be false before taking action, in case
// a subclass called disown due to failure.
}
void CSceneClass::clean()
{
if (m_ChunksOwnsPointers) { nldebug("Not parsed, or disowned"); return; } // Must have local ownership, parsing may have failed
if (m_Chunks.size() == 0 && m_OrphanedChunks.size() != 0) { nlwarning("Already cleaned"); return; } // Already cleaned, should not call twice, not reliable because not all chunks have child chunks
// Clear unneeded references from the parent
m_Chunks.clear();
// Clean owned child chunks
for (TStorageObjectContainer::const_iterator it = m_OrphanedChunks.begin(), end = m_OrphanedChunks.end(); it != end; ++it)
{
if (it->second->isContainer())
{
static_cast<CStorageContainer *>(it->second)->clean();
}
}
// Erase archived chunks, they must have been parsed perfectly
for (std::vector<IStorageObject *>::iterator it = m_ArchivedChunks.begin(), end = m_ArchivedChunks.end(); it != end; ++it)
delete (*it);
m_ArchivedChunks.clear();
}
void CSceneClass::build(uint16 version, uint filter)
{
// Must be clean first
if (!m_ChunksOwnsPointers && m_Chunks.size() != 0) { nlerror("Not cleaned"); return; } // Cannot call twice, illegal call
if (m_Chunks.size() != 0) { nldebug("Not parsed, or disowned"); return; } // Don't have local ownership, parsing may have failed, the built version is implicitly up to date
// Store orphan chunks
m_Chunks.insert(m_Chunks.end(), m_OrphanedChunks.begin(), m_OrphanedChunks.end());
// Build the orphan chunks (this is a little trick to do it this
// way here, don't do this from subclasses)
CStorageContainer::build(version);
// Set the insertion pointer before the orphans
m_PutChunkInsert = m_Chunks.begin();
// Inheriting classes take control from here on, so the build is
// called to owned subclasses from the putChunk function.
}
void CSceneClass::disown()
{
if (m_ChunksOwnsPointers) { nldebug("Not parsed"); }
if (!m_ChunksOwnsPointers && (m_Chunks.size() < m_OrphanedChunks.size())) { nlerror("Not built"); return; } // If chunks is not the owner, built chunks must match the parsed data. This check is not fully reliable
// Clear local references
m_OrphanedChunks.clear();
m_ArchivedChunks.clear();
// Return ownership
m_ChunksOwnsPointers = true;
// Disown children
CStorageContainer::disown();
}
void CSceneClass::init()
{
// Nothing to do here!
}
IStorageObject *CSceneClass::createChunkById(uint16 id, bool container)
{
return CStorageContainer::createChunkById(id, container);
}
const ucstring CSceneClass::DisplayName = ucstring("Invalid Scene Class");
const char *CSceneClass::InternalName = "SceneClass";
const NLMISC::CClassId CSceneClass::ClassId = NLMISC::CClassId::Null; // This class is invalid
const TSClassId CSceneClass::SuperClassId = 0x0000; // This class is invalid
namespace {
static const CSceneClassDesc<CSceneClass> SceneClassDesc(static_cast<const IDllPluginDescInternal *>(&DllPluginDescBuiltin));
} /* anonymous namespace */
bool CSceneClass::inherits(const NLMISC::CClassId classId) const
{
return false;
}
const ISceneClassDesc *CSceneClass::classDesc() const
{
return static_cast<const ISceneClassDesc *>(&SceneClassDesc);
}
void CSceneClass::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{
// Nothing to do here...
}
IStorageObject *CSceneClass::getChunk(uint16 id)
{
if (m_OrphanedChunks.begin()->first == id)
{
IStorageObject *result = m_OrphanedChunks.begin()->second;
m_OrphanedChunks.pop_front();
return result;
}
else
{
for (TStorageObjectContainer::iterator it = m_OrphanedChunks.begin(), end = m_OrphanedChunks.end(); it != end; ++it)
{
if (it->first == id)
{
nlwarning("Try to get chunk with 0x%x id, but found 0x%x instead. Found the correct chunk at a different position. Unknown chunks, or chunks out of order", (uint32)id, (uint32)m_OrphanedChunks.begin()->first);
IStorageObject *result = it->second;
m_OrphanedChunks.erase(it);
return result;
}
}
}
// nldebug("Chunk 0x%x not found, this is allowed, returning NULL", (uint32)id);
return NULL;
}
void CSceneClass::putChunk(uint16 id, IStorageObject *storageObject)
{
if (storageObject->isContainer())
{
static_cast<CStorageContainer *>(storageObject)->build(VersionUnknown); // FIXME
}
m_OrphanedChunks.insert(m_PutChunkInsert, TStorageObjectWithId(id, storageObject));
}
uint16 CSceneClass::peekChunk()
{
if (m_OrphanedChunks.size())
return m_OrphanedChunks.begin()->first;
return 0x0000;
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,231 @@
/**
* \file scene_class.h
* \brief CSceneClass
* \date 2012-08-20 09:07GMT
* \author Jan Boon (Kaetemi)
* CSceneClass
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_SCENE_CLASS_H
#define PIPELINE_SCENE_CLASS_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
#include <nel/misc/class_id.h>
#include <nel/misc/smart_ptr.h>
// Project includes
#include "typedefs.h"
#include "storage_object.h"
#include "storage_value.h"
#include "dll_plugin_desc.h"
#include "scene.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
class CSceneImpl;
}
class ISceneClassDesc;
/**
* \brief CSceneClass
* \date 2012-08-19 19:25GMT
* \author Jan Boon (Kaetemi)
* It is recommended to use CRefPtr<T> to refer to any pointers to
* classes inherited from this class.
* NOTE: CRefPtr<T> does not delete the class when references go to
* zero. When you remove a class from the scene, the class will be
* deleted if the reference count is zero. Otherwise, you are
* responsible for deleting it (for example, if you keep the class
* backed up in an undo stack for undeletion). You may use CSmartPtr<T>
* when the class is no longer owned by the scene container.
* CRefPtr<T> is a safe handle, which you can use to verify if the class
* has been deleted or not, similar to AnimHandle in max.
*/
class CSceneClass : public CStorageContainer, public NLMISC::CVirtualRefCount
{
public:
CSceneClass(CScene *scene);
virtual ~CSceneClass();
//! \name Inherited functions that are implemented by wrapping around other virtual functions in this class
//@{
virtual std::string className() const; // do not override, implemented using classDesc
virtual void toString(std::ostream &ostream, const std::string &pad = "") const; // do not override, implemented using toStringLocal
//@}
//! \name Inherited functions called through the storage loading and saving system
//@{
/// Override this to read a chunk from the chunks stream. Call the parent's parse function first. Get the necessary chunks implemented by your class using getChunk. See the getChunk function for further information. In case of failure, call disown. If m_ChunksOwnsPointers is true, the parsing has failed, warnings have already been printed, and nothing should happen. Chunks are already parsed when you get them from getChunk
virtual void parse(uint16 version, uint filter = 0);
/// Override this if the chunks you are using are not needed after they have been parsed. You may delete any chunks you own. Call the parent's clean first. You must call clean on any chunks you own if they implement this function
virtual void clean();
/// Override this to write a chunk to the chunks stream. If you create a new chunk, the creating class owns it, and should delete it when clean is called. You no longer own any created chunks when disown has been called. Use putChunk to add the chunk. Call the parent's build first. The putChunk function calls build on added chunks
virtual void build(uint16 version, uint filter = 0);
/// Remove any references to chunks that are owned by the inheriting class (those that were acquired using getChunk during parse or created using putChunk during build). You no longer have ownership over these chunks, and should not use them anymore. This function may be called after build to disable any functionality from the loaded storage. Call the parent's disown after disowning your own chunks. Disown is called on the disowned child chunks for you
virtual void disown();
//@}
//! \name Virtual functionality for inheriting classes to implement
//@{
/// Initialize this class from scratch, call the parent first
virtual void init();
//@}
//! \name Static const variables for the class description
//@{
static const ucstring DisplayName;
static const char *InternalName;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
//@}
//! \name More virtual functionality for inheriting classes to implement
//@{
/// Returns whether the class inherits from a class with given class id
virtual bool inherits(const NLMISC::CClassId classId) const;
/// Return the class description of the inheriting class
virtual const ISceneClassDesc *classDesc() const;
/// Create a readable representation of this class
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
//@}
public:
//! \name Read access to internal data, provided for browsing trough the file from code
//@{
inline const TStorageObjectContainer &orphanedChunks() const { return m_OrphanedChunks; }
//@}
//! \name Scene utility access
//@{
/// Return the scene scene class
inline BUILTIN::CSceneImpl *scene() const { return m_Scene->container()->scene(); }
/// Return the scene version
inline uint16 version() const { return m_Scene->version(); }
/// Return the scene container
inline CSceneClassContainer *container() const { return m_Scene->container(); }
//@}
protected:
//! \name Methods used by inheriting classes to read and write to the storage safely
//@{
/// Use during parsing. Gets the chunk with specified id. Warnings when chunks are skipped may be elevated to errors. Remaining orphaned chunks will be appended after chunks that are written by the classes. Returns NULL when the chunk does not exist. Empty chunks are often not written by classes. You have ownership over the chunk until it is disowned. In case that the chunk cannot be parsed, call disown and abort parsing, or you may keep the chunk as is without modifications and put it back as is during build with putChunk. If this function returns NULL it is also possible that the parsing has been aborted when m_ChunksOwnsPointers is true
IStorageObject *getChunk(uint16 id);
/// Use during file build. Adds a chunk to the chunks that will be written to the file. Build is called when a chunk is passed through
void putChunk(uint16 id, IStorageObject *storageObject);
/// Same as getChunk but for lazy programmers, must use together with putChunkValue
template <typename T>
const T &getChunkValue(uint16 id);
/// Same as putChunk but for lazy programmers, must use together with getChunkValue
template <typename T>
void putChunkValue(uint16 id, const T &value);
/// See the next chunk id
uint16 peekChunk();
//@}
protected:
virtual IStorageObject *createChunkById(uint16 id, bool container);
/// Chunks which have been parsed, kept unmodified, and which are no longer necessary, should be placed here
std::vector<IStorageObject *> m_ArchivedChunks;
private:
TStorageObjectContainer m_OrphanedChunks;
TStorageObjectIterator m_PutChunkInsert;
CScene *m_Scene;
}; /* class CSceneClass */
template <typename T>
const T &CSceneClass::getChunkValue(uint16 id)
{
CStorageValue<T> *chunk = static_cast<CStorageValue<T> *>(getChunk(id));
if (!chunk) { nlerror("Try to get required chunk value 0x%x but it does not exist, bad file format"); }
m_ArchivedChunks.push_back(chunk);
return chunk->Value;
}
template <typename T>
void CSceneClass::putChunkValue(uint16 id, const T &value)
{
CStorageValue<T> *chunk = new CStorageValue<T>();
chunk->Value = value;
m_ArchivedChunks.push_back(chunk);
putChunk(id, chunk);
}
/**
* \brief ISceneClassDesc
* \date 2012-08-19 19:25GMT
* \author Jan Boon (Kaetemi)
* ISceneClassDesc
*/
class ISceneClassDesc
{
public:
virtual CSceneClass *create(CScene *scene) const = 0;
virtual void destroy(CSceneClass *sc) const = 0;
virtual const ucchar *displayName() const = 0;
virtual const char *internalName() const = 0;
virtual NLMISC::CClassId classId() const = 0;
virtual TSClassId superClassId() const = 0;
virtual const IDllPluginDescInternal *dllPluginDesc() const = 0;
}; /* class ISceneClassDesc */
/**
* \brief CSceneClassDesc
* \date 2012-08-19 19:25GMT
* \author Jan Boon (Kaetemi)
* CSceneClassDesc
* Use in a cpp when registering the CClassId.
*/
template <typename T>
class CSceneClassDesc : public ISceneClassDesc
{
public:
CSceneClassDesc(const IDllPluginDescInternal *dllPluginDesc) : m_DllPluginDesc(dllPluginDesc) { }
virtual CSceneClass *create(CScene *scene) const { return static_cast<CSceneClass *>(new T(scene)); }
virtual void destroy(CSceneClass *sc) const { delete static_cast<T *>(sc); }
virtual const ucchar *displayName() const { return T::DisplayName.c_str(); }
virtual const char *internalName() const { return T::InternalName; }
virtual NLMISC::CClassId classId() const { return T::ClassId; }
virtual TSClassId superClassId() const { return T::SuperClassId; }
virtual const IDllPluginDescInternal *dllPluginDesc() const { return m_DllPluginDesc; }
private:
const IDllPluginDescInternal *m_DllPluginDesc;
}; /* class CSceneClassDesc */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_SCENE_CLASS_H */
/* end of file */

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save