├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTORS.md ├── COPYING.md ├── INSTALL.md ├── README.md ├── bin_unix └── README.txt ├── bin_win32 └── README.txt ├── bin_win64 └── README.txt ├── config ├── autoexec.cfg ├── blendbrush.cfg ├── default.cfg ├── default_map_settings.cfg ├── font.cfg ├── glsl.cfg ├── glsl │ ├── aa.cfg │ ├── ao.cfg │ ├── blur.cfg │ ├── decal.cfg │ ├── deferred.cfg │ ├── edit.cfg │ ├── fxaa.cfg │ ├── gi.cfg │ ├── grass.cfg │ ├── hud.cfg │ ├── material.cfg │ ├── misc.cfg │ ├── model.cfg │ ├── movie.cfg │ ├── particle.cfg │ ├── postfx.cfg │ ├── scale.cfg │ ├── shared.cfg │ ├── sky.cfg │ ├── smaa.cfg │ ├── stain.cfg │ ├── tonemap.cfg │ ├── ui.cfg │ ├── volumetric.cfg │ └── world.cfg ├── heightmap.cfg ├── keymap.cfg ├── server-init.cfg ├── stdedit.cfg ├── stdlib.cfg ├── ui.cfg ├── ui.oct └── ui │ ├── 2048.oct │ ├── edit.oct │ ├── misc.oct │ └── options.oct ├── media ├── blendbrush │ ├── circle_128_hard.png │ ├── circle_128_soft.png │ ├── circle_128_solid.png │ ├── circle_16_hard.png │ ├── circle_16_soft.png │ ├── circle_16_solid.png │ ├── circle_256_hard.png │ ├── circle_256_soft.png │ ├── circle_256_solid.png │ ├── circle_32_hard.png │ ├── circle_32_soft.png │ ├── circle_32_solid.png │ ├── circle_64_hard.png │ ├── circle_64_soft.png │ ├── circle_64_solid.png │ ├── circle_8_hard.png │ ├── circle_8_soft.png │ ├── circle_8_solid.png │ ├── dot_1_hard.png │ ├── dot_1_soft.png │ ├── dot_1_solid.png │ ├── gradient_128.png │ ├── gradient_16.png │ ├── gradient_32.png │ ├── gradient_64.png │ ├── noise_1024_hard.png │ ├── noise_1024_soft.png │ ├── noise_128_hard.png │ ├── noise_128_soft.png │ ├── noise_256_hard.png │ ├── noise_256_soft.png │ ├── noise_512_hard.png │ ├── noise_512_soft.png │ ├── noise_64_hard.png │ ├── noise_64_soft.png │ ├── square_16_hard.png │ ├── square_16_solid.png │ ├── square_32_hard.png │ ├── square_32_solid.png │ ├── square_64_hard.png │ └── square_64_solid.png ├── interface │ ├── background.png │ ├── cursor.png │ ├── font │ │ ├── default.cfg │ │ ├── default.ttf │ │ ├── default.txt │ │ ├── default0.png │ │ └── default_outline.cfg │ ├── hud │ │ ├── crosshair.png │ │ └── damage.png │ ├── icon │ │ ├── edit_envmap.png │ │ ├── edit_generic.png │ │ ├── edit_light.png │ │ ├── edit_mapmodel.png │ │ ├── edit_marker.png │ │ ├── edit_particles.png │ │ ├── edit_sound.png │ │ └── edit_spotlight.png │ ├── logo.png │ ├── logo_1024.png │ └── shadow.png ├── map │ └── test │ │ ├── entities.oct │ │ ├── map.ofm │ │ ├── media.cfg │ │ └── preview.png ├── model │ ├── box │ │ ├── obj.cfg │ │ ├── skin.jpg │ │ └── tris.obj │ ├── platform │ │ ├── obj.cfg │ │ ├── skin.jpg │ │ └── tris.obj │ └── player │ │ ├── animation.cfg │ │ ├── animation │ │ ├── backward.iqm │ │ ├── backward45_L.iqm │ │ ├── backward45_R.iqm │ │ ├── crouch.iqm │ │ ├── crouch_forward.iqm │ │ ├── forward.iqm │ │ ├── forward_45L.iqm │ │ ├── forward_45R.iqm │ │ ├── jump.iqm │ │ ├── jump_backward.iqm │ │ ├── jump_backward45L.iqm │ │ ├── jump_backward45R.iqm │ │ ├── jump_forward.iqm │ │ ├── jump_forward45L.iqm │ │ ├── jump_forward45R.iqm │ │ ├── jump_left.iqm │ │ ├── jump_right.iqm │ │ ├── rest.iqm │ │ ├── sideleft.iqm │ │ ├── sideright.iqm │ │ └── stand.iqm │ │ ├── diffuse.png │ │ ├── fullbody_ao.png │ │ ├── fullbody_nm.png │ │ ├── iqm.cfg │ │ ├── masks.png │ │ └── player.iqm ├── particle │ ├── ball1.png │ ├── ball2.png │ ├── ball3.png │ ├── base.png │ ├── blob.png │ ├── blood.png │ ├── bullet.png │ ├── explosion.png │ ├── flames.png │ ├── flare.png │ ├── glow.png │ ├── lensflares.png │ ├── license.txt │ ├── lightning.png │ ├── muzzleflash1.png │ ├── muzzleflash2.png │ ├── muzzleflash3.png │ ├── readme.txt │ ├── scorch.png │ ├── smoke.png │ ├── snow.png │ ├── spark.png │ └── steam.png ├── prefab │ └── empty.txt ├── scripts │ ├── apiutil.oct │ ├── core │ │ ├── capi.oct │ │ ├── engine │ │ │ ├── camera.oct │ │ │ ├── changes.oct │ │ │ ├── cubescript.oct │ │ │ ├── edit.oct │ │ │ ├── init.oct │ │ │ ├── input.oct │ │ │ ├── lights.oct │ │ │ ├── model.oct │ │ │ ├── particles.oct │ │ │ ├── sound.oct │ │ │ └── stains.oct │ │ ├── entities │ │ │ ├── ents.oct │ │ │ ├── ents_basic.oct │ │ │ ├── init.oct │ │ │ └── svars.oct │ │ ├── events │ │ │ ├── actions.oct │ │ │ ├── frame.oct │ │ │ ├── init.oct │ │ │ └── input.oct │ │ ├── externals.oct │ │ ├── gui │ │ │ ├── constants.oct │ │ │ ├── core.oct │ │ │ ├── core_buttons.oct │ │ │ ├── core_containers.oct │ │ │ ├── core_editors.oct │ │ │ ├── core_misc.oct │ │ │ ├── core_primitives.oct │ │ │ ├── core_scrollers.oct │ │ │ ├── core_sliders.oct │ │ │ ├── core_spacers.oct │ │ │ ├── default.oct │ │ │ └── init.oct │ │ ├── init.oct │ │ ├── logger.oct │ │ ├── network │ │ │ ├── init.oct │ │ │ └── msg.oct │ │ └── octascript │ │ │ ├── env.oct │ │ │ ├── geom.oct │ │ │ ├── init.oct │ │ │ ├── messagepack.oct │ │ │ └── stream.oct │ ├── extra │ │ ├── day_manager.oct │ │ ├── entities │ │ │ ├── lights.oct │ │ │ ├── particles.oct │ │ │ └── teleporters.oct │ │ ├── events │ │ │ ├── actions.oct │ │ │ └── timers.oct │ │ ├── game_manager.oct │ │ └── health.oct │ ├── games │ │ ├── drawing │ │ │ └── init.oct │ │ └── octacraft │ │ │ └── init.oct │ ├── gamescripts │ │ ├── drawing │ │ │ └── basic.oct │ │ └── octacraft │ │ │ └── basic.oct │ ├── lang │ │ ├── init.lua │ │ └── octascript │ │ │ ├── COPYING.txt │ │ │ ├── README.md │ │ │ ├── editors │ │ │ ├── geany │ │ │ │ ├── README.txt │ │ │ │ └── filetypes.Octascript.conf │ │ │ ├── jedit │ │ │ │ ├── README.txt │ │ │ │ └── octascript.xml │ │ │ ├── kate │ │ │ │ ├── README.txt │ │ │ │ └── octascript.xml │ │ │ ├── nano │ │ │ │ ├── README.txt │ │ │ │ └── octascript.nanorc │ │ │ └── vim │ │ │ │ ├── README.txt │ │ │ │ ├── ftdetect │ │ │ │ └── octascript.vim │ │ │ │ └── syntax │ │ │ │ └── octascript.vim │ │ │ ├── octascript │ │ │ ├── ast.lua │ │ │ ├── bytecode.lua │ │ │ ├── generator.lua │ │ │ ├── lexer.lua │ │ │ ├── parser.lua │ │ │ ├── rt │ │ │ │ └── init.lua │ │ │ ├── stdcore │ │ │ │ ├── init.lua │ │ │ │ └── native │ │ │ │ │ └── init.oct │ │ │ ├── stdlib │ │ │ │ └── std │ │ │ │ │ └── geom.oct │ │ │ └── util.lua │ │ │ ├── repl.oct │ │ │ ├── replutil.c │ │ │ ├── run.lua │ │ │ └── tools │ │ │ └── highlight │ │ │ └── oct.lang │ └── luastate.oct ├── sky │ └── empty.txt ├── sound │ ├── gk │ │ └── jump2.ogg │ ├── olpc │ │ └── AdamKeshen │ │ │ ├── BeatBoxCHIK.wav │ │ │ └── kik.wav │ └── yo_frankie │ │ ├── DeathFlash.wav │ │ ├── amb_waterdrip_2.wav │ │ └── watersplash2.wav └── texture │ ├── core │ ├── 1024.png │ ├── 1024i.png │ ├── 1024n.png │ ├── 128.png │ ├── 128i.png │ ├── 128n.png │ ├── 16.png │ ├── 16i.png │ ├── 16n.png │ ├── 2048.png │ ├── 2048i.png │ ├── 2048n.png │ ├── 256.png │ ├── 256i.png │ ├── 256n.png │ ├── 32.png │ ├── 32i.png │ ├── 32n.png │ ├── 512.png │ ├── 512i.png │ ├── 512n.png │ ├── 64.png │ ├── 64i.png │ ├── 64n.png │ ├── 8.png │ ├── 8i.png │ ├── 8n.png │ ├── core.tex │ ├── default.tex │ ├── defsky.png │ └── license.txt │ ├── default.png │ ├── material │ └── default │ │ ├── glass.mat │ │ ├── glass │ │ ├── cross-noise_normal.png │ │ ├── glass2_normal.png │ │ ├── glass_normal.png │ │ ├── noise_normal.png │ │ ├── subtle_normal.png │ │ └── vertical-noise_normal.png │ │ ├── lava.mat │ │ ├── lava │ │ └── lava.png │ │ ├── water.mat │ │ └── water │ │ ├── caustic │ │ ├── caust00.png │ │ ├── caust01.png │ │ ├── caust02.png │ │ ├── caust03.png │ │ ├── caust04.png │ │ ├── caust05.png │ │ ├── caust06.png │ │ ├── caust07.png │ │ ├── caust08.png │ │ ├── caust09.png │ │ ├── caust10.png │ │ ├── caust11.png │ │ ├── caust12.png │ │ ├── caust13.png │ │ ├── caust14.png │ │ ├── caust15.png │ │ ├── caust16.png │ │ ├── caust17.png │ │ ├── caust18.png │ │ ├── caust19.png │ │ ├── caust20.png │ │ ├── caust21.png │ │ ├── caust22.png │ │ ├── caust23.png │ │ ├── caust24.png │ │ ├── caust25.png │ │ ├── caust26.png │ │ ├── caust27.png │ │ ├── caust28.png │ │ ├── caust29.png │ │ ├── caust30.png │ │ └── caust31.png │ │ ├── water.png │ │ ├── water_normal.png │ │ ├── waterfall.png │ │ └── waterfall_normal.png │ ├── nobiax │ ├── pattern019.png │ ├── pattern019.tex │ ├── pattern019_n.png │ ├── pattern019_s.png │ ├── pattern037.png │ ├── pattern037.tex │ ├── pattern037_n.png │ ├── pattern037_s.png │ ├── pattern042.png │ ├── pattern042.tex │ ├── pattern042_n.png │ ├── pattern042_s.png │ ├── pattern044.png │ ├── pattern044.tex │ ├── pattern044_n.png │ ├── pattern044_s.png │ ├── pattern045.png │ ├── pattern045.tex │ ├── pattern045_n.png │ ├── pattern045_s.png │ ├── pattern047.png │ ├── pattern047.tex │ ├── pattern047_n.png │ ├── pattern047_s.png │ ├── pattern049.png │ ├── pattern049.tex │ ├── pattern049_n.png │ ├── pattern049_s.png │ ├── pattern055.png │ ├── pattern055.tex │ ├── pattern055_n.png │ ├── pattern055_s.png │ ├── pattern056.png │ ├── pattern056.tex │ ├── pattern056_n.png │ ├── pattern056_s.png │ ├── pattern057.png │ ├── pattern057.tex │ ├── pattern057_n.png │ ├── pattern057_s.png │ ├── pattern205.png │ ├── pattern205.tex │ ├── pattern205_n.png │ ├── pattern205_s.png │ ├── pattern208.png │ ├── pattern208.tex │ ├── pattern208_n.png │ └── pattern208_s.png │ └── notexture.png ├── octaforge.sh └── src ├── Makefile ├── enet ├── ChangeLog ├── LICENSE ├── README.txt ├── callbacks.c ├── check_cflags.sh ├── compress.c ├── host.c ├── include │ └── enet │ │ ├── callbacks.h │ │ ├── enet.h │ │ ├── list.h │ │ ├── protocol.h │ │ ├── time.h │ │ ├── types.h │ │ ├── unix.h │ │ ├── utility.h │ │ └── win32.h ├── list.c ├── packet.c ├── peer.c ├── protocol.c ├── unix.c └── win32.c ├── history.txt ├── octa ├── engine │ ├── aa.cc │ ├── animmodel.hh │ ├── bih.cc │ ├── bih.hh │ ├── blend.cc │ ├── client.cc │ ├── command.cc │ ├── console.cc │ ├── dynlight.cc │ ├── engine.hh │ ├── explosion.hh │ ├── grass.cc │ ├── hitzone.hh │ ├── iqm.hh │ ├── lensflare.hh │ ├── light.cc │ ├── light.hh │ ├── lightning.hh │ ├── main.cc │ ├── master.cc │ ├── material.cc │ ├── md3.hh │ ├── md5.hh │ ├── model.hh │ ├── movie.cc │ ├── mpr.hh │ ├── normal.cc │ ├── obj.hh │ ├── octa.cc │ ├── octa.hh │ ├── octaedit.cc │ ├── octarender.cc │ ├── physics.cc │ ├── pvs.cc │ ├── ragdoll.hh │ ├── rendergl.cc │ ├── renderlights.cc │ ├── rendermodel.cc │ ├── renderparticles.cc │ ├── rendersky.cc │ ├── rendertext.cc │ ├── renderva.cc │ ├── server.cc │ ├── serverbrowser.cc │ ├── shader.cc │ ├── skelmodel.hh │ ├── smd.hh │ ├── sound.cc │ ├── stain.cc │ ├── texture.cc │ ├── texture.hh │ ├── vertmodel.hh │ ├── water.cc │ ├── world.cc │ ├── world.hh │ └── worldio.cc ├── game │ ├── client.cc │ ├── entities.cc │ ├── game.cc │ ├── game.hh │ ├── render.cc │ └── server.cc ├── gui │ ├── core.cc │ ├── core.hh │ └── gui.hh ├── octaforge │ ├── of_logger.cc │ ├── of_logger.hh │ ├── of_lua.cc │ └── of_lua.hh └── shared │ ├── arch_detection.hh │ ├── command.hh │ ├── crypto.cc │ ├── crypto.hh │ ├── cube.hh │ ├── ents.hh │ ├── geom.cc │ ├── geom.hh │ ├── glemu.cc │ ├── glemu.hh │ ├── glexts.hh │ ├── iengine.hh │ ├── igame.hh │ ├── stream.cc │ ├── tessfont.c │ ├── tools.cc │ ├── tools.hh │ └── zip.cc ├── ostd ├── COPYING.md ├── README.md ├── ostd │ ├── algorithm.hh │ ├── argparse.hh │ ├── array.hh │ ├── atomic.hh │ ├── event.hh │ ├── filesystem.hh │ ├── format.hh │ ├── functional.hh │ ├── initializer_list.hh │ ├── internal │ │ ├── hashtable.hh │ │ └── tuple.hh │ ├── io.hh │ ├── keyset.hh │ ├── map.hh │ ├── maybe.hh │ ├── memory.hh │ ├── new.hh │ ├── platform.hh │ ├── range.hh │ ├── set.hh │ ├── stream.hh │ ├── string.hh │ ├── tuple.hh │ ├── type_traits.hh │ ├── types.hh │ ├── utility.hh │ ├── vecmath.hh │ └── vector.hh ├── run_tests.py ├── src │ └── new.cc └── tests │ ├── array.cc │ ├── utility.cc │ └── vector.cc ├── readme_sauerbraten.txt ├── readme_tesseract.txt ├── vcpp ├── broken │ ├── octaforge.sln │ ├── octaforge.vcxproj │ └── octaforge.vcxproj.filters ├── dpiaware.manifest ├── mingw.rc ├── octaforge.cbp ├── octaforge.ico └── octaforge.rc └── xcode ├── macutils.m ├── octaforge.icns ├── octaforge.plist └── octaforge.xcodeproj └── project.pbxproj /.gitignore: -------------------------------------------------------------------------------- 1 | .gitattributes 2 | *.o 3 | *.so 4 | *.dll 5 | *.a 6 | *.lib 7 | *.bak 8 | client_* 9 | server_* 10 | out 11 | *~ 12 | .directory 13 | .DS_Store 14 | *.orig 15 | src/build/ 16 | src/platform_windows/ 17 | bin_win*/LICENSE* 18 | *.core 19 | *.diff 20 | *.patch 21 | *.out 22 | xcuserdata/ 23 | octaforge.xcworkspace/ 24 | *.xcuserstate 25 | -------------------------------------------------------------------------------- /CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | People who have contributed content into OctaForge repository: 2 | 3 | * Daniel 'q66' Kolesa - most of the OF code 4 | * Lee 'eihrul' Salzman - tesseract + changes in the model system 5 | * fleeky - player model 6 | * David 'dkreuter' Kreuter - misc cleanups 7 | * Dale 'graphitemaster' Weiler - rewritten scaling system to avoid preprocessor macros 8 | * Ryan 'TheAncientGoat' Swart - base for the simple drawing game 9 | * Kurtis 'kurtk84' Kesler - entity icons and extra heightmapping brushes 10 | * Calinou - markdown conversions 11 | -------------------------------------------------------------------------------- /COPYING.md: -------------------------------------------------------------------------------- 1 | OctaForge as whole is licensed under the University of Illinois/NCSA Open Source 2 | License, a permissive, non-copyleft, BSD style license. The license text goes as 3 | follows: 4 | 5 | Copyright (c) 2011-2015 OctaForge developers. All rights reserved. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | this software and associated documentation files (the "Software"), to deal with 9 | the Software without restriction, including without limitation the rights to 10 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 11 | of the Software, and to permit persons to whom the Software is furnished to do 12 | so, subject to the following conditions: 13 | 14 | * Redistributions of source code must retain the above copyright notice, 15 | this list of conditions and the following disclaimers. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimers in the 19 | documentation and/or other materials provided with the distribution. 20 | 21 | * Neither the names of OctaForge developers nor any contributors may be 22 | used to endorse or promote products derived from this Software without 23 | specific prior written permission. 24 | 25 | **THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 27 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 | CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 30 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE 31 | SOFTWARE.** 32 | 33 | For OctaForge developers and contributors, refer to CONTRIBUTORS.txt. 34 | 35 | OctaForge contains portions of source code from other projects, including: 36 | 37 | * OctaScript - NCSA licensed, created by Daniel "q66" Kolesa 38 | * Tesseract - created by Lee 'eihrul' Salzman, see src/readme_tesseract.txt 39 | * Cube 2/Sauerbraten - see src/readme_sauerbraten.txt 40 | 41 | The engine is originally based on the Syntensity project by Alon "kripken" 42 | Zakai, but modern OctaForge no longer contains Syntensity code. 43 | 44 | Additionally, some code is taken from (or is inspired by) the Lamiae 45 | RPG engine by Kevin 'Hirato Kirata' Meyer, mostly in the UI part (zlib 46 | licensed). 47 | 48 | Special thanks to Lee "eihrul" Salzman for the help with the Cube 2/Tesseract 49 | codebase and moral support. 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | OctaForge 2 | ========= 3 | 4 | **THIS REPOSITORY IS ARCHIVED AND DEPRECATED.** 5 | **Development continues on https://git.octaforge.org.** 6 | 7 | For installation, read **INSTALL.md**. 8 | 9 | Running depends on the platform. 10 | 11 | On Unix-like systems (OS X only when compiled with the provided Makefile), run 12 | it using `bin_unix/client_YOUROS_YOURARCH` from either the root directory or 13 | `bin_unix`. 14 | 15 | On OS X, you can use the way above and you can also run it from within the 16 | Xcode project (development builds) or you can run the generated app bundle 17 | after deploying (the .dmg file also contains gamedata and is ready to ship). 18 | 19 | On Windows, execute `bin_winYOURARCH\client_win_YOURARCH.exe` either from 20 | the root directory or from the directory with the binary. 21 | 22 | Samee goes for server, just change "client" to "server". Using the -d2 option 23 | to client binary you can get the same dedicated server too (-d1 will start a 24 | listenserver). 25 | 26 | In case of problems, delete contents of your OF home directory 27 | (`$HOME/.octaforge` on Unix-like operating systems, 28 | `Documents\My Games\OctaForge` on Windows) 29 | 30 | The variable "game" influences what gamescript will be run. In local sessions 31 | it's used directly, but when connecting to a server is involved, the server 32 | will send the gamescript name to the client (on the server the same variable 33 | is used to specify it; modify server-init.cfg appropriately). 34 | 35 | Example: 36 | 37 | /game drawing.basic 38 | 39 | This results in media/scripts/gamescripts/drawing/basic.oct being run. 40 | 41 | There is just one map, "test", bundled by default. Use `/newmap` to create a 42 | new map, just like in Tesseract. 43 | 44 | If a problem persists, report it into our 45 | issue tracker: 46 | 47 | 48 | -------------------------------------------------------------------------------- /bin_unix/README.txt: -------------------------------------------------------------------------------- 1 | This directory contains binary executables of 2 | OctaForge for POSIX compatible operating systems. 3 | -------------------------------------------------------------------------------- /bin_win32/README.txt: -------------------------------------------------------------------------------- 1 | This directory contains binary executables of 2 | OctaForge for Windows (x86). If you don't have 3 | the required runtime DLLs in this directory, 4 | get them here: 5 | 6 | https://github.com/OctaForge/OF-Windows 7 | -------------------------------------------------------------------------------- /bin_win64/README.txt: -------------------------------------------------------------------------------- 1 | This directory contains binary executables of 2 | OctaForge for Windows (x64). If you don't have 3 | the required runtime DLLs in this directory, 4 | get them here: 5 | 6 | https://github.com/OctaForge/OF-Windows 7 | -------------------------------------------------------------------------------- /config/autoexec.cfg: -------------------------------------------------------------------------------- 1 | // 2 | -------------------------------------------------------------------------------- /config/blendbrush.cfg: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Texture-Blending Brush List // 3 | /////////////////////////////////////////////////////////////////////////////// 4 | 5 | looplist2 n p [ 6 | "Dot 1px Soft" dot_1_soft 7 | "Dot 1px Hard" dot_1_hard 8 | "Dot 1px Solid" dot_1_solid 9 | "Circle 8px Soft" circle_8_soft 10 | "Circle 8px Hard" circle_8_hard 11 | "Circle 8px Solid" circle_8_solid 12 | "Circle 16px Soft" circle_16_soft 13 | "Circle 16px Hard" circle_16_hard 14 | "Circle 16px Solid" circle_16_solid 15 | "Circle 32px Soft" circle_32_soft 16 | "Circle 32px Hard" circle_32_hard 17 | "Circle 32px Solid" circle_32_solid 18 | "Circle 64px Soft" circle_64_soft 19 | "Circle 64px Hard" circle_64_hard 20 | "Circle 64px Solid" circle_64_solid 21 | "Circle 128px Soft" circle_128_soft 22 | "Circle 128px Hard" circle_128_hard 23 | "Circle 128px Solid" circle_128_solid 24 | "Circle 256px Soft" circle_256_soft 25 | "Circle 256px Hard" circle_256_hard 26 | "Circle 256px Solid" circle_256_solid 27 | "Noise 64px Soft" noise_64_soft 28 | "Noise 64px Hard" noise_64_hard 29 | "Noise 128px Soft" noise_128_soft 30 | "Noise 128px Hard" noise_128_hard 31 | "Noise 256px Soft" noise_256_soft 32 | "Noise 256px Hard" noise_256_hard 33 | "Noise 512px Soft" noise_512_soft 34 | "Noise 512px Hard" noise_512_hard 35 | "Noise 1024px Soft" noise_1024_soft 36 | "Noise 1024px Hard" noise_1024_hard 37 | "Square 16px Hard" square_16_hard 38 | "Square 16px Solid" square_16_solid 39 | "Square 32px Hard" square_32_hard 40 | "Square 32px Solid" square_32_solid 41 | "Square 64px Hard" square_64_hard 42 | "Square 64px Solid" square_64_solid 43 | "Gradient 16px" gradient_16 44 | "Gradient 32px" gradient_32 45 | "Gradient 64px" gradient_64 46 | "Gradient 128px" gradient_128 47 | ] [addblendbrush $n (concatword "media/blendbrush/" $p ".png")] 48 | -------------------------------------------------------------------------------- /config/default_map_settings.cfg: -------------------------------------------------------------------------------- 1 | // default settings for maps 2 | // on every map load, this file will be executed, followed by mapscript. 3 | 4 | setdefaultenv = [ 5 | skybox "" 6 | atmo 1 7 | sunlightpitch 50 8 | sunlightyaw 30 9 | sunlight 0xFFF8E0 10 | skylight 0x7495B8 11 | 12 | texpackload core/default 13 | 14 | matpackload default/water 15 | matpackload default/lava 16 | matpackload default/glass 17 | ] 18 | 19 | if $emptymap [setdefaultenv] 20 | -------------------------------------------------------------------------------- /config/font.cfg: -------------------------------------------------------------------------------- 1 | loopfiles f "media/interface/font" cfg [ 2 | exec (concatword "media/interface/font/" $f ".cfg") 3 | ] -------------------------------------------------------------------------------- /config/glsl.cfg: -------------------------------------------------------------------------------- 1 | exec "config/glsl/shared.cfg" 2 | exec "config/glsl/misc.cfg" 3 | exec "config/glsl/hud.cfg" 4 | exec "config/glsl/world.cfg" 5 | exec "config/glsl/decal.cfg" 6 | exec "config/glsl/grass.cfg" 7 | exec "config/glsl/model.cfg" 8 | exec "config/glsl/ao.cfg" 9 | exec "config/glsl/gi.cfg" 10 | exec "config/glsl/particle.cfg" 11 | exec "config/glsl/stain.cfg" 12 | exec "config/glsl/material.cfg" 13 | exec "config/glsl/deferred.cfg" 14 | exec "config/glsl/tonemap.cfg" 15 | exec "config/glsl/volumetric.cfg" 16 | exec "config/glsl/sky.cfg" 17 | exec "config/glsl/aa.cfg" 18 | exec "config/glsl/scale.cfg" 19 | exec "config/glsl/blur.cfg" 20 | exec "config/glsl/ui.cfg" 21 | exec "config/glsl/postfx.cfg" 22 | exec "config/glsl/edit.cfg" 23 | exec "config/glsl/movie.cfg" 24 | 25 | -------------------------------------------------------------------------------- /config/glsl/aa.cfg: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////// 2 | // 3 | // anti-aliasing 4 | // 5 | //////////////////////////////////////////////// 6 | 7 | lazyshader 0 "tqaaresolve" [ 8 | attribute vec4 vvertex; 9 | @(screentexcoord 0) 10 | uniform vec4 quincunx; 11 | varying vec2 texcoord0, texcoord1, texcoord2; 12 | @(? $tqaaresolvegather [ 13 | varying vec2 texcoord3; 14 | ]) 15 | void main(void) 16 | { 17 | gl_Position = vvertex; 18 | texcoord0 = vtexcoord0; 19 | texcoord1 = vtexcoord0 + quincunx.xy; 20 | texcoord2 = vtexcoord0 + quincunx.zw; 21 | @(? $tqaaresolvegather [ 22 | texcoord3 = vtexcoord0 - 0.5; 23 | ]) 24 | } 25 | ] [ 26 | @(gfetchdefs tex2) 27 | uniform sampler2DRect tex0, tex1; 28 | uniform mat4 reprojectmatrix; 29 | uniform vec2 maxvelocity; 30 | uniform vec2 colorweight; 31 | varying vec2 texcoord0, texcoord1, texcoord2; 32 | @(? $tqaaresolvegather [ 33 | varying vec2 texcoord3; 34 | ]) 35 | fragdata(0, fragcolor, vec4) 36 | void main(void) 37 | { 38 | @(gdepthunpack depth [gfetch(tex2, texcoord0)] [ 39 | vec4 prevtc = reprojectmatrix * vec4(depth*texcoord0, depth, 1.0); 40 | ] [ 41 | vec4 prevtc = reprojectmatrix * vec4(texcoord0, depth, 1.0); 42 | ]) 43 | 44 | vec2 vel = prevtc.xy/prevtc.w - texcoord0; 45 | float scale = clamp(maxvelocity.x*inversesqrt(dot(vel, vel) + 1e-6), 0.0, 1.0); 46 | 47 | vec4 color = texture2DRect(tex0, texcoord1); 48 | float mask = (1.0 - color.a) * scale; 49 | vec4 prevcolor = texture2DRect(tex1, texcoord2 + vel*mask); 50 | 51 | @(? $tqaaresolvegather [ 52 | vec4 l0 = textureGather(tex0, texcoord3, 1); 53 | vec4 l1 = textureGatherOffset(tex0, texcoord3, ivec2(1, 1), 1); 54 | float l2 = texture2DRectOffset(tex0, texcoord0, ivec2(1, -1)).g; 55 | float l3 = texture2DRectOffset(tex0, texcoord0, ivec2(-1, 1)).g; 56 | vec4 l01min = min(l0, l1), l01max = max(l0, l1); 57 | l01min.xy = min(l01min.xy, l01min.zw); 58 | l01max.xy = max(l01max.xy, l01max.zw); 59 | float lmin = min(min(l01min.x, l01min.y), min(l2, l3)); 60 | float lmax = max(max(l01max.x, l01max.y), max(l2, l3)); 61 | ] [ 62 | float l0 = texture2DRect(tex0, texcoord0 + vec2(-1.0, -0.5)).g; 63 | float l1 = texture2DRect(tex0, texcoord0 + vec2( 0.5, -1.0)).g; 64 | float l2 = texture2DRect(tex0, texcoord0 + vec2( 1.0, 0.5)).g; 65 | float l3 = texture2DRect(tex0, texcoord0 + vec2(-0.5, 1.0)).g; 66 | float lmin = min(color.g, min(min(l0, l1), min(l2, l3))); 67 | float lmax = max(color.g, max(max(l0, l1), max(l2, l3))); 68 | ]) 69 | 70 | float weight = 0.5 - 0.5*clamp((colorweight.x*max(prevcolor.g - lmax, lmin - prevcolor.g) + colorweight.y) / (lmax - lmin + 1e-4), 0.0, 1.0); 71 | weight *= clamp(1.0 - 2.0*(prevcolor.a - color.a), 0.0, 1.0); 72 | fragcolor.rgb = mix(color.rgb, prevcolor.rgb, weight); 73 | fragcolor.a = color.a; 74 | } 75 | ] 76 | 77 | smaaopt = [ >= (strstr $smaaopts $arg1) 0 ] 78 | smaashaders = [ 79 | smaapreset = $arg1 80 | smaaopts = $arg2 81 | exec "config/glsl/smaa.cfg" 82 | ] 83 | 84 | fxaaopt = [ >= (strstr $fxaaopts $arg1) 0 ] 85 | fxaashaders = [ 86 | fxaapreset = $arg1 87 | fxaaopts = $arg2 88 | exec "config/glsl/fxaa.cfg" 89 | ] 90 | 91 | -------------------------------------------------------------------------------- /config/glsl/blur.cfg: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////// 2 | // 3 | // separable blur with up to 7 taps 4 | // 5 | //////////////////////////////////////////////// 6 | 7 | blurshader = [ 8 | shader 0 $arg1 [ 9 | attribute vec4 vvertex; 10 | @(screentexcoord 0) 11 | uniform float offsets[8]; 12 | varying vec2 texcoord0, texcoordp1, texcoordn1; 13 | @(loopconcat+ i 2 (min (- $arg2 1) 2) [result [ 14 | varying vec2 texcoordp@i, texcoordn@i; 15 | ]]) 16 | void main(void) 17 | { 18 | gl_Position = vvertex; 19 | texcoord0 = vtexcoord0; 20 | vec2 tcp = vtexcoord0, tcn = vtexcoord0; 21 | tcp.@arg3 += offsets[1]; 22 | tcn.@arg3 -= offsets[1]; 23 | texcoordp1 = tcp; 24 | texcoordn1 = tcn; 25 | @(loopconcat+ i 2 (min (- $arg2 1) 2) [result [ 26 | tcp.@arg3 = vtexcoord0.@arg3 + offsets[@@i]; 27 | tcn.@arg3 = vtexcoord0.@arg3 - offsets[@@i]; 28 | texcoordp@i = tcp; 29 | texcoordn@i = tcn; 30 | ]]) 31 | } 32 | ] [ 33 | uniform float weights[8]; 34 | uniform float offsets[8]; 35 | uniform sampler@[arg4] tex0; 36 | varying vec2 texcoord0, texcoordp1, texcoordn1; 37 | @(loopconcat+ i 2 (min (- $arg2 1) 2) [result [ 38 | varying vec2 texcoordp@i, texcoordn@i; 39 | ]]) 40 | fragdata(0, fragcolor, vec4) 41 | void main(void) 42 | { 43 | #define texval(coords) texture@[arg4](tex0, (coords)) 44 | vec4 val = texval(texcoord0) * weights[0]; 45 | @(loopconcat+ i 1 $arg2 [ 46 | if (< $i 4) [result [ 47 | val += weights[@@i] * (texval(texcoordp@i) + texval(texcoordn@i)); 48 | ]] [result [ 49 | val += weights[@@i] * 50 | @(if (=s $arg3 "x") [result [ 51 | (texval(vec2(texcoord0.x + offsets[@@i], texcoord0.y)) + texval(vec2(texcoord0.x - offsets[@@i], texcoord0.y))); 52 | ]] [result [ 53 | (texval(vec2(texcoord0.x, texcoord0.y + offsets[@@i])) + texval(vec2(texcoord0.x, texcoord0.y - offsets[@@i]))); 54 | ]]) 55 | ]] 56 | ]) 57 | fragcolor = val; 58 | } 59 | ] 60 | ] 61 | 62 | loop+ i 1 7 [ 63 | blurshader (format "blurx%1" $i) $i x 2D 64 | blurshader (format "blury%1" $i) $i y 2D 65 | blurshader (format "blurx%1rect" $i) $i x 2DRect 66 | blurshader (format "blury%1rect" $i) $i y 2DRect 67 | ] 68 | 69 | -------------------------------------------------------------------------------- /config/glsl/edit.cfg: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////// 2 | // 3 | // miscellaneous edit shaders 4 | // 5 | //////////////////////////////////////////////// 6 | 7 | shader 0 "blendbrush" [ 8 | attribute vec4 vvertex, vcolor; 9 | uniform mat4 camprojmatrix; 10 | uniform vec4 texgenS, texgenT; 11 | uniform float ldrscale; 12 | varying vec4 color; 13 | varying vec2 texcoord0; 14 | void main(void) 15 | { 16 | gl_Position = camprojmatrix * vvertex; 17 | color = vec4(ldrscale * vcolor.rgb, vcolor.a); 18 | texcoord0 = vec2(dot(texgenS, vvertex), dot(texgenT, vvertex)); 19 | } 20 | ] [ 21 | uniform sampler2D tex0; 22 | varying vec4 color; 23 | varying vec2 texcoord0; 24 | fragdata(0, fragcolor, vec4) 25 | void main(void) 26 | { 27 | fragcolor = texture2D(tex0, texcoord0).r * color; 28 | } 29 | ] 30 | 31 | lazyshader 0 "prefab" [ 32 | attribute vec4 vvertex, vcolor; 33 | attribute vec3 vnormal; 34 | uniform mat4 prefabmatrix; 35 | uniform mat3 prefabworld; 36 | varying vec3 nvec; 37 | varying vec4 color; 38 | @(msaainterpvert) 39 | 40 | void main(void) 41 | { 42 | gl_Position = prefabmatrix * vvertex; 43 | color = vcolor; 44 | nvec = prefabworld * vnormal; 45 | @(msaapackvert) 46 | } 47 | ] [ 48 | varying vec3 nvec; 49 | varying vec4 color; 50 | @(msaainterpfrag) 51 | 52 | void main(void) 53 | { 54 | gcolor.rgb = color.rgb; 55 | gcolor.a = 0.0; 56 | vec3 normal = normalize(nvec); 57 | @(gnormpackdef normal packnorm) 58 | @(msaapackfrag) 59 | } 60 | ] 61 | 62 | -------------------------------------------------------------------------------- /config/glsl/grass.cfg: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////// 2 | // 3 | // grass shaders 4 | // 5 | //////////////////////////////////////////////// 6 | 7 | // grasstype: 8 | // b -> blendmap 9 | 10 | grassopt = [ >= (strstr $grasstype $arg1) 0 ] 11 | 12 | grassvariantshader = [ 13 | local grasstype 14 | grasstype = $arg2 15 | variantshader 0 $arg1 (? (grassopt "b") 0 -1) [ 16 | attribute vec4 vvertex, vcolor; 17 | attribute vec2 vtexcoord0; 18 | uniform mat4 camprojmatrix; 19 | @(ginterpvert) 20 | varying vec2 texcoord0; 21 | varying vec4 colorscale; 22 | @(? (grassopt "b") [uniform vec4 blendmapparams; varying vec2 texcoord1;]) 23 | void main(void) 24 | { 25 | gl_Position = camprojmatrix * vvertex; 26 | colorscale = vcolor; 27 | texcoord0 = vtexcoord0; 28 | @(? (grassopt "b") [ 29 | texcoord1 = (vvertex.xy - blendmapparams.xy)*blendmapparams.zw; 30 | ]) 31 | @(gdepthpackvert) 32 | } 33 | ] [ 34 | uniform sampler2D tex0; 35 | uniform float grasstest; 36 | @(ginterpfrag) 37 | varying vec2 texcoord0; 38 | varying vec4 colorscale; 39 | @(? (grassopt "b") [uniform sampler2D tex1; varying vec2 texcoord1;]) 40 | void main(void) 41 | { 42 | vec4 color = texture2D(tex0, texcoord0) * colorscale; 43 | @(? (grassopt "b") [ 44 | color.a *= texture2D(tex1, texcoord1).r; 45 | ]) 46 | if(color.a <= grasstest) 47 | discard; 48 | gcolor = vec4(color.rgb, 0.0); 49 | @(gnormpack [vec3(0.5, 0.5, 1.0)]) 50 | @(gdepthpackfrag) 51 | } 52 | ] 53 | ] 54 | 55 | grassshader = [ 56 | shadername = (concatword "grass" $arg1) 57 | grassvariantshader $shadername $arg1 58 | grassvariantshader $shadername (concatword $arg1 "b") 59 | ] 60 | 61 | -------------------------------------------------------------------------------- /config/glsl/scale.cfg: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////// 2 | // 3 | // upscaling shaders 4 | // 5 | ////////////////////////////////////////////////////////////////////// 6 | 7 | shader 0 "scalelinear" [ 8 | attribute vec4 vvertex; 9 | @(screentexcoord 0) 10 | varying vec2 texcoord0; 11 | 12 | void main(void) 13 | { 14 | gl_Position = vvertex; 15 | texcoord0 = vtexcoord0; 16 | } 17 | ] [ 18 | uniform sampler2DRect tex0; 19 | varying vec2 texcoord0; 20 | fragdata(0, fragcolor, vec4) 21 | 22 | void main(void) 23 | { 24 | fragcolor = texture2DRect(tex0, texcoord0); 25 | } 26 | ] 27 | 28 | loop i 2 [ 29 | lazyshader 0 (? $i "scalecubicy" "scalecubicx") [ 30 | attribute vec4 vvertex; 31 | @(screentexcoord 0) 32 | varying vec2 texcoord0; 33 | 34 | void main(void) 35 | { 36 | gl_Position = vvertex; 37 | texcoord0 = vtexcoord0; 38 | } 39 | ] [ 40 | uniform sampler2DRect tex0; 41 | varying vec2 texcoord0; 42 | fragdata(0, fragcolor, vec4) 43 | 44 | vec4 cubic(float s) 45 | { 46 | const float B = @gscalecubicsoft, C = @(divf (-f 1 $gscalecubicsoft) 2); 47 | float s2 = s*s, s3 = s2*s; 48 | return vec4((-1.0/6.0*B - C) * s3 + (0.5*B + 2.0*C) * s2 + (-0.5*B - C) * s + 1.0/6.0*B, 49 | (2.0 - 1.5*B - C) * s3 + (-3.0 + 2.0*B + C) * s2 + (1.0 - 1.0/3.0*B), 50 | (-2.0 + 1.5*B + C) * s3 + (3.0 - 2.5*B - 2.0*C) * s2 + (0.5*B + C)*s + 1.0/6.0*B, 51 | (1.0/6.0*B + C) * s3 - C * s2); 52 | } 53 | 54 | void main(void) 55 | { 56 | vec2 center = texcoord0; 57 | @(if $i [result [ 58 | float offset = fract(texcoord0.y-0.5); 59 | center.y -= offset; 60 | #define texval(tap) texture2DRect(tex0, center + vec2(0.0, tap)) 61 | #define texvaloffset(tap) texture2DRectOffset(tex0, center, ivec2(0, tap)) 62 | ]] [result [ 63 | float offset = fract(texcoord0.x-0.5); 64 | center.x -= offset; 65 | #define texval(tap) texture2DRect(tex0, center + vec2(tap, 0.0)) 66 | #define texvaloffset(tap) texture2DRectOffset(tex0, center, ivec2(tap, 0)) 67 | ]]) 68 | vec4 weight = cubic(offset); 69 | weight.y += weight.z; 70 | weight.z /= weight.y; 71 | fragcolor = weight.x*texvaloffset(-1) + weight.y*texval(weight.z) + weight.w*texvaloffset(2); 72 | } 73 | ] 74 | ] 75 | 76 | shader 0 "reorient" [ 77 | attribute vec4 vvertex; 78 | uniform vec3 reorientx, reorienty; 79 | varying vec2 texcoord0; 80 | 81 | void main(void) 82 | { 83 | gl_Position = vvertex; 84 | texcoord0.x = dot(vvertex.xy, reorientx.xy) + reorientx.z; 85 | texcoord0.y = dot(vvertex.xy, reorienty.xy) + reorienty.z; 86 | } 87 | ] [ 88 | uniform sampler2DRect tex0; 89 | varying vec2 texcoord0; 90 | fragdata(0, fragcolor, vec4) 91 | 92 | void main(void) 93 | { 94 | fragcolor = texture2DRect(tex0, texcoord0); 95 | } 96 | ] 97 | 98 | 99 | -------------------------------------------------------------------------------- /config/glsl/stain.cfg: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////// 2 | // 3 | // stain shaders 4 | // 5 | //////////////////////////////////////////////// 6 | 7 | // staintype: 8 | // o -> overbright 9 | // t -> transparent 10 | // f -> fogged 11 | 12 | stainopt = [ >= (strstr $staintype $arg1) 0 ] 13 | 14 | stainvariantshader = [ 15 | local staintype 16 | staintype = $arg2 17 | variantshader 0 $arg1 (? (stainopt "t") 1 -1) (if (! (stainopt "t")) [result [ 18 | @(? (stainopt "f") [ 19 | #pragma CUBE2_fog 20 | ]) 21 | attribute vec4 vvertex, vcolor; 22 | attribute vec2 vtexcoord0; 23 | uniform mat4 camprojmatrix; 24 | uniform vec4 colorscale; 25 | varying vec4 color; 26 | varying vec2 texcoord0; 27 | void main(void) 28 | { 29 | gl_Position = camprojmatrix * vvertex; 30 | color = vcolor * colorscale; 31 | texcoord0 = vtexcoord0; 32 | } 33 | ]]) [ 34 | uniform sampler2D tex0; 35 | varying vec4 color; 36 | varying vec2 texcoord0; 37 | fragdata(0, fragcolor, vec4) 38 | @(? (stainopt "t") [ 39 | fragdata(1, gglow, vec4) 40 | ]) 41 | void main(void) 42 | { 43 | vec4 diffuse = texture2D(tex0, texcoord0); 44 | #pragma CUBE2_swizzle diffuse 45 | @(if (stainopt "o") [result [ 46 | diffuse.rgb = mix(vec3(0.5), diffuse.rgb, color.rgb); 47 | fragcolor.rgb = diffuse.rgb; 48 | fragcolor.a = 0.5; 49 | @(? (stainopt "t") [ 50 | gglow.rgb = diffuse.rgb; 51 | gglow.a = 0.5; 52 | ]) 53 | ]] [result [ 54 | diffuse *= color; 55 | fragcolor = diffuse; 56 | @(? (stainopt "t") [ 57 | gglow.rgb = vec3(0.0); 58 | gglow.a = diffuse.a; 59 | ]) 60 | ]]) 61 | } 62 | ] 63 | ] 64 | 65 | stainshader = [ 66 | staintype = $arg2 67 | stainvariantshader $arg1 $arg2 68 | if (! (stainopt "f")) [ 69 | stainvariantshader $arg1 (concatword $arg2 "t") 70 | ] 71 | ] 72 | 73 | stainshader "stain" "" 74 | stainshader "overbrightstain" "o" 75 | stainshader "foggedstain" "f" 76 | 77 | -------------------------------------------------------------------------------- /config/glsl/ui.cfg: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////// 2 | // 3 | // UI shaders 4 | // 5 | //////////////////////////////////////////////// 6 | 7 | lazyshader 0 "modelpreview" [ 8 | attribute vec4 vvertex; 9 | attribute vec2 vtexcoord0; 10 | varying vec2 texcoord0; 11 | 12 | void main(void) 13 | { 14 | gl_Position = vvertex; 15 | texcoord0 = vtexcoord0; 16 | } 17 | ] [ 18 | @(gfetchdefs [tex0 tex1 tex3]) 19 | uniform vec3 camera; 20 | uniform mat4 worldmatrix; 21 | uniform vec4 lightscale; 22 | uniform vec3 sunlightdir; 23 | uniform vec3 sunlightcolor; 24 | uniform float cutout; 25 | varying vec2 texcoord0; 26 | fragdata(0, fragcolor, vec4) 27 | 28 | void main(void) 29 | { 30 | vec4 normal = gfetch(tex1, texcoord0); 31 | if(normal.x + normal.y == cutout) discard; 32 | 33 | normal.xyz = normal.xyz*2.0 - 1.0; 34 | @(if $usepacknorm [result [ 35 | float glowscale = dot(normal.xyz, normal.xyz); 36 | normal.xyz *= inversesqrt(glowscale); 37 | @(unpacknorm glowscale) 38 | ]] [result [ 39 | #define glowscale normal.a 40 | ]]) 41 | 42 | vec4 diffuse = gfetch(tex0, texcoord0); 43 | vec3 glow = diffuse.rgb * (1.0 - glowscale); 44 | diffuse.rgb *= glowscale; 45 | 46 | vec3 light = diffuse.rgb * lightscale.rgb; 47 | light += glow.rgb * lightscale.a; 48 | 49 | float sunfacing = dot(sunlightdir, normal.xyz); 50 | if(sunfacing > 0.0) 51 | { 52 | @(gdepthunpack depth [gfetch(tex3, texcoord0)] [ 53 | vec3 pos = (worldmatrix * vec4(depth*texcoord0, depth, 1.0)).xyz; 54 | ] [ 55 | vec4 pos = worldmatrix * vec4(texcoord0, depth, 1.0); 56 | pos.xyz /= pos.w; 57 | ]) 58 | @(unpackspec) 59 | float sunspec = pow(clamp(sunfacing*facing - dot(camdir, sunlightdir), 0.0, 1.0), gloss) * specscale; 60 | light += (diffuse.rgb*sunfacing + sunspec) * sunlightcolor; 61 | } 62 | 63 | fragcolor.rgb = light; 64 | fragcolor.a = 1.0; 65 | } 66 | ] 67 | 68 | 69 | -------------------------------------------------------------------------------- /config/keymap.cfg: -------------------------------------------------------------------------------- 1 | // do not modify, use "bind" in autoexec.cfg instead 2 | 3 | keymap -1 MOUSELEFT 4 | keymap -2 MOUSEMIDDLE 5 | keymap -3 MOUSERIGHT 6 | keymap -4 MOUSEWHEELUP 7 | keymap -5 MOUSEWHEELDOWN 8 | keymap -6 MOUSEBACK 9 | keymap -7 MOUSEFORWARD 10 | keymap 8 BACKSPACE 11 | keymap 9 TAB 12 | keymap 13 RETURN 13 | keymap 27 ESCAPE 14 | keymap 32 SPACE 15 | keymap 33 EXCLAIM 16 | keymap 34 QUOTEDBL 17 | keymap 35 HASH 18 | keymap 36 DOLLAR 19 | keymap 38 AMPERSAND 20 | keymap 39 QUOTE 21 | keymap 40 LEFTPAREN 22 | keymap 41 RIGHTPAREN 23 | keymap 42 ASTERISK 24 | keymap 43 PLUS 25 | keymap 44 COMMA 26 | keymap 45 MINUS 27 | keymap 46 PERIOD 28 | keymap 47 SLASH 29 | keymap 48 0 30 | keymap 49 1 31 | keymap 50 2 32 | keymap 51 3 33 | keymap 52 4 34 | keymap 53 5 35 | keymap 54 6 36 | keymap 55 7 37 | keymap 56 8 38 | keymap 57 9 39 | keymap 58 COLON 40 | keymap 59 SEMICOLON 41 | keymap 60 LESS 42 | keymap 61 EQUALS 43 | keymap 62 GREATER 44 | keymap 63 QUESTION 45 | keymap 64 AT 46 | keymap 91 LEFTBRACKET 47 | keymap 92 BACKSLASH 48 | keymap 93 RIGHTBRACKET 49 | keymap 94 CARET 50 | keymap 95 UNDERSCORE 51 | keymap 96 BACKQUOTE 52 | keymap 97 A 53 | keymap 98 B 54 | keymap 99 C 55 | keymap 100 D 56 | keymap 101 E 57 | keymap 102 F 58 | keymap 103 G 59 | keymap 104 H 60 | keymap 105 I 61 | keymap 106 J 62 | keymap 107 K 63 | keymap 108 L 64 | keymap 109 M 65 | keymap 110 N 66 | keymap 111 O 67 | keymap 112 P 68 | keymap 113 Q 69 | keymap 114 R 70 | keymap 115 S 71 | keymap 116 T 72 | keymap 117 U 73 | keymap 118 V 74 | keymap 119 W 75 | keymap 120 X 76 | keymap 121 Y 77 | keymap 122 Z 78 | keymap 127 DELETE 79 | keymap 0x40000059 KP1 80 | keymap 0x4000005a KP2 81 | keymap 0x4000005b KP3 82 | keymap 0x4000005c KP4 83 | keymap 0x4000005d KP5 84 | keymap 0x4000005e KP6 85 | keymap 0x4000005f KP7 86 | keymap 0x40000060 KP8 87 | keymap 0x40000061 KP9 88 | keymap 0x40000062 KP0 89 | keymap 0x40000063 KP_PERIOD 90 | keymap 0x40000054 KP_DIVIDE 91 | keymap 0x40000055 KP_MULTIPLY 92 | keymap 0x40000056 KP_MINUS 93 | keymap 0x40000057 KP_PLUS 94 | keymap 0x40000058 KP_ENTER 95 | keymap 0x40000067 KP_EQUALS 96 | keymap 0x40000052 UP 97 | keymap 0x40000051 DOWN 98 | keymap 0x4000004f RIGHT 99 | keymap 0x40000050 LEFT 100 | keymap 0x40000048 PAUSE 101 | keymap 0x40000049 INSERT 102 | keymap 0x4000004a HOME 103 | keymap 0x4000004d END 104 | keymap 0x4000004b PAGEUP 105 | keymap 0x4000004e PAGEDOWN 106 | keymap 0x4000003a F1 107 | keymap 0x4000003b F2 108 | keymap 0x4000003c F3 109 | keymap 0x4000003d F4 110 | keymap 0x4000003e F5 111 | keymap 0x4000003f F6 112 | keymap 0x40000040 F7 113 | keymap 0x40000041 F8 114 | keymap 0x40000042 F9 115 | keymap 0x40000043 F10 116 | keymap 0x40000044 F11 117 | keymap 0x40000045 F12 118 | keymap 0x40000053 NUMLOCK 119 | keymap 0x40000039 CAPSLOCK 120 | keymap 0x40000047 SCROLLOCK 121 | keymap 0x400000e5 RSHIFT 122 | keymap 0x400000e1 LSHIFT 123 | keymap 0x400000e4 RCTRL 124 | keymap 0x400000e0 LCTRL 125 | keymap 0x400000e6 RALT 126 | keymap 0x400000e2 LALT 127 | keymap 0x400000e7 RMETA 128 | keymap 0x400000e3 LMETA 129 | keymap 0x40000065 COMPOSE 130 | keymap 0x40000075 HELP 131 | keymap 0x40000046 PRINT 132 | keymap 0x4000009a SYSREQ 133 | keymap 0x40000076 MENU 134 | -------------------------------------------------------------------------------- /config/server-init.cfg: -------------------------------------------------------------------------------- 1 | if (! $game) [ 2 | game drawing.basic 3 | ] 4 | 5 | maprotation "*" "test" 6 | -------------------------------------------------------------------------------- /config/stdlib.cfg: -------------------------------------------------------------------------------- 1 | // Console language standard library 2 | 3 | // Binds a key so that it will toggle a variable 4 | bindvar = [bind $arg1 [@arg2 (= $@arg2 0); if (= $@arg2 0) [echo @@arg2 OFF] [echo @@arg2 ON]]] 5 | bindvarquiet = [bind $arg1 [@arg2 (= $@arg2 0)]] 6 | editbindvar = [editbind $arg1 [@arg2 (= $@arg2 0); if (= $@arg2 0) [echo @@arg2 OFF] [echo @@arg2 ON]]] 7 | editbindvarquiet = [editbind $arg1 [@arg2 (= $@arg2 0)]] 8 | 9 | // Binds a key so that it will set a modifier while held down 10 | bindmod = [bind $arg1 [@arg2 1; onrelease [@@arg2 0]]] 11 | editbindmod = [editbind $arg1 [@arg2 1; onrelease [@@arg2 0]]] 12 | 13 | quine = [echo (format "quine = [%1]" $quine)] 14 | 15 | // Returns given RGB color as an INT color 16 | // usage: (rgbtoint R G B) 17 | rgbtoint = [+ (<< $arg1 16) (<< $arg2 8) $arg3] 18 | 19 | // Returns given RGB color as a HEX color 20 | // usage: (rgbtohex R G B) 21 | rgbtohex = [tohex (rgbtoint $arg1 $arg2 $arg3) 6] 22 | 23 | // Returns given INT color as an RGB color 24 | // usage: (inttorgb R-var G-var B-var) 25 | inttorgb = [ 26 | $arg2 = (& (>> $arg1 16) 0xFF) 27 | $arg3 = (& (>> $arg1 8) 0xFF) 28 | $arg4 = (& $arg1 0xFF) 29 | ] 30 | 31 | -------------------------------------------------------------------------------- /config/ui.cfg: -------------------------------------------------------------------------------- 1 | // cubescript-side ui stuff (convenience functions) 2 | 3 | edithudline1 = [edithud] 4 | edithudline2 = [format "cube %1%2" $selchildcount (if $showmat [selchildmat ": "])] 5 | edithudline3 = [format "wtr:%1k(%2%%) wvt:%3k(%4%%) evt:%5k eva:%6k" $editstatwtr $editstatvtr $editstatwvt $editstatvvt $editstatevt $editstateva] 6 | edithudline4 = [format "ond:%1 va:%2 gl:%3(%4) oq:%5 pvs:%6" $editstatocta $editstatva $editstatglde $editstatgeombatch $editstatoq $editstatpvs] 7 | getedithud = [ concatword (edithudline1) "^f7^n" (edithudline2) "^n" (edithudline3) "^n" (edithudline4) ] 8 | 9 | showui = [lua [ 10 | import core.gui.core as gui 11 | return gui::get_root().show_window(@(escape $arg1)) 12 | ]] 13 | hideui = [lua [ 14 | import core.gui.core as gui 15 | return gui::get_root().hide_window(@(escape $arg1)) 16 | ]] 17 | hidetopmostui = [lua [ 18 | import core.gui.core as gui 19 | return gui::get_root().hide_window(true) 20 | ]] 21 | toggleui = [ 22 | if (! (hideui $arg1)) [showui $arg1] [] 23 | ] 24 | holdui = [ 25 | if (! $arg2) [hideui $arg1] [showui $arg1] 26 | ] 27 | uivisible = [lua [ 28 | import core.gui.core as gui 29 | return gui::get_root().window_visible(@(escape $arg1)) 30 | ]] 31 | 32 | toggleconsole = [toggleui fullconsole] 33 | 34 | edittoggled = [ 35 | if $editing [ 36 | showui editstats 37 | showui varicons 38 | ] [ 39 | hideui editstats 40 | hideui varicons 41 | ] 42 | ] 43 | 44 | bind ESCAPE [if (! (hidetopmostui)) [toggleui main]] -------------------------------------------------------------------------------- /media/blendbrush/circle_128_hard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/circle_128_hard.png -------------------------------------------------------------------------------- /media/blendbrush/circle_128_soft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/circle_128_soft.png -------------------------------------------------------------------------------- /media/blendbrush/circle_128_solid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/circle_128_solid.png -------------------------------------------------------------------------------- /media/blendbrush/circle_16_hard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/circle_16_hard.png -------------------------------------------------------------------------------- /media/blendbrush/circle_16_soft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/circle_16_soft.png -------------------------------------------------------------------------------- /media/blendbrush/circle_16_solid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/circle_16_solid.png -------------------------------------------------------------------------------- /media/blendbrush/circle_256_hard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/circle_256_hard.png -------------------------------------------------------------------------------- /media/blendbrush/circle_256_soft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/circle_256_soft.png -------------------------------------------------------------------------------- /media/blendbrush/circle_256_solid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/circle_256_solid.png -------------------------------------------------------------------------------- /media/blendbrush/circle_32_hard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/circle_32_hard.png -------------------------------------------------------------------------------- /media/blendbrush/circle_32_soft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/circle_32_soft.png -------------------------------------------------------------------------------- /media/blendbrush/circle_32_solid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/circle_32_solid.png -------------------------------------------------------------------------------- /media/blendbrush/circle_64_hard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/circle_64_hard.png -------------------------------------------------------------------------------- /media/blendbrush/circle_64_soft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/circle_64_soft.png -------------------------------------------------------------------------------- /media/blendbrush/circle_64_solid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/circle_64_solid.png -------------------------------------------------------------------------------- /media/blendbrush/circle_8_hard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/circle_8_hard.png -------------------------------------------------------------------------------- /media/blendbrush/circle_8_soft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/circle_8_soft.png -------------------------------------------------------------------------------- /media/blendbrush/circle_8_solid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/circle_8_solid.png -------------------------------------------------------------------------------- /media/blendbrush/dot_1_hard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/dot_1_hard.png -------------------------------------------------------------------------------- /media/blendbrush/dot_1_soft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/dot_1_soft.png -------------------------------------------------------------------------------- /media/blendbrush/dot_1_solid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/dot_1_solid.png -------------------------------------------------------------------------------- /media/blendbrush/gradient_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/gradient_128.png -------------------------------------------------------------------------------- /media/blendbrush/gradient_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/gradient_16.png -------------------------------------------------------------------------------- /media/blendbrush/gradient_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/gradient_32.png -------------------------------------------------------------------------------- /media/blendbrush/gradient_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/gradient_64.png -------------------------------------------------------------------------------- /media/blendbrush/noise_1024_hard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/noise_1024_hard.png -------------------------------------------------------------------------------- /media/blendbrush/noise_1024_soft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/noise_1024_soft.png -------------------------------------------------------------------------------- /media/blendbrush/noise_128_hard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/noise_128_hard.png -------------------------------------------------------------------------------- /media/blendbrush/noise_128_soft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/noise_128_soft.png -------------------------------------------------------------------------------- /media/blendbrush/noise_256_hard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/noise_256_hard.png -------------------------------------------------------------------------------- /media/blendbrush/noise_256_soft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/noise_256_soft.png -------------------------------------------------------------------------------- /media/blendbrush/noise_512_hard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/noise_512_hard.png -------------------------------------------------------------------------------- /media/blendbrush/noise_512_soft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/noise_512_soft.png -------------------------------------------------------------------------------- /media/blendbrush/noise_64_hard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/noise_64_hard.png -------------------------------------------------------------------------------- /media/blendbrush/noise_64_soft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/noise_64_soft.png -------------------------------------------------------------------------------- /media/blendbrush/square_16_hard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/square_16_hard.png -------------------------------------------------------------------------------- /media/blendbrush/square_16_solid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/square_16_solid.png -------------------------------------------------------------------------------- /media/blendbrush/square_32_hard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/square_32_hard.png -------------------------------------------------------------------------------- /media/blendbrush/square_32_solid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/square_32_solid.png -------------------------------------------------------------------------------- /media/blendbrush/square_64_hard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/square_64_hard.png -------------------------------------------------------------------------------- /media/blendbrush/square_64_solid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/blendbrush/square_64_solid.png -------------------------------------------------------------------------------- /media/interface/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/interface/background.png -------------------------------------------------------------------------------- /media/interface/cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/interface/cursor.png -------------------------------------------------------------------------------- /media/interface/font/default.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/interface/font/default.ttf -------------------------------------------------------------------------------- /media/interface/font/default0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/interface/font/default0.png -------------------------------------------------------------------------------- /media/interface/font/default_outline.cfg: -------------------------------------------------------------------------------- 1 | fontalias "default_outline" "default" 2 | fontborder 0.15 0.35 3 | fontoutline 0.35 0.55 4 | -------------------------------------------------------------------------------- /media/interface/hud/crosshair.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/interface/hud/crosshair.png -------------------------------------------------------------------------------- /media/interface/hud/damage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/interface/hud/damage.png -------------------------------------------------------------------------------- /media/interface/icon/edit_envmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/interface/icon/edit_envmap.png -------------------------------------------------------------------------------- /media/interface/icon/edit_generic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/interface/icon/edit_generic.png -------------------------------------------------------------------------------- /media/interface/icon/edit_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/interface/icon/edit_light.png -------------------------------------------------------------------------------- /media/interface/icon/edit_mapmodel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/interface/icon/edit_mapmodel.png -------------------------------------------------------------------------------- /media/interface/icon/edit_marker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/interface/icon/edit_marker.png -------------------------------------------------------------------------------- /media/interface/icon/edit_particles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/interface/icon/edit_particles.png -------------------------------------------------------------------------------- /media/interface/icon/edit_sound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/interface/icon/edit_sound.png -------------------------------------------------------------------------------- /media/interface/icon/edit_spotlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/interface/icon/edit_spotlight.png -------------------------------------------------------------------------------- /media/interface/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/interface/logo.png -------------------------------------------------------------------------------- /media/interface/logo_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/interface/logo_1024.png -------------------------------------------------------------------------------- /media/interface/shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/interface/shadow.png -------------------------------------------------------------------------------- /media/map/test/map.ofm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/map/test/map.ofm -------------------------------------------------------------------------------- /media/map/test/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/map/test/preview.png -------------------------------------------------------------------------------- /media/model/box/obj.cfg: -------------------------------------------------------------------------------- 1 | mdlambient 50 2 | mdlspec -1 3 | mdlscale 20 4 | -------------------------------------------------------------------------------- /media/model/box/skin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/box/skin.jpg -------------------------------------------------------------------------------- /media/model/box/tris.obj: -------------------------------------------------------------------------------- 1 | # verts. Y and Z are flipped. 2 | v -50 50 -50 3 | v -50 50 50 4 | v 50 50 50 5 | v 50 50 -50 6 | v -50 -50 -50 7 | v -50 -50 50 8 | v 50 -50 50 9 | v 50 -50 -50 10 | 11 | # texture verts 12 | vt 0.0 0.0 13 | vt 0.0 1.0 14 | vt 1.0 1.0 15 | vt 1.0 0.0 16 | 17 | # normal verts - TODO 18 | vn 1.0 1.0 1.0 19 | 20 | # faces 21 | f 1/1/1 2/2/1 3/3/1 4/4/1 22 | f 8/1/1 7/2/1 6/3/1 5/4/1 23 | f 6/1/1 7/2/1 3/3/1 2/4/1 24 | f 1/1/1 4/2/1 8/3/1 5/4/1 25 | f 5/1/1 6/2/1 2/3/1 1/4/1 26 | f 7/1/1 8/2/1 4/3/1 3/4/1 27 | 28 | -------------------------------------------------------------------------------- /media/model/platform/obj.cfg: -------------------------------------------------------------------------------- 1 | mdlambient 50 2 | mdlspec -1 3 | mdlscale 80 4 | -------------------------------------------------------------------------------- /media/model/platform/skin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/platform/skin.jpg -------------------------------------------------------------------------------- /media/model/platform/tris.obj: -------------------------------------------------------------------------------- 1 | # verts. Y and Z are flipped. 2 | v -100 10 0 3 | v -100 10 200 4 | v 100 10 200 5 | v 100 10 0 6 | v -100 -10 0 7 | v -100 -10 200 8 | v 100 -10 200 9 | v 100 -10 0 10 | 11 | # texture verts 12 | vt 0.0 0.0 13 | vt 0.0 1.0 14 | vt 1.0 1.0 15 | vt 1.0 0.0 16 | 17 | # normal verts - TODO 18 | vn 1.0 1.0 1.0 19 | 20 | # faces 21 | f 1/1/1 2/2/1 3/3/1 4/4/1 22 | f 8/1/1 7/2/1 6/3/1 5/4/1 23 | f 6/1/1 7/2/1 3/3/1 2/4/1 24 | f 1/1/1 4/2/1 8/3/1 5/4/1 25 | f 5/1/1 6/2/1 2/3/1 1/4/1 26 | f 7/1/1 8/2/1 4/3/1 3/4/1 27 | 28 | -------------------------------------------------------------------------------- /media/model/player/animation.cfg: -------------------------------------------------------------------------------- 1 | //iqmtag tag_weapon tag_weapon 0 0 0 0 0 90 2 | 3 | iqmpitch spine 0.4 0 -30 30 4 | iqmpitch chest 0.3 0 -30 30 5 | //iqmpitch chest 0.30 0 -7 9 6 | //iqmpitch C_chest 0.30 0 -6 3 7 | //iqmpitch C_neck 0.30 0 -9 13 8 | //iqmpitch C_head 0.25 0 -15 19 9 | //iqmpitch L_arm 0.30 0 -15 40 10 | //iqmpitch R_arm 0.30 0 -15 25 11 | 12 | iqmanim "mapmodel" "animation/rest.iqm" 13 | iqmanim "edit" "animation/jump.iqm" 14 | iqmanim "lag" "animation/rest.iqm" 15 | 16 | iqmanim "idle" "animation/stand.iqm" 17 | iqmanim "run_N" "animation/forward.iqm" 27 18 | iqmanim "run_NE" "animation/forward_45R.iqm" 35 19 | iqmanim "run_E" "animation/sideright.iqm" 33 20 | iqmanim "run_SE" "animation/backward45_R.iqm" 35 21 | iqmanim "run_S" "animation/backward.iqm" 27 22 | iqmanim "run_SW" "animation/backward45_L.iqm" 35 23 | iqmanim "run_W" "animation/sideleft.iqm" 33 24 | iqmanim "run_NW" "animation/forward_45L.iqm" 35 25 | 26 | iqmanim "jump" "animation/jump.iqm" 27 | iqmanim "jump_N" "animation/jump_forward.iqm" 28 | iqmanim "jump_NE" "animation/jump_forward45R.iqm" 29 | iqmanim "jump_E" "animation/jump_right.iqm" 30 | iqmanim "jump_SE" "animation/jump_backward45R.iqm" 31 | iqmanim "jump_S" "animation/jump_backward.iqm" 32 | iqmanim "jump_SW" "animation/jump_backward45L.iqm" 33 | iqmanim "jump_W" "animation/jump_left.iqm" 34 | iqmanim "jump_NW" "animation/jump_forward45L.iqm" 35 | 36 | iqmanim "crouch" "animation/crouch.iqm" 37 | iqmanim "crouch_N" "animation/crouch_forward.iqm" 21 38 | iqmanim "crouch_NE" "animation/crouch_forward.iqm" 21 39 | iqmanim "crouch_E" "animation/crouch_forward.iqm" 21 40 | iqmanim "crouch_SE" "animation/crouch_forward.iqm" 21 41 | iqmanim "crouch_S" "animation/crouch_forward.iqm" 21 42 | iqmanim "crouch_SW" "animation/crouch_forward.iqm" 21 43 | iqmanim "crouch_W" "animation/crouch_forward.iqm" 21 44 | iqmanim "crouch_NW" "animation/crouch_forward.iqm" 21 45 | 46 | //iqmanim "crouch jump" "animation/crouch_jump.iqmanim" 47 | //iqmanim "crouch jump N" "animation/crouch_jump_N.iqmanim" 48 | //iqmanim "crouch jump NE" "animation/crouch_jump_NE.iqmanim" 49 | //iqmanim "crouch jump E" "animation/crouch_jump_E.iqmanim" 50 | //iqmanim "crouch jump SE" "animation/crouch_jump_SE.iqmanim" 51 | //iqmanim "crouch jump S" "animation/crouch_jump_S.iqmanim" 52 | //iqmanim "crouch jump SW" "animation/crouch_jump_SW.iqmanim" 53 | //iqmanim "crouch jump W" "animation/crouch_jump_W.iqmanim" 54 | //iqmanim "crouch jump NW" "animation/crouch_jump_NW.iqmanim" 55 | 56 | //iqmanim "sink" "animation/jump.iqmanim" 57 | //iqmanim "swim" "animation/jump_N.iqmanim" 58 | 59 | //iqmanim "crouch sink" "animation/crouch_jump.iqmanim" 60 | //iqmanim "crouch swim" "animation/crouch_jump_N.iqmanim" 61 | -------------------------------------------------------------------------------- /media/model/player/animation/backward.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/backward.iqm -------------------------------------------------------------------------------- /media/model/player/animation/backward45_L.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/backward45_L.iqm -------------------------------------------------------------------------------- /media/model/player/animation/backward45_R.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/backward45_R.iqm -------------------------------------------------------------------------------- /media/model/player/animation/crouch.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/crouch.iqm -------------------------------------------------------------------------------- /media/model/player/animation/crouch_forward.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/crouch_forward.iqm -------------------------------------------------------------------------------- /media/model/player/animation/forward.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/forward.iqm -------------------------------------------------------------------------------- /media/model/player/animation/forward_45L.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/forward_45L.iqm -------------------------------------------------------------------------------- /media/model/player/animation/forward_45R.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/forward_45R.iqm -------------------------------------------------------------------------------- /media/model/player/animation/jump.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/jump.iqm -------------------------------------------------------------------------------- /media/model/player/animation/jump_backward.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/jump_backward.iqm -------------------------------------------------------------------------------- /media/model/player/animation/jump_backward45L.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/jump_backward45L.iqm -------------------------------------------------------------------------------- /media/model/player/animation/jump_backward45R.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/jump_backward45R.iqm -------------------------------------------------------------------------------- /media/model/player/animation/jump_forward.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/jump_forward.iqm -------------------------------------------------------------------------------- /media/model/player/animation/jump_forward45L.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/jump_forward45L.iqm -------------------------------------------------------------------------------- /media/model/player/animation/jump_forward45R.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/jump_forward45R.iqm -------------------------------------------------------------------------------- /media/model/player/animation/jump_left.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/jump_left.iqm -------------------------------------------------------------------------------- /media/model/player/animation/jump_right.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/jump_right.iqm -------------------------------------------------------------------------------- /media/model/player/animation/rest.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/rest.iqm -------------------------------------------------------------------------------- /media/model/player/animation/sideleft.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/sideleft.iqm -------------------------------------------------------------------------------- /media/model/player/animation/sideright.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/sideright.iqm -------------------------------------------------------------------------------- /media/model/player/animation/stand.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/animation/stand.iqm -------------------------------------------------------------------------------- /media/model/player/diffuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/diffuse.png -------------------------------------------------------------------------------- /media/model/player/fullbody_ao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/fullbody_ao.png -------------------------------------------------------------------------------- /media/model/player/fullbody_nm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/fullbody_nm.png -------------------------------------------------------------------------------- /media/model/player/iqm.cfg: -------------------------------------------------------------------------------- 1 | iqmload "player.iqm" player 180 2 | 3 | iqmskin * fullbody_ao.png masks.png 0.6 0.3 4 | //iqmcolor * -1 5 | iqmdecal * diffuse.png 6 | iqmbumpmap * fullbody_nm.png 7 | 8 | exec "media/model/player/animation.cfg" 9 | //exec "media/model/player/hammer/ragdoll.cfg" 10 | 11 | mdlspec 150 12 | mdlscale 345 13 | -------------------------------------------------------------------------------- /media/model/player/masks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/masks.png -------------------------------------------------------------------------------- /media/model/player/player.iqm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/model/player/player.iqm -------------------------------------------------------------------------------- /media/particle/ball1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/ball1.png -------------------------------------------------------------------------------- /media/particle/ball2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/ball2.png -------------------------------------------------------------------------------- /media/particle/ball3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/ball3.png -------------------------------------------------------------------------------- /media/particle/base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/base.png -------------------------------------------------------------------------------- /media/particle/blob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/blob.png -------------------------------------------------------------------------------- /media/particle/blood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/blood.png -------------------------------------------------------------------------------- /media/particle/bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/bullet.png -------------------------------------------------------------------------------- /media/particle/explosion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/explosion.png -------------------------------------------------------------------------------- /media/particle/flames.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/flames.png -------------------------------------------------------------------------------- /media/particle/flare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/flare.png -------------------------------------------------------------------------------- /media/particle/glow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/glow.png -------------------------------------------------------------------------------- /media/particle/lensflares.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/lensflares.png -------------------------------------------------------------------------------- /media/particle/license.txt: -------------------------------------------------------------------------------- 1 | blood.png 2 | Created by FischKopF, source: http://www.quadropolis.us/node/2693 3 | "Feel free to edit, claim it's yours, use it in own projects" 4 | 5 | bullet.png 6 | leileilol, GPL 7 | 8 | snow.png 9 | Kevin "Hirato Kirata" Meyer (CC-BY-SA) 10 | 11 | -------------------------------------------------------------------------------- /media/particle/lightning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/lightning.png -------------------------------------------------------------------------------- /media/particle/muzzleflash1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/muzzleflash1.png -------------------------------------------------------------------------------- /media/particle/muzzleflash2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/muzzleflash2.png -------------------------------------------------------------------------------- /media/particle/muzzleflash3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/muzzleflash3.png -------------------------------------------------------------------------------- /media/particle/readme.txt: -------------------------------------------------------------------------------- 1 | ball1.png - 2 | ball2.png - 3 | ball3.png - 4 | base.png - CC-0 by T7g 5 | blob.png - CC-BY-SA by kripken 6 | blood.png - "Feel free to edit, claim it's yours, use it in own projects" by FischKopF (http://www.quadropolis.us/node/2693) 7 | bullet.png - 8 | explosion.png - CC-BY by RaZgRiZ 9 | flames.png - CC-BY by RaZgRiZ 10 | flare.png - CC-BY by RaZgRiZ 11 | lensflares.png - public domain by baby-rabbit 12 | lightning.png - CC-BY by RaZgRiZ 13 | muzzleflash1.png - CC-BY-SA by q009 14 | muzzleflash2.png - CC-BY-SA by q009 15 | muzzleflash3.png - CC-BY-SA by q009 16 | scorch.png - CC-0 by q66 17 | smoke.png - CC-BY by RaZgRiZ 18 | snow.png - CC-BY-SA by Kevin "Hirato Kirata" Meyer 19 | spark.png - CC-BY-SA by q009 20 | steam.png - CC-BY-SA by q009 21 | -------------------------------------------------------------------------------- /media/particle/scorch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/scorch.png -------------------------------------------------------------------------------- /media/particle/smoke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/smoke.png -------------------------------------------------------------------------------- /media/particle/snow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/snow.png -------------------------------------------------------------------------------- /media/particle/spark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/spark.png -------------------------------------------------------------------------------- /media/particle/steam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/particle/steam.png -------------------------------------------------------------------------------- /media/prefab/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/prefab/empty.txt -------------------------------------------------------------------------------- /media/scripts/core/engine/camera.oct: -------------------------------------------------------------------------------- 1 | /**< 2 | Camera related functions. All the force functions take effect for 3 | one frame only. 4 | 5 | Author: 6 | q66 7 | 8 | License: 9 | See COPYING.txt. 10 | */ 11 | 12 | import capi 13 | 14 | @[server] { return } 15 | 16 | from std.geom import Vec3 17 | 18 | from capi import camera_get, camera_get_position 19 | 20 | /** 21 | Gets information about the camera. 22 | 23 | Returns: 24 | The camera position (as a vec3) followed by yaw, pitch and roll 25 | (as multiple return values). 26 | */ 27 | export func get() { 28 | var x, y, z, yaw, pitch, roll = camera_get() 29 | return Vec3(x, y, z), yaw, pitch, roll 30 | } 31 | 32 | /// Returns the camera position (as a vec3). 33 | export func get_position() { 34 | return Vec3(camera_get_position()) 35 | } 36 | 37 | /// Returns the camera yaw. 38 | export var get_yaw = capi.camera_get_yaw 39 | 40 | /// Returns the camera pitch. 41 | export var get_pitch = capi.camera_get_pitch 42 | 43 | /// Returns the camera roll. 44 | export var get_roll = capi.camear_get_roll 45 | 46 | /** 47 | Forces the camera. 48 | 49 | Arguments: 50 | - x, y, z - the position. 51 | - yaw, pitch, roll - the resulting camera yaw, pitch and roll. 52 | - fov - the camera fov, which is optional. 53 | */ 54 | export var force = capi.camera_force 55 | 56 | /// Forces the camera position. Takes x, y, z. 57 | export var force_position = capi.camera_force_position 58 | 59 | /// Forces the camera yaw. 60 | export var force_yaw = capi.camera_force_yaw 61 | 62 | /// Forces the camera pitch. 63 | export var force_pitch = capi.camera_force_pitch 64 | 65 | /// Forces the camera roll. 66 | export var force_roll = capi.camera_force_roll 67 | 68 | /// Forces the camera field of view. 69 | export var force_fov = capi.camera_force_fov -------------------------------------------------------------------------------- /media/scripts/core/engine/changes.oct: -------------------------------------------------------------------------------- 1 | /**< 2 | OctaScript interface to changes queue. 3 | 4 | Author: 5 | q66 6 | 7 | License: 8 | See COPYING.txt. 9 | */ 10 | 11 | from std.object import Object 12 | 13 | import core.engine.cubescript as cs 14 | 15 | import core.externals 16 | 17 | var needsapply = [] 18 | 19 | /** 20 | Specifies the change type, can be GFX, SOUND or SHADERS. 21 | */ 22 | export var change = enum { 23 | GFX : 1 << 0, 24 | SOUND : 1 << 1, 25 | SHADERS: 1 << 2 26 | } 27 | 28 | /** 29 | Adds a change of the given type and description to the queue assuming 30 | a change of the same description doesn't already exist. 31 | */ 32 | export func add(ctype, desc) { 33 | for i, v in needsapply.each() { 34 | if v.desc == desc { return } 35 | } 36 | needsapply.push({ 37 | ctype: ctype, desc: desc 38 | }) 39 | } 40 | 41 | /** 42 | Clears out changes of the given type. If not given, clears out all. 43 | */ 44 | export func clear(ctype) { 45 | ctype = ctype || (change.GFX | change.SOUND | change.SHADERS) 46 | 47 | needsapply = needsapply.filter(func(v) { 48 | if (v.ctype & ctype) == 0 { 49 | return true 50 | } 51 | v.ctype = (v.ctype & ~ctype) 52 | if v.ctype == 0 { 53 | return false 54 | } 55 | return true 56 | }) 57 | } 58 | externals::set("changes_clear", clear) 59 | 60 | /** 61 | Applies all queued changes. 62 | */ 63 | export func apply() { 64 | var changetypes = 0 65 | for i, v in needsapply.each() { 66 | changetypes |= v.ctype 67 | } 68 | 69 | if (changetypes & change.GFX) != 0 { 70 | cs::execute("resetgl") 71 | } else if (changetypes & change.SHADERS) != 0 { 72 | cs::execute("resetshaders") 73 | } 74 | if (changetypes & change.SOUND) != 0 { 75 | cs::execute("resetsound") 76 | } 77 | } 78 | 79 | /** 80 | Returns a table of all queued changes' descriptions. 81 | */ 82 | export func get() { 83 | return needsapply.map(\v -> v.desc) 84 | } -------------------------------------------------------------------------------- /media/scripts/core/engine/init.oct: -------------------------------------------------------------------------------- 1 | import core.logger as log 2 | 3 | log::log(log.DEBUG, ":::: Cubescript utilities.") 4 | import core.engine.cubescript as undef 5 | 6 | log::log(log.DEBUG, ":::: Input.") 7 | import core.engine.input as undef 8 | 9 | log::log(log.DEBUG, ":::: Camera.") 10 | import core.engine.camera as undef 11 | 12 | log::log(log.DEBUG, ":::: Sound.") 13 | import core.engine.sound as undef 14 | 15 | log::log(log.DEBUG, ":::: Models.") 16 | import core.engine.model as undef 17 | 18 | log::log(log.DEBUG, ":::: Lights.") 19 | import core.engine.lights as undef 20 | 21 | log::log(log.DEBUG, ":::: Stains.") 22 | import core.engine.stains as undef 23 | 24 | log::log(log.DEBUG, ":::: Particles.") 25 | import core.engine.particles as undef 26 | 27 | log::log(log.DEBUG, ":::: Editing.") 28 | import core.engine.edit as undef 29 | 30 | log::log(log.DEBUG, ":::: Changes.") 31 | import core.engine.changes as undef 32 | -------------------------------------------------------------------------------- /media/scripts/core/engine/input.oct: -------------------------------------------------------------------------------- 1 | /**< 2 | Input related engine functions. It's a clientside module. 3 | 4 | Author: 5 | q66 6 | 7 | License: 8 | See COPYING.txt. 9 | */ 10 | 11 | @[server] { return } 12 | 13 | import capi 14 | import core.events.frame 15 | 16 | from std.geom import Vec3 17 | 18 | /** Function: get_target_position 19 | Returns the position in the world you're targeting. 20 | */ 21 | export var get_target_position = frame::cache_by_frame(func() { 22 | return Vec3(capi::gettargetpos()) 23 | }) -------------------------------------------------------------------------------- /media/scripts/core/engine/sound.oct: -------------------------------------------------------------------------------- 1 | /**< 2 | Sound related functions. Relevant only clientside. 3 | 4 | Author: 5 | q66 6 | 7 | License: 8 | See COPYING.txt. 9 | */ 10 | 11 | @[server] { return } 12 | 13 | import capi 14 | 15 | from std.geom import Vec3 16 | 17 | /** 18 | Plays a sound. 19 | 20 | Arguments: 21 | - name - the sound name. 22 | - pos - the sound position (a value with x, y, z, defaults to 23 | 0, 0, 0). 24 | - vol - an optional volume that defaults to 100. 25 | */ 26 | export func play(name, pos, vol) { 27 | if !name { return } 28 | pos = pos || Vec3(0) 29 | capi::sound_play(name, pos.x, pos.y, pos.z, vol || 100) 30 | } 31 | 32 | /** 33 | Stops a sound. 34 | 35 | Arguments: 36 | - name - the sound name. 37 | - vol - an optional volume that defaults to 100. 38 | */ 39 | export func stop(name, vol) { capi::sound_stop(name, vol || 100) } 40 | 41 | /** Function: preload_map 42 | Preloads a map sound so that it doesn't have to be loaded on the fly 43 | later. That leads to better performance. 44 | 45 | Arguments: 46 | - name - the sound name. 47 | - vol - an optional volume that defaults to 100. 48 | 49 | See also: 50 | - $preload_game 51 | */ 52 | export func preload_map(name, vol) { 53 | return capi::sound_preload_map(name, vol || 100) 54 | } 55 | 56 | /** Function: preload_game 57 | Preloads a game sound so that it doesn't have to be loaded on the fly 58 | later. That leads to better performance. 59 | 60 | Arguments: 61 | - name - the sound name. 62 | - vol - an optional volume that defaults to 100. 63 | 64 | See also: 65 | - $preload_map 66 | */ 67 | export func preload_game(name, vol) { 68 | return capi::sound_preload_game(name, vol || 100) 69 | } -------------------------------------------------------------------------------- /media/scripts/core/engine/stains.oct: -------------------------------------------------------------------------------- 1 | /**< 2 | OctaScript stain API. Works on the client. 3 | 4 | Author: 5 | q66 6 | 7 | License: 8 | See COPYING.txt. 9 | */ 10 | 11 | @[server] { return } 12 | 13 | import capi 14 | 15 | /** 16 | The flags available during stain renderer registration. Use bitwise 17 | OR to combine them. They include RND4 (picks one of four corners), 18 | ROTATE, INVMOD, OVERBRIGHT, GLOW, SATURATE. 19 | */ 20 | export var flags = enum { 21 | RND4 : 1 << 0, 22 | ROTATE : 1 << 1, 23 | INVMOD : 1 << 2, 24 | OVERBRIGHT: 1 << 3, 25 | GLOW : 1 << 4, 26 | SATURATE : 1 << 5 27 | } 28 | 29 | /** Function: register_renderer 30 | Registers a new stain renderer. 31 | 32 | Arguments: 33 | - name - the renderer name. 34 | - tex - the stain texture name. 35 | - flags - the optional stain renderer flags. 36 | 37 | Returns: 38 | The stain renderer id (an integer, use it for spawning stains) 39 | and a boolean which is false if a renderer of such name is 40 | already registered (in this case the id returned belongs to 41 | the registered renderer). 42 | 43 | See also: 44 | - $flags 45 | */ 46 | export var register_renderer = capi.stain_register_renderer 47 | 48 | /** Function: get_renderer 49 | Given a name, returns the id of the renderer of that name or 50 | nothing (if no such renderer exists). 51 | */ 52 | export var get_renderer = capi.stain_get_renderer 53 | 54 | /** 55 | Creates a stain. 56 | 57 | Arguments: 58 | - tp - the stain renderer id. 59 | - op - the origin position (any value with x, y, z). 60 | - sp - a surface normal vector (again, any value with x, y, z). 61 | - rad - the stain radius (a float). 62 | - r, g, b - the stain color (floats, typically from 0 to 1). 63 | - info - optional, specifies the corner to use if it's rnd4 64 | (0 to 3). 65 | */ 66 | export func add(tp, op, sp, rad, r, g, b, inf) { 67 | capi::stain_add(tp, op.x, op.y, op.z, sp.x, sp.y, sp.z, rad, r, g, b, 68 | inf || 0) 69 | } -------------------------------------------------------------------------------- /media/scripts/core/entities/init.oct: -------------------------------------------------------------------------------- 1 | import core.logger as log 2 | 3 | log::log(log.DEBUG, ":::: State variables.") 4 | import core.entities.svars as undef 5 | 6 | log::log(log.DEBUG, ":::: Entities.") 7 | import core.entities.ents as undef 8 | 9 | log::log(log.DEBUG, ":::: Entities: basic set.") 10 | import core.entities.ents_basic as undef 11 | -------------------------------------------------------------------------------- /media/scripts/core/events/init.oct: -------------------------------------------------------------------------------- 1 | import core.logger as log 2 | 3 | log::log(log.DEBUG, ":::: Frame handling.") 4 | import core.events.frame as undef 5 | 6 | log::log(log.DEBUG, ":::: Action system.") 7 | import core.events.actions as undef 8 | 9 | log::log(log.DEBUG, ":::: Input events.") 10 | import core.events.input as undef 11 | -------------------------------------------------------------------------------- /media/scripts/core/externals.oct: -------------------------------------------------------------------------------- 1 | /**< 2 | Provides the handling of externals. Not accessible from anywhere but the 3 | core library. 4 | 5 | Author: 6 | q66 7 | 8 | License: 9 | See COPYING.txt. 10 | */ 11 | 12 | import capi 13 | import luastate 14 | 15 | var externals = {} 16 | 17 | /// Retrieves the external of the given name. 18 | export func get(name) { 19 | return externals[name] 20 | } 21 | 22 | /// Unsets the external of the given name, returns the previous value or undef. 23 | export func unset(name) { 24 | var old = externals[name] 25 | if old == undef { return undef } 26 | externals[name] = undef 27 | return old 28 | } 29 | 30 | /// Sets the external of the given name, returns the previous value or undef. 31 | export func set(name, fun) { 32 | var old = externals[name] 33 | externals[name] = fun 34 | return old 35 | } 36 | 37 | capi::external_hook(externals) 38 | 39 | // we need the state restore external here so that it gets cleaned up with 40 | // the rest 41 | 42 | externals["state_restore"] = func() { 43 | luastate::restore() 44 | } -------------------------------------------------------------------------------- /media/scripts/core/gui/init.oct: -------------------------------------------------------------------------------- 1 | import core.logger as log 2 | 3 | log::log(log.DEBUG, ":::: Core UI implementation.") 4 | 5 | import core.gui.core as undef 6 | import core.gui.core_containers as undef 7 | import core.gui.core_spacers as undef 8 | import core.gui.core_primitives as undef 9 | import core.gui.core_scrollers as undef 10 | import core.gui.core_sliders as undef 11 | import core.gui.core_buttons as undef 12 | import core.gui.core_editors as undef 13 | import core.gui.core_misc as undef 14 | 15 | import core.gui.default as undef 16 | -------------------------------------------------------------------------------- /media/scripts/core/init.oct: -------------------------------------------------------------------------------- 1 | /**< 2 | Loads all required core modules, sets up logging, loads the FFI 3 | and sets up the default environment. 4 | 5 | Author: 6 | q66 7 | 8 | License: 9 | See COPYING.txt. 10 | */ 11 | 12 | import luastate 13 | 14 | import std.table 15 | import std.debug 16 | 17 | from std.math import randomseed 18 | from std.os import time 19 | from std.conv import tostring 20 | 21 | // init a random seed 22 | randomseed(time()) 23 | 24 | /** 25 | Traces what OctaScript does and logs it into the console. Not in use by 26 | default. Very verbose. Use only when absolutely required. Uncomment 27 | the sethook line to use it. Takes two arguments, the caught event and 28 | the line on which the event was caught. 29 | 30 | Does not get logged, just printed into the console. 31 | 32 | ``` 33 | debug::sethook(trace, "c") 34 | ``` 35 | */ 36 | func trace(event, line) { 37 | var s = debug::getinfo(2, "nSl") 38 | print "DEBUG:" 39 | print " " ~ tostring(s.name) 40 | print " " ~ tostring(s.namewhat) 41 | print " " ~ tostring(s.source) 42 | print " " ~ tostring(s.short_src) 43 | print " " ~ tostring(s.linedefined) 44 | print " " ~ tostring(s.lastlinedefined) 45 | print " " ~ tostring(s.what) 46 | print " " ~ tostring(s.currentline) 47 | } 48 | 49 | //debug::sethook(trace, "c") 50 | 51 | import capi 52 | 53 | // patch capi 54 | import core.capi as undef 55 | 56 | capi::log(1, "Initializing logging.") 57 | 58 | import core.logger as log 59 | 60 | import core.externals as undef 61 | 62 | log::log(log.DEBUG, "Initializing the core library.") 63 | 64 | log::log(log.DEBUG, ":: OctaScript extensions.") 65 | import core.octascript as undef 66 | 67 | log::log(log.DEBUG, ":: Network system.") 68 | import core.network as undef 69 | 70 | log::log(log.DEBUG, ":: Event system.") 71 | import core.events as undef 72 | 73 | log::log(log.DEBUG, ":: Engine system.") 74 | import core.engine as undef 75 | 76 | log::log(log.DEBUG, ":: Entity system.") 77 | import core.entities as undef 78 | 79 | log::log(log.DEBUG, ":: GUI.") 80 | import core.gui as undef 81 | 82 | log::log(log.DEBUG, "Core scripting initialization complete.") 83 | 84 | import std 85 | -------------------------------------------------------------------------------- /media/scripts/core/logger.oct: -------------------------------------------------------------------------------- 1 | /**< 2 | Provides the core logging facilities. 3 | 4 | Author: 5 | q66 6 | 7 | License: 8 | See COPYING.txt. 9 | */ 10 | 11 | import capi 12 | 13 | /// The INFO logging level, use for very verbose output. 14 | export var INFO = 0 15 | 16 | /// The DEBUG logging level. 17 | export var DEBUG = 1 18 | 19 | /// The WARNING logging level, displayed by default. 20 | export var WARNING = 2 21 | 22 | /// The ERROR logging level, always printed (incl. the in-engine console). 23 | export var ERROR = 3 24 | 25 | /** Function: log 26 | Logs some text into the console with the given level. By default, OF 27 | uses the "WARNING" level. You can change it on engine startup. 28 | 29 | Arguments: 30 | - level - the logging level. 31 | - text - the text to be logged. 32 | 33 | See also: 34 | - $INFO 35 | - $DEBUG 36 | - $WARNING 37 | - $ERROR 38 | */ 39 | export var log = capi.log 40 | 41 | /** Function: echo 42 | Displays some text into both consoles (in-engine and terminal). 43 | 44 | Arguments: 45 | - text - the text to be printed. 46 | */ 47 | export var echo = capi.echo 48 | 49 | /** Function: should_log 50 | Returns whether the given logging level should be logged. 51 | 52 | Arguments: 53 | - level - the logging level to use. 54 | 55 | Returns: 56 | Either true or false. 57 | */ 58 | export var should_log = capi.should_log -------------------------------------------------------------------------------- /media/scripts/core/network/init.oct: -------------------------------------------------------------------------------- 1 | import core.logger as log 2 | 3 | log::log(log.DEBUG, ":::: Messages.") 4 | import core.network.msg as undef 5 | -------------------------------------------------------------------------------- /media/scripts/core/network/msg.oct: -------------------------------------------------------------------------------- 1 | /**< 2 | Provides an API to the OctaForge message system. 3 | 4 | Author: 5 | q66 6 | 7 | License: 8 | See COPYING.txt. 9 | */ 10 | 11 | import capi 12 | 13 | /** 14 | A constant (value -1) used when sending messages. Specifying this constant 15 | means that the message will be sent to all clients. 16 | */ 17 | export var ALL_CLIENTS = -1 18 | 19 | import capi 20 | 21 | export var is_local = @[server,func() { return true },func() { 22 | return capi::isconnected(false, true) && !capi::isconnected(false, false) 23 | }] 24 | 25 | export var is_server = @[server,func() { return true },func() { 26 | return capi::islistenserver() || is_local() 27 | }] 28 | 29 | export var is_server_only = @[server,func() { return true },func() { 30 | return capi::islistenserver() && !capi::isconnected(false, true) 31 | }] 32 | 33 | // low level stuff, unexposed 34 | 35 | from std.conv import tonumber 36 | 37 | import core.externals 38 | from core.octascript.messagepack import unpack as mp_unpack 39 | 40 | func get_byte(c) { 41 | return tonumber(capi::ucharbuf_getuchar(c.p)) 42 | } 43 | externals::set("buf_get_msgpack", func(p) { 44 | return mp_unpack({ p: p, get_byte: get_byte }) 45 | }) -------------------------------------------------------------------------------- /media/scripts/core/octascript/env.oct: -------------------------------------------------------------------------------- 1 | /**< 2 | Provides environment management for sandboxed scripts. 3 | 4 | Author: 5 | q66 6 | 7 | License: 8 | See COPYING.txt. 9 | */ 10 | 11 | from std.eval import load 12 | import core.externals 13 | 14 | externals::set("gamescript_run", func(fname) { 15 | load(e"import $fname")() 16 | }) -------------------------------------------------------------------------------- /media/scripts/core/octascript/geom.oct: -------------------------------------------------------------------------------- 1 | /**< 2 | Geometry utilities. 3 | 4 | Author: 5 | q66 6 | 7 | License: 8 | See COPYING.txt. 9 | */ 10 | 11 | import capi 12 | from std.geom import Vec3 13 | from std.math import min, max 14 | 15 | /** 16 | Returns the distance to the floor below some given position. 17 | 18 | Arguments: 19 | - max_dist - the maximum distance. 20 | - radius - optionally the radius to search within. 21 | - lowest - if true, finds the lowest floor instead of highest 22 | floor, optional. 23 | */ 24 | export func floor_distance(self, max_dist, radius, lowest) { 25 | var rt = capi::ray_floor(self.x, self.y, self.z, max_dist) 26 | if !radius { return rt } 27 | 28 | var tbl = [ -radius / 2, 0, radius / 2 ] 29 | var f = lowest ? max : min 30 | for x in 0 to tbl.len() - 1 { 31 | for y in 0 to tbl.len() - 1 { 32 | var o = self.add_new(Vec3(tbl[x], tbl[y], 0)) 33 | rt = f(rt, capi::ray_floor(o.x, o.y, o.z, max_dist)) 34 | } 35 | } 36 | 37 | return rt 38 | } 39 | 40 | /** 41 | Returns true is the line between two given positions is clear 42 | (if there are no obstructions). Returns false otherwise. 43 | */ 44 | export func is_los(self, d) { 45 | return capi::ray_los(self.x, self.y, self.z, d.x, d.y, d.z) 46 | } 47 | -------------------------------------------------------------------------------- /media/scripts/core/octascript/init.oct: -------------------------------------------------------------------------------- 1 | import core.logger as log 2 | 3 | log::log(log.DEBUG, ":::: OctaScript extensions: streams") 4 | import core.octascript.stream as undef 5 | 6 | log::log(log.DEBUG, ":::: OctaScript extensions: geom") 7 | import core.octascript.geom as undef 8 | 9 | log::log(log.DEBUG, ":::: OctaScript extensions: messagepack") 10 | import core.octascript.messagepack as undef 11 | 12 | log::log(log.DEBUG, ":::: Environment support.") 13 | import core.octascript.env as undef 14 | -------------------------------------------------------------------------------- /media/scripts/extra/entities/teleporters.oct: -------------------------------------------------------------------------------- 1 | /**< 2 | Reusable teleporter entities. 3 | 4 | Author: 5 | q66 6 | 7 | License: 8 | See COPYING.txt. 9 | */ 10 | 11 | @[server] { return } 12 | 13 | import core.logger as log 14 | import core.entities.svars 15 | 16 | from core.entities.ents import Obstacle, register_prototype, get_static_by_tag 17 | from core.engine.sound import play 18 | 19 | from std.math import random as rand 20 | 21 | /** Object: teleporters.Teleporter 22 | A regular invisible teleporter. Derives from {{$ents.Obstacle}}. Properties 23 | can be specified on creation as first two parameters to newent (the rest 24 | applies to {{$ents.Obstacle}} properties). 25 | 26 | In edit mode, the links from teleporter to destinations are visualized. 27 | 28 | Properties: 29 | - destination - an integer from 1 to N (0 by default, as in invalid), 30 | specifies the teleporter destination number (which is a marker 31 | tagged teledest_N), there can be multiple destinations and the 32 | teleporter will select one at random. 33 | - sound_name - name of the sound to play on teleportation, empty 34 | by default. 35 | */ 36 | export var Teleporter = Obstacle.clone({ 37 | name: "Teleporter", 38 | 39 | __properties: { 40 | destination: svars::StateInteger(), 41 | sound_name : svars::StateString() 42 | }, 43 | 44 | __init_svars: func(self, kwargs, nd) { 45 | Obstacle::__init_svars(self, kwargs, [ nd.unpack(2) ]) 46 | self.set_attr("destination", 0, nd[0]) 47 | self.set_attr("sound_name", "", nd[1]) 48 | }, 49 | 50 | __activate: func(self, kwargs) { 51 | Obstacle::__activate(self, kwargs) 52 | self.connect("collision,start", self.on_collision) 53 | }, 54 | 55 | on_collision: func(self, collider) { 56 | var dest = self.get_attr("destination") 57 | if dest <= 0 { return } 58 | var dests = get_static_by_tag("teledest_" ~ dest) 59 | if dests.len() == 0 { 60 | log::log(log.ERROR, "No teledest found.") 61 | return 62 | } 63 | dests[rand(0, dests.len())].place_entity(collider) 64 | var sn = self.get_attr("sound_name") 65 | if sn != "" { play(sn) } 66 | }, 67 | 68 | get_attached_next: func(self) { 69 | var dest = self.get_attr("destination") 70 | if dest <= 0 { return } 71 | return get_static_by_tag("teledest_" ~ dest).unpack() 72 | } 73 | }) 74 | 75 | register_prototype(Teleporter) -------------------------------------------------------------------------------- /media/scripts/extra/events/timers.oct: -------------------------------------------------------------------------------- 1 | /**< 2 | Timer objects for general use. 3 | 4 | Author: 5 | q66 6 | 7 | License: 8 | See COPYING.txt. 9 | */ 10 | 11 | from std.object import Object 12 | 13 | /** 14 | A general use timer. It's not automatically managed - you have to simulate 15 | it yourself using the provided methods. That makes it flexible for various 16 | scenarios (where the timing is not managed by the general event loop). 17 | */ 18 | export var Timer = Object.clone({ 19 | name = "Timer", 20 | 21 | /** 22 | A timer constructor. 23 | 24 | Arguments: 25 | - interval - time in milliseconds the timer should take until 26 | the next repeated action. 27 | - carry_over - a boolean specifying whether to carry potential 28 | extra time to next iteration (if you $tick with a too large 29 | value, the sum will be larger than the interval), defaults 30 | to false. 31 | */ 32 | __ctor: func(self, interval, carry_over) { 33 | self.interval = interval 34 | self.carry_over = carry_over || false 35 | self.sum = 0 36 | }, 37 | 38 | /** 39 | Performs one timer tick. 40 | 41 | Arguments: 42 | - millis - the value in milliseconds to add to the internal sum. 43 | If this is larger than the interval, sum is reset to either zero 44 | or "sum - interval" (if carry_over is true). 45 | 46 | Returns: 47 | True if the interval was reached, false otherwise. 48 | */ 49 | tick: func(self, millis) { 50 | var sum = self.sum + millis 51 | var interval = self.interval 52 | if sum >= interval { 53 | self.sum = self.carry_over && (sum - interval) || 0 54 | return true 55 | } else { 56 | self.sum = sum 57 | return false 58 | } 59 | }, 60 | 61 | /// Manually sets sum to interval. 62 | prime: func(self) { 63 | self.sum = self.interval 64 | } 65 | }) -------------------------------------------------------------------------------- /media/scripts/games/octacraft/init.oct: -------------------------------------------------------------------------------- 1 | /**< 2 | A main file for the "octacraft" test game. It's meant to be a 3 | Minecraft inspired demo with procedural world generation. 4 | 5 | Author: 6 | q66 7 | 8 | License: 9 | See COPYING.txt. 10 | */ 11 | 12 | import core.logger as log 13 | 14 | import core.engine.input 15 | import core.events.input as inputev 16 | import core.events.actions 17 | import core.engine.edit 18 | import core.engine.cubescript as cs 19 | import core.entities.svars 20 | import core.entities.ents 21 | 22 | import extra.game_manager 23 | import extra.day_manager 24 | import extra.health 25 | 26 | /** Object: GamePlayer 27 | This serves as a base for our player. 28 | */ 29 | var GamePlayer = ents.Player.clone({ 30 | name: "GamePlayer" 31 | }) 32 | 33 | ents::register_prototype(GamePlayer, [ 34 | game_manager.player_plugin, 35 | health.player_plugin, 36 | //health.plugins.player_hud, 37 | health.plugins.player_off_map, 38 | health.plugins.player_in_deadly_material 39 | ]) 40 | 41 | @[!server] ents::register_prototype(ents.Obstacle, [ health.plugins.area ], 42 | "HealthArea") 43 | 44 | //day_manager::setup([ day_manager.plugins.day_night ]) 45 | 46 | ents::set_player_prototype("GamePlayer") 47 | 48 | @[server] { 49 | return 50 | } 51 | 52 | var MouseAction = actions.Action.clone({ 53 | name: "MouseAction", 54 | allow_multiple: false, 55 | block_size: 4, 56 | 57 | __start: func(self) { 58 | self.counter = 0 59 | self.try_block() 60 | }, 61 | 62 | __run: func(self, millis) { 63 | var cnt = self.counter 64 | cnt += millis 65 | var btn = self.button 66 | if (btn == 1 && cnt >= 600) || (btn != 1 && cnt >= 200) { 67 | self.counter = 0 68 | self.try_block() 69 | } else { 70 | self.counter = cnt 71 | } 72 | return false 73 | }, 74 | 75 | try_block: func(self) { 76 | var pl = self.player 77 | var tg = input::get_target_position() 78 | var pos = pl.get_attr("position") 79 | var bf 80 | if self.button == 1 { 81 | tg.add((tg - pos).normalize()) 82 | bf = edit.cube_delete 83 | } else { 84 | tg.sub((tg - pos).normalize()) 85 | bf = edit.cube_create 86 | } 87 | var bsize = self.block_size 88 | bf(tg.x >> bsize << bsize, tg.y >> bsize << bsize, 89 | tg.z >> bsize << bsize, 1 << bsize) 90 | } 91 | }) 92 | 93 | inputev::set_event("click", func(btn, down, x, y, z, ent, cx, cy) { 94 | var pl = ents::get_player() 95 | if !pl || pl.get_editing() { return } 96 | if ent && ent.click { 97 | return ent.click(btn, down, x, y, z, cx, cy) 98 | } 99 | var gm = game_manager::get() 100 | if down { 101 | var mact = MouseAction() 102 | mact.button = btn 103 | mact.player = pl 104 | gm.mouse_action = mact 105 | gm.enqueue_action(mact) 106 | } else if gm.mouse_action { 107 | gm.mouse_action.cancel() 108 | gm.mouse_action = undef 109 | } 110 | }) 111 | -------------------------------------------------------------------------------- /media/scripts/gamescripts/drawing/basic.oct: -------------------------------------------------------------------------------- 1 | // A very basic gamescript 2 | 3 | import extra.game_manager 4 | 5 | import extra.entities.teleporters 6 | import extra.entities.lights 7 | import extra.entities.particles 8 | 9 | import games.drawing 10 | 11 | game_manager::setup() -------------------------------------------------------------------------------- /media/scripts/gamescripts/octacraft/basic.oct: -------------------------------------------------------------------------------- 1 | // A very basic gamescript 2 | 3 | import extra.game_manager 4 | 5 | import extra.entities.teleporters 6 | import extra.entities.lights 7 | import extra.entities.particles 8 | 9 | import games.octacraft 10 | 11 | game_manager::setup() -------------------------------------------------------------------------------- /media/scripts/lang/init.lua: -------------------------------------------------------------------------------- 1 | --[[!< 2 | Loads OctaScript, a language that compiles to LuaJIT bytecode and is 3 | used by OctaForge for scripting. 4 | 5 | This is an OctaForge project that also lives within its own repository 6 | on the OctaForge Git as well as on GitHub mirror (OctaForge/OctaScript). 7 | 8 | Author: 9 | q66 10 | 11 | License: 12 | See COPYING.txt. 13 | ]] 14 | 15 | local capi = require("capi") 16 | 17 | capi.log(1, "Initializing OctaScript.") 18 | 19 | package.path = "media/scripts/lang/octascript/?/init.oct;" 20 | .. "media/scripts/lang/octascript/?/init.lua;" 21 | .. "media/scripts/lang/octascript/?.lua" 22 | 23 | local std = require("octascript.stdcore") 24 | 25 | local M = {} 26 | 27 | std.package.cond_env = { debug = capi.should_log(1), server = SERVER } 28 | 29 | local compile = std.eval.compile 30 | M.compile = compile 31 | M.env = require("octascript.rt").env 32 | M.traceback = debug.traceback 33 | 34 | require("octascript.stdcore.native") 35 | 36 | capi.log(1, "OctaScript initialization complete.") 37 | 38 | local oldloader = std.package.loaders[1] 39 | 40 | local octfile_read = function(path) 41 | local file, err = capi.stream_open(path, "r") 42 | if not file then return nil, err end 43 | local tp = file:read("*all") 44 | file:close() 45 | return tp 46 | end 47 | 48 | std.package.loaders[1] = function(modname, ppath) 49 | return oldloader(modname, ppath, capi.search_oct_path, octfile_read) 50 | end 51 | 52 | std.package.path = "media/?/init.oct;" 53 | .. "media/?.oct;" 54 | .. "media/scripts/lang/octascript/octascript/stdlib/?.oct;" 55 | .. "media/scripts/?/init.oct;" 56 | .. "media/scripts/?.oct" 57 | 58 | return M 59 | -------------------------------------------------------------------------------- /media/scripts/lang/octascript/README.md: -------------------------------------------------------------------------------- 1 | OctaScript 2 | ========== 3 | 4 | ## The OctaForge scripting language 5 | 6 | OctaScript is a language that was created specifically for OctaForge. However, 7 | it's usable standalone as well. It differs from other languages by compiling 8 | to LuaJIT bytecode, leveraging its high performance and unlike transpilers, 9 | this approach allows it to provide correct debug info and implement a lot more 10 | features in an easier manner. 11 | 12 | This repository contains a standalone version of OctaScript, not dependent 13 | upon the OctaForge engine. 14 | 15 | Support for text editors and various tools is also stored here. 16 | 17 | The language, editor modes and everything else are provided under the terms 18 | of the University of Illinois/NCSA Open Source License (similar to BSD 3 clause). 19 | 20 | Editor support: 21 | 22 | * jEdit 23 | * Geany 24 | * Kate 25 | * Qt Creator 26 | * KDevelop 27 | * GNU Nano 28 | * Vim (syntax, no indent) 29 | 30 | Qt Creator and KDevelop are supported as they use Kate's language 31 | files. Other editors using the same editor component are supported 32 | as well. 33 | 34 | Future editor support: 35 | 36 | * Emacs 37 | * Sublime Text 38 | * gEdit 39 | * Notepad++ 40 | 41 | Tools support: 42 | 43 | * Highlight 44 | 45 | Future tools support: 46 | 47 | * Pygments 48 | -------------------------------------------------------------------------------- /media/scripts/lang/octascript/editors/geany/README.txt: -------------------------------------------------------------------------------- 1 | This is a Geany filetype for OctaScript. 2 | 3 | Install filetypes.Octascript.conf to $HOME/.config/geany/filedefs. 4 | 5 | Then open Geany, go to Tools->Configuration Files->filetype_extensions.conf. 6 | 7 | Make it look like this at least (merge if you already have it): 8 | 9 | [Extensions] 10 | Octascript=*.oct; 11 | [Groups] 12 | Script=Octascript; 13 | 14 | Restart Geany, enjoy highlighting. 15 | 16 | Note that nested comments are not supported with Geany's lexer. 17 | -------------------------------------------------------------------------------- /media/scripts/lang/octascript/editors/geany/filetypes.Octascript.conf: -------------------------------------------------------------------------------- 1 | [styling=C] 2 | 3 | [keywords] 4 | primary=as break by continue else enum export false for from func goto if import in null print raise rec repeat return self to true try typeof undef until var while 5 | secondary=__add __call __concat __div __eq __index __le __lt __metatable __mode __mul __newindex __pairs __pow __sub __tostring __unm 6 | 7 | [lexer_properties] 8 | lexer.cpp.triplequoted.strings=1 9 | 10 | [settings] 11 | lexer_filetype=C 12 | extension=oct 13 | comment_single=// 14 | comment_open=/* 15 | comment_close=*/ 16 | 17 | comment_use_indent=true 18 | context_action_cmd= 19 | -------------------------------------------------------------------------------- /media/scripts/lang/octascript/editors/jedit/README.txt: -------------------------------------------------------------------------------- 1 | This is a jEdit mode for OctaScript. 2 | 3 | Install to $HOME/.jedit/modes. 4 | 5 | Create the file "catalog" in that directory if it doesn't 6 | exist already and paste this line inside: 7 | 8 | 9 | 10 | It should look roughly like this: 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /media/scripts/lang/octascript/editors/kate/README.txt: -------------------------------------------------------------------------------- 1 | This is a Kate mode for OctaScript. 2 | 3 | It will also work for Qt Creator, KDevelop and other editors that use 4 | the same editor component. 5 | 6 | Install to $HOME/.kde4/share/apps/katepart/syntax. 7 | 8 | This will work with Kate and KDevelop by default but might not work with 9 | Qt Creator by default. For Qt Creator, you will have to either manually 10 | select the path to the "syntax" directory or copy it to Qt Creator's own 11 | directory. 12 | -------------------------------------------------------------------------------- /media/scripts/lang/octascript/editors/nano/README.txt: -------------------------------------------------------------------------------- 1 | This is a GNU Nano mode for OctaScript. 2 | 3 | Install to your preferred location and include from your .nanorc, like this: 4 | 5 | include "$HOME/.octascript.nanorc" 6 | 7 | Obviously, adjust the file name as you need. 8 | 9 | Keep in mind that nested comments are not supported as they're not possible 10 | to do with regexes. 11 | -------------------------------------------------------------------------------- /media/scripts/lang/octascript/editors/nano/octascript.nanorc: -------------------------------------------------------------------------------- 1 | # Nano syntax file for OctaScript 2 | # by Daniel "q66" Kolesa 3 | # NCSA licensed 4 | # 5 | syntax "octascript" "\.oct$" 6 | 7 | # Decimal integer literals 8 | color brightred "([0-9]|[1-9][0-9_]*)([Ll][Ll]|[Uu][Ll][Ll])?" 9 | # Binary integer literals 10 | color brightred "(0[bB][01_]*)([Ll][Ll]|[Uu][Ll][Ll])?" 11 | # Hexadecimal integer literals 12 | color brightred "(0[xX]([0-9a-fA-F][0-9a-fA-F_]*|[0-9a-fA-F_]*[0-9a-fA-F]))([Ll][Ll]|[Uu][Ll][Ll])?" 13 | 14 | # Float literals 15 | color brightred "[0-9][0-9_]*\.([0-9][0-9_]*)([eE][+-]?([0-9][0-9_]*))?i?" 16 | color brightred "[0-9][0-9_]*([eE][+-]?([0-9][0-9_]*))i?" 17 | color brightred "[^.]\.([0-9][0-9_]*)([eE][+-]?([0-9][0-9_]*))?i?" 18 | color brightred "[0-9][0-9_]*i?" 19 | 20 | color brightwhite "\<[[:alpha:]_][[:alnum:]_]*\>" 21 | 22 | # general stuff 23 | color green "[[:<:]](__add|__call|__concat|__div|__eq|__index|__le|__lt|__metatable|__mode|__mul|__newindex|__pairs|__pow|__sub|__tostring|__unm)[[:>:]]" 24 | color brightgreen "[[:<:]](false|null|true|undef)[[:>:]]" 25 | color brightgreen "[[:<:]](self|typeof)[[:>:]]" 26 | color brightcyan "[[:<:]](as|by|else|enum|export|for|from|if|import|in|raise|rec|to|try|until|var|while)[[:>:]]" 27 | color brightcyan "[[:<:]](goto|continue|break|return|print)[[:>:]]" 28 | 29 | # Numbers 30 | 31 | # strings 32 | color brightyellow "['][^']*[^\\][']" "[']{3}.*[^\\][']{3}" 33 | color brightyellow "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}" 34 | color brightyellow start=""""[^"]" end=""""" start="'''[^']" end="'''" 35 | 36 | ## Comment highlighting 37 | color brightblue "//.*" 38 | color brightblue start="/\*" end="\*/" 39 | 40 | ## Trailing whitespace 41 | color ,green "[[:space:]]+$" 42 | -------------------------------------------------------------------------------- /media/scripts/lang/octascript/editors/vim/README.txt: -------------------------------------------------------------------------------- 1 | These are the vim syntax files for OctaScript. 2 | 3 | Install syntax/octascript.vim to $HOME/.vim/syntax/octascript.vim 4 | and ftdetect/octascript.vim to $HOME/.vim/ftdetect/octascript.vim 5 | 6 | It'll match files with a .oct extension. 7 | -------------------------------------------------------------------------------- /media/scripts/lang/octascript/editors/vim/ftdetect/octascript.vim: -------------------------------------------------------------------------------- 1 | au BufRead,BufNewFile *.oct set filetype=octascript 2 | -------------------------------------------------------------------------------- /media/scripts/lang/octascript/octascript/util.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | OctaScript 3 | 4 | Copyright (C) 2014 Daniel "q66" Kolesa 5 | 6 | See COPYING.txt for licensing. 7 | ]] 8 | 9 | local ffi = require("ffi") 10 | 11 | local M = {} 12 | 13 | M.Object = { 14 | __call = function(self, ...) 15 | local r = self:clone() 16 | if self.__ctor then self.__ctor(r, ...) end 17 | return r 18 | end, 19 | 20 | clone = function(self, tbl) 21 | tbl = tbl or {} 22 | tbl.__index, tbl.__proto, tbl.__call = self, self, self.__call 23 | setmetatable(tbl, tbl) 24 | return tbl 25 | end, 26 | } 27 | 28 | M.error = function(msg) 29 | if string.sub(msg, 1, 9) == "OFS_ERROR" then 30 | return false, "octascript: " .. string.sub(msg, 10) 31 | else 32 | error(msg) 33 | end 34 | end 35 | 36 | M.null = ffi.cast("void*", 0) 37 | 38 | return M 39 | -------------------------------------------------------------------------------- /media/scripts/lang/octascript/repl.oct: -------------------------------------------------------------------------------- 1 | // An OctaScript REPL 2 | // Part of OctaScript 3 | // Written by Daniel "q66" Kolesa 4 | // NCSA licensed 5 | 6 | import replutil 7 | import std.io 8 | import std.debug 9 | import std.eval 10 | 11 | from std.util import _VERSION 12 | 13 | func repl_header() { 14 | print e"$_VERSION REPL (interactive shell)" 15 | } 16 | 17 | func repl_traceback(msg) { 18 | msg = debug::traceback(msg, 2) 19 | return msg.find_match("^(.*stdin:%d: in main chunk).*$") || msg 20 | || "(no error message)" 21 | } 22 | 23 | from std.conv import serialize 24 | 25 | func print_ret(stat, ...) { 26 | if !(...) { 27 | return stat 28 | } 29 | var msg = [ ... ].map(\v -> serialize(v)).concat(", ") 30 | if !stat { 31 | io.stderr.write(msg, "\n\n") 32 | io.stderr.flush() 33 | } else { 34 | io::write(msg, "\n") 35 | io::flush() 36 | } 37 | return stat 38 | } 39 | 40 | func hook_interrupt() { 41 | debug::sethook() 42 | raise "interrupted!", 3 43 | } 44 | 45 | func sig_interrupt() { 46 | replutil::signal() 47 | debug::sethook(hook_interrupt, "crl", 1) 48 | } 49 | 50 | func do_call(f, ...) { 51 | replutil::signal(sig_interrupt) 52 | var rets = [ try[repl_traceback] f(...) ] 53 | replutil::signal() 54 | return rets.unpack() 55 | } 56 | 57 | func input_incomplete(ln) { 58 | return ln && ln.find_match("^.*'") != undef 59 | } 60 | 61 | func input_get_prompt(n) { 62 | return ">".rep(n) ~ " " 63 | } 64 | 65 | func input_get_line(n) { 66 | var line = replutil::readline(input_get_prompt(n)) 67 | if !line { 68 | return undef 69 | } 70 | var ln = line.len() 71 | 72 | if line.sub(ln - 1) == "\n" { 73 | line = line.sub(0, ln - 1) 74 | } 75 | return (n == 1 && line.sub(0, 1) == "=") ? 76 | ("return " ~ line.sub(1)) : line 77 | } 78 | 79 | func input_load_line() { 80 | var line = input_get_line(1) 81 | if !line { 82 | return undef 83 | } 84 | var f, err 85 | while true { 86 | var stat, ret = eval::load(line, "=stdin", "t", undef, true) 87 | if !stat { 88 | var bs = line.sub(line.len() - 1) == "\\" 89 | if !input_incomplete(ret) && !bs { 90 | f, err = undef, ret 91 | break 92 | } else if bs { 93 | line = line.sub(0, line.len() - 1) 94 | } 95 | } else { 96 | f, err = stat, ret 97 | break 98 | } 99 | var ln = input_get_line(2) 100 | if !ln { 101 | return f, err 102 | } 103 | line = line ~ "\n" ~ ln 104 | } 105 | return f, err 106 | } 107 | 108 | func repl_run() { 109 | replutil::signal() 110 | while true { 111 | var stat, msg = input_load_line() 112 | if stat { 113 | print_ret(do_call(stat)) 114 | } else { 115 | print_ret(stat, msg) 116 | } 117 | } 118 | io::write("\n") 119 | io::flush() 120 | } 121 | 122 | func dotty() { 123 | repl_header() 124 | repl_run() 125 | } 126 | 127 | try (func(argv) { 128 | if replutil::isatty() { 129 | dotty() 130 | } else { 131 | raise "only interactive REPL supported for now" 132 | } 133 | })([ ... ]) -------------------------------------------------------------------------------- /media/scripts/lang/octascript/run.lua: -------------------------------------------------------------------------------- 1 | -- OctaScript standalone main entry 2 | -- partially from lj-lang-toolkit 3 | 4 | package.path = "./?.oct;./?/init.oct;./?/init.lua;" .. package.path 5 | 6 | local bcsave = require("jit.bcsave") 7 | 8 | local std = require("octascript.stdcore") 9 | local rt = require("octascript.rt") 10 | 11 | require("octascript.stdcore.native") 12 | 13 | std.package.path = std.package.path .. ";./octascript/stdlib/?.oct" 14 | 15 | local compile = std.eval.compile 16 | local assert_run = function(ok, err) 17 | if not ok then 18 | io.stderr:write(err, "\n") 19 | os.exit(1) 20 | end 21 | return ok 22 | end 23 | 24 | local usage = function() 25 | io.stderr:write([[ 26 | OctaScript: luajit [options]... [script [args]...] 27 | 28 | Available options: 29 | -b ... Save or list bytecode. 30 | ]]) 31 | os.exit(1) 32 | end 33 | 34 | local args = { ... } 35 | local k = 1 36 | 37 | local fname 38 | while args[k] do 39 | local a = args[k] 40 | if string.sub(a, 1, 2) == "-b" then 41 | local j = 1 42 | if #a > 2 then 43 | args[j] = "-" .. string.sub(a, 3) 44 | j = j + 1 45 | else 46 | table.remove(args, j) 47 | end 48 | local fn = args[j] 49 | local f = assert_run(io.open(fn, "rb")) 50 | local tp = f:read("*all") 51 | f:close() 52 | local cname = "@" .. fn 53 | args[j] = assert_run(load(compile(cname, tp), cname, "b", rt.env)) 54 | bcsave.start(unpack(args)) 55 | os.exit(0) 56 | else 57 | if string.sub(a, 1, 1) == "-" then 58 | io.stderr:write("invalid option: ", a) 59 | usage() 60 | end 61 | fname = a 62 | break 63 | end 64 | end 65 | 66 | if not fname then usage() end 67 | local f = assert_run(io.open(fname, "rb")) 68 | local tp = f:read("*all") 69 | f:close() 70 | local lcode = compile("@" .. fname, tp) 71 | local fn = assert_run(load(lcode, "@" .. fname, "b", rt.env)) 72 | fn(arg[1], unpack(args, k + 1)) 73 | -------------------------------------------------------------------------------- /media/scripts/lang/octascript/tools/highlight/oct.lang: -------------------------------------------------------------------------------- 1 | -- OctaScript highlight langdef by Daniel "q66" Kolesa 2 | -- NCSA licensed 3 | 4 | Description="OctaScript" 5 | 6 | Digits = [[ (?:0x|0X)[0-9a-fA-F]+|\d*[\.\_]?\d+(?:[eE][\-\+]\d+)?[lLuUbfdm]* ]] 7 | 8 | Keywords = { 9 | { Id = 1, List = { 10 | "as", "break", "by", "continue", "else", "enum", "export", "false", 11 | "for", "from", "func", "goto", "if", "import", "in", "null", "print", 12 | "raise", "rec", "repeat", "return", "self", "to", "true", "try", 13 | "typeof", "undef", "until", "var", "while" 14 | } }, 15 | { Id = 2, Regex = [[@\w+]], }, 16 | { Id = 2, List = { 17 | "__add", "__call", "__concat", "__div", "__eq", "__index", "__le", 18 | "__lt", "__metatable", "__mode", "__mul", "__newindex", "__pairs", 19 | "__pow", "__sub", "__tostring", "__unm" 20 | } }, 21 | { Id = 4, Regex = [[(\w+)\s*\(]] } 22 | } 23 | 24 | Strings = { 25 | Delimiter = [["""|'''|"|']], 26 | RawPrefix = "r" 27 | } 28 | 29 | IgnoreCase = false 30 | 31 | Comments = { 32 | { Block = false, 33 | Delimiter = { [[\/\/]] }, 34 | }, 35 | { Block = true, 36 | Nested = true, 37 | Delimiter = { [[\/\*]],[[\*\/]] } 38 | } 39 | } 40 | 41 | Operators=[[\(|\)|\[|\]|\{|\}|\,|\;|\:|\&|\||\^|<|>|\!|\=|\/|\*|\%|\+|\-|.]] 42 | -------------------------------------------------------------------------------- /media/scripts/luastate.oct: -------------------------------------------------------------------------------- 1 | /**< 2 | Takes care of state consistency and refreshing. 3 | The capi patcher also injects "capi_restore" here, used to restore 4 | the C API table to its original state (so that it can be re-patched 5 | from scratch). 6 | 7 | Author: 8 | q66 9 | 10 | License: 11 | See COPYING.txt. 12 | */ 13 | 14 | // first thing we do: make a snapshot of the entire standard library 15 | // shallow is enough (modules with deep structure, such as std.package, 16 | // are not allowed within sandbox) 17 | 18 | import capi 19 | 20 | import std 21 | import std.gc 22 | import std.ffi 23 | import std.package 24 | from std.table import pairs, copy 25 | 26 | import std.geom 27 | 28 | var std_snapshot = {} 29 | for k, v in pairs(std) { 30 | std_snapshot[k] = copy(v) 31 | } 32 | 33 | // restore from a copy of snapshot 34 | func std_restore() { 35 | var loaded = package.loaded 36 | for k, v in pairs(std_snapshot) { 37 | var cp = copy(v) 38 | std[k] = cp 39 | loaded["std." ~ k] = cp 40 | } 41 | // restore ffi separately 42 | loaded["std.ffi"] = ffi 43 | // restore geom separately 44 | loaded["std.geom"] = geom 45 | } 46 | 47 | import luastate as M 48 | 49 | export func restore() { 50 | var loaded = package.loaded 51 | // go over loaded, erase everything except some 52 | var capi, std, lstate = loaded["capi"], loaded["std"], loaded["luastate"] 53 | for k, v in pairs(loaded) { 54 | loaded[k] = undef 55 | } 56 | loaded["capi"] = capi 57 | loaded["std"] = std 58 | loaded["luastate"] = lstate 59 | // cleanup std contents (in case something injected extra stuff in there) 60 | for k, v in pairs(std) { 61 | std[k] = undef 62 | } 63 | std_restore() 64 | M::capi_restore() 65 | capi::reload_core() 66 | // erase any remains of old stuff 67 | gc::collect() 68 | } -------------------------------------------------------------------------------- /media/sky/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/sky/empty.txt -------------------------------------------------------------------------------- /media/sound/gk/jump2.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/sound/gk/jump2.ogg -------------------------------------------------------------------------------- /media/sound/olpc/AdamKeshen/BeatBoxCHIK.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/sound/olpc/AdamKeshen/BeatBoxCHIK.wav -------------------------------------------------------------------------------- /media/sound/olpc/AdamKeshen/kik.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/sound/olpc/AdamKeshen/kik.wav -------------------------------------------------------------------------------- /media/sound/yo_frankie/DeathFlash.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/sound/yo_frankie/DeathFlash.wav -------------------------------------------------------------------------------- /media/sound/yo_frankie/amb_waterdrip_2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/sound/yo_frankie/amb_waterdrip_2.wav -------------------------------------------------------------------------------- /media/sound/yo_frankie/watersplash2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/sound/yo_frankie/watersplash2.wav -------------------------------------------------------------------------------- /media/texture/core/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/1024.png -------------------------------------------------------------------------------- /media/texture/core/1024i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/1024i.png -------------------------------------------------------------------------------- /media/texture/core/1024n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/1024n.png -------------------------------------------------------------------------------- /media/texture/core/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/128.png -------------------------------------------------------------------------------- /media/texture/core/128i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/128i.png -------------------------------------------------------------------------------- /media/texture/core/128n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/128n.png -------------------------------------------------------------------------------- /media/texture/core/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/16.png -------------------------------------------------------------------------------- /media/texture/core/16i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/16i.png -------------------------------------------------------------------------------- /media/texture/core/16n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/16n.png -------------------------------------------------------------------------------- /media/texture/core/2048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/2048.png -------------------------------------------------------------------------------- /media/texture/core/2048i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/2048i.png -------------------------------------------------------------------------------- /media/texture/core/2048n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/2048n.png -------------------------------------------------------------------------------- /media/texture/core/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/256.png -------------------------------------------------------------------------------- /media/texture/core/256i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/256i.png -------------------------------------------------------------------------------- /media/texture/core/256n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/256n.png -------------------------------------------------------------------------------- /media/texture/core/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/32.png -------------------------------------------------------------------------------- /media/texture/core/32i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/32i.png -------------------------------------------------------------------------------- /media/texture/core/32n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/32n.png -------------------------------------------------------------------------------- /media/texture/core/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/512.png -------------------------------------------------------------------------------- /media/texture/core/512i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/512i.png -------------------------------------------------------------------------------- /media/texture/core/512n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/512n.png -------------------------------------------------------------------------------- /media/texture/core/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/64.png -------------------------------------------------------------------------------- /media/texture/core/64i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/64i.png -------------------------------------------------------------------------------- /media/texture/core/64n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/64n.png -------------------------------------------------------------------------------- /media/texture/core/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/8.png -------------------------------------------------------------------------------- /media/texture/core/8i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/8i.png -------------------------------------------------------------------------------- /media/texture/core/8n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/8n.png -------------------------------------------------------------------------------- /media/texture/core/core.tex: -------------------------------------------------------------------------------- 1 | setshader bumpworld 2 | 3 | texture c core/256.png 0 0 0 2 4 | texture n core/256n.png 5 | 6 | texture c core/256.png 0 0 0 2 7 | texture n core/256n.png 8 | 9 | texture c core/256.png 0 0 0 2 10 | texture n core/256n.png 11 | 12 | texture c core/128.png 0 0 0 2 13 | texture n core/128n.png 14 | 15 | texture c core/64.png 0 0 0 2 16 | texture n core/64n.png 17 | 18 | texture c core/32.png 0 0 0 2 19 | texture n core/32n.png 20 | 21 | texture c core/16.png 0 0 0 2 22 | texture n core/16n.png 23 | 24 | texture c core/8.png 0 0 0 2 25 | texture n core/8n.png 26 | 27 | texture c core/256i.png 0 0 0 2 28 | texture n core/256n.png 29 | 30 | texture c core/128i.png 0 0 0 2 31 | texture n core/128n.png 32 | 33 | texture c core/64i.png 0 0 0 2 34 | texture n core/64n.png 35 | 36 | texture c core/32i.png 0 0 0 2 37 | texture n core/32n.png 38 | 39 | texture c core/16i.png 0 0 0 2 40 | texture n core/16n.png 41 | 42 | texture c core/8i.png 0 0 0 2 43 | texture n core/8n.png 44 | 45 | texture c core/512.png 0 0 0 2 46 | texture n core/512n.png 47 | 48 | texture c core/1024.png 0 0 0 2 49 | texture n core/1024n.png 50 | 51 | texture c core/2048.png 0 0 0 2 52 | texture n core/2048n.png 53 | 54 | texture c core/512i.png 0 0 0 2 55 | texture n core/512n.png 56 | 57 | texture c core/1024i.png 0 0 0 2 58 | texture n core/1024n.png 59 | 60 | texture c core/2048i.png 0 0 0 2 61 | texture n core/2048n.png 62 | -------------------------------------------------------------------------------- /media/texture/core/default.tex: -------------------------------------------------------------------------------- 1 | texture c core/defsky.png 2 | 3 | setshader bumpworld 4 | 5 | texture c core/256.png 0 0 0 2 6 | texture n core/256n.png -------------------------------------------------------------------------------- /media/texture/core/defsky.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/core/defsky.png -------------------------------------------------------------------------------- /media/texture/core/license.txt: -------------------------------------------------------------------------------- 1 | water normal and dudv: 2 | Gregor Koch (cronos) 3 | 4 | rest: 5 | authors: Spiney, q66 6 | 7 | License: Creative Commons Attribution (CC BY) - http://creativecommons.org/licenses/by/3.0/ 8 | 9 | Font used in dev textures is Terminus, which is licensed under SIL Open Font License 1.1 10 | (http://scripts.sil.org/OFL) 11 | -------------------------------------------------------------------------------- /media/texture/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/default.png -------------------------------------------------------------------------------- /media/texture/material/default/glass.mat: -------------------------------------------------------------------------------- 1 | loop+ i 1 4 [ 2 | materialreset [glass@i] 3 | texture [glass@i] "material/default/glass/glass_normal.png" // Glass Normals 4 | ] -------------------------------------------------------------------------------- /media/texture/material/default/glass/cross-noise_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/glass/cross-noise_normal.png -------------------------------------------------------------------------------- /media/texture/material/default/glass/glass2_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/glass/glass2_normal.png -------------------------------------------------------------------------------- /media/texture/material/default/glass/glass_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/glass/glass_normal.png -------------------------------------------------------------------------------- /media/texture/material/default/glass/noise_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/glass/noise_normal.png -------------------------------------------------------------------------------- /media/texture/material/default/glass/subtle_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/glass/subtle_normal.png -------------------------------------------------------------------------------- /media/texture/material/default/glass/vertical-noise_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/glass/vertical-noise_normal.png -------------------------------------------------------------------------------- /media/texture/material/default/lava.mat: -------------------------------------------------------------------------------- 1 | loop+ i 1 4 [ 2 | materialreset [lava@i] 3 | texture [lava@i] "material/default/lava/lava.png" // Lava Diffuse 4 | texture 1 "material/default/water/water_normal.png" // Lava Normals 5 | texture 1 "material/default/lava/lava.png" // Lavafall Diffuse 6 | texture 1 "material/default/water/waterfall_normal.png" // Lavafall Normals 7 | ] -------------------------------------------------------------------------------- /media/texture/material/default/lava/lava.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/lava/lava.png -------------------------------------------------------------------------------- /media/texture/material/default/water.mat: -------------------------------------------------------------------------------- 1 | loop+ i 1 4 [ 2 | materialreset [water@i] 3 | texture [water@i] "material/default/water/water.png" // Water Diffuse (Unused) 4 | texture 1 "material/default/water/water_normal.png" // Water Normals 5 | texture 1 "material/default/water/waterfall.png" // Waterfall Diffuse 6 | texture 1 "material/default/water/waterfall_normal.png" // Waterfall Normals 7 | ] -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust00.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust01.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust02.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust03.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust04.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust05.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust06.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust07.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust08.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust09.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust10.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust11.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust12.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust13.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust14.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust15.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust16.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust17.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust18.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust19.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust20.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust21.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust22.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust23.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust24.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust25.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust26.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust27.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust27.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust28.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust29.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust30.png -------------------------------------------------------------------------------- /media/texture/material/default/water/caustic/caust31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/caustic/caust31.png -------------------------------------------------------------------------------- /media/texture/material/default/water/water.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/water.png -------------------------------------------------------------------------------- /media/texture/material/default/water/water_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/water_normal.png -------------------------------------------------------------------------------- /media/texture/material/default/water/waterfall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/waterfall.png -------------------------------------------------------------------------------- /media/texture/material/default/water/waterfall_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/material/default/water/waterfall_normal.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern019.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern019.tex: -------------------------------------------------------------------------------- 1 | setshader bumpspecmapworld 2 | setshaderparam "specscale" 1.0 1.0 1.0 3 | texture 0ns nobiax/pattern019 -------------------------------------------------------------------------------- /media/texture/nobiax/pattern019_n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern019_n.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern019_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern019_s.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern037.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern037.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern037.tex: -------------------------------------------------------------------------------- 1 | setshader bumpenvspecmapworld 2 | setshaderparam "specscale" 1.0 1.0 1.0 3 | setshaderparam "envscale" 2.0 2.0 2.0 4 | texture 0ns nobiax/pattern037 -------------------------------------------------------------------------------- /media/texture/nobiax/pattern037_n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern037_n.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern037_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern037_s.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern042.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern042.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern042.tex: -------------------------------------------------------------------------------- 1 | setshader bumpspecmapworld 2 | setshaderparam "specscale" 1.0 1.0 1.0 3 | texture 0ns nobiax/pattern042 -------------------------------------------------------------------------------- /media/texture/nobiax/pattern042_n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern042_n.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern042_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern042_s.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern044.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern044.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern044.tex: -------------------------------------------------------------------------------- 1 | setshader bumpspecmapworld 2 | setshaderparam "specscale" 0.1 0.1 0.1 3 | texture 0ns nobiax/pattern044 -------------------------------------------------------------------------------- /media/texture/nobiax/pattern044_n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern044_n.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern044_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern044_s.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern045.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern045.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern045.tex: -------------------------------------------------------------------------------- 1 | setshader bumpspecmapworld 2 | setshaderparam "specscale" 0.2 0.2 0.2 3 | texture 0ns nobiax/pattern045 -------------------------------------------------------------------------------- /media/texture/nobiax/pattern045_n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern045_n.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern045_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern045_s.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern047.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern047.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern047.tex: -------------------------------------------------------------------------------- 1 | setshader bumpspecmapworld 2 | setshaderparam "specscale" 0.5 0.5 0.5 3 | texture 0ns nobiax/pattern047 -------------------------------------------------------------------------------- /media/texture/nobiax/pattern047_n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern047_n.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern047_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern047_s.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern049.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern049.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern049.tex: -------------------------------------------------------------------------------- 1 | setshader bumpspecmapworld 2 | setshaderparam "specscale" 1.0 1.0 1.0 3 | texture 0ns nobiax/pattern049 -------------------------------------------------------------------------------- /media/texture/nobiax/pattern049_n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern049_n.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern049_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern049_s.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern055.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern055.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern055.tex: -------------------------------------------------------------------------------- 1 | setshader bumpspecmapworld 2 | setshaderparam "specscale" 1.0 1.0 1.0 3 | texture 0ns nobiax/pattern055 -------------------------------------------------------------------------------- /media/texture/nobiax/pattern055_n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern055_n.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern055_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern055_s.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern056.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern056.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern056.tex: -------------------------------------------------------------------------------- 1 | setshader bumpenvspecmapworld 2 | setshaderparam "specscale" 1.0 1.0 1.0 3 | setshaderparam "envscale" 0.5 0.55 0.6 4 | texture 0ns nobiax/pattern056 -------------------------------------------------------------------------------- /media/texture/nobiax/pattern056_n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern056_n.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern056_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern056_s.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern057.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern057.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern057.tex: -------------------------------------------------------------------------------- 1 | setshader bumpenvspecmapworld 2 | setshaderparam "specscale" 1.0 1.0 1.0 3 | setshaderparam "envscale" 0.5 0.55 0.6 4 | texture 0ns nobiax/pattern057 -------------------------------------------------------------------------------- /media/texture/nobiax/pattern057_n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern057_n.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern057_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern057_s.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern205.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern205.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern205.tex: -------------------------------------------------------------------------------- 1 | setshader bumpspecmapworld 2 | setshaderparam "specscale" 1.0 1.0 1.0 3 | texture 0ns nobiax/pattern205 -------------------------------------------------------------------------------- /media/texture/nobiax/pattern205_n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern205_n.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern205_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern205_s.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern208.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern208.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern208.tex: -------------------------------------------------------------------------------- 1 | setshader bumpspecmapworld 2 | setshaderparam "specscale" 1.0 1.0 1.0 3 | texture 0ns nobiax/pattern208 -------------------------------------------------------------------------------- /media/texture/nobiax/pattern208_n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern208_n.png -------------------------------------------------------------------------------- /media/texture/nobiax/pattern208_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/nobiax/pattern208_s.png -------------------------------------------------------------------------------- /media/texture/notexture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/media/texture/notexture.png -------------------------------------------------------------------------------- /octaforge.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | OS=$(uname -s) 4 | ARCH=$(uname -m) 5 | 6 | BIN_OS= 7 | BIN_ARCH= 8 | BIN_DATA=. 9 | BIN_DIR=bin_unix 10 | 11 | case $OS in 12 | Linux) 13 | BIN_OS=linux 14 | ;; 15 | FreeBSD) 16 | BIN_OS=freebsd 17 | ;; 18 | Darwin) 19 | BIN_OS=darwin 20 | ;; 21 | esac 22 | 23 | case $ARCH in 24 | i486|i586|i686) 25 | BIN_ARCH=x86 26 | ;; 27 | x86_64|amd64) 28 | BIN_ARCH=x64 29 | ;; 30 | esac 31 | 32 | if [ -x ${BIN_DATA}/${BIN_DIR}/client_${BIN_OS}_${BIN_ARCH} ]; then 33 | cd ${BIN_DATA} 34 | exec ${BIN_DIR}/client_${BIN_OS}_${BIN_ARCH} $@ 35 | else 36 | echo "You don't have a binary client for ${OS}/${ARCH}." 37 | echo "Either get precompiled binaries (if available) or compile it" 38 | echo "yourself using the instructions written in INSTALL.txt." 39 | exit 1 40 | fi -------------------------------------------------------------------------------- /src/enet/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2015 Lee Salzman 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /src/enet/README.txt: -------------------------------------------------------------------------------- 1 | This is ENet from http://enet.bespin.org meant for 2 | distribution with the OctaForge game engine. 3 | 4 | Does not contain build system. 5 | -------------------------------------------------------------------------------- /src/enet/callbacks.c: -------------------------------------------------------------------------------- 1 | /** 2 | @file callbacks.c 3 | @brief ENet callback functions 4 | */ 5 | #define ENET_BUILDING_LIB 1 6 | #include "enet/enet.h" 7 | 8 | static ENetCallbacks callbacks = { malloc, free, abort }; 9 | 10 | int 11 | enet_initialize_with_callbacks (ENetVersion version, const ENetCallbacks * inits) 12 | { 13 | if (version < ENET_VERSION_CREATE (1, 3, 0)) 14 | return -1; 15 | 16 | if (inits -> malloc != NULL || inits -> free != NULL) 17 | { 18 | if (inits -> malloc == NULL || inits -> free == NULL) 19 | return -1; 20 | 21 | callbacks.malloc = inits -> malloc; 22 | callbacks.free = inits -> free; 23 | } 24 | 25 | if (inits -> no_memory != NULL) 26 | callbacks.no_memory = inits -> no_memory; 27 | 28 | return enet_initialize (); 29 | } 30 | 31 | ENetVersion 32 | enet_linked_version (void) 33 | { 34 | return ENET_VERSION; 35 | } 36 | 37 | void * 38 | enet_malloc (size_t size) 39 | { 40 | void * memory = callbacks.malloc (size); 41 | 42 | if (memory == NULL) 43 | callbacks.no_memory (); 44 | 45 | return memory; 46 | } 47 | 48 | void 49 | enet_free (void * memory) 50 | { 51 | callbacks.free (memory); 52 | } 53 | 54 | -------------------------------------------------------------------------------- /src/enet/check_cflags.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ENet cflags detection for unix by Daniel 'q66' Kolesa 3 | # I hereby put this file into public domain, use as you wish 4 | 5 | CC=$* 6 | 7 | cat << EOF > check_func.c 8 | void TEST_FUN(); 9 | int main() { TEST_FUN(); return 0; } 10 | EOF 11 | cat << EOF > check_member.c 12 | #include "check_member.h" 13 | static void pass() {} 14 | int main() { struct TEST_STRUCT test; pass(test.TEST_FIELD); return 0; } 15 | EOF 16 | cat << EOF > check_type.c 17 | #include "check_type.h" 18 | int main() { TEST_TYPE test; return 0; } 19 | EOF 20 | 21 | CHECK_FUNC() { 22 | $CC check_func.c -DTEST_FUN=$1 -o check_func 2>/dev/null 23 | if [ $? -eq 0 ]; then printf " $2"; rm check_func; fi 24 | } 25 | 26 | CHECK_FUNC getaddrinfo -DHAS_GETADDRINFO 27 | CHECK_FUNC getnameinfo -DHAS_GETNAMEINFO 28 | CHECK_FUNC gethostbyaddr_r -DHAS_GETHOSTBYADDR_R 29 | CHECK_FUNC gethostbyname_r -DHAS_GETHOSTBYNAME_R 30 | CHECK_FUNC poll -DHAS_POLL 31 | CHECK_FUNC fcntl -DHAS_FCNTL 32 | CHECK_FUNC inet_pton -DHAS_INET_PTON 33 | CHECK_FUNC inet_ntop -DHAS_INET_NTOP 34 | 35 | echo "#include " > check_member.h 36 | $CC check_member.c -DTEST_STRUCT=msghdr -DTEST_FIELD=msg_flags \ 37 | -o check_member 2>/dev/null 38 | if [ $? -eq 0 ]; then printf " -DHAS_MSGHDR_FLAGS"; rm check_member; fi 39 | rm check_member.h 40 | 41 | echo "#include " > check_type.h 42 | echo "#include " >> check_type.h 43 | $CC check_type.c -DTEST_TYPE=socklen_t -o check_type 2>/dev/null 44 | if [ $? -eq 0 ]; then printf " -DHAS_SOCKLEN_T"; rm check_type; fi 45 | rm check_type.h 46 | 47 | echo '' 48 | rm check_func.c 49 | rm check_member.c 50 | rm check_type.c 51 | -------------------------------------------------------------------------------- /src/enet/include/enet/callbacks.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file callbacks.h 3 | @brief ENet callbacks 4 | */ 5 | #ifndef __ENET_CALLBACKS_H__ 6 | #define __ENET_CALLBACKS_H__ 7 | 8 | #include 9 | 10 | typedef struct _ENetCallbacks 11 | { 12 | void * (ENET_CALLBACK * malloc) (size_t size); 13 | void (ENET_CALLBACK * free) (void * memory); 14 | void (ENET_CALLBACK * no_memory) (void); 15 | } ENetCallbacks; 16 | 17 | /** @defgroup callbacks ENet internal callbacks 18 | @{ 19 | @ingroup private 20 | */ 21 | extern void * enet_malloc (size_t); 22 | extern void enet_free (void *); 23 | 24 | /** @} */ 25 | 26 | #endif /* __ENET_CALLBACKS_H__ */ 27 | 28 | -------------------------------------------------------------------------------- /src/enet/include/enet/list.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file list.h 3 | @brief ENet list management 4 | */ 5 | #ifndef __ENET_LIST_H__ 6 | #define __ENET_LIST_H__ 7 | 8 | #include 9 | 10 | typedef struct _ENetListNode 11 | { 12 | struct _ENetListNode * next; 13 | struct _ENetListNode * previous; 14 | } ENetListNode; 15 | 16 | typedef ENetListNode * ENetListIterator; 17 | 18 | typedef struct _ENetList 19 | { 20 | ENetListNode sentinel; 21 | } ENetList; 22 | 23 | extern void enet_list_clear (ENetList *); 24 | 25 | extern ENetListIterator enet_list_insert (ENetListIterator, void *); 26 | extern void * enet_list_remove (ENetListIterator); 27 | extern ENetListIterator enet_list_move (ENetListIterator, void *, void *); 28 | 29 | extern size_t enet_list_size (ENetList *); 30 | 31 | #define enet_list_begin(list) ((list) -> sentinel.next) 32 | #define enet_list_end(list) (& (list) -> sentinel) 33 | 34 | #define enet_list_empty(list) (enet_list_begin (list) == enet_list_end (list)) 35 | 36 | #define enet_list_next(iterator) ((iterator) -> next) 37 | #define enet_list_previous(iterator) ((iterator) -> previous) 38 | 39 | #define enet_list_front(list) ((void *) (list) -> sentinel.next) 40 | #define enet_list_back(list) ((void *) (list) -> sentinel.previous) 41 | 42 | #endif /* __ENET_LIST_H__ */ 43 | 44 | -------------------------------------------------------------------------------- /src/enet/include/enet/time.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file time.h 3 | @brief ENet time constants and macros 4 | */ 5 | #ifndef __ENET_TIME_H__ 6 | #define __ENET_TIME_H__ 7 | 8 | #define ENET_TIME_OVERFLOW 86400000 9 | 10 | #define ENET_TIME_LESS(a, b) ((a) - (b) >= ENET_TIME_OVERFLOW) 11 | #define ENET_TIME_GREATER(a, b) ((b) - (a) >= ENET_TIME_OVERFLOW) 12 | #define ENET_TIME_LESS_EQUAL(a, b) (! ENET_TIME_GREATER (a, b)) 13 | #define ENET_TIME_GREATER_EQUAL(a, b) (! ENET_TIME_LESS (a, b)) 14 | 15 | #define ENET_TIME_DIFFERENCE(a, b) ((a) - (b) >= ENET_TIME_OVERFLOW ? (b) - (a) : (a) - (b)) 16 | 17 | #endif /* __ENET_TIME_H__ */ 18 | 19 | -------------------------------------------------------------------------------- /src/enet/include/enet/types.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file types.h 3 | @brief type definitions for ENet 4 | */ 5 | #ifndef __ENET_TYPES_H__ 6 | #define __ENET_TYPES_H__ 7 | 8 | typedef unsigned char enet_uint8; /**< unsigned 8-bit type */ 9 | typedef unsigned short enet_uint16; /**< unsigned 16-bit type */ 10 | typedef unsigned int enet_uint32; /**< unsigned 32-bit type */ 11 | 12 | #endif /* __ENET_TYPES_H__ */ 13 | 14 | -------------------------------------------------------------------------------- /src/enet/include/enet/unix.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file unix.h 3 | @brief ENet Unix header 4 | */ 5 | #ifndef __ENET_UNIX_H__ 6 | #define __ENET_UNIX_H__ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #ifdef MSG_MAXIOVLEN 16 | #define ENET_BUFFER_MAXIMUM MSG_MAXIOVLEN 17 | #endif 18 | 19 | typedef int ENetSocket; 20 | 21 | #define ENET_SOCKET_NULL -1 22 | 23 | #define ENET_HOST_TO_NET_16(value) (htons (value)) /**< macro that converts host to net byte-order of a 16-bit value */ 24 | #define ENET_HOST_TO_NET_32(value) (htonl (value)) /**< macro that converts host to net byte-order of a 32-bit value */ 25 | 26 | #define ENET_NET_TO_HOST_16(value) (ntohs (value)) /**< macro that converts net to host byte-order of a 16-bit value */ 27 | #define ENET_NET_TO_HOST_32(value) (ntohl (value)) /**< macro that converts net to host byte-order of a 32-bit value */ 28 | 29 | typedef struct 30 | { 31 | void * data; 32 | size_t dataLength; 33 | } ENetBuffer; 34 | 35 | #define ENET_CALLBACK 36 | 37 | #define ENET_API extern 38 | 39 | typedef fd_set ENetSocketSet; 40 | 41 | #define ENET_SOCKETSET_EMPTY(sockset) FD_ZERO (& (sockset)) 42 | #define ENET_SOCKETSET_ADD(sockset, socket) FD_SET (socket, & (sockset)) 43 | #define ENET_SOCKETSET_REMOVE(sockset, socket) FD_CLR (socket, & (sockset)) 44 | #define ENET_SOCKETSET_CHECK(sockset, socket) FD_ISSET (socket, & (sockset)) 45 | 46 | #endif /* __ENET_UNIX_H__ */ 47 | 48 | -------------------------------------------------------------------------------- /src/enet/include/enet/utility.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file utility.h 3 | @brief ENet utility header 4 | */ 5 | #ifndef __ENET_UTILITY_H__ 6 | #define __ENET_UTILITY_H__ 7 | 8 | #define ENET_MAX(x, y) ((x) > (y) ? (x) : (y)) 9 | #define ENET_MIN(x, y) ((x) < (y) ? (x) : (y)) 10 | 11 | #endif /* __ENET_UTILITY_H__ */ 12 | 13 | -------------------------------------------------------------------------------- /src/enet/include/enet/win32.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file win32.h 3 | @brief ENet Win32 header 4 | */ 5 | #ifndef __ENET_WIN32_H__ 6 | #define __ENET_WIN32_H__ 7 | 8 | #ifdef _MSC_VER 9 | #ifdef ENET_BUILDING_LIB 10 | #pragma warning (disable: 4267) // size_t to int conversion 11 | #pragma warning (disable: 4244) // 64bit to 32bit int 12 | #pragma warning (disable: 4018) // signed/unsigned mismatch 13 | #pragma warning (disable: 4146) // unary minus operator applied to unsigned type 14 | #endif 15 | #endif 16 | 17 | #include 18 | #include 19 | 20 | typedef SOCKET ENetSocket; 21 | 22 | #define ENET_SOCKET_NULL INVALID_SOCKET 23 | 24 | #define ENET_HOST_TO_NET_16(value) (htons (value)) 25 | #define ENET_HOST_TO_NET_32(value) (htonl (value)) 26 | 27 | #define ENET_NET_TO_HOST_16(value) (ntohs (value)) 28 | #define ENET_NET_TO_HOST_32(value) (ntohl (value)) 29 | 30 | typedef struct 31 | { 32 | size_t dataLength; 33 | void * data; 34 | } ENetBuffer; 35 | 36 | #define ENET_CALLBACK __cdecl 37 | 38 | #ifdef ENET_DLL 39 | #ifdef ENET_BUILDING_LIB 40 | #define ENET_API __declspec( dllexport ) 41 | #else 42 | #define ENET_API __declspec( dllimport ) 43 | #endif /* ENET_BUILDING_LIB */ 44 | #else /* !ENET_DLL */ 45 | #define ENET_API extern 46 | #endif /* ENET_DLL */ 47 | 48 | typedef fd_set ENetSocketSet; 49 | 50 | #define ENET_SOCKETSET_EMPTY(sockset) FD_ZERO (& (sockset)) 51 | #define ENET_SOCKETSET_ADD(sockset, socket) FD_SET (socket, & (sockset)) 52 | #define ENET_SOCKETSET_REMOVE(sockset, socket) FD_CLR (socket, & (sockset)) 53 | #define ENET_SOCKETSET_CHECK(sockset, socket) FD_ISSET (socket, & (sockset)) 54 | 55 | #endif /* __ENET_WIN32_H__ */ 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/enet/list.c: -------------------------------------------------------------------------------- 1 | /** 2 | @file list.c 3 | @brief ENet linked list functions 4 | */ 5 | #define ENET_BUILDING_LIB 1 6 | #include "enet/enet.h" 7 | 8 | /** 9 | @defgroup list ENet linked list utility functions 10 | @ingroup private 11 | @{ 12 | */ 13 | void 14 | enet_list_clear (ENetList * list) 15 | { 16 | list -> sentinel.next = & list -> sentinel; 17 | list -> sentinel.previous = & list -> sentinel; 18 | } 19 | 20 | ENetListIterator 21 | enet_list_insert (ENetListIterator position, void * data) 22 | { 23 | ENetListIterator result = (ENetListIterator) data; 24 | 25 | result -> previous = position -> previous; 26 | result -> next = position; 27 | 28 | result -> previous -> next = result; 29 | position -> previous = result; 30 | 31 | return result; 32 | } 33 | 34 | void * 35 | enet_list_remove (ENetListIterator position) 36 | { 37 | position -> previous -> next = position -> next; 38 | position -> next -> previous = position -> previous; 39 | 40 | return position; 41 | } 42 | 43 | ENetListIterator 44 | enet_list_move (ENetListIterator position, void * dataFirst, void * dataLast) 45 | { 46 | ENetListIterator first = (ENetListIterator) dataFirst, 47 | last = (ENetListIterator) dataLast; 48 | 49 | first -> previous -> next = last -> next; 50 | last -> next -> previous = first -> previous; 51 | 52 | first -> previous = position -> previous; 53 | last -> next = position; 54 | 55 | first -> previous -> next = first; 56 | position -> previous = last; 57 | 58 | return first; 59 | } 60 | 61 | size_t 62 | enet_list_size (ENetList * list) 63 | { 64 | size_t size = 0; 65 | ENetListIterator position; 66 | 67 | for (position = enet_list_begin (list); 68 | position != enet_list_end (list); 69 | position = enet_list_next (position)) 70 | ++ size; 71 | 72 | return size; 73 | } 74 | 75 | /** @} */ 76 | -------------------------------------------------------------------------------- /src/history.txt: -------------------------------------------------------------------------------- 1 | Current upstream version of /enet, /engine and /shared: Sauerbraten SVN (in sync) + improvements from Sauerbraten Enhanced 2 | -------------------------------------------------------------------------------- /src/octa/engine/light.hh: -------------------------------------------------------------------------------- 1 | struct PackNode 2 | { 3 | PackNode *child1, *child2; 4 | ushort x, y, w, h; 5 | int available; 6 | 7 | PackNode(ushort x, ushort y, ushort w, ushort h) : child1(0), child2(0), x(x), y(y), w(w), h(h), available(min(w, h)) {} 8 | 9 | void discardchildren() 10 | { 11 | DELETEP(child1); 12 | DELETEP(child2); 13 | } 14 | 15 | void forceempty() 16 | { 17 | discardchildren(); 18 | available = 0; 19 | } 20 | 21 | void reset() 22 | { 23 | discardchildren(); 24 | available = min(w, h); 25 | } 26 | 27 | bool resize(int nw, int nh) 28 | { 29 | if(w == nw && h == nw) return false; 30 | discardchildren(); 31 | w = nw; 32 | h = nh; 33 | available = min(w, h); 34 | return true; 35 | } 36 | 37 | ~PackNode() 38 | { 39 | discardchildren(); 40 | } 41 | 42 | bool insert(ushort &tx, ushort &ty, ushort tw, ushort th); 43 | void reserve(ushort tx, ushort ty, ushort tw, ushort th); 44 | }; 45 | 46 | extern bvec ambient, skylight, sunlight; 47 | extern float ambientscale, skylightscale, sunlightscale; 48 | extern float sunlightyaw, sunlightpitch; 49 | extern vec sunlightdir; 50 | extern int fullbright, fullbrightlevel; 51 | 52 | extern void clearlights(); 53 | extern void initlights(); 54 | extern void clearlightcache(int id = -1); 55 | extern void brightencube(cube &c); 56 | extern void setsurfaces(cube &c, const surfaceinfo *surfs, const vertinfo *verts, int numverts); 57 | extern void setsurface(cube &c, int orient, const surfaceinfo &surf, const vertinfo *verts, int numverts); 58 | extern void previewblends(const ivec &bo, const ivec &bs); 59 | 60 | extern void calcnormals(bool lerptjoints = false); 61 | extern void clearnormals(); 62 | extern void resetsmoothgroups(); 63 | extern int smoothangle(int id, int angle); 64 | extern void findnormal(const vec &key, int smooth, const vec &surface, vec &v); 65 | 66 | #define CHECK_CALCLIGHT_PROGRESS_LOCKED(exit, show_calclight_progress, before, after) \ 67 | if(check_calclight_progress) \ 68 | { \ 69 | if(!calclight_canceled) \ 70 | { \ 71 | before; \ 72 | show_calclight_progress(); \ 73 | check_calclight_canceled(); \ 74 | after; \ 75 | } \ 76 | if(calclight_canceled) { exit; } \ 77 | } 78 | #define CHECK_CALCLIGHT_PROGRESS(exit, show_calclight_progress) CHECK_CALCLIGHT_PROGRESS_LOCKED(exit, show_calclight_progress, , ) 79 | 80 | extern bool calclight_canceled; 81 | extern volatile bool check_calclight_progress; 82 | 83 | extern void check_calclight_canceled(); 84 | 85 | extern const vector &checklightcache(int x, int y); 86 | 87 | -------------------------------------------------------------------------------- /src/octa/engine/world.hh: -------------------------------------------------------------------------------- 1 | 2 | enum // hardcoded texture numbers 3 | { 4 | DEFAULT_SKY = 0, 5 | DEFAULT_GEOM, 6 | NUMDEFAULTSLOTS 7 | }; 8 | 9 | #define TMAPVERSION 1 10 | 11 | struct tmapheader 12 | { 13 | char magic[4]; // "TMAP" 14 | int version; // any >8bit quantity is little endian 15 | int headersize; // sizeof(header) 16 | int worldsize; 17 | int numents; 18 | int numpvs; 19 | int blendmap; 20 | int numvars; 21 | int numvslots; 22 | }; 23 | 24 | #define MAPVERSION 1 // bump if map format changes, see worldio.cpp 25 | 26 | struct mapheader 27 | { 28 | char magic[4]; // "TMAP" 29 | int version; // any >8bit quantity is little endian 30 | int headersize; // sizeof(header) 31 | int worldsize; 32 | int numpvs; 33 | int blendmap; 34 | int numvars; 35 | int numvslots; 36 | }; 37 | 38 | #define WATER_AMPLITUDE 0.4f 39 | #define WATER_OFFSET 1.1f 40 | 41 | enum 42 | { 43 | MATSURF_NOT_VISIBLE = 0, 44 | MATSURF_VISIBLE, 45 | MATSURF_EDIT_ONLY 46 | }; 47 | 48 | /* OF */ 49 | extern int texdefscale; 50 | #define TEX_SCALE texdefscale 51 | 52 | struct vertex { vec pos; bvec4 norm; vec tc; bvec4 tangent; }; 53 | 54 | -------------------------------------------------------------------------------- /src/octa/game/render.cc: -------------------------------------------------------------------------------- 1 | #include "game.hh" 2 | 3 | namespace game 4 | { 5 | VARP(ragdoll, 0, 1, 1); 6 | VARP(ragdollmillis, 0, 10000, 300000); 7 | VARP(ragdollfade, 0, 100, 5000); 8 | 9 | vector ragdolls; 10 | 11 | CLUAICOMMAND(ragdoll_save, bool, (int cn), { 12 | gameent *d = getclient(cn); 13 | assert(d); 14 | if(!d->ragdoll || !ragdollmillis || (!ragdollfade && lastmillis > d->lastdeath + ragdollmillis)) return false; 15 | gameent *r = new gameent(*d); 16 | r->lastupdate = ragdollfade && lastmillis > d->lastdeath + max(ragdollmillis - ragdollfade, 0) ? lastmillis - max(ragdollmillis - ragdollfade, 0) : d->lastdeath; 17 | r->edit = NULL; 18 | r->ai = NULL; 19 | ragdolls.add(r); 20 | d->ragdoll = NULL; 21 | return true; 22 | }); 23 | 24 | CLUAICOMMAND(ragdoll_clean, void, (int cn), { 25 | gameent *d = getclient(cn); 26 | assert(d); 27 | if (d->ragdoll) cleanragdoll(d); 28 | }) 29 | 30 | void clearragdolls() { 31 | ragdolls.deletecontents(); 32 | } 33 | 34 | CLUAICOMMAND(ragdolls_clear, void, (), clearragdolls();); 35 | 36 | void moveragdolls() { 37 | loopv(ragdolls) 38 | { 39 | gameent *d = ragdolls[i]; 40 | if(lastmillis > d->lastupdate + ragdollmillis) 41 | { 42 | delete ragdolls.remove(i--); 43 | continue; 44 | } 45 | moveragdoll(d); 46 | } 47 | } 48 | 49 | CLUAICOMMAND(ragdolls_move, void, (), moveragdolls();); 50 | 51 | VARP(playerfpsshadow, 0, 1, 1); 52 | 53 | void rendergame() 54 | { 55 | bool tp = isthirdperson(); 56 | lua::L->call_external("game_render", "bb", tp, !tp && playerfpsshadow); 57 | } 58 | 59 | void renderavatar() 60 | { 61 | lua::L->call_external("game_render_hud", ""); 62 | } 63 | } 64 | 65 | -------------------------------------------------------------------------------- /src/octa/gui/gui.hh: -------------------------------------------------------------------------------- 1 | /* The GUI subsystem of OctaForge - primary include file 2 | * 3 | * This file is part of OctaForge. See COPYING.md for futher information. 4 | */ 5 | 6 | #ifndef OCTA_GUI_GUI_HH 7 | #define OCTA_GUI_GUI_HH 8 | 9 | #include 10 | 11 | #endif -------------------------------------------------------------------------------- /src/octa/octaforge/of_logger.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * of_logger.cpp, version 1 3 | * Logging facilities for OctaForge. 4 | * 5 | * author: q66 6 | * license: see COPYING.txt 7 | */ 8 | 9 | #include "cube.hh" 10 | 11 | namespace logger 12 | { 13 | int current_indent = 0; 14 | 15 | const char *names[LEVELNUM] = { "INFO", "DEBUG", "WARNING", "ERROR", "INIT", "OFF" }; 16 | loglevel numbers[LEVELNUM] = { INFO, DEBUG, WARNING, ERROR, INIT, OFF }; 17 | loglevel current_level = WARNING; 18 | 19 | loglevel name_to_num(const char *name) 20 | { 21 | for (int i = 0; i < LEVELNUM; i++) 22 | if (!strcmp( names[i], name)) 23 | return numbers[i]; 24 | 25 | log(ERROR, "no such loglevel: %s\n", name); 26 | return numbers[0]; 27 | } 28 | 29 | void setlevel(loglevel level) 30 | { 31 | assert(level >= 0 && level < LEVELNUM); 32 | 33 | current_level = level; 34 | printf("<<< setting loglevel to %s >>>\n", names[level]); 35 | } 36 | 37 | void setlevel(const char *level) 38 | { 39 | setlevel(name_to_num(level)); 40 | } 41 | 42 | bool should_log(loglevel level) 43 | { 44 | return (level >= current_level); 45 | } 46 | 47 | void log(loglevel level, const char *fmt, ...) 48 | { 49 | assert (current_level >= 0 && current_level < LEVELNUM); 50 | if (!should_log(level)) return; 51 | 52 | const char *level_s = names[level]; 53 | 54 | for (int i = 0; i < current_indent; i++) 55 | printf(" "); 56 | 57 | char sbuf[512]; 58 | char *buf = sbuf; 59 | va_list ap, ap2; 60 | va_start(ap, fmt); 61 | va_copy(ap2, ap); 62 | size_t len = vsnprintf(sbuf, sizeof(sbuf), fmt, ap); 63 | va_end(ap); 64 | if (len >= sizeof(sbuf)) { 65 | buf = new char[len + 1]; 66 | vsnprintf(buf, len + 1, fmt, ap2); 67 | } 68 | va_end(ap2); 69 | 70 | #ifndef STANDALONE 71 | if (level == ERROR) { 72 | conoutf(CON_ERROR, "[[%s]] - %s", level_s, buf); 73 | } 74 | else 75 | #endif 76 | logoutf("[[%s]] - %s", level_s, buf); 77 | if (buf != sbuf) { 78 | delete[] buf; 79 | } 80 | 81 | fflush(stdout); 82 | } 83 | 84 | logindent::logindent(loglevel level) 85 | { 86 | if (should_log(level)) 87 | { 88 | current_indent++; 89 | done = true; 90 | } 91 | else done = false; 92 | } 93 | 94 | logindent::~logindent() 95 | { 96 | if (done) current_indent--; 97 | } 98 | 99 | CLUAICOMMAND(log, void, (int level, const char *msg), { 100 | log((loglevel)level, "%s", msg); 101 | }); 102 | 103 | CLUAICOMMAND(should_log, bool, (int level), { 104 | return should_log((loglevel)level); 105 | }); 106 | 107 | CLUAICOMMAND(echo, void, (const char *msg), { 108 | conoutf("\f1%s", msg); 109 | }); 110 | } /* end namespace logger */ 111 | -------------------------------------------------------------------------------- /src/octa/octaforge/of_logger.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * of_logger.h, version 1 3 | * Logging facilities for OctaForge (header) 4 | * 5 | * author: q66 6 | * license: see COPYING.txt 7 | */ 8 | 9 | #ifndef OF_LOGGER_H 10 | #define OF_LOGGER_H 11 | 12 | #define INDENT_LOG(level) logger::logindent ind(level) 13 | 14 | /* Windows */ 15 | #ifdef ERROR 16 | #undef ERROR 17 | #endif 18 | 19 | /* Mac */ 20 | #ifdef DEBUG 21 | #undef DEBUG 22 | #endif 23 | 24 | namespace logger 25 | { 26 | #define LEVELNUM 6 27 | 28 | enum loglevel 29 | { 30 | INFO, 31 | DEBUG, 32 | WARNING, 33 | ERROR, 34 | INIT, 35 | OFF 36 | }; 37 | 38 | loglevel name_to_num(const char *name); 39 | void setlevel (loglevel level); 40 | void setlevel (const char *level = "WARNING"); 41 | bool should_log (loglevel level); 42 | void log (loglevel level, const char *fmt, ...); 43 | 44 | extern loglevel current_level; 45 | extern loglevel numbers[LEVELNUM]; 46 | extern const char *names [LEVELNUM]; 47 | 48 | struct logindent 49 | { 50 | logindent(loglevel level); 51 | ~logindent(); 52 | bool done; 53 | }; 54 | } /* end namespace logger */ 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/octa/octaforge/of_lua.hh: -------------------------------------------------------------------------------- 1 | #ifndef OF_LAPI_H 2 | #define OF_LAPI_H 3 | 4 | namespace lua 5 | { 6 | struct va_ref { va_list ap; }; 7 | 8 | struct State { 9 | lua_State *state; 10 | string mod_dir; 11 | 12 | State(bool dedicated, const char *dir); 13 | ~State(); 14 | 15 | bool push_external(const char *name); 16 | 17 | bool call_external(const char *name, const char *args, ...); 18 | 19 | int call_external_ret_nopop(const char *name, const char *args, 20 | const char *retargs, ...); 21 | 22 | bool call_external_ret(const char *name, const char *args, 23 | const char *retargs, ...); 24 | 25 | void pop_external_ret(int n); 26 | 27 | void load_module(const char *name); 28 | int load_file (const char *fname); 29 | int load_string(const char *str, const char *ch = NULL); 30 | bool exec_file (const char *cfgfile, bool msg = true); 31 | }; 32 | 33 | extern State *L; 34 | 35 | bool reg_fun (const char *name, lua_CFunction fun); 36 | bool reg_cfun (const char *name, const char *sig, void *fun); 37 | bool init (bool dedicated, const char *dir = "media/scripts/core"); 38 | void reset (); 39 | void close (); 40 | void assert_stack(); 41 | } 42 | 43 | #define LUACOMMAND(name, fun) \ 44 | static bool __dummy_##name = lua::reg_fun(#name, fun); 45 | 46 | #define LUAICOMMANDN(name, state, body) \ 47 | template struct _lfn_##name; \ 48 | template<> struct _lfn_##name<__LINE__> { \ 49 | static bool init; static int fun(lua_State*); \ 50 | }; \ 51 | bool _lfn_##name<__LINE__>::init = lua::reg_fun(#name, \ 52 | _lfn_##name<__LINE__>::fun); \ 53 | int _lfn_##name<__LINE__>::fun(lua_State *state) { \ 54 | body; \ 55 | } 56 | 57 | #define LUAICOMMAND(name, body) LUAICOMMANDN(name, L, body) 58 | 59 | #define CLUACOMMAND(nm, rett, argt, fun) \ 60 | static bool __dummyc_##nm = lua::reg_cfun(#nm, #rett "(*)" #argt, \ 61 | (void*)fun); 62 | 63 | #define CLUAICOMMAND(nm, rett, argt, body) \ 64 | template struct _lcfn_##nm; \ 65 | template<> struct _lcfn_##nm<__LINE__> { \ 66 | static bool init; static rett fun argt; \ 67 | }; \ 68 | bool _lcfn_##nm<__LINE__>::init = lua::reg_cfun(#nm, #rett "(*)" #argt, \ 69 | (void*)_lcfn_##nm<__LINE__>::fun); \ 70 | rett _lcfn_##nm<__LINE__>::fun argt { \ 71 | body; \ 72 | } 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /src/octa/shared/arch_detection.hh: -------------------------------------------------------------------------------- 1 | #if defined(__i386) || defined(__i386__) || defined(_M_IX86) 2 | #define OF_TARGET_X86 1 3 | #elif defined(__x86_64__) || defined(__x86_64) || \ 4 | defined(_M_X64) || defined(_M_AMD64) 5 | #define OF_TARGET_X64 1 6 | #endif 7 | 8 | #if defined(_WIN32) && !defined(_XBOX_VER) 9 | #define OF_TARGET_WINDOWS 1 10 | #elif defined(__linux__) 11 | #define OF_TARGET_LINUX 1 12 | #elif defined(__MACH__) && defined(__APPLE__) 13 | #define OF_TARGET_OSX 1 14 | #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ 15 | defined(__NetBSD__) || defined(__OpenBSD__) 16 | #define OF_TARGET_BSD 1 17 | #elif (defined(__sun__) && defined(__svr4__)) || defined(__CYGWIN__) 18 | #define OF_TARGET_POSIX 1 19 | #endif 20 | -------------------------------------------------------------------------------- /src/octa/shared/cube.hh: -------------------------------------------------------------------------------- 1 | #ifndef __CUBE_H__ 2 | #define __CUBE_H__ 3 | 4 | #define _FILE_OFFSET_BITS 64 5 | 6 | #ifdef __GNUC__ 7 | #define gamma __gamma 8 | #endif 9 | 10 | #ifdef __STRICT_ANSI__ 11 | #undef __STRICT_ANSI__ 12 | #endif 13 | 14 | #ifdef WIN32 15 | #define _USE_MATH_DEFINES 16 | #endif 17 | #include 18 | 19 | #ifdef __GNUC__ 20 | #undef gamma 21 | #endif 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | #include "ostd/types.hh" 34 | #include "ostd/new.hh" 35 | #include "ostd/algorithm.hh" 36 | 37 | extern "C" { 38 | #ifdef __APPLE__ 39 | #include "LuaJIT/lua.h" 40 | #include "LuaJIT/lualib.h" 41 | #include "LuaJIT/lauxlib.h" 42 | #else 43 | #include "lua.h" 44 | #include "lualib.h" 45 | #include "lauxlib.h" 46 | #endif 47 | } 48 | 49 | #ifdef WIN32 50 | #define WIN32_LEAN_AND_MEAN 51 | #define NOMINMAX 52 | #ifdef _WIN32_WINNT 53 | #undef _WIN32_WINNT 54 | #endif 55 | #define _WIN32_WINNT 0x0500 56 | #include "windows.h" 57 | #ifndef _WINDOWS 58 | #define _WINDOWS 59 | #endif 60 | #ifndef __GNUC__ 61 | #include 62 | #include 63 | #include 64 | #endif 65 | #define ZLIB_DLL 66 | #endif 67 | 68 | #ifndef STANDALONE 69 | #ifdef __APPLE__ 70 | #include "SDL2/SDL.h" 71 | #include "SDL2/SDL_opengl.h" 72 | #ifdef OSX_USE_LAUNCHER 73 | #define main SDL_main 74 | #endif 75 | #else 76 | #include 77 | #include 78 | #endif 79 | #endif 80 | 81 | #include 82 | 83 | #include 84 | 85 | #include "tools.hh" 86 | #include "geom.hh" 87 | #include "ents.hh" 88 | #include "command.hh" 89 | 90 | #ifndef STANDALONE 91 | #include "glexts.hh" 92 | #include "glemu.hh" 93 | #endif 94 | 95 | #include "iengine.hh" 96 | #include "igame.hh" 97 | 98 | #include "of_logger.hh" 99 | #include "of_lua.hh" 100 | 101 | #endif 102 | 103 | -------------------------------------------------------------------------------- /src/ostd/COPYING.md: -------------------------------------------------------------------------------- 1 | OctaSTD is licensed under the University of Illinois/NCSA Open Source License, 2 | a permissive, non-copyleft, BSD style license. The license text goes as follows: 3 | 4 | Copyright (c) 2015 Daniel "q66" Kolesa. All rights reserved. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal with 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | of the Software, and to permit persons to whom the Software is furnished to do 11 | so, subject to the following conditions: 12 | 13 | * Redistributions of source code must retain the above copyright notice, 14 | this list of conditions and the following disclaimers. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimers in the 18 | documentation and/or other materials provided with the distribution. 19 | 20 | * Neither the names of OctaSTD developers nor any contributors may be 21 | used to endorse or promote products derived from this Software without 22 | specific prior written permission. 23 | 24 | **THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 26 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 29 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE 30 | SOFTWARE.** 31 | 32 | Additionally some code from the libc++ project has been used as a reference; 33 | libc++ is a part of the LLVM project. 34 | 35 | Additional thanks to Dale Weiler aka graphitemaster (reference code in the 36 | Neothyne project) and cppreference.com. -------------------------------------------------------------------------------- /src/ostd/README.md: -------------------------------------------------------------------------------- 1 | # octastd 2 | 3 | OctaSTD is a collection of C++ utilities to aid the upcoming OctaForge C++ 4 | API. It provides containers (dynamic arrays etc) as well as other utilities. 5 | 6 | Documentation for OctaSTD can be found at https://wiki.octaforge.org/docs/octastd. 7 | 8 | It utilizes C++11. It also implements equivalents of certain C++14 library 9 | features that are possible to implement with the C++11 language. It does not 10 | go beyond C++11 level when it comes to core language features. 11 | 12 | ## Supported compilers 13 | 14 | Compiler | Version 15 | -------- | ------- 16 | gcc/g++ | 4.8+ 17 | clang | 3.3+ 18 | 19 | Other C++11 compliant compilers might work as well. OctaSTD does not utilize 20 | compiler specific extensions except certain builtin type traits - to implement 21 | traits that are not normally possible to implement without compiler support. 22 | 23 | OctaSTD does not provide fallbacks for those traits. The compiler is expected 24 | to support these builtins. So far the 2 above-mentioned compilers support them 25 | (MSVC++ supports most of these as well). 26 | 27 | MSVC++ is currently unsupported. It is likely that it will never be supported, 28 | as it seems that MS will start supporting Clang in Visual Studio; however, 29 | if that does not happen and the MS C++ compiler gains the required features, 30 | support will be added. 31 | 32 | ## Supported operating systems 33 | 34 | Currently supported OSes in OctaSTD are Linux, FreeBSD and OS X. Other 35 | systems that implement POSIX API will also work (if they don't, bug reports 36 | are welcome). 37 | 38 | Windows is supported at least with the MinGW (gcc) and Clang compilers. MS 39 | Visual Studio is currently unsupported. -------------------------------------------------------------------------------- /src/ostd/ostd/argparse.hh: -------------------------------------------------------------------------------- 1 | /* Argument parser. 2 | * 3 | * This file is part of OctaSTD. See COPYING.md for futher information. 4 | */ 5 | 6 | #ifndef OSTD_ARGPARSE_HH 7 | #define OSTD_ARGPARSE_HH 8 | 9 | namespace ostd { 10 | 11 | } /* namespace ostd */ 12 | 13 | #endif -------------------------------------------------------------------------------- /src/ostd/ostd/initializer_list.hh: -------------------------------------------------------------------------------- 1 | /* Initializer list support for OctaSTD. 2 | * 3 | * This file is part of OctaSTD. See COPYING.md for futher information. 4 | */ 5 | 6 | #ifndef OSTD_INITIALIZER_LIST_HH 7 | #define OSTD_INITIALIZER_LIST_HH 8 | 9 | #include 10 | 11 | #include "ostd/range.hh" 12 | 13 | #ifndef OSTD_ALLOW_CXXSTD 14 | /* must be in std namespace otherwise the compiler won't know about it */ 15 | namespace std { 16 | 17 | template 18 | class initializer_list { 19 | const T *p_buf; 20 | ostd::Size p_len; 21 | 22 | constexpr initializer_list(const T *v, ostd::Size n): p_buf(v), p_len(n) {} 23 | public: 24 | constexpr initializer_list(): p_buf(nullptr), p_len(0) {} 25 | 26 | constexpr ostd::Size size() const { return p_len; } 27 | 28 | constexpr const T *begin() const { return p_buf; } 29 | constexpr const T *end() const { return p_buf + p_len; } 30 | }; 31 | 32 | } 33 | #else 34 | #include 35 | #endif 36 | 37 | namespace ostd { 38 | 39 | template using InitializerList = std::initializer_list; 40 | 41 | template 42 | PointerRange iter(std::initializer_list init) { 43 | return PointerRange(init.begin(), init.end()); 44 | } 45 | 46 | template 47 | PointerRange citer(std::initializer_list init) { 48 | return PointerRange(init.begin(), init.end()); 49 | } 50 | 51 | } 52 | 53 | #endif -------------------------------------------------------------------------------- /src/ostd/ostd/new.hh: -------------------------------------------------------------------------------- 1 | /* Default new/delete operator overloads for OctaSTD. Also has an impl file. 2 | * 3 | * This file is part of OctaSTD. See COPYING.md for futher information. 4 | */ 5 | 6 | #ifndef OSTD_NEW_HH 7 | #define OSTD_NEW_HH 8 | 9 | #ifndef OSTD_ALLOW_CXXSTD 10 | #include "ostd/types.hh" 11 | 12 | inline void *operator new (ostd::Size, void *p) { return p; } 13 | inline void *operator new [](ostd::Size, void *p) { return p; } 14 | inline void operator delete (void *, void *) {} 15 | inline void operator delete[](void *, void *) {} 16 | #else 17 | #include 18 | #endif 19 | 20 | #endif -------------------------------------------------------------------------------- /src/ostd/ostd/types.hh: -------------------------------------------------------------------------------- 1 | /* Core type aliases for OctaSTD. 2 | * 3 | * This file is part of OctaSTD. See COPYING.md for futher information. 4 | */ 5 | 6 | #ifndef OSTD_TYPES_HH 7 | #define OSTD_TYPES_HH 8 | 9 | #include 10 | #include 11 | 12 | namespace ostd { 13 | 14 | /* "builtin" types */ 15 | 16 | using sbyte = signed char; 17 | using byte = unsigned char; 18 | using ushort = unsigned short; 19 | using uint = unsigned int; 20 | using ulong = unsigned long; 21 | using ullong = unsigned long long; 22 | using llong = long long; 23 | 24 | using ldouble = long double; 25 | 26 | /* keywords in c++, but aliased */ 27 | 28 | using Wchar = wchar_t; 29 | using Char16 = char16_t; 30 | using Char32 = char32_t; 31 | 32 | /* nullptr type */ 33 | 34 | using Nullptr = decltype(nullptr); 35 | 36 | /* max align */ 37 | 38 | #if defined(__CLANG_MAX_ALIGN_T_DEFINED) || defined(_GCC_MAX_ALIGN_T) 39 | using MaxAlign = ::max_align_t; 40 | #else 41 | using MaxAlign = long double; 42 | #endif 43 | 44 | /* stddef */ 45 | 46 | using Ptrdiff = ptrdiff_t; 47 | using Size = size_t; 48 | 49 | /* stdint */ 50 | 51 | using Intmax = intmax_t; 52 | using Uintmax = uintmax_t; 53 | 54 | using Intptr = intptr_t; 55 | using Uintptr = uintptr_t; 56 | 57 | using Int8 = int8_t; 58 | using Int16 = int16_t; 59 | using Int32 = int32_t; 60 | using Int64 = int64_t; 61 | 62 | using Uint8 = uint8_t; 63 | using Uint16 = uint16_t; 64 | using Uint32 = uint32_t; 65 | using Uint64 = uint64_t; 66 | 67 | using IntLeast8 = int_least8_t; 68 | using IntLeast16 = int_least16_t; 69 | using IntLeast32 = int_least32_t; 70 | using IntLeast64 = int_least64_t; 71 | 72 | using UintLeast8 = uint_least8_t; 73 | using UintLeast16 = uint_least16_t; 74 | using UintLeast32 = uint_least32_t; 75 | using UintLeast64 = uint_least64_t; 76 | 77 | using IntFast8 = int_fast8_t; 78 | using IntFast16 = int_fast16_t; 79 | using IntFast32 = int_fast32_t; 80 | using IntFast64 = int_fast64_t; 81 | 82 | using UintFast8 = uint_fast8_t; 83 | using UintFast16 = uint_fast16_t; 84 | using UintFast32 = uint_fast32_t; 85 | using UintFast64 = uint_fast64_t; 86 | 87 | } 88 | 89 | #endif -------------------------------------------------------------------------------- /src/ostd/run_tests.py: -------------------------------------------------------------------------------- 1 | from sys import stdout, exit 2 | from os import listdir, remove, name as osname 3 | from os.path import splitext, join as joinp 4 | import subprocess as sp 5 | 6 | # configuration - you can modify this 7 | 8 | COMPILER = "c++" 9 | CXXFLAGS = [ 10 | "-std=c++11", 11 | "-Wall", "-Wextra", 12 | "-Wno-missing-braces", # clang false positive 13 | "-I." 14 | ] 15 | COLORS = (osname != "nt") 16 | TESTDIR = "tests" 17 | SRCEXT = ".cc" 18 | 19 | # don't modify past these lines 20 | 21 | nsuccess = 0 22 | nfailed = 0 23 | 24 | if COLORS: 25 | colors = { 26 | "red": "\033[91m", 27 | "green": "\033[92m", 28 | "blue": "\033[94m", 29 | "bold": "\033[1m", 30 | "end": "\033[0m" 31 | } 32 | else: 33 | colors = { "red": "", "green": "", "blue": "", "bold": "", "end": "" } 34 | 35 | def print_result(modname, fmsg = None): 36 | global nsuccess, nfailed 37 | if fmsg: 38 | print modname + ("...\t%(red)s%(bold)s(" + fmsg + ")%(end)s") % colors 39 | nfailed += 1 40 | else: 41 | print modname + "...\t%(green)s%(bold)s(success)%(end)s" % colors 42 | nsuccess += 1 43 | 44 | for fname in listdir(TESTDIR): 45 | (modname, modext) = splitext(fname) 46 | 47 | if modext != SRCEXT: 48 | continue 49 | 50 | srcpath = joinp(TESTDIR, fname) 51 | exepath = joinp(TESTDIR, modname) 52 | 53 | pc = sp.Popen([ COMPILER, srcpath, "-o", exepath ] + CXXFLAGS, 54 | stdout = sp.PIPE, stderr = sp.STDOUT) 55 | stdout.write(pc.communicate()[0]) 56 | 57 | if pc.returncode != 0: 58 | print_result(modname, "compile error") 59 | continue 60 | 61 | pc = sp.Popen(exepath, stdout = sp.PIPE, stderr = sp.STDOUT) 62 | stdout.write(pc.communicate()[0]) 63 | 64 | if pc.returncode != 0: 65 | remove(exepath) 66 | print_result(modname, "runtime error") 67 | continue 68 | 69 | remove(exepath) 70 | print_result(modname) 71 | 72 | print "\n%(blue)s%(bold)stesting done:%(end)s" % colors 73 | print "%(green)sSUCCESS: " % colors + str(nsuccess) + colors["end"] 74 | print "%(red)sFAILURE: " % colors + str(nfailed) + colors["end"] -------------------------------------------------------------------------------- /src/ostd/src/new.cc: -------------------------------------------------------------------------------- 1 | /* Default new/delete operator overloads for OctaSTD. Also has a header file. 2 | * 3 | * This file is part of OctaSTD. See COPYING.md for futher information. 4 | */ 5 | 6 | #include 7 | 8 | #include "ostd/types.hh" 9 | 10 | void *operator new(ostd::Size size) { 11 | void *p = malloc(size); 12 | if (!p) abort(); 13 | return p; 14 | } 15 | 16 | void *operator new[](ostd::Size size) { 17 | void *p = malloc(size); 18 | if (!p) abort(); 19 | return p; 20 | } 21 | 22 | void operator delete(void *p) noexcept { 23 | free(p); 24 | } 25 | 26 | void operator delete[](void *p) noexcept { 27 | free(p); 28 | } -------------------------------------------------------------------------------- /src/ostd/tests/array.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "ostd/array.hh" 3 | #include "ostd/string.hh" 4 | 5 | using namespace ostd; 6 | 7 | int main() { 8 | Array x = { 2, 4, 8, 16, 32 }; 9 | 10 | assert(x.front() == 2); 11 | assert(x.back() == 32); 12 | 13 | assert(x[0] == 2); 14 | assert(x[2] == 8); 15 | 16 | assert(*(x.at(0)) == x[0]); 17 | assert(*(x.at(3)) == x[3]); 18 | 19 | assert(x.size() == 5); 20 | 21 | assert(!x.empty()); 22 | 23 | assert(x.in_range(4)); 24 | assert(x.in_range(0)); 25 | assert(!x.in_range(5)); 26 | 27 | assert(x.data()[0] == x[0]); 28 | 29 | auto r = x.iter(); 30 | assert(r.front() == 2); 31 | assert(r.back() == 32); 32 | 33 | Array z; 34 | x.swap(z); 35 | 36 | assert(z.front() == 2); 37 | assert(z.back() == 32); 38 | 39 | assert(z.size() == 5); 40 | 41 | assert(to_string(z) == "{2, 4, 8, 16, 32}"); 42 | 43 | return 0; 44 | } -------------------------------------------------------------------------------- /src/ostd/tests/utility.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "ostd/utility.hh" 3 | #include "ostd/string.hh" 4 | 5 | using namespace ostd; 6 | 7 | struct Foo { 8 | int x; 9 | Foo(): x(5) {} 10 | Foo(int x): x(x) {} 11 | Foo(const Foo &x): x(x.x) {} 12 | Foo(Foo &&x): x(x.x) { x.x = 0; } 13 | Foo &operator=(int _x) { 14 | x = _x; 15 | return *this; 16 | } 17 | }; 18 | 19 | struct NotSwappable { 20 | int i; 21 | NotSwappable(int i): i(i) {} 22 | }; 23 | 24 | struct Swappable { 25 | int i; 26 | bool swapped; 27 | Swappable(int i): i(i), swapped(false) {} 28 | void swap(Swappable &v) { 29 | auto j = i; 30 | i = v.i; 31 | v.i = j; 32 | swapped = v.swapped = true; 33 | } 34 | }; 35 | 36 | int main() { 37 | Foo bar(150); 38 | Foo baz(move(bar)); 39 | 40 | assert(bar.x == 0); 41 | assert(baz.x == 150); 42 | 43 | Foo cp(baz); 44 | 45 | assert(baz.x == 150); 46 | assert(cp.x == 150); 47 | 48 | auto i = exchange(baz, 20); 49 | assert(baz.x == 20); 50 | assert(i.x == 150); 51 | 52 | NotSwappable nsx(10); 53 | NotSwappable nsy(20); 54 | 55 | swap(nsx, nsy); 56 | assert(nsx.i == 20); 57 | assert(nsy.i == 10); 58 | 59 | Swappable sx(10); 60 | Swappable sy(20); 61 | 62 | assert(!sx.swapped); 63 | assert(!sy.swapped); 64 | 65 | swap(sx, sy); 66 | assert(sx.swapped); 67 | assert(sy.swapped); 68 | assert(sx.i == 20); 69 | assert(sy.i == 10); 70 | 71 | int ai[3] = { 5, 10, 15 }; 72 | int bi[3] = { 6, 11, 16 }; 73 | swap(ai, bi); 74 | 75 | assert(ai[0] == 6); 76 | assert(bi[2] == 15); 77 | 78 | auto x = make_pair(5, 3.14f); 79 | 80 | assert((IsSame::value)); 81 | assert((IsSame::value)); 82 | 83 | assert(x.first == 5); 84 | assert(x.second == 3.14f); 85 | 86 | auto st = make_pair(5, 10); 87 | assert(to_string(st) == "{5, 10}"); 88 | 89 | return 0; 90 | } -------------------------------------------------------------------------------- /src/ostd/tests/vector.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "ostd/vector.hh" 3 | #include "ostd/string.hh" 4 | 5 | using namespace ostd; 6 | 7 | int main() { 8 | Vector x = { 5, 10, 15, 20 }; 9 | 10 | assert(x.front() == 5); 11 | assert(x.back() == 20); 12 | 13 | assert(x[0] == 5); 14 | assert(x[2] == 15); 15 | 16 | assert(*(x.at(0)) == x[0]); 17 | assert(*(x.at(3)) == x[3]); 18 | 19 | assert(x.data()[0] == x[0]); 20 | 21 | assert(x.size() == 4); 22 | 23 | Vector y(5, 10); 24 | 25 | assert(y.size() == 5); 26 | assert(y.front() == 10); 27 | assert(y.back() == 10); 28 | 29 | Vector z(x); 30 | 31 | assert(x.front() == z.front()); 32 | assert(x.back() == z.back()); 33 | 34 | z.clear(); 35 | 36 | assert(z.size() == 0); 37 | assert(z.capacity() != 0); 38 | assert(z.empty()); 39 | 40 | z = move(y); 41 | 42 | assert(z.size() == 5); 43 | assert(y.size() == 0); 44 | assert(z.front() == 10); 45 | assert(z.back() == 10); 46 | 47 | z.resize(150, 5); 48 | assert(z.size() == 150); 49 | assert(z.front() == 10); 50 | assert(z.back() == 5); 51 | 52 | assert(z.push(30) == 30); 53 | assert(z.back() == 30); 54 | 55 | assert(z.emplace_back(20) == 20); 56 | assert(z.back() == 20); 57 | 58 | z.clear(); 59 | z.resize(10, 5); 60 | 61 | assert(z.in_range(9)); 62 | assert(z.in_range(0)); 63 | assert(!z.in_range(10)); 64 | 65 | z.insert(2, 4); 66 | assert(z[2] == 4); 67 | assert(z[0] == 5); 68 | assert(z[3] == 5); 69 | assert(z.size() == 11); 70 | 71 | auto r = z.iter(); 72 | assert(r.front() == 5); 73 | assert(r.back() == 5); 74 | assert(r[2] == 4); 75 | 76 | auto r2 = iter(z); 77 | assert(r.front() == r2.front()); 78 | 79 | Vector w; 80 | w.swap(z); 81 | 82 | assert(z.size() == 0); 83 | assert(w.size() != 0); 84 | assert(w.front() == 5); 85 | assert(w.back() == 5); 86 | 87 | int pushn[] = { 3, 2, 1 }; 88 | w.push_n(pushn, 3); 89 | 90 | assert(to_string(w) == "{5, 5, 4, 5, 5, 5, 5, 5, 5, 5, 5, 3, 2, 1}"); 91 | 92 | return 0; 93 | } -------------------------------------------------------------------------------- /src/readme_tesseract.txt: -------------------------------------------------------------------------------- 1 | Note that this license is an extension of the original Sauerbraten source 2 | code license which is included under the file "readme_sauerbraten.txt" for 3 | reference. Both are essentially the ZLIB license, but the Tesseract license 4 | may include differing copyright owners and usage clarifications. 5 | 6 | Tesseract source code license, usage, and documentation. 7 | 8 | You may use the Tesseract source code if you abide by the ZLIB license 9 | http://www.opensource.org/licenses/zlib-license.php 10 | (very similar to the BSD license): 11 | 12 | 13 | LICENSE 14 | ======= 15 | 16 | Tesseract game engine source code, any release. 17 | 18 | Copyright (C) 2001-2015 Wouter van Oortmerssen, Lee Salzman, Mike Dysart, Robert Pointon, Quinton Reeves, and Benjamin Segovia 19 | 20 | This software is provided 'as-is', without any express or implied 21 | warranty. In no event will the authors be held liable for any damages 22 | arising from the use of this software. 23 | 24 | Permission is granted to anyone to use this software for any purpose, 25 | including commercial applications, and to alter it and redistribute it 26 | freely, subject to the following restrictions: 27 | 28 | 1. The origin of this software must not be misrepresented; you must not 29 | claim that you wrote the original software. If you use this software 30 | in a product, an acknowledgment in the product documentation would be 31 | appreciated but is not required. 32 | 2. Altered source versions must be plainly marked as such, and must not be 33 | misrepresented as being the original software. 34 | 3. This notice may not be removed or altered from any source distribution. 35 | 36 | 37 | LICENSE NOTES 38 | ============= 39 | The license covers the source code found in the "src" directory of this 40 | archive as well as the .cfg files under the "data" directory. The included 41 | ENet network library which Tesseract uses is covered by an MIT-style 42 | license, which is however compatible with the above license for all 43 | practical purposes. 44 | 45 | Other media included with this distribution (maps, textures, sounds, models etc.) 46 | are NOT covered by this license, and may have individual copyrights and 47 | distribution restrictions (see individual readmes). 48 | 49 | AUTHORS 50 | ====== 51 | Wouter "Aardappel" van Oortmerssen 52 | http://strlen.com 53 | 54 | Lee "eihrul" Salzman 55 | http://sauerbraten.org/lee/ 56 | 57 | Mike "Gilt" Dysart 58 | 59 | Robert "baby-rabbit" Pointon 60 | http://www.fernlightning.com 61 | 62 | Quinton "Quin" Reeves 63 | http://www.redeclipse.net 64 | 65 | Benjamin Segovia 66 | 67 | For additional authors/contributors, see the Tesseract distribution readme. 68 | 69 | -------------------------------------------------------------------------------- /src/vcpp/broken/octaforge.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "octaforge", "octaforge.vcxproj", "{7252208C-BAF1-49D4-8770-B831E7E68947}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Debug|x64 = Debug|x64 10 | Profile|Win32 = Profile|Win32 11 | Profile|x64 = Profile|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {7252208C-BAF1-49D4-8770-B831E7E68947}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {7252208C-BAF1-49D4-8770-B831E7E68947}.Debug|Win32.Build.0 = Debug|Win32 18 | {7252208C-BAF1-49D4-8770-B831E7E68947}.Debug|x64.ActiveCfg = Debug|x64 19 | {7252208C-BAF1-49D4-8770-B831E7E68947}.Debug|x64.Build.0 = Debug|x64 20 | {7252208C-BAF1-49D4-8770-B831E7E68947}.Profile|Win32.ActiveCfg = Profile|Win32 21 | {7252208C-BAF1-49D4-8770-B831E7E68947}.Profile|Win32.Build.0 = Profile|Win32 22 | {7252208C-BAF1-49D4-8770-B831E7E68947}.Profile|x64.ActiveCfg = Profile|x64 23 | {7252208C-BAF1-49D4-8770-B831E7E68947}.Profile|x64.Build.0 = Profile|x64 24 | {7252208C-BAF1-49D4-8770-B831E7E68947}.Release|Win32.ActiveCfg = Release|Win32 25 | {7252208C-BAF1-49D4-8770-B831E7E68947}.Release|Win32.Build.0 = Release|Win32 26 | {7252208C-BAF1-49D4-8770-B831E7E68947}.Release|x64.ActiveCfg = Release|x64 27 | {7252208C-BAF1-49D4-8770-B831E7E68947}.Release|x64.Build.0 = Release|x64 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /src/vcpp/dpiaware.manifest: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/vcpp/mingw.rc: -------------------------------------------------------------------------------- 1 | #include "octaforge.rc" 2 | CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "dpiaware.manifest" 3 | -------------------------------------------------------------------------------- /src/vcpp/octaforge.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/src/vcpp/octaforge.ico -------------------------------------------------------------------------------- /src/vcpp/octaforge.rc: -------------------------------------------------------------------------------- 1 | #include "winresrc.h" 2 | #define IDI_ICON1 1 3 | 4 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 5 | IDI_ICON1 ICON "octaforge.ico" 6 | -------------------------------------------------------------------------------- /src/xcode/macutils.m: -------------------------------------------------------------------------------- 1 | /* macutils.m - a collection of utilities for OS X 2 | * 3 | * tesseract launcher code used for reference 4 | */ 5 | 6 | #include 7 | #include 8 | #import 9 | 10 | #define BUNDLE_NAME @"OctaForge" 11 | 12 | void mac_set_datapath() { 13 | NSString *path = [[NSBundle mainBundle] bundlePath]; 14 | NSFileManager *fm = [NSFileManager defaultManager]; 15 | /* makefile + command line setups */ 16 | NSString *dpath = [path stringByDeletingLastPathComponent]; 17 | if ([fm fileExistsAtPath:[dpath stringByAppendingPathComponent:@"media"]]) { 18 | chdir([dpath UTF8String]); 19 | return; 20 | } 21 | /* release app bundle */ 22 | dpath = [path stringByAppendingPathComponent:@"Contents/gamedata"]; 23 | if ([fm fileExistsAtPath:dpath]) { 24 | chdir([dpath UTF8String]); 25 | return; 26 | } 27 | /* development bundle setup - nasty */ 28 | NSString *paths[] = { 29 | [path stringByDeletingLastPathComponent], /* relative to the binary */ 30 | [NSString stringWithUTF8String:__FILE__] /* relative to the source code - xcode 4+ */ 31 | }; 32 | for (size_t i = 0; i < 2; i++) { 33 | NSString *dpath = paths[i]; 34 | while ([dpath length] > 1) { 35 | dpath = [dpath stringByDeletingLastPathComponent]; 36 | /* FIXME: get rid of bundle name here */ 37 | NSString *probe = [dpath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.app/Contents/gamedata", BUNDLE_NAME]]; 38 | if ([fm fileExistsAtPath:[probe stringByAppendingPathComponent:@"media"]]) { 39 | chdir([probe UTF8String]); 40 | return; 41 | } else if ([fm fileExistsAtPath:[dpath stringByAppendingPathComponent:@"media"]]) { 42 | chdir([dpath UTF8String]); 43 | return; 44 | } 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /src/xcode/octaforge.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctaForge/OF-Engine/fd2dd742024200a97b140e5530a97b2c86c873f2/src/xcode/octaforge.icns -------------------------------------------------------------------------------- /src/xcode/octaforge.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDocumentTypes 8 | 9 | 10 | CFBundleTypeExtensions 11 | 12 | dmo 13 | 14 | CFBundleTypeIconFile 15 | octaforge 16 | CFBundleTypeName 17 | OctaForge demo 18 | CFBundleTypeRole 19 | Viewer 20 | LSTypeIsPackage 21 | 22 | NSPersistentStoreTypeKey 23 | NSBinaryStoreType 24 | 25 | 26 | CFBundleTypeExtensions 27 | 28 | ofm 29 | 30 | CFBundleTypeIconFile 31 | octaforge 32 | CFBundleTypeName 33 | OctaForge map 34 | CFBundleTypeRole 35 | Editor 36 | LSTypeIsPackage 37 | 38 | NSPersistentStoreTypeKey 39 | NSBinaryStoreType 40 | 41 | 42 | CFBundleExecutable 43 | $(EXECUTABLE_NAME) 44 | CFBundleIconFile 45 | octaforge 46 | CFBundleIdentifier 47 | com.octaforge.$(PRODUCT_NAME:rfc1034identifier) 48 | CFBundleInfoDictionaryVersion 49 | 6.0 50 | CFBundleName 51 | $(PRODUCT_NAME) 52 | CFBundlePackageType 53 | APPL 54 | CFBundleShortVersionString 55 | 0.1-git 56 | CFBundleSignature 57 | ???? 58 | CFBundleVersion 59 | 1 60 | LSApplicationCategoryType 61 | public.app-category.developer-tools 62 | LSMinimumSystemVersion 63 | $(MACOSX_DEPLOYMENT_TARGET) 64 | NSHighResolutionCapable 65 | 66 | NSHumanReadableCopyright 67 | Copyright © 2015 OctaForge developers. Available under the terms of the University of Illinois/NCSA Open Source license. 68 | NSPrincipalClass 69 | SDLApplication 70 | 71 | 72 | --------------------------------------------------------------------------------