SourceCode Overview
From SfzWiki
Revision as of 21:18, 20 June 2007 by Ghoulsblade (Talk | contribs)
Warning : preliminary documentation This part is about the C++ SourceCode and Lua Scripts for SFZ.
Contents
overview
* src/ : c++ source files (.cpp) * include/ : c++ header files (.h) * data/ : data files * data/lua/ : lua scripts (.lua) the c++ source code is in the src/ directory, the headers are in include/ the lua code is in the data/lua/ directory, one main.lua and several libs.<br> large parts of SFZ are coded in lua to ensure high flexibility, <br> and customizability without recompiling, while keeping performance critical code in c++.
data
the data/ dir contains all data, lua scripts are under data/lua/ * main.material contains definitions of materials used by ogre * OgreCore.zip standard materials and fonts * lua/ contains lua scripts * lua/main.lua central lua file * lua/udata.lua helper used for lua binding (luabind.h)
c++
for most things there are include/thing.h as header src/thing.cpp for the actual code src/thing_L.cpp for lua bindings/wrappers *main.cpp main function *game.h .cpp mainclass, init, step, deinit *scripting.h .cpp global interface for lua, and utils *luabind.h template class for lua binding *luaxml.h .cpp make tinyxml parser available for lua (there are currently luabindings for data, builder, gfx2D, gfx3D, widget, fifo, luaxml,...) *ogrewrapper.h .cpp central interface to ogre *robrenderable.h .cpp util for custom renderables *meshshape.h .cpp used for mousepicking of meshes (statics,dynamics,chars) *widget.h .cpp _L.cpp managing for gui elements *gfx2D.h .cpp _L.cpp wrapper for 2D graphics *gfx3D.h .cpp _L.cpp wrapper for 3D graphics *SortedOverlayContainer.h gui-element class (z-ordering) *BorderColourClipPaneOverlay.h gui-element class *ColourClipPaneOverlay.h gui-element class *ColourClipTextOverlay.h gui-element class *camera.h .cpp _L.cpp lua binding for ogre cam *viewport.h .cpp _L.cpp lua binding for ogre viewport *material.h .cpp _L.cpp lua binding for ogre material *rendertexture.h .cpp _L.cpp lua binding for ogre render-to-texture holder *sound.h .cpp _L.cpp sound and musik wrapper *sound_fmod.cpp sound implementation using fmod *sound_openal.cpp sound implementation using openal *prefix.h should be included first in every source file, for os specific macros *shell.h .cpp obsolete, inits timer and random *input.h .cpp keyboard, mouse, see also ogrewrapper.cpp for OIS access *listener.h .cpp baseclass for listener pattern *smartptr.h baseclass for smartptr design pattern *timer.h .cpp timed callbacks, stepper, fps-calc, etc *profile.h .cpp runtime callstack and calltime measurement *tiny?.h ?.cpp tiny xml parser *robstring1.2.h .cpp string utils *net.h .cpp networking *fifo.h first in first out buffer, used by net
lua
main.lua main file lib.guimaker.lua core of the guisystem drin, utility functions for creating text-fields etc, no UO specific code sort of like the interface to the c++ gui code, and common shortcuts lib.edittext.lua text-input fields lib.fadelines.lua the messages at the bottom left of the screen that slowly fade away lib.input.lua keyboard and mouse events, keybindings lib.plaingui.lua simple gui, only used for teleport dialog in offline gameplay lib.time.lua calcs fps, calls MainStep from main.lua and calls registered steppers lib.util.lua some utilities, mainly vector and quaternion math lib.xml.lua xml-parser utils (see lib.gfm.lua for parser usage)