UTILITY FUNCTION COLLECTION
This is a collection of useful utility functions for use in your DBPRO games or applications.
There are a lot of stuff in there already, but I have plans to add a lot more, which is why I have posted it under WIP.
The functions already included are ready to go, but I might elaborate on them further if I get some useful ideas.
This collection is free and open source, so please feel free to use it any way you like. You are also welcome to expand the collection if you have anything useful lying around. If you do, please post here so I can keep up to date.
Any comments, ideas, or bug-reports are as always welcome...
Current Utilities:
LANDSCAPES:
- Dynamically create and delete Matrix Landscapes very easily.
- Load and apply HeightMaps or Textures easily with one command.
- Apply HeightMaps or Textures you have already loaded.
- Easily get the Matrix number, or the Width/Depth and number of Tiles, and then use regular Matrix commands on your Landscape.
UFC_InitLandscapes() // Initialize Landscape functions.
ls = UFC_NewLandscape(2500,2500,64,64) // Create a new Landscape.
UFC_LoadLSHeightMap(ls, "heightmap.bmp", 4.0) // Load and apply a HeightMap.
UFC_LoadLSTexture(ls, "texture.bmp") // Load and apply a Texture.
TIMERS:
- Dynamically create and delete timers.
- More than one Timer can be used at any point.
- Start and Stop/Pause functionality.
- Reset and Restart a timer with same duration.
- Get elapsed time, percentage done, and duration of Timers.
- Independant of framerate and each other...
LOGICS:
- Dynamically create and delete Logic circuits.
- Connect Wires and various Gates to create a circuit.
- Update output Wires based on the Logic of the Gates.
- AND, NAND, OR, XOR, NOR, and CMP Gates can be chosen.
- UFC_Truth() function to get the Logic of a specific Gate type, without creating an actual circuit.
NODES:
- Dynamic creation of tree structures made up of Nodes. Similar to a mindmapping structure.
- Attach Nodes to other Nodes, or create a new Root Node.
- Set a name for your Nodes, and be able to find them later by Name.
- Attach data to your Nodes by referencing their NodeID. (this is not included, since I don't know what data you want to use)
- Read the comments in the "nodes.dba" file for more info...
RESOURCES:
- Simple function to find an available resource number for most standard types.
CHANGELOG
28/09-10: Fixed a bug in Landscapes that caused the Texture to be applied incorrectly. The download has been updated.
26/09-10: Added Landscapes and Resources.
25/09-10: Added Nodes to the collection.
- enderleit