From a80992973feb47adfc1214ad1a3f7fc34eb345c0 Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Fri, 20 Nov 2009 01:20:46 +0000 Subject: [PATCH] added summerhack --- 3dengfx.conf | 11 + Makefile | 41 ++ README | 16 + data/curve00 | 23 ++ data/curve01 | 11 + data/curve02 | 13 + data/curve03 | 44 +++ data/exibit.psys | 42 ++ data/galaxy.psys | 42 ++ data/pillar.curve | 15 + data/stars.psys | 38 ++ data/test2.psys | 36 ++ data/tex_list | 25 ++ data/thelab.psys | 47 +++ demoscript | 83 ++++ src/3dengfx | 1 + src/events.cpp | 76 ++++ src/events.hpp | 8 + src/parts/.dist.hpp.swp | Bin 0 -> 12288 bytes src/parts/.space.cpp.swp | Bin 0 -> 20480 bytes src/parts/Makefile-part | 4 + src/parts/dist.cpp | 136 +++++++ src/parts/dist.hpp | 16 + src/parts/parts.hpp | 16 + src/parts/pipes.cpp | 302 +++++++++++++++ src/parts/pipes.hpp | 16 + src/parts/space.cpp | 182 +++++++++ src/parts/space.hpp | 16 + src/parts/temple.cpp | 575 +++++++++++++++++++++++++++ src/parts/temple.hpp | 16 + src/sdlvf/Makefile-part | 1 + src/sdlvf/sdlvf.c | 202 ++++++++++ src/sdlvf/sdlvf.h | 81 ++++ src/sumhack.cpp | 197 ++++++++++ tools/curve_draw/Makefile | 13 + tools/curve_draw/cursors.cc | 176 +++++++++ tools/curve_draw/cursors.h | 8 + tools/curve_draw/curve_draw.cc | 461 ++++++++++++++++++++++ tools/curve_draw/curves.cc | 488 +++++++++++++++++++++++ tools/curve_draw/curves.h | 96 +++++ tools/curve_draw/gfx.cc | 299 +++++++++++++++ tools/curve_draw/gfx.h | 7 + tools/curve_draw/linkedlist.h | 260 +++++++++++++ tools/curve_draw/vmath/Makefile-part | 5 + tools/curve_draw/vmath/matrix.cc | 704 ++++++++++++++++++++++++++++++++++ tools/curve_draw/vmath/matrix.h | 162 ++++++++ tools/curve_draw/vmath/matrix.inl | 50 +++ tools/curve_draw/vmath/quaternion.cc | 182 +++++++++ tools/curve_draw/vmath/quaternion.h | 83 ++++ tools/curve_draw/vmath/sphvec.cc | 55 +++ tools/curve_draw/vmath/sphvec.h | 43 +++ tools/curve_draw/vmath/vector.cc | 290 ++++++++++++++ tools/curve_draw/vmath/vector.h | 222 +++++++++++ tools/curve_draw/vmath/vector.inl | 427 +++++++++++++++++++++ tools/curve_draw/vmath/vmath.cc | 211 ++++++++++ tools/curve_draw/vmath/vmath.h | 103 +++++ tools/curve_draw/vmath/vmath.inl | 41 ++ tools/curve_draw/vmath/vmath_types.h | 36 ++ tools/find_textures | 12 + 59 files changed, 6766 insertions(+) create mode 100644 3dengfx.conf create mode 100644 Makefile create mode 100644 README create mode 100644 data/curve00 create mode 100644 data/curve01 create mode 100644 data/curve02 create mode 100644 data/curve03 create mode 100644 data/exibit.psys create mode 100644 data/galaxy.psys create mode 100644 data/pillar.curve create mode 100644 data/stars.psys create mode 100644 data/test2.psys create mode 100644 data/tex_list create mode 100644 data/thelab.psys create mode 100644 demoscript create mode 120000 src/3dengfx create mode 100644 src/events.cpp create mode 100644 src/events.hpp create mode 100644 src/parts/.dist.hpp.swp create mode 100644 src/parts/.space.cpp.swp create mode 100644 src/parts/Makefile-part create mode 100644 src/parts/dist.cpp create mode 100644 src/parts/dist.hpp create mode 100644 src/parts/parts.hpp create mode 100644 src/parts/pipes.cpp create mode 100644 src/parts/pipes.hpp create mode 100644 src/parts/space.cpp create mode 100644 src/parts/space.hpp create mode 100644 src/parts/temple.cpp create mode 100644 src/parts/temple.hpp create mode 100644 src/sdlvf/Makefile-part create mode 100644 src/sdlvf/sdlvf.c create mode 100644 src/sdlvf/sdlvf.h create mode 100644 src/sumhack.cpp create mode 100644 tools/curve_draw/Makefile create mode 100644 tools/curve_draw/cursors.cc create mode 100644 tools/curve_draw/cursors.h create mode 100644 tools/curve_draw/curve_draw.cc create mode 100644 tools/curve_draw/curves.cc create mode 100644 tools/curve_draw/curves.h create mode 100644 tools/curve_draw/gfx.cc create mode 100644 tools/curve_draw/gfx.h create mode 100644 tools/curve_draw/linkedlist.h create mode 100644 tools/curve_draw/vmath/Makefile-part create mode 100644 tools/curve_draw/vmath/matrix.cc create mode 100644 tools/curve_draw/vmath/matrix.h create mode 100644 tools/curve_draw/vmath/matrix.inl create mode 100644 tools/curve_draw/vmath/quaternion.cc create mode 100644 tools/curve_draw/vmath/quaternion.h create mode 100644 tools/curve_draw/vmath/sphvec.cc create mode 100644 tools/curve_draw/vmath/sphvec.h create mode 100644 tools/curve_draw/vmath/vector.cc create mode 100644 tools/curve_draw/vmath/vector.h create mode 100644 tools/curve_draw/vmath/vector.inl create mode 100644 tools/curve_draw/vmath/vmath.cc create mode 100644 tools/curve_draw/vmath/vmath.h create mode 100644 tools/curve_draw/vmath/vmath.inl create mode 100644 tools/curve_draw/vmath/vmath_types.h create mode 100755 tools/find_textures diff --git a/3dengfx.conf b/3dengfx.conf new file mode 100644 index 0000000..0af8e71 --- /dev/null +++ b/3dengfx.conf @@ -0,0 +1,11 @@ +; The Lab Demos :: 3D engine configuration file +; --------------------------------------- +; this file is generated by config_tool (our GUI demo configuration +; tool) so your best bet would be using that tool to configure the demo. +; If that does not work for some reason, modify this file with care... + +fullscreen = true +resolution = 1024x768 +bpp = dontcare +zbuffer = dontcare +stencil = dontcare diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4292695 --- /dev/null +++ b/Makefile @@ -0,0 +1,41 @@ +src := src/sumhack.cpp src/events.cpp +bin := sumhack-thelab + +include src/parts/Makefile-part +include src/sdlvf/Makefile-part + +obj := $(src:.cpp=.o) $(csrc:.c=.o) + +opt := -O1 +opt := -g +CXXFLAGS := -ansi -pedantic -Wall $(opt) -Isrc/3dengfx/src `src/3dengfx/3dengfx-config --cflags` +CFLAGS := -std=c89 -pedantic -Wall $(opt) `src/3dengfx/3dengfx-config --cflags` +libs := src/3dengfx/lib3dengfx.a `src/3dengfx/3dengfx-config --libs-no-3dengfx` -lGL -lvorbisfile + +$(bin): $(obj) src/3dengfx/lib3dengfx.a data/tex_list + $(CXX) -o $@ $(obj) $(libs) + +src/3dengfx/lib3dengfx.a: + cd src/3dengfx;\ + ./configure --with-gfxlib=sdl --disable-ft --enable-opt --disable-debug && make + +data/tex_list: $(src) + tools/find_textures >$@ + +include $(obj:.o=.d) + +%.d: %.cpp + @set -e; rm -f $@; $(CXX) -MM $(CXXFLAGS) $< > $@.$$$$; \ + sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; rm -f $@.$$$$ + +%.d: %.c + @set -e; rm -f $@; $(CC) -MM $(CFLAGS) $< > $@.$$$$; \ + sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; rm -f $@.$$$$ + +.PHONY: clean +clean: + $(RM) $(obj) $(bin) + +.PHONY: cleandep +cleandep: + find src \( -name '*.d' -o -name '*.d.*' \) -exec $(RM) '{}' ';' diff --git a/README b/README new file mode 100644 index 0000000..e37c14c --- /dev/null +++ b/README @@ -0,0 +1,16 @@ +Summer Hack / The Lab Demos +--------------------------- +Demo code: Nuclear +3d engine: Nuclear, Samurai +Sound sys: Savvy + Music: Tourmpadakis + +Greets to everyone who watches this small demoish thingy. + +About this thing... +Needs a video card that doesn't suck for fillrate. No shaders or other +high-end gimmicks are used this time. +Released under the GPL, do whatever you wish with it. + +Contact info... +http://thelab.demoscene.gr - nuclear@siggraph.org diff --git a/data/curve00 b/data/curve00 new file mode 100644 index 0000000..b8a1f68 --- /dev/null +++ b/data/curve00 @@ -0,0 +1,23 @@ +curve_3dengfx + +bspline +19 +-44.089134 38.695248 1.000000 +-51.828182 25.327801 1.000000 +-54.833332 12.833332 1.000000 +-56.833332 -2.833332 1.000000 +-57.222065 -20.168427 1.000000 +-53.000763 -19.464882 1.000000 +-41.333332 -4.166668 1.000000 +-28.500000 0.166668 1.000000 +-25.000000 -1.833332 1.000000 +-32.166668 -16.833336 1.000000 +-31.166664 -22.000000 1.000000 +-8.833332 -4.333336 1.000000 +-10.833336 -0.666664 1.000000 +-17.999996 2.000000 1.000000 +-24.333332 -8.666664 1.000000 +-21.333332 -17.500000 1.000000 +-11.333336 -17.833336 1.000000 +-5.333332 -7.833332 1.000000 +10.500000 4.166664 1.000000 diff --git a/data/curve01 b/data/curve01 new file mode 100644 index 0000000..3d9e50a --- /dev/null +++ b/data/curve01 @@ -0,0 +1,11 @@ +curve_3dengfx + +bspline +7 +-40.249992 -36.575001 1.000000 +-41.124996 -28.699993 1.000000 +-32.374996 24.850000 1.000000 +-30.274998 22.749998 1.000000 +-34.124996 2.974998 1.000000 +-38.499996 -11.200001 1.000000 +-45.499996 -19.774998 1.000000 diff --git a/data/curve02 b/data/curve02 new file mode 100644 index 0000000..de7f9fc --- /dev/null +++ b/data/curve02 @@ -0,0 +1,13 @@ +curve_3dengfx + +bspline +9 +-17.500000 25.025000 1.000000 +-19.464882 28.141998 1.000000 +-53.938831 28.141998 1.000000 +-75.514366 5.862915 1.000000 +-74.810814 -5.159370 1.000000 +-60.036263 8.677116 1.000000 +-61.912399 -3.986778 1.000000 +-71.996613 -16.650681 1.000000 +-77.155983 -42.212997 1.000000 diff --git a/data/curve03 b/data/curve03 new file mode 100644 index 0000000..95a936b --- /dev/null +++ b/data/curve03 @@ -0,0 +1,44 @@ +curve_3dengfx + +bspline +40 +16.666290 24.372211 1.000000 +13.978188 31.719719 1.000000 +11.290070 33.691002 1.000000 +8.960373 32.615753 1.000000 +3.763359 24.730627 1.000000 +1.254456 6.809883 1.000000 +5.734642 -1.075245 1.000000 +5.913841 -11.469280 1.000000 +1.971283 -17.562336 1.000000 +0.896042 -20.967274 1.000000 +4.480186 -18.816784 1.000000 +17.194740 -12.341385 1.000000 +26.485451 -17.749409 1.000000 +31.477478 -18.304085 1.000000 +40.510368 -14.308704 1.000000 +45.341881 -5.017342 1.000000 +41.439507 0.557480 1.000000 +34.365734 0.575157 1.000000 +29.764469 -3.163376 1.000000 +28.757938 -15.960651 1.000000 +38.104267 -16.823391 1.000000 +46.156490 -6.470535 1.000000 +44.862377 5.464008 1.000000 +44.431011 0.718948 1.000000 +42.995193 -11.710075 1.000000 +46.490738 -17.652496 1.000000 +48.937622 -17.128166 1.000000 +54.355721 -8.738857 1.000000 +58.026039 25.342695 1.000000 +56.802597 27.789574 1.000000 +55.579155 26.216579 1.000000 +53.831383 -3.495548 1.000000 +54.597290 -14.425369 1.000000 +59.892685 -15.520966 1.000000 +64.640274 -12.051575 1.000000 +66.831467 -2.921589 1.000000 +61.353485 1.278194 1.000000 +55.510284 -2.191193 1.000000 +51.675697 -18.990356 1.000000 +52.953896 -23.920540 1.000000 diff --git a/data/exibit.psys b/data/exibit.psys new file mode 100644 index 0000000..dc1c7c6 --- /dev/null +++ b/data/exibit.psys @@ -0,0 +1,42 @@ +# --- particle system options --- +# psize: (particle size) +# psize-r: (particle size range, unused currently) +# life: (particle life in seconds) +# life-r: (particle life range) +# birth-rate: (birth rate, particles/sec) +# birth-rate-r: (birth rate range) +# grav: (gravity vector) +# shoot: (shoot vector, direction AND force) +# shoot-r: (shoot vector range) +# friction: (environment friction multiplier) +# spawn_off: (spawn particles in specified offset from the emitter position) +# spawn_off-r: (range of spawn-offset random vector) +# tex: (texture filename) +# color_start: (color at time of birth, alpha included) +# color_end: (color at time of death, alpha included) +# color: (specify the same color for start/end) +# rot: (particle rotation in rad/sec) +# halo: (halo texture filename) +# halo_size: (halo size) +# halo_rot: (halo rotation in rad/sec) +# big_particles: (requirement for big screen-space particles) + +psize: 700.0 +life: 3.5 +birth-rate: 50.0 +grav: 0, -0.05, 0 +shoot: 0, 0.0, 0 +shoot-r: 0.5, 0.5, 0.5; +friction: 0.995 +spawn_off: 0, 150.0, 0 +spawn_off-r: 5, 5, 5 +tex: data/img/psys03.png +color_start: 1.0, 0.61, 0.18, 1.0 +color_end: 1.0, 0.91, 0.18, 1.0 +glob_rot: 0.0 +rot: 0.0 + +halo: data/img/psys03.png +halo_size: 3000.0 + +big_particles: true diff --git a/data/galaxy.psys b/data/galaxy.psys new file mode 100644 index 0000000..b7b02b6 --- /dev/null +++ b/data/galaxy.psys @@ -0,0 +1,42 @@ +# --- particle system options --- +# psize: (particle size) +# psize-r: (particle size range, unused currently) +# life: (particle life in seconds) +# life-r: (particle life range) +# birth-rate: (birth rate, particles/sec) +# birth-rate-r: (birth rate range) +# grav: (gravity vector) +# shoot: (shoot vector, direction AND force) +# shoot-r: (shoot vector range) +# friction: (environment friction multiplier) +# spawn_off: (spawn particles in specified offset from the emitter position) +# spawn_off-r: (range of spawn-offset random vector) +# tex: (texture filename) +# color_start: (color at time of birth, alpha included) +# color_end: (color at time of death, alpha included) +# color: (specify the same color for start/end) +# rot: (particle rotation in rad/sec) +# halo: (halo texture filename) +# halo_size: (halo size) +# halo_rot: (halo rotation in rad/sec) +# big_particles: (requirement for big screen-space particles) + +psize: 800.0 +life: 5.0 +birth-rate: 130.0 +grav: 0, 0, 0 +shoot: 0, 0, 0 +shoot-r: 3.0, 0.2, 0.1; +friction: 0.995 +spawn_off: 0, 0, 0 +spawn_off-r: 10, 1.0, 3 +tex: data/img/psys03.png +color_start: 0.25, 0.4, 1.0, 1.0 +color_end: 0.5, 0.8, 1.0, 0.1 +glob_rot: 0.0 +rot: 0.0 + +halo: data/img/psys03.png +halo_size: 2800.0 + +big_particles: true diff --git a/data/pillar.curve b/data/pillar.curve new file mode 100644 index 0000000..5d0e3e9 --- /dev/null +++ b/data/pillar.curve @@ -0,0 +1,15 @@ +curve_3dengfx + +catmullrom +11 +4.192291 0.684456 0.000000 +5.047863 3.935621 0.000000 +5.304535 11.122410 0.000000 +4.192291 20.704794 0.000000 +4.962307 22.073706 0.000000 +5.561207 22.672604 0.000000 +5.047863 23.271503 0.000000 +5.390091 23.442617 0.000000 +5.903435 23.870401 0.000000 +5.218979 24.298187 0.000000 +0.085560 24.300000 0.000000 diff --git a/data/stars.psys b/data/stars.psys new file mode 100644 index 0000000..7f6cabd --- /dev/null +++ b/data/stars.psys @@ -0,0 +1,38 @@ +# --- particle system options --- +# psize: (particle size) +# psize-r: (particle size range, unused currently) +# life: (particle life in seconds) +# life-r: (particle life range) +# birth-rate: (birth rate, particles/sec) +# birth-rate-r: (birth rate range) +# grav: (gravity vector) +# shoot: (shoot vector, direction AND force) +# shoot-r: (shoot vector range) +# friction: (environment friction multiplier) +# spawn_off: (spawn particles in specified offset from the emitter position) +# spawn_off-r: (range of spawn-offset random vector) +# tex: (texture filename) +# color_start: (color at time of birth, alpha included) +# color_end: (color at time of death, alpha included) +# color: (specify the same color for start/end) +# rot: (particle rotation in rad/sec) +# halo: (halo texture filename) +# halo_size: (halo size) +# halo_rot: (halo rotation in rad/sec) +# big_particles: (requirement for big screen-space particles) + +psize: 1000.0 +psize-r: 300.0 +life: 6.0 +birth-rate: 10.0 +grav: 0, 0, 0 +shoot: 0, 0, 0 +shoot-r: 0.0, 0.0, 0.0; +friction: 1.0 +spawn_off: 0, 0, 0 +spawn_off-r: 500, 500, 500 +tex: data/img/psys03.png +color_start: 0.6, 0.75, 1.0, 1.0 +color_end: 0.8, 0.75, 1.0, 0.0 +glob_rot: 0.0 +rot: 0.0 diff --git a/data/test2.psys b/data/test2.psys new file mode 100644 index 0000000..dace8bb --- /dev/null +++ b/data/test2.psys @@ -0,0 +1,36 @@ +# --- particle system options --- +# psize: (particle size) +# psize-r: (particle size range, unused currently) +# life: (particle life in seconds) +# life-r: (particle life range) +# birth-rate: (birth rate, particles/sec) +# birth-rate-r: (birth rate range) +# grav: (gravity vector) +# shoot: (shoot vector, direction AND force) +# shoot-r: (shoot vector range) +# friction: (environment friction multiplier) +# spawn_off: (spawn particles in specified offset from the emitter position) +# spawn_off-r: (range of spawn-offset random vector) +# tex: (texture filename) +# color_start: (color at time of birth, alpha included) +# color_end: (color at time of death, alpha included) +# color: (specify the same color for start/end) +# rot: (particle rotation in rad/sec) +# halo: (halo texture filename) +# halo_size: (halo size) +# halo_rot: (halo rotation in rad/sec) +# big_particles: (requirement for big screen-space particles) + +psize: 1000.0 +psize_end: 0.1 +life: 3.5 +birth-rate: 100.0 +grav: 0, 0, 0 +friction: 0 +tex: data/img/scl_blobs0000.png +color_start: 0.25, 0.4, 1.0, 0.9 +color_end: 0.5, 0.8, 1.0, 0.2 +rot: 4.0 +glob_rot: 2.0 + +big_particles: true diff --git a/data/tex_list b/data/tex_list new file mode 100644 index 0000000..2e4eb86 --- /dev/null +++ b/data/tex_list @@ -0,0 +1,25 @@ +data/img/benedeti.jpg +data/img/brick1_base1.jpg +data/img/cracks.jpg +data/img/greets.png +data/img/label_dolphin.png +data/img/label_duck.png +data/img/label_face.png +data/img/label_teapot.png +data/img/loading.jpg +data/img/mud.jpg +data/img/nebula_nx.jpg +data/img/nebula_ny.jpg +data/img/nebula_nz.jpg +data/img/nebula_px.jpg +data/img/nebula_py.jpg +data/img/nebula_pz.jpg +data/img/nx.jpg +data/img/ny.jpg +data/img/nz.jpg +data/img/presents.png +data/img/px.jpg +data/img/py.jpg +data/img/pz.jpg +data/img/title.png +data/img/volcano.jpg diff --git a/data/thelab.psys b/data/thelab.psys new file mode 100644 index 0000000..b6bb008 --- /dev/null +++ b/data/thelab.psys @@ -0,0 +1,47 @@ +# --- particle system options --- +# psize: (particle size) +# psize-r: (particle size range, unused currently) +# life: (particle life in seconds) +# life-r: (particle life range) +# birth-rate: (birth rate, particles/sec) +# birth-rate-r: (birth rate range) +# grav: (gravity vector) +# shoot: (shoot vector, direction AND force) +# shoot-r: (shoot vector range) +# friction: (environment friction multiplier) +# spawn_off: (spawn particles in specified offset from the emitter position) +# spawn_off-r: (range of spawn-offset random vector) +# spawn_offset_curve: (filename of a curve file) +# tex: (texture filename) +# color_start: (color at time of birth, alpha included) +# color_end: (color at time of death, alpha included) +# color: (specify the same color for start/end) +# rot: (particle rotation in rad/sec) +# halo: (halo texture filename) +# halo_size: (halo size) +# halo_rot: (halo rotation in rad/sec) +# big_particles: (requirement for big screen-space particles) + +psize: 450.0 +psize-r: 200.0 +life: 3.5 +birth-rate: 250.0 +#grav: 0, 0.0025, 0 +grav: 0, 0.0025, 0 +shoot: 0, 0, 0 +shoot-r: 0.1, 0.1, 0.1; +friction: 0.995 +spawn_off: 0, 0, 0 +spawn_off-r: 0.7, 0.7, 0.7 +tex: data/img/psys03.png +#tex: data/waterfall010002.png +#tex: /home/nuclear/3ddata/textures/particles/sq_star.png + +#color_start: 0.25, 0.4, 1.0, 1.0 +#color_end: 0.5, 0.8, 1.0, 0.1 +#color_start: 1.0, 0.2, 0.3, 1.0 +#color_end: 0.3, 0.2, 1.0, 0.05 +color_start: 1, 0.78, 0.2, 1 +color_end: 1, 0.27, 0.2, 0.15 + +big_particles: true diff --git a/demoscript b/demoscript new file mode 100644 index 0000000..776b728 --- /dev/null +++ b/demoscript @@ -0,0 +1,83 @@ +# 3dengfx demosystem script v1.2 +# ------------------------------ +# format: