From 28fc78007fadd62c1ca552295f3b46bdec561513 Mon Sep 17 00:00:00 2001 From: GeneralGuy4872 Date: Fri, 25 Sep 2020 21:23:07 -0500 Subject: [PATCH] push commit and start work again --- README.md | 66 +-- chunk_layout.md | 9 + fantasy/avianinn.txt | 14 +- {questdialogs => questdialogs__old}/boom.c | 0 .../escape_newteammate_siren.depra | 0 .../farlook/spoilers_rogue_questgiver.txt | 0 .../lightningfractal.c | 0 .../old/avianquest | 0 .../old/knightquest | 0 .../old/questtemplate | 0 .../old/roguequest | 0 .../oracles.depra | 0 {questdialogs => questdialogs__old}/scene.nfo | 0 {questdialogs => questdialogs__old}/ship.txt | 0 .../true_ending_start.txt | 0 ...ueneutral_unspecified_rogue__beginning.txt | 0 .../twomasters.depra | 0 .../volcanomancy.depra | 0 src/alpha/TODO | 16 + src/{working => alpha}/build.sh | 0 src/{working => alpha}/main.cc | 4 +- src/alpha/main_altindent.cc | 425 ++++++++++++++++ src/alpha/main_physics.cc | 474 ++++++++++++++++++ src/alpha/modularized/build.sh | 2 + src/alpha/modularized/commandline.incplusplus | 21 + .../datatypes/camcoord.incplusplus | 16 + src/alpha/modularized/eventloop.incplusplus | 148 ++++++ src/alpha/modularized/globals.incplusplus | 24 + .../changecolors.incplusplus | 29 ++ src/alpha/modularized/irrcontext.incplusplus | 14 + src/alpha/modularized/jitterbug.incplusplus | 20 + src/alpha/modularized/main.cc | 147 ++++++ .../modularized/maineventloop.incplusplus | 125 +++++ .../modularized/ncursesthread.incplusplus | 72 +++ src/alpha/modularized/physics/AKNOWLADGEMENTS | 8 + src/alpha/modularized/scripting.incplusplus | 25 + src/{stable => alpha/sandbox}/base1.def | 0 .../sandbox/bitvector/bitvector16.c | 0 .../sandbox/bitvector/bitvector32.c | 0 .../sandbox/bitvector/bitvector64.c | 0 .../sandbox/bitvector/bitvector8.c | 0 src/{incomplete => alpha}/sandbox/coord.c | 0 src/{stable => alpha/sandbox}/cppkeyword.def | 0 src/alpha/sandbox/handle_collisions.cc | 61 +++ src/alpha/sandbox/ode_physics.cc | 82 +++ .../util/util.h => alpha/sandbox/util/util.H} | 18 +- src/{rotten => alpha/sandbox}/util/util.c | 26 +- src/{rotten => alpha/sandbox}/util/util.def | 5 +- src/incomplete/sandbox/printer.cc | 37 -- src/{ => prealpha}/deprecated/archive.c | 0 .../deprecated/atomic_mutex.d/atomic_mutex.c | 0 .../deprecated/atomic_mutex.d/atomic_mutex.h | 0 .../deprecated/bettersavefileio.c | 0 src/{ => prealpha}/deprecated/concepts.txt | 0 .../deprecated/doublelinkedlist.cc | 0 src/{ => prealpha}/deprecated/evheap.c | 0 src/{ => prealpha}/deprecated/exists.tmpl | 0 src/{ => prealpha}/deprecated/extmodules.cc | 0 .../deprecated/flywheel.cpseudo | 0 src/{ => prealpha}/deprecated/funstack.c | 0 .../deprecated/getsafe.d/getsafe.cc | 0 .../deprecated/getsafe.d/getsafe.h | 0 src/{ => prealpha}/deprecated/globalvar.cc | 0 src/{ => prealpha}/deprecated/heapio.c | 0 src/{ => prealpha}/deprecated/heapio2.c | 0 .../deprecated/lightning.psudoexpr | 0 src/{ => prealpha}/deprecated/lighttree.c | 0 src/{ => prealpha}/deprecated/plugin.cc | 0 src/{ => prealpha}/deprecated/plugin.cclass | 0 src/{ => prealpha}/deprecated/plugin.h | 0 .../deprecated/pure_c_shared_mutex.c | 0 src/{ => prealpha}/deprecated/renderstack.c | 0 src/{ => prealpha}/deprecated/savefileio.cc | 0 src/{ => prealpha}/deprecated/scalar.c | 0 src/{ => prealpha}/deprecated/strangemutex.cc | 0 src/{ => prealpha}/deprecated/texturetree.c | 0 src/{ => prealpha}/deprecated/uuidtypes.def | 0 .../deprecated/vectors.d/vectors.c | 0 .../deprecated/vectors.d/vectors.c.m4 | 0 .../deprecated/vectors.d/vectors.h | 0 .../deprecated/vectors.d/vectors.h.m4 | 0 .../wrapper___std___shared_mutex.cc | 0 src/{ => prealpha}/incomplete/TODO | 0 .../incomplete/launchpad/camcoord.cc | 0 .../launchpad/directory/directory.hh | 0 .../launchpad/directory/tmp_directory.tmpl | 0 .../incomplete/launchpad/minifixed.cc | 0 .../incomplete/launchpad/ncursesnoise.c | 0 .../incomplete/launchpad/slurp.cc | 0 .../incomplete/mothballed/argvlogic.h | 0 .../incomplete/mothballed/as_moduleglue.cc | 0 .../incomplete/mothballed/build.sh | 0 .../incomplete/mothballed/chunk.H | 0 .../incomplete/mothballed/chunk.fragment | 0 .../incomplete/mothballed/commandline.hh | 0 .../mothballed/commandlinesyntax.txt | 0 .../doublelinkedlist.d/refcounted.cc | 0 .../doublelinkedlist.d/refcounted.h | 0 .../doublelinkedlist.d/refcounted.hh | 0 .../mothballed/flywheel/flywheel.cclass | 0 .../mothballed/flywheel/flywheel.hh | 0 .../incomplete/mothballed/iwf__chunk.cc | 0 .../incomplete/mothballed/iwf__graphics3d.cc | 0 .../C_iwf__voxels__minichunk.cc | 0 .../C_iwf__voxels__minichunk.h | 0 .../iwf__voxels__minichunk.cclass | 0 .../iwf__voxels__minichunk.hh | 0 .../incomplete/mothballed/iwf_joystick.c | 0 .../incomplete/mothballed/keyswitch.inc | 0 .../incomplete/mothballed/listcontainer.cc | 0 .../incomplete/mothballed/magnetoception.txt | 0 .../incomplete/mothballed/main.cc | 0 .../incomplete/mothballed/memdump.pseudoc | 0 .../incomplete/mothballed/octanttriple.c | 0 .../incomplete/mothballed/pools.cc | 0 .../mothballed/refcount.d/refcounted.cc | 0 .../mothballed/refcount.d/refcounted.h | 0 .../mothballed/refcount.d/refcounted.hh | 0 .../incomplete/mothballed/repl.cc | 0 .../incomplete/mothballed/scriptboot.cc | 0 .../incomplete/mothballed/seedcrypt.cc | 0 .../incomplete/mothballed/seedcrypt.h | 0 .../incomplete/mothballed/seedcrypt.hlib | 0 .../incomplete/mothballed/split.cc | 0 .../incomplete/mothballed/startup.cc | 0 .../incomplete/mothballed/types.h | 0 .../variablewidthdatablock.cc | 0 .../variablewidthdatablock.hh | 0 .../incomplete/mothballed/voxel.H | 0 .../incomplete/sandbox/bitstruct/bitpack.c | 0 .../incomplete/sandbox/bitstruct/bitpack.h | 0 .../incomplete/sandbox/commandline/lexer.lex | 0 .../incomplete/sandbox/commandline/parser.y | 0 .../incomplete/sandbox/commandline/wrapper.cc | 0 .../incomplete/sandbox/cursesprinter.cc | 0 .../sandbox/datatypes/basenttyp/abilities.H | 0 .../incomplete/sandbox/datatypes/chunk.H | 0 .../sandbox/datatypes/chunk__directions.def | 0 .../sandbox/datatypes/chunk__magic.H | 0 .../incomplete/sandbox/datatypes/color.H | 0 .../encounter_wheel/encounter_wheel.cc | 0 .../encounter_wheel/encounter_wheel.h | 0 .../encounter_wheel/encounter_wheel.hh | 0 .../sandbox/datatypes/entity/ent_map.make | 0 .../sandbox/datatypes/lights/lighttype.h | 0 .../datatypes/lights/lighttype_map.make | 0 .../incomplete/sandbox/pathfinder_data.cc | 0 .../incomplete/sandbox/printer.H | 0 src/prealpha/incomplete/sandbox/printer.cc | 78 +++ .../incomplete/sandbox/reload_rooms.inc | 0 .../incomplete/sandbox/tiledata.H | 0 .../incomplete/sandbox/tileref.c | 0 .../incomplete/sandbox/voxelnodeid.c | 0 .../incomplete/scratchpad.d/dijkstra.c | 0 .../incomplete/scratchpad.d/dijkstra2.c | 0 .../incomplete/scratchpad.d/irrcontext.cc | 0 .../incomplete/scratchpad.d/loadvoxels.cc | 0 .../incomplete/scratchpad.d/roomcache.cc | 0 .../incomplete/scratchpad.d/round.c | 0 .../incomplete/scratchpad.d/scratchpad | 0 .../scratchpad.d/tiledata_and_texturecache.c | 0 src/{ => prealpha}/ongoing/CONFIG.DEF | 0 src/{ => prealpha}/ongoing/globals.inc | 0 src/{ => prealpha}/reference/badlexer.cc | 0 src/{ => prealpha}/reference/cuckootree.c | 0 src/{ => prealpha}/reference/evheap.c | 0 src/{ => prealpha}/reference/main.c | 0 src/{ => prealpha}/reference/oldtypes.h | 0 src/{ => prealpha}/reference/tmp.cnode | 0 .../rotten/bitconcat/bitconcat.c | 0 .../rotten/bitconcat/bitconcat.h | 0 src/{ => prealpha}/rotten/dlfunc_shim.h | 0 src/{ => prealpha}/rotten/fdshim.def | 0 src/{ => prealpha}/rotten/listf/listf.cc | 0 src/{ => prealpha}/rotten/listf/listf.h | 0 src/{ => prealpha}/rotten/random/random.c | 0 src/{ => prealpha}/rotten/random/random.h | 0 .../rotten/structops/structops.c | 0 .../rotten/structops/structops.h | 0 src/{ => prealpha}/stable/barrelroll.inl | 0 .../stable/cursescat/cursescat.c | 0 .../stable/cursescat/cursescat.h | 0 src/{ => prealpha}/stable/loops.def | 0 src/{ => prealpha}/stable/threequal.tmpl | 0 textures/diamond.png | Bin 152 -> 195 bytes textures/diamond_shape.png | Bin 0 -> 152 bytes textures/err.png | Bin 0 -> 255 bytes textures/wormhole_ripple.gif | Bin 0 -> 2513 bytes 188 files changed, 1866 insertions(+), 100 deletions(-) create mode 100644 chunk_layout.md rename {questdialogs => questdialogs__old}/boom.c (100%) rename {questdialogs => questdialogs__old}/escape_newteammate_siren.depra (100%) rename {questdialogs => questdialogs__old}/farlook/spoilers_rogue_questgiver.txt (100%) rename {questdialogs => questdialogs__old}/lightningfractal.c (100%) rename {questdialogs => questdialogs__old}/old/avianquest (100%) rename {questdialogs => questdialogs__old}/old/knightquest (100%) rename {questdialogs => questdialogs__old}/old/questtemplate (100%) rename {questdialogs => questdialogs__old}/old/roguequest (100%) rename {questdialogs => questdialogs__old}/oracles.depra (100%) rename {questdialogs => questdialogs__old}/scene.nfo (100%) rename {questdialogs => questdialogs__old}/ship.txt (100%) rename {questdialogs => questdialogs__old}/true_ending_start.txt (100%) rename {questdialogs => questdialogs__old}/trueneutral_unspecified_rogue__beginning.txt (100%) rename {questdialogs => questdialogs__old}/twomasters.depra (100%) rename {questdialogs => questdialogs__old}/volcanomancy.depra (100%) create mode 100644 src/alpha/TODO rename src/{working => alpha}/build.sh (100%) rename src/{working => alpha}/main.cc (99%) create mode 100644 src/alpha/main_altindent.cc create mode 100644 src/alpha/main_physics.cc create mode 100755 src/alpha/modularized/build.sh create mode 100644 src/alpha/modularized/commandline.incplusplus create mode 100644 src/alpha/modularized/datatypes/camcoord.incplusplus create mode 100644 src/alpha/modularized/eventloop.incplusplus create mode 100644 src/alpha/modularized/globals.incplusplus create mode 100644 src/alpha/modularized/hardcodedfunctions/changecolors.incplusplus create mode 100644 src/alpha/modularized/irrcontext.incplusplus create mode 100644 src/alpha/modularized/jitterbug.incplusplus create mode 100644 src/alpha/modularized/main.cc create mode 100644 src/alpha/modularized/maineventloop.incplusplus create mode 100644 src/alpha/modularized/ncursesthread.incplusplus create mode 100644 src/alpha/modularized/physics/AKNOWLADGEMENTS create mode 100644 src/alpha/modularized/scripting.incplusplus rename src/{stable => alpha/sandbox}/base1.def (100%) rename src/{incomplete => alpha}/sandbox/bitvector/bitvector16.c (100%) rename src/{incomplete => alpha}/sandbox/bitvector/bitvector32.c (100%) rename src/{incomplete => alpha}/sandbox/bitvector/bitvector64.c (100%) rename src/{incomplete => alpha}/sandbox/bitvector/bitvector8.c (100%) rename src/{incomplete => alpha}/sandbox/coord.c (100%) rename src/{stable => alpha/sandbox}/cppkeyword.def (100%) create mode 100644 src/alpha/sandbox/handle_collisions.cc create mode 100644 src/alpha/sandbox/ode_physics.cc rename src/{rotten/util/util.h => alpha/sandbox/util/util.H} (85%) rename src/{rotten => alpha/sandbox}/util/util.c (87%) rename src/{rotten => alpha/sandbox}/util/util.def (85%) delete mode 100644 src/incomplete/sandbox/printer.cc rename src/{ => prealpha}/deprecated/archive.c (100%) rename src/{ => prealpha}/deprecated/atomic_mutex.d/atomic_mutex.c (100%) rename src/{ => prealpha}/deprecated/atomic_mutex.d/atomic_mutex.h (100%) rename src/{ => prealpha}/deprecated/bettersavefileio.c (100%) rename src/{ => prealpha}/deprecated/concepts.txt (100%) rename src/{ => prealpha}/deprecated/doublelinkedlist.cc (100%) rename src/{ => prealpha}/deprecated/evheap.c (100%) rename src/{ => prealpha}/deprecated/exists.tmpl (100%) rename src/{ => prealpha}/deprecated/extmodules.cc (100%) rename src/{ => prealpha}/deprecated/flywheel.cpseudo (100%) rename src/{ => prealpha}/deprecated/funstack.c (100%) rename src/{ => prealpha}/deprecated/getsafe.d/getsafe.cc (100%) rename src/{ => prealpha}/deprecated/getsafe.d/getsafe.h (100%) rename src/{ => prealpha}/deprecated/globalvar.cc (100%) rename src/{ => prealpha}/deprecated/heapio.c (100%) rename src/{ => prealpha}/deprecated/heapio2.c (100%) rename src/{ => prealpha}/deprecated/lightning.psudoexpr (100%) rename src/{ => prealpha}/deprecated/lighttree.c (100%) rename src/{ => prealpha}/deprecated/plugin.cc (100%) rename src/{ => prealpha}/deprecated/plugin.cclass (100%) rename src/{ => prealpha}/deprecated/plugin.h (100%) rename src/{ => prealpha}/deprecated/pure_c_shared_mutex.c (100%) rename src/{ => prealpha}/deprecated/renderstack.c (100%) rename src/{ => prealpha}/deprecated/savefileio.cc (100%) rename src/{ => prealpha}/deprecated/scalar.c (100%) rename src/{ => prealpha}/deprecated/strangemutex.cc (100%) rename src/{ => prealpha}/deprecated/texturetree.c (100%) rename src/{ => prealpha}/deprecated/uuidtypes.def (100%) rename src/{ => prealpha}/deprecated/vectors.d/vectors.c (100%) rename src/{ => prealpha}/deprecated/vectors.d/vectors.c.m4 (100%) rename src/{ => prealpha}/deprecated/vectors.d/vectors.h (100%) rename src/{ => prealpha}/deprecated/vectors.d/vectors.h.m4 (100%) rename src/{ => prealpha}/deprecated/wrapper___std___shared_mutex.cc (100%) rename src/{ => prealpha}/incomplete/TODO (100%) rename src/{ => prealpha}/incomplete/launchpad/camcoord.cc (100%) rename src/{ => prealpha}/incomplete/launchpad/directory/directory.hh (100%) rename src/{ => prealpha}/incomplete/launchpad/directory/tmp_directory.tmpl (100%) rename src/{ => prealpha}/incomplete/launchpad/minifixed.cc (100%) rename src/{ => prealpha}/incomplete/launchpad/ncursesnoise.c (100%) rename src/{ => prealpha}/incomplete/launchpad/slurp.cc (100%) rename src/{ => prealpha}/incomplete/mothballed/argvlogic.h (100%) rename src/{ => prealpha}/incomplete/mothballed/as_moduleglue.cc (100%) rename src/{ => prealpha}/incomplete/mothballed/build.sh (100%) rename src/{ => prealpha}/incomplete/mothballed/chunk.H (100%) rename src/{ => prealpha}/incomplete/mothballed/chunk.fragment (100%) rename src/{ => prealpha}/incomplete/mothballed/commandline.hh (100%) rename src/{ => prealpha}/incomplete/mothballed/commandlinesyntax.txt (100%) rename src/{ => prealpha}/incomplete/mothballed/doublelinkedlist.d/refcounted.cc (100%) rename src/{ => prealpha}/incomplete/mothballed/doublelinkedlist.d/refcounted.h (100%) rename src/{ => prealpha}/incomplete/mothballed/doublelinkedlist.d/refcounted.hh (100%) rename src/{ => prealpha}/incomplete/mothballed/flywheel/flywheel.cclass (100%) rename src/{ => prealpha}/incomplete/mothballed/flywheel/flywheel.hh (100%) rename src/{ => prealpha}/incomplete/mothballed/iwf__chunk.cc (100%) rename src/{ => prealpha}/incomplete/mothballed/iwf__graphics3d.cc (100%) rename src/{ => prealpha}/incomplete/mothballed/iwf__voxels__minichunk/C_iwf__voxels__minichunk.cc (100%) rename src/{ => prealpha}/incomplete/mothballed/iwf__voxels__minichunk/C_iwf__voxels__minichunk.h (100%) rename src/{ => prealpha}/incomplete/mothballed/iwf__voxels__minichunk/iwf__voxels__minichunk.cclass (100%) rename src/{ => prealpha}/incomplete/mothballed/iwf__voxels__minichunk/iwf__voxels__minichunk.hh (100%) rename src/{ => prealpha}/incomplete/mothballed/iwf_joystick.c (100%) rename src/{ => prealpha}/incomplete/mothballed/keyswitch.inc (100%) rename src/{ => prealpha}/incomplete/mothballed/listcontainer.cc (100%) rename src/{ => prealpha}/incomplete/mothballed/magnetoception.txt (100%) rename src/{ => prealpha}/incomplete/mothballed/main.cc (100%) rename src/{ => prealpha}/incomplete/mothballed/memdump.pseudoc (100%) rename src/{ => prealpha}/incomplete/mothballed/octanttriple.c (100%) rename src/{ => prealpha}/incomplete/mothballed/pools.cc (100%) rename src/{ => prealpha}/incomplete/mothballed/refcount.d/refcounted.cc (100%) rename src/{ => prealpha}/incomplete/mothballed/refcount.d/refcounted.h (100%) rename src/{ => prealpha}/incomplete/mothballed/refcount.d/refcounted.hh (100%) rename src/{ => prealpha}/incomplete/mothballed/repl.cc (100%) rename src/{ => prealpha}/incomplete/mothballed/scriptboot.cc (100%) rename src/{ => prealpha}/incomplete/mothballed/seedcrypt.cc (100%) rename src/{ => prealpha}/incomplete/mothballed/seedcrypt.h (100%) rename src/{ => prealpha}/incomplete/mothballed/seedcrypt.hlib (100%) rename src/{ => prealpha}/incomplete/mothballed/split.cc (100%) rename src/{ => prealpha}/incomplete/mothballed/startup.cc (100%) rename src/{ => prealpha}/incomplete/mothballed/types.h (100%) rename src/{ => prealpha}/incomplete/mothballed/variablewidthdatablock/variablewidthdatablock.cc (100%) rename src/{ => prealpha}/incomplete/mothballed/variablewidthdatablock/variablewidthdatablock.hh (100%) rename src/{ => prealpha}/incomplete/mothballed/voxel.H (100%) rename src/{ => prealpha}/incomplete/sandbox/bitstruct/bitpack.c (100%) rename src/{ => prealpha}/incomplete/sandbox/bitstruct/bitpack.h (100%) rename src/{ => prealpha}/incomplete/sandbox/commandline/lexer.lex (100%) rename src/{ => prealpha}/incomplete/sandbox/commandline/parser.y (100%) rename src/{ => prealpha}/incomplete/sandbox/commandline/wrapper.cc (100%) rename src/{ => prealpha}/incomplete/sandbox/cursesprinter.cc (100%) rename src/{ => prealpha}/incomplete/sandbox/datatypes/basenttyp/abilities.H (100%) rename src/{ => prealpha}/incomplete/sandbox/datatypes/chunk.H (100%) rename src/{ => prealpha}/incomplete/sandbox/datatypes/chunk__directions.def (100%) rename src/{ => prealpha}/incomplete/sandbox/datatypes/chunk__magic.H (100%) rename src/{ => prealpha}/incomplete/sandbox/datatypes/color.H (100%) rename src/{ => prealpha}/incomplete/sandbox/datatypes/encounter_wheel/encounter_wheel.cc (100%) rename src/{ => prealpha}/incomplete/sandbox/datatypes/encounter_wheel/encounter_wheel.h (100%) rename src/{ => prealpha}/incomplete/sandbox/datatypes/encounter_wheel/encounter_wheel.hh (100%) rename src/{ => prealpha}/incomplete/sandbox/datatypes/entity/ent_map.make (100%) rename src/{ => prealpha}/incomplete/sandbox/datatypes/lights/lighttype.h (100%) rename src/{ => prealpha}/incomplete/sandbox/datatypes/lights/lighttype_map.make (100%) rename src/{ => prealpha}/incomplete/sandbox/pathfinder_data.cc (100%) rename src/{ => prealpha}/incomplete/sandbox/printer.H (100%) create mode 100644 src/prealpha/incomplete/sandbox/printer.cc rename src/{ => prealpha}/incomplete/sandbox/reload_rooms.inc (100%) rename src/{ => prealpha}/incomplete/sandbox/tiledata.H (100%) rename src/{ => prealpha}/incomplete/sandbox/tileref.c (100%) rename src/{ => prealpha}/incomplete/sandbox/voxelnodeid.c (100%) rename src/{ => prealpha}/incomplete/scratchpad.d/dijkstra.c (100%) rename src/{ => prealpha}/incomplete/scratchpad.d/dijkstra2.c (100%) rename src/{ => prealpha}/incomplete/scratchpad.d/irrcontext.cc (100%) rename src/{ => prealpha}/incomplete/scratchpad.d/loadvoxels.cc (100%) rename src/{ => prealpha}/incomplete/scratchpad.d/roomcache.cc (100%) rename src/{ => prealpha}/incomplete/scratchpad.d/round.c (100%) rename src/{ => prealpha}/incomplete/scratchpad.d/scratchpad (100%) rename src/{ => prealpha}/incomplete/scratchpad.d/tiledata_and_texturecache.c (100%) rename src/{ => prealpha}/ongoing/CONFIG.DEF (100%) rename src/{ => prealpha}/ongoing/globals.inc (100%) rename src/{ => prealpha}/reference/badlexer.cc (100%) rename src/{ => prealpha}/reference/cuckootree.c (100%) rename src/{ => prealpha}/reference/evheap.c (100%) rename src/{ => prealpha}/reference/main.c (100%) rename src/{ => prealpha}/reference/oldtypes.h (100%) rename src/{ => prealpha}/reference/tmp.cnode (100%) rename src/{ => prealpha}/rotten/bitconcat/bitconcat.c (100%) rename src/{ => prealpha}/rotten/bitconcat/bitconcat.h (100%) rename src/{ => prealpha}/rotten/dlfunc_shim.h (100%) rename src/{ => prealpha}/rotten/fdshim.def (100%) rename src/{ => prealpha}/rotten/listf/listf.cc (100%) rename src/{ => prealpha}/rotten/listf/listf.h (100%) rename src/{ => prealpha}/rotten/random/random.c (100%) rename src/{ => prealpha}/rotten/random/random.h (100%) rename src/{ => prealpha}/rotten/structops/structops.c (100%) rename src/{ => prealpha}/rotten/structops/structops.h (100%) rename src/{ => prealpha}/stable/barrelroll.inl (100%) rename src/{ => prealpha}/stable/cursescat/cursescat.c (100%) rename src/{ => prealpha}/stable/cursescat/cursescat.h (100%) rename src/{ => prealpha}/stable/loops.def (100%) rename src/{ => prealpha}/stable/threequal.tmpl (100%) create mode 100644 textures/diamond_shape.png create mode 100644 textures/err.png create mode 100644 textures/wormhole_ripple.gif diff --git a/README.md b/README.md index 62130c3..82ffb5d 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,8 @@ to have smooth(ish) sailing through to a working alpha! The game engine uses the [Irrlicht Engine](http://irrlicht.sourceforge.net/) for rendering 3d -graphics, [Cairo Graphics](https://www.cairographics.org/) for 2d graphics, +graphics, the [Open Dynamics Engine](http://www.ode.org/) for physics, +[Cairo Graphics](https://www.cairographics.org/) for 2d graphics, [NCurses](https://invisible-island.net/ncurses/) for interactive menus, `` for story dialog, and [lua](https://www.lua.org/) for scripting and a command line.\ @@ -73,32 +74,35 @@ CODING STYLE ============ occasionally, a type of C coding called "Object Style C" will be used, -which takes the following form: -`namespace$$pseudo_class$$method(pseudo_object,arg,arg,arg...)` +which takes the following form: +`namespace$$pseudo_class$$method(pseudo_object,arg,arg,arg...)` +The order of the method call and the object are just reversed. functions that in fortran would be called "subroutines" are also used, and will be denoted by returning an implicit int or the SYSINT macro (which evaluates to the empty string *(implicit int)* in C and to `int` in C++) -the types in `` (or ) should be used when an integer +the types in `` (or ``) should be used when an integer of a specific width is required, with the exception that `char` should be prefferred to `int8_t`, and `unsigned char` should be prefferred to `uint8_t`. if an interger bitfield uses less than the full number of -bytes in an int, then it should be signed; otherwise it should -(*usually*) be unsigned. +bytes in an int, then it should be signed; otherwise it should (*usually*) +be unsigned. `struct`s should be catagorized into bitpacked structs and loosly-packed structs. every field of a bitpacked struct should have an explicit width, and should be of type `signed`, `unsigned`, or `bool`. a loosly-packed -struct should never use explicit-width fields. bitpacked structs should -eventually be replaced with interger bitfields. +struct should never use explicit-width fields; a bitpacked struct should +never contain a type with implementation defined width (i.e. pointers). all +bitpacked structs should be replaced with intergals and manual packing +functions before beta. -sincle-pourpose classes for storing global state, to me at least, seems a -wholly useless concept; this is an interface without an instance. I will -try to implement these as namespaces (either C++ namespaces or using $$ as -described elsewhere), and will attempt to refer to such namespaces as -"daemons" (cf. system daemon) if the interface contains functions. +single-pourpose classes for storing global state should be avoided in +favor of namespaces. these namespaces will be called "daemons" (cf. system +daemon) if they contain functions. + +`goto` may be used in place of `break` when the latter looks ambiguous. since `this` is a reserved word in C++, and `self` is a reserved word in Objective-C, when using Object-Style-C, the object variable will be named @@ -109,24 +113,24 @@ similarly, since `new` is a keyword in C++ with a compleatly different meaning, an object that is being constructed by a function will be named `nova`. `input` may be employed as the primary, or only, argument of a function. `output` will be the return value. `acc` is an **acc**umulator, -and should be a register variable. +and should always (and only) be a register variable. variables with generic names follow the following conventions: - `x`, `y`, `z`, and `w` refer to coordinates. `w` isn't used often. -- `i` and `j` are `for`-loop iterators, either in the sense of C++ - `::iterator`s or in the sense of intergal counters -- `n` and `m` are generic numbers, usually for-loop intergal counters -- `tmp` is a temporary variable, usually holding an intermidiate value. +- `i` and `j` are `for`-loop iterators, either a C++ `::iterator` or an + intergal counter +- `n` and `m` are generic numbers, usually `for`-loop intergal counters +- `tmp` is a temporary variable, usually holding an intermidiate value or + a local copy of a shared resource. - `T` is a type in a template - `L` is a lua engine - `data` is the main data member of an object -a naming system similar to -[Systems Hungarian](https://en.wikipedia.org/wiki/Hungarian_notation) -is revived for the pourpose of manually mangling C functions that can -take multiple argument types, as this allows such functions to maintain C -linkage while also having faux overloads. this is similar to functions in -the C standard library such as `abs()` and `fabs()`. +some library functions use a naming system similar to the standard library +to denote the type of argument that they take (c.f. `man abs`, `man fabs`, +[Systems Hungarian](https://en.wikipedia.org/wiki/Hungarian_notation)). the +libraries that do this are written in C, and do not use operator +overloading. FILENAMES ========= @@ -199,6 +203,10 @@ modularly independant of the project, but which are being published for the first time as part of the project, at a later date under a less restrictive liscense. +Additionally, there are some files in the project that are offered under +the terms of the license that applies to the toutorials that I used to +create their initial contents. + *note: I originally intended to liscense the project under the GPLv3, and some parts of the source code archive have comments to this intent; I have since chosen to commit to the GPLv2 "or later" because of various potential @@ -209,10 +217,6 @@ signifigant disdain for legal trolls suppressing the advancement of knowladge, and I personally believe this liscense to be the best way of preventing such from happening in my relm of works.*** ---- - -\**note: as I've been learning, one of the things I've been teaching myself -has also been the git system; as a result, instead of branching the repo -at two specific "flag day" points of development, I *forked* it instead. -Mistakes were made. If you want to see these relics (you really don't), -I will leave them as-is.* +(even minimalizing the number of dependancies as I have, the license +propogation portion of my project has been extreamly time-consuming and +stressful) diff --git a/chunk_layout.md b/chunk_layout.md new file mode 100644 index 0000000..1234671 --- /dev/null +++ b/chunk_layout.md @@ -0,0 +1,9 @@ +CHUNK LAYOUT +============ + +randomly generated chunks must be packed into a cuboid area; this creates +problems as the game's world is sphereical. since I have no dillusions that +the graphics of the game will be stellar, this issue will be solved by +creating hard seams between areas, eleminating the projection issues +entirely. these will slightly resembal a similar cop-out that will be +employed to avoid rendering overlapping chunks. diff --git a/fantasy/avianinn.txt b/fantasy/avianinn.txt index 925ceb1..f0e213e 100644 --- a/fantasy/avianinn.txt +++ b/fantasy/avianinn.txt @@ -1,7 +1,9 @@ -Hello, traveler! -you are welcome to stay in our village, -so long as you bare us no ill will. +Hello, traveler! You are welcome to stay in our village, so long as you bare us no ill will.Rooms are 3 ore chunksm a night.Hmm? What's this made of? Electrum? Why would I want that?Thanks! Your room is the first one on the right[[m.*They hand you a key with the number 1 on it*Thanks! Your room is the second one on the right.*They hand you a key with the number 2 on it*Thanks! Your room is the third one on the right.*They hand you a key with the number 3 on it*Thanks! Your room is the last one on the right.*They hand you a key with the number 4 on it*Thanks! Your room is the first one on the left.*They hand you a key with the number 5 on it*Thanks! Your room is the second one on the left.*They hand you a key with the number 6 on it*Thanks! Your room is the third one on the left.*They hand you a key with the number 7 on it*Thanks! Your room is the last one on the left.*They hand you a key with the number 8 on it*Come again! + +Comments: +The script that calls this file will randomly choose a room for the player, +and recall the lines accordingly. The Sirens have no currency, and have an +abundant supply of precious metals, which forces the player to barter +various common items from elsewhere in the game's world for goods and +services. -hmm? what's this made of? silver? gold? -why would I need want that? -rooms are 3 ore a night. diff --git a/questdialogs/boom.c b/questdialogs__old/boom.c similarity index 100% rename from questdialogs/boom.c rename to questdialogs__old/boom.c diff --git a/questdialogs/escape_newteammate_siren.depra b/questdialogs__old/escape_newteammate_siren.depra similarity index 100% rename from questdialogs/escape_newteammate_siren.depra rename to questdialogs__old/escape_newteammate_siren.depra diff --git a/questdialogs/farlook/spoilers_rogue_questgiver.txt b/questdialogs__old/farlook/spoilers_rogue_questgiver.txt similarity index 100% rename from questdialogs/farlook/spoilers_rogue_questgiver.txt rename to questdialogs__old/farlook/spoilers_rogue_questgiver.txt diff --git a/questdialogs/lightningfractal.c b/questdialogs__old/lightningfractal.c similarity index 100% rename from questdialogs/lightningfractal.c rename to questdialogs__old/lightningfractal.c diff --git a/questdialogs/old/avianquest b/questdialogs__old/old/avianquest similarity index 100% rename from questdialogs/old/avianquest rename to questdialogs__old/old/avianquest diff --git a/questdialogs/old/knightquest b/questdialogs__old/old/knightquest similarity index 100% rename from questdialogs/old/knightquest rename to questdialogs__old/old/knightquest diff --git a/questdialogs/old/questtemplate b/questdialogs__old/old/questtemplate similarity index 100% rename from questdialogs/old/questtemplate rename to questdialogs__old/old/questtemplate diff --git a/questdialogs/old/roguequest b/questdialogs__old/old/roguequest similarity index 100% rename from questdialogs/old/roguequest rename to questdialogs__old/old/roguequest diff --git a/questdialogs/oracles.depra b/questdialogs__old/oracles.depra similarity index 100% rename from questdialogs/oracles.depra rename to questdialogs__old/oracles.depra diff --git a/questdialogs/scene.nfo b/questdialogs__old/scene.nfo similarity index 100% rename from questdialogs/scene.nfo rename to questdialogs__old/scene.nfo diff --git a/questdialogs/ship.txt b/questdialogs__old/ship.txt similarity index 100% rename from questdialogs/ship.txt rename to questdialogs__old/ship.txt diff --git a/questdialogs/true_ending_start.txt b/questdialogs__old/true_ending_start.txt similarity index 100% rename from questdialogs/true_ending_start.txt rename to questdialogs__old/true_ending_start.txt diff --git a/questdialogs/trueneutral_unspecified_rogue__beginning.txt b/questdialogs__old/trueneutral_unspecified_rogue__beginning.txt similarity index 100% rename from questdialogs/trueneutral_unspecified_rogue__beginning.txt rename to questdialogs__old/trueneutral_unspecified_rogue__beginning.txt diff --git a/questdialogs/twomasters.depra b/questdialogs__old/twomasters.depra similarity index 100% rename from questdialogs/twomasters.depra rename to questdialogs__old/twomasters.depra diff --git a/questdialogs/volcanomancy.depra b/questdialogs__old/volcanomancy.depra similarity index 100% rename from questdialogs/volcanomancy.depra rename to questdialogs__old/volcanomancy.depra diff --git a/src/alpha/TODO b/src/alpha/TODO new file mode 100644 index 0000000..0a7c53f --- /dev/null +++ b/src/alpha/TODO @@ -0,0 +1,16 @@ +- Redo chunk renderer (*AGAIN*) + - cache all 26 border chunk addresses + - colliding with an edge that connects to address 0 deals void damage + and imparts a force of 10 gees on the player in a direction + perpindicular to the interface (handled by the function that + re-alignes the global coordinate system when chunk boundries are + crossed) + - store chunk priority in case of two chunks being rendered in the same + space + - the interface to the chunk that is not rendered is is blocked by a + flat quad with an opaque ripple texture + - priority is only relevant between chunks with the same taxicab norm + from octant 0 + - a negative priority chunk is a room boundry, and uses a different + ripple texture. the chunk is never loaded, and crossing the boundry + causes a hard reload of all world-related engine state. diff --git a/src/working/build.sh b/src/alpha/build.sh similarity index 100% rename from src/working/build.sh rename to src/alpha/build.sh diff --git a/src/working/main.cc b/src/alpha/main.cc similarity index 99% rename from src/working/main.cc rename to src/alpha/main.cc index eecb2e4..de075df 100644 --- a/src/working/main.cc +++ b/src/alpha/main.cc @@ -69,6 +69,8 @@ std::atomic_int EXELINE[THREADCOUNT]; /***CUSTOM CLASSES***/ +#define DRAG(P,U,C,A) (.5 * P * (U * U) * C * A) + namespace iwf { namespace datatypes { class camcoord { public: @@ -83,7 +85,7 @@ class camcoord { return tmp; }}; }} - + namespace irrcontext { irr::IrrlichtDevice * device; irr::video::IVideoDriver * driver; diff --git a/src/alpha/main_altindent.cc b/src/alpha/main_altindent.cc new file mode 100644 index 0000000..2f9616c --- /dev/null +++ b/src/alpha/main_altindent.cc @@ -0,0 +1,425 @@ +/************** + * IWANNAFLY * + * * + * prealpha * + **************/ + +#define SNAPSHOT "AFTERNOON/26/07/2020" + +/* this program currently requires a second terminal to be used; this is + * done by passing the terminal's device file (which can be obtained with + * the command tty) as argv[1] and the device's $TERM value as argv[2]. you + * must have permission to open the device file as "r+". + * + * an example of invocation is: + * + * Iwannafly /dev/pts/1 xterm + * + * this is primarily to speed prototyping, and will not be necissary in the + * finished game; during development, all text input will be done using + * stdio, and all GUI interaction will be done using nCurses. + */ + +#define BEGIN { +#define END } +/* for namespaces and extern "C" blocks + * they screw up the new indenting scheme + */ + +#define SYSINT int +#define RGBColor(R,G,B) irr::video::SColor(0xFF,R,G,B) +#define RGBAColor(R,G,B,A) irr::video::SColor(A,R,G,B) + +#define POLLTIME 5000 + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +extern "C" BEGIN +#include +END //not C++ safe-- idk why this fixes it. + +/***GLOBALS***/ + +std::atomic_bool SCRAM; +std::atomic JITTER; +std::atomic JITTERMAX; +pthread_mutex_t JITTER_ADV_LOCK = PTHREAD_MUTEX_INITIALIZER; +float JITTER_ADVERAGE; +typedef std::map NODES_t; +NODES_t NODES; + +#define THREAD__MAIN 0 +#define THREAD__EVENT 1 +#define THREAD__JITTERBUG 2 +#define THREAD__NCURSES 3 +#define THREAD__LUA_SCRIPTING 4 +#define THREAD__LUA_COMMANDLINE 5 +#define THREADCOUNT 6 + +/***CUSTOM CLASSES***/ + +#define DRAG(P,U,C,A) (.5 * P * (U * U) * C * A) + +namespace iwf +BEGIN +namespace datatypes +BEGIN + +class camcoord + { public: + double az; + double el; + + irr::core::vector3df euclid () + { irr::core::vector3df tmp; + tmp.X = sin(this->el) * cos(this->az); + tmp.Y = sin(this->el) * sin(this->az); + tmp.Z = cos(this->el); + return tmp; + } }; + +END +END + +namespace irrcontext +BEGIN +irr::IrrlichtDevice * device; +irr::video::IVideoDriver * driver; +irr::scene::ISceneManager * smgr; +irr::gui::IGUIEnvironment * guienv; +irr::scene::IMeshManipulator * meshmanipr; +irr::gui::ICursorControl * cursctrl; +irr::ITimer * timer; +double deltatime; +uint32_t then; +uint32_t now; +END + +iwf::datatypes::camcoord CAMCOORD; +irr::scene::ICameraSceneNode * CAMERA; +pthread_mutex_t CAMLOCK = PTHREAD_MUTEX_INITIALIZER; +std::atomic_bool STEALCURSOR; +std::atomic_bool YINVERT; + +/***EVENT LOOP***/ + +class MainEventReciever : public irr::IEventReceiver +/* part of this program has been created using the toutorials at + * http://irrlicht.sourceforge.net/docu/pages.html + * + * (on a related note, have I mentioned the Ship of Theseus today?) + */ + { public: + virtual bool OnEvent (const irr::SEvent& event) + { if (JITTER >= JITTERMAX) return false; //did nothing + switch (event.EventType) + { case irr::EET_MOUSE_INPUT_EVENT : + switch (event.MouseInput.Event) + { case irr::EMIE_LMOUSE_PRESSED_DOWN : + { STEALCURSOR = true; + irrcontext::cursctrl->setVisible(0); + irrcontext::cursctrl->setPosition(0.5f,0.5f); + this->mouseCenter = irrcontext::cursctrl->getPosition(); + } break; + case irr::EMIE_MOUSE_MOVED : + if (!STEALCURSOR) return false; + else + { pthread_mutex_lock(&CAMLOCK); + CAMCOORD.el += + (event.MouseInput.Y - this->mouseCenter.Y) + * + (YINVERT ? -1 : 1) + * + (180 / M_PI) + * + (1 / 1000.0) + * + irrcontext::deltatime; + if (CAMCOORD.el >= 0.0) + CAMCOORD.el = 0 - (M_PI / 1000); + else if (CAMCOORD.el <= -M_PI) + CAMCOORD.el = -(M_PI - (M_PI / 1000)); + CAMCOORD.az += + (event.MouseInput.X - this->mouseCenter.X) + * + (180 / M_PI) + * + (1 / 1000.0) + * + irrcontext::deltatime; + while (CAMCOORD.az < -M_PI) + CAMCOORD.az += 2 * M_PI; + while (CAMCOORD.az > M_PI) + CAMCOORD.az -= 2 * M_PI; + pthread_mutex_unlock(&CAMLOCK); + irrcontext::cursctrl->setPosition(0.5f,0.5f); + } break; + default : break; + } + case (irr::EET_KEY_INPUT_EVENT) : + { if (event.KeyInput.PressedDown) + switch (event.KeyInput.Key) + { case irr::KEY_KEY_W : + { pthread_mutex_lock(&CAMLOCK); + CAMCOORD.el += 5 * irrcontext::deltatime; + if (CAMCOORD.el >= 0.0) + CAMCOORD.el = 0 - (M_PI / 1000); + pthread_mutex_unlock(&CAMLOCK); + } break; + case irr::KEY_KEY_S : + { pthread_mutex_lock(&CAMLOCK); + CAMCOORD.el -= 5 * irrcontext::deltatime; + if (CAMCOORD.el <= -M_PI) + CAMCOORD.el = -(M_PI - (M_PI / 1000)); + pthread_mutex_unlock(&CAMLOCK); + } break; + case irr::KEY_KEY_A : + { pthread_mutex_lock(&CAMLOCK); + CAMCOORD.az -= 5 * irrcontext::deltatime; + while (CAMCOORD.az < -M_PI) + CAMCOORD.az += 2 * M_PI; + pthread_mutex_unlock(&CAMLOCK); + } break; + case irr::KEY_KEY_D : + { pthread_mutex_lock(&CAMLOCK); + CAMCOORD.az += 5 * irrcontext::deltatime; + while (CAMCOORD.az > M_PI) + CAMCOORD.az -= 2 * M_PI; + pthread_mutex_unlock(&CAMLOCK); + } break; + case irr::KEY_ESCAPE : + { STEALCURSOR = 0; + irrcontext::cursctrl->setVisible(1); + } break; + case irr::KEY_KEY_Y : + { YINVERT = !YINVERT; + } break; + default : break; + } } break; + default : break; + } + return false; + } + private: + irr::core::vector2di mouseCenter; + }; + +MainEventReciever RECIEVER; + +/***JITTERBUG THREAD GOVERNER***/ + +void * iwf$$threads$$jitterbug$$loop (void * dummy) + { double localbuffer = 0.0; + for (;;usleep(POLLTIME)) + { + JITTER++; + if (JITTER == -1) + { + SCRAM = true; + return NULL; + } + localbuffer = ((JITTER * 3) + localbuffer) / 4; + if (!pthread_mutex_trylock(&JITTER_ADV_LOCK)) + { + JITTER_ADVERAGE = localbuffer; + pthread_mutex_unlock(&JITTER_ADV_LOCK); + } + } } + +pthread_t iwf$$threads$$jitterbug; + +/***NCURSES THREAD***/ + +SCREEN * CURSCREEN; + +void * iwf$$threads$$curses$$function (void * input) + { char *(*argv)[] = input; + for (int fg = 0;fg < 8;fg++) + { for (int bg = 0;bg < 8;bg++) + { init_pair(fg | (bg << 3),fg,bg); + } } + FILE * devfile = fopen((*argv)[1],"r+"); + if (devfile == NULL) + { fprintf(stderr,"%s\n(Not a typewriter?)\n",strerror(errno)); + printf("usage: %s <$TERM of tty> ...\n",(*argv)[0]); + SCRAM = true; + return NULL; + } + CURSCREEN = newterm((*argv)[2],devfile,devfile); + set_term(CURSCREEN); + raw(); + noecho(); + keypad(NULL,1); + mvprintw(3,3,"IWannaFly"); + mvprintw(4,4,"prealpha devtest"); + mvprintw(5,5,"revision snapshot:"); + mvprintw(6,5,SNAPSHOT); + irr::core::vector3df placeholder; + float placeholder2; + char tmp; + int tmp0; + int tmp1; + int tmp2; + int tmp4; + int tmp5; + for (;;sleep(1)) + { pthread_mutex_lock(&CAMLOCK); + mvprintw(8,8, + "camera azimuth : % 15.10f°",CAMCOORD.az * (180 / M_PI)); + mvprintw(9,8, + "camera elevation : % 15.10f°",CAMCOORD.el * (180 / M_PI)); + mvprintw(11,8, + "camera basis vector:"); + placeholder = CAMCOORD.euclid(); + pthread_mutex_unlock(&CAMLOCK); + mvprintw(12,10,"% 12.10fx",placeholder.X); + mvprintw(13,10,"% 12.10fy",placeholder.Y); + mvprintw(14,10,"% 12.10fz",placeholder.Z); + mvprintw(16,8,"cursor grabbed? >%s",STEALCURSOR ? "yes" : "no "); + pthread_mutex_lock(&JITTER_ADV_LOCK); + mvprintw(17,8,"adverage jitter : %4.4f",JITTER_ADVERAGE); + pthread_mutex_unlock(&JITTER_ADV_LOCK); + tmp = JITTERMAX; + mvprintw(18,8,"(max jitter : %3i)",tmp); + refresh(); + } }; + +pthread_t iwf$$threads$$curses; + +/***CHANGE THE COLORS***/ + +// lua code created using toutorials at lua.org + +static int LFunc$$changecolor (lua_State * L) + { int tmp[5]; + for (ptrdiff_t i = 0;i < 5;i++) + tmp[i] = lua_tointeger(L,i + 1); + { + NODES_t::iterator i = NODES.find(tmp[0]); + if (i != NODES.end()) + { + irrcontext::meshmanipr->setVertexColors(i->second->getMesh(),RGBAColor(tmp[1],tmp[2],tmp[3],tmp[4])); + return 0; + } } } + +static const struct luaL_Reg LLib$$changecolor [] = { + {"changecolor",LFunc$$changecolor}, + {NULL,NULL}}; + +/***INTERNAL SCRIPTING LUA THREAD***/ + +pthread_mutex_t SCRIPTPASS = PTHREAD_MUTEX_INITIALIZER; +bool SCRIPTGO; +std::string SCRIPTJOB; + +void * iwf$$threads$$lua__scripting$$function (void * dummy) + { lua_State * L = luaL_newstate(); + luaL_newlib(L,LLib$$changecolor); + lua_setglobal(L,"lib"); + for (;;usleep(POLLTIME)) + { + pthread_mutex_lock(&SCRIPTPASS); + if (SCRIPTGO) + { + luaL_dostring(L,SCRIPTJOB.c_str()); + SCRIPTJOB.clear(); + SCRIPTGO = false; + } + pthread_mutex_unlock(&SCRIPTPASS); + } + return NULL; + } + +pthread_t iwf$$threads$$lua__scripting; + +/***LUA COMMAND LINE THREAD***/ + +void * iwf$$threads$$lua__commandline$$function (void * dummy) + { lua_State * L = luaL_newstate(); + luaL_newlib(L,LLib$$changecolor); + lua_setglobal(L,"lib"); + printf("IWannaFly lua commandline\n]> "); + for (std::string buffer;;) + { getline(std::cin,buffer); + luaL_dostring(L,buffer.c_str()); + buffer.clear(); + printf("Done\n]> "); + } + return NULL; + } + +pthread_t iwf$$threads$$lua__commandline; + +/***INITIALIZATION***/ + +SYSINT initialize (char *argv[]) + { setvbuf(stdout, NULL, _IONBF, 0); + SCRAM = 0; + JITTERMAX = 0xF; + + pthread_create(&iwf$$threads$$curses,NULL,iwf$$threads$$curses$$function,argv); + pthread_create(&iwf$$threads$$jitterbug,NULL,iwf$$threads$$jitterbug$$loop,NULL); + pthread_create(&iwf$$threads$$lua__scripting,NULL,iwf$$threads$$lua__scripting$$function,NULL); + pthread_create(&iwf$$threads$$lua__commandline,NULL,iwf$$threads$$lua__commandline$$function,NULL); + + irrcontext::device = irr::createDevice(irr::video::EDT_OPENGL,irr::core::dimension2d(640, 480),16,false,false,false,&RECIEVER); + irrcontext::driver = irrcontext::device->getVideoDriver(); + irrcontext::smgr = irrcontext::device->getSceneManager(); + irrcontext::guienv = irrcontext::device->getGUIEnvironment(); + irrcontext::meshmanipr = irrcontext::smgr->getMeshManipulator(); + irrcontext::cursctrl = irrcontext::device->getCursorControl(); + irrcontext::timer = irrcontext::device->getTimer(); + + irrcontext::guienv->addStaticText(L"IWannaFly Devtest prealpha snapshot " SNAPSHOT,irr::core::rect(10,10,260,22),1); + CAMERA = irrcontext::smgr->addCameraSceneNode(NULL,irr::core::vector3df(0,0,0),irr::core::vector3df(1,1,1)); + CAMERA->setUpVector(irr::core::vector3df(0,0,1)); + + for (int x = -1;x < 2;x += 1) + { for (int y = -1;y < 2;y += 1) + { for (int z = -1;z < 2;z += 1) + { if (x || y || z) + { irr::scene::IMeshSceneNode * tmp = + irrcontext::smgr->addCubeSceneNode(10.0,NULL,((z * 9) + (y * 3) + x),irr::core::vector3df((x * 25),(y * 25),(z * 25))); + NODES[(z * 9) + (y * 3) + x] = tmp; + } } } } + irrcontext::smgr->addLightSceneNode(); + } + +/***MAIN, FEAT. RENDER LOOP***/ + +main (int argc, char *argv[]) + { if (argc < 2) + { printf("usage: %s <$TERM of tty> ...\n",argv[0]); + exit(1); + } + initialize(argv); + while (irrcontext::device->run()) + { JITTER = 0; + if (SCRAM) + exit(0); + pthread_mutex_lock(&CAMLOCK); + CAMERA->setTarget(CAMCOORD.euclid()); + pthread_mutex_unlock(&CAMLOCK); + irrcontext::driver->beginScene(true, true, RGBAColor(0,0,0xAA,0xF0)); + irrcontext::smgr->drawAll(); + irrcontext::guienv->drawAll(); + irrcontext::driver->endScene(); + irrcontext::now = irrcontext::timer->getTime(); + irrcontext::deltatime = (irrcontext::now - irrcontext::then) / 1000.0; + irrcontext::then = irrcontext::now; + } } diff --git a/src/alpha/main_physics.cc b/src/alpha/main_physics.cc new file mode 100644 index 0000000..de075df --- /dev/null +++ b/src/alpha/main_physics.cc @@ -0,0 +1,474 @@ +/************** + * IWANNAFLY * + * * + * prealpha * + **************/ + +#define SNAPSHOT "AFTERNOON/26/07/2020" + +/* this program currently requires a second terminal to be used; this is + * done by passing the terminal's device file (which can be obtained with + * the command tty) as argv[1] and the device's $TERM value as argv[2]. you + * must have permission to open the device file as "r+". + * + * an example of invocation is: + * + * Iwannafly /dev/pts/1 xterm + * + * this is primarily to speed prototyping, and will not be necissary in the + * finished game; during development, all text input will be done using + * stdio, and all GUI interaction will be done using nCurses. + */ + +#define SYSINT int +#define RGBColor(R,G,B) irr::video::SColor(0xFF,R,G,B) +#define RGBAColor(R,G,B,A) irr::video::SColor(A,R,G,B) + +#define POLLTIME 5000 + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +extern "C" { + #include + } //not C++ safe-- idk why this fixes it. + +/***GLOBALS***/ + +std::atomic_bool SCRAM; +std::atomic JITTER; +std::atomic JITTERMAX; +pthread_mutex_t JITTER_ADV_LOCK = PTHREAD_MUTEX_INITIALIZER; +float JITTER_ADVERAGE; +typedef std::map NODES_t; +NODES_t NODES; + +#define THREAD__MAIN 0 +#define THREAD__EVENT 1 +#define THREAD__JITTERBUG 2 +#define THREAD__NCURSES 3 +#define THREAD__LUA_SCRIPTING 4 +#define THREAD__LUA_COMMANDLINE 5 +#define THREADCOUNT 6 +std::atomic_int EXELINE[THREADCOUNT]; +#define CHECKPOINT(X,Y) EXELINE[X] = Y + +/***CUSTOM CLASSES***/ + +#define DRAG(P,U,C,A) (.5 * P * (U * U) * C * A) + +namespace iwf { namespace datatypes { +class camcoord { + public: + double az; + double el; + + irr::core::vector3df euclid () { + irr::core::vector3df tmp; + tmp.X = sin(this->el) * cos(this->az); + tmp.Y = sin(this->el) * sin(this->az); + tmp.Z = cos(this->el); + return tmp; + }}; +}} + +namespace irrcontext { + irr::IrrlichtDevice * device; + irr::video::IVideoDriver * driver; + irr::scene::ISceneManager * smgr; + irr::gui::IGUIEnvironment * guienv; + irr::scene::IMeshManipulator * meshmanipr; + irr::gui::ICursorControl * cursctrl; + irr::ITimer * timer; + double deltatime; + uint32_t then; + uint32_t now; + } + +iwf::datatypes::camcoord CAMCOORD; +irr::scene::ICameraSceneNode * CAMERA; +pthread_mutex_t CAMLOCK = PTHREAD_MUTEX_INITIALIZER; +std::atomic_bool STEALCURSOR; +std::atomic_bool YINVERT; + +/***EVENT LOOP***/ + +class MainEventReciever : public irr::IEventReceiver { +/* part of this program has been created using the toutorials at + * http://irrlicht.sourceforge.net/docu/pages.html + * + * (on a related note, have I mentioned the Ship of Theseus today?) + */ + public: + virtual bool OnEvent (const irr::SEvent& event) { + CHECKPOINT(THREAD__EVENT,__LINE__); + if (JITTER >= JITTERMAX) { + CHECKPOINT(THREAD__EVENT,__LINE__); + return false; //did nothing + } + CHECKPOINT(THREAD__EVENT,__LINE__); + switch (event.EventType) { + CHECKPOINT(THREAD__EVENT,__LINE__); + case irr::EET_MOUSE_INPUT_EVENT : switch (event.MouseInput.Event) { + CHECKPOINT(THREAD__EVENT,__LINE__); + case irr::EMIE_LMOUSE_PRESSED_DOWN : { + CHECKPOINT(THREAD__EVENT,__LINE__); + STEALCURSOR = true; + irrcontext::cursctrl->setVisible(0); + irrcontext::cursctrl->setPosition(0.5f,0.5f); + this->mouseCenter = irrcontext::cursctrl->getPosition(); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + case irr::EMIE_MOUSE_MOVED : if (!STEALCURSOR) { + return false; + } else { + CHECKPOINT(THREAD__EVENT,__LINE__); + pthread_mutex_lock(&CAMLOCK); + CAMCOORD.el += (event.MouseInput.Y - this->mouseCenter.Y) * (YINVERT ? -1 : 1) * (180 / M_PI) * (1 / 1000.0) * irrcontext::deltatime; + if (CAMCOORD.el >= 0.0) { + CAMCOORD.el = 0 - (M_PI / 1000); + } else if (CAMCOORD.el <= -M_PI) { + CAMCOORD.el = -(M_PI - (M_PI / 1000)); + } + CAMCOORD.az += (event.MouseInput.X - this->mouseCenter.X) * (180 / M_PI) * (1 / 1000.0) * irrcontext::deltatime; + while (CAMCOORD.az < -M_PI) { + CAMCOORD.az += 2 * M_PI; + } while (CAMCOORD.az > M_PI) { + CAMCOORD.az -= 2 * M_PI; + } + pthread_mutex_unlock(&CAMLOCK); + irrcontext::cursctrl->setPosition(0.5f,0.5f); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + default : break; + } + case (irr::EET_KEY_INPUT_EVENT) : { + CHECKPOINT(THREAD__EVENT,__LINE__); + if (event.KeyInput.PressedDown) { + CHECKPOINT(THREAD__EVENT,__LINE__); + switch (event.KeyInput.Key) { + + case irr::KEY_KEY_W : { + CHECKPOINT(THREAD__EVENT,__LINE__); + pthread_mutex_lock(&CAMLOCK); + CAMCOORD.el += 5 * irrcontext::deltatime; + if (CAMCOORD.el >= 0.0) { + CAMCOORD.el = 0 - (M_PI / 1000); + } + pthread_mutex_unlock(&CAMLOCK); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + + case irr::KEY_KEY_S : { + CHECKPOINT(THREAD__EVENT,__LINE__); + pthread_mutex_lock(&CAMLOCK); + CAMCOORD.el -= 5 * irrcontext::deltatime; + if (CAMCOORD.el <= -M_PI) { + CAMCOORD.el = -(M_PI - (M_PI / 1000)); + } + pthread_mutex_unlock(&CAMLOCK); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + + case irr::KEY_KEY_A : { + CHECKPOINT(THREAD__EVENT,__LINE__); + pthread_mutex_lock(&CAMLOCK); + CAMCOORD.az -= 5 * irrcontext::deltatime; + while (CAMCOORD.az < -M_PI) { + CAMCOORD.az += 2 * M_PI; + } + pthread_mutex_unlock(&CAMLOCK); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + + case irr::KEY_KEY_D : { + CHECKPOINT(THREAD__EVENT,__LINE__); + pthread_mutex_lock(&CAMLOCK); + CAMCOORD.az += 5 * irrcontext::deltatime; + while (CAMCOORD.az > M_PI) { + CAMCOORD.az -= 2 * M_PI; + } + pthread_mutex_unlock(&CAMLOCK); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + + case irr::KEY_ESCAPE : { + CHECKPOINT(THREAD__EVENT,__LINE__); + STEALCURSOR = 0; + irrcontext::cursctrl->setVisible(1); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + + case irr::KEY_KEY_Y : { + CHECKPOINT(THREAD__EVENT,__LINE__); + YINVERT = !YINVERT; + } break; + + default : break; + }}} break; + default : break; + } + CHECKPOINT(THREAD__EVENT,__LINE__); + return false; + } + private: + irr::core::vector2di mouseCenter; + }; + +MainEventReciever RECIEVER; + +/***JITTERBUG THREAD GOVERNER***/ + +void * iwf$$threads$$jitterbug$$loop (void * dummy) { + double localbuffer = 0.0; + for (;;usleep(POLLTIME)) { + CHECKPOINT(THREAD__JITTERBUG,__LINE__); + JITTER++; + if (JITTER == -1) { + SCRAM = true; + return NULL; + } + CHECKPOINT(THREAD__JITTERBUG,__LINE__); + localbuffer = ((JITTER * 3) + localbuffer) / 4; + if (!pthread_mutex_trylock(&JITTER_ADV_LOCK)) { + CHECKPOINT(THREAD__JITTERBUG,__LINE__); + JITTER_ADVERAGE = localbuffer; + pthread_mutex_unlock(&JITTER_ADV_LOCK); + } + CHECKPOINT(THREAD__JITTERBUG,__LINE__); + }} + +pthread_t iwf$$threads$$jitterbug; + +/***NCURSES THREAD***/ + +SCREEN * CURSCREEN; + +void * iwf$$threads$$curses$$function (void * input) { + char *(*argv)[] = input; + for (int fg = 0;fg < 8;fg++) { + for (int bg = 0;bg < 8;bg++) { + init_pair(fg | (bg << 3),fg,bg); + }} + FILE * devfile = fopen((*argv)[1],"r+"); + if (devfile == NULL) { + fprintf(stderr,"%s\n(Not a typewriter?)\n",strerror(errno)); + printf("usage: %s <$TERM of tty> ...\n",(*argv)[0]); + SCRAM = true; + return NULL; + } + + CURSCREEN = newterm((*argv)[2],devfile,devfile); + set_term(CURSCREEN); + + raw(); + noecho(); + keypad(NULL,1); + + mvprintw(3,3,"IWannaFly"); + mvprintw(4,4,"prealpha devtest"); + mvprintw(5,5,"revision snapshot:"); + mvprintw(6,5,SNAPSHOT); + + irr::core::vector3df placeholder; + float placeholder2; + char tmp; + int tmp0; + int tmp1; + int tmp2; + int tmp4; + int tmp5; + + for (;;sleep(1)) { + CHECKPOINT(THREAD__NCURSES,__LINE__); + pthread_mutex_lock(&CAMLOCK); + mvprintw(8,8,"camera azimuth : % 15.10f°",CAMCOORD.az * (180 / M_PI)); + mvprintw(9,8,"camera elevation : % 15.10f°",CAMCOORD.el * (180 / M_PI)); + mvprintw(11,8,"camera basis vector:"); + placeholder = CAMCOORD.euclid(); + pthread_mutex_unlock(&CAMLOCK); + CHECKPOINT(THREAD__NCURSES,__LINE__); + mvprintw(12,10,"% 12.10fx",placeholder.X); + mvprintw(13,10,"% 12.10fy",placeholder.Y); + mvprintw(14,10,"% 12.10fz",placeholder.Z); + mvprintw(16,8,"cursor grabbed? >%s",STEALCURSOR ? "yes" : "no "); + CHECKPOINT(THREAD__NCURSES,__LINE__); + pthread_mutex_lock(&JITTER_ADV_LOCK); + mvprintw(17,8,"adverage jitter : %4.4f",JITTER_ADVERAGE); + pthread_mutex_unlock(&JITTER_ADV_LOCK); + + CHECKPOINT(THREAD__NCURSES,__LINE__); + tmp = JITTERMAX; + mvprintw(18,8,"(max jitter : %3i)",tmp); + CHECKPOINT(THREAD__NCURSES,__LINE__); + + tmp0 = EXELINE[0]; + tmp1 = EXELINE[1]; + tmp2 = EXELINE[2]; + tmp4 = EXELINE[4]; + tmp5 = EXELINE[5]; + CHECKPOINT(THREAD__NCURSES,__LINE__); + mvprintw(20,8,"line of execution : % 4i % 4i % 4i SELF % 4i % 4i",tmp0,tmp1,tmp2,tmp4,tmp5); + + CHECKPOINT(THREAD__NCURSES,__LINE__); + refresh(); + CHECKPOINT(THREAD__NCURSES,__LINE__); + }}; + +pthread_t iwf$$threads$$curses; + +/***CHANGE THE COLORS***/ + +// lua code created using toutorials at lua.org + +static int LFunc$$changecolor (lua_State * L) { + int tmp[5]; + for (ptrdiff_t i = 0;i < 5;i++) { + tmp[i] = lua_tointeger(L,i + 1); + }{ + NODES_t::iterator i = NODES.find(tmp[0]); + if (i != NODES.end()) { + irrcontext::meshmanipr->setVertexColors(i->second->getMesh(),RGBAColor(tmp[1],tmp[2],tmp[3],tmp[4])); + return 0; + }}} + +static const struct luaL_Reg LLib$$changecolor [] = { + {"changecolor",LFunc$$changecolor}, + {NULL,NULL} + }; + +/***INTERNAL SCRIPTING LUA THREAD***/ + +pthread_mutex_t SCRIPTPASS = PTHREAD_MUTEX_INITIALIZER; +bool SCRIPTGO; +std::string SCRIPTJOB; + +void * iwf$$threads$$lua__scripting$$function (void * dummy) { + lua_State * L = luaL_newstate(); + luaL_newlib(L,LLib$$changecolor); + lua_setglobal(L,"lib"); + for (;;usleep(POLLTIME)) { + pthread_mutex_lock(&SCRIPTPASS); + CHECKPOINT(THREAD__LUA_SCRIPTING,__LINE__); + if (SCRIPTGO) { + luaL_dostring(L,SCRIPTJOB.c_str()); + SCRIPTJOB.clear(); + SCRIPTGO = false; + } + pthread_mutex_unlock(&SCRIPTPASS); + CHECKPOINT(THREAD__LUA_SCRIPTING,__LINE__); + } + return NULL; + } + +pthread_t iwf$$threads$$lua__scripting; + +/***LUA COMMAND LINE THREAD***/ + +void * iwf$$threads$$lua__commandline$$function (void * dummy) { + lua_State * L = luaL_newstate(); + luaL_newlib(L,LLib$$changecolor); + lua_setglobal(L,"lib"); + printf("IWannaFly lua commandline\n]> "); + for (std::string buffer;;) { + CHECKPOINT(THREAD__LUA_COMMANDLINE,__LINE__); + getline(std::cin,buffer); + CHECKPOINT(THREAD__LUA_COMMANDLINE,__LINE__); + luaL_dostring(L,buffer.c_str()); + CHECKPOINT(THREAD__LUA_COMMANDLINE,__LINE__); + buffer.clear(); + CHECKPOINT(THREAD__LUA_COMMANDLINE,__LINE__); + printf("Done\n]> "); + } + return NULL; + } + +pthread_t iwf$$threads$$lua__commandline; + +/***INITIALIZATION***/ + +SYSINT initialize (char *argv[]) { + setvbuf(stdout, NULL, _IONBF, 0); + SCRAM = 0; + JITTERMAX = 0xF; + + pthread_create(&iwf$$threads$$curses,NULL,iwf$$threads$$curses$$function,argv); + pthread_create(&iwf$$threads$$jitterbug,NULL,iwf$$threads$$jitterbug$$loop,NULL); + pthread_create(&iwf$$threads$$lua__scripting,NULL,iwf$$threads$$lua__scripting$$function,NULL); + pthread_create(&iwf$$threads$$lua__commandline,NULL,iwf$$threads$$lua__commandline$$function,NULL); + + irrcontext::device = irr::createDevice(irr::video::EDT_OPENGL,irr::core::dimension2d(640, 480),16,false,false,false,&RECIEVER); + irrcontext::driver = irrcontext::device->getVideoDriver(); + irrcontext::smgr = irrcontext::device->getSceneManager(); + irrcontext::guienv = irrcontext::device->getGUIEnvironment(); + irrcontext::meshmanipr = irrcontext::smgr->getMeshManipulator(); + irrcontext::cursctrl = irrcontext::device->getCursorControl(); + irrcontext::timer = irrcontext::device->getTimer(); + + irrcontext::guienv->addStaticText(L"IWannaFly Devtest prealpha snapshot " SNAPSHOT,irr::core::rect(10,10,260,22),1); + CAMERA = irrcontext::smgr->addCameraSceneNode(NULL,irr::core::vector3df(0,0,0),irr::core::vector3df(1,1,1)); + CAMERA->setUpVector(irr::core::vector3df(0,0,1)); + + for (int x = -1;x < 2;x += 1) { + for (int y = -1;y < 2;y += 1) { + for (int z = -1;z < 2;z += 1) { + if (x || y || z) { + irr::scene::IMeshSceneNode * tmp = irrcontext::smgr->addCubeSceneNode( + 10.0, + NULL, + ((z * 9) + (y * 3) + x), + irr::core::vector3df( + (x * 25), + (y * 25), + (z * 25))); + NODES[(z * 9) + (y * 3) + x] = tmp; + }}}} + irrcontext::smgr->addLightSceneNode(); + } + +/***MAIN, FEAT. RENDER LOOP***/ + +main (int argc, char *argv[]) { + + if (argc < 2) { + printf("usage: %s <$TERM of tty> ...\n",argv[0]); + exit(1); + } + initialize(argv); + while (irrcontext::device->run()) { + JITTER = 0; + if (SCRAM) exit(0); + CHECKPOINT(THREAD__MAIN,__LINE__); + pthread_mutex_lock(&CAMLOCK); + CAMERA->setTarget(CAMCOORD.euclid()); + pthread_mutex_unlock(&CAMLOCK); + CHECKPOINT(THREAD__MAIN,__LINE__); + irrcontext::driver->beginScene(true, true, RGBAColor(0,0,0xAA,0xF0)); + CHECKPOINT(THREAD__MAIN,__LINE__); + irrcontext::smgr->drawAll(); + CHECKPOINT(THREAD__MAIN,__LINE__); + irrcontext::guienv->drawAll(); + CHECKPOINT(THREAD__MAIN,__LINE__); + irrcontext::driver->endScene(); + CHECKPOINT(THREAD__MAIN,__LINE__); + irrcontext::now = irrcontext::timer->getTime(); + CHECKPOINT(THREAD__MAIN,__LINE__); + irrcontext::deltatime = (irrcontext::now - irrcontext::then) / 1000.0; + CHECKPOINT(THREAD__MAIN,__LINE__); + irrcontext::then = irrcontext::now; + CHECKPOINT(THREAD__MAIN,__LINE__); + }} diff --git a/src/alpha/modularized/build.sh b/src/alpha/modularized/build.sh new file mode 100755 index 0000000..fbd86db --- /dev/null +++ b/src/alpha/modularized/build.sh @@ -0,0 +1,2 @@ +#!/bin/sh +g++ ./main.cc -lcurses -lIrrlicht -lpthread -llua5.3 -fpermissive -g -o IWannaFly_prerelease_snapshot.out diff --git a/src/alpha/modularized/commandline.incplusplus b/src/alpha/modularized/commandline.incplusplus new file mode 100644 index 0000000..f25662a --- /dev/null +++ b/src/alpha/modularized/commandline.incplusplus @@ -0,0 +1,21 @@ +//parent file is: ./main.cc + +// written with the help of toutorials at https://www.lua.org/pil/24.html + +void * iwf$$threads$$lua__commandline$$function (void * dummy) { + lua_State * L = luaL_newstate(); + luaL_newlib(L,LLib$$changecolor); + lua_setglobal(L,"lib"); + printf("IWannaFly lua commandline\n]> "); + for (std::string buffer;;) { + CHECKPOINT(THREAD__LUA_COMMANDLINE,__LINE__); + getline(std::cin,buffer); + CHECKPOINT(THREAD__LUA_COMMANDLINE,__LINE__); + luaL_dostring(L,buffer.c_str()); + CHECKPOINT(THREAD__LUA_COMMANDLINE,__LINE__); + buffer.clear(); + CHECKPOINT(THREAD__LUA_COMMANDLINE,__LINE__); + printf("Done\n]> "); + } + return NULL; + } diff --git a/src/alpha/modularized/datatypes/camcoord.incplusplus b/src/alpha/modularized/datatypes/camcoord.incplusplus new file mode 100644 index 0000000..bbe8b53 --- /dev/null +++ b/src/alpha/modularized/datatypes/camcoord.incplusplus @@ -0,0 +1,16 @@ +//parent is: ../main.cc + +namespace iwf { namespace datatypes { +class camcoord { + public: + double az; + double el; + + irr::core::vector3df euclid () { + irr::core::vector3df tmp; + tmp.X = sin(this->el) * cos(this->az); + tmp.Y = sin(this->el) * sin(this->az); + tmp.Z = cos(this->el); + return tmp; + }}; +}} diff --git a/src/alpha/modularized/eventloop.incplusplus b/src/alpha/modularized/eventloop.incplusplus new file mode 100644 index 0000000..0a8b082 --- /dev/null +++ b/src/alpha/modularized/eventloop.incplusplus @@ -0,0 +1,148 @@ +/* part of this program has been created using the toutorials at + * http://irrlicht.sourceforge.net/docu/pages.html + * + * I have no affiliation with the developers of Irrlicht, and have + * signifigantly altered (c.f. the Ship of Theseus) the example provided. + * + * this file distributed under the same terms as the Irrlicht engine + * + **
+ ** This software is provided ‘as-is’, without any express or implied + ** warranty. In no event will the authors be held liable for any damages + ** arising from the use of this software. + ** + ** Permission is granted to anyone to use this software for any purpose, + ** including commercial applications, and to alter it and redistribute it + ** freely, subject to the following restrictions: + ** + ** 1. The origin of this software must not be misrepresented; you must not + ** claim that you wrote the original software. If you use this software + ** in a product, an acknowledgment in the product documentation would + ** be appreciated but is not required. + ** + ** 2. Altered source versions must be plainly marked as such, and must not + ** be misrepresented as being the original software. + ** + ** 3. This notice may not be removed or altered from any source + ** distribution. + **
+ */ + +//parent file is: ./main.cc + +class MainEventReciever : public irr::IEventReceiver { + public: + virtual bool OnEvent (const irr::SEvent& event) { + CHECKPOINT(THREAD__EVENT,__LINE__); + if (JITTER >= JITTERMAX) { + CHECKPOINT(THREAD__EVENT,__LINE__); + return false; //did nothing + } + CHECKPOINT(THREAD__EVENT,__LINE__); + switch (event.EventType) { + CHECKPOINT(THREAD__EVENT,__LINE__); + case irr::EET_MOUSE_INPUT_EVENT : switch (event.MouseInput.Event) { + CHECKPOINT(THREAD__EVENT,__LINE__); + case irr::EMIE_LMOUSE_PRESSED_DOWN : { + CHECKPOINT(THREAD__EVENT,__LINE__); + STEALCURSOR = true; + irrcontext::cursctrl->setVisible(0); + irrcontext::cursctrl->setPosition(0.5f,0.5f); + this->mouseCenter = irrcontext::cursctrl->getPosition(); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + case irr::EMIE_MOUSE_MOVED : if (!STEALCURSOR) { + return false; + } else { + CHECKPOINT(THREAD__EVENT,__LINE__); + pthread_mutex_lock(&CAMLOCK); + CAMCOORD.el += (event.MouseInput.Y - this->mouseCenter.Y) * (YINVERT ? -1 : 1) * (180 / M_PI) * (1 / 1000.0) * irrcontext::deltatime; + if (CAMCOORD.el >= 0.0) { + CAMCOORD.el = 0 - (M_PI / 1000); + } else if (CAMCOORD.el <= -M_PI) { + CAMCOORD.el = -(M_PI - (M_PI / 1000)); + } + CAMCOORD.az += (event.MouseInput.X - this->mouseCenter.X) * (180 / M_PI) * (1 / 1000.0) * irrcontext::deltatime; + while (CAMCOORD.az < -M_PI) { + CAMCOORD.az += 2 * M_PI; + } while (CAMCOORD.az > M_PI) { + CAMCOORD.az -= 2 * M_PI; + } + pthread_mutex_unlock(&CAMLOCK); + irrcontext::cursctrl->setPosition(0.5f,0.5f); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + default : break; + } + case (irr::EET_KEY_INPUT_EVENT) : { + CHECKPOINT(THREAD__EVENT,__LINE__); + if (event.KeyInput.PressedDown) { + CHECKPOINT(THREAD__EVENT,__LINE__); + switch (event.KeyInput.Key) { + + case irr::KEY_KEY_W : { + CHECKPOINT(THREAD__EVENT,__LINE__); + pthread_mutex_lock(&CAMLOCK); + CAMCOORD.el += 5 * irrcontext::deltatime; + if (CAMCOORD.el >= 0.0) { + CAMCOORD.el = 0 - (M_PI / 1000); + } + pthread_mutex_unlock(&CAMLOCK); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + + case irr::KEY_KEY_S : { + CHECKPOINT(THREAD__EVENT,__LINE__); + pthread_mutex_lock(&CAMLOCK); + CAMCOORD.el -= 5 * irrcontext::deltatime; + if (CAMCOORD.el <= -M_PI) { + CAMCOORD.el = -(M_PI - (M_PI / 1000)); + } + pthread_mutex_unlock(&CAMLOCK); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + + case irr::KEY_KEY_A : { + CHECKPOINT(THREAD__EVENT,__LINE__); + pthread_mutex_lock(&CAMLOCK); + CAMCOORD.az -= 5 * irrcontext::deltatime; + while (CAMCOORD.az < -M_PI) { + CAMCOORD.az += 2 * M_PI; + } + pthread_mutex_unlock(&CAMLOCK); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + + case irr::KEY_KEY_D : { + CHECKPOINT(THREAD__EVENT,__LINE__); + pthread_mutex_lock(&CAMLOCK); + CAMCOORD.az += 5 * irrcontext::deltatime; + while (CAMCOORD.az > M_PI) { + CAMCOORD.az -= 2 * M_PI; + } + pthread_mutex_unlock(&CAMLOCK); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + + case irr::KEY_ESCAPE : { + CHECKPOINT(THREAD__EVENT,__LINE__); + STEALCURSOR = 0; + irrcontext::cursctrl->setVisible(1); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + + case irr::KEY_KEY_Y : { + CHECKPOINT(THREAD__EVENT,__LINE__); + YINVERT = !YINVERT; + } break; + + default : break; + }}} break; + default : break; + } + CHECKPOINT(THREAD__EVENT,__LINE__); + return false; + } + private: + irr::core::vector2di mouseCenter; + }; diff --git a/src/alpha/modularized/globals.incplusplus b/src/alpha/modularized/globals.incplusplus new file mode 100644 index 0000000..eae43af --- /dev/null +++ b/src/alpha/modularized/globals.incplusplus @@ -0,0 +1,24 @@ +//parent file is: ./main.cc + +std::atomic_bool SCRAM; +std::atomic JITTER; +std::atomic JITTERMAX; +pthread_mutex_t JITTER_ADV_LOCK = PTHREAD_MUTEX_INITIALIZER; +float JITTER_ADVERAGE; +typedef std::map NODES_t; +NODES_t NODES; + +#define THREAD__MAIN 0 +#define THREAD__EVENT 1 +#define THREAD__JITTERBUG 2 +#define THREAD__NCURSES 3 +#define THREAD__LUA_SCRIPTING 4 +#define THREAD__LUA_COMMANDLINE 5 +#define THREADCOUNT 6 +std::atomic_int EXELINE[THREADCOUNT]; +#define CHECKPOINT(X,Y) EXELINE[X] = Y + +irr::scene::ICameraSceneNode * CAMERA; +pthread_mutex_t CAMLOCK = PTHREAD_MUTEX_INITIALIZER; +std::atomic_bool STEALCURSOR; +std::atomic_bool YINVERT; diff --git a/src/alpha/modularized/hardcodedfunctions/changecolors.incplusplus b/src/alpha/modularized/hardcodedfunctions/changecolors.incplusplus new file mode 100644 index 0000000..883b8a8 --- /dev/null +++ b/src/alpha/modularized/hardcodedfunctions/changecolors.incplusplus @@ -0,0 +1,29 @@ +// parent file is: ../main.cc + +/* this function will be part of the public-facing API, but the calling + * convention will be different: + * + * changecolor(octant,x,y,z,r,g,b,a) + * + * octant in the range [13,13] + * x, y, and z truncated to 5 bits + * r, g, b, and a truncated to 8 bits + */ + +// created using toutorials at https://www.lua.org/pil/24.html + +static int LFunc$$changecolor (lua_State * L) { + int tmp[5]; + for (ptrdiff_t i = 0;i < 5;i++) { + tmp[i] = lua_tointeger(L,i + 1); + }{ + NODES_t::iterator i = NODES.find(tmp[0]); + if (i != NODES.end()) { + irrcontext::meshmanipr->setVertexColors(i->second->getMesh(),RGBAColor(tmp[1],tmp[2],tmp[3],tmp[4])); + return 0; + }}} + +static const struct luaL_Reg LLib$$changecolor [] = { + {"changecolor",LFunc$$changecolor}, + {NULL,NULL} + }; diff --git a/src/alpha/modularized/irrcontext.incplusplus b/src/alpha/modularized/irrcontext.incplusplus new file mode 100644 index 0000000..a8cff96 --- /dev/null +++ b/src/alpha/modularized/irrcontext.incplusplus @@ -0,0 +1,14 @@ +//parent is: ./main.cc + +namespace irrcontext { + irr::IrrlichtDevice * device; + irr::video::IVideoDriver * driver; + irr::scene::ISceneManager * smgr; + irr::gui::IGUIEnvironment * guienv; + irr::scene::IMeshManipulator * meshmanipr; + irr::gui::ICursorControl * cursctrl; + irr::ITimer * timer; + double deltatime; + uint32_t then; + uint32_t now; + } diff --git a/src/alpha/modularized/jitterbug.incplusplus b/src/alpha/modularized/jitterbug.incplusplus new file mode 100644 index 0000000..05aa0fd --- /dev/null +++ b/src/alpha/modularized/jitterbug.incplusplus @@ -0,0 +1,20 @@ +//parent file is: ./main.cc + +void * iwf$$threads$$jitterbug$$loop (void * dummy) { + double localbuffer = 0.0; + for (;;usleep(POLLTIME)) { + CHECKPOINT(THREAD__JITTERBUG,__LINE__); + JITTER++; + if (JITTER == -1) { + SCRAM = true; + return NULL; + } + CHECKPOINT(THREAD__JITTERBUG,__LINE__); + localbuffer = ((JITTER * 3) + localbuffer) / 4; + if (!pthread_mutex_trylock(&JITTER_ADV_LOCK)) { + CHECKPOINT(THREAD__JITTERBUG,__LINE__); + JITTER_ADVERAGE = localbuffer; + pthread_mutex_unlock(&JITTER_ADV_LOCK); + } + CHECKPOINT(THREAD__JITTERBUG,__LINE__); + }} diff --git a/src/alpha/modularized/main.cc b/src/alpha/modularized/main.cc new file mode 100644 index 0000000..4762dee --- /dev/null +++ b/src/alpha/modularized/main.cc @@ -0,0 +1,147 @@ +/************** + * IWANNAFLY * + * * + * prealpha * + **************/ + +#define SNAPSHOT "AFTERNOON/07/AUG/2020" + +/* this program currently requires a second terminal to be used; this is + * done by passing the terminal's device file (which can be obtained with + * the command tty) as argv[1] and the device's $TERM value as argv[2]. you + * must have permission to open the device file as "r+". + * + * an example of invocation is: + * + * Iwannafly /dev/pts/1 xterm + * + * this is primarily to speed prototyping, and will not be necissary in the + * finished game; during development, all text input will be done using + * stdio, and all GUI interaction will be done using nCurses. + */ + +#define SYSINT int +#define RGBColor(R,G,B) irr::video::SColor(0xFF,R,G,B) +#define RGBAColor(R,G,B,A) irr::video::SColor(A,R,G,B) + +#define POLLTIME 5000 + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +extern "C" { + #include + } //not C++ safe-- idk why this fixes it. + +#include "globals.incplusplus" + +#include "datatypes/camcoord.incplusplus" +iwf::datatypes::camcoord CAMCOORD; + +#include "irrcontext.incplusplus" + +#include "maineventloop.incplusplus" +MainEventReciever RECIEVER; + +#include "jitterbug.incplusplus" +pthread_t iwf$$threads$$jitterbug; + +SCREEN * CURSCREEN; +#include "ncursesthread.incplusplus" +pthread_t iwf$$threads$$curses; + +#include "hardcodedfunctions/changecolors.incplusplus" + +#include "scripting.incplusplus" +pthread_t iwf$$threads$$lua__scripting; + +#include "commandline.incplusplus" +pthread_t iwf$$threads$$lua__commandline; + +/***INITIALIZATION***/ + +SYSINT initialize (char *argv[]) { + setvbuf(stdout, NULL, _IONBF, 0); + SCRAM = 0; + JITTERMAX = 0xF; + + pthread_create(&iwf$$threads$$curses,NULL,iwf$$threads$$curses$$function,argv); + pthread_create(&iwf$$threads$$jitterbug,NULL,iwf$$threads$$jitterbug$$loop,NULL); + pthread_create(&iwf$$threads$$lua__scripting,NULL,iwf$$threads$$lua__scripting$$function,NULL); + pthread_create(&iwf$$threads$$lua__commandline,NULL,iwf$$threads$$lua__commandline$$function,NULL); + + irrcontext::device = irr::createDevice(irr::video::EDT_OPENGL,irr::core::dimension2d(640, 480),16,false,false,false,&RECIEVER); + irrcontext::driver = irrcontext::device->getVideoDriver(); + irrcontext::smgr = irrcontext::device->getSceneManager(); + irrcontext::guienv = irrcontext::device->getGUIEnvironment(); + irrcontext::meshmanipr = irrcontext::smgr->getMeshManipulator(); + irrcontext::cursctrl = irrcontext::device->getCursorControl(); + irrcontext::timer = irrcontext::device->getTimer(); + + irrcontext::guienv->addStaticText(L"IWannaFly Devtest prealpha snapshot " SNAPSHOT,irr::core::rect(10,10,260,22),1); + CAMERA = irrcontext::smgr->addCameraSceneNode(NULL,irr::core::vector3df(0,0,0),irr::core::vector3df(1,1,1)); + CAMERA->setUpVector(irr::core::vector3df(0,0,1)); + + for (int x = -1;x < 2;x += 1) { + for (int y = -1;y < 2;y += 1) { + for (int z = -1;z < 2;z += 1) { + if (x || y || z) { + irr::scene::IMeshSceneNode * tmp = irrcontext::smgr->addCubeSceneNode( + 10.0, + NULL, + ((z * 9) + (y * 3) + x), + irr::core::vector3df( + (x * 25), + (y * 25), + (z * 25))); + NODES[(z * 9) + (y * 3) + x] = tmp; + }}}} + irrcontext::smgr->addLightSceneNode(); + } + +/***MAIN***/ + +main (int argc, char *argv[]) { + + if (argc < 2) { + printf("usage: %s <$TERM of tty> ...\n",argv[0]); + exit(1); + } + initialize(argv); + while (irrcontext::device->run()) { + JITTER = 0; + if (SCRAM) exit(0); + CHECKPOINT(THREAD__MAIN,__LINE__); + pthread_mutex_lock(&CAMLOCK); + CAMERA->setTarget(CAMCOORD.euclid()); + pthread_mutex_unlock(&CAMLOCK); + CHECKPOINT(THREAD__MAIN,__LINE__); + irrcontext::driver->beginScene(true, true, RGBAColor(0,0,0xAA,0xF0)); + CHECKPOINT(THREAD__MAIN,__LINE__); + irrcontext::smgr->drawAll(); + CHECKPOINT(THREAD__MAIN,__LINE__); + irrcontext::guienv->drawAll(); + CHECKPOINT(THREAD__MAIN,__LINE__); + irrcontext::driver->endScene(); + CHECKPOINT(THREAD__MAIN,__LINE__); + irrcontext::now = irrcontext::timer->getTime(); + CHECKPOINT(THREAD__MAIN,__LINE__); + irrcontext::deltatime = (irrcontext::now - irrcontext::then) / 1000.0; + CHECKPOINT(THREAD__MAIN,__LINE__); + irrcontext::then = irrcontext::now; + CHECKPOINT(THREAD__MAIN,__LINE__); + }} diff --git a/src/alpha/modularized/maineventloop.incplusplus b/src/alpha/modularized/maineventloop.incplusplus new file mode 100644 index 0000000..31885b7 --- /dev/null +++ b/src/alpha/modularized/maineventloop.incplusplus @@ -0,0 +1,125 @@ +//parent file is: ./main.cc + +//ERROR -- INCOMPLETE CITATION +/* part of this program has been created using the toutorials at + * http://irrlicht.sourceforge.net/docu/pages.html + * + * (on a related note, have I mentioned the Ship of Theseus today?) + */ + +class MainEventReciever : public irr::IEventReceiver { + public: + virtual bool OnEvent (const irr::SEvent& event) { + CHECKPOINT(THREAD__EVENT,__LINE__); + if (JITTER >= JITTERMAX) { + CHECKPOINT(THREAD__EVENT,__LINE__); + return false; //did nothing + } + CHECKPOINT(THREAD__EVENT,__LINE__); + switch (event.EventType) { + CHECKPOINT(THREAD__EVENT,__LINE__); + case irr::EET_MOUSE_INPUT_EVENT : switch (event.MouseInput.Event) { + CHECKPOINT(THREAD__EVENT,__LINE__); + case irr::EMIE_LMOUSE_PRESSED_DOWN : { + CHECKPOINT(THREAD__EVENT,__LINE__); + STEALCURSOR = true; + irrcontext::cursctrl->setVisible(0); + irrcontext::cursctrl->setPosition(0.5f,0.5f); + this->mouseCenter = irrcontext::cursctrl->getPosition(); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + case irr::EMIE_MOUSE_MOVED : if (!STEALCURSOR) { + return false; + } else { + CHECKPOINT(THREAD__EVENT,__LINE__); + pthread_mutex_lock(&CAMLOCK); + CAMCOORD.el += (event.MouseInput.Y - this->mouseCenter.Y) * (YINVERT ? -1 : 1) * (180 / M_PI) * (1 / 1000.0) * irrcontext::deltatime; + if (CAMCOORD.el >= 0.0) { + CAMCOORD.el = 0 - (M_PI / 1000); + } else if (CAMCOORD.el <= -M_PI) { + CAMCOORD.el = -(M_PI - (M_PI / 1000)); + } + CAMCOORD.az += (event.MouseInput.X - this->mouseCenter.X) * (180 / M_PI) * (1 / 1000.0) * irrcontext::deltatime; + while (CAMCOORD.az < -M_PI) { + CAMCOORD.az += 2 * M_PI; + } while (CAMCOORD.az > M_PI) { + CAMCOORD.az -= 2 * M_PI; + } + pthread_mutex_unlock(&CAMLOCK); + irrcontext::cursctrl->setPosition(0.5f,0.5f); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + default : break; + } + case (irr::EET_KEY_INPUT_EVENT) : { + CHECKPOINT(THREAD__EVENT,__LINE__); + if (event.KeyInput.PressedDown) { + CHECKPOINT(THREAD__EVENT,__LINE__); + switch (event.KeyInput.Key) { + + case irr::KEY_KEY_W : { + CHECKPOINT(THREAD__EVENT,__LINE__); + pthread_mutex_lock(&CAMLOCK); + CAMCOORD.el += 5 * irrcontext::deltatime; + if (CAMCOORD.el >= 0.0) { + CAMCOORD.el = 0 - (M_PI / 1000); + } + pthread_mutex_unlock(&CAMLOCK); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + + case irr::KEY_KEY_S : { + CHECKPOINT(THREAD__EVENT,__LINE__); + pthread_mutex_lock(&CAMLOCK); + CAMCOORD.el -= 5 * irrcontext::deltatime; + if (CAMCOORD.el <= -M_PI) { + CAMCOORD.el = -(M_PI - (M_PI / 1000)); + } + pthread_mutex_unlock(&CAMLOCK); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + + case irr::KEY_KEY_A : { + CHECKPOINT(THREAD__EVENT,__LINE__); + pthread_mutex_lock(&CAMLOCK); + CAMCOORD.az -= 5 * irrcontext::deltatime; + while (CAMCOORD.az < -M_PI) { + CAMCOORD.az += 2 * M_PI; + } + pthread_mutex_unlock(&CAMLOCK); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + + case irr::KEY_KEY_D : { + CHECKPOINT(THREAD__EVENT,__LINE__); + pthread_mutex_lock(&CAMLOCK); + CAMCOORD.az += 5 * irrcontext::deltatime; + while (CAMCOORD.az > M_PI) { + CAMCOORD.az -= 2 * M_PI; + } + pthread_mutex_unlock(&CAMLOCK); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + + case irr::KEY_ESCAPE : { + CHECKPOINT(THREAD__EVENT,__LINE__); + STEALCURSOR = 0; + irrcontext::cursctrl->setVisible(1); + CHECKPOINT(THREAD__EVENT,__LINE__); + } break; + + case irr::KEY_KEY_Y : { + CHECKPOINT(THREAD__EVENT,__LINE__); + YINVERT = !YINVERT; + } break; + + default : break; + }}} break; + default : break; + } + CHECKPOINT(THREAD__EVENT,__LINE__); + return false; + } + private: + irr::core::vector2di mouseCenter; + }; diff --git a/src/alpha/modularized/ncursesthread.incplusplus b/src/alpha/modularized/ncursesthread.incplusplus new file mode 100644 index 0000000..4176d25 --- /dev/null +++ b/src/alpha/modularized/ncursesthread.incplusplus @@ -0,0 +1,72 @@ +//parent file is: ./main.cc + +void * iwf$$threads$$curses$$function (void * input) { + char *(*argv)[] = input; + for (int fg = 0;fg < 8;fg++) { + for (int bg = 0;bg < 8;bg++) { + init_pair(fg | (bg << 3),fg,bg); + }} + FILE * devfile = fopen((*argv)[1],"r+"); + if (devfile == NULL) { + fprintf(stderr,"%s\n(Not a typewriter?)\n",strerror(errno)); + printf("usage: %s <$TERM of tty> ...\n",(*argv)[0]); + SCRAM = true; + return NULL; + } + + CURSCREEN = newterm((*argv)[2],devfile,devfile); + set_term(CURSCREEN); + + raw(); + noecho(); + keypad(NULL,1); + + mvprintw(3,3,"IWannaFly"); + mvprintw(4,4,"prealpha devtest"); + mvprintw(5,5,"revision snapshot:"); + mvprintw(6,5,SNAPSHOT); + + irr::core::vector3df placeholder; + float placeholder2; + char tmp; + int tmp0; + int tmp1; + int tmp2; + int tmp4; + int tmp5; + + for (;;sleep(1)) { + CHECKPOINT(THREAD__NCURSES,__LINE__); + pthread_mutex_lock(&CAMLOCK); + mvprintw(8,8,"camera azimuth : % 15.10f°",CAMCOORD.az * (180 / M_PI)); + mvprintw(9,8,"camera elevation : % 15.10f°",CAMCOORD.el * (180 / M_PI)); + mvprintw(11,8,"camera basis vector:"); + placeholder = CAMCOORD.euclid(); + pthread_mutex_unlock(&CAMLOCK); + CHECKPOINT(THREAD__NCURSES,__LINE__); + mvprintw(12,10,"% 12.10fx",placeholder.X); + mvprintw(13,10,"% 12.10fy",placeholder.Y); + mvprintw(14,10,"% 12.10fz",placeholder.Z); + mvprintw(16,8,"cursor grabbed? >%s",STEALCURSOR ? "yes" : "no "); + CHECKPOINT(THREAD__NCURSES,__LINE__); + pthread_mutex_lock(&JITTER_ADV_LOCK); + mvprintw(17,8,"adverage jitter : %4.4f",JITTER_ADVERAGE); + pthread_mutex_unlock(&JITTER_ADV_LOCK); + + CHECKPOINT(THREAD__NCURSES,__LINE__); + tmp = JITTERMAX; + mvprintw(18,8,"(max jitter : %3i)",tmp); + CHECKPOINT(THREAD__NCURSES,__LINE__); + + tmp0 = EXELINE[0]; + tmp1 = EXELINE[1]; + tmp2 = EXELINE[2]; + tmp4 = EXELINE[4]; + tmp5 = EXELINE[5]; + CHECKPOINT(THREAD__NCURSES,__LINE__); + mvprintw(20,8,"line of execution : % 4i % 4i % 4i SELF % 4i % 4i",tmp0,tmp1,tmp2,tmp4,tmp5); + + CHECKPOINT(THREAD__NCURSES,__LINE__); + refresh(); + CHECKPOINT(THREAD__NCURSES,__LINE__); + }}; diff --git a/src/alpha/modularized/physics/AKNOWLADGEMENTS b/src/alpha/modularized/physics/AKNOWLADGEMENTS new file mode 100644 index 0000000..6054f69 --- /dev/null +++ b/src/alpha/modularized/physics/AKNOWLADGEMENTS @@ -0,0 +1,8 @@ +The code in this directory is derived from a toutorial at +https://compusciencing.github.io/starting-with-ode.html +and the ODE manual at http://www.ode.org/ode-latest-userguide.html +(both retrieved July/Augest 2020) + +I am choosing to use ODE under the LGPL 2.1 license + +Irrlicht documentation is at http://irrlicht.sourceforge.net/docu/ diff --git a/src/alpha/modularized/scripting.incplusplus b/src/alpha/modularized/scripting.incplusplus new file mode 100644 index 0000000..2294a83 --- /dev/null +++ b/src/alpha/modularized/scripting.incplusplus @@ -0,0 +1,25 @@ +//parent file is: ./main.cc + +// written with the help of toutorials at https://www.lua.org/pil/24.html + +pthread_mutex_t SCRIPTPASS = PTHREAD_MUTEX_INITIALIZER; +bool SCRIPTGO; +std::string SCRIPTJOB; + +void * iwf$$threads$$lua__scripting$$function (void * dummy) { + lua_State * L = luaL_newstate(); + luaL_newlib(L,LLib$$changecolor); + lua_setglobal(L,"lib"); + for (;;usleep(POLLTIME)) { + pthread_mutex_lock(&SCRIPTPASS); + CHECKPOINT(THREAD__LUA_SCRIPTING,__LINE__); + if (SCRIPTGO) { + luaL_dostring(L,SCRIPTJOB.c_str()); + SCRIPTJOB.clear(); + SCRIPTGO = false; + } + pthread_mutex_unlock(&SCRIPTPASS); + CHECKPOINT(THREAD__LUA_SCRIPTING,__LINE__); + } + return NULL; + } diff --git a/src/stable/base1.def b/src/alpha/sandbox/base1.def similarity index 100% rename from src/stable/base1.def rename to src/alpha/sandbox/base1.def diff --git a/src/incomplete/sandbox/bitvector/bitvector16.c b/src/alpha/sandbox/bitvector/bitvector16.c similarity index 100% rename from src/incomplete/sandbox/bitvector/bitvector16.c rename to src/alpha/sandbox/bitvector/bitvector16.c diff --git a/src/incomplete/sandbox/bitvector/bitvector32.c b/src/alpha/sandbox/bitvector/bitvector32.c similarity index 100% rename from src/incomplete/sandbox/bitvector/bitvector32.c rename to src/alpha/sandbox/bitvector/bitvector32.c diff --git a/src/incomplete/sandbox/bitvector/bitvector64.c b/src/alpha/sandbox/bitvector/bitvector64.c similarity index 100% rename from src/incomplete/sandbox/bitvector/bitvector64.c rename to src/alpha/sandbox/bitvector/bitvector64.c diff --git a/src/incomplete/sandbox/bitvector/bitvector8.c b/src/alpha/sandbox/bitvector/bitvector8.c similarity index 100% rename from src/incomplete/sandbox/bitvector/bitvector8.c rename to src/alpha/sandbox/bitvector/bitvector8.c diff --git a/src/incomplete/sandbox/coord.c b/src/alpha/sandbox/coord.c similarity index 100% rename from src/incomplete/sandbox/coord.c rename to src/alpha/sandbox/coord.c diff --git a/src/stable/cppkeyword.def b/src/alpha/sandbox/cppkeyword.def similarity index 100% rename from src/stable/cppkeyword.def rename to src/alpha/sandbox/cppkeyword.def diff --git a/src/alpha/sandbox/handle_collisions.cc b/src/alpha/sandbox/handle_collisions.cc new file mode 100644 index 0000000..84fd7b6 --- /dev/null +++ b/src/alpha/sandbox/handle_collisions.cc @@ -0,0 +1,61 @@ +/* This file is derived from an example in the documentation at + * http://www.ode.org/ode-latest-userguide.html + * + * This file is released under the same terms as the OpenDynamics Engine + */ + +#define MAX_NUM_CONTACTS 3 +#define ODE_MU +#define ODE_SOFT_ERP +#define ODE_SOFT_CFM +#define ODE_BOUNCY +#define TIME_STEP + +void handle_collisions (void * data, dGeomID geom1, dGeomID geom2) { + if (dGeomIsSpace(o1) || dGeomIsSpace(o2)) { + dSpaceCollide2(o1,o2,data,&handle_collisions); + if (dGeomIsSpace(o1)) + dSpaceCollide(o1,data,&handle_collisions); + if (dGeomIsSpace(o2)) + dSpaceCollide(o2,data,&handle_collisions); + } + + dBodyID body1 = dGeomGetBody(geom1); + dBodyID body2 = dGeomGetBody(geom2); + + dContact contacts[MAX_NUM_CONTACTS]; + int numc = dCollide(geom1, geom2, MAX_NUM_CONTACTS, &contacts[0].geom, sizeof(dContact)); + + for (int i = 0; i < numc; ++i) { + contacts[i].surface.mode = + dContactBounce + | + dContactSoftERP + | + dContactSoftCFM + | + dContactApprox1 + | + dContactSlip1 + | + dContactSlip2; + + contacts[i].surface.mu = ODE_MU; + contacts[i].surface.soft_erp = ODE_SOFT_ERP; + contacts[i].surface.soft_cfm = ODE_SOFT_CFM; + contacts[i].surface.bounce = ODE_BOUNCINESS; + + dJointID contact = + dJointCreateContact( + WORLD, + COLLISIONS, + &contacts[i]); + + dJointAttach(contact, body1, body2); + }} + +for (;;) { + for (std::map::iterator i = ENTITIES.begin();i != ENTITIES.end();i++) { + + dSpaceCollide(SPACE,NULL,&handle_collisions); + dWorldStep(WORLD,TIME_STEP); diff --git a/src/alpha/sandbox/ode_physics.cc b/src/alpha/sandbox/ode_physics.cc new file mode 100644 index 0000000..8246984 --- /dev/null +++ b/src/alpha/sandbox/ode_physics.cc @@ -0,0 +1,82 @@ +std::atomic_bool ODE_FINISH_SYNC; +std::atomic_bool ODE_INTREQ; +std::atomic_bool ODE_IACK; + +std::atomic_bool IRR_FINISH_SYNC; +std::atomic_bool IRR_INTREQ; +std::atomic_bool IRR_IACK; + +dWorldID WORLD; +dSpaceID SPACE; +dJointGroupID COLLISIONGROUP; + +struct BlockTag { + IMeshSceneNode * node; + dGeomID geom; + }; + +std::vector BLOCKBANK; + +struct EntTag { + IMeshSceneNode * irrnode; + dBodyID body; + dGeomID geom; + dMass mass; + }; + +std::vector ENTITIES; +//will be seperated into different kinds of entities later + +initialize () { + dInitODE2(0); + WORLD = dWorldCreate(); + dWorldSetGravity(WORLD,0,0,-1.5); + SPACE = dSimpleSpaceCreate(0); + COLLISION = dJointGroupCreate(0); + … + + +//add to main +for (;;) { + if (ODE_IREQ) { + ODE_IACK = true; + while (ODE_IREQ); + ODE_IACK = false; + } + + ODE_FINISH_SYNC = true; + while (IRR_FINISH_SYNC != ODE_FINISH_SYNC); + { + dReal * tmp; + dMatrix3 ident; + dRSetIdentity(ident); + for (std::map::iterator i = ENTITIES.begin();i != ENTITIES.end();i++) { + tmp = dGeomGetPosition(i->geom); + i->node->SetPosition(irr::core::vector3df(tmp[0],tmp[1],tmp[2])); + dGeomSetRotation(i->geom,ident); + }}} + + +iwf$$DEBUGcreatevoxel() { + BlockTag nova; + { + dReal tmpX = iwf$$raw16$$coord3$$get$x(coord); + dReal tmpY = iwf$$raw16$$coord3$$get$y(coord); + dReal tmpZ = iwf$$raw16$$coord3$$get$z(coord); + dGeomID tmp = dCreateBox(SPACE, 2.5 , 2.5 , 2.5); + dGeomSetPosition(tmp,tmpX,tmpY,tmpZ); + nova.geom = tmp; + }{ + irr::scene::IMeshSceneNode * tmp = irrcontext::addCubeSceneNode( + 2.5f, + NULL, + 0, + irr::core::vector3df( + iwf$$raw16$$coord$$get$x(coord), + iwf$$raw16$$coord$$get$y(coord), + iwf$$raw16$$coord$$get$z(coord) + ); + nova.node = tmp; + } + BLOCKBANK.push_back(nova); + } diff --git a/src/rotten/util/util.h b/src/alpha/sandbox/util/util.H similarity index 85% rename from src/rotten/util/util.h rename to src/alpha/sandbox/util/util.H index d1c845b..d8a6822 100644 --- a/src/rotten/util/util.h +++ b/src/alpha/sandbox/util/util.H @@ -40,15 +40,15 @@ extern unsigned long long usquaredll(unsigned long long n); extern int cmpll(signed long long a,signed long long b); extern int ucmpll(unsigned long long a,unsigned long long b); -extern float maxf(float a,float b); -extern float minf(float a,float b); -extern float squaredf(float n); -extern int cmpf(float a,float b); - -extern double maxfd(double a,double b); -extern double minfd(double a,double b); -extern double squaredfd(double n); -extern int cmpfd(double a,double b); +extern float fmaxf(float a,float b); +extern float fminf(float a,float b); +extern float fsquaredf(float n); +extern int fcmpf(float a,float b); + +extern double fmax(double a,double b); +extern double fmin(double a,double b); +extern double fsquared(double n); +extern int fcmp(double a,double b); extern double norm2xy(double x,double y); extern double norm2xyz(double x,double y,double z); diff --git a/src/rotten/util/util.c b/src/alpha/sandbox/util/util.c similarity index 87% rename from src/rotten/util/util.c rename to src/alpha/sandbox/util/util.c index e520aba..8efe808 100644 --- a/src/rotten/util/util.c +++ b/src/alpha/sandbox/util/util.c @@ -235,7 +235,7 @@ __attribute__((const)) ucmpll(unsigned long long a,unsigned long long b) { /*---FLOATS---*/ -float __attribute__((const)) maxf(float a,float b) { +float __attribute__((const)) fmaxf (float a,float b) { if (a >= b) { return a; } @@ -243,7 +243,7 @@ float __attribute__((const)) maxf(float a,float b) { return b; } -float __attribute__((const)) minf(float a,float b) { +float __attribute__((const)) fminf (float a,float b) { if (a <= b) { return a; } @@ -251,11 +251,11 @@ float __attribute__((const)) minf(float a,float b) { return b; } -float __attribute__((const)) squaredf (float n) { +float __attribute__((const)) fsquaredf (float n) { return n * n } -__attribute__((const)) cmpf(float a,float b) { +__attribute__((const)) fcmpf (float a,float b) { if (a == b) { return 0; } @@ -270,11 +270,11 @@ __attribute__((const)) cmpf(float a,float b) { } } -#define sgnf(X) cmpf(X,0) +#define fsgnf (X) fcmpf(X,0) /*---DOUBLES---*/ -double __attribute__((const)) maxfd(double a,double b) { +double __attribute__((const)) fmax (double a,double b) { if (a >= b) { return a; } @@ -282,7 +282,7 @@ double __attribute__((const)) maxfd(double a,double b) { return b; } -double __attribute__((const)) minfd(double a,double b) { +double __attribute__((const)) fmin (double a,double b) { if (a <= b) { return a; } @@ -290,11 +290,11 @@ double __attribute__((const)) minfd(double a,double b) { return b; } -double __attribute__((const)) squaredfd(double n) { +double __attribute__((const)) fsquared (double n) { return n * n } -__attribute__((const)) cmpf(float a,float b) { +__attribute__((const)) fcmp (double a,double b) { if (a == b) { return 0; } @@ -309,18 +309,18 @@ __attribute__((const)) cmpf(float a,float b) { } } -#define sgnfd(X) cmpfd(X,0) +#define sgnfd(X) fcmp(X,0) double __attribute__((const)) norm2xy(double x,double y) { - return sqrt(fdsquared(x)+fdsquared(y)); + return sqrt(fsquared(x)+fsquared(y)); } double __attribute__((const)) norm2xyz(double x,double y,double z) { - return sqrt(fdsquared(x)+fdsquared(y)+fdsquared(z)); + return sqrt(fsquared(x)+fsquared(y)+fsquared(z)); } double __attribute__((const)) norm2xyzw(double x,double y,double z,double w) { - return sqrt(fdsquared(x)+fdsquared(y)+fdsquared(z)+fdsquared(z)); + return sqrt(fsquared(x)+fsquared(y)+fsquared(z)+fsquared(z)); } /*---STDIN---*/ diff --git a/src/rotten/util/util.def b/src/alpha/sandbox/util/util.def similarity index 85% rename from src/rotten/util/util.def rename to src/alpha/sandbox/util/util.def index 0758562..062216e 100644 --- a/src/rotten/util/util.def +++ b/src/alpha/sandbox/util/util.def @@ -2,7 +2,6 @@ #define __GG4872_UTIL_DEF__ #define FILENO int -#define BYTE unsigned char #define addoffset(T,X,Y) (T)(((BYTE*) (X)) + (Y)) #define tosignbit(X) (X < 0 ? 1 : 0) @@ -11,8 +10,8 @@ #define sgn(X) cmp(X,0) #define sgnl(X) cmpl(X,0) #define sgnll(X) cmpll(X,0) -#define sgnf(X) cmpf(X,0) -#define sgnfd(X) cmpfd(X,0) +#define fsgnf(X) fcmpf(X,0) +#define fsgn(X) fcmp(X,0) #define istrue(X) ((X) || 0) #define iff(X,Y) (istrue(X) == istrue(Y)) diff --git a/src/incomplete/sandbox/printer.cc b/src/incomplete/sandbox/printer.cc deleted file mode 100644 index 5abbe65..0000000 --- a/src/incomplete/sandbox/printer.cc +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include - -※include "cppkeyword.H" - -static int ch; -static unsigned line; -static FILE * thisfile; - -extern "C" SYSINT iwf$$printer$$gets (const char * filename) { - thisfile = fopen(filename,"r"); - if (thisfile == NULL) { - return -1; - } - line = 0; - for ( - ch = fgetc(thisfile); - ((unsigned)ch) <= UCHAR_MAX; - ch = fgetc(thisfile)) { - if (!ch) { - buffer.at(line).push_back("\033[m\n"); - line++; - buffer.reserve(line + 1); - if (!(buffer.at(line).empty())) { - buffer.at(line).clear(); - }} else { - buffer.at(line).push_back((char)ch); - }} - fclose(thisfile); - thisfile = NULL; - return 0; - } - -extern "C" SYSINT iwf$$printer$$printline (unsigned index) { - printf("%s",buffer.at(index).c_str(); - } diff --git a/src/deprecated/archive.c b/src/prealpha/deprecated/archive.c similarity index 100% rename from src/deprecated/archive.c rename to src/prealpha/deprecated/archive.c diff --git a/src/deprecated/atomic_mutex.d/atomic_mutex.c b/src/prealpha/deprecated/atomic_mutex.d/atomic_mutex.c similarity index 100% rename from src/deprecated/atomic_mutex.d/atomic_mutex.c rename to src/prealpha/deprecated/atomic_mutex.d/atomic_mutex.c diff --git a/src/deprecated/atomic_mutex.d/atomic_mutex.h b/src/prealpha/deprecated/atomic_mutex.d/atomic_mutex.h similarity index 100% rename from src/deprecated/atomic_mutex.d/atomic_mutex.h rename to src/prealpha/deprecated/atomic_mutex.d/atomic_mutex.h diff --git a/src/deprecated/bettersavefileio.c b/src/prealpha/deprecated/bettersavefileio.c similarity index 100% rename from src/deprecated/bettersavefileio.c rename to src/prealpha/deprecated/bettersavefileio.c diff --git a/src/deprecated/concepts.txt b/src/prealpha/deprecated/concepts.txt similarity index 100% rename from src/deprecated/concepts.txt rename to src/prealpha/deprecated/concepts.txt diff --git a/src/deprecated/doublelinkedlist.cc b/src/prealpha/deprecated/doublelinkedlist.cc similarity index 100% rename from src/deprecated/doublelinkedlist.cc rename to src/prealpha/deprecated/doublelinkedlist.cc diff --git a/src/deprecated/evheap.c b/src/prealpha/deprecated/evheap.c similarity index 100% rename from src/deprecated/evheap.c rename to src/prealpha/deprecated/evheap.c diff --git a/src/deprecated/exists.tmpl b/src/prealpha/deprecated/exists.tmpl similarity index 100% rename from src/deprecated/exists.tmpl rename to src/prealpha/deprecated/exists.tmpl diff --git a/src/deprecated/extmodules.cc b/src/prealpha/deprecated/extmodules.cc similarity index 100% rename from src/deprecated/extmodules.cc rename to src/prealpha/deprecated/extmodules.cc diff --git a/src/deprecated/flywheel.cpseudo b/src/prealpha/deprecated/flywheel.cpseudo similarity index 100% rename from src/deprecated/flywheel.cpseudo rename to src/prealpha/deprecated/flywheel.cpseudo diff --git a/src/deprecated/funstack.c b/src/prealpha/deprecated/funstack.c similarity index 100% rename from src/deprecated/funstack.c rename to src/prealpha/deprecated/funstack.c diff --git a/src/deprecated/getsafe.d/getsafe.cc b/src/prealpha/deprecated/getsafe.d/getsafe.cc similarity index 100% rename from src/deprecated/getsafe.d/getsafe.cc rename to src/prealpha/deprecated/getsafe.d/getsafe.cc diff --git a/src/deprecated/getsafe.d/getsafe.h b/src/prealpha/deprecated/getsafe.d/getsafe.h similarity index 100% rename from src/deprecated/getsafe.d/getsafe.h rename to src/prealpha/deprecated/getsafe.d/getsafe.h diff --git a/src/deprecated/globalvar.cc b/src/prealpha/deprecated/globalvar.cc similarity index 100% rename from src/deprecated/globalvar.cc rename to src/prealpha/deprecated/globalvar.cc diff --git a/src/deprecated/heapio.c b/src/prealpha/deprecated/heapio.c similarity index 100% rename from src/deprecated/heapio.c rename to src/prealpha/deprecated/heapio.c diff --git a/src/deprecated/heapio2.c b/src/prealpha/deprecated/heapio2.c similarity index 100% rename from src/deprecated/heapio2.c rename to src/prealpha/deprecated/heapio2.c diff --git a/src/deprecated/lightning.psudoexpr b/src/prealpha/deprecated/lightning.psudoexpr similarity index 100% rename from src/deprecated/lightning.psudoexpr rename to src/prealpha/deprecated/lightning.psudoexpr diff --git a/src/deprecated/lighttree.c b/src/prealpha/deprecated/lighttree.c similarity index 100% rename from src/deprecated/lighttree.c rename to src/prealpha/deprecated/lighttree.c diff --git a/src/deprecated/plugin.cc b/src/prealpha/deprecated/plugin.cc similarity index 100% rename from src/deprecated/plugin.cc rename to src/prealpha/deprecated/plugin.cc diff --git a/src/deprecated/plugin.cclass b/src/prealpha/deprecated/plugin.cclass similarity index 100% rename from src/deprecated/plugin.cclass rename to src/prealpha/deprecated/plugin.cclass diff --git a/src/deprecated/plugin.h b/src/prealpha/deprecated/plugin.h similarity index 100% rename from src/deprecated/plugin.h rename to src/prealpha/deprecated/plugin.h diff --git a/src/deprecated/pure_c_shared_mutex.c b/src/prealpha/deprecated/pure_c_shared_mutex.c similarity index 100% rename from src/deprecated/pure_c_shared_mutex.c rename to src/prealpha/deprecated/pure_c_shared_mutex.c diff --git a/src/deprecated/renderstack.c b/src/prealpha/deprecated/renderstack.c similarity index 100% rename from src/deprecated/renderstack.c rename to src/prealpha/deprecated/renderstack.c diff --git a/src/deprecated/savefileio.cc b/src/prealpha/deprecated/savefileio.cc similarity index 100% rename from src/deprecated/savefileio.cc rename to src/prealpha/deprecated/savefileio.cc diff --git a/src/deprecated/scalar.c b/src/prealpha/deprecated/scalar.c similarity index 100% rename from src/deprecated/scalar.c rename to src/prealpha/deprecated/scalar.c diff --git a/src/deprecated/strangemutex.cc b/src/prealpha/deprecated/strangemutex.cc similarity index 100% rename from src/deprecated/strangemutex.cc rename to src/prealpha/deprecated/strangemutex.cc diff --git a/src/deprecated/texturetree.c b/src/prealpha/deprecated/texturetree.c similarity index 100% rename from src/deprecated/texturetree.c rename to src/prealpha/deprecated/texturetree.c diff --git a/src/deprecated/uuidtypes.def b/src/prealpha/deprecated/uuidtypes.def similarity index 100% rename from src/deprecated/uuidtypes.def rename to src/prealpha/deprecated/uuidtypes.def diff --git a/src/deprecated/vectors.d/vectors.c b/src/prealpha/deprecated/vectors.d/vectors.c similarity index 100% rename from src/deprecated/vectors.d/vectors.c rename to src/prealpha/deprecated/vectors.d/vectors.c diff --git a/src/deprecated/vectors.d/vectors.c.m4 b/src/prealpha/deprecated/vectors.d/vectors.c.m4 similarity index 100% rename from src/deprecated/vectors.d/vectors.c.m4 rename to src/prealpha/deprecated/vectors.d/vectors.c.m4 diff --git a/src/deprecated/vectors.d/vectors.h b/src/prealpha/deprecated/vectors.d/vectors.h similarity index 100% rename from src/deprecated/vectors.d/vectors.h rename to src/prealpha/deprecated/vectors.d/vectors.h diff --git a/src/deprecated/vectors.d/vectors.h.m4 b/src/prealpha/deprecated/vectors.d/vectors.h.m4 similarity index 100% rename from src/deprecated/vectors.d/vectors.h.m4 rename to src/prealpha/deprecated/vectors.d/vectors.h.m4 diff --git a/src/deprecated/wrapper___std___shared_mutex.cc b/src/prealpha/deprecated/wrapper___std___shared_mutex.cc similarity index 100% rename from src/deprecated/wrapper___std___shared_mutex.cc rename to src/prealpha/deprecated/wrapper___std___shared_mutex.cc diff --git a/src/incomplete/TODO b/src/prealpha/incomplete/TODO similarity index 100% rename from src/incomplete/TODO rename to src/prealpha/incomplete/TODO diff --git a/src/incomplete/launchpad/camcoord.cc b/src/prealpha/incomplete/launchpad/camcoord.cc similarity index 100% rename from src/incomplete/launchpad/camcoord.cc rename to src/prealpha/incomplete/launchpad/camcoord.cc diff --git a/src/incomplete/launchpad/directory/directory.hh b/src/prealpha/incomplete/launchpad/directory/directory.hh similarity index 100% rename from src/incomplete/launchpad/directory/directory.hh rename to src/prealpha/incomplete/launchpad/directory/directory.hh diff --git a/src/incomplete/launchpad/directory/tmp_directory.tmpl b/src/prealpha/incomplete/launchpad/directory/tmp_directory.tmpl similarity index 100% rename from src/incomplete/launchpad/directory/tmp_directory.tmpl rename to src/prealpha/incomplete/launchpad/directory/tmp_directory.tmpl diff --git a/src/incomplete/launchpad/minifixed.cc b/src/prealpha/incomplete/launchpad/minifixed.cc similarity index 100% rename from src/incomplete/launchpad/minifixed.cc rename to src/prealpha/incomplete/launchpad/minifixed.cc diff --git a/src/incomplete/launchpad/ncursesnoise.c b/src/prealpha/incomplete/launchpad/ncursesnoise.c similarity index 100% rename from src/incomplete/launchpad/ncursesnoise.c rename to src/prealpha/incomplete/launchpad/ncursesnoise.c diff --git a/src/incomplete/launchpad/slurp.cc b/src/prealpha/incomplete/launchpad/slurp.cc similarity index 100% rename from src/incomplete/launchpad/slurp.cc rename to src/prealpha/incomplete/launchpad/slurp.cc diff --git a/src/incomplete/mothballed/argvlogic.h b/src/prealpha/incomplete/mothballed/argvlogic.h similarity index 100% rename from src/incomplete/mothballed/argvlogic.h rename to src/prealpha/incomplete/mothballed/argvlogic.h diff --git a/src/incomplete/mothballed/as_moduleglue.cc b/src/prealpha/incomplete/mothballed/as_moduleglue.cc similarity index 100% rename from src/incomplete/mothballed/as_moduleglue.cc rename to src/prealpha/incomplete/mothballed/as_moduleglue.cc diff --git a/src/incomplete/mothballed/build.sh b/src/prealpha/incomplete/mothballed/build.sh similarity index 100% rename from src/incomplete/mothballed/build.sh rename to src/prealpha/incomplete/mothballed/build.sh diff --git a/src/incomplete/mothballed/chunk.H b/src/prealpha/incomplete/mothballed/chunk.H similarity index 100% rename from src/incomplete/mothballed/chunk.H rename to src/prealpha/incomplete/mothballed/chunk.H diff --git a/src/incomplete/mothballed/chunk.fragment b/src/prealpha/incomplete/mothballed/chunk.fragment similarity index 100% rename from src/incomplete/mothballed/chunk.fragment rename to src/prealpha/incomplete/mothballed/chunk.fragment diff --git a/src/incomplete/mothballed/commandline.hh b/src/prealpha/incomplete/mothballed/commandline.hh similarity index 100% rename from src/incomplete/mothballed/commandline.hh rename to src/prealpha/incomplete/mothballed/commandline.hh diff --git a/src/incomplete/mothballed/commandlinesyntax.txt b/src/prealpha/incomplete/mothballed/commandlinesyntax.txt similarity index 100% rename from src/incomplete/mothballed/commandlinesyntax.txt rename to src/prealpha/incomplete/mothballed/commandlinesyntax.txt diff --git a/src/incomplete/mothballed/doublelinkedlist.d/refcounted.cc b/src/prealpha/incomplete/mothballed/doublelinkedlist.d/refcounted.cc similarity index 100% rename from src/incomplete/mothballed/doublelinkedlist.d/refcounted.cc rename to src/prealpha/incomplete/mothballed/doublelinkedlist.d/refcounted.cc diff --git a/src/incomplete/mothballed/doublelinkedlist.d/refcounted.h b/src/prealpha/incomplete/mothballed/doublelinkedlist.d/refcounted.h similarity index 100% rename from src/incomplete/mothballed/doublelinkedlist.d/refcounted.h rename to src/prealpha/incomplete/mothballed/doublelinkedlist.d/refcounted.h diff --git a/src/incomplete/mothballed/doublelinkedlist.d/refcounted.hh b/src/prealpha/incomplete/mothballed/doublelinkedlist.d/refcounted.hh similarity index 100% rename from src/incomplete/mothballed/doublelinkedlist.d/refcounted.hh rename to src/prealpha/incomplete/mothballed/doublelinkedlist.d/refcounted.hh diff --git a/src/incomplete/mothballed/flywheel/flywheel.cclass b/src/prealpha/incomplete/mothballed/flywheel/flywheel.cclass similarity index 100% rename from src/incomplete/mothballed/flywheel/flywheel.cclass rename to src/prealpha/incomplete/mothballed/flywheel/flywheel.cclass diff --git a/src/incomplete/mothballed/flywheel/flywheel.hh b/src/prealpha/incomplete/mothballed/flywheel/flywheel.hh similarity index 100% rename from src/incomplete/mothballed/flywheel/flywheel.hh rename to src/prealpha/incomplete/mothballed/flywheel/flywheel.hh diff --git a/src/incomplete/mothballed/iwf__chunk.cc b/src/prealpha/incomplete/mothballed/iwf__chunk.cc similarity index 100% rename from src/incomplete/mothballed/iwf__chunk.cc rename to src/prealpha/incomplete/mothballed/iwf__chunk.cc diff --git a/src/incomplete/mothballed/iwf__graphics3d.cc b/src/prealpha/incomplete/mothballed/iwf__graphics3d.cc similarity index 100% rename from src/incomplete/mothballed/iwf__graphics3d.cc rename to src/prealpha/incomplete/mothballed/iwf__graphics3d.cc diff --git a/src/incomplete/mothballed/iwf__voxels__minichunk/C_iwf__voxels__minichunk.cc b/src/prealpha/incomplete/mothballed/iwf__voxels__minichunk/C_iwf__voxels__minichunk.cc similarity index 100% rename from src/incomplete/mothballed/iwf__voxels__minichunk/C_iwf__voxels__minichunk.cc rename to src/prealpha/incomplete/mothballed/iwf__voxels__minichunk/C_iwf__voxels__minichunk.cc diff --git a/src/incomplete/mothballed/iwf__voxels__minichunk/C_iwf__voxels__minichunk.h b/src/prealpha/incomplete/mothballed/iwf__voxels__minichunk/C_iwf__voxels__minichunk.h similarity index 100% rename from src/incomplete/mothballed/iwf__voxels__minichunk/C_iwf__voxels__minichunk.h rename to src/prealpha/incomplete/mothballed/iwf__voxels__minichunk/C_iwf__voxels__minichunk.h diff --git a/src/incomplete/mothballed/iwf__voxels__minichunk/iwf__voxels__minichunk.cclass b/src/prealpha/incomplete/mothballed/iwf__voxels__minichunk/iwf__voxels__minichunk.cclass similarity index 100% rename from src/incomplete/mothballed/iwf__voxels__minichunk/iwf__voxels__minichunk.cclass rename to src/prealpha/incomplete/mothballed/iwf__voxels__minichunk/iwf__voxels__minichunk.cclass diff --git a/src/incomplete/mothballed/iwf__voxels__minichunk/iwf__voxels__minichunk.hh b/src/prealpha/incomplete/mothballed/iwf__voxels__minichunk/iwf__voxels__minichunk.hh similarity index 100% rename from src/incomplete/mothballed/iwf__voxels__minichunk/iwf__voxels__minichunk.hh rename to src/prealpha/incomplete/mothballed/iwf__voxels__minichunk/iwf__voxels__minichunk.hh diff --git a/src/incomplete/mothballed/iwf_joystick.c b/src/prealpha/incomplete/mothballed/iwf_joystick.c similarity index 100% rename from src/incomplete/mothballed/iwf_joystick.c rename to src/prealpha/incomplete/mothballed/iwf_joystick.c diff --git a/src/incomplete/mothballed/keyswitch.inc b/src/prealpha/incomplete/mothballed/keyswitch.inc similarity index 100% rename from src/incomplete/mothballed/keyswitch.inc rename to src/prealpha/incomplete/mothballed/keyswitch.inc diff --git a/src/incomplete/mothballed/listcontainer.cc b/src/prealpha/incomplete/mothballed/listcontainer.cc similarity index 100% rename from src/incomplete/mothballed/listcontainer.cc rename to src/prealpha/incomplete/mothballed/listcontainer.cc diff --git a/src/incomplete/mothballed/magnetoception.txt b/src/prealpha/incomplete/mothballed/magnetoception.txt similarity index 100% rename from src/incomplete/mothballed/magnetoception.txt rename to src/prealpha/incomplete/mothballed/magnetoception.txt diff --git a/src/incomplete/mothballed/main.cc b/src/prealpha/incomplete/mothballed/main.cc similarity index 100% rename from src/incomplete/mothballed/main.cc rename to src/prealpha/incomplete/mothballed/main.cc diff --git a/src/incomplete/mothballed/memdump.pseudoc b/src/prealpha/incomplete/mothballed/memdump.pseudoc similarity index 100% rename from src/incomplete/mothballed/memdump.pseudoc rename to src/prealpha/incomplete/mothballed/memdump.pseudoc diff --git a/src/incomplete/mothballed/octanttriple.c b/src/prealpha/incomplete/mothballed/octanttriple.c similarity index 100% rename from src/incomplete/mothballed/octanttriple.c rename to src/prealpha/incomplete/mothballed/octanttriple.c diff --git a/src/incomplete/mothballed/pools.cc b/src/prealpha/incomplete/mothballed/pools.cc similarity index 100% rename from src/incomplete/mothballed/pools.cc rename to src/prealpha/incomplete/mothballed/pools.cc diff --git a/src/incomplete/mothballed/refcount.d/refcounted.cc b/src/prealpha/incomplete/mothballed/refcount.d/refcounted.cc similarity index 100% rename from src/incomplete/mothballed/refcount.d/refcounted.cc rename to src/prealpha/incomplete/mothballed/refcount.d/refcounted.cc diff --git a/src/incomplete/mothballed/refcount.d/refcounted.h b/src/prealpha/incomplete/mothballed/refcount.d/refcounted.h similarity index 100% rename from src/incomplete/mothballed/refcount.d/refcounted.h rename to src/prealpha/incomplete/mothballed/refcount.d/refcounted.h diff --git a/src/incomplete/mothballed/refcount.d/refcounted.hh b/src/prealpha/incomplete/mothballed/refcount.d/refcounted.hh similarity index 100% rename from src/incomplete/mothballed/refcount.d/refcounted.hh rename to src/prealpha/incomplete/mothballed/refcount.d/refcounted.hh diff --git a/src/incomplete/mothballed/repl.cc b/src/prealpha/incomplete/mothballed/repl.cc similarity index 100% rename from src/incomplete/mothballed/repl.cc rename to src/prealpha/incomplete/mothballed/repl.cc diff --git a/src/incomplete/mothballed/scriptboot.cc b/src/prealpha/incomplete/mothballed/scriptboot.cc similarity index 100% rename from src/incomplete/mothballed/scriptboot.cc rename to src/prealpha/incomplete/mothballed/scriptboot.cc diff --git a/src/incomplete/mothballed/seedcrypt.cc b/src/prealpha/incomplete/mothballed/seedcrypt.cc similarity index 100% rename from src/incomplete/mothballed/seedcrypt.cc rename to src/prealpha/incomplete/mothballed/seedcrypt.cc diff --git a/src/incomplete/mothballed/seedcrypt.h b/src/prealpha/incomplete/mothballed/seedcrypt.h similarity index 100% rename from src/incomplete/mothballed/seedcrypt.h rename to src/prealpha/incomplete/mothballed/seedcrypt.h diff --git a/src/incomplete/mothballed/seedcrypt.hlib b/src/prealpha/incomplete/mothballed/seedcrypt.hlib similarity index 100% rename from src/incomplete/mothballed/seedcrypt.hlib rename to src/prealpha/incomplete/mothballed/seedcrypt.hlib diff --git a/src/incomplete/mothballed/split.cc b/src/prealpha/incomplete/mothballed/split.cc similarity index 100% rename from src/incomplete/mothballed/split.cc rename to src/prealpha/incomplete/mothballed/split.cc diff --git a/src/incomplete/mothballed/startup.cc b/src/prealpha/incomplete/mothballed/startup.cc similarity index 100% rename from src/incomplete/mothballed/startup.cc rename to src/prealpha/incomplete/mothballed/startup.cc diff --git a/src/incomplete/mothballed/types.h b/src/prealpha/incomplete/mothballed/types.h similarity index 100% rename from src/incomplete/mothballed/types.h rename to src/prealpha/incomplete/mothballed/types.h diff --git a/src/incomplete/mothballed/variablewidthdatablock/variablewidthdatablock.cc b/src/prealpha/incomplete/mothballed/variablewidthdatablock/variablewidthdatablock.cc similarity index 100% rename from src/incomplete/mothballed/variablewidthdatablock/variablewidthdatablock.cc rename to src/prealpha/incomplete/mothballed/variablewidthdatablock/variablewidthdatablock.cc diff --git a/src/incomplete/mothballed/variablewidthdatablock/variablewidthdatablock.hh b/src/prealpha/incomplete/mothballed/variablewidthdatablock/variablewidthdatablock.hh similarity index 100% rename from src/incomplete/mothballed/variablewidthdatablock/variablewidthdatablock.hh rename to src/prealpha/incomplete/mothballed/variablewidthdatablock/variablewidthdatablock.hh diff --git a/src/incomplete/mothballed/voxel.H b/src/prealpha/incomplete/mothballed/voxel.H similarity index 100% rename from src/incomplete/mothballed/voxel.H rename to src/prealpha/incomplete/mothballed/voxel.H diff --git a/src/incomplete/sandbox/bitstruct/bitpack.c b/src/prealpha/incomplete/sandbox/bitstruct/bitpack.c similarity index 100% rename from src/incomplete/sandbox/bitstruct/bitpack.c rename to src/prealpha/incomplete/sandbox/bitstruct/bitpack.c diff --git a/src/incomplete/sandbox/bitstruct/bitpack.h b/src/prealpha/incomplete/sandbox/bitstruct/bitpack.h similarity index 100% rename from src/incomplete/sandbox/bitstruct/bitpack.h rename to src/prealpha/incomplete/sandbox/bitstruct/bitpack.h diff --git a/src/incomplete/sandbox/commandline/lexer.lex b/src/prealpha/incomplete/sandbox/commandline/lexer.lex similarity index 100% rename from src/incomplete/sandbox/commandline/lexer.lex rename to src/prealpha/incomplete/sandbox/commandline/lexer.lex diff --git a/src/incomplete/sandbox/commandline/parser.y b/src/prealpha/incomplete/sandbox/commandline/parser.y similarity index 100% rename from src/incomplete/sandbox/commandline/parser.y rename to src/prealpha/incomplete/sandbox/commandline/parser.y diff --git a/src/incomplete/sandbox/commandline/wrapper.cc b/src/prealpha/incomplete/sandbox/commandline/wrapper.cc similarity index 100% rename from src/incomplete/sandbox/commandline/wrapper.cc rename to src/prealpha/incomplete/sandbox/commandline/wrapper.cc diff --git a/src/incomplete/sandbox/cursesprinter.cc b/src/prealpha/incomplete/sandbox/cursesprinter.cc similarity index 100% rename from src/incomplete/sandbox/cursesprinter.cc rename to src/prealpha/incomplete/sandbox/cursesprinter.cc diff --git a/src/incomplete/sandbox/datatypes/basenttyp/abilities.H b/src/prealpha/incomplete/sandbox/datatypes/basenttyp/abilities.H similarity index 100% rename from src/incomplete/sandbox/datatypes/basenttyp/abilities.H rename to src/prealpha/incomplete/sandbox/datatypes/basenttyp/abilities.H diff --git a/src/incomplete/sandbox/datatypes/chunk.H b/src/prealpha/incomplete/sandbox/datatypes/chunk.H similarity index 100% rename from src/incomplete/sandbox/datatypes/chunk.H rename to src/prealpha/incomplete/sandbox/datatypes/chunk.H diff --git a/src/incomplete/sandbox/datatypes/chunk__directions.def b/src/prealpha/incomplete/sandbox/datatypes/chunk__directions.def similarity index 100% rename from src/incomplete/sandbox/datatypes/chunk__directions.def rename to src/prealpha/incomplete/sandbox/datatypes/chunk__directions.def diff --git a/src/incomplete/sandbox/datatypes/chunk__magic.H b/src/prealpha/incomplete/sandbox/datatypes/chunk__magic.H similarity index 100% rename from src/incomplete/sandbox/datatypes/chunk__magic.H rename to src/prealpha/incomplete/sandbox/datatypes/chunk__magic.H diff --git a/src/incomplete/sandbox/datatypes/color.H b/src/prealpha/incomplete/sandbox/datatypes/color.H similarity index 100% rename from src/incomplete/sandbox/datatypes/color.H rename to src/prealpha/incomplete/sandbox/datatypes/color.H diff --git a/src/incomplete/sandbox/datatypes/encounter_wheel/encounter_wheel.cc b/src/prealpha/incomplete/sandbox/datatypes/encounter_wheel/encounter_wheel.cc similarity index 100% rename from src/incomplete/sandbox/datatypes/encounter_wheel/encounter_wheel.cc rename to src/prealpha/incomplete/sandbox/datatypes/encounter_wheel/encounter_wheel.cc diff --git a/src/incomplete/sandbox/datatypes/encounter_wheel/encounter_wheel.h b/src/prealpha/incomplete/sandbox/datatypes/encounter_wheel/encounter_wheel.h similarity index 100% rename from src/incomplete/sandbox/datatypes/encounter_wheel/encounter_wheel.h rename to src/prealpha/incomplete/sandbox/datatypes/encounter_wheel/encounter_wheel.h diff --git a/src/incomplete/sandbox/datatypes/encounter_wheel/encounter_wheel.hh b/src/prealpha/incomplete/sandbox/datatypes/encounter_wheel/encounter_wheel.hh similarity index 100% rename from src/incomplete/sandbox/datatypes/encounter_wheel/encounter_wheel.hh rename to src/prealpha/incomplete/sandbox/datatypes/encounter_wheel/encounter_wheel.hh diff --git a/src/incomplete/sandbox/datatypes/entity/ent_map.make b/src/prealpha/incomplete/sandbox/datatypes/entity/ent_map.make similarity index 100% rename from src/incomplete/sandbox/datatypes/entity/ent_map.make rename to src/prealpha/incomplete/sandbox/datatypes/entity/ent_map.make diff --git a/src/incomplete/sandbox/datatypes/lights/lighttype.h b/src/prealpha/incomplete/sandbox/datatypes/lights/lighttype.h similarity index 100% rename from src/incomplete/sandbox/datatypes/lights/lighttype.h rename to src/prealpha/incomplete/sandbox/datatypes/lights/lighttype.h diff --git a/src/incomplete/sandbox/datatypes/lights/lighttype_map.make b/src/prealpha/incomplete/sandbox/datatypes/lights/lighttype_map.make similarity index 100% rename from src/incomplete/sandbox/datatypes/lights/lighttype_map.make rename to src/prealpha/incomplete/sandbox/datatypes/lights/lighttype_map.make diff --git a/src/incomplete/sandbox/pathfinder_data.cc b/src/prealpha/incomplete/sandbox/pathfinder_data.cc similarity index 100% rename from src/incomplete/sandbox/pathfinder_data.cc rename to src/prealpha/incomplete/sandbox/pathfinder_data.cc diff --git a/src/incomplete/sandbox/printer.H b/src/prealpha/incomplete/sandbox/printer.H similarity index 100% rename from src/incomplete/sandbox/printer.H rename to src/prealpha/incomplete/sandbox/printer.H diff --git a/src/prealpha/incomplete/sandbox/printer.cc b/src/prealpha/incomplete/sandbox/printer.cc new file mode 100644 index 0000000..bd7fa5c --- /dev/null +++ b/src/prealpha/incomplete/sandbox/printer.cc @@ -0,0 +1,78 @@ +#include +#include +#include + +※include "cppkeyword.H" + +static int ch; +static unsigned line; +static FILE * thisfile; +extern std::vector> PLAYERNAMES; +const char *PRONOUNS[3][4] = { + "she","her","her","hers", + "he","him","his","his", + "they","them","their","theirs" + }; + +extern "C" SYSINT iwf$$printer$$gets (const char * filename) { + thisfile = fopen(filename,"r"); + if (thisfile == NULL) { + return -1; + } + size_t line = 0; + bool mode = 0; + for ( + ch = fgetc(thisfile); + ((unsigned)ch) <= UCHAR_MAX; + ch = fgetc(thisfile)) { + if (mode) { + if ( + !ch + || + ((4 < ch) && (ch < 010) + || + ((016 <= ch) && (ch < 027)) + || + (ch == 032) + || + ((034 <= ch) && (ch <= 037)) + ) { + buffer.at(line).push_back("�"); + } else if (((1 <= ch) && (ch <= 3)) || (ch == 027)) { + if ((!(buffer.at(line).empty())) || (ch == 027)) { + buffer.at(line).push_back("\033[m\n"); + line++; + buffer.reserve(line + 1); + buffer.at(line).clear(); + } + if (ch == 1) { + buffer.at(line).push_back("\033[2;3m"); + } else if (ch == 3) { + mode = false; + }} else if (ch == 030) { + buffer.at(line).clear(); + } else if ((ch == 4) || (ch == 031)) { + goto endmedium; //goto is less ambiguous than break + } else if (ch == 0xFE) { + int playerno = fgetc(thisfile); + buffer.at(line).push_back(PLAYERNAMES.at(playerno).first) + } else if (ch == 0xFF) { + int playerno = fgetc(thisfile); + int index = fgetc(thisfile); + buffer.at(line).push_back(PRONOUNS[PLAYERNAMES.at(playerno).second % 3][index % 4]); + } else { + buffer.at(line).push_back((char)ch); + } + } else { + if (ch == 2) { + mode = true; + }} + endmedium: + fclose(thisfile); + thisfile = NULL; + return 0; + } + +extern "C" SYSINT iwf$$printer$$printline (unsigned index) { + printf("%s",buffer.at(index).c_str()); + } diff --git a/src/incomplete/sandbox/reload_rooms.inc b/src/prealpha/incomplete/sandbox/reload_rooms.inc similarity index 100% rename from src/incomplete/sandbox/reload_rooms.inc rename to src/prealpha/incomplete/sandbox/reload_rooms.inc diff --git a/src/incomplete/sandbox/tiledata.H b/src/prealpha/incomplete/sandbox/tiledata.H similarity index 100% rename from src/incomplete/sandbox/tiledata.H rename to src/prealpha/incomplete/sandbox/tiledata.H diff --git a/src/incomplete/sandbox/tileref.c b/src/prealpha/incomplete/sandbox/tileref.c similarity index 100% rename from src/incomplete/sandbox/tileref.c rename to src/prealpha/incomplete/sandbox/tileref.c diff --git a/src/incomplete/sandbox/voxelnodeid.c b/src/prealpha/incomplete/sandbox/voxelnodeid.c similarity index 100% rename from src/incomplete/sandbox/voxelnodeid.c rename to src/prealpha/incomplete/sandbox/voxelnodeid.c diff --git a/src/incomplete/scratchpad.d/dijkstra.c b/src/prealpha/incomplete/scratchpad.d/dijkstra.c similarity index 100% rename from src/incomplete/scratchpad.d/dijkstra.c rename to src/prealpha/incomplete/scratchpad.d/dijkstra.c diff --git a/src/incomplete/scratchpad.d/dijkstra2.c b/src/prealpha/incomplete/scratchpad.d/dijkstra2.c similarity index 100% rename from src/incomplete/scratchpad.d/dijkstra2.c rename to src/prealpha/incomplete/scratchpad.d/dijkstra2.c diff --git a/src/incomplete/scratchpad.d/irrcontext.cc b/src/prealpha/incomplete/scratchpad.d/irrcontext.cc similarity index 100% rename from src/incomplete/scratchpad.d/irrcontext.cc rename to src/prealpha/incomplete/scratchpad.d/irrcontext.cc diff --git a/src/incomplete/scratchpad.d/loadvoxels.cc b/src/prealpha/incomplete/scratchpad.d/loadvoxels.cc similarity index 100% rename from src/incomplete/scratchpad.d/loadvoxels.cc rename to src/prealpha/incomplete/scratchpad.d/loadvoxels.cc diff --git a/src/incomplete/scratchpad.d/roomcache.cc b/src/prealpha/incomplete/scratchpad.d/roomcache.cc similarity index 100% rename from src/incomplete/scratchpad.d/roomcache.cc rename to src/prealpha/incomplete/scratchpad.d/roomcache.cc diff --git a/src/incomplete/scratchpad.d/round.c b/src/prealpha/incomplete/scratchpad.d/round.c similarity index 100% rename from src/incomplete/scratchpad.d/round.c rename to src/prealpha/incomplete/scratchpad.d/round.c diff --git a/src/incomplete/scratchpad.d/scratchpad b/src/prealpha/incomplete/scratchpad.d/scratchpad similarity index 100% rename from src/incomplete/scratchpad.d/scratchpad rename to src/prealpha/incomplete/scratchpad.d/scratchpad diff --git a/src/incomplete/scratchpad.d/tiledata_and_texturecache.c b/src/prealpha/incomplete/scratchpad.d/tiledata_and_texturecache.c similarity index 100% rename from src/incomplete/scratchpad.d/tiledata_and_texturecache.c rename to src/prealpha/incomplete/scratchpad.d/tiledata_and_texturecache.c diff --git a/src/ongoing/CONFIG.DEF b/src/prealpha/ongoing/CONFIG.DEF similarity index 100% rename from src/ongoing/CONFIG.DEF rename to src/prealpha/ongoing/CONFIG.DEF diff --git a/src/ongoing/globals.inc b/src/prealpha/ongoing/globals.inc similarity index 100% rename from src/ongoing/globals.inc rename to src/prealpha/ongoing/globals.inc diff --git a/src/reference/badlexer.cc b/src/prealpha/reference/badlexer.cc similarity index 100% rename from src/reference/badlexer.cc rename to src/prealpha/reference/badlexer.cc diff --git a/src/reference/cuckootree.c b/src/prealpha/reference/cuckootree.c similarity index 100% rename from src/reference/cuckootree.c rename to src/prealpha/reference/cuckootree.c diff --git a/src/reference/evheap.c b/src/prealpha/reference/evheap.c similarity index 100% rename from src/reference/evheap.c rename to src/prealpha/reference/evheap.c diff --git a/src/reference/main.c b/src/prealpha/reference/main.c similarity index 100% rename from src/reference/main.c rename to src/prealpha/reference/main.c diff --git a/src/reference/oldtypes.h b/src/prealpha/reference/oldtypes.h similarity index 100% rename from src/reference/oldtypes.h rename to src/prealpha/reference/oldtypes.h diff --git a/src/reference/tmp.cnode b/src/prealpha/reference/tmp.cnode similarity index 100% rename from src/reference/tmp.cnode rename to src/prealpha/reference/tmp.cnode diff --git a/src/rotten/bitconcat/bitconcat.c b/src/prealpha/rotten/bitconcat/bitconcat.c similarity index 100% rename from src/rotten/bitconcat/bitconcat.c rename to src/prealpha/rotten/bitconcat/bitconcat.c diff --git a/src/rotten/bitconcat/bitconcat.h b/src/prealpha/rotten/bitconcat/bitconcat.h similarity index 100% rename from src/rotten/bitconcat/bitconcat.h rename to src/prealpha/rotten/bitconcat/bitconcat.h diff --git a/src/rotten/dlfunc_shim.h b/src/prealpha/rotten/dlfunc_shim.h similarity index 100% rename from src/rotten/dlfunc_shim.h rename to src/prealpha/rotten/dlfunc_shim.h diff --git a/src/rotten/fdshim.def b/src/prealpha/rotten/fdshim.def similarity index 100% rename from src/rotten/fdshim.def rename to src/prealpha/rotten/fdshim.def diff --git a/src/rotten/listf/listf.cc b/src/prealpha/rotten/listf/listf.cc similarity index 100% rename from src/rotten/listf/listf.cc rename to src/prealpha/rotten/listf/listf.cc diff --git a/src/rotten/listf/listf.h b/src/prealpha/rotten/listf/listf.h similarity index 100% rename from src/rotten/listf/listf.h rename to src/prealpha/rotten/listf/listf.h diff --git a/src/rotten/random/random.c b/src/prealpha/rotten/random/random.c similarity index 100% rename from src/rotten/random/random.c rename to src/prealpha/rotten/random/random.c diff --git a/src/rotten/random/random.h b/src/prealpha/rotten/random/random.h similarity index 100% rename from src/rotten/random/random.h rename to src/prealpha/rotten/random/random.h diff --git a/src/rotten/structops/structops.c b/src/prealpha/rotten/structops/structops.c similarity index 100% rename from src/rotten/structops/structops.c rename to src/prealpha/rotten/structops/structops.c diff --git a/src/rotten/structops/structops.h b/src/prealpha/rotten/structops/structops.h similarity index 100% rename from src/rotten/structops/structops.h rename to src/prealpha/rotten/structops/structops.h diff --git a/src/stable/barrelroll.inl b/src/prealpha/stable/barrelroll.inl similarity index 100% rename from src/stable/barrelroll.inl rename to src/prealpha/stable/barrelroll.inl diff --git a/src/stable/cursescat/cursescat.c b/src/prealpha/stable/cursescat/cursescat.c similarity index 100% rename from src/stable/cursescat/cursescat.c rename to src/prealpha/stable/cursescat/cursescat.c diff --git a/src/stable/cursescat/cursescat.h b/src/prealpha/stable/cursescat/cursescat.h similarity index 100% rename from src/stable/cursescat/cursescat.h rename to src/prealpha/stable/cursescat/cursescat.h diff --git a/src/stable/loops.def b/src/prealpha/stable/loops.def similarity index 100% rename from src/stable/loops.def rename to src/prealpha/stable/loops.def diff --git a/src/stable/threequal.tmpl b/src/prealpha/stable/threequal.tmpl similarity index 100% rename from src/stable/threequal.tmpl rename to src/prealpha/stable/threequal.tmpl diff --git a/textures/diamond.png b/textures/diamond.png index d33a503628a1f7958b8cf203410102924d787228..cf55dc11393bcd6b05f81a7a12489db9b3de265a 100644 GIT binary patch delta 146 zcmV;D0B!%60mA{1Ie&FYL_t(Ijm?lj4uBvG1gFG@@$~+z9<-#QAaKz+k+Qql7QRNp z+g7|DV5(Yva?Y4t^F)MN1Bi^6dm*w={lW&^QfC?@K+b)ph&OP`E#8jkW`GnmBTb^Y zg{i6m=EPYoZY3Ee>Py9rMOGHZ`01E&B07*qoM6N<$g2{+O AV*mgE delta 102 zcmV-s0Ga>80hj@hIbTXiL_t(IjbmUKXuycX{!f8k49(aK!>NWC%{bLE63{>tpvVQ- zB#1QtLmeSQh_d8A9tHU12r496GqMJB14xc7Vgr^WmkdGx0POiC-mkhhZU6uP07*qo IM6N<$f*i3Xf&c&j diff --git a/textures/diamond_shape.png b/textures/diamond_shape.png new file mode 100644 index 0000000000000000000000000000000000000000..d33a503628a1f7958b8cf203410102924d787228 GIT binary patch literal 152 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5M?jcysy3fAP|(ZM z#WBR9H#tEf<3PuefBubeJZEq49A4Qban|ChkV&bGC0dBI(KY(VlT(~ v;|YhBN|f;?wi0HKKHVhdX)4osoERA1{8YWSewTS3&{PIbS3j3^P6|3H|LeTroZP*A8U zB%&lFvm_^#fq`SDx2_fw15*d1S52y-1yEK3BI9J0gq?i3XE&PBRo{ zTZbDN&;QB7-M{5lS9Mm-`O=sZH+}RYgmspAL~an<^5dH2{tt4q6YuYQyEEsm-@QG@ rzwWK7SDE-Yur@30*IMIqe^xOa^vzV_k-GH_Xf=bUtDnm{r-UW|7@Jp4 literal 0 HcmV?d00001 diff --git a/textures/wormhole_ripple.gif b/textures/wormhole_ripple.gif new file mode 100644 index 0000000000000000000000000000000000000000..4ee78e6509168a7670b1ac098e623b7b6a851e97 GIT binary patch literal 2513 zcmeHI?N3@~9K9_dSHL0_>I+t0M5U`QVAWBp0v8Z;ouZS?t)?yL8qzcojcJ<2>X0j< zwJO?dW@{qWrZtU;xR}X@Mn$36Y>BjKvNoEC+C>tztF09*BD?JK{SVgX4>&pJ{LVR# zyrfugR!ss(fG@xYKD|#4{I47c0V*J*QiW8HLaI=R6(W|&s=ktlm9p$i9_9#Q1#2IR zqXGdSJ#0(3CIFZP1cUG8R*StABp=_B>n!$;Xj*BV$*q>^V>9wx-@}?xl)< z8XMFxT}F=T`ax_o8el#U3NCFdu1w#=kl6)VYSbu zpZ7xBw<>L;u`ZtHy4kLF+^Gj+e*Q?wZSLp&*B1KKA~cR7Ahf;oSG{Mp1q{a5*cLB| z4Fvk$d-;wBf@5&mcWf1GrwNm+*?qX9Rt%8RzJ_mPkH`$*ISBjeEywvI>T%Bjf$gP@ za*wDL6ZK}(rMnEZ6C*S0UXEKNa0~;w=2bGGuIQ92oVfmVM_1bC*K@Qxo`r$asumK6 zM)EA+`+yk9w720YsaxMD)xuWXK0ilLp`O>%VvoVL@_X|}s_?tVex63AXY#vp2H#oa z{bbBhG&B+5+g_JjhlKhAEMe=?_38-8|Mj93&;x2_`N}IzUE# z6LbovEXuXkUuFm!5(i@34=XawQU-h+x#~G^?km1&lhL zzTjRJ8}RWLn{DOl`Od`T76;gvENKsZR+*@%d@VLp$}QoZ$_>6W7b znp9vNn!kC-PN+f1ij7fOMOD>0rp$CQCSh_=w+{8T~TM+ z#=LHi7^Y?w9|)dXWacE*54#&#s0l&_XglC5w}`?Cl6n^z_BIUV&HIOLi^D)9<~iah zY-b0aWtl4>18ZYBwf?hE+qv;C