From 9e7643aa7c25ce551bfe59905fbf56156e264824 Mon Sep 17 00:00:00 2001
From: Nathan Letwory
Date: Sun, 4 Jan 2009 18:16:34 +0000
Subject: 2.5 / Cleanup - remove Verse support. This will be brought back in
The Future (probably jiri + me) This means 5k lines less in blenkernel. -
fix two small errors for global cleanup, now compiles properly with FFMPEG
enabled too.
---
CMakeLists.txt | 2 -
config/darwin-config.py | 6 -
config/irix6-config.py | 4 -
config/linux2-config.py | 3 -
config/linuxcross-config.py | 3 -
config/win32-mingw-config.py | 3 -
config/win32-vc-config.py | 3 -
extern/SConscript | 3 -
extern/verse/CMakeLists.txt | 28 -
extern/verse/Makefile | 55 -
extern/verse/dist/BUGS | 8 -
extern/verse/dist/CMakeLists.txt | 90 -
extern/verse/dist/MAINTAINERS | 15 -
extern/verse/dist/Makefile | 15 -
extern/verse/dist/Makefile.win32 | 102 -
extern/verse/dist/README.html | 173 --
extern/verse/dist/SConstruct | 146 --
extern/verse/dist/examples/list-nodes.c | 39 -
extern/verse/dist/mkprot_cmd/CMakeLists.txt | 52 -
extern/verse/dist/resources/Makefile.win32 | 11 -
extern/verse/dist/resources/verse.ico | Bin 17814 -> 0 bytes
extern/verse/dist/resources/verse.rc | 1 -
extern/verse/dist/resources/verse.res | Bin 18060 -> 0 bytes
extern/verse/dist/v_bignum.c | 860 --------
extern/verse/dist/v_bignum.h | 89 -
extern/verse/dist/v_cmd_buf.c | 119 --
extern/verse/dist/v_cmd_buf.h | 74 -
extern/verse/dist/v_cmd_def_a.c | 94 -
extern/verse/dist/v_cmd_def_b.c | 44 -
extern/verse/dist/v_cmd_def_c.c | 35 -
extern/verse/dist/v_cmd_def_g.c | 183 --
extern/verse/dist/v_cmd_def_m.c | 273 ---
extern/verse/dist/v_cmd_def_o.c | 517 -----
extern/verse/dist/v_cmd_def_s.c | 211 --
extern/verse/dist/v_cmd_def_t.c | 36 -
extern/verse/dist/v_cmd_gen.c | 939 ---------
extern/verse/dist/v_cmd_gen.h | 42 -
extern/verse/dist/v_connect.c | 490 -----
extern/verse/dist/v_connection.c | 490 -----
extern/verse/dist/v_connection.h | 73 -
extern/verse/dist/v_encryption.c | 255 ---
extern/verse/dist/v_encryption.h | 32 -
extern/verse/dist/v_func_storage.c | 194 --
extern/verse/dist/v_gen_pack_a_node.c | 521 -----
extern/verse/dist/v_gen_pack_b_node.c | 238 ---
extern/verse/dist/v_gen_pack_c_node.c | 189 --
extern/verse/dist/v_gen_pack_g_node.c | 1154 -----------
extern/verse/dist/v_gen_pack_init.c | 95 -
extern/verse/dist/v_gen_pack_m_node.c | 352 ----
extern/verse/dist/v_gen_pack_o_node.c | 1297 ------------
extern/verse/dist/v_gen_pack_s_node.c | 711 -------
extern/verse/dist/v_gen_pack_t_node.c | 226 ---
extern/verse/dist/v_gen_unpack_func.h | 63 -
extern/verse/dist/v_gen_unpack_funcs.h | 0
extern/verse/dist/v_internal_verse.h | 2 -
extern/verse/dist/v_man_pack_node.c | 498 -----
extern/verse/dist/v_network.c | 274 ---
extern/verse/dist/v_network.h | 24 -
extern/verse/dist/v_network_in_que.c | 140 --
extern/verse/dist/v_network_in_que.h | 24 -
extern/verse/dist/v_network_out_que.c | 396 ----
extern/verse/dist/v_network_out_que.h | 17 -
extern/verse/dist/v_pack.c | 386 ----
extern/verse/dist/v_pack.h | 59 -
extern/verse/dist/v_pack_method.c | 219 --
extern/verse/dist/v_prime.c | 165 --
extern/verse/dist/v_randgen.c | 101 -
extern/verse/dist/v_randgen.h | 14 -
extern/verse/dist/v_util.c | 98 -
extern/verse/dist/v_util.h | 21 -
extern/verse/dist/verse.h | 530 -----
extern/verse/dist/verse_header.h | 409 ----
extern/verse/dist/verse_ms.c | 286 ---
extern/verse/dist/verse_ms.h | 72 -
extern/verse/dist/vs_connection.c | 179 --
extern/verse/dist/vs_main.c | 180 --
extern/verse/dist/vs_master.c | 131 --
extern/verse/dist/vs_node_audio.c | 420 ----
extern/verse/dist/vs_node_bitmap.c | 560 ------
extern/verse/dist/vs_node_curve.c | 258 ---
extern/verse/dist/vs_node_geometry.c | 1047 ----------
extern/verse/dist/vs_node_head.c | 414 ----
extern/verse/dist/vs_node_material.c | 116 --
extern/verse/dist/vs_node_object.c | 837 --------
extern/verse/dist/vs_node_particle.c | 52 -
extern/verse/dist/vs_node_storage.c | 245 ---
extern/verse/dist/vs_node_text.c | 274 ---
extern/verse/dist/vs_server.h | 62 -
extern/verse/make/msvc_7_0/libverse.vcproj | 279 ---
extern/verse/make/msvc_7_0/verse.vcproj | 481 -----
extern/verse/make/msvc_9_0/libverse.vcproj | 368 ----
extern/verse/make/msvc_9_0/verse.vcproj | 669 -------
source/Makefile | 12 -
source/blender/blenkernel/BKE_DerivedMesh.h | 2 +-
source/blender/blenkernel/BKE_global.h | 5 +-
source/blender/blenkernel/BKE_image.h | 1 -
source/blender/blenkernel/BKE_verse.h | 583 ------
source/blender/blenkernel/CMakeLists.txt | 9 -
source/blender/blenkernel/SConscript | 7 -
source/blender/blenkernel/intern/DerivedMesh.c | 606 ------
source/blender/blenkernel/intern/Makefile | 5 -
source/blender/blenkernel/intern/image.c | 17 +-
source/blender/blenkernel/intern/mesh.c | 52 +-
source/blender/blenkernel/intern/object.c | 4 -
.../blender/blenkernel/intern/verse_bitmap_node.c | 448 -----
.../blenkernel/intern/verse_geometry_node.c | 2098 --------------------
source/blender/blenkernel/intern/verse_method.c | 519 -----
source/blender/blenkernel/intern/verse_node.c | 747 -------
.../blender/blenkernel/intern/verse_object_node.c | 617 ------
source/blender/blenkernel/intern/verse_session.c | 478 -----
source/blender/blenkernel/intern/writeavi.c | 2 +-
source/blender/blenkernel/intern/writeffmpeg.c | 2 +-
source/blender/blenlib/BLI_editVert.h | 9 -
source/blender/blenlib/BLI_storage_types.h | 3 -
source/blender/blenlib/CMakeLists.txt | 5 -
source/blender/blenlib/SConscript | 4 -
source/blender/blenloader/CMakeLists.txt | 6 -
source/blender/blenloader/SConscript | 7 +-
source/blender/blenloader/intern/Makefile | 5 -
source/blender/blenloader/intern/writefile.c | 25 -
source/blender/editors/CMakeLists.txt | 9 -
source/blender/editors/screen/CMakeLists.txt | 9 -
source/blender/editors/space_outliner/outliner.c | 6 +-
source/blender/editors/transform/transform.h | 7 -
.../editors/transform/transform_conversions.c | 23 +-
.../blender/editors/transform/transform_generics.c | 59 -
source/blender/imbuf/CMakeLists.txt | 5 -
source/blender/imbuf/SConscript | 4 -
source/blender/makesdna/DNA_ID.h | 9 -
source/blender/makesdna/DNA_image_types.h | 4 -
source/blender/makesdna/DNA_mesh_types.h | 4 -
source/blender/makesdna/DNA_object_types.h | 4 -
source/blender/makesrna/intern/rna_image.c | 1 -
source/blender/nodes/CMakeLists.txt | 9 -
source/blender/nodes/SConscript | 7 -
source/blender/python/CMakeLists.txt | 9 -
source/blender/python/intern/Makefile | 10 -
source/blender/windowmanager/CMakeLists.txt | 9 -
source/blender/windowmanager/intern/Makefile | 9 -
source/blender/windowmanager/intern/wm_init_exit.c | 3 -
source/creator/CMakeLists.txt | 1 -
source/nan_definitions.mk | 4 -
source/nan_link.mk | 3 -
tools/btools.py | 12 -
144 files changed, 28 insertions(+), 27435 deletions(-)
delete mode 100644 extern/verse/CMakeLists.txt
delete mode 100644 extern/verse/Makefile
delete mode 100644 extern/verse/dist/BUGS
delete mode 100644 extern/verse/dist/CMakeLists.txt
delete mode 100644 extern/verse/dist/MAINTAINERS
delete mode 100644 extern/verse/dist/Makefile
delete mode 100644 extern/verse/dist/Makefile.win32
delete mode 100644 extern/verse/dist/README.html
delete mode 100644 extern/verse/dist/SConstruct
delete mode 100644 extern/verse/dist/examples/list-nodes.c
delete mode 100644 extern/verse/dist/mkprot_cmd/CMakeLists.txt
delete mode 100644 extern/verse/dist/resources/Makefile.win32
delete mode 100644 extern/verse/dist/resources/verse.ico
delete mode 100644 extern/verse/dist/resources/verse.rc
delete mode 100644 extern/verse/dist/resources/verse.res
delete mode 100644 extern/verse/dist/v_bignum.c
delete mode 100644 extern/verse/dist/v_bignum.h
delete mode 100644 extern/verse/dist/v_cmd_buf.c
delete mode 100644 extern/verse/dist/v_cmd_buf.h
delete mode 100644 extern/verse/dist/v_cmd_def_a.c
delete mode 100644 extern/verse/dist/v_cmd_def_b.c
delete mode 100644 extern/verse/dist/v_cmd_def_c.c
delete mode 100644 extern/verse/dist/v_cmd_def_g.c
delete mode 100644 extern/verse/dist/v_cmd_def_m.c
delete mode 100644 extern/verse/dist/v_cmd_def_o.c
delete mode 100644 extern/verse/dist/v_cmd_def_s.c
delete mode 100644 extern/verse/dist/v_cmd_def_t.c
delete mode 100644 extern/verse/dist/v_cmd_gen.c
delete mode 100644 extern/verse/dist/v_cmd_gen.h
delete mode 100644 extern/verse/dist/v_connect.c
delete mode 100644 extern/verse/dist/v_connection.c
delete mode 100644 extern/verse/dist/v_connection.h
delete mode 100644 extern/verse/dist/v_encryption.c
delete mode 100644 extern/verse/dist/v_encryption.h
delete mode 100644 extern/verse/dist/v_func_storage.c
delete mode 100644 extern/verse/dist/v_gen_pack_a_node.c
delete mode 100644 extern/verse/dist/v_gen_pack_b_node.c
delete mode 100644 extern/verse/dist/v_gen_pack_c_node.c
delete mode 100644 extern/verse/dist/v_gen_pack_g_node.c
delete mode 100644 extern/verse/dist/v_gen_pack_init.c
delete mode 100644 extern/verse/dist/v_gen_pack_m_node.c
delete mode 100644 extern/verse/dist/v_gen_pack_o_node.c
delete mode 100644 extern/verse/dist/v_gen_pack_s_node.c
delete mode 100644 extern/verse/dist/v_gen_pack_t_node.c
delete mode 100644 extern/verse/dist/v_gen_unpack_func.h
delete mode 100644 extern/verse/dist/v_gen_unpack_funcs.h
delete mode 100644 extern/verse/dist/v_internal_verse.h
delete mode 100644 extern/verse/dist/v_man_pack_node.c
delete mode 100644 extern/verse/dist/v_network.c
delete mode 100644 extern/verse/dist/v_network.h
delete mode 100644 extern/verse/dist/v_network_in_que.c
delete mode 100644 extern/verse/dist/v_network_in_que.h
delete mode 100644 extern/verse/dist/v_network_out_que.c
delete mode 100644 extern/verse/dist/v_network_out_que.h
delete mode 100644 extern/verse/dist/v_pack.c
delete mode 100644 extern/verse/dist/v_pack.h
delete mode 100644 extern/verse/dist/v_pack_method.c
delete mode 100644 extern/verse/dist/v_prime.c
delete mode 100644 extern/verse/dist/v_randgen.c
delete mode 100644 extern/verse/dist/v_randgen.h
delete mode 100644 extern/verse/dist/v_util.c
delete mode 100644 extern/verse/dist/v_util.h
delete mode 100644 extern/verse/dist/verse.h
delete mode 100644 extern/verse/dist/verse_header.h
delete mode 100644 extern/verse/dist/verse_ms.c
delete mode 100644 extern/verse/dist/verse_ms.h
delete mode 100644 extern/verse/dist/vs_connection.c
delete mode 100644 extern/verse/dist/vs_main.c
delete mode 100644 extern/verse/dist/vs_master.c
delete mode 100644 extern/verse/dist/vs_node_audio.c
delete mode 100644 extern/verse/dist/vs_node_bitmap.c
delete mode 100644 extern/verse/dist/vs_node_curve.c
delete mode 100644 extern/verse/dist/vs_node_geometry.c
delete mode 100644 extern/verse/dist/vs_node_head.c
delete mode 100644 extern/verse/dist/vs_node_material.c
delete mode 100644 extern/verse/dist/vs_node_object.c
delete mode 100644 extern/verse/dist/vs_node_particle.c
delete mode 100644 extern/verse/dist/vs_node_storage.c
delete mode 100644 extern/verse/dist/vs_node_text.c
delete mode 100644 extern/verse/dist/vs_server.h
delete mode 100644 extern/verse/make/msvc_7_0/libverse.vcproj
delete mode 100644 extern/verse/make/msvc_7_0/verse.vcproj
delete mode 100644 extern/verse/make/msvc_9_0/libverse.vcproj
delete mode 100644 extern/verse/make/msvc_9_0/verse.vcproj
delete mode 100644 source/blender/blenkernel/BKE_verse.h
delete mode 100644 source/blender/blenkernel/intern/verse_bitmap_node.c
delete mode 100644 source/blender/blenkernel/intern/verse_geometry_node.c
delete mode 100644 source/blender/blenkernel/intern/verse_method.c
delete mode 100644 source/blender/blenkernel/intern/verse_node.c
delete mode 100644 source/blender/blenkernel/intern/verse_object_node.c
delete mode 100644 source/blender/blenkernel/intern/verse_session.c
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2616bff79a3..a593f762387 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,7 +57,6 @@ OPTION(WITH_PLAYER "Build Player" OFF)
OPTION(WITH_GAMEENGINE "Enable Game Engine" ON)
OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
-OPTION(WITH_VERSE "Enable Verse (http://verse.blender.org)" OFF)
OPTION(WITH_ELBEEM "Enable Elbeem (Fluid Simulation)" ON)
OPTION(WITH_QUICKTIME "Enable Quicktime Support" OFF)
OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON)
@@ -425,7 +424,6 @@ ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
#-----------------------------------------------------------------------------
# Common.
-SET(VERSE_INC ${CMAKE_SOURCE_DIR}/extern/verse/dist)
SET(FTGL ${CMAKE_SOURCE_DIR}/extern/bFTGL)
SET(FTGL_INC ${FTGL}/include)
diff --git a/config/darwin-config.py b/config/darwin-config.py
index 3ef7b7132d9..8719c5e7da0 100644
--- a/config/darwin-config.py
+++ b/config/darwin-config.py
@@ -46,12 +46,6 @@ if USE_SDK==True:
#BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
#BF_FFMPEG_LIB = 'avformat.a avcodec.a avutil.a'
-WITH_BF_VERSE = False
-BF_VERSE = "#extern/verse/dist"
-BF_VERSE_LIBPATH = "${BF_BUILDDIR}/extern/verse/dist"
-BF_VERSE_INCLUDE = BF_VERSE
-BF_VERSE_LIBS = "libverse"
-
# python.org libs install in /library we want to use that for 2.5
#
# if you want py2.5 on leopard without installing
diff --git a/config/irix6-config.py b/config/irix6-config.py
index b643affb0b3..eb6c46b38de 100644
--- a/config/irix6-config.py
+++ b/config/irix6-config.py
@@ -2,10 +2,6 @@ import os
LCGDIR = os.getcwd()+"/../lib/irix-6.5-mips"
LIBDIR = LCGDIR
-print LCGDIR
-
-WITH_BF_VERSE = 'false'
-BF_VERSE_INCLUDE = "#extern/verse/dist"
BF_PYTHON = LCGDIR+'/python'
BF_PYTHON_VERSION = '2.5'
diff --git a/config/linux2-config.py b/config/linux2-config.py
index 2984c06d2df..522ddbafb3f 100644
--- a/config/linux2-config.py
+++ b/config/linux2-config.py
@@ -1,9 +1,6 @@
LCGDIR = '../lib/linux2'
LIBDIR = "${LCGDIR}"
-WITH_BF_VERSE = False
-BF_VERSE_INCLUDE = "#extern/verse/dist"
-
BF_PYTHON = '/usr'
BF_PYTHON_VERSION = '2.5'
WITH_BF_STATICPYTHON = False
diff --git a/config/linuxcross-config.py b/config/linuxcross-config.py
index 5981c8b96e5..8c643b75d63 100644
--- a/config/linuxcross-config.py
+++ b/config/linuxcross-config.py
@@ -1,9 +1,6 @@
LCGDIR = '#../lib/windows'
LIBDIR = '${LCGDIR}'
-WITH_BF_VERSE = False
-BF_VERSE_INCLUDE = "#extern/verse/dist"
-
WITH_BF_YAFRAY = True
BF_PYTHON = LIBDIR + '/python'
diff --git a/config/win32-mingw-config.py b/config/win32-mingw-config.py
index e9e9aac1589..d69e4bfc7bc 100644
--- a/config/win32-mingw-config.py
+++ b/config/win32-mingw-config.py
@@ -1,9 +1,6 @@
LCGDIR = '#../lib/windows'
LIBDIR = "${LCGDIR}"
-WITH_BF_VERSE = False
-BF_VERSE_INCLUDE = "#extern/verse/dist"
-
BF_PYTHON = LIBDIR + '/python'
BF_PYTHON_VERSION = '2.5'
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
diff --git a/config/win32-vc-config.py b/config/win32-vc-config.py
index 8ba8c8f04e6..b21c50c913e 100644
--- a/config/win32-vc-config.py
+++ b/config/win32-vc-config.py
@@ -1,9 +1,6 @@
LCGDIR = '#../lib/windows'
LIBDIR = '${LCGDIR}'
-WITH_BF_VERSE = False
-BF_VERSE_INCLUDE = "#extern/verse/dist"
-
# enable ffmpeg support
WITH_BF_FFMPEG = True # -DWITH_FFMPEG
BF_FFMPEG = LIBDIR +'/ffmpeg'
diff --git a/extern/SConscript b/extern/SConscript
index 4c892e1956d..972d2a8e703 100644
--- a/extern/SConscript
+++ b/extern/SConscript
@@ -14,9 +14,6 @@ if env['WITH_BF_BULLET']:
if env['WITH_BF_INTERNATIONAL']:
SConscript(['bFTGL/SConscript'])
-if env['WITH_BF_VERSE']:
- SConscript(['verse/dist/SConstruct'])
-
if env['WITH_BF_FFMPEG'] and env['BF_FFMPEG_LIB'] == '':
SConscript(['x264/SConscript'])
SConscript(['libmp3lame/SConscript'])
diff --git a/extern/verse/CMakeLists.txt b/extern/verse/CMakeLists.txt
deleted file mode 100644
index 318a550668e..00000000000
--- a/extern/verse/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-# $Id$
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# The Original Code is Copyright (C) 2006, Blender Foundation
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): Jacques Beaurain.
-#
-# ***** END GPL LICENSE BLOCK *****
-
-SUBDIRS(dist)
-
diff --git a/extern/verse/Makefile b/extern/verse/Makefile
deleted file mode 100644
index 51dc5543d2a..00000000000
--- a/extern/verse/Makefile
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# The Original Code is Copyright (C) 2002 by Hans Lambermont
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): Jiri Hnidek
-#
-# ***** END GPL LICENSE BLOCK *****
-LIBNAME = verse
-SOURCEDIR = extern/$(LIBNAME)
-DIR = $(OCGDIR)/$(SOURCEDIR)
-DIRS = dist
-
-include nan_subdirs.mk
-include nan_compile.mk
-include nan_link.mk
-
-DISTDIR = dist
-CP = ../../intern/tools/cpifdiff.sh
-
-ifeq ($(OS),windows)
- EXT = .exe
-endif
-
-install: all debug
- @[ -d $(NAN_VERSE) ] || mkdir -p $(NAN_VERSE)
- @[ -d $(NAN_VERSE)/include ] || mkdir -p $(NAN_VERSE)/include
- @[ -d $(NAN_VERSE)/lib ] || mkdir -p $(NAN_VERSE)/lib
- @[ -d $(OCGDIR)/bin ] || mkdir -p $(OCGDIR)/bin
- @$(CP) $(DISTDIR)/*.h $(NAN_VERSE)/include
- @$(CP) $(DIR)/libverse.a $(NAN_VERSE)/lib
-ifeq ($(OS),darwin)
- ranlib $(NAN_VERSE)/lib/libverse.a
-endif
- $(CCC) $(CCFLAGS) $(LDFLAGS) -o $(DIR)/verse$(EXT) $(DIR)/libverse.a $(LIBS) $(SLIBS) $(LLIBS) $(DADD) $(LOPTS)
- @$(CP) $(DIR)/verse$(EXT) $(OCGDIR)/bin
diff --git a/extern/verse/dist/BUGS b/extern/verse/dist/BUGS
deleted file mode 100644
index 8c3603a3a45..00000000000
--- a/extern/verse/dist/BUGS
+++ /dev/null
@@ -1,8 +0,0 @@
-
-Known problems with Verse
-
-2004-03-03
-* The source code needs plenty of cleaning up in order to compile more
- cleanly.
-* License information needs to be added all over the place.
-* Decent documentation is missing.
diff --git a/extern/verse/dist/CMakeLists.txt b/extern/verse/dist/CMakeLists.txt
deleted file mode 100644
index ae130df6410..00000000000
--- a/extern/verse/dist/CMakeLists.txt
+++ /dev/null
@@ -1,90 +0,0 @@
-# $Id$
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# The Original Code is Copyright (C) 2006, Blender Foundation
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): Jacques Beaurain.
-#
-# ***** END GPL LICENSE BLOCK *****
-
-SUBDIRS(mkprot_cmd)
-
-SET(SRC_MKPROT_OUT
- v_gen_pack_init.c
- v_gen_pack_a_node.c
- v_gen_pack_b_node.c
- v_gen_pack_c_node.c
- v_gen_pack_g_node.c
- v_gen_pack_m_node.c
- v_gen_pack_o_node.c
- v_gen_pack_s_node.c
- v_gen_pack_t_node.c
-)
-
-SET(INC .)
-
-SET(SRC
- v_cmd_buf.c
- v_connect.c
- v_connection.c
- v_encryption.c
- v_func_storage.c
- v_man_pack_node.c
- v_network.c
- v_network_in_que.c
- v_network_out_que.c
- v_pack.c
- v_pack_method.c
- v_prime.c
- v_randgen.c
- v_util.c
- v_bignum.c
- verse_ms.c
- ${SRC_MKPROT_OUT}
-)
-
-BLENDERLIB(verse "${SRC}" "${INC}")
-ADD_DEPENDENCIES(verse mkprot)
-#verselib = env.BlenderLib(libname='verse', sources=lib_source_files, includes=[], defines=defines, libtype=['core', 'intern'], priority = [5, 5])
-
-SET(SRC_VERSE
- vs_connection.c
- vs_main.c
- vs_node_audio.c
- vs_node_bitmap.c
- vs_node_curve.c
- vs_node_geometry.c
- vs_node_head.c
- vs_node_material.c
- vs_node_object.c
- vs_node_particle.c
- vs_node_storage.c
- vs_node_text.c
- vs_master.c
-)
-
-ADD_EXECUTABLE(verse_server ${SRC_VERSE})
-IF(WIN32)
-TARGET_LINK_LIBRARIES(verse_server verse ws2_32)
-ELSE(WIN32)
-TARGET_LINK_LIBRARIES(verse_server verse)
-ENDIF(WIN32)
-ADD_DEPENDENCIES(verse_server mkprot)
-MESSAGE(STATUS "Configuring verse_server")
diff --git a/extern/verse/dist/MAINTAINERS b/extern/verse/dist/MAINTAINERS
deleted file mode 100644
index c467d5309b8..00000000000
--- a/extern/verse/dist/MAINTAINERS
+++ /dev/null
@@ -1,15 +0,0 @@
-
- Verse Maintainers
-
-This file tries to list credits for the various parts of the
-Verse core distribution, and also identify who maintains what.
-
-We are deeply appreciative of any contributions and thank you
-all for your time and interest in helping make Verse a better
-thing.
-
-* All code was originally written by Eskil Steenberg, and is
- being maintained by him and Emil Brink. Contact us through
- the project page at http://www.blender.org/modules/verse/.
-
-* SCons build file by N. Letwory, http://www.jester-depot.net/.
diff --git a/extern/verse/dist/Makefile b/extern/verse/dist/Makefile
deleted file mode 100644
index 69b5590b2bc..00000000000
--- a/extern/verse/dist/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# Makefile for Verse core; API and reference server.
-# This pretty much requires GNU Make, I think.
-#
-# This build is slightly complicated that part of the C code that
-# needs to go into the API implementation is generated by building
-# and running other C files (this is the protocol definition).
-#
-
-LIBNAME = verse
-DIR = $(OCGDIR)/extern/$(LIBNAME)
-
-include nan_compile.mk
-
-# TARGETS = verse
diff --git a/extern/verse/dist/Makefile.win32 b/extern/verse/dist/Makefile.win32
deleted file mode 100644
index 548881c6a16..00000000000
--- a/extern/verse/dist/Makefile.win32
+++ /dev/null
@@ -1,102 +0,0 @@
-#
-# Makefile for Verse core; API and reference server.
-# Written by modifying the main GNU Makefile, for nmake.
-#
-# It is more hard-coded, relying on less intelligence in
-# the make tool.
-#
-# This build is slightly complicated that part of the C code that
-# needs to go into the API implementation is generated by building
-# and running other C files (this is the protocol definition).
-#
-
-CC = cl
-CFLAGS =
-LDFLAGS = -pg
-
-AR = ar
-ARFLAGS = rus
-RANLIB = ranlib
-
-TARGETS = verse.lib verse.exe
-
-# Automatically generated protocol things.
-PROT_DEF = v_cmd_def_a.c v_cmd_def_b.c v_cmd_def_c.c v_cmd_def_g.c v_cmd_def_m.c v_cmd_def_o.c v_cmd_def_s.c v_cmd_def_t.c
-PROT_TOOL = v_cmd_gen.c $(PROT_DEF)
-PROT_OUT = v_gen_pack_init.c v_gen_unpack_func.h verse.h \
- v_gen_pack_a_node.c v_gen_pack_b_node.c v_gen_pack_c_node.c v_gen_pack_g_node.c v_gen_pack_m_node.c v_gen_pack_o_node.c v_gen_pack_s_node.c v_gen_pack_t_node.c
-
-# The API implementation is the protocol code plus a few bits.
-LIBVERSE_SRC = v_gen_pack_init.c v_gen_unpack_func.h verse.h v_gen_pack_a_node.c v_gen_pack_b_node.c v_gen_pack_c_node.c v_gen_pack_g_node.c \
- v_gen_pack_m_node.c v_gen_pack_o_node.c v_gen_pack_s_node.c v_gen_pack_t_node.c \
- v_bignum.c v_cmd_buf.c v_connect.c \
- v_connection.c v_connection.h v_encryption.c \
- v_func_storage.c v_internal_verse.h v_man_pack_node.c \
- v_network.c v_network.h v_network_in_que.c v_network_out_que.c \
- v_pack.c v_pack.h v_pack_method.c v_prime.c v_randgen.c v_util.c
-
-LIBVERSE_OBJ = v_gen_pack_init.obj v_gen_pack_a_node.obj v_gen_pack_b_node.obj v_gen_pack_c_node.obj v_gen_pack_g_node.obj \
- v_gen_pack_m_node.obj v_gen_pack_o_node.obj v_gen_pack_s_node.obj v_gen_pack_t_node.obj \
- v_bignum.obj v_cmd_buf.obj v_connect.obj \
- v_connection.obj v_encryption.obj \
- v_func_storage.obj v_man_pack_node.obj \
- v_network.obj v_network_in_que.obj v_network_out_que.obj \
- v_pack.obj v_pack_method.obj v_prime.obj v_randgen.obj v_util.obj
-
-# The server is a simple 1:1 mapping, but in Windows nmake ... That doesn't help much. :/
-VERSE_SRC = vs_connection.c vs_main.c vs_master.c vs_node_audio.c vs_node_bitmap.c vs_node_curve.c vs_node_geometry.c vs_node_head.c vs_node_material.c vs_node_object.c vs_node_particle.c vs_node_storage.c vs_node_text.c
-VERSE_OBJ = vs_connection.obj vs_main.obj vs_master.obj vs_node_audio.obj vs_node_bitmap.obj vs_node_curve.obj vs_node_geometry.obj \
- vs_node_head.obj vs_node_material.obj vs_node_object.obj vs_node_particle.obj vs_node_storage.obj vs_node_text.obj
-
-# -----------------------------------------------------
-
-ALL: verse.lib verse.exe
-
-verse.exe: $(VERSE_OBJ) verse.lib resources\verse.res
- cl /Fe$@ $** wsock32.lib
-
-verse.lib: $(LIBVERSE_OBJ)
- link /lib /nologo /out:$@ $**
-
-# -----------------------------------------------------
-
-# Here are the automatically generated pieces of the puzzle.
-# Basically, we generate v_gen_pack_X_node.c files by compiling
-# the v_cmd_def_X.c files together with some driver glue and
-# running the result.
-#
-
-# The autogen outputs all depend on the tool.
-$(PROT_OUT): mkprot.exe
- mkprot.exe
-
-# Build the protocol maker, from the definitions themselves.
-mkprot.exe: $(PROT_TOOL) verse_header.h
- $(CC) /DV_GENERATE_FUNC_MODE /Fe$@ $(PROT_TOOL)
-
-# Clean away all the generated parts of the protocol implementation.
-cleanprot: clean
- del mkprot $(PROT_OUT) mkprot.exe
-
-# -----------------------------------------------------
-
-clean:
- del *.obj $(TARGETS)
-
-# -----------------------------------------------------
-
-# Utter ugliness to create release archives. Needs to improve, but should work for a while.
-dist:
- RELEASE=$$( \
- R=`grep V_RELEASE_NUMBER verse.h | tr -s ' \t' | tr -d '"\r' | cut -d' ' -f3` ; \
- P=`grep V_RELEASE_PATCH verse.h | tr -s ' \t' | tr -d '"\r' | cut -d' ' -f3` ; \
- L=`grep V_RELEASE_LABEL verse.h | tr -s ' \t' | tr -d '"\r' | cut -d' ' -f3` ; echo r$${R}p$$P$$L ) ; \
- if [ $$RELEASE ]; then ( \
- rm -rf /tmp/verse; \
- mkdir -p /tmp/verse; \
- cp -a * /tmp/verse; \
- cd /tmp && zip verse-$$RELEASE.zip -r verse -x 'verse/*CVS*' -x 'verse/.*' ; \
- ); mv /tmp/verse-$$RELEASE.zip . \
- ;else \
- echo "Couldn't auto-set RELEASE from verse.h, something is fishy" \
- ;fi
diff --git a/extern/verse/dist/README.html b/extern/verse/dist/README.html
deleted file mode 100644
index b3b3050bf12..00000000000
--- a/extern/verse/dist/README.html
+++ /dev/null
@@ -1,173 +0,0 @@
-
-
-
-
-Verse README
-
-
-
-
-Verse
-
-
-This is the Verse protocol and sample server implementations.
-
-
-For more information, see the Verse web site.
-
-Building the Verse Core
-
-Note: This section is only of interest to developers, who wish to build the Verse core themselves.
-If you have chosen a binary download, you will already have the server and can skip the rest
-of this section.
-
-
-Running "make" here will build the API library, "libverse.a" (and its
-header file, "verse.h"). These two will then be used to build the
-reference Verse server binary, called "verse".
-
-
-If you are more comfortable with SCons, and of course have it
-installed on your system, you can type "scons" instead.
-
-
-Starting the Server
-
-The Verse server is a command-line program, without a graphical user interface.
-You simply start it, and it will immediately begin listening for incoming
-connections on a network socket. Here is how a typical invocation looks:
-
-~> verse
-
-
-If you don't ask it to do otherwise, the Verse server will start listening for UDP packets
-on its default port. The port number currently used by Verse is 4950.
-
-
-Note: This is not an official registered, port number.
-It is possible that it gets assigned to someone else, in case Verse will need to change.
-
-
-You can use the following command line options to control the server's operation:
-
-
- - -h
- -
- Print a help text, that shows all understood options.
-
- - -ms
- -
- Enables master server communications to the default, built-in address. Use the -h option to learn
- what this address is. Please note that master server communication is disabled by default.
-
- - -ms:ip=IP
- -
- Sets a new address to use for master server communication. This also implies -ms, i.e. the server
- will try to register itself with the given master server. For details on the protocol used to do
- this, please see the spec.
-
- - -ms:de=DESC
- -
- Sets the description to use for this server, when registering with the the master server. This is
- only used if master server communication is actually enabled. The description is expected to be a
- human-readable string, like
"A test server, run on a cable modem, and offline during local daytime"
- or something.
-
- - -ms:ta=TAGS
- -
- Sets the tags to use for this server, when registering with the the master server. This is only used
- if master server communication is actually enabled. The tags consists of a comma-separated list of
- single words. Each word must begin with a letter, and contain only letters, digits, or underscore
- characters. For instance:
home,r6p1,linux,sweden,open
.
-
- - -port=N
- -
- Use the indicated port number, rather than the default. Note that ports below 1024 are generally
- off-limits to ordinary users. Running Verse on such a port is not recommended.
-
- - -version
- -
- Prints the version string of the server to the terminal, and then exits (successfully). See
- below for information how the version string is constructed.
-
-
-
-For example, here is how to start the server, register it with the default master server, and run
-on port number equal to 16333:
-
-~> ./server -ms -port=16333
-
-
-Here is a more complicated example, that uses an explicit master server address, and also sets both
-the description and tags:
-
-~> ./server -ms:ip=master.example.net -ms:de="A test server, for the documentation" -ms:ta=example,docs
-
-
-Options can occur in any order, with later options overriding earlier ones, in case of conflicts.
-
-
-
-
-Verse uses a simple two-level numbering scheme to identify releases.
-There is a "release number", and a "patch level" on each release. The
-intent is that within a release, the API does not change and neither
-should the network protocol. Between releases, we might improve the
-API which will require application programmers to update their code
-to stay in sync. We can do non-API-altering changes within a release
-by increasing the patch level, for bug fixing and other things.
-
-
-The symbols V_RELEASE_NUMBER
and V_RELEASE_PATCH
-are integer literals that hold the values for the API you have, and can be
-used (and displayed) in application source code as you see fit. There is
-also a string, V_RELEASE_LABEL
, which is sometimes used.
-
-
-To form a complete Verse version number, the above-mentioned symbols are
-to be combined like so:
-"r<V_RELEASE_NUMBER>
p<V_RELEASE_PATCH><V_RELEASE_LABEL>
".
-So, the following variable values:
-
-- V_RELEASE_VERSION = 2
-
- V_RELEASE_VERSION = 51
-
- V_RELEASE_LABEL = "foo"
-
-Would generate the version string "r2p51foo
".
-
-
-
-
diff --git a/extern/verse/dist/SConstruct b/extern/verse/dist/SConstruct
deleted file mode 100644
index a80a1ac79e9..00000000000
--- a/extern/verse/dist/SConstruct
+++ /dev/null
@@ -1,146 +0,0 @@
-#!/usr/bin/env python
-#
-# I think it is quite straight-forward to add new platforms,
-# just look at the old makefile and at the existing platforms.
-#
-# This SConstruct creates a configuration file which can be
-# used for tweaking a build.
-#
-# For more about SConstruct, see .
-#
-
-import os
-import os.path
-import sys
-import re
-import time
-import string
-from distutils import sysconfig
-
-Import('env')
-
-defines = []
-cflags = []
-debug_flags = []
-extra_flags = []
-release_flags = []
-warn_flags = []
-platform_libs = []
-platform_libpath = []
-platform_linkflags = []
-
-ourplatform = env['OURPLATFORM']
-if ourplatform == 'win32-vc':
- print "Building on win32"
- defines += ['_WIN32']
- warn_flags = ['/Wall']
- platform_libs = ['ws2_32']
-elif ourplatform == 'win32-mingw':
- defines += ['_WIN32', 'WIN32']
- platform_libs = ['shell32', 'kernel32', 'gdi32', 'user32', 'ws2_32']
-elif ourplatform == 'linux2':
- print "Building on linux2"
-elif ourplatform == 'openbsd3':
- print "Building on openbsd3"
-
-root_build_dir = env['BF_BUILDDIR']
-
-if env['VERSE_BUILD_BINARY'] == 'release':
- cflags = extra_flags + release_flags + warn_flags
- if ourplatform == 'win32-vc':
- defines += ['NDEBUG']
-else:
- cflags = extra_flags + debug_flags + warn_flags
- if ourplatform == 'win32-vc':
- #defines += ['_DEBUG'] specifying this makes msvc want to link to python22_d.lib??
- platform_linkflags += ['/DEBUG','/PDB:verse.pdb']
-
-
-verse_env = env.Clone()
-
-cmd_gen_files = (['v_cmd_gen.c',
- 'v_cmd_def_a.c',
- 'v_cmd_def_b.c',
- 'v_cmd_def_c.c',
- 'v_cmd_def_g.c',
- 'v_cmd_def_m.c',
- 'v_cmd_def_o.c',
- 'v_cmd_def_s.c',
- 'v_cmd_def_t.c'
- ])
-
-cmd_gen_deps = (['v_gen_pack_init.c'])
-
-proto_env = env.Clone()
-proto_env.Append(CPPDEFINES=['V_GENERATE_FUNC_MODE'])
-mkprot_tool = proto_env.Program(target = 'mkprot', source = cmd_gen_files)
-
-mkprot_re = re.compile('v_cmd_def_([a-z]{1}).c')
-def mkprot_emitter(target = None, source = None, env = None):
- newtargets = list()
- for s in source:
- p, f = os.path.split(str(s))
- m = mkprot_re.match(f)
- if m:
- newtargets.append("v_gen_pack_"+m.group(1)+"_node.c")
- newtargets.extend(['verse.h'])
- env.Depends(newtargets, mkprot_tool)
- return (newtargets, source)
-
-mkprot_bld = Builder(action = "\"" + mkprot_tool[0].abspath + "\" -src=\""+os.getcwd()+os.sep+"extern"+os.sep+"verse"+os.sep+"dist"+os.sep+os.sep+"\" -dst=\""+os.path.abspath(env['BF_BUILDDIR'])+os.sep+"extern"+os.sep+"verse"+os.sep+"dist"+os.sep+os.sep+"\"",
- emitter = mkprot_emitter)
-
-verse_env['BUILDERS']['Protocol'] = mkprot_bld
-
-cmd_gen_deps.extend(verse_env.Protocol('do_mkprot', cmd_gen_files))
-
-cmd_gen_deps.pop()
-
-lib_source_files = (['v_cmd_buf.c',
- 'v_connect.c',
- 'v_connection.c',
- 'v_encryption.c',
- 'v_func_storage.c',
- 'v_man_pack_node.c',
- 'v_network.c',
- 'v_network_in_que.c',
- 'v_network_out_que.c',
- 'v_pack.c',
- 'v_pack_method.c',
- 'v_prime.c',
- 'v_randgen.c',
- 'v_util.c',
- 'v_bignum.c',
- 'verse_ms.c'
- ])
-lib_source_files.extend(cmd_gen_deps)
-
-server_source_files = (['vs_connection.c',
- 'vs_main.c',
- 'vs_master.c',
- 'vs_node_audio.c',
- 'vs_node_bitmap.c',
- 'vs_node_curve.c',
- 'vs_node_geometry.c',
- 'vs_node_head.c',
- 'vs_node_material.c',
- 'vs_node_object.c',
- 'vs_node_particle.c',
- 'vs_node_storage.c',
- 'vs_node_text.c'
- ])
-
-verselib_env = verse_env.Clone()
-verselib_env.Append(CPPDEFINES = defines)
-
-verseserver_env = verse_env.Clone()
-verseserver_env.Append(CPPDEFINES = defines)
-verseserver_env.Append (LIBPATH = ['.'])
-verseserver_env.Append (LIBS= ['verse'])
-verseserver_env.Append (LIBS= platform_libs)
-
-verselib_env.BlenderLib(libname='verse', sources=lib_source_files, includes=["."], defines = defines, libtype=['core', 'intern', 'player'], priority = [5, 5, 100])
-verseserver_env.BlenderProg(builddir="#"+root_build_dir+os.sep, progname='verse', sources=server_source_files, libs=[],
-libpath='#'+env['BF_BUILDDIR']+'/lib')
-
-
diff --git a/extern/verse/dist/examples/list-nodes.c b/extern/verse/dist/examples/list-nodes.c
deleted file mode 100644
index 6c9cc000d7c..00000000000
--- a/extern/verse/dist/examples/list-nodes.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* A minimalist Verse example. Ask server for nodes, print information. */
-
-#include
-#include
-
-#include "verse.h" /* Bring in the Verse API. */
-
-/* A callback for connection acception: will be called when server accepts this client. */
-static void callback_accept_connect(void *user, uint32 avatar, void *address, void *connection, uint8 *host_id)
-{
- uint32 i, mask = 0;
-
- printf("Connected to a Verse host!\n\nListing nodes:\n");
-
- /* Build node subscription mask. */
- for(i = 0; i < V_NT_NUM_TYPES; i++)
- mask |= 1 << i;
- verse_send_node_index_subscribe(mask); /* Request listing of all nodes. */
-}
-
-/* A callback for node creation: is called to report information about existing nodes, too. */
-static void callback_node_create(void *user, VNodeID node_id, VNodeType type, VNodeOwner ownership)
-{
- printf(" Node #%u has type %u\n", node_id, type);
-}
-
-int main(void)
-{
- /* Register callbacks for interesting commands. */
- verse_callback_set(verse_send_connect_accept, callback_accept_connect, NULL);
- verse_callback_set(verse_send_node_create, callback_node_create, NULL);
-
- /* Kick off program by connecting to Verse host on local machine. */
- verse_send_connect("list-nodes", "", "localhost", NULL);
- while(TRUE)
- verse_callback_update(10000); /* Listen to network, get callbacks. */
-
- return EXIT_SUCCESS; /* This is never reached. */
-}
diff --git a/extern/verse/dist/mkprot_cmd/CMakeLists.txt b/extern/verse/dist/mkprot_cmd/CMakeLists.txt
deleted file mode 100644
index f6e89f912e5..00000000000
--- a/extern/verse/dist/mkprot_cmd/CMakeLists.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-# $Id$
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# The Original Code is Copyright (C) 2006, Blender Foundation
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): Jacques Beaurain.
-#
-# ***** END GPL LICENSE BLOCK *****
-
-SET(SRC
- ../v_cmd_gen.c
- ../v_cmd_def_a.c
- ../v_cmd_def_b.c
- ../v_cmd_def_c.c
- ../v_cmd_def_g.c
- ../v_cmd_def_m.c
- ../v_cmd_def_o.c
- ../v_cmd_def_s.c
- ../v_cmd_def_t.c
-)
-
-ADD_DEFINITIONS(-DV_GENERATE_FUNC_MODE)
-ADD_EXECUTABLE(mkprot ${SRC})
-
-# Uncoment the following to get verse to generate the files using dependency
-# tracking without having the generated files submitted in CVS.
-#
-#ADD_CUSTOM_COMMAND(TARGET mkprot
-# POST_BUILD
-# COMMAND mkprot -src=${CMAKE_CURRENT_SOURCE_DIR}/../ -dst=${CMAKE_CURRENT_SOURCE_DIR}/../
-# MAIN_DEPENDENCY ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/mkprot
-# WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}
-#)
-MESSAGE(STATUS "Configuring mkprot(verse)")
-
diff --git a/extern/verse/dist/resources/Makefile.win32 b/extern/verse/dist/resources/Makefile.win32
deleted file mode 100644
index 8e7b4a09bbd..00000000000
--- a/extern/verse/dist/resources/Makefile.win32
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# This builds a resource file for the Verse server, for the icon.
-#
-
-ALL: verse.res
-
-verse.res: verse.rc
-
-
-clean:
- del *.res
diff --git a/extern/verse/dist/resources/verse.ico b/extern/verse/dist/resources/verse.ico
deleted file mode 100644
index b30f4c927ef..00000000000
Binary files a/extern/verse/dist/resources/verse.ico and /dev/null differ
diff --git a/extern/verse/dist/resources/verse.rc b/extern/verse/dist/resources/verse.rc
deleted file mode 100644
index a068a6f3e3e..00000000000
--- a/extern/verse/dist/resources/verse.rc
+++ /dev/null
@@ -1 +0,0 @@
-1 ICON verse.ico
diff --git a/extern/verse/dist/resources/verse.res b/extern/verse/dist/resources/verse.res
deleted file mode 100644
index ed4db6ca27f..00000000000
Binary files a/extern/verse/dist/resources/verse.res and /dev/null differ
diff --git a/extern/verse/dist/v_bignum.c b/extern/verse/dist/v_bignum.c
deleted file mode 100644
index 3f65af03427..00000000000
--- a/extern/verse/dist/v_bignum.c
+++ /dev/null
@@ -1,860 +0,0 @@
-/*
- * Routines for big (thousands of bits) unsigned integers, and
- * doing simple maths operations on them. Written by Emil Brink.
- *
- * Part of the Verse core, see license details elsewhere.
- *
- * Bignums are represented as vectors of VBigDig (unsigned short),
- * where the first element holds the length of the number in such
- * digits. So a 32-bit number would be { 2, low, high }; digits are
- * in little-endian format.
- *
- * Verse's uint16 and uint32 types are *not* used, since there is no
- * need to limit the bits. If your machine has 32-bit shorts and 64-
- * bit ints, this code should cope.
- *
- * By using unsigned shorts, which are assumed to be half the size of
- * an unsigned int, we can easily do intermediary steps in int-sized
- * variables, and thus get space for manual carry-management.
- *
- * This is the second incarnation of this code, the first one used
- * a fixed 2,048-bit VBigNum structure passed by value. It had to be
- * replaced since it was too weak for the desired functionality. Now,
- * there's roughly 1,5 weeks of time gone into this code, which still
- * means it's optimized for simplicity rather than speed.
- *
- * There has been neither time nor interest to meditate over FFTs and
- * Karatsubas. Reasonable improvements are of course welcome, although
- * this code *should* not be a bottleneck. Famous last words...
- *
- * In general, these routines do not do a lot of error checking, they
- * assume you know what you're doing. Numbers must have >0 digits.
- * Shifts should not be overly large (1e3 bits: safe, ~2e9+: avoid).
-*/
-
-#include
-#include
-#include
-#include
-
-#include "v_randgen.h"
-
-#include "v_bignum.h"
-
-#define MAX_DIG ((1UL << V_BIGBITS) - 1)
-
-/* ----------------------------------------------------------------------------------------- */
-
-/* Some routines need temporary storage to hold a term or two (the multi-
- * plier, for instance). Since we don't want to use malloc()/free(), let's
- * just have a bunch of digits that it's possible to allocate from in a
- * stack-like manner.
-*/
-static VBigDig heap[2048 + 32];
-static unsigned int heap_pos;
-
-/* Allocate a number of digits, returning it un-initialized. */
-static VBigDig * bignum_alloc(unsigned int n)
-{
- VBigDig *y;
-
- if(heap_pos + n > sizeof heap / sizeof *heap)
- {
- printf("Out of memory in bignum heap -- unbalanced calls?\n");
- return NULL;
- }
- y = heap + heap_pos;
- heap_pos += n + 1;
- *y = n;
- return y;
-}
-
-/* Free a number previously allocated by bignum_allow() above. MUST match in sequences. */
-static void bignum_free(const VBigDig *x)
-{
- heap_pos -= *x + 1;
-}
-
-/* ----------------------------------------------------------------------------------------- */
-
-/* Set x from bits. External representation is big-endian byte array. */
-void v_bignum_raw_import(VBigDig *x, const void *bits)
-{
- const unsigned char *bytes = bits;
- int i;
-
- for(i = *x++ - 1; i >= 0; i--)
- {
- x[i] = ((VBigDig) *bytes++) << 8;
- x[i] |= *bytes++;
- }
-}
-
-/* Set bits to value of x. External representation is big-endian byte array. */
-void v_bignum_raw_export(const VBigDig *x, void *bits)
-{
- unsigned char *bytes = bits;
- int i;
-
- for(i = *x++ - 1; i >= 0; i--)
- {
- *bytes++ = x[i] >> 8;
- *bytes++ = (unsigned char) x[i];
- }
-}
-
-/* ----------------------------------------------------------------------------------------- */
-
-/* Assigns x = 0. */
-void v_bignum_set_zero(VBigDig *x)
-{
- memset(x + 1, 0, *x * sizeof *x);
-}
-
-/* Assigns x = 1. */
-void v_bignum_set_one(VBigDig *x)
-{
- int i;
-
- for(i = *x++ - 1, *x++ = 1; i > 0; i--)
- *x++ = 0;
-}
-
-/* Assigns x = y. */
-void v_bignum_set_digit(VBigDig *x, VBigDig y)
-{
- v_bignum_set_zero(x);
- x[1] = y;
-}
-
-/* Assigns x = , with string in decimal ASCII. Kind of slow. */
-void v_bignum_set_string(VBigDig *x, const char *string)
-{
- unsigned int d;
-
- v_bignum_set_zero(x);
- for(; *string && isdigit(*string); string++)
- {
- v_bignum_mul_digit(x, 10);
- d = *string - '0';
- v_bignum_add_digit(x, d);
- }
-}
-
-/* Assigns x = , with string in hexadecimal ASCII. */
-void v_bignum_set_string_hex(VBigDig *x, const char *string)
-{
- unsigned int d;
-
- if(string[0] == '0' && (string[1] == 'x' || string[1] == 'X'))
- string += 2;
- v_bignum_set_zero(x);
- for(; *string && isxdigit(*string); string++)
- {
- v_bignum_bit_shift_left(x, 4);
- d = tolower(*string) - '0';
- if(d > 9)
- d -= ('a' - '0') - 10;
- x[1] |= (d & 0xF);
- }
-}
-
-/* Performs x = y, taking care to handle different precisions correctly by truncating. */
-void v_bignum_set_bignum(VBigDig *x, const VBigDig *y)
-{
- int xs, ys, i, s;
-
- xs = x[0];
- ys = y[0];
- if(xs == ys) /* For same sizes, just memcpy() and be done. */
- {
- memcpy(x + 1, y + 1, xs * sizeof *x);
- return;
- }
- else if(ys > xs)
- s = xs;
- else
- s = ys;
- /* Copy as many digits as will fit, and clear any remaining high digits. */
- for(i = 1; i <= s; i++)
- x[i] = y[i];
- for(; i <= xs; i++)
- x[i] = 0;
-}
-
-/* Performs x = y[msb:msb-bits], right-adjusting the result. */
-void v_bignum_set_bignum_part(VBigDig *x, const VBigDig *y, unsigned int msb, unsigned int bits)
-{
- unsigned int i, bit;
-
- v_bignum_set_zero(x);
- if(y == NULL || msb > (y[0] * (CHAR_BIT * sizeof *x)))
- return;
- for(i = 0; i < bits; i++)
- {
- bit = msb - (bits - 1) + i;
- if(v_bignum_bit_test(y, bit))
- v_bignum_bit_set(x, i);
- }
-}
-
-/* Set x to a random bunch of bits. Should use a real random source. */
-void v_bignum_set_random(VBigDig *x, VRandGen *gen)
-{
- unsigned int s = *x++;
-
- if(gen != NULL)
- v_randgen_get(gen, x, s * sizeof *x);
- else
- {
- fprintf(stderr, "** Warning: Calling v_bignum_set_random() without VRandGen is potentially expensive\n");
- if((gen = v_randgen_new()) != NULL)
- {
- v_randgen_get(gen, x, s * sizeof *x);
- v_randgen_destroy(gen);
- }
- else
- fprintf(stderr, __FILE__ ": Couldn't create random number generator\n");
- }
-}
-
-/* Print x in hexadecimal, with 0x prefix but no linefeed. */
-void v_bignum_print_hex(const VBigDig *x)
-{
- int i, s = *x;
-
- printf("0x");
- for(i = 0; i < s; i++)
- printf("%04X", x[s - i]);
-}
-
-/* Print x in hexadecimal, with linefeed. */
-void v_bignum_print_hex_lf(const VBigDig *x)
-{
- v_bignum_print_hex(x);
- printf("\n");
-}
-
-/* ----------------------------------------------------------------------------------------- */
-
-/* x = ~x. */
-void v_bignum_not(VBigDig *x)
-{
- unsigned int i, s = *x++;
-
- for(i = 0; i < s; i++)
- x[i] = ~x[i];
-}
-
-int v_bignum_bit_test(const VBigDig *x, unsigned int bit)
-{
- unsigned int slot = bit / (CHAR_BIT * sizeof *x), m = 1 << (bit % (CHAR_BIT * sizeof *x));
-
- if(slot < x[0])
- return (x[slot + 1] & m) != 0;
- return 0;
-}
-
-/* Compute x |= (1 << bit). */
-void v_bignum_bit_set(VBigDig *x, unsigned int bit)
-{
- unsigned int slot, m;
-
- if(bit >= (*x * (CHAR_BIT * sizeof *x)))
- return;
- slot = bit / (CHAR_BIT * sizeof *x);
- m = 1 << (bit % (CHAR_BIT * sizeof *x));
- x[1 + slot] |= m;
-}
-
-/* Returns index of most signifant '1' bit of x, or -1 if x == 0. */
-int v_bignum_bit_msb(const VBigDig *x)
-{
- int i;
- unsigned int s = *x++;
-
- for(i = s - 1; i >= 0; i--)
- {
- if(x[i] != 0)
- {
- int bit = (i + 1) * (CHAR_BIT * sizeof *x) - 1;
- VBigDig d = x[i], mask;
-
- for(mask = 1 << (CHAR_BIT * sizeof *x - 1); mask != 0; mask >>= 1, bit--)
- {
- if(d & mask)
- return bit;
- }
- }
- }
- return -1;
-}
-
-int v_bignum_bit_size(const VBigDig *x)
-{
- return *x * V_BIGBITS;
-}
-
-/* Perform x <<= count. */
-void v_bignum_bit_shift_left(VBigDig *x, unsigned int count)
-{
- unsigned int t, carry, s = *x++;
- register int i;
-
- if(count >= CHAR_BIT * sizeof *x) /* Shift whole digits. */
- {
- unsigned int places = count / (CHAR_BIT * sizeof *x);
-
- for(i = s - 1; i >= (int) places; i--)
- x[i] = x[i - places];
- for(; i >= 0; i--) /* Clear out the LSBs. */
- x[i] = 0;
- count -= places * (CHAR_BIT * sizeof *x);
- if(count == 0)
- return;
- }
- /* Shift bits. */
- for(i = carry = 0; i < (int) s; i++)
- {
- t = (x[i] << count) | carry;
- x[i] = t;
- carry = t >> (CHAR_BIT * sizeof *x);
- }
-}
-
-/* Perform x <<= 1. This is a frequent operation so it can have its own function. */
-void v_bignum_bit_shift_left_1(VBigDig *x)
-{
- register unsigned int t, carry, s = *x++, i;
-
- /* Shift bits. */
- for(i = carry = 0; i < s; i++)
- {
- t = (x[i] << 1) | carry;
- x[i] = t;
- carry = t >> (CHAR_BIT * sizeof *x);
- }
-}
-
-/* Perform x >>= count. */
-void v_bignum_bit_shift_right(VBigDig *x, unsigned int count)
-{
- unsigned int t, carry, s = *x++;
- int i;
-
- /* Shift entire digits first. */
- if(count >= CHAR_BIT * sizeof *x)
- {
- unsigned int places = count / (CHAR_BIT * sizeof *x);
-
- if(places > s)
- {
- memset(x, 0, s * sizeof *x);
- return;
- }
- for(i = 0; i < (int) (s - places); i++)
- x[i] = x[i + places];
- for(; i < (int) s; i++)
- x[i] = 0;
- count -= places * CHAR_BIT * sizeof *x;
- if(count == 0)
- return;
- }
- /* Shift any remaining bits. */
- for(i = s - 1, carry = 0; i >= 0; i--)
- {
- t = x[i] << (CHAR_BIT * sizeof *x);
- t >>= count;
- t |= carry;
- carry = (t & MAX_DIG) << (CHAR_BIT * sizeof *x);
- x[i] = t >> (CHAR_BIT * sizeof *x);
- }
-}
-
-/* ----------------------------------------------------------------------------------------- */
-
-/* Return x == 0. */
-int v_bignum_eq_zero(const VBigDig *x)
-{
- unsigned int i, s = *x++;
-
- for(i = 0; i < s; i++)
- if(x[i])
- return 0;
- return 1;
-}
-
-/* Return x == 1. */
-int v_bignum_eq_one(const VBigDig *x)
-{
- unsigned int i, s = *x++;
-
- if(x[0] != 1)
- return 0;
- for(i = 1; i < s; i++)
- if(x[i])
- return 0;
- return 1;
-}
-
-/* Returns x == y, handling different lengths properly. */
-int v_bignum_eq(const VBigDig *x, const VBigDig *y)
-{
- unsigned int i, xs, ys, cs;
-
- if(x == y) /* Quick test thanks to pointer representation. */
- return 1;
- xs = *x++;
- ys = *y++;
-
- if(xs == ys) /* Same size? Then let's be quick about this. */
- return memcmp(x, y, xs * sizeof *x) == 0;
- else
- {
- cs = xs < ys ? xs : ys; /* Common size. */
- if(memcmp(x, y, cs * sizeof *x) == 0)
- {
- const VBigDig *l;
-
- if(cs == xs) /* y is longer. */
- l = y, i = ys - 1;
- else
- l = x, i = xs - 1;
- for(; i > cs; i--)
- if(l[i])
- return 0;
- return 1;
- }
- }
- return 0;
-}
-
-/* Returns x >= y. */
-int v_bignum_gte(const VBigDig *x, const VBigDig *y)
-{
- unsigned int xs, ys;
- int i, j, k;
-
- if(x == y)
- return 1;
- /* Find indexes of highest-most used digit in each of the numbers. */
- xs = *x++;
- ys = *y++;
- for(i = xs - 1; i >= 0; i--)
- if(x[i] != 0)
- break;
- for(j = ys - 1; j >= 0; j--)
- if(y[j] != 0)
- break;
- /* Both zero? */
- if(i < 0 && j < 0)
- return 1;
- /* Quick answers exists for different-sized numbers. Find them. */
- if(i < j)
- return 0;
- if(i > j)
- return 1;
- /* Compare digit by digit. */
- for(k = i; k >= 0; k--)
- {
- if(x[k] < y[k])
- return 0;
- if(x[k] > y[k])
- return 1;
- }
- return x[k] >= y[k];
-}
-
-/* ----------------------------------------------------------------------------------------- */
-
-/* Computes x += y. */
-void v_bignum_add_digit(VBigDig *x, VBigDig y)
-{
- unsigned int i, s = *x++, t;
-
- t = x[0] + y;
- x[0] = t;
- if(t > MAX_DIG)
- {
- for(i = 1; i < s; i++)
- {
- if(++x[i])
- break;
- }
- }
-}
-
-/* Computes x -= y. */
-void v_bignum_sub_digit(VBigDig *x, VBigDig y)
-{
- unsigned int i, s = *x++, t;
-
- t = x[0] - y;
- x[0] = t;
- if(t > MAX_DIG)
- {
- for(i = 1; i < s; i++)
- {
- x[i]--;
- if(x[i] < MAX_DIG)
- break;
- }
- }
-}
-
-/* Computes x *= y. */
-void v_bignum_mul_digit(VBigDig *x, VBigDig y)
-{
- unsigned int i, s = *x++, carry, t;
-
- for(i = carry = 0; i < s; i++)
- {
- t = x[i] * y + carry;
- x[i] = t;
- carry = t >> (CHAR_BIT * sizeof *x);
- }
-}
-
-/* ----------------------------------------------------------------------------------------- */
-
-/* Computes x += y. */
-void v_bignum_add(VBigDig *x, const VBigDig *y)
-{
- unsigned int i, xs = *x++, ys = *y++, s, carry, t;
-
- s = xs < ys ? xs : ys;
- for(i = carry = 0; i < s; i++)
- {
- t = x[i] + y[i] + carry;
- x[i] = t;
- carry = t > MAX_DIG;
- }
- for(; carry && i < xs; i++)
- {
- t = x[i] + carry;
- x[i] = t;
- carry = t > MAX_DIG;
- }
-}
-
-/* Computes x -= y. */
-void v_bignum_sub(VBigDig *x, const VBigDig *y)
-{
- unsigned int i, xs = *x++, ys = *y++, s, carry, t;
-
- if(x == y)
- {
- v_bignum_set_zero(x - 1);
- return;
- }
- s = xs < ys ? xs : ys;
- for(i = carry = 0; i < s; i++)
- {
- t = x[i] - y[i] - carry;
- x[i] = t;
- carry = t > MAX_DIG;
- }
- for(; carry && i < xs; i++)
- {
- t = x[i] - carry;
- x[i] = t;
- carry = t > MAX_DIG;
- }
-}
-
-/* Compute x *= y, using as many digits as is necessary, then truncating the
- * result down. This is Algorithm 14.12 from "Handbook of Applied Cryptography".
-*/
-void v_bignum_mul(VBigDig *x, const VBigDig *y)
-{
- int n = *x, t = *y, i, j;
- VBigDigs uv = 0, c, w[2048];
-
- memset(w, 0, (n + t + 1) * sizeof *w);
- for(i = 0; i < t; i++)
- {
- c = 0;
- for(j = 0; j < n; j++)
- {
- uv = w[i + j] + x[1 + j] * y[1 + i] + c;
- w[i + j] = uv & ((1 << V_BIGBITS) - 1);
- c = uv >> V_BIGBITS;
- }
- w[i + n + 1] = uv >> V_BIGBITS;
- }
- /* Write low words of w back into x. */
- for(i = 0; i < *x; i++)
- x[1 + i] = w[i];
-}
-
-/* Computes x /= y and remainder = x % y. */
-void v_bignum_div(VBigDig *x, const VBigDig *y, VBigDig *remainder)
-{
- VBigDig *q, *work;
- int msbx = v_bignum_bit_msb(x), msby = v_bignum_bit_msb(y), next;
-
- /* Compare magnitudes of inputs, allows quick exits. */
- if(msby > msbx)
- {
- if(remainder != NULL)
- v_bignum_set_bignum(remainder, x);
- v_bignum_set_zero(x);
- return;
- }
- if(msby < 0)
- {
- v_bignum_set_zero(x);
- return;
- }
- q = bignum_alloc(*x);
- v_bignum_set_zero(q);
- work = bignum_alloc(*x);
- v_bignum_set_bignum_part(work, x, msbx, msby + 1);
-
- for(next = msbx - (msby + 1); next >= -1; next--)
- {
- v_bignum_bit_shift_left_1(q);
- if(v_bignum_gte(work, y))
- {
- q[1] |= 1;
- v_bignum_sub(work, y);
- }
- v_bignum_bit_shift_left_1(work);
- if(v_bignum_bit_test(x, next))
- work[1] |= 1;
- }
- v_bignum_bit_shift_right(work, 1); /* Undo the last shift (when next==-1). */
-
- if(remainder != NULL)
- {
-/* printf("div() got remainder ");
- v_bignum_print_hex_lf(work);
-*/
- v_bignum_set_bignum(remainder, work);
- }
- bignum_free(work);
- v_bignum_set_bignum(x, q);
- bignum_free(q);
-}
-
-/* Computes x %= y. */
-void v_bignum_mod(VBigDig *x, const VBigDig *y)
-{
- int digs;
- VBigDig *tmp;
-
-/* printf("computing ");
- v_bignum_print_hex(x);
- printf("L %% ");
- v_bignum_print_hex(y);
-*/
- digs = *x > *y ? *x : *y;
- tmp = bignum_alloc(digs);
- v_bignum_div(x, y, tmp);
- v_bignum_set_bignum(x, tmp);
- bignum_free(tmp);
-/* printf("L = ");
- v_bignum_print_hex_lf(x);
-*/
-}
-
-/* Initialize Barrett reduction by computing the "mu" helper value. Defined in
- * Handbook of Applied Cryptography algorithm 14.42 as floor(b^2k / m).
-*/
-const VBigDig * v_bignum_reduce_begin(const VBigDig *m)
-{
- VBigDig *mu;
- int k;
-
- for(k = *m; m[k] == 0; k--)
- ;
-/* printf("k=%d -> digits are 0..%u\n", k, k - 1);
- printf("computing mu=floor(65536^%d/", 2 * k);
- v_bignum_print_hex(m);
- printf(")\n");
-*/ mu = bignum_alloc(2 * k + 1);
- /* b ^ 2k is just 65536 << 2k, i.e. set bit 16 * 2k. */
- v_bignum_set_zero(mu);
- v_bignum_bit_set(mu, V_BIGBITS * 2 * k);
-/* v_bignum_print_hex_lf(mu);*/
- v_bignum_div(mu, m, NULL);
-
- return mu;
-}
-
-void v_bignum_reduce_end(const VBigDig *mu)
-{
- bignum_free(mu);
-}
-
-/* Compute x % m, using mu as the helper quantity mu, precomputed by the
- * routine above.
-*/
-void v_bignum_reduce(VBigDig *x, const VBigDig *m, const VBigDig *mu)
-{
- VBigDig *q, *r1, *r2, *r;
- int i, k;
-
- for(k = *m; m[k] == 0; k--)
- ;
- /* Step 1, compute the q helper. */
- q = bignum_alloc(*x + *mu - (k - 1)); /* Tighter bound number length (was 2 * *x). */
- v_bignum_set_bignum(q, x);
- v_bignum_bit_shift_right(q, V_BIGBITS * (k - 1));
- v_bignum_mul(q, mu);
- v_bignum_bit_shift_right(q, V_BIGBITS * (k + 1));
-
- /* Step 2, initialize. */
- r1 = bignum_alloc(*x);
- r2 = bignum_alloc(*x);
- v_bignum_set_bignum(r1, x);
- for(i = k + 1; i < *r1; i++)
- r1[i + 1] = 0;
- v_bignum_set_bignum(r2, q);
- v_bignum_mul(r2, m);
- for(i = k + 1; i < *r2; i++)
- r2[i + 1] = 0;
- r = x;
- v_bignum_set_bignum(r, r1);
- v_bignum_sub(r, r2);
- /* Step 3, make sure r is positive. */
- if(v_bignum_bit_test(r, V_BIGBITS * *r - 1))
- {
- VBigDig *term;
-
- term = bignum_alloc(k + 1 * V_BIGBITS);
- v_bignum_set_zero(term);
- v_bignum_bit_set(term, V_BIGBITS * (k + 1));
- v_bignum_add(r, term);
- bignum_free(term);
- }
- /* Step 4, loop. */
- while(v_bignum_gte(r, m))
- v_bignum_sub(r, m);
-
- bignum_free(r2);
- bignum_free(r1);
- bignum_free(q);
-}
-
-/* Compute x * x using the algorithm 14.16 from "Handbook of Applied Cryptography".
- * Note that since 'w' needs to be double-precision (i.e., 32-bit), we cannot allocate
- * it using bignum_alloc() cleanly. Thus the static limit, which should be enough here.
- * NOTE: This very much assumes V_BIGBITS == 16.
-*/
-void v_bignum_square_half(VBigDig *x)
-{
- VBigDigs w[256], uv, c, ouv;
- int t = *x / 2, i, j, high;
-
- if(t == 0)
- return;
- for(; x[t] == 0; t--)
- ;
- memset(w, 0, 2 * t * sizeof *w); /* Clear digits of w. */
-/* printf("print %lu, ", ++count);
- v_bignum_print_hex(x);
- printf("*");
- v_bignum_print_hex(x);
-*/ for(i = 0; i < t; i++)
- {
-/* printf("computing w[%d]: %lX + %lX * %lX\n", 2 * i, w[2 * i], x[1 + i], x[1 + i]);*/
- uv = w[2 * i] + x[1 + i] * x[1 + i];
-/* printf("setting w[%d]=%X [before]\n", 2 * i, uv & 0xffff);*/
- w[2 * i] = uv & 0xffff;
- c = uv >> V_BIGBITS;
-/* printf("uv before=%X, c=%X\n", uv, c);*/
- high = 0;
- for(j = i + 1; j < t; j++)
- {
-/* printf("computing uv=%X+2*%X*%X+%X\n", w[i + j], x[1 + j], x[1 + i], c);*/
- uv = ((VBigDigs)x[1 + j]) * ((VBigDigs)x[1 + i]);
- high = (uv & 0x80000000) != 0;
- uv *= 2;
- ouv = uv; /* Addition below might wrap and generate high bit. */
- uv += w[i + j] + c;
-/* printf("ouv=0x%lX uv=0x%lX\n", ouv, uv);*/
- high |= uv < ouv;
-/* printf("setting w[%d]=%lX [inner] uv=%lX high=%d c=%X\n", i + j, uv & 0xffff, uv, high, c);*/
- w[i + j] = uv & 0xffff;
- c = (uv >> V_BIGBITS) | (high << V_BIGBITS);
- }
-/* printf("setting w[%d] to %X [after]\n", i + t, (uv >> 16) | (high << 16));*/
- w[i + t] = (uv >> V_BIGBITS) | (high << V_BIGBITS);
- }
-/* printf("w=0x");
- for(i = *x - 1; i >= 0; i--)
- printf("%04X.", w[i]);
- printf("\n");
-*/ /* Write low words of w back into x, trashing it with the square. */
- for(i = 0; i < 2 * t; i++)
- x[1 + i] = w[i];
- for(; i < *x; i++)
- x[1 + i] = 0;
-/* printf("==");
- v_bignum_print_hex_lf(x);
-*/
-}
-
-/* Computes x = (x^y) % n, where ^ denotes exponentiation. */
-void v_bignum_pow_mod(VBigDig *x, const VBigDig *y, const VBigDig *n)
-{
- VBigDig *tmp;
- const VBigDig *mu;
- int i, k;
-
-/* printf("computing pow(");
- v_bignum_print_hex(x);
- printf("L,");
- v_bignum_print_hex(y);
- printf("L,");
- v_bignum_print_hex(n);
- printf("L)\n");
-*/
- tmp = bignum_alloc(2 * *x); /* Squaring needs twice the bits, or lossage occurs. */
- v_bignum_set_bignum(tmp, x);
- k = v_bignum_bit_msb(y);
- mu = v_bignum_reduce_begin(n);
- for(i = k - 1; i >= 0; i--)
- {
- v_bignum_square_half(tmp);
- v_bignum_reduce(tmp, n, mu);
- if(v_bignum_bit_test(y, i))
- {
- v_bignum_mul(tmp, x);
- v_bignum_reduce(tmp, n, mu);
- }
- }
- v_bignum_set_bignum(x, tmp);
- v_bignum_reduce_end(mu);
- bignum_free(tmp);
-}
-
-/* ----------------------------------------------------------------------------------------- */
-
-#if defined STANDALONE
-
-int main(void)
-{
- VBigDig VBIGNUM(x, 3648), VBIGNUM(y, 128), VBIGNUM(z, 128);
-
- printf("MAX_DIG=%u\n", MAX_DIG);
-
- v_bignum_set_string_hex(x, "0x433864FE0F8FAC180FF1BC3A5BFD0C5566F6B11679E27294EDCC43056EB73EE118415E0CD6E6519509476EB21341ED0328BA7B14E0ED80D5E100A4549C5202B57B4CF17A74987631B6BA896C0DBA2095A7EDE5B9C4B4EEFCD1B9EF8474BCB7FBD0F64B549625D444847ED1FCB7F8050EB4F22794F694A0FAC6DFFB781C264B227966840185F9216484F6A7954741CB11FC14DEC2937EAD2CE640FD9A4339706BDB5BC355079C2F2F7994669DFA5B20C50D957A676E67C86835037078323A0BDAD3686B8E638749F327A7AD433C0D18BCD2FC970D125914C7FBEE061290A0F0F3572E207");
- v_bignum_set_bignum(y, x);
- v_bignum_set_digit(z, 77);
-
- printf("x:");
- v_bignum_print_hex_lf(x);
- printf("y:");
- v_bignum_print_hex_lf(y);
- printf("r:");
- v_bignum_print_hex_lf(z);
- v_bignum_pow_mod(x, y, z);
- printf(" =");
- v_bignum_print_hex_lf(x);
-
- return 0;
-}
-
-#endif /* STANDALONE */
diff --git a/extern/verse/dist/v_bignum.h b/extern/verse/dist/v_bignum.h
deleted file mode 100644
index 06e58844452..00000000000
--- a/extern/verse/dist/v_bignum.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Verse routines for big integer operations.
- * Handy in heavy encryption done during connect.
-*/
-
-#include
-
-#include "v_randgen.h"
-
-/* ----------------------------------------------------------------------------------------- */
-
-typedef unsigned short VBigDig; /* Type used to hold one digit of a bignum. */
-typedef unsigned int VBigDigs; /* Should hold precisely two digits. */
-
-#define V_BIGBITS (CHAR_BIT * sizeof (VBigDig))
-
-/* Use this macro to initialize big number variables, like so:
- * VBigDig BIGNUM(foo, 128), BIGNUM(bar, 256);
- * Creates automatic variables 'foo' of 128 bits, and 'bar' of 256.
- *
- * Note that 'bits' must be a multiple of V_BIGBITS, completely
- * arbitrary number sizes are not supported by this module.
-*/
-#define VBIGNUM(n, bits) n[1 + (bits / V_BIGBITS)] = { bits / V_BIGBITS }
-
-/* ----------------------------------------------------------------------------------------- */
-
-/* Import/export numbers from raw bits. The number x must have been allocated
- * with the desired number of bits to read/write.
-*/
-extern void v_bignum_raw_import(VBigDig *x, const void *bits);
-extern void v_bignum_raw_export(const VBigDig *x, void *bits);
-
-/* Initializers. */
-extern void v_bignum_set_zero(VBigDig *x);
-extern void v_bignum_set_one(VBigDig *x);
-extern void v_bignum_set_digit(VBigDig *x, VBigDig y);
-extern void v_bignum_set_string(VBigDig *x, const char *string); /* Decimal. */
-extern void v_bignum_set_string_hex(VBigDig *x, const char *string);
-extern void v_bignum_set_bignum(VBigDig *x, const VBigDig *y);
-/* x = most significant bits of , starting at . Right-
- * adjusted in x, so that e.g. y=0xcafebabec001 msb=47 bits=16 gives x=0xcafe.
-*/
-extern void v_bignum_set_bignum_part(VBigDig *x, const VBigDig *y,
- unsigned int msb, unsigned int bits);
-extern void v_bignum_set_random(VBigDig *x, VRandGen *gen);
-
-/* Handy during debugging. */
-extern void v_bignum_print_hex(const VBigDig *x);
-extern void v_bignum_print_hex_lf(const VBigDig *x);
-
-/* Bit operators. */
-extern void v_bignum_not(VBigDig *x);
-extern int v_bignum_bit_test(const VBigDig *x, unsigned int bit);
-extern void v_bignum_bit_set(VBigDig *x, unsigned int bit);
-extern int v_bignum_bit_msb(const VBigDig *x);
-extern int v_bignum_bit_size(const VBigDig *x);
-extern void v_bignum_bit_shift_left(VBigDig *x, unsigned int count);
-extern void v_bignum_bit_shift_left_1(VBigDig *x);
-extern void v_bignum_bit_shift_right(VBigDig *x, unsigned int count);
-
-/* Comparators. */
-extern int v_bignum_eq_zero(const VBigDig *x); /* x == 0. */
-extern int v_bignum_eq_one(const VBigDig *x); /* x == 1. */
-extern int v_bignum_eq(const VBigDig *x, const VBigDig *y); /* x == y. */
-extern int v_bignum_gte(const VBigDig *x, const VBigDig *y); /* x >= y. */
-
-/* Number vs single-digit arithmetic. */
-extern void v_bignum_add_digit(VBigDig *x, VBigDig y); /* x += y. */
-extern void v_bignum_sub_digit(VBigDig *x, VBigDig y); /* x -= y. */
-extern void v_bignum_mul_digit(VBigDig *x, VBigDig y); /* x *= y. */
-
-/* Arithmetic. */
-extern void v_bignum_add(VBigDig *x, const VBigDig *y); /* x += y. */
-extern void v_bignum_sub(VBigDig *x, const VBigDig *y); /* x -= y. */
-extern void v_bignum_mul(VBigDig *x, const VBigDig *y); /* x *= y. */
-extern void v_bignum_div(VBigDig *x, const VBigDig *y, VBigDig *remainder);
-extern void v_bignum_mod(VBigDig *x, const VBigDig *y); /* x %= y. */
-
-/* Barrett reducer for fast x % m computation. Requires precalcing step. */
-extern const VBigDig * v_bignum_reduce_begin(const VBigDig *m);
-extern void v_bignum_reduce(VBigDig *x, const VBigDig *m, const VBigDig *mu);
-extern void v_bignum_reduce_end(const VBigDig *mu);
-
-/* Compute x *= x, assuming x only uses half of its actual size. */
-extern void v_bignum_square_half(VBigDig *x);
-
-/* Compute pow(x, y, n) == (x raised to the y:th power) modulo n. */
-extern void v_bignum_pow_mod(VBigDig *x, const VBigDig *y, const VBigDig *n);
diff --git a/extern/verse/dist/v_cmd_buf.c b/extern/verse/dist/v_cmd_buf.c
deleted file mode 100644
index b7faf227352..00000000000
--- a/extern/verse/dist/v_cmd_buf.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
-**
-*/
-
-#include
-#include
-#include
-
-#include "verse_header.h"
-#include "v_pack.h"
-#include "v_cmd_buf.h"
-
-static const size_t vcmdbuf_chunk_size[] = { 10000, 10000, 10000, 10000, 8000, 5000, 500 }; /* If you think memory is cheap, set this to a high value. */
-
-/* Sizes of individual command buffers, indexable by VCMDBufSize values. Switch-killer. */
-static const size_t vcmdbuf_size[] = {
- sizeof (VCMDBuffer10), sizeof (VCMDBuffer20), sizeof (VCMDBuffer30), sizeof (VCMDBuffer80),
- sizeof (VCMDBuffer160), sizeof (VCMDBuffer320), sizeof (VCMDBuffer1500)
-};
-
-#define VCMDBUF_INIT_CHUNK_FACTOR 0.5
-
-static struct {
- VCMDBufHead *buffers[VCMDBS_COUNT];
- unsigned int available[VCMDBS_COUNT];
-} VCMDBufData;
-
-static boolean v_cmd_buf_initialized = FALSE;
-
-void cmd_buf_init(void)
-{
- unsigned int i, j;
- VCMDBufHead *buf, *b;
-
- for(i = 0; i < VCMDBS_COUNT; i++)
- {
- VCMDBufData.buffers[i] = NULL;
- VCMDBufData.available[i] = (unsigned int) (vcmdbuf_chunk_size[i] * VCMDBUF_INIT_CHUNK_FACTOR);
- for(j = 0, buf = NULL; j < VCMDBufData.available[i]; j++, buf = b)
- {
- b = v_cmd_buf_allocate(i);
- b->next = buf;
- }
- VCMDBufData.buffers[i] = buf;
- }
- v_cmd_buf_initialized = TRUE;
-}
-
-VCMDBufHead * v_cmd_buf_allocate(VCMDBufSize buf_size)
-{
- VCMDBufHead *output = NULL;
-
- if(VCMDBufData.buffers[buf_size] != NULL)
- {
- output = VCMDBufData.buffers[buf_size];
- VCMDBufData.buffers[buf_size] = output->next;
- VCMDBufData.available[buf_size]--;
- }
- else
- {
- if(buf_size < sizeof vcmdbuf_size / sizeof *vcmdbuf_size)
- output = malloc(vcmdbuf_size[buf_size]);
- else
- {
- fprintf(stderr, "v_cmd_buf.c: Can't handle buffer size %d\n", buf_size);
- return NULL;
- }
- output->buf_size = buf_size;
- }
- output->next = NULL;
- output->packet = 0;
- output->size = 0;
- output->address_size = -1;
- return output;
-}
-
-void v_cmd_buf_free(VCMDBufHead *head)
-{
- if(VCMDBufData.available[head->buf_size] < vcmdbuf_chunk_size[head->buf_size])
- {
- head->next = VCMDBufData.buffers[head->buf_size];
- VCMDBufData.buffers[head->buf_size] = head;
- VCMDBufData.available[head->buf_size]++;
- }
- else
- free(head);
-}
-
-void v_cmd_buf_set_size(VCMDBufHead *head, unsigned int size)
-{
- head->size = size;
-}
-
-void v_cmd_buf_set_address_size(VCMDBufHead *head, unsigned int size)
-{
- unsigned int i;
-
- head->address_size = size;
- head->address_sum = 0;
- for(i = 1; i < size + 1; i++)
- head->address_sum += i * i * (uint32)(((VCMDBuffer1500 *)head)->buf[i - 1]);
-}
-
-void v_cmd_buf_set_unique_address_size(VCMDBufHead *head, unsigned int size)
-{
- static unsigned int i = 0;
-
- head->address_size = size;
- head->address_sum = i++;
-}
-
-boolean v_cmd_buf_compare(VCMDBufHead *a, VCMDBufHead *b)
-{
- if(a->address_sum != b->address_sum)
- return FALSE;
- if(a->address_size != b->address_size)
- return FALSE;
- return memcmp(((VCMDBuffer1500 *)a)->buf, ((VCMDBuffer1500 *)b)->buf, a->address_size) == 0;
-}
diff --git a/extern/verse/dist/v_cmd_buf.h b/extern/verse/dist/v_cmd_buf.h
deleted file mode 100644
index 6eda7640bb1..00000000000
--- a/extern/verse/dist/v_cmd_buf.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-**
-*/
-
-#include
-
-#include "verse_header.h"
-#include "v_pack.h"
-
-#define V_NOQ_MAX_PACKET_SIZE 1500
-
-typedef enum {
- VCMDBS_10 = 0,
- VCMDBS_20 = 1,
- VCMDBS_30 = 2,
- VCMDBS_80 = 3,
- VCMDBS_160 = 4,
- VCMDBS_320 = 5,
- VCMDBS_1500 = 6,
- VCMDBS_COUNT = 7
-} VCMDBufSize;
-
-typedef struct {
- void *next;
- uint32 packet;
- unsigned int address_size;
- unsigned int address_sum;
- VCMDBufSize buf_size;
- unsigned int size;
-} VCMDBufHead;
-
-typedef struct {
- VCMDBufHead head;
- uint8 buf[10];
-} VCMDBuffer10;
-
-typedef struct {
- VCMDBufHead head;
- uint8 buf[20];
-} VCMDBuffer20;
-
-typedef struct {
- VCMDBufHead head;
- uint8 buf[30];
-} VCMDBuffer30;
-
-typedef struct {
- VCMDBufHead head;
- uint8 buf[80];
-} VCMDBuffer80;
-
-typedef struct {
- VCMDBufHead head;
- uint8 buf[160];
-} VCMDBuffer160;
-
-typedef struct {
- VCMDBufHead head;
- uint8 buf[320];
-} VCMDBuffer320;
-
-
-typedef struct {
- VCMDBufHead head;
- uint8 buf[1500];
-} VCMDBuffer1500;
-
-extern VCMDBufHead *v_cmd_buf_allocate(VCMDBufSize buf_size);
-extern void v_cmd_buf_free(VCMDBufHead *head);
-
-extern void v_cmd_buf_set_size(VCMDBufHead *head, unsigned int size);
-extern void v_cmd_buf_set_address_size(VCMDBufHead *head, unsigned int size);
-extern void v_cmd_buf_set_unique_address_size(VCMDBufHead *head, unsigned int size);
-extern boolean v_cmd_buf_compare(VCMDBufHead *a, VCMDBufHead *b);
diff --git a/extern/verse/dist/v_cmd_def_a.c b/extern/verse/dist/v_cmd_def_a.c
deleted file mode 100644
index 8557601428b..00000000000
--- a/extern/verse/dist/v_cmd_def_a.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Command definitions for audio node commands.
-*/
-
-#include
-#include
-#include "verse_header.h"
-#include "v_cmd_gen.h"
-#include "v_cmd_buf.h"
-
-#if defined(V_GENERATE_FUNC_MODE)
-
-void v_gen_audio_cmd_def(void)
-{
- v_cg_new_cmd(V_NT_AUDIO, "a_buffer_create", 160, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_BUFFER_ID, "buffer_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_NAME, "name");
- v_cg_add_param(VCGP_ENUM_NAME, "VNABlockType");
- v_cg_add_param(VCGP_ENUM, "type");
- v_cg_add_param(VCGP_REAL64, "frequency");
- v_cg_alias(FALSE, "a_buffer_destroy", "if(name[0] == 0)", 2, NULL);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_AUDIO, "a_buffer_subscribe", 161, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_BUFFER_ID, "layer_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_alias(TRUE, "a_buffer_unsubscribe", NULL, 2, NULL);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_AUDIO, "a_block_set", 162, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "buffer_id");
- v_cg_add_param(VCGP_UINT32, "block_index");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_ENUM_NAME, "VNABlockType");
- v_cg_add_param(VCGP_ENUM, "type");
- v_cg_add_param(VCGP_POINTER_TYPE, "VNABlock");
- v_cg_add_param(VCGP_POINTER, "samples");
-
- v_cg_add_param(VCGP_PACK_INLINE, "\tbuffer_pos += vnp_pack_audio_block(&buf[buffer_pos], type, samples);\n");
-
- v_cg_add_param(VCGP_UNPACK_INLINE, "\tif(type <= VN_A_BLOCK_REAL64)\n\t{\n"
- "\t\tVNABlock\tblock;\n"
- "\t\tbuffer_pos += vnp_unpack_audio_block(&buf[buffer_pos], type, &block);\n"
- "\t\tif(func_a_block_set != NULL)\n"
- "\t\t\tfunc_a_block_set(v_fs_get_user_data(162), node_id, buffer_id, block_index, (VNABlockType) type, &block);\n"
- "\t\treturn buffer_pos;\n"
- "\t}\n");
- v_cg_alias(FALSE, "a_block_clear", "if(type > VN_A_BLOCK_REAL64)", 3, NULL);
- v_cg_end_cmd();
-
-
- v_cg_new_cmd(V_NT_AUDIO, "a_stream_create", 163, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "stream_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_NAME, "name");
- v_cg_alias(FALSE, "a_stream_destroy", "if(name[0] == 0)", 2, NULL);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_AUDIO, "a_stream_subscribe", 164, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "stream_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_alias(TRUE, "a_stream_unsubscribe", NULL, 2, NULL);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_AUDIO, "a_stream", 165, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "stream_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_UINT32, "time_s");
- v_cg_add_param(VCGP_UINT32, "time_f");
- v_cg_add_param(VCGP_ENUM_NAME, "VNABlockType");
- v_cg_add_param(VCGP_ENUM, "type");
- v_cg_add_param(VCGP_REAL64, "frequency");
- v_cg_add_param(VCGP_POINTER_TYPE, "VNABlock");
- v_cg_add_param(VCGP_POINTER, "samples");
-
- v_cg_add_param(VCGP_PACK_INLINE, "\tbuffer_pos += vnp_pack_audio_block(&buf[buffer_pos], type, samples);\n");
-
- v_cg_add_param(VCGP_UNPACK_INLINE, "\t{\n\t\tVNABlock\tblock;\n\tbuffer_pos += vnp_unpack_audio_block(&buf[buffer_pos], type, &block);\n"
- "\t\tif(func_a_stream != NULL)\n"
- "\t\t\tfunc_a_stream(v_fs_get_user_data(165), node_id, stream_id, time_s, time_f, (VNABlockType) type, frequency, &block);\n"
- "\t\treturn buffer_pos;\n"
- "\t}\n");
-
- v_cg_end_cmd();
-}
-
-#endif
diff --git a/extern/verse/dist/v_cmd_def_b.c b/extern/verse/dist/v_cmd_def_b.c
deleted file mode 100644
index b266b03648c..00000000000
--- a/extern/verse/dist/v_cmd_def_b.c
+++ /dev/null
@@ -1,44 +0,0 @@
-
-#include
-#include
-
-#include "verse_header.h"
-#include "v_cmd_gen.h"
-#include "v_cmd_buf.h"
-
-#if defined(V_GENERATE_FUNC_MODE)
-
-void v_gen_bitmap_cmd_def(void)
-{
- v_cg_new_cmd(V_NT_BITMAP, "b_dimensions_set", 80, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_UINT16, "width");
- v_cg_add_param(VCGP_UINT16, "height");
- v_cg_add_param(VCGP_UINT16, "depth");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_BITMAP, "b_layer_create", 81, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "layer_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_NAME, "name");
- v_cg_add_param(VCGP_ENUM_NAME, "VNBLayerType");
- v_cg_add_param(VCGP_ENUM, "type");
- v_cg_alias(FALSE, "b_layer_destroy", "if(name[0] == 0)", 2, NULL);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_BITMAP, "b_layer_subscribe", 82, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "layer_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_UINT8, "level");
- v_cg_alias(FALSE, "b_layer_unsubscribe", "if(level == 255)", 2, NULL);
- v_cg_end_cmd();
-
- v_cg_new_manual_cmd(83, "b_tile_set", "void verse_send_b_tile_set(VNodeID node_id, VLayerID layer_id, "
- "uint16 tile_x, uint16 tile_y, uint16 z, VNBLayerType type, const VNBTile *tile)",
- NULL, NULL);
-}
-
-#endif
diff --git a/extern/verse/dist/v_cmd_def_c.c b/extern/verse/dist/v_cmd_def_c.c
deleted file mode 100644
index 317b45e1a27..00000000000
--- a/extern/verse/dist/v_cmd_def_c.c
+++ /dev/null
@@ -1,35 +0,0 @@
-
-#include
-#include
-#include "verse_header.h"
-#include "v_cmd_gen.h"
-#include "v_cmd_buf.h"
-
-#if defined(V_GENERATE_FUNC_MODE)
-
-void v_gen_curve_cmd_def(void)
-{
- v_cg_new_cmd(V_NT_CURVE, "c_curve_create", 128, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "curve_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_NAME, "name");
- v_cg_add_param(VCGP_UINT8, "dimensions");
- v_cg_alias(FALSE, "c_curve_destroy", "if(name[0] == 0)", 2, NULL);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_CURVE, "c_curve_subscribe", 129, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "curve_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_alias(TRUE, "c_curve_unsubscribe", "if(!alias_bool)", 2, NULL);
- v_cg_end_cmd();
-
- v_cg_new_manual_cmd(130, "c_key_set", "void verse_send_c_key_set(VNodeID node_id, VLayerID curve_id, "
- "uint32 key_id, uint8 dimensions, const real64 *pre_value, const uint32 *pre_pos, "
- "const real64 *value, real64 pos, const real64 *post_value, const uint32 *post_pos)",
- "c_key_destroy", "void verse_send_c_key_destroy(VNodeID node_id, VLayerID curve_id, "
- "uint32 key_id)");
-}
-
-#endif
diff --git a/extern/verse/dist/v_cmd_def_g.c b/extern/verse/dist/v_cmd_def_g.c
deleted file mode 100644
index 5a4ea7202b4..00000000000
--- a/extern/verse/dist/v_cmd_def_g.c
+++ /dev/null
@@ -1,183 +0,0 @@
-
-#include
-#include
-#include "verse_header.h"
-#include "v_cmd_gen.h"
-#include "v_cmd_buf.h"
-
-#if defined(V_GENERATE_FUNC_MODE)
-
-void v_gen_geometry_cmd_def(void)
-{
- unsigned int order[] = { 0, 2 };
-
- v_cg_new_cmd(V_NT_GEOMETRY, "g_layer_create", 48, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "layer_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_NAME, "name");
- v_cg_add_param(VCGP_ENUM_NAME, "VNGLayerType");
- v_cg_add_param(VCGP_ENUM, "type");
- v_cg_add_param(VCGP_UINT32, "def_uint");
- v_cg_add_param(VCGP_REAL64, "def_real");
- v_cg_alias(FALSE, "g_layer_destroy", "if(name[0] == 0)", 2, NULL);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_GEOMETRY, "g_layer_subscribe", 49, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "layer_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_ENUM_NAME, "VNRealFormat");
- v_cg_add_param(VCGP_ENUM, "type");
- v_cg_alias(FALSE, "g_layer_unsubscribe", "if(type > VN_FORMAT_REAL64)", 2, NULL);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_GEOMETRY, "g_vertex_set_xyz_real32", 50, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "layer_id");
- v_cg_add_param(VCGP_UINT32, "vertex_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_REAL32, "x");
- v_cg_add_param(VCGP_REAL32, "y");
- v_cg_add_param(VCGP_REAL32, "z");
- v_cg_alias(FALSE, "g_vertex_delete_real32", "if(x == V_REAL32_MAX || y == V_REAL32_MAX || z == V_REAL32_MAX)", 2, order);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_GEOMETRY, "g_vertex_set_xyz_real64", 51, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "layer_id");
- v_cg_add_param(VCGP_UINT32, "vertex_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_REAL64, "x");
- v_cg_add_param(VCGP_REAL64, "y");
- v_cg_add_param(VCGP_REAL64, "z");
- v_cg_alias(FALSE, "g_vertex_delete_real64", "if(x == V_REAL64_MAX || y == V_REAL64_MAX || z == V_REAL64_MAX)", 2, order);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_GEOMETRY, "g_vertex_set_uint32", 52, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "layer_id");
- v_cg_add_param(VCGP_UINT32, "vertex_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_UINT32, "value");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_GEOMETRY, "g_vertex_set_real64", 53, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "layer_id");
- v_cg_add_param(VCGP_UINT32, "vertex_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_REAL64, "value");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_GEOMETRY, "g_vertex_set_real32", 54, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "layer_id");
- v_cg_add_param(VCGP_UINT32, "vertex_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_REAL32, "value");
- v_cg_end_cmd();
-/*
- v_cg_new_cmd(V_NT_GEOMETRY, "g_vertex_delete", VCGCT_NORMAL);
- v_cg_add_param(VCGP_UINT32, "vertex_id");
- v_cg_end_cmd();
-*/
- v_cg_new_cmd(V_NT_GEOMETRY, "g_polygon_set_corner_uint32", 55, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "layer_id");
- v_cg_add_param(VCGP_UINT32, "polygon_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_UINT32, "v0");
- v_cg_add_param(VCGP_UINT32, "v1");
- v_cg_add_param(VCGP_UINT32, "v2");
- v_cg_add_param(VCGP_UINT32, "v3");
- v_cg_alias(FALSE, "g_polygon_delete", "if(layer_id == 1 && v0 == ~0u)", 2, order);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_GEOMETRY, "g_polygon_set_corner_real64", 56, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "layer_id");
- v_cg_add_param(VCGP_UINT32, "polygon_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_REAL64, "v0");
- v_cg_add_param(VCGP_REAL64, "v1");
- v_cg_add_param(VCGP_REAL64, "v2");
- v_cg_add_param(VCGP_REAL64, "v3");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_GEOMETRY, "g_polygon_set_corner_real32", 57, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "layer_id");
- v_cg_add_param(VCGP_UINT32, "polygon_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_REAL32, "v0");
- v_cg_add_param(VCGP_REAL32, "v1");
- v_cg_add_param(VCGP_REAL32, "v2");
- v_cg_add_param(VCGP_REAL32, "v3");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_GEOMETRY, "g_polygon_set_face_uint8", 58, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "layer_id");
- v_cg_add_param(VCGP_UINT32, "polygon_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_UINT8, "value");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_GEOMETRY, "g_polygon_set_face_uint32", 59, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "layer_id");
- v_cg_add_param(VCGP_UINT32, "polygon_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_UINT32, "value");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_GEOMETRY, "g_polygon_set_face_real64", 60, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "layer_id");
- v_cg_add_param(VCGP_UINT32, "polygon_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_REAL64, "value");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_GEOMETRY, "g_polygon_set_face_real32", 61, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_LAYER_ID, "layer_id");
- v_cg_add_param(VCGP_UINT32, "polygon_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_REAL32, "value");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_GEOMETRY, "g_crease_set_vertex", 62, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_NAME, "layer");
- v_cg_add_param(VCGP_UINT32, "def_crease");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_GEOMETRY, "g_crease_set_edge", 63, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_NAME, "layer");
- v_cg_add_param(VCGP_UINT32, "def_crease");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_GEOMETRY, "g_bone_create", 64, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_UINT16, "bone_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_NAME, "weight");
- v_cg_add_param(VCGP_NAME, "reference");
- v_cg_add_param(VCGP_UINT16, "parent");
- v_cg_add_param(VCGP_REAL64, "pos_x");
- v_cg_add_param(VCGP_REAL64, "pos_y");
- v_cg_add_param(VCGP_REAL64, "pos_z");
- v_cg_add_param(VCGP_NAME, "position_label");
- v_cg_add_param(VCGP_NAME, "rotation_label");
- v_cg_add_param(VCGP_NAME, "scale_label");
- v_cg_alias(FALSE, "g_bone_destroy", "if(weight[0] == 0)", 2, NULL);
-
- v_cg_end_cmd();
-}
-
-#endif
diff --git a/extern/verse/dist/v_cmd_def_m.c b/extern/verse/dist/v_cmd_def_m.c
deleted file mode 100644
index 3f4b9aa7178..00000000000
--- a/extern/verse/dist/v_cmd_def_m.c
+++ /dev/null
@@ -1,273 +0,0 @@
-
-#include
-#include
-#include "verse_header.h"
-#include "v_cmd_gen.h"
-#include "v_cmd_buf.h"
-
-#if defined(V_GENERATE_FUNC_MODE)
-
-void v_gen_material_cmd_def(void)
-{
- v_cg_new_cmd(V_NT_MATERIAL, "m_fragment_create", 68, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_FRAGMENT_ID, "frag_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_ENUM_NAME, "VNMFragmentType");
- v_cg_add_param(VCGP_ENUM, "type");
- v_cg_add_param(VCGP_POINTER_TYPE, "VMatFrag");
- v_cg_add_param(VCGP_POINTER, "fragment");
-
- v_cg_add_param(VCGP_PACK_INLINE, "\tswitch(type)\n"
- "\t{\n"
- "\tcase VN_M_FT_COLOR :\n"
- "\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->color.red);\n"
- "\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->color.green);\n"
- "\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->color.blue);\n"
- "\t\tbreak;\n"
- "\tcase VN_M_FT_LIGHT :\n"
- "\t\tbuffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)fragment->light.type);\n"
- "\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->light.normal_falloff);\n"
- "\t\tbuffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], fragment->light.brdf);\n"
- "\t\tbuffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->light.brdf_r, 16);\n"
- "\t\tbuffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->light.brdf_g, 16);\n"
- "\t\tbuffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->light.brdf_b, 16);\n"
- "\t\tbreak;\n"
- "\tcase VN_M_FT_REFLECTION :\n"
- "\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->reflection.normal_falloff);\n"
- "\t\tbreak;\n"
- "\tcase VN_M_FT_TRANSPARENCY :\n"
- "\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->transparency.normal_falloff);\n"
- "\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->transparency.refraction_index);\n"
- "\t\tbreak;\n"
- "\tcase VN_M_FT_GEOMETRY :\n"
- "\t\tbuffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->geometry.layer_r, 16);\n"
- "\t\tbuffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->geometry.layer_g, 16);\n"
- "\t\tbuffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->geometry.layer_b, 16);\n"
- "\t\tbreak;\n"
- "\tcase VN_M_FT_VOLUME :\n"
- "\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->volume.diffusion);\n"
- "\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->volume.col_r);\n"
- "\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->volume.col_g);\n"
- "\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->volume.col_b);\n"
- "\t\tbreak;\n"
- "\tcase VN_M_FT_VIEW :\n"
- "\t\tbreak;\n"
- "\tcase VN_M_FT_TEXTURE :\n"
- "\t\tbuffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], fragment->texture.bitmap);\n"
- "\t\tbuffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->texture.layer_r, 16);\n"
- "\t\tbuffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->texture.layer_g, 16);\n"
- "\t\tbuffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->texture.layer_b, 16);\n"
- "\t\tbuffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)fragment->texture.filtered);\n"
- "\t\tbuffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->texture.mapping);\n"
- "\t\tbreak;\n"
- "\tcase VN_M_FT_NOISE :\n"
- "\t\tbuffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)fragment->noise.type);\n"
- "\t\tbuffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->noise.mapping);\n"
- "\t\tbreak;\n"
- "\tcase VN_M_FT_BLENDER :\n"
- "\t\tbuffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)fragment->blender.type);\n"
- "\t\tbuffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->blender.data_a);\n"
- "\t\tbuffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->blender.data_b);\n"
- "\t\tbuffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->blender.control);\n"
- "\t\tbreak;\n"
- "\tcase VN_M_FT_CLAMP :\n"
- "\t\tbuffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)fragment->clamp.min);\n"
- "\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->clamp.red);\n"
- "\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->clamp.green);\n"
- "\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->clamp.blue);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->clamp.data);\n"
- "\t\tbreak;\n"
- "\tcase VN_M_FT_MATRIX :\n"
- "\t\t{\n"
- "\t\t\tunsigned int i;\n"
- "\t\t\tfor(i = 0; i < 16; i++)\n"
- "\t\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->matrix.matrix[i]);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->matrix.data);\n"
- "\t\t}\n"
- "\t\tbreak;\n"
- "\tcase VN_M_FT_RAMP :\n"
- "\t\tif(fragment->ramp.point_count == 0)\n"
- "\t\t\treturn;\n"
- "\t\t{\n"
- "\t\t\tunsigned int i, pos;\n"
- "\t\t\tdouble last;\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)fragment->ramp.type);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)fragment->ramp.channel);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->ramp.mapping);\n"
- "\t\t\tpos = buffer_pos;\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], fragment->ramp.point_count);\n"
- "\t\t\tlast = fragment->ramp.ramp[0].pos - 1;\n"
- "\t\t\tfor(i = 0; i < fragment->ramp.point_count && fragment->ramp.ramp[i].pos > last && i < 48; i++)\n"
- "\t\t\t{\n"
- "\t\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->ramp.ramp[i].pos);\n"
- "\t\t\t\tlast = fragment->ramp.ramp[i].pos;\n"
- "\t\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->ramp.ramp[i].red);\n"
- "\t\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->ramp.ramp[i].green);\n"
- "\t\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->ramp.ramp[i].blue);\n"
- "\t\t\t}\n\t\t\tif(i != fragment->ramp.point_count)\n"
- "\t\t\t\tvnp_raw_pack_uint8(&buf[pos], i);\n"
- "\t\t}\n"
- "\t\tbreak;\n"
- "\tcase VN_M_FT_ANIMATION :\n"
- "\t\tbuffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->animation.label, 16);\n"
- "\t\tbreak;\n"
- "\tcase VN_M_FT_ALTERNATIVE :\n"
- "\t\tbuffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->alternative.alt_a);\n"
- "\t\tbuffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->alternative.alt_b);\n"
- "\t\tbreak;\n"
- "\tcase VN_M_FT_OUTPUT :\n"
- "\t\tbuffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->output.label, 16);\n"
- "\t\tbuffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->output.front);\n"
- "\t\tbuffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->output.back);\n"
- "\t\tbreak;\n"
- "\t}\n");
-
- v_cg_add_param(VCGP_UNPACK_INLINE, "\tif(type <= VN_M_FT_OUTPUT)\n"
- "\t{\n"
- "\t\tVMatFrag frag;\n"
- "\t\tuint8 temp;\n"
- "\t\tswitch(type)\n"
- "\t\t{\n"
- "\t\tcase VN_M_FT_COLOR :\n"
- "\t\t\tif(buffer_pos + 3 * 8 > buffer_length)\n"
- "\t\t\t\treturn -1;\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.color.red);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.color.green);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.color.blue);\n"
- "\t\t\tbreak;\n"
- "\t\tcase VN_M_FT_LIGHT :\n"
- "\t\t\tif(buffer_pos + 13 > buffer_length)\n"
- "\t\t\t\treturn -1;\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &temp);\n"
- "\t\t\tfrag.light.type = (VNMLightType)temp;\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.light.normal_falloff);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &frag.light.brdf);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.light.brdf_r, 16, buffer_length - buffer_pos);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.light.brdf_g, 16, buffer_length - buffer_pos);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.light.brdf_b, 16, buffer_length - buffer_pos);\n"
- "\t\t\tbreak;\n"
- "\t\tcase VN_M_FT_REFLECTION :\n"
- "\t\t\tif(buffer_pos + 8 > buffer_length)\n"
- "\t\t\t\treturn -1;\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.reflection.normal_falloff);\n"
- "\t\t\tbreak;\n"
- "\t\tcase VN_M_FT_TRANSPARENCY :\n"
- "\t\t\tif(buffer_pos + 16 > buffer_length)\n"
- "\t\t\t\treturn -1;\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.transparency.normal_falloff);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.transparency.refraction_index);\n"
- "\t\t\tbreak;\n"
- "\t\tcase VN_M_FT_VOLUME :\n"
- "\t\t\tif(buffer_pos + 32 > buffer_length)\n"
- "\t\t\t\treturn -1;\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.volume.diffusion);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.volume.col_r);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.volume.col_g);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.volume.col_b);\n"
- "\t\t\tbreak;\n"
- "\t\tcase VN_M_FT_VIEW :\n"
- "\t\t\tbreak;\n"
- "\t\tcase VN_M_FT_GEOMETRY :\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.geometry.layer_r, 16, buffer_length - buffer_pos);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.geometry.layer_g, 16, buffer_length - buffer_pos);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.geometry.layer_b, 16, buffer_length - buffer_pos);\n"
- "\t\t\tbreak;\n"
- "\t\tcase VN_M_FT_TEXTURE :\n"
- "\t\t\tif(buffer_pos + 10 > buffer_length)\n"
- "\t\t\t\treturn -1;\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &frag.texture.bitmap);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.texture.layer_r, 16, buffer_length - buffer_pos);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.texture.layer_g, 16, buffer_length - buffer_pos);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.texture.layer_b, 16, buffer_length - buffer_pos);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &temp);\n"
- "\t\t\tfrag.texture.filtered = (VNMNoiseType)temp;\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.texture.mapping);\n"
- "\t\t\tbreak;\n"
- "\t\tcase VN_M_FT_NOISE :\n"
- "\t\t\tif(buffer_pos + 3 > buffer_length)\n"
- "\t\t\t\treturn -1;\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &temp);\n"
- "\t\t\tfrag.noise.type = (VNMNoiseType)temp;\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.noise.mapping);\n"
- "\t\t\tbreak;\n"
- "\t\tcase VN_M_FT_BLENDER :\n"
- "\t\t\tif(buffer_pos + 7 > buffer_length)\n"
- "\t\t\t\treturn -1;\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &temp);\n"
- "\t\t\tfrag.blender.type = (VNMBlendType)temp;\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.blender.data_a);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.blender.data_b);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.blender.control);\n"
- "\t\t\tbreak;\n"
- "\t\tcase VN_M_FT_CLAMP :\n"
- "\t\t\tif(buffer_pos + 27 > buffer_length)\n"
- "\t\t\t\treturn -1;\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &temp);\n"
- "\t\t\tfrag.clamp.min = (VNMBlendType)temp;\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.clamp.red);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.clamp.green);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.clamp.blue);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.clamp.data);\n"
- "\t\t\tbreak;\n"
- "\t\tcase VN_M_FT_MATRIX :\n"
- "\t\t\tif(buffer_pos + 8 * 16 + 2 > buffer_length)\n"
- "\t\t\t\treturn -1;\n"
- "\t\t\telse\n"
- "\t\t\t{\n"
- "\t\t\t\tunsigned int i;\n"
- "\t\t\t\tfor(i = 0; i < 16; i++)\n"
- "\t\t\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.matrix.matrix[i]);\n"
- "\t\t\t\tbuffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.matrix.data);\n"
- "\t\t\t}\n"
- "\t\t\tbreak;\n"
- "\t\tcase VN_M_FT_RAMP :\n"
- "\t\t\tif(buffer_pos + 5 + 4 * 8 > buffer_length)\n"
- "\t\t\t\treturn -1;\n"
- "\t\t\telse\n"
- "\t\t\t{\n"
- "\t\t\t\tunsigned int i, pos;\n"
- "\t\t\t\tbuffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &temp);\n"
- "\t\t\t\tfrag.ramp.type = (VNMRampType)temp;\n"
- "\t\t\t\tbuffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &temp);\n"
- "\t\t\t\tfrag.ramp.channel = (VNMRampChannel)temp;\n"
- "\t\t\t\tbuffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.ramp.mapping);\n"
- "\t\t\t\tpos = buffer_pos;\n"
- "\t\t\t\tbuffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &frag.ramp.point_count);\n"
- "\t\t\t\tfor(i = 0; i < frag.ramp.point_count && buffer_pos + 8 * 4 <= buffer_length && i < 48; i++)\n"
- "\t\t\t\t{\n"
- "\t\t\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.ramp.ramp[i].pos);\n"
- "\t\t\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.ramp.ramp[i].red);\n"
- "\t\t\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.ramp.ramp[i].green);\n"
- "\t\t\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.ramp.ramp[i].blue);\n"
- "\t\t\t\t}if(i != frag.ramp.point_count)\n"
- "\t\t\t\t\tfrag.ramp.point_count = i;\n"
- "\t\t\t}\n"
- "\t\t\tbreak;\n"
- "\t\tcase VN_M_FT_ANIMATION :\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.animation.label, 16, buffer_length - buffer_pos);\n"
- "\t\t\tbreak;\n"
- "\t\tcase VN_M_FT_ALTERNATIVE :\n"
- "\t\t\tif(buffer_pos + 4 > buffer_length)\n"
- "\t\t\t\treturn -1;\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.alternative.alt_a);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.alternative.alt_b);\n"
- "\t\t\tbreak;\n"
- "\t\tcase VN_M_FT_OUTPUT :\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.output.label, 16, buffer_length - buffer_pos);\n"
- "\t\t\tif(buffer_pos + 4 > buffer_length)\n"
- "\t\t\t\treturn -1;\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.output.front);\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.output.back);\n"
- "\t\t\tbreak;\n"
- "\t\t}\n"
- "\t\tif(func_m_fragment_create != NULL)\n"
- "\t\t\tfunc_m_fragment_create(v_fs_get_user_data(68), node_id, frag_id, type, &frag);\n"
- "\t\treturn buffer_pos;\n"
- "\t}\n");
- v_cg_alias(FALSE, "m_fragment_destroy", "if(type > VN_M_FT_OUTPUT)", 2, NULL);
-
- v_cg_end_cmd();
-}
-
-#endif
diff --git a/extern/verse/dist/v_cmd_def_o.c b/extern/verse/dist/v_cmd_def_o.c
deleted file mode 100644
index a0135f2a4a7..00000000000
--- a/extern/verse/dist/v_cmd_def_o.c
+++ /dev/null
@@ -1,517 +0,0 @@
-
-#include
-#include
-#include "verse_header.h"
-#include "v_cmd_gen.h"
-#include "v_cmd_buf.h"
-
-#if defined(V_GENERATE_FUNC_MODE)
-
-void v_gen_object_cmd_def(void)
-{
- v_cg_new_cmd(V_NT_OBJECT, "o_transform_pos_real32", 32, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_UINT32, "time_s");
- v_cg_add_param(VCGP_UINT32, "time_f");
- v_cg_add_param(VCGP_POINTER_TYPE,"real32");
- v_cg_add_param(VCGP_POINTER, "pos");
- v_cg_add_param(VCGP_POINTER_TYPE,"real32");
- v_cg_add_param(VCGP_POINTER, "speed");
- v_cg_add_param(VCGP_POINTER_TYPE,"real32");
- v_cg_add_param(VCGP_POINTER, "accelerate");
- v_cg_add_param(VCGP_POINTER_TYPE,"real32");
- v_cg_add_param(VCGP_POINTER, "drag_normal");
- v_cg_add_param(VCGP_PACK_INLINE, "\t{\n"
- "\t\tunsigned char mask = 0;\n"
- "\t\tunsigned int cmd;\n"
- "\t\tcmd = buffer_pos++;\n"
- "\t\tbuffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], pos[0]);\n"
- "\t\tbuffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], pos[1]);\n"
- "\t\tbuffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], pos[2]);\n"
- "\t\tif(speed != NULL && (speed[0] > 0.0000001 || speed[0] < -0.0000001 || speed[1] > 0.0000001 || speed[1] < -0.0000001 || speed[2] > 0.0000001 || speed[2] < -0.0000001))\n"
- "\t\t{\n"
- "\t\t\tmask |= 1;\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], speed[0]);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], speed[1]);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], speed[2]);\n"
- "\t\t}\n"
- "\t\tif(accelerate != NULL && (accelerate[0] > 0.0000001 || accelerate[0] < -0.0000001 || accelerate[1] > 0.0000001 || accelerate[1] < -0.0000001 || accelerate[2] > 0.0000001 || accelerate[2] < -0.0000001))\n"
- "\t\t{\n"
- "\t\t\tmask |= 2;\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], accelerate[0]);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], accelerate[1]);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], accelerate[2]);\n"
- "\t\t}\n"
- "\t\tif(drag_normal != NULL && (drag > 0.0000001 || drag < -0.0000001) && (drag_normal[0] > 0.0000001 || drag_normal[0] < -0.0000001 || drag_normal[1] > 0.0000001 || drag_normal[1] < -0.0000001 || drag_normal[2] > 0.0000001 || drag_normal[2] < -0.0000001))\n"
- "\t\t{\n"
- "\t\t\tmask |= 4;\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], drag_normal[0]);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], drag_normal[1]);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], drag_normal[2]);\n"
- "\t\t}\n"
- "\t\tif(drag > 0.0000001 || drag < -0.0000001)\n"
- "\t\t{\n"
- "\t\t\tmask |= 8;\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], drag);\n"
- "\t\t}\n"
- "\t\tvnp_raw_pack_uint8(&buf[cmd], mask);\n"
- "\t}if(FALSE)\n");
- v_cg_add_param(VCGP_UNPACK_INLINE, "\t{\n"
- "\t\tfloat output[4][3];\n"
- "\t\tunsigned int i, j;\n"
- "\t\tchar mask, pow = 1;\n"
- "\t\tbuffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &mask);\n"
- "\t\tfor(j = 0; j < 3; j++)\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &output[0][j]);\n"
- "\t\tfor(i = 1; i < 4; i++)\n"
- "\t\t{\n"
- "\t\t\tif((mask & pow) != 0)\n"
- "\t\t\t\tfor(j = 0; j < 3; j++)\n"
- "\t\t\t\t\tbuffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &output[i][j]);\n"
- "\t\t\telse\n"
- "\t\t\t\tfor(j = 0; j < 3; j++)\n"
- "\t\t\t\t\toutput[i][j] = 0;\n"
- "\t\t\tpow *= 2;\n"
- "\t\t}\n"
- "\t\tif((mask & pow) != 0)\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &drag);\n"
- "\t\telse\n"
- "\t\t\tdrag = 0.0f;\n"
- "\t\tif(func_o_transform_pos_real32 != NULL)\n"
- "\t\t\tfunc_o_transform_pos_real32(v_fs_get_user_data(32), node_id, time_s, time_f, &output[0][0], &output[1][0], &output[2][0], &output[3][0], drag);\n"
- "\t\treturn buffer_pos;\n"
- "\t}\n");
- v_cg_add_param(VCGP_REAL32, "drag");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_OBJECT, "o_transform_rot_real32", 33, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_UINT32, "time_s");
- v_cg_add_param(VCGP_UINT32, "time_f");
- v_cg_add_param(VCGP_POINTER_TYPE, "VNQuat32");
- v_cg_add_param(VCGP_POINTER, "rot");
- v_cg_add_param(VCGP_POINTER_TYPE, "VNQuat32");
- v_cg_add_param(VCGP_POINTER, "speed");
- v_cg_add_param(VCGP_POINTER_TYPE, "VNQuat32");
- v_cg_add_param(VCGP_POINTER, "accelerate");
- v_cg_add_param(VCGP_POINTER_TYPE, "VNQuat32");
- v_cg_add_param(VCGP_POINTER, "drag_normal");
- v_cg_add_param(VCGP_PACK_INLINE, "\t{\n"
- "\t\tuint8 mask = 0;\n"
- "\t\tunsigned int maskpos;\n"
- "\t\tmaskpos = buffer_pos++;\t\t/* Remember location, and reserve a byte for the mask. */\n"
- "\t\tbuffer_pos += vnp_pack_quat32(&buf[buffer_pos], rot);\n"
- "\t\tif(v_quat32_valid(speed))\n"
- "\t\t{\n"
- "\t\t\tmask |= 1;\n"
- "\t\t\tbuffer_pos += vnp_pack_quat32(&buf[buffer_pos], speed);\n"
- "\t\t}\n"
- "\t\tif(v_quat32_valid(accelerate))\n"
- "\t\t{\n"
- "\t\t\tmask |= 2;\n"
- "\t\t\tbuffer_pos += vnp_pack_quat32(&buf[buffer_pos], accelerate);\n"
- "\t\t}\n"
- "\t\tif(v_quat32_valid(drag_normal))\n"
- "\t\t{\n"
- "\t\t\tmask |= 4;\n"
- "\t\t\tbuffer_pos += vnp_pack_quat32(&buf[buffer_pos], drag_normal);\n"
- "\t\t}\n"
- "\t\tif(drag > 0.0000001 || drag < -0.0000001)\n"
- "\t\t{\n"
- "\t\t\tmask |= 8;\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], drag);\n"
- "\t\t}\n"
- "\t\tvnp_raw_pack_uint8(&buf[maskpos], mask);\t/* Write the mask into start of command. */\n"
- "\t}\n"
- "\tif(FALSE)\n");
- v_cg_add_param(VCGP_UNPACK_INLINE, "\t{\n"
- "\t\tVNQuat32 trot, temp[3], *q[3];\n"
- "\t\tunsigned int i;\n"
- "\t\tuint8 mask, test;\n"
- "\t\tbuffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &mask);\n"
- "\t\tbuffer_pos += vnp_unpack_quat32(&buf[buffer_pos], &trot);\n"
- "\t\tfor(i = 0, test = 1; i < sizeof temp / sizeof *temp; i++, test <<= 1)\n"
- "\t\t{\n"
- "\t\t\tif(mask & test)\t\t/* Field present? */\n"
- "\t\t\t{\n"
- "\t\t\t\tbuffer_pos += vnp_unpack_quat32(&buf[buffer_pos], &temp[i]);\n"
- "\t\t\t\tq[i] = &temp[i];\n"
- "\t\t\t}\n"
- "\t\t\telse\n"
- "\t\t\t\tq[i] = NULL;\n"
- "\t\t}\n"
- "\t\tif(mask & test)\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &drag);\n"
- "\t\telse\n"
- "\t\t\tdrag = 0.0;\n"
- "\t\tif(func_o_transform_rot_real32 != NULL)\n"
- "\t\t\tfunc_o_transform_rot_real32(v_fs_get_user_data(33), node_id, time_s, time_f, &trot, q[0], q[1], q[2], drag);\n"
- "\t\treturn buffer_pos;\n"
- "\t}\n");
- v_cg_add_param(VCGP_REAL32, "drag");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_OBJECT, "o_transform_scale_real32", 34, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_REAL32, "scale_x");
- v_cg_add_param(VCGP_REAL32, "scale_y");
- v_cg_add_param(VCGP_REAL32, "scale_z");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_OBJECT, "o_transform_pos_real64", 35, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_UINT32, "time_s");
- v_cg_add_param(VCGP_UINT32, "time_f");
- v_cg_add_param(VCGP_POINTER_TYPE,"real64");
- v_cg_add_param(VCGP_POINTER, "pos");
- v_cg_add_param(VCGP_POINTER_TYPE,"real64");
- v_cg_add_param(VCGP_POINTER, "speed");
- v_cg_add_param(VCGP_POINTER_TYPE,"real64");
- v_cg_add_param(VCGP_POINTER, "accelerate");
- v_cg_add_param(VCGP_POINTER_TYPE,"real64");
- v_cg_add_param(VCGP_POINTER, "drag_normal");
- v_cg_add_param(VCGP_PACK_INLINE, "\t{\n"
- "\t\tunsigned char mask = 0;\n"
- "\t\tunsigned int cmd;\n"
- "\t\tcmd = buffer_pos++;\n"
- "\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], pos[0]);\n"
- "\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], pos[1]);\n"
- "\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], pos[2]);\n"
- "\t\tif(speed != NULL && (speed[0] > 0.0000001 || speed[0] < -0.0000001 || speed[1] > 0.0000001 || speed[1] < -0.0000001 || speed[2] > 0.0000001 || speed[2] < -0.0000001))\n"
- "\t\t{\n"
- "\t\t\tmask |= 1;\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], speed[0]);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], speed[1]);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], speed[2]);\n"
- "\t\t}\n"
- "\t\tif(accelerate != NULL && (accelerate[0] > 0.0000001 || accelerate[0] < -0.0000001 || accelerate[1] > 0.0000001 || accelerate[1] < -0.0000001 || accelerate[2] > 0.0000001 || accelerate[2] < -0.0000001))\n"
- "\t\t{\n"
- "\t\t\tmask |= 2;\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], accelerate[0]);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], accelerate[1]);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], accelerate[2]);\n"
- "\t\t}\n"
- "\t\tif(drag_normal != NULL && (drag > 0.0000001 || drag < -0.0000001) && (drag_normal[0] > 0.0000001 || drag_normal[0] < -0.0000001 || drag_normal[1] > 0.0000001 || drag_normal[1] < -0.0000001 || drag_normal[2] > 0.0000001 || drag_normal[2] < -0.0000001))\n"
- "\t\t{\n"
- "\t\t\tmask |= 4;\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], drag_normal[0]);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], drag_normal[1]);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], drag_normal[2]);\n"
- "\t\t}\n"
- "\t\tif(drag > 0.0000001 || drag < -0.0000001)\n"
- "\t\t{\n"
- "\t\t\tmask |= 8;\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], drag);\n"
- "\t\t}\n"
- "\t\tvnp_raw_pack_uint8(&buf[cmd], mask);\n"
- "\t}if(FALSE)\n");
- v_cg_add_param(VCGP_UNPACK_INLINE, "\t{\n"
- "\t\tdouble output[4][3];\n"
- "\t\tunsigned int i, j;\n"
- "\t\tchar mask, pow = 1;\n"
- "\t\tbuffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &mask);\n"
- "\t\tfor(j = 0; j < 3; j++)\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &output[0][j]);\n"
- "\t\tfor(i = 1; i < 4; i++)\n"
- "\t\t{\n"
- "\t\t\tif((mask & pow) != 0)\n"
- "\t\t\t\tfor(j = 0; j < 3; j++)\n"
- "\t\t\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &output[i][j]);\n"
- "\t\t\telse\n"
- "\t\t\t\tfor(j = 0; j < 3; j++)\n"
- "\t\t\t\t\toutput[i][j] = 0;\n"
- "\t\t\tpow *= 2;\n"
- "\t\t}\n"
- "\t\tif((mask & pow) != 0)\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &drag);\n"
- "\t\telse\n"
- "\t\t\tdrag = 0.0;\n"
- "\t\tif(func_o_transform_pos_real64 != NULL)\n"
- "\t\t\tfunc_o_transform_pos_real64(v_fs_get_user_data(35), node_id, time_s, time_f, &output[0][0], &output[1][0], &output[2][0], &output[3][0], drag);\n"
- "\t\treturn buffer_pos;\n"
- "\t}\n");
- v_cg_add_param(VCGP_REAL64, "drag");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_OBJECT, "o_transform_rot_real64", 36, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_UINT32, "time_s");
- v_cg_add_param(VCGP_UINT32, "time_f");
- v_cg_add_param(VCGP_POINTER_TYPE,"VNQuat64");
- v_cg_add_param(VCGP_POINTER, "rot");
- v_cg_add_param(VCGP_POINTER_TYPE,"VNQuat64");
- v_cg_add_param(VCGP_POINTER, "speed");
- v_cg_add_param(VCGP_POINTER_TYPE,"VNQuat64");
- v_cg_add_param(VCGP_POINTER, "accelerate");
- v_cg_add_param(VCGP_POINTER_TYPE,"VNQuat64");
- v_cg_add_param(VCGP_POINTER, "drag_normal");
- v_cg_add_param(VCGP_PACK_INLINE, "\t{\n"
- "\t\tuint8 mask = 0;\n"
- "\t\tunsigned int maskpos;\n"
- "\t\tmaskpos = buffer_pos++;\t\t/* Remember location, and reserve a byte for the mask. */\n"
- "\t\tbuffer_pos += vnp_pack_quat64(&buf[buffer_pos], rot);\n"
- "\t\tif(v_quat64_valid(speed))\n"
- "\t\t{\n"
- "\t\t\tmask |= 1;\n"
- "\t\t\tbuffer_pos += vnp_pack_quat64(&buf[buffer_pos], speed);\n"
- "\t\t}\n"
- "\t\tif(v_quat64_valid(accelerate))\n"
- "\t\t{\n"
- "\t\t\tmask |= 2;\n"
- "\t\t\tbuffer_pos += vnp_pack_quat64(&buf[buffer_pos], accelerate);\n"
- "\t\t}\n"
- "\t\tif(v_quat64_valid(drag_normal))\n"
- "\t\t{\n"
- "\t\t\tmask |= 4;\n"
- "\t\t\tbuffer_pos += vnp_pack_quat64(&buf[buffer_pos], drag_normal);\n"
- "\t\t}\n"
- "\t\tif(drag > 0.0000001 || drag < -0.0000001)\n"
- "\t\t{\n"
- "\t\t\tmask |= 8;\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], drag);\n"
- "\t\t}\n"
- "\t\tvnp_raw_pack_uint8(&buf[maskpos], mask);\t/* Write the mask into start of command. */\n"
- "\t}\n"
- "\tif(FALSE)\n");
- v_cg_add_param(VCGP_UNPACK_INLINE, "\t{\n"
- "\t\tVNQuat64 trot, temp[3], *q[3];\n"
- "\t\tunsigned int i;\n"
- "\t\tuint8 mask, test;\n"
- "\t\tbuffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &mask);\n"
- "\t\tbuffer_pos += vnp_unpack_quat64(&buf[buffer_pos], &trot);\n"
- "\t\tfor(i = 0, test = 1; i < sizeof temp / sizeof *temp; i++, test <<= 1)\n"
- "\t\t{\n"
- "\t\t\tif(mask & test)\t\t/* Field present? */\n"
- "\t\t\t{\n"
- "\t\t\t\tbuffer_pos += vnp_unpack_quat64(&buf[buffer_pos], &temp[i]);\n"
- "\t\t\t\tq[i] = &temp[i];\n"
- "\t\t\t}\n"
- "\t\t\telse\n"
- "\t\t\t\tq[i] = NULL;\n"
- "\t\t}\n"
- "\t\tif(mask & test)\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &drag);\n"
- "\t\telse\n"
- "\t\t\tdrag = 0.0;\n"
- "\t\tif(func_o_transform_rot_real64 != NULL)\n"
- "\t\t\tfunc_o_transform_rot_real64(v_fs_get_user_data(36), node_id, time_s, time_f, &trot, q[0], q[1], q[2], drag);\n"
- "\t\treturn buffer_pos;\n"
- "\t}\n");
- v_cg_add_param(VCGP_REAL64, "drag");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_OBJECT, "o_transform_scale_real64", 37, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_REAL64, "scale_x");
- v_cg_add_param(VCGP_REAL64, "scale_y");
- v_cg_add_param(VCGP_REAL64, "scale_z");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_OBJECT, "o_transform_subscribe", 38, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_ENUM_NAME, "VNRealFormat");
- v_cg_add_param(VCGP_ENUM, "type");
- v_cg_alias(TRUE, "o_transform_unsubscribe", NULL, 4, NULL);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_OBJECT, "o_light_set", 39, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_REAL64, "light_r");
- v_cg_add_param(VCGP_REAL64, "light_g");
- v_cg_add_param(VCGP_REAL64, "light_b");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_OBJECT, "o_link_set", 40, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_UINT16, "link_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_NODE_ID, "link");
- v_cg_add_param(VCGP_NAME, "label");
- v_cg_add_param(VCGP_UINT32, "target_id");
- v_cg_alias(TRUE, "o_link_destroy", NULL, 2, NULL);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_OBJECT, "o_method_group_create", 41, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_UINT16, "group_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_NAME, "name");
- v_cg_alias(FALSE, "o_method_group_destroy", "if(name[0] == 0)", 2, NULL);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_OBJECT, "o_method_group_subscribe", 42, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_UINT16, "group_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_alias(TRUE, "o_method_group_unsubscribe", NULL, 2, NULL);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_OBJECT, "o_method_create", 43, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_UINT16, "group_id");
- v_cg_add_param(VCGP_UINT16, "method_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_LONG_NAME, "name");
- v_cg_add_param(VCGP_UINT8, "param_count");
- v_cg_add_param(VCGP_POINTER_TYPE,"VNOParamType");
- v_cg_add_param(VCGP_POINTER, "param_types");
- v_cg_add_param(VCGP_POINTER_TYPE,"char *");
- v_cg_add_param(VCGP_POINTER, "param_names");
- v_cg_add_param(VCGP_PACK_INLINE, "\t{\n"
- "\t\tunsigned int i, j, sum = 1;\n"
- "\t\tfor(i = 0; i < param_count; i++)\n"
- "\t\t{\n"
- "\t\t\tsum += 3;\n"
- "\t\t\tfor(j = 0; param_names[i][j] != 0; j++);\n"
- "\t\t}\n"
- "\t\tif(sum + buffer_pos > 1500)\n"
- "\t\t\treturn;\n"
- "\t\tfor(i = 0; i < param_count; i++)\n"
- "\t\t{\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], param_types[i]);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_string(&buf[buffer_pos], param_names[i], 1500 - buffer_pos);\n"
- "\t\t}\n"
- "\t}\n");
- v_cg_add_param(VCGP_UNPACK_INLINE, "\tif(param_count != 255)\n"
- "\t{\n"
- "\t\tunsigned int i, size, text = 0;\n"
- "\t\tVNOParamType types[256];\n"
- "\t\tuint8 t;\n"
- "\t\tchar name_buf[1500], *names[256];\n"
- "\t\tfor(i = 0; i < param_count; i++)\n"
- "\t\t{\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &t);\n"
- "\t\t\ttypes[i] = t;\n"
- "\t\t\tnames[i] = &name_buf[text];\n"
- "\t\t\tsize = vnp_raw_unpack_string(&buf[buffer_pos], names[i], 1500 - buffer_pos, buffer_length - buffer_pos);\n"
- "\t\t\tbuffer_pos += size;\n"
- "\t\t\ttext += size;\n"
- "\t\t}\n"
- "\t\tif(func_o_method_create != NULL)\n"
- "\t\t\tfunc_o_method_create(v_fs_get_user_data(43), node_id, group_id, method_id, name, param_count, types, (const char **) names);\n"
- "\t\treturn buffer_pos;\n"
- "\t}\n");
- v_cg_alias(FALSE, "o_method_destroy", "if(name[0] == 0)", 3, NULL);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_OBJECT, "o_method_call", 44, VCGCT_UNIQUE);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_UINT16, "group_id");
- v_cg_add_param(VCGP_UINT16, "method_id");
- v_cg_add_param(VCGP_NODE_ID, "sender");
- v_cg_add_param(VCGP_POINTER_TYPE, "VNOPackedParams");
- v_cg_add_param(VCGP_POINTER, "params");
- v_cg_add_param(VCGP_PACK_INLINE, "\t{\n"
- "\t\tunsigned int i;\n"
- "\t\tuint16 size;\n"
- "\t\tvnp_raw_unpack_uint16(params, &size);\n"
- "\t\tfor(i = 0; i < size; i++)\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], ((uint8 *)params)[i]);\n"
- "\t\tfree((void *) params);\t/* Drop the const. */\n"
- "\t}\n");
- v_cg_add_param(VCGP_UNPACK_INLINE, "\t{\n"
- "\t\tunsigned int i;\n"
- "\t\tuint8 par[1500];\n"
- "\t\tuint16 size;\n"
- "\t\tvnp_raw_unpack_uint16(&buf[buffer_pos], &size);\n"
- "\t\tfor(i = 0; i < size; i++)\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &par[i]);\n"
- "\t\tif(func_o_method_call != NULL)\n"
- "\t\t\tfunc_o_method_call(v_fs_get_user_data(44), node_id, group_id, method_id, sender, par);\n"
- "\t\treturn buffer_pos;\n"
- "\t}\n");
-
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_OBJECT, "o_anim_run", 45, VCGCT_UNIQUE);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_UINT16, "link_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_UINT32, "time_s");
- v_cg_add_param(VCGP_UINT32, "time_f");
- v_cg_add_param(VCGP_UINT8, "dimensions");
- v_cg_add_param(VCGP_POINTER_TYPE, "real64");
- v_cg_add_param(VCGP_POINTER, "pos");
- v_cg_add_param(VCGP_POINTER_TYPE, "real64");
- v_cg_add_param(VCGP_POINTER, "speed");
- v_cg_add_param(VCGP_POINTER_TYPE, "real64");
- v_cg_add_param(VCGP_POINTER, "accel");
- v_cg_add_param(VCGP_POINTER_TYPE, "real64");
- v_cg_add_param(VCGP_POINTER, "scale");
- v_cg_add_param(VCGP_POINTER_TYPE, "real64");
- v_cg_add_param(VCGP_POINTER, "scale_speed");
- v_cg_add_param(VCGP_PACK_INLINE, "\t{\n"
- "\t\tunsigned char mask = 0;\n"
- "\t\tunsigned int cmd, i;\n"
- "\t\tcmd = buffer_pos++;\n"
- "\t\tif(dimensions > 4)\n"
- "\t\t\tdimensions = 4;\n"
- "\t\tfor(i = 0; i < dimensions; i++)\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], pos[i]);\n"
- "\t\tif(speed != NULL)\n"
- "\t\t{\n"
- "\t\t\tmask |= 1;\n"
- "\t\t\tfor(i = 0; i < dimensions; i++)\n"
- "\t\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], speed[i]);\n"
- "\t\t}\n"
- "\t\tif(accel != NULL)\n"
- "\t\t{\n"
- "\t\t\tmask |= 2;\n"
- "\t\t\tfor(i = 0; i < dimensions; i++)\n"
- "\t\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], accel[i]);\n"
- "\t\t}\n"
- "\t\tif(scale != NULL)\n"
- "\t\t{\n"
- "\t\t\tmask |= 3;\n"
- "\t\t\tfor(i = 0; i < dimensions; i++)\n"
- "\t\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], scale[i]);\n"
- "\t\t}\n"
- "\t\tif(scale_speed != NULL)\n"
- "\t\t{\n"
- "\t\t\tmask |= 4;\n"
- "\t\t\tfor(i = 0; i < dimensions; i++)\n"
- "\t\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], scale_speed[i]);\n"
- "\t\t}\n"
- "\t\tvnp_raw_pack_uint8(&buf[cmd], mask);\n"
- "\t}\n");
- v_cg_add_param(VCGP_UNPACK_INLINE, "\t{\n"
- "\t\tdouble output[5][4];\n"
- "\t\tunsigned int i, j;\n"
- "\t\tchar mask, pow = 1;\n"
- "\t\tbuffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &mask);\n"
- "\t\tif(dimensions > 4)\n"
- "\t\t\tdimensions = 4;\n"
- "\t\tfor(j = 0; j < dimensions; j++)\n"
- "\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &output[0][j]);\n"
- "\t\tfor(i = 1; i < 5; i++)\n"
- "\t\t{\n"
- "\t\t\tif((mask & pow) != 0)\n"
- "\t\t\t\tfor(j = 0; j < dimensions; j++)\n"
- "\t\t\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &output[i][j]);\n"
- "\t\t\telse\n"
- "\t\t\t\tfor(j = 0; j < dimensions; j++)\n"
- "\t\t\t\t\toutput[i][j] = 0;\n"
- "\t\t\tpow *= 2;\n"
- "\t\t}\n"
- "\t\tif(func_o_anim_run != NULL)\n"
- "\t\t\tfunc_o_anim_run(v_fs_get_user_data(45), node_id, link_id, time_s, time_f, dimensions, &output[0][0], &output[1][0], &output[2][0], &output[3][0], &output[4][0]);\n"
- "\t\treturn buffer_pos;\n"
- "\t}\n");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_OBJECT, "o_hide", 46, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_UINT8, "hidden");
- v_cg_end_cmd();
-}
-
-#endif
diff --git a/extern/verse/dist/v_cmd_def_s.c b/extern/verse/dist/v_cmd_def_s.c
deleted file mode 100644
index 1b8b69dcd6d..00000000000
--- a/extern/verse/dist/v_cmd_def_s.c
+++ /dev/null
@@ -1,211 +0,0 @@
-
-#include
-#include
-#include "verse_header.h"
-#include "v_cmd_gen.h"
-#include "v_cmd_buf.h"
-
-#if defined(V_GENERATE_FUNC_MODE)
-
-void v_gen_system_cmd_def(void)
-{
- v_cg_new_manual_cmd(0, "connect", "VSession verse_send_connect(const char *name, const char *pass, const char *address, const uint8 *expected_host_id)", NULL, NULL);
-
- v_cg_new_manual_cmd(1, "connect_accept", "VSession verse_send_connect_accept(VNodeID avatar, const char *address, uint8 *host_id)", NULL, NULL);
-
- v_cg_new_manual_cmd(2, "connect_terminate", "void verse_send_connect_terminate(const char *address, const char *bye)", NULL, NULL);
-
- v_cg_new_manual_cmd(5, "ping", "void verse_send_ping(const char *address, const char *message)", NULL, NULL);
-
- v_cg_new_cmd(V_NT_SYSTEM, "error_message", 6, VCGCT_UNIQUE);
- v_cg_add_param(VCGP_LONG_NAME, "message");
-
- v_cg_new_cmd(V_NT_SYSTEM, "packet_ack", 7, VCGCT_INVISIBLE_SYSTEM);
- v_cg_add_param(VCGP_UINT32, "packet_id");
- v_cg_add_param(VCGP_PACK_INLINE, "\tv_cmd_buf_set_unique_address_size(head, buffer_pos);\n"
- "\tv_cmd_buf_set_size(head, buffer_pos);\n"
- "\tv_noq_send_ack_nak_buf(v_con_get_network_queue(), head);\n"
- "\treturn;\n");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_SYSTEM, "packet_nak", 8, VCGCT_INVISIBLE_SYSTEM);
- v_cg_add_param(VCGP_UINT32, "packet_id");
- v_cg_add_param(VCGP_PACK_INLINE, "\tv_cmd_buf_set_unique_address_size(head, buffer_pos);\n"
- "\tv_cmd_buf_set_size(head, buffer_pos);\n"
- "\tv_noq_send_ack_nak_buf(v_con_get_network_queue(), head);\n"
- "\treturn;\n");
- v_cg_end_cmd();
-
-
- v_cg_new_cmd(V_NT_SYSTEM, "node_index_subscribe", 9, VCGCT_NORMAL);
- v_cg_add_param(VCGP_UINT32, "mask");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_SYSTEM, "node_create", 10, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_ENUM_NAME, "VNodeType");
- v_cg_add_param(VCGP_ENUM, "type");
- v_cg_add_param(VCGP_ENUM_NAME, "VNodeOwner");
- v_cg_add_param(VCGP_ENUM, "owner");
- v_cg_alias(FALSE, "node_destroy", "if(owner == (uint8) ~0u || type >= V_NT_NUM_TYPES)", 1, NULL);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_SYSTEM, "node_subscribe", 11, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_alias(TRUE, "node_unsubscribe", NULL, 1, NULL);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_SYSTEM, "tag_group_create", 16, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_UINT16, "group_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_NAME, "name");
- v_cg_alias(FALSE, "tag_group_destroy", "if(name[0] == 0)", 2, NULL);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_SYSTEM, "tag_group_subscribe", 17, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_UINT16, "group_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_alias(TRUE, "tag_group_unsubscribe", NULL, 2, NULL);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_SYSTEM, "tag_create", 18, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_UINT16, "group_id");
- v_cg_add_param(VCGP_UINT16, "tag_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_NAME, "name");
- v_cg_add_param(VCGP_ENUM_NAME, "VNTagType");
- v_cg_add_param(VCGP_ENUM, "type");
- v_cg_add_param(VCGP_POINTER_TYPE, "VNTag");
- v_cg_add_param(VCGP_POINTER, "tag");
- v_cg_add_param(VCGP_PACK_INLINE, "\tif(type > VN_TAG_BLOB)\n"
- "\t{\n"
- "\t\tv_cmd_buf_free(head);\n"
- "\t\treturn;\n"
- "\t}\n"
- "\tswitch(type)\n"
- "\t{\n"
- "\t\tcase VN_TAG_BOOLEAN :\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], ((VNTag *)tag)->vboolean);\n"
- "\t\tbreak;\n"
- "\t\tcase VN_TAG_UINT32 :\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], ((VNTag *)tag)->vuint32);\n"
- "\t\tbreak;\n"
- "\t\tcase VN_TAG_REAL64 :\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], ((VNTag *)tag)->vreal64);\n"
- "\t\tbreak;\n"
- "\t\tcase VN_TAG_STRING :\n"
- "\t\t{\n"
- "\t\t\tunsigned int i;\n"
- "\t\t\tfor(i = 0; ((VNTag *)tag)->vstring[i] != 0 && i < VN_TAG_MAX_BLOB_SIZE; i++)\n"
- "\t\t\t\tbuffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], ((VNTag *)tag)->vstring[i]);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 0);\n"
- "\t\t}\n"
- "\t\tbreak;\n"
- "\t\tcase VN_TAG_REAL64_VEC3 :\n"
- "\t\t{\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], ((VNTag *)tag)->vreal64_vec3[0]);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], ((VNTag *)tag)->vreal64_vec3[1]);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], ((VNTag *)tag)->vreal64_vec3[2]);\n"
- "\t\t}\n"
- "\t\tbreak;\n"
- "\t\tcase VN_TAG_LINK :\n"
- "\t\t{\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], ((VNTag *)tag)->vlink);\n"
- "\t\t}\n"
- "\t\tbreak;\n"
- "\t\tcase VN_TAG_ANIMATION :\n"
- "\t\t{\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], ((VNTag *)tag)->vanimation.curve);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], ((VNTag *)tag)->vanimation.start);\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], ((VNTag *)tag)->vanimation.end);\n"
- "\t\t}\n"
- "\t\tbreak;\n"
- "\t\tcase VN_TAG_BLOB :\n"
- "\t\t{\n"
- "\t\t\tunsigned int i;\n"
- "\t\t\tif(((VNTag *)tag)->vblob.size > VN_TAG_MAX_BLOB_SIZE)\n"
- "\t\t\t\t((VNTag *)tag)->vblob.size = VN_TAG_MAX_BLOB_SIZE;\n"
- "\t\t\tbuffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], ((VNTag *)tag)->vblob.size);\n"
- "\t\t\tfor(i = 0; i < ((VNTag *)tag)->vblob.size; i++)\n"
- "\t\t\t\tbuffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], ((uint8 *)((VNTag *)tag)->vblob.blob)[i]);\n"
- "\t\t}\n"
- "\t\tbreak;\n"
- "\t\tdefault :\n"
- "\t\t\t;\n"
- "\t}\n");
- v_cg_add_param(VCGP_UNPACK_INLINE, "\tif(type < VN_TAG_TYPE_COUNT)\n"
- "\t{\n"
- "\t\tVNTag tag;\n"
- "\t\tunsigned int i;\n"
- "\t\tchar string[VN_TAG_MAX_BLOB_SIZE];\n"
- "\t\tswitch(type)\n"
- "\t\t{\n"
- "\t\t\tcase VN_TAG_BOOLEAN :\n"
- "\t\t\t\tbuffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &tag.vboolean);\n"
- "\t\t\tbreak;\n"
- "\t\t\tcase VN_TAG_UINT32 :\n"
- "\t\t\t\tbuffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &tag.vuint32);\n"
- "\t\t\tbreak;\n"
- "\t\t\tcase VN_TAG_REAL64 :\n"
- "\t\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &tag.vreal64);\n"
- "\t\t\tbreak;\n"
- "\t\t\tcase VN_TAG_STRING :\n"
- "\t\t\t{\n"
- "\t\t\t\ttag.vstring = string;\n"
- "\t\t\t\tbuffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], string, VN_TAG_MAX_BLOB_SIZE, buffer_length - buffer_pos);\n"
- "\t\t\t}\n"
- "\t\t\tbreak;\n"
- "\t\t\tcase VN_TAG_REAL64_VEC3 :\n"
- "\t\t\t{\n"
- "\t\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &tag.vreal64_vec3[0]);\n"
- "\t\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &tag.vreal64_vec3[1]);\n"
- "\t\t\t\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &tag.vreal64_vec3[2]);\n"
- "\t\t\t}\n"
- "\t\t\tbreak;\n"
- "\t\t\tcase VN_TAG_LINK :\n"
- "\t\t\t{\n"
- "\t\t\t\tbuffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &tag.vlink);\n"
- "\t\t\t}\n"
- "\t\t\tbreak;\n"
- "\t\t\tcase VN_TAG_ANIMATION :\n"
- "\t\t\t{\n"
- "\t\t\t\tbuffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &tag.vanimation.curve);\n"
- "\t\t\t\tbuffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &tag.vanimation.start);\n"
- "\t\t\t\tbuffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &tag.vanimation.end);\n"
- "\t\t\t}\n"
- "\t\t\tbreak;\n"
- "\t\t\tcase VN_TAG_BLOB :\n"
- "\t\t\t{\n"
- "\t\t\t\tbuffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &tag.vblob.size);\n"
- "\t\t\t\tif(tag.vblob.size > VN_TAG_MAX_BLOB_SIZE)\n"
- "\t\t\t\t\ttag.vblob.size = VN_TAG_MAX_BLOB_SIZE;\n"
- "\t\t\t\ttag.vblob.blob = string;\n"
- "\t\t\t\tfor(i = 0; i < tag.vblob.size; i++)\n"
- "\t\t\t\t\tbuffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &string[i]);\n"
- "\t\t\t}\n"
- "\t\t\tbreak;\n"
- "\t\tdefault :\n"
- "\t\t\t;\n"
- "\t\t}\n"
- "\t\tif(func_tag_create != NULL)\n"
- "\t\tfunc_tag_create(v_fs_get_user_data(18), node_id, group_id, tag_id, name, type, &tag);\n"
- "\t\treturn buffer_pos;\n"
- "\t}\n");
- v_cg_alias(FALSE, "tag_destroy", "if(type >= VN_TAG_TYPE_COUNT)", 3, NULL);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_SYSTEM, "node_name_set", 19, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_LONG_NAME, "name");
-
- v_cg_end_cmd();
-}
-
-#endif
diff --git a/extern/verse/dist/v_cmd_def_t.c b/extern/verse/dist/v_cmd_def_t.c
deleted file mode 100644
index 3c568b42d7b..00000000000
--- a/extern/verse/dist/v_cmd_def_t.c
+++ /dev/null
@@ -1,36 +0,0 @@
-
-#include
-#include
-#include "verse_header.h"
-#include "v_cmd_gen.h"
-#include "v_cmd_buf.h"
-
-#if defined(V_GENERATE_FUNC_MODE)
-
-void v_gen_text_cmd_def(void)
-{
- v_cg_new_cmd(V_NT_TEXT, "t_language_set", 96, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_LONG_NAME, "language");
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_TEXT, "t_buffer_create", 97, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_BUFFER_ID, "buffer_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_add_param(VCGP_NAME, "name");
- v_cg_alias(FALSE, "t_buffer_destroy", "if(name[0] == 0)", 2, NULL);
- v_cg_end_cmd();
-
- v_cg_new_cmd(V_NT_TEXT, "t_buffer_subscribe", 98, VCGCT_NORMAL);
- v_cg_add_param(VCGP_NODE_ID, "node_id");
- v_cg_add_param(VCGP_BUFFER_ID, "buffer_id");
- v_cg_add_param(VCGP_END_ADDRESS, NULL);
- v_cg_alias(TRUE, "t_buffer_unsubscribe", NULL, 2, NULL);
- v_cg_end_cmd();
-
- v_cg_new_manual_cmd(99, "t_text_set", "void verse_send_t_text_set(VNodeID node_id, VBufferID buffer_id, uint32 pos, uint32 length, const char *text)", NULL, NULL);
-}
-
-#endif
diff --git a/extern/verse/dist/v_cmd_gen.c b/extern/verse/dist/v_cmd_gen.c
deleted file mode 100644
index 3d18f8cf1af..00000000000
--- a/extern/verse/dist/v_cmd_gen.c
+++ /dev/null
@@ -1,939 +0,0 @@
-/*
-**
-*/
-
-#include
-#include
-#include
-
-#include "verse_header.h"
-#include "v_cmd_buf.h"
-
-#include "v_cmd_gen.h"
-
-#if defined _WIN32
-#include
-#define chdir _chdir
-#define snprintf _snprintf
-#endif
-
-#if defined V_GENERATE_FUNC_MODE
-
-#define MAX_PARAMS_PER_CMD 32
-
-static struct {
- FILE *nodes[V_NT_NUM_TYPES_NETPACK];
- FILE *init;
- FILE *unpack;
- FILE *verse_h;
- FILE *internal_verse_h;
- const char *func_name;
- VNodeType type;
- VCGCommandType command;
- unsigned int param_count;
- VCGParam param_type[MAX_PARAMS_PER_CMD];
- const char *param_name[MAX_PARAMS_PER_CMD];
- unsigned int cmd_id;
- const char *alias_name;
- const char *alias_qualifier;
- unsigned int alias_param;
- unsigned int *alias_param_array;
- char alias_bool_switch;
-} VCGData;
-
-extern void v_gen_system_cmd_def(void);
-extern void v_gen_object_cmd_def(void);
-extern void v_gen_geometry_cmd_def(void);
-extern void v_gen_material_cmd_def(void);
-extern void v_gen_bitmap_cmd_def(void);
-extern void v_gen_text_cmd_def(void);
-extern void v_gen_curve_cmd_def(void);
-extern void v_gen_audio_cmd_def(void);
-
-static int v_cg_init(const char *src_path)
-{
- char buf[1024];
- int i;
- FILE *f;
-
- VCGData.nodes[V_NT_OBJECT] = fopen("v_gen_pack_o_node.c", "w");
- VCGData.nodes[V_NT_GEOMETRY] = fopen("v_gen_pack_g_node.c", "w");
- VCGData.nodes[V_NT_MATERIAL] = fopen("v_gen_pack_m_node.c", "w");
- VCGData.nodes[V_NT_BITMAP] = fopen("v_gen_pack_b_node.c", "w");
- VCGData.nodes[V_NT_TEXT] = fopen("v_gen_pack_t_node.c", "w");
- VCGData.nodes[V_NT_CURVE] = fopen("v_gen_pack_c_node.c", "w");
- VCGData.nodes[V_NT_AUDIO] = fopen("v_gen_pack_a_node.c", "w");
- VCGData.nodes[V_NT_SYSTEM] = fopen("v_gen_pack_s_node.c", "w");
- VCGData.init = fopen("v_gen_pack_init.c", "w");
- VCGData.unpack = fopen("v_gen_unpack_func.h", "w");
- VCGData.verse_h = fopen("verse.h", "w");
- VCGData.internal_verse_h = fopen("v_internal_verse.h", "w");
- for(i = 0; i < V_NT_NUM_TYPES_NETPACK + 1; i++)
- {
- if(i == V_NT_NUM_TYPES_NETPACK)
- f = VCGData.init;
- else
- f = VCGData.nodes[i];
- fprintf(f,
- "/*\n"
- "** This is automatically generated source code -- do not edit.\n"
- "** Changes are affected either by editing the corresponding protocol\n"
- "** definition file (v_cmd_def_X.c where X=node type), or by editing\n"
- "** the code generator itself, in v_cmd_gen.c.\n"
- "*/\n\n");
- fprintf(f, "#include \n");
- fprintf(f, "#include \n\n");
- fprintf(f, "#include \"v_cmd_gen.h\"\n");
- fprintf(f, "#if !defined(V_GENERATE_FUNC_MODE)\n");
- fprintf(f, "#include \"verse.h\"\n");
- fprintf(f, "#include \"v_cmd_buf.h\"\n");
- fprintf(f, "#include \"v_network_out_que.h\"\n");
- fprintf(f, "#include \"v_network.h\"\n");
- fprintf(f, "#include \"v_connection.h\"\n");
- fprintf(f, "#include \"v_util.h\"\n\n");
- }
- VCGData.cmd_id = 0;
- fprintf(f, "#include \"v_gen_unpack_func.h\"\n\n");
- fprintf(f,
- "#include \"verse.h\"\n\n\n"
- "extern void verse_send_packet_ack(uint32 packet_id);\n"
- "extern void verse_send_packet_nak(uint32 packet_id);\n\n");
-
- fprintf(VCGData.init, "void init_pack_and_unpack(void)\n{\n");
- fprintf(VCGData.verse_h,
- "/*\n"
- "** Verse API Header file (for use with libverse.a).\n"
- "** This is automatically generated code; do not edit.\n"
- "*/\n\n"
- "\n"
- "#if !defined VERSE_H\n"
- "\n"
- "#if defined __cplusplus\t\t/* Declare as C symbols for C++ users. */\n"
- "extern \"C\" {\n"
- "#endif\n\n"
- "#define\tVERSE_H\n\n");
- /* Copy contents of "verse_header.h" into output "verse.h". */
- snprintf(buf, sizeof buf, "%sverse_header.h", src_path);
- f = fopen(buf, "r");
- if(f != NULL)
- {
- while((i = fgetc(f)) != EOF)
- fputc(i, VCGData.verse_h);
- fclose(f);
- }
- else
- {
- fprintf(stderr, "mkprot: Couldn't find \"%s\" input file\n", buf);
- return 0;
- }
- fprintf(VCGData.verse_h, "\n/* Command sending functions begin. ----------------------------------------- */\n\n");
- return 1;
-}
-
-static void v_cg_close(void)
-{
- unsigned int i;
- for(i = 0; i < V_NT_NUM_TYPES_NETPACK; i++)
- {
- fprintf(VCGData.nodes[i], "#endif\n\n");
- }
- fprintf(VCGData.init, "}\n#endif\n\n");
- fprintf(VCGData.verse_h,
- "\n#if defined __cplusplus\n"
- "}\n"
- "#endif\n");
- fprintf(VCGData.verse_h, "\n#endif\t\t/* VERSE_H */\n");
-}
-
-void v_cg_new_cmd(VCGCommandType type, const char *name, unsigned int cmd_id, VCGCommandType command)
-{
- VCGData.param_count = 0;
- VCGData.func_name = name;
- VCGData.type = type;
- VCGData.cmd_id = cmd_id;
- VCGData.command = command;
-/* printf("def: %u: %s\n", cmd_id, name);*/
-}
-
-void v_cg_new_manual_cmd(unsigned int cmd_id, const char *name, const char *def, const char *alias_name, const char *alias_def)
-{
- fprintf(VCGData.verse_h, "extern %s;\n", def);
- if(alias_def != NULL)
- fprintf(VCGData.verse_h, "extern %s;\n", alias_def);
- fprintf(VCGData.init, "\tv_fs_add_func(%i, v_unpack_%s, (void *) verse_send_%s, ", cmd_id, name, name);
- if(alias_name != NULL)
- fprintf(VCGData.init, "(void *) verse_send_%s);\n", alias_name);
- else
- fprintf(VCGData.init, "NULL);\n");
- fprintf(VCGData.unpack, "extern unsigned int v_unpack_%s(const char *data, size_t length);\n", name);
-/* printf("def: %u: %s\n", cmd_id, name);*/
-}
-
-void v_cg_alias(char bool_switch, const char *name, const char *qualifier, unsigned int param, unsigned int *param_array)
-{
- VCGData.alias_name = name;
- VCGData.alias_qualifier = qualifier;
- VCGData.alias_param = param;
- VCGData.alias_param_array = param_array;
- VCGData.alias_bool_switch = bool_switch;
-}
-
-void v_cg_add_param(VCGParam type, const char *name)
-{
- if(VCGData.param_count == MAX_PARAMS_PER_CMD)
- exit(1);
- VCGData.param_type[VCGData.param_count] = type;
- VCGData.param_name[VCGData.param_count] = name;
- VCGData.param_count++;
-}
-
-static void v_cg_gen_func_params(FILE *f, boolean types, boolean alias)
-{
- unsigned int i;
- unsigned int length, active;
- length = VCGData.param_count;
- if(alias)
- length = VCGData.alias_param;
- for(i = 0; i < length; i++)
- {
- if(alias && VCGData.alias_param_array != NULL)
- active = VCGData.alias_param_array[i];
- else
- {
- for(;(VCGData.param_type[i] == VCGP_PACK_INLINE || VCGData.param_type[i] == VCGP_UNPACK_INLINE || VCGData.param_type[i] == VCGP_POINTER_TYPE || VCGData.param_type[i] == VCGP_ENUM_NAME) && i < VCGData.param_count; i++);
- if(i == VCGData.param_count)
- break;
- active = i;
- }
-
- if(active < VCGData.param_count && VCGData.param_type[active] != VCGP_END_ADDRESS)
- {
- switch(VCGData.param_type[active])
- {
- case VCGP_UINT8 :
- fprintf(f, "uint8 %s", VCGData.param_name[active]);
- break;
- case VCGP_UINT16 :
- fprintf(f, "uint16 %s", VCGData.param_name[active]);
- break;
- case VCGP_UINT32 :
- fprintf(f, "uint32 %s", VCGData.param_name[active]);
- break;
- case VCGP_REAL32 :
- fprintf(f, "real32 %s", VCGData.param_name[active]);
- break;
- case VCGP_REAL64 :
- fprintf(f, "real64 %s", VCGData.param_name[active]);
- break;
- case VCGP_POINTER :
- if(active != 0 && VCGData.param_type[active - 1] == VCGP_POINTER_TYPE)
- fprintf(f, "const %s *%s", VCGData.param_name[active - 1], VCGData.param_name[active]);
- else
- fprintf(f, "const void *%s", VCGData.param_name[active]);
- break;
- case VCGP_NAME :
- if(types)
- fprintf(f, "char %s[16]", VCGData.param_name[active]);
- else
- fprintf(f, "const char *%s", VCGData.param_name[active]);
- break;
- case VCGP_LONG_NAME :
- if(types)
- fprintf(f, "char %s[512]", VCGData.param_name[active]);
- else
- fprintf(f, "const char *%s", VCGData.param_name[active]);
- break;
- case VCGP_NODE_ID :
- fprintf(f, "VNodeID %s", VCGData.param_name[active]);
- break;
- case VCGP_LAYER_ID :
- fprintf(f, "VLayerID %s", VCGData.param_name[active]);
- break;
- case VCGP_BUFFER_ID :
- fprintf(f, "VBufferID %s", VCGData.param_name[active]);
- break;
- case VCGP_FRAGMENT_ID :
- fprintf(f, "VNMFragmentID %s", VCGData.param_name[active]);
- break;
- case VCGP_ENUM :
-/* if(types)
- fprintf(f, "uint8 %s", VCGData.param_name[active]);
- else
-*/ fprintf(f, "%s %s", VCGData.param_name[active - 1], VCGData.param_name[active]);
- break;
- }
- if(types)
- fprintf(f, ";\n\t");
- else
- {
- for(;(VCGData.param_type[active + 1] == VCGP_END_ADDRESS || VCGData.param_type[active + 1] == VCGP_PACK_INLINE || VCGData.param_type[active + 1] == VCGP_UNPACK_INLINE || VCGData.param_type[active + 1] == VCGP_POINTER_TYPE) && active < VCGData.param_count; active++);
- if(active + 1 < length)
- fprintf(f, ", ");
- }
- }
- }
-}
-
-static void v_cg_create_print(FILE *f, boolean send, boolean alias)
-{
- unsigned int i, length, active;
- const char *name;
- if(VCGData.command == VCGCT_INVISIBLE_SYSTEM)
- return;
- name = VCGData.func_name;
- if(alias)
- name = VCGData.alias_name;
- if(send)
- fprintf(f, "\tprintf(\"send: verse_send_%s(", name);
- else
- fprintf(f, "\tprintf(\"receive: verse_send_%s(", name);
-
- length = VCGData.param_count;
- if(alias)
- length = VCGData.alias_param;
- for(i = 0; i < length; i++)
- {
- if(alias && VCGData.alias_param_array != NULL)
- active = VCGData.alias_param_array[i];
- else
- active = i;
-
- switch(VCGData.param_type[active])
- {
- case VCGP_NODE_ID :
- fprintf(f, "%s = %%u ", VCGData.param_name[active]);
- break;
- case VCGP_UINT8 :
- case VCGP_UINT16 :
- case VCGP_UINT32 :
- case VCGP_LAYER_ID :
- case VCGP_BUFFER_ID :
- case VCGP_ENUM :
- case VCGP_FRAGMENT_ID :
- fprintf(f, "%s = %%u ", VCGData.param_name[active]);
- break;
- case VCGP_REAL32 :
- case VCGP_REAL64 :
- fprintf(f, "%s = %%f ", VCGData.param_name[active]);
- break;
- case VCGP_POINTER :
- if(send)
- fprintf(f, "%s = %%p ", VCGData.param_name[active]);
- break;
- case VCGP_NAME :
- case VCGP_LONG_NAME :
- fprintf(f, "%s = %%s ", VCGData.param_name[active]);
- break;
- }
- }
- if(send)
- fprintf(f, ");\\n\"");
- else
- fprintf(f, "); callback = %%p\\n\"");
-
- for(i = 0; i < length; i++)
- {
- if(alias && VCGData.alias_param_array != NULL)
- active = VCGData.alias_param_array[i];
- else
- active = i;
- switch(VCGData.param_type[active])
- {
- case VCGP_NODE_ID :
- fprintf(f, ", %s", VCGData.param_name[active]);
- break;
- case VCGP_POINTER :
- if(!send)
- break;
- case VCGP_UINT8 :
- case VCGP_UINT16 :
- case VCGP_UINT32 :
- case VCGP_LAYER_ID :
- case VCGP_BUFFER_ID :
- case VCGP_ENUM :
- case VCGP_FRAGMENT_ID :
- case VCGP_REAL32 :
- case VCGP_REAL64 :
- case VCGP_NAME :
- case VCGP_LONG_NAME :
- fprintf(f, ", %s", VCGData.param_name[active]);
- break;
- }
- }
- if(send)
- fprintf(f, ");\n");
- else if(alias)
- fprintf(f, ", v_fs_get_alias_user_func(%u));\n", VCGData.cmd_id);
- else
- fprintf(f, ", v_fs_get_user_func(%u));\n", VCGData.cmd_id);
-
-}
-
-static unsigned int v_cg_compute_command_size(unsigned int start, boolean end)
-{
- unsigned int size = 0;
- for(; start < VCGData.param_count; start++)
- {
- switch(VCGData.param_type[start])
- {
- case VCGP_UINT8 :
- case VCGP_ENUM :
- size++;
- break;
- case VCGP_UINT16 :
- case VCGP_LAYER_ID :
- case VCGP_BUFFER_ID :
- case VCGP_FRAGMENT_ID :
- size += 2;
- break;
- case VCGP_NODE_ID :
- case VCGP_UINT32 :
- case VCGP_REAL32 :
- size += 4;
- break;
- case VCGP_REAL64 :
- size += 8;
- break;
- case VCGP_NAME :
- if(end)
- return size;
- size += 16;
- break;
- case VCGP_LONG_NAME :
- if(end)
- return size;
- size += 512;
- break;
- case VCGP_POINTER :
- case VCGP_PACK_INLINE :
- case VCGP_UNPACK_INLINE :
- if(end)
- return size;
- size += 1500;
- break;
- case VCGP_END_ADDRESS :
- if(end)
- return size;
- }
- }
- return size;
-}
-
-void v_cg_set_command_address(FILE *f, boolean alias)
-{
- unsigned int i, j, count = 0, length, size = 1, *param, def[] ={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
-
- for(i = 0; i < VCGData.param_count; i++)
- if(VCGData.param_type[i] == VCGP_END_ADDRESS)
- break;
- if(i == VCGData.param_count)
- return;
- if(alias)
- length = VCGData.alias_param;
- else
- length = VCGData.param_count;
-
- if(alias && VCGData.alias_param_array != 0)
- param = VCGData.alias_param_array;
- else
- param = def;
-
- if(i == VCGData.param_count)
- return;
- fprintf(f, "\tif(");
- for(i = j = 0; i < VCGData.param_count; i++)
- {
- switch(VCGData.param_type[i])
- {
- case VCGP_UINT8 :
- case VCGP_ENUM :
- size++;
- break;
- case VCGP_UINT16 :
- case VCGP_LAYER_ID :
- case VCGP_BUFFER_ID :
- case VCGP_FRAGMENT_ID :
- size += 2;
- break;
- case VCGP_NODE_ID :
- case VCGP_UINT32 :
- case VCGP_REAL32 :
- size += 4;
- break;
- }
- if(j < length && param[j] == i)
- {
- switch(VCGData.param_type[param[j]])
- {
- case VCGP_UINT8 :
- case VCGP_ENUM :
- break;
- case VCGP_UINT16 :
- case VCGP_LAYER_ID :
- case VCGP_BUFFER_ID :
- case VCGP_FRAGMENT_ID :
- if(count++ != 0)
- fprintf(f, " || ");
- fprintf(f, "%s == (uint16) ~0u", VCGData.param_name[param[j]]);
- break;
- case VCGP_NODE_ID :
- case VCGP_UINT32 :
- case VCGP_REAL32 :
- if(count++ != 0)
- fprintf(f, " || ");
- fprintf(f, "%s == (uint32) ~0u", VCGData.param_name[param[j]]);
- break;
- }
- j++;
- }
- if(VCGData.param_type[i] == VCGP_END_ADDRESS)
- {
- fprintf(f, ")\n");
- fprintf(f, "\t\tv_cmd_buf_set_unique_address_size(head, %u);\n", size);
- fprintf(f, "\telse\n");
- fprintf(f, "\t\tv_cmd_buf_set_address_size(head, %u);\n", size);
- return;
- }
- }
- fprintf(f, ")\n");
- fprintf(f, "\t\tv_cmd_buf_set_unique_address_size(head, %u);\n", size);
- fprintf(f, "\telse\n");
- fprintf(f, "\t\tv_cmd_buf_set_address_size(head, %u);\n", size);
- return;
-}
-
-static const char * v_cg_compute_buffer_size(void)
-{
- unsigned int size;
- size = v_cg_compute_command_size(0, FALSE) + 1;
- if(size <= 10)
- return "VCMDBS_10";
- else if(size <= 20)
- return "VCMDBS_20";
- else if(size <= 30)
- return "VCMDBS_30";
- else if(size <= 80)
- return "VCMDBS_80";
- else if(size <= 160)
- return "VCMDBS_160";
- else if(size <= 320)
- return "VCMDBS_320";
- return "VCMDBS_1500";
-}
-
-static void v_cg_gen_pack(boolean alias)
-{
- unsigned int i, j, size = 0, ad_size = 0;
- boolean printed = FALSE;
- boolean address = FALSE;
- boolean no_param;
-
- FILE *f;
- f = VCGData.nodes[VCGData.type];
- printf("generating function: verse_send_%s\n", VCGData.func_name);
- if(alias)
- fprintf(f, "void verse_send_%s(", VCGData.alias_name);
- else
- fprintf(f, "void verse_send_%s(", VCGData.func_name);
- v_cg_gen_func_params(f, FALSE, alias);
- fprintf(f, ")\n{\n\tuint8 *buf;\n");
- fprintf(f, "\tunsigned int buffer_pos = 0;\n");
- fprintf(f, "\tVCMDBufHead *head;\n");
- fprintf(f, "\thead = v_cmd_buf_allocate(%s);/* Allocating the buffer */\n", v_cg_compute_buffer_size());
- fprintf(f, "\tbuf = ((VCMDBuffer10 *)head)->buf;\n\n");
-
- fprintf(f, "\tbuffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], %u);\t/* Pack the command. */\n", VCGData.cmd_id);
-
- fprintf(f, "#if defined V_PRINT_SEND_COMMANDS\n");
- v_cg_create_print(f, TRUE, alias);
- fprintf(f, "#endif\n");
-
- for(i = 0; i < VCGData.param_count; i++)
- {
- const char *param = VCGData.param_name[i];
- no_param = FALSE;
- if(alias)
- {
- if(i >= VCGData.alias_param && VCGData.alias_param_array == NULL)
- no_param = TRUE;
- if(VCGData.alias_param_array != NULL)
- {
- for(j = 0; j < VCGData.alias_param; j++)
- if(VCGData.alias_param_array[j] == i)
- break;
- if(j == VCGData.alias_param)
- no_param = TRUE;
- }
- }
-
- if(no_param)
- param = "-1";
-
- switch(VCGData.param_type[i])
- {
- case VCGP_UINT8 :
- fprintf(f, "\tbuffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], %s);\n", param);
- break;
- case VCGP_UINT16 :
- fprintf(f, "\tbuffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], %s);\n", param);
- break;
- case VCGP_UINT32 :
- fprintf(f, "\tbuffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], %s);\n", param);
- break;
- case VCGP_ENUM :
- fprintf(f, "\tbuffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)%s);\n", param);
- break;
- }
- if(VCGData.param_type[i] == VCGP_REAL32)
- {
- if(no_param)
- param = "V_REAL32_MAX";
- fprintf(f, "\tbuffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], %s);\n", param);
- }
- if(VCGData.param_type[i] == VCGP_REAL64)
- {
- if(no_param)
- param = "V_REAL64_MAX";
- fprintf(f, "\tbuffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], %s);\n", param);
- }
- if(no_param)
- param = "NULL";
- switch(VCGData.param_type[i])
- {
- case VCGP_NAME :
- fprintf(f, "\tbuffer_pos += vnp_raw_pack_string(&buf[buffer_pos], %s, 16);\n", param);
- break;
- case VCGP_LONG_NAME :
- fprintf(f, "\tbuffer_pos += vnp_raw_pack_string(&buf[buffer_pos], %s, 512);\n", param);
- break;
- }
- if(no_param)
- {
- /* Horrible work-around, that prevents vertex/polygon deletes from misbehaving. */
- if(strncmp(VCGData.alias_name, "g_vertex_delete_real", 20) == 0 && i == 1)
- param = "0";
- else if(strncmp(VCGData.alias_name, "g_polygon_delete", 16) == 0 && i == 1)
- param = "1";
- else
- param = "-1";
- }
- switch(VCGData.param_type[i])
- {
- case VCGP_NODE_ID :
- fprintf(f, "\tbuffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], %s);\n", param);
- break;
- case VCGP_LAYER_ID :
- fprintf(f, "\tbuffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], %s);\n", param);
- break;
- case VCGP_BUFFER_ID :
- fprintf(f, "\tbuffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], %s);\n", param);
- break;
- case VCGP_FRAGMENT_ID :
- fprintf(f, "\tbuffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], %s);\n", param);
- break;
- }
- if(!alias && VCGData.param_type[i] == VCGP_PACK_INLINE)
- fprintf(f, "%s", VCGData.param_name[i]);
- }
- if(VCGData.alias_name != NULL && VCGData.alias_bool_switch)
- {
- if(alias)
- fprintf(f, "\tbuffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], FALSE);\n");
- else
- fprintf(f, "\tbuffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], TRUE);\n");
- }
- v_cg_set_command_address(f, alias);
- fprintf(f, "\tv_cmd_buf_set_size(head, buffer_pos);\n");
-
- fprintf(f, "\tv_noq_send_buf(v_con_get_network_queue(), head);\n");
- fprintf(f, "}\n\n");
-}
-
-static void v_cg_gen_unpack(void)
-{
- FILE *f;
- unsigned int i;
- boolean printed = FALSE;
-
- f = VCGData.nodes[VCGData.type];
- printf("generating function: v_unpack_%s\n", VCGData.func_name);
- fprintf(f, "unsigned int v_unpack_%s(const char *buf, size_t buffer_length)\n", VCGData.func_name);
- fprintf(f, "{\n");
- for(i = 0; i < VCGData.param_count && VCGData.param_type[i] != VCGP_ENUM; i++);
- if(i < VCGData.param_count)
- fprintf(f, "\tuint8 enum_temp;\n");
- fprintf(f, "\tunsigned int buffer_pos = 0;\n");
- fprintf(f, "\tvoid (* func_%s)(void *user_data, ", VCGData.func_name);
- v_cg_gen_func_params(f, FALSE, FALSE);
- fprintf(f, ");\n\t");
- v_cg_gen_func_params(f, TRUE, FALSE);
- if(VCGData.alias_name != NULL && VCGData.alias_bool_switch)
- fprintf(f, "uint8\talias_bool;\n");
- fprintf(f, "\n\tfunc_%s = v_fs_get_user_func(%u);\n", VCGData.func_name, VCGData.cmd_id);
- fprintf(f, "\tif(buffer_length < %u)\n\t\treturn -1;\n", v_cg_compute_command_size(0, TRUE));
- for(i = 0; i < VCGData.param_count; i++)
- {
- switch(VCGData.param_type[i])
- {
- case VCGP_UINT8 :
- fprintf(f, "\tbuffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &%s);\n", VCGData.param_name[i]);
- break;
- case VCGP_UINT16 :
- fprintf(f, "\tbuffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &%s);\n", VCGData.param_name[i]);
- break;
- case VCGP_UINT32 :
- fprintf(f, "\tbuffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &%s);\n", VCGData.param_name[i]);
- break;
- case VCGP_REAL32 :
- fprintf(f, "\tbuffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &%s);\n", VCGData.param_name[i]);
- break;
- case VCGP_REAL64 :
- fprintf(f, "\tbuffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &%s);\n", VCGData.param_name[i]);
- break;
- case VCGP_POINTER_TYPE :
- break;
- case VCGP_POINTER :
- break;
- case VCGP_NAME :
- fprintf(f, "\tbuffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], %s, 16, buffer_length - buffer_pos);\n", VCGData.param_name[i]);
- if(i + 1 < VCGData.param_count)
- fprintf(f, "\tif(buffer_length < %u + buffer_pos)\n\t\treturn -1;\n", v_cg_compute_command_size(i + 1, TRUE));
- break;
- case VCGP_LONG_NAME :
- fprintf(f, "\tbuffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], %s, 512, buffer_length - buffer_pos);\n", VCGData.param_name[i]);
- if(i + 1 < VCGData.param_count)
- fprintf(f, "\tif(buffer_length < %u + buffer_pos)\n\t\treturn -1;\n", v_cg_compute_command_size(i + 1, TRUE));
- break;
- case VCGP_NODE_ID :
- fprintf(f, "\tbuffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &%s);\n", VCGData.param_name[i]);
- break;
- case VCGP_LAYER_ID :
- fprintf(f, "\tbuffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &%s);\n", VCGData.param_name[i]);
- break;
- case VCGP_BUFFER_ID :
- fprintf(f, "\tbuffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &%s);\n", VCGData.param_name[i]);
- break;
- case VCGP_FRAGMENT_ID :
- fprintf(f, "\tbuffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &%s);\n", VCGData.param_name[i]);
- break;
- case VCGP_ENUM :
- fprintf(f, "\tbuffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &enum_temp);\n");
- fprintf(f, "\t%s = (%s)enum_temp;\n", VCGData.param_name[i], VCGData.param_name[i - 1]);
- break;
- case VCGP_UNPACK_INLINE :
- if(!printed)
- {
- fprintf(f, "#if defined V_PRINT_RECEIVE_COMMANDS\n");
- if(VCGData.alias_name != NULL)
- {
- fprintf(f, "\t%s\n\t", VCGData.alias_qualifier);
- v_cg_create_print(f, FALSE, TRUE);
- fprintf(f, "\telse\n\t");
- }
- v_cg_create_print(f, FALSE, FALSE);
- fprintf(f, "#endif\n");
- printed = TRUE;
- }
- fprintf(f, "%s\n", VCGData.param_name[i++]);
- break;
- }
- }
- if(VCGData.alias_name != NULL && VCGData.alias_bool_switch)
- {
- fprintf(f, "\tif(buffer_length < buffer_pos + 1)\n");
- fprintf(f, "\t\treturn -1;\n");
- fprintf(f, "\tbuffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &alias_bool);\n");
- }
- if(!printed)
- {
- fprintf(f, "#if defined V_PRINT_RECEIVE_COMMANDS\n");
- if(VCGData.alias_name != NULL)
- {
- if(VCGData.alias_qualifier != NULL)
- fprintf(f, "\t%s\n\t", VCGData.alias_qualifier);
- else
- fprintf(f, "\tif(!alias_bool)\n\t");
- v_cg_create_print(f, FALSE, TRUE);
- fprintf(f, "\telse\n\t");
- }
- v_cg_create_print(f, FALSE, FALSE);
- fprintf(f, "#endif\n");
- printed = TRUE;
- }
-
- if(VCGData.alias_name != NULL)
- {
- unsigned int active;
-
- if(VCGData.alias_bool_switch)
- fprintf(f, "\tif(!alias_bool)\n");
- else
- fprintf(f, "\t%s\n", VCGData.alias_qualifier);
- fprintf(f, "\t{\n");
- fprintf(f, "\t\tvoid (* alias_%s)(void *user_data, ", VCGData.alias_name);
- v_cg_gen_func_params(f, FALSE, TRUE);
- fprintf(f, ");\n");
- fprintf(f, "\t\talias_%s = v_fs_get_alias_user_func(%u);\n", VCGData.alias_name, VCGData.cmd_id);
- fprintf(f, "\t\tif(alias_%s != NULL)\n", VCGData.alias_name);
- fprintf(f, "\t\t\talias_%s(v_fs_get_alias_user_data(%u)", VCGData.alias_name, VCGData.cmd_id);
- for(i = 0; i < VCGData.param_count && i < VCGData.alias_param; i++)
- {
- if(VCGData.alias_param_array != NULL)
- active = VCGData.alias_param_array[i];
- else
- active = i;
-
- if(VCGData.param_type[active] != VCGP_PACK_INLINE &&
- VCGData.param_type[active] != VCGP_UNPACK_INLINE &&
- VCGData.param_type[active] != VCGP_END_ADDRESS &&
- VCGData.param_type[active] != VCGP_POINTER_TYPE)
- {
- if(VCGData.param_type[active] == VCGP_ENUM_NAME)
- {
- fprintf(f, ", (%s)%s", VCGData.param_name[active], VCGData.param_name[active + 1]);
- i++;
- }
- else
- fprintf(f, ", %s", VCGData.param_name[active]);
- }
- }
- fprintf(f, ");\n\t\treturn buffer_pos;\n\t}\n");
- }
-
- fprintf(f, "\tif(func_%s != NULL)\n", VCGData.func_name);
- fprintf(f, "\t\tfunc_%s(v_fs_get_user_data(%u)", VCGData.func_name, VCGData.cmd_id);
- for(i = 0; i < VCGData.param_count; i++)
- {
- if(VCGData.param_type[i] != VCGP_PACK_INLINE && VCGData.param_type[i] != VCGP_UNPACK_INLINE && VCGData.param_type[i] != VCGP_END_ADDRESS && VCGData.param_type[i] != VCGP_POINTER_TYPE)
- {
- if(VCGData.param_type[i] == VCGP_ENUM_NAME)
- {
- fprintf(f, ", (%s) %s", VCGData.param_name[i], VCGData.param_name[i + 1]);
- i++;
- }
- else
- fprintf(f, ", %s", VCGData.param_name[i]);
- }
- }
- fprintf(f, ");\n");
- fprintf(f, "\n\treturn buffer_pos;\n");
- fprintf(f, "}\n\n");
-}
-
-static void v_cg_gen_alias(void)
-{
- FILE *f;
- unsigned int i;
- f = VCGData.nodes[VCGData.type];
- fprintf(f, "void verse_send_%s(", VCGData.alias_name);
- v_cg_gen_func_params(f, FALSE, TRUE);
- fprintf(f, ")\n{\n");
- fprintf(f, "\tverse_send_%s(", VCGData.func_name);
- for(i = 0; i < VCGData.param_count; i++)
- if(VCGData.param_type[i] != VCGP_ENUM_NAME && VCGData.param_type[i] != VCGP_PACK_INLINE && VCGData.param_type[i] != VCGP_UNPACK_INLINE && VCGData.param_type[i] != VCGP_END_ADDRESS && VCGData.param_type[i] != VCGP_POINTER_TYPE)
- fprintf(f, ", %s", VCGData.param_name[i]);
- fprintf(f, "}\n\n");
-}
-
-static void v_cg_gen_init(void)
-{
- FILE *f;
- f = VCGData.init;
- fprintf(f, "\tv_fs_add_func(%i, v_unpack_%s, verse_send_%s, ", VCGData.cmd_id, VCGData.func_name, VCGData.func_name);
- if(VCGData.alias_name != NULL)
- fprintf(f, "verse_send_%s);\n", VCGData.alias_name);
- else
- fprintf(f, "NULL);\n");
-}
-
-static void v_cg_gen_verse_h(void)
-{
- FILE *f;
- if(VCGData.command == VCGCT_INVISIBLE_SYSTEM)
- f = VCGData.internal_verse_h;
- else
- f = VCGData.verse_h;
- fprintf(f, "extern void verse_send_%s(", VCGData.func_name);
- v_cg_gen_func_params(f, FALSE, FALSE);
- fprintf(f, ");\n");
- if(VCGData.alias_name != NULL)
- {
- fprintf(f, "extern void verse_send_%s(", VCGData.alias_name);
- v_cg_gen_func_params(f, FALSE, TRUE);
- fprintf(f, ");\n");
- }
-}
-
-static void v_cg_gen_unpack_h(void)
-{
- fprintf(VCGData.unpack, "extern unsigned int v_unpack_%s(const char *data, size_t length);\n", VCGData.func_name);
-}
-
-void v_cg_end_cmd(void)
-{
- v_cg_gen_pack(FALSE);
- if(VCGData.alias_name != NULL)
- v_cg_gen_pack(TRUE);
- v_cg_gen_unpack();
- v_cg_gen_init();
- v_cg_gen_verse_h();
- v_cg_gen_unpack_h();
- VCGData.alias_name = NULL;
-}
-
-int main(int argc, char *argv[])
-{
- const char *src = "";
- int i;
-
- for(i = 1; argv[i] != NULL; i++)
- {
- if(strcmp(argv[i], "-h") == 0)
- {
- printf("Verse protocol generation tool.\nUsage:\n");
- printf(" -h\t\tPrint this usage information, and exit.\n");
- printf(" -src=PATH\tSets source path prefix to PATH. It must be possible to find\n");
- printf("\t\tthe \"verse_header.h\" input file by appending that name to PATH.\n");
- printf("\t\tThus, PATH must end with a proper directory separator character.\n");
- printf(" -dst=PATH\tSets output directory, where all output files are written.\n");
- printf("\t\tIf used, use -src to point to where \"verse_header.h\" is.\n");
- printf("\nThe -src and -dst options were added to simplify building of Verse-Blender.\n");
- return EXIT_SUCCESS;
- }
- else if(strncmp(argv[i], "-src=", 5) == 0)
- src = argv[i] + 5;
- else if(strncmp(argv[i], "-dst=", 5) == 0)
- {
- if(chdir(argv[i] + 5) != 0)
- fprintf(stderr, "%s: Couldn't set output directory to \"%s\"\n", argv[0], argv[i] + 5);
- }
- else
- fprintf(stderr, "%s: Ignoring unknown option \"%s\"\n", argv[0], argv[i]);
- }
-
- printf("start\n");
- if(!v_cg_init(src))
- return EXIT_FAILURE;
- v_gen_system_cmd_def();
- fprintf(VCGData.verse_h, "\n");
- v_gen_object_cmd_def();
- fprintf(VCGData.verse_h, "\n");
- v_gen_geometry_cmd_def();
- fprintf(VCGData.verse_h, "\n");
- v_gen_material_cmd_def();
- fprintf(VCGData.verse_h, "\n");
- v_gen_bitmap_cmd_def();
- fprintf(VCGData.verse_h, "\n");
- v_gen_text_cmd_def();
- fprintf(VCGData.verse_h, "\n");
- v_gen_curve_cmd_def();
- fprintf(VCGData.verse_h, "\n");
- v_gen_audio_cmd_def();
- fprintf(VCGData.verse_h, "\n");
- v_cg_close();
- printf("end\n");
-
- return EXIT_SUCCESS;
-}
-
-#endif
diff --git a/extern/verse/dist/v_cmd_gen.h b/extern/verse/dist/v_cmd_gen.h
deleted file mode 100644
index 6cc19a84d19..00000000000
--- a/extern/verse/dist/v_cmd_gen.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-**
-*/
-
-/* Define this to at least build the code that regenerates the variable parts of the code. */
-/*#define V_GENERATE_FUNC_MODE*/
-
-typedef enum {
- VCGP_UINT8,
- VCGP_UINT16,
- VCGP_UINT32,
- VCGP_REAL32,
- VCGP_REAL64,
- VCGP_POINTER_TYPE,
- VCGP_POINTER,
- VCGP_NAME,
- VCGP_LONG_NAME,
- VCGP_NODE_ID,
- VCGP_LAYER_ID,
- VCGP_BUFFER_ID,
- VCGP_FRAGMENT_ID,
- VCGP_ENUM_NAME,
- VCGP_ENUM,
- VCGP_PACK_INLINE,
- VCGP_UNPACK_INLINE,
- VCGP_END_ADDRESS
-} VCGParam;
-
-typedef enum {
- VCGCT_NORMAL,
- VCGCT_UNIQUE,
- VCGCT_ONCE,
- VCGCT_INVISIBLE_SYSTEM, /* In the dark we are all invisible. */
- VCGCT_ORDERED
-} VCGCommandType;
-
-extern void v_cg_new_cmd(VCGCommandType type, const char *name, unsigned int cmd_id, VCGCommandType command);
-extern void v_cg_add_param(VCGParam type, const char *name);
-extern void v_cg_alias(char bool_switch, const char *name, const char *qualifier,
- unsigned int param, unsigned int *param_array);
-extern void v_cg_end_cmd(void);
-extern void v_cg_new_manual_cmd(unsigned int cmd_id, const char *name, const char *params, const char *alias_name, const char *alias_params);
diff --git a/extern/verse/dist/v_connect.c b/extern/verse/dist/v_connect.c
deleted file mode 100644
index 31be90e2d47..00000000000
--- a/extern/verse/dist/v_connect.c
+++ /dev/null
@@ -1,490 +0,0 @@
-/*
-**
-*/
-
-#include
-#include
-#include
-#include
-
-#include "v_cmd_gen.h"
-
-#if !defined V_GENERATE_FUNC_MODE
-
-#include "verse.h"
-#include "v_cmd_buf.h"
-#include "v_network_out_que.h"
-#include "v_network.h"
-#include "v_connection.h"
-#include "v_encryption.h"
-#include "v_util.h"
-
-extern void verse_send_packet_ack(uint32 packet_id);
-
-static void v_send_hidden_connect_contact(void) /* Stage 0: Clinets inital call to connect to host */
-{
- uint8 buf[V_ENCRYPTION_LOGIN_KEY_HALF_SIZE + 4 + 1 + 1], *key;
- unsigned int i, buffer_pos = 0;
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], 0);/* Packing the packet id */
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 0);/* Packing the command */
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 0);/* Stage 0 */
-
- key = v_con_get_my_key();
- for(i = 0; i < V_ENCRYPTION_LOGIN_KEY_SIZE; i++)
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], key[V_ENCRYPTION_LOGIN_PUBLIC_START + i]);/* Packing the command */
- for(i = 0; i < V_ENCRYPTION_LOGIN_KEY_SIZE; i++)
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], key[V_ENCRYPTION_LOGIN_N_START + i]);/* Packing the command */
-
- v_n_send_data(v_con_get_network_address(), buf, buffer_pos);
-}
-
-static void v_send_hidden_connect_send_key(void) /* Stage 1: Hosts reply to any atempt to connect */
-{
- uint8 buf[V_ENCRYPTION_LOGIN_KEY_SIZE * 3 + 4 + 1 + 1 + 1 + 4 + 4], *host_id;
- unsigned int i, buffer_pos = 0, s, f;
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], 0);/* Packing the packet id */
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 0);/* Packing the command */
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 1);/* Stage 1 */
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], V_RELEASE_NUMBER);/* version */
- v_n_get_current_time(&s, &f);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], s);/* time, seconds */
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], f);/* time, fraction */
- host_id = v_con_get_host_id();
- for(i = 0; i < V_ENCRYPTION_LOGIN_KEY_SIZE; i++)
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], host_id[V_ENCRYPTION_LOGIN_PUBLIC_START + i]);
- for(i = 0; i < V_ENCRYPTION_LOGIN_KEY_SIZE; i++)
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], host_id[V_ENCRYPTION_LOGIN_N_START + i]);
-
- v_n_send_data(v_con_get_network_address(), buf, buffer_pos);
-}
-
-static void v_send_hidden_connect_login(void) /* Stage 2: clients sends encrypted name and password */
-{
- uint8 buf[1500], *key, name_pass[V_ENCRYPTION_LOGIN_KEY_SIZE], encrypted_key[V_ENCRYPTION_LOGIN_KEY_SIZE];
- const char *name, *pass;
- unsigned int buffer_pos = 0, i;
-
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], 1);/* Packing the packet id */
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 0);/* Packing the command */
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 2);/* Stage 2 */
- name = v_con_get_name();
- /* Pad data area with randomness. */
- for(i = 0; i < sizeof name_pass; i++)
- name_pass[i] = rand() >> 13;
- v_strlcpy(name_pass, name, V_ENCRYPTION_LOGIN_KEY_SIZE / 2);
- pass = v_con_get_pass();
- v_strlcpy(name_pass + V_ENCRYPTION_LOGIN_KEY_SIZE / 2, pass, V_ENCRYPTION_LOGIN_KEY_SIZE / 2);
- /* Make sure last (MSB) byte is clear, to guarantee that data < key for RSA math. */
- name_pass[sizeof name_pass - 1] = 0;
- key = v_con_get_other_key();
- v_e_connect_encrypt(encrypted_key, name_pass, &key[V_ENCRYPTION_LOGIN_PUBLIC_START], &key[V_ENCRYPTION_LOGIN_N_START]);
-
- for(i = 0; i < V_ENCRYPTION_LOGIN_KEY_SIZE; i++)
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], encrypted_key[i]);
- v_n_send_data(v_con_get_network_address(), buf, buffer_pos);
-}
-
-static void v_send_hidden_connect_accept(void) /* Host accepts Clients connectionatempt and sends over data encryption key */
-{
- uint8 buf[1500], *client_key, encrypted[V_ENCRYPTION_DATA_KEY_SIZE];
- unsigned int i, buffer_pos = 0;
-
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], 1);/* Packing the packet id */
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 1);/* Packing the command */
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], verse_session_get_avatar());
- client_key = v_con_get_other_key();
- v_e_connect_encrypt(encrypted, v_con_get_data_key(), &client_key[V_ENCRYPTION_LOGIN_PUBLIC_START], &client_key[V_ENCRYPTION_LOGIN_N_START]);
- for(i = 0; i < V_ENCRYPTION_DATA_KEY_SIZE; i++)
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], encrypted[i]);
- v_n_send_data(v_con_get_network_address(), buf, buffer_pos);
-}
-
-static void v_send_hidden_connect_terminate(VNetworkAddress *address, unsigned int packet_id, const char *bye) /* Host accepts Clients connectionatempt and sends over data encryption key */
-{
- uint8 buf[1500];
- unsigned int buffer_pos = 0;
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], packet_id);/* Packing the packet id */
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 2);/* Packing the command */
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], bye, 512); /* pack message */
- v_e_data_encrypt_command(buf, sizeof (uint32), buf + sizeof (uint32), buffer_pos, v_con_get_data_key());
- v_n_send_data(address, buf, buffer_pos);
-}
-
-VSession verse_send_connect(const char *name, const char *pass, const char *address, const uint8 *expected_key)
-{
- uint8 *my_key, *key = NULL;
- unsigned int i;
- VNetworkAddress a;
- VSession *session;
- if(v_n_set_network_address(&a, address))
- {
-#if defined(V_PRINT_SEND_COMMANDS)
- char ip_string[32];
-#endif
- session = v_con_connect(a.ip, a.port, V_CS_CONTACT);
-#if defined(V_PRINT_SEND_COMMANDS)
- v_n_get_address_string(&a, ip_string);
- printf("send: %p = verse_send_connect(name = %s, pass = %s, address = %s (%s), expected_key = %p)\n", session, name, pass, address, ip_string, expected_key);
-#endif
- v_con_set_name_pass(name, pass);
- if(expected_key != NULL)
- {
- key = malloc((sizeof *key) * V_ENCRYPTION_LOGIN_KEY_HALF_SIZE);
- for(i = 0; i < V_ENCRYPTION_LOGIN_KEY_HALF_SIZE; i++)
- key[i] = expected_key[i];
- *v_con_get_expected_key() = key;
- }
- my_key = v_con_get_my_key();
- v_e_connect_create_key(&my_key[V_ENCRYPTION_LOGIN_PRIVATE_START], &my_key[V_ENCRYPTION_LOGIN_PUBLIC_START], &my_key[V_ENCRYPTION_LOGIN_N_START]);
- v_send_hidden_connect_contact();
- v_con_inqueue_timer_update(); /* Reset timer in connection's in queue, above takes a while. */
- return session;
- }
- else
- {
-#if defined(V_PRINT_SEND_COMMANDS)
- printf("send: NULL = verse_send_connect(name = %s, pass = %s, address = %s (Unressolved DNS), key = %p);\n", name, pass, address, key);
-#endif
- return NULL;
- }
-}
-
-void v_update_connection_pending(boolean resend)
-{
- VSession (* func_connect)(void *user_data, const char *name, const char *pass, const char *address, const uint8 *key) = NULL;
- VSession (* func_connect_accept)(void *user_data, VNodeID avatar, char *address, uint8 *host_id);
- void (* func_connect_terminate)(void *user_data, char *address, const char *bye);
- char address_string[32];
-
- switch(v_con_get_connect_stage())
- {
- case V_CS_CONTACT : /* client tries to contact host */
- if(resend)
- v_send_hidden_connect_contact();
- break;
- case V_CS_CONTACTED : /* Host replies with challange */
- if(resend)
- v_send_hidden_connect_send_key();
- break;
- case V_CS_PENDING_ACCEPT : /* Client sends login */
- if(resend)
- v_send_hidden_connect_login();
- break;
- case V_CS_PENDING_HOST_CALLBACK : /* Host got login waits for accept connect callback */
- v_con_set_connect_stage(V_CS_PENDING_DECISION);
- func_connect = v_fs_get_user_func(0);
- v_n_get_address_string(v_con_get_network_address(), address_string);
-#if defined(V_PRINT_RECEIVE_COMMANDS)
- printf("receive: verse_send_connect(address = %s, name = %s, pass = %s, key = NULL); callback = %p\n", address_string, v_con_get_name(), v_con_get_pass(), func_connect);
-#endif
- if(func_connect != 0)
- func_connect(v_fs_get_user_data(0), v_con_get_name(), v_con_get_pass(), address_string, NULL);
- break;
- case V_CS_PENDING_CLIENT_CALLBACK_ACCEPT : /* Host got login waits for accept connect callback */
- v_con_set_connect_stage(V_CS_CONNECTED);
- func_connect_accept = v_fs_get_user_func(1);
- v_n_get_address_string(v_con_get_network_address(), address_string);
-#if defined(V_PRINT_RECEIVE_COMMANDS)
- printf("receive: func_connect_accept(avatar = %u, address = %s, name = %s, pass = %s, key = NULL); callback = %p\n",
- verse_session_get_avatar(), address_string, v_con_get_name(), v_con_get_pass(), func_connect);
-#endif
- if(func_connect_accept != 0)
- func_connect_accept(v_fs_get_user_data(1), verse_session_get_avatar(), address_string, NULL);
- break;
- case V_CS_PENDING_CLIENT_CALLBACK_TERMINATE : /* Host got login waits for accept connect callback */
- v_con_set_connect_stage(V_CS_CONNECTED);
- func_connect_terminate = v_fs_get_user_func(2);
- v_n_get_address_string(v_con_get_network_address(), address_string);
-#if defined(V_PRINT_RECEIVE_COMMANDS)
- printf("receive: func_connect_terminate(address = %s, bye = %s); callback = %p\n", address_string, "no message", func_connect);
-#endif
- if(func_connect_terminate != 0)
- func_connect_terminate(v_fs_get_user_data(2), address_string, "no message");
- break;
- default:
- ;
- }
-}
-
-void v_unpack_connection(const char *buf, unsigned int buffer_length) /* un packing all stages of connect command */
-{
- unsigned int buffer_pos, i, pack_id;
- uint32 seconds, fractions, pre;
- uint8 /*key[V_ENCRYPTION_LOGIN_KEY_SIZE], */stage, cmd_id, version;
-
- if(buffer_length < 5)
- return;
-
- buffer_pos = vnp_raw_unpack_uint32(buf, &pack_id);
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &cmd_id);
- pre = v_con_get_connect_stage();
- if(cmd_id == 0)
- {
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &stage);
- printf(" Handling connection, stage %u\n", stage);
- if(stage == V_CS_IDLE && V_CS_IDLE == v_con_get_connect_stage()) /* reseved by host */
- {
- uint8 *other_key, *my_key;
-
- verse_send_packet_ack(pack_id);
- my_key = v_con_get_my_key();
- v_con_set_data_key(v_e_data_create_key());
- other_key = v_con_get_other_key();
- for(i = 0; i < V_ENCRYPTION_LOGIN_KEY_SIZE; i++)
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &other_key[V_ENCRYPTION_LOGIN_PUBLIC_START + i]);/* Packing the command */
- for(i = 0; i < V_ENCRYPTION_LOGIN_KEY_SIZE; i++)
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &other_key[V_ENCRYPTION_LOGIN_N_START + i]);/* Packing the command */
- v_con_set_connect_stage(V_CS_CONTACTED);
- v_send_hidden_connect_send_key();
- return;
- }
- if(stage == V_CS_CONTACT && V_CS_CONTACT == v_con_get_connect_stage())
- {
- uint8 *other_key; /* *host_id, *my_key, a[V_ENCRYPTION_LOGIN_KEY_SIZE], b[V_ENCRYPTION_LOGIN_KEY_SIZE];*/
- verse_send_packet_ack(pack_id);
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &version);
- if(version != V_RELEASE_NUMBER)
- {
- /* char error_message[128];
- func_connect_deny = v_fs_get_user_func(2);
- #if defined(V_PRINT_RECEIVE_COMMANDS)
- printf("receive: verse_send_connect_deny(Host is running version %u you are running version %u); callback = %p\n", (uint32)version, (uint32)V_RELEASE_NUMBER func_connect_deny);
- #endif
- if(func_connect_deny != NULL)
- {
- sprintf(error_message, "Host is running version %u you are running version %u", (uint32)version, (uint32)V_RELEASE_NUMBER);
- func_connect_deny(v_fs_get_user_data(2), error_message);
- }*/
- return;
- }
-
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &seconds);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &fractions);
- v_con_set_time(seconds, fractions);
-
- other_key = v_con_get_other_key();
- for(i = 0; i < V_ENCRYPTION_LOGIN_KEY_SIZE; i++)
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &other_key[V_ENCRYPTION_LOGIN_PUBLIC_START + i]);
- for(i = 0; i < V_ENCRYPTION_DATA_KEY_SIZE; i++)
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &other_key[V_ENCRYPTION_LOGIN_N_START + i]);
-
- v_con_set_connect_stage(V_CS_PENDING_ACCEPT);
- v_send_hidden_connect_login();
- return;
- }
-#if 0
- for(i = 0; i < V_ENCRYPTION_LOGIN_KEY_HALF_SIZE && encrypted_key[i] == 0; i++);
- if(i < 0)
- {
- other_key = v_con_get_my_key();
- v_e_connect_encrypt(decrypted_key, encrypted_key, &other_key[V_ENCRYPTION_LOGIN_PUBLIC_START + i], &other_key[V_ENCRYPTION_LOGIN_N_START + i]);
- for(i = 0; i < V_ENCRYPTION_LOGIN_KEY_HALF_SIZE && my_key[V_ENCRYPTION_LOGIN_PUBLIC_START + i] == decrypted_key[i]; i++);
- if(i < 0) /* Host is not who it appers top be */
- {
- func_connect_deny = v_fs_get_user_func(2);
-#if defined(V_PRINT_RECEIVE_COMMANDS)
- printf("receive: verse_send_connect_deny(Host failed identity check); callback = %p\n", func_connect_deny);
-#endif
- if(func_connect_deny != NULL)
- func_connect_deny(v_fs_get_user_data(2), "Host failed identity check");
- return;
- }
- }
-#endif
- if(stage == V_CS_CONTACTED && V_CS_CONTACTED == v_con_get_connect_stage()) /* reseved by host */
- {
- char *host_id, unpack[V_ENCRYPTION_LOGIN_KEY_SIZE], data[V_ENCRYPTION_LOGIN_KEY_SIZE];
- VNetworkAddress *address;
- verse_send_packet_ack(pack_id);
- address = v_con_get_network_address();
- for(i = 0; i < V_ENCRYPTION_LOGIN_KEY_SIZE; i++)
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &data[i]);
- host_id = v_con_get_host_id();
- v_e_connect_encrypt(unpack, data, &host_id[V_ENCRYPTION_LOGIN_PRIVATE_START], &host_id[V_ENCRYPTION_LOGIN_N_START]);
- v_con_set_name_pass(unpack, &unpack[V_ENCRYPTION_LOGIN_KEY_SIZE / 2]);
- v_con_set_connect_stage(V_CS_PENDING_HOST_CALLBACK);
- return;
- }
- }
- if(cmd_id == 1 && V_CS_PENDING_ACCEPT == v_con_get_connect_stage()) /* reseved by client */
- {
- uint8 *my_key, key[V_ENCRYPTION_DATA_KEY_SIZE], decrypted[V_ENCRYPTION_DATA_KEY_SIZE];
- uint32 avatar;
- verse_send_packet_ack(pack_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &avatar);
- v_con_set_avatar(avatar);
- for(i = 0; i < V_ENCRYPTION_DATA_KEY_SIZE; i++)
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &key[i]);
- my_key = v_con_get_my_key();
- v_e_connect_encrypt(decrypted, key, &my_key[V_ENCRYPTION_LOGIN_PRIVATE_START], &my_key[V_ENCRYPTION_LOGIN_N_START]);
- v_con_set_data_key(decrypted);
- v_con_set_connect_stage(V_CS_PENDING_CLIENT_CALLBACK_ACCEPT);
- v_send_hidden_connect_send_key();
- return;
- }
- if(cmd_id == 2 && V_CS_PENDING_ACCEPT == v_con_get_connect_stage()) /* reseved by client */
- {
- verse_send_packet_ack(pack_id);
- /* buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], name, 512, buffer_length - buffer_pos);
- */ v_con_set_connect_stage(V_CS_PENDING_CLIENT_CALLBACK_TERMINATE);
- return;
- }
-}
-
-VSession verse_send_connect_accept(VNodeID avatar, const char *address, uint8 *host_id)
-{
- VNetworkAddress a;
-#if defined(V_PRINT_SEND_COMMANDS)
- printf("send: verse_send_connect_accept(avatar = %u, address = %s, host_id = NULL);\n", avatar, address);
-#endif
-
- if(!v_n_set_network_address(&a, address))
- return NULL;
- if(v_co_switch_connection(a.ip, a.port))
- {
- if(v_con_get_connect_stage() != V_CS_PENDING_DECISION)
- return NULL;
- v_con_set_avatar(avatar);
- v_con_set_connect_stage(V_CS_CONNECTED);
- v_send_hidden_connect_accept();
- return v_con_get_network_queue();
- }
- return NULL;
-}
-
-void v_callback_connect_terminate(const char *bye)
-{
- void (* func_connect_terminate)(void *user_data, char *address, const char *bye);
- char address_string[32];
-
- printf("terminate (%s)\n", bye);
- func_connect_terminate = v_fs_get_user_func(2);
- v_n_get_address_string(v_con_get_network_address(), address_string);
-#if defined(V_PRINT_RECEIVE_COMMANDS)
- printf("receive: verse_send_connect_terminate(address = %s, bye = %s); callback = %p\n", address_string, bye, func_connect_terminate);
-#endif
- if(func_connect_terminate != 0)
- func_connect_terminate(v_fs_get_user_data(2), address_string, bye);
-}
-
-void verse_send_connect_terminate(const char *address, const char *bye)
-{
- VNetworkAddress a;
-#if defined(V_PRINT_RECEIVE_COMMANDS)
- printf("send: verse_send_connect_terminate(address = %s, bye = %s);\n", address, bye);
-#endif
-
- if(address == NULL)
- v_send_hidden_connect_terminate(v_con_get_network_address(), v_noq_get_next_out_packet_id(v_con_get_network_queue()), bye);
- else if(!v_n_set_network_address(&a, address))
- return;
- else if(v_co_switch_connection(a.ip, a.port))
- v_send_hidden_connect_terminate(v_con_get_network_address(), v_noq_get_next_out_packet_id(v_con_get_network_queue()), bye);
-
- if(v_con_get_connect_stage() != V_CS_PENDING_DECISION)
- verse_session_destroy(v_con_get_network_queue());
-}
-
-void verse_send_ping(const char *address, const char *message)
-{
- VNetworkAddress a;
- if(v_n_set_network_address(&a, address))
- {
- unsigned int buffer_pos = 0;
- uint8 buf[1500];
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], 0);/* Packing the Packet id */
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 5);/* Packing the command */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_ping(address = %s text = %s);\n", address, message);
-#endif
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], message, 1400);
- v_n_send_data(&a, buf, buffer_pos);
- }
-#if defined V_PRINT_SEND_COMMANDS
- else
- printf("send: verse_send_ping(address = %s (FAULTY) message = %s);\n", address, message);
-#endif
-}
-
-unsigned int v_unpack_ping(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_ping)(void *user_data, const char *address, const char *text);
- char address[64];
- char message[1400];
-
- func_ping = v_fs_get_user_func(5);
- v_n_get_address_string(v_con_get_network_address(), address);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], message, 1400, buffer_length - buffer_pos);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_ping(address = %s message = %s ); callback = %p\n", address, message, v_fs_get_user_func(5));
-#endif
- if(func_ping != NULL)
- func_ping(v_fs_get_user_data(5), address, message);
- return buffer_pos;
-}
-
-typedef struct {
- uint32 ip;
- uint16 port;
- char message[1400];
- void *next;
-} VPingCommand;
-
-static VPingCommand *v_ping_commands = NULL;
-
-boolean v_connect_unpack_ping(const char *buf, size_t buffer_length, uint32 ip, uint16 port)
-{
- if(buffer_length > 5)
- {
- unsigned int buffer_pos = 0;
- uint8 cmd_id;
- uint32 pack_id;
-
- buffer_pos = vnp_raw_unpack_uint32(&buf[buffer_pos], &pack_id);
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &cmd_id);
- if(cmd_id == 5)
- {
- if(NULL != v_fs_get_user_func(5))
- {
- VPingCommand *pc;
-
- pc = malloc(sizeof *pc);
- pc->ip = ip;
- pc->port = port;
- vnp_raw_unpack_string(&buf[buffer_pos], pc->message,
- sizeof pc->message, buffer_length - buffer_pos);
- pc->next = v_ping_commands;
- v_ping_commands = pc;
- }
- return TRUE;
- }
- }
- return FALSE;
-}
-
-void v_ping_update(void)
-{
- VPingCommand *cp;
- void (* func_ping)(void *user_data, const char *address, const char *text);
- VNetworkAddress a;
- char address[64];
- func_ping = v_fs_get_user_func(5);
-
- while(v_ping_commands != NULL)
- {
- cp = v_ping_commands->next;
- a.ip = v_ping_commands->ip;
- a.port = v_ping_commands->port;
- v_n_get_address_string(&a, address);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_ping(address = %s message = %s ); callback = %p\n", address, v_ping_commands->message, v_fs_get_user_func(5));
-#endif
- if(func_ping != NULL)
- func_ping(v_fs_get_user_data(5), address, v_ping_commands->message);
- free(v_ping_commands);
- v_ping_commands = cp;
- }
-}
-
-#endif
diff --git a/extern/verse/dist/v_connection.c b/extern/verse/dist/v_connection.c
deleted file mode 100644
index 3bfafad5660..00000000000
--- a/extern/verse/dist/v_connection.c
+++ /dev/null
@@ -1,490 +0,0 @@
-/*
-**
-*/
-
-#include
-#include
-#include
-
-#include "v_cmd_buf.h"
-#include "v_network_in_que.h"
-#include "v_network_out_que.h"
-#include "v_cmd_gen.h"
-#include "v_connection.h"
-#include "v_encryption.h"
-#include "v_util.h"
-
-#if !defined(V_GENERATE_FUNC_MODE)
-#include "verse.h"
-
-#define CONNECTION_CHUNK_SIZE 16
-#define V_MAX_CONNECT_PACKET_SIZE 1500
-#define V_CON_MAX_MICROSECOND_BETWEEN_SENDS 100
-#define V_RE_CONNECTON_TIME_OUT 4
-#define V_CONNECTON_TIME_OUT 30
-
-typedef struct {
- VNetOutQueue *out_queue;
- VNetInQueue in_queue;
- VNetworkAddress network_address;
- boolean connected;
- unsigned int avatar;
-/* unsigned int packet_id;*/
- int32 timedelta_s;
- uint32 timedelta_f;
- boolean destroy_flag;
- void *ordered_storage;
- char name[V_ENCRYPTION_LOGIN_KEY_SIZE / 2];
- char pass[V_ENCRYPTION_LOGIN_KEY_SIZE / 2];
- VConnectStage connect_stage;
- unsigned int stage_atempts;
- uint8 key_my[V_ENCRYPTION_LOGIN_KEY_FULL_SIZE];
- uint8 key_other[V_ENCRYPTION_LOGIN_KEY_FULL_SIZE];
- uint8 key_data[V_ENCRYPTION_DATA_KEY_SIZE];
- uint8 *expected_key;
-} VConnection;
-
-static struct {
- VConnection *con;
- unsigned int con_count;
- unsigned int current_connection;
- VNetworkAddress *connect_address;
- void *unified_func_storage;
- uint16 connect_port;
- unsigned int pending_packets;
- uint8 host_id[V_ENCRYPTION_LOGIN_KEY_FULL_SIZE];
-} VConData;
-
-extern void cmd_buf_init(void);
-
-void v_con_init(void) /* since verse doesnt have an init function this function is runned over an ove ard starts whit a check it it has run before */
-{
- static boolean v_con_initialized = FALSE;
-
- if(v_con_initialized)
- return;
- cmd_buf_init();
- v_con_initialized = TRUE;
- VConData.con = malloc(CONNECTION_CHUNK_SIZE * sizeof *VConData.con);
- memset(VConData.con, 0, CONNECTION_CHUNK_SIZE * sizeof *VConData.con); /* Clear the memory. */
- VConData.con_count = 0;
- VConData.pending_packets = 0;
-/* v_e_connect_create_key(&VConData.host_id[V_ENCRYPTION_LOGIN_PRIVATE_START],
- &VConData.host_id[V_ENCRYPTION_LOGIN_PUBLIC_START],
- &VConData.host_id[V_ENCRYPTION_LOGIN_N_START]);*/ /* default host id if none is set by user */
-}
-
-void verse_set_port(uint16 port)
-{
- v_n_set_port(port);
-}
-
-void verse_host_id_create(uint8 *id)
-{
- v_e_connect_create_key(&id[V_ENCRYPTION_LOGIN_PRIVATE_START],
- &id[V_ENCRYPTION_LOGIN_PUBLIC_START], &id[V_ENCRYPTION_LOGIN_N_START]);
-}
-
-void verse_host_id_set(uint8 *id)
-{
- memcpy(VConData.host_id, id, V_ENCRYPTION_LOGIN_KEY_FULL_SIZE);
-}
-
-extern void *v_fs_create_func_storage(void);
-extern void *v_create_ordered_storage(void);
-extern void v_destroy_ordered_storage(void *data);
-
-void *v_con_connect(uint32 ip, uint16 port, VConnectStage stage) /* creates a new connection slot */
-{
- v_con_init(); /* init connections, if not done yet */
- if((VConData.con_count - 1) % CONNECTION_CHUNK_SIZE == 0) /* do we need more slots for connections, then reallocate more space */
- VConData.con = realloc(VConData.con, (sizeof *VConData.con) * (VConData.con_count + CONNECTION_CHUNK_SIZE));
- VConData.con[VConData.con_count].out_queue = v_noq_create_network_queue(); /* create a out queue fo all out going commands */
- v_niq_clear(&VConData.con[VConData.con_count].in_queue); /* clear and init the que of incomming packets.*/
- VConData.con[VConData.con_count].connected = FALSE; /* not yet propperly connected and should not accept commands yet */
- VConData.con[VConData.con_count].network_address.ip = ip; /* ip address of other side */
- VConData.con[VConData.con_count].network_address.port = port; /* port used by other side */
- VConData.con[VConData.con_count].avatar = 0; /* no avatar set yet*/
-/* VConData.con[VConData.con_count].packet_id = 2;*/
- VConData.con[VConData.con_count].destroy_flag = FALSE; /* this is a flag that is set once the connection is about to be destroyed.*/
- VConData.con[VConData.con_count].ordered_storage = v_create_ordered_storage();
- VConData.con[VConData.con_count].name[0] = 0; /* nouser name set yet */
- VConData.con[VConData.con_count].pass[0] = 0; /* no password set yet */
- VConData.con[VConData.con_count].connect_stage = stage; /* this is the stage of the connection, it show if the connection is ready, the init state depends if this is a client or host */
- VConData.con[VConData.con_count].stage_atempts = 0; /* each stage in the connection prosess is atempted multiple times to avoid failiure if packets get lost*/
- VConData.con[VConData.con_count].timedelta_s = 0; /* number of seconds since last incomming packet to the connection*/
- VConData.con[VConData.con_count].timedelta_f = 0; /* number of fractions of a second since last incomming packet to the connection*/
- VConData.con[VConData.con_count].expected_key = NULL; /* expected hist id if this is a client */
- VConData.current_connection = VConData.con_count; /* set the new connection to the current*/
- ++VConData.con_count; /* add one to the number of connections*/
- return VConData.con[VConData.current_connection].out_queue;
-}
-
-void verse_session_destroy(VSession session) /* a session can not be destroyed right away, because this function might be called inside a call back from the session it tryes tpo destroy, therfor it only markes it*/
-{
- unsigned int i;
- for(i = 0; i < VConData.con_count && VConData.con[i].out_queue != session; i++);
- if(i < VConData.con_count)
- {
- VConData.con[i].destroy_flag = TRUE;
- }
-}
-
-void verse_session_set(VSession session) /* find a session and make it the current*/
-{
- unsigned int i;
- for(i = 0; i < VConData.con_count && session != VConData.con[i].out_queue; i++);
- if(i < VConData.con_count)
- VConData.current_connection = i;
-}
-
-VSession verse_session_get(void)
-{
- if(VConData.current_connection < VConData.con_count)
- return VConData.con[VConData.current_connection].out_queue;
- return NULL;
-}
-
-uint32 v_co_find_connection(uint32 ip, uint16 port) /* if a packet comes form a ip address what connection does it belong to? */
-{
- unsigned int i;
-
- for(i = 0; i < VConData.con_count; i++)
- {
- if(ip == VConData.con[i].network_address.ip &&
- port == VConData.con[i].network_address.port &&
- VConData.con[i].destroy_flag == 0)
- {
- return i;
- }
- }
- return -1;
-}
-
-boolean v_co_switch_connection(uint32 ip, uint16 port) /* switches to the current connection to one ip address if it exists */
-{
- unsigned int i;
- for(i = 0; i < VConData.con_count; i++)
- {
- if(ip == VConData.con[i].network_address.ip && port == VConData.con[i].network_address.port)
- {
- VConData.current_connection = i;
- return TRUE;
- }
- }
- return FALSE;
-}
-
-void v_con_inqueue_timer_update(void)
-{
- if(VConData.current_connection < VConData.con_count)
- {
- v_niq_timer_update(&VConData.con[VConData.current_connection].in_queue);
- }
-}
-
-/*
-extern void v_fs_buf_unpack(const uint8 *data, unsigned int length);
-extern void v_fs_buf_store_pack(uint8 *data, unsigned int length);
-extern boolean v_fs_buf_unpack_stored(void);
-*/
-extern void v_unpack_connection(const char *buf, unsigned int buffer_length);
-
-extern void verse_send_packet_nak(uint32 packet_id);
-extern void v_callback_connect_terminate(const char *bye);
-extern boolean v_connect_unpack_ping(const char *buf, size_t buffer_length, uint32 ip, uint16 port);
-extern void v_ping_update(void);
-void v_fs_unpack_beginning(uint8 *data, unsigned int length);
-
-/* Main function that receives and distributes all incoming packets. */
-boolean v_con_network_listen(void)
-{
- VNetworkAddress address;
- uint8 buf[V_MAX_CONNECT_PACKET_SIZE], *store;
- int size = 0;
- unsigned int connection;
- uint32 packet_id;
- boolean ret = FALSE;
-
- v_con_init(); /* Init if needed. */
- connection = VConData.current_connection; /* Store current connection in a local variable so that we can restore it later. */
- size = v_n_receive_data(&address, buf, sizeof buf); /* Ask for incoming data from the network. */
- while(size != -1 && size != 0) /* Did we get any data? */
- {
- VConData.current_connection = v_co_find_connection(address.ip, address.port); /* Is there a connection matching the IP and port? */
- vnp_raw_unpack_uint32(buf, &packet_id); /* Unpack the ID of the packet. */
-/* printf("got packet ID %u, %d bytes, connection %u\n", packet_id, size, VConData.current_connection);*/
- if(VConData.current_connection < VConData.con_count &&
- !(VConData.con[VConData.current_connection].connect_stage == V_CS_CONNECTED && packet_id == 0)) /* If this isn't a packet from an existing connection, disregard it. */
- {
- if(VConData.con[VConData.current_connection].connect_stage == V_CS_CONNECTED) /* Is this connection initialized? */
- {
- store = v_niq_store(&VConData.con[VConData.current_connection].in_queue, size, packet_id); /* Store the packet. */
- if(store != NULL)
- {
- VConData.pending_packets++; /* We now have one more packet pending unpack. */
- v_e_data_decrypt_packet(store, buf, size, VConData.con[VConData.current_connection].key_data); /* Decrypt the packet. */
- v_fs_unpack_beginning(store, size);
- }
- }
- else
- {
- v_unpack_connection(buf, size); /* This is an ongoing connecton-attempt. */
- v_niq_timer_update(&VConData.con[VConData.current_connection].in_queue);
- }
- }
- else if(v_connect_unpack_ping(buf, size, address.ip, address.port)) /* Ping handled. */
- ;
- else if(v_fs_func_accept_connections()) /* Do we accept connection-attempts? */
- {
- if(VConData.current_connection >= VConData.con_count ||
- V_RE_CONNECTON_TIME_OUT < v_niq_time_out(&VConData.con[VConData.current_connection].in_queue)) /* Is it a new client, or an old client that we haven't heard form in some time? */
- {
- if(VConData.current_connection < VConData.con_count)
- {
- VConData.con[VConData.current_connection].network_address.ip = 0;
- VConData.con[VConData.current_connection].destroy_flag = TRUE; /* Destroy old connection if there is one. */
- }
- v_con_connect(address.ip, address.port, V_CS_IDLE); /* Create a new connection. */
- v_unpack_connection(buf, size); /* Unpack the connection-attempt. */
- }
- }
- else
- {
- fprintf(stderr, __FILE__ ": Unhandled packet--dropping\n");
- if(VConData.con_count > 0)
- {
- fprintf(stderr, __FILE__ ": State: connections=%u, current=%u (stage %u), packet_id=%u\n",
- VConData.con_count,
- VConData.current_connection,
- (VConData.current_connection < VConData.con_count) ? VConData.con[VConData.current_connection].connect_stage : 0,
- packet_id);
- }
- }
- size = v_n_receive_data(&address, buf, sizeof buf); /* See if there are more incoming packets. */
- ret = TRUE;
- }
- VConData.current_connection = connection; /* Reset the current connection. */
-
- return ret;
-}
-
-extern void v_update_connection_pending(boolean resend);
-
-boolean v_con_callback_update(void)
-{
- static unsigned int seconds;
- boolean output = FALSE;
- size_t size;
- unsigned int connection, s;
- VNetInPacked *p;
-
- v_n_get_current_time(&s, NULL);
- connection = VConData.current_connection;
- for(VConData.current_connection = 0; VConData.current_connection < VConData.con_count; VConData.current_connection++)
- if(VConData.con[VConData.current_connection].connect_stage != V_CS_CONNECTED)
- v_update_connection_pending(s != seconds);
- seconds = s;
- VConData.current_connection = connection;
- if(VConData.pending_packets == 0)
- return FALSE;
- if(VConData.con[VConData.current_connection].connect_stage == V_CS_CONNECTED)
- {
- while((p = v_niq_get(&VConData.con[VConData.current_connection].in_queue, &size)) != NULL)
- {
- VConData.pending_packets--;
- v_fs_unpack(p->data, size);
- v_niq_release(&VConData.con[VConData.current_connection].in_queue, p);
- output = TRUE;
- }
- v_con_network_listen();
- }
- return output;
-}
-
-void verse_callback_update(unsigned int microseconds)
-{
- unsigned int connection, passed;
-
- v_ping_update(); /* Deliver any pending pings. */
- connection = VConData.current_connection;
- for(VConData.current_connection = 0; VConData.current_connection < VConData.con_count; VConData.current_connection++)
- {
- if(VConData.con[VConData.current_connection].connect_stage == V_CS_CONNECTED)
- v_noq_send_queue(VConData.con[VConData.current_connection].out_queue, &VConData.con[VConData.current_connection].network_address);
- if(VConData.con[VConData.current_connection].destroy_flag == TRUE)
- {
- v_noq_destroy_network_queue(VConData.con[VConData.current_connection].out_queue);
- VConData.pending_packets -= v_niq_free(&VConData.con[VConData.current_connection].in_queue);
- v_destroy_ordered_storage(VConData.con[VConData.current_connection].ordered_storage);
- if(VConData.con[VConData.current_connection].expected_key != NULL)
- free(VConData.con[VConData.current_connection].expected_key);
- if(VConData.con_count - 1 != VConData.current_connection)
- VConData.con[VConData.current_connection] = VConData.con[VConData.con_count - 1];
- VConData.con_count--;
- if(connection >= VConData.con_count)
- VConData.current_connection = 0;
- return;
- }
- }
- VConData.current_connection = connection;
-
- if(VConData.con_count > 0)
- {
-/* printf("checking timeout of stage %d connection %u\n",
- VConData.con[VConData.current_connection].connect_stage, VConData.current_connection);
-*/ if(V_CONNECTON_TIME_OUT < v_niq_time_out(&VConData.con[VConData.current_connection].in_queue))
- {
- if(VConData.con[VConData.current_connection].connect_stage != V_CS_CONNECTED)
- {
- VConData.con[VConData.current_connection].destroy_flag = TRUE;
- }
- else
- v_callback_connect_terminate("connection timed out");
- }
- }
-
- v_con_network_listen();
- if(VConData.con_count > 0)
- if(v_con_callback_update())
- return;
- for(passed = 0; passed < microseconds && VConData.pending_packets == 0;)
- {
- boolean update;
- if(microseconds - passed > V_CON_MAX_MICROSECOND_BETWEEN_SENDS) /* Still a long way to go? */
- passed += v_n_wait_for_incoming(V_CON_MAX_MICROSECOND_BETWEEN_SENDS);
- else
- passed += v_n_wait_for_incoming(microseconds - passed);
- do
- {
- update = v_con_network_listen();
- connection = VConData.current_connection;
- for(VConData.current_connection = 0; VConData.current_connection < VConData.con_count; VConData.current_connection++)
- {
- if(VConData.con[VConData.current_connection].connect_stage == V_CS_CONNECTED)
- {
- if(v_noq_send_queue(VConData.con[VConData.current_connection].out_queue, &VConData.con[VConData.current_connection].network_address))
- update = TRUE;
- }
- }
- VConData.current_connection = connection;
- } while(update);
- }
- if(VConData.con_count > 0)
- v_con_callback_update();
-}
-
-void v_con_set_name_pass(const char *name, const char *pass)
-{
- v_strlcpy(VConData.con[VConData.current_connection].name, name, sizeof VConData.con[VConData.current_connection].name);
- v_strlcpy(VConData.con[VConData.current_connection].pass, pass, sizeof VConData.con[VConData.current_connection].pass);
-}
-
-const char * v_con_get_name(void)
-{
- return VConData.con[VConData.current_connection].name;
-}
-
-const char * v_con_get_pass(void)
-{
- return VConData.con[VConData.current_connection].pass;
-}
-
-void v_con_set_connect_stage(VConnectStage stage)
-{
- VConData.con[VConData.current_connection].connect_stage = stage;
- VConData.con[VConData.current_connection].stage_atempts = 0;
-}
-
-VConnectStage v_con_get_connect_stage(void)
-{
- return VConData.con[VConData.current_connection].connect_stage;
-}
-
-uint8 *v_con_get_my_key(void)
-{
- return VConData.con[VConData.current_connection].key_my;
-}
-
-uint8 *v_con_get_other_key(void)
-{
- return VConData.con[VConData.current_connection].key_other;
-}
-
-uint8 **v_con_get_expected_key(void)
-{
- return &VConData.con[VConData.current_connection].expected_key;
-}
-
-uint8 * v_con_get_host_id(void)
-{
- return VConData.host_id;
-}
-
-void v_con_set_data_key(const uint8 *key)
-{
- memcpy(VConData.con[VConData.current_connection].key_data, key, V_ENCRYPTION_DATA_KEY_SIZE);
-}
-
-const uint8 * v_con_get_data_key(void)
-{
- return VConData.con[VConData.current_connection].key_data;
-}
-
-void * v_con_get_network_queue(void)
-{
- return VConData.con[VConData.current_connection].out_queue;
-}
-
-VNetworkAddress * v_con_get_network_address(void)
-{
- return &VConData.con[VConData.current_connection].network_address;
-}
-
-void * v_con_get_ordered_storage(void)
-{
- return VConData.con[VConData.current_connection].ordered_storage;
-}
-
-void v_con_set_avatar(uint32 avatar)
-{
- VConData.con[VConData.current_connection].avatar = avatar;
-}
-
-uint32 verse_session_get_avatar(void)
-{
- return VConData.con[VConData.current_connection].avatar;
-}
-
-void verse_session_get_time(uint32 *seconds, uint32 *fractions)
-{
- uint32 s, f;
- v_n_get_current_time(&s, &f);
- if((uint32)~0 - f < VConData.con[VConData.current_connection].timedelta_f)
- s++;
- if(seconds != NULL)
- {
- if(VConData.con[VConData.current_connection].timedelta_s < 0)
- *seconds = s - (uint32)(-VConData.con[VConData.current_connection].timedelta_s);
- else
- *seconds = s + VConData.con[VConData.current_connection].timedelta_s;
- }
- if(fractions != NULL)
- *fractions = f + VConData.con[VConData.current_connection].timedelta_f;
-}
-
-void v_con_set_time(uint32 seconds, uint32 fractions)
-{
- uint32 s, f;
- v_n_get_current_time(&s, &f);
-
- if(f < fractions)
- s--;
- if (s < seconds)
- VConData.con[VConData.current_connection].timedelta_s = -(int)(seconds - s);
- else
- VConData.con[VConData.current_connection].timedelta_s = (int)(s - seconds);
- VConData.con[VConData.current_connection].timedelta_f = f - fractions;
-}
-
-#endif
diff --git a/extern/verse/dist/v_connection.h b/extern/verse/dist/v_connection.h
deleted file mode 100644
index 1d2ac53d597..00000000000
--- a/extern/verse/dist/v_connection.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-**
-*/
-
-#include "v_network.h"
-
-typedef struct{
- char name[16];
- char pass[16];
- uint8 key;
- VNodeID avatar;
-}VSConnectionID;
-
-typedef enum{
- V_CS_IDLE = 0, /* Host connection waiting for connection */
- V_CS_CONTACT = 1, /* client tryes to contact host */
- V_CS_CONTACTED = 2, /* Host replyes whit challange */
- V_CS_PENDING_ACCEPT = 3, /* Client sends login */
- V_CS_PENDING_HOST_CALLBACK = 4, /* Host got login waits for accept connect callback */
- V_CS_PENDING_CLIENT_CALLBACK_ACCEPT = 5, /* Host got login waits for accept connect callback */
- V_CS_PENDING_CLIENT_CALLBACK_TERMINATE = 6, /* Host got login waits for connect terminate callback */
- V_CS_PENDING_DECISION = 7, /* Host got has executed Callback waits for accept command */
- V_CS_CONNECTED = 8 /* Connection establiched */
-}VConnectStage;
-
-/* Connection related functions (v_connection.c) */
-
-extern boolean v_con_network_listen(void);
-
-extern void v_con_set_name_pass(const char *name, const char *pass);
-extern const char * v_con_get_name(void);
-extern const char * v_con_get_pass(void);
-
-extern void v_con_set_avatar(uint32 avatar);
-extern void v_con_set_time(uint32 seconds, uint32 fractions);
-
-extern void v_con_set_connect_stage(VConnectStage stage);
-extern VConnectStage v_con_get_connect_stage(void);
-
-
-extern uint8 *v_con_get_my_key(void);
-extern uint8 *v_con_get_other_key(void);
-extern uint8 *v_con_get_host_id(void);
-extern uint8 **v_con_get_expected_key(void);
-
-extern void v_con_set_data_key(const uint8 *key);
-extern const uint8 * v_con_get_data_key(void);
-
-
-extern void * v_con_get_network_queue(void);
-extern VNetworkAddress *v_con_get_network_address(void);
-extern void * v_con_get_network_address_id(unsigned int id);
-extern unsigned int * v_con_get_network_expected_packet(void);
-extern void * v_con_get_ordered_storage(void);
-extern void * v_con_get_func_storage(void);
-extern void * v_con_connect(uint32 ip, uint16 port, VConnectStage stage);
-extern unsigned int v_con_get_network_address_count(void);
-
-extern boolean v_co_switch_connection(uint32 ip, uint16 port);
-
-extern void v_con_inqueue_timer_update(void);
-
-
-/* Func storage related functions (v_func_storage.c)*/
-extern void v_fs_unpack(uint8 *data, unsigned int length);
-
-extern boolean v_fs_func_accept_connections(void);
-extern void v_fs_add_func(unsigned int cmd_id, unsigned int (*unpack_func)(const char *buf, size_t buffer_length), void *pack_func, void *alias_func);
-
-extern void * v_fs_get_alias_user_func(unsigned int cmd_id);
-extern void * v_fs_get_alias_user_data(unsigned int cmd_id);
-extern void * v_fs_get_user_func(unsigned int cmd_id);
-extern void * v_fs_get_user_data(unsigned int cmd_id);
diff --git a/extern/verse/dist/v_encryption.c b/extern/verse/dist/v_encryption.c
deleted file mode 100644
index aea0f8e6979..00000000000
--- a/extern/verse/dist/v_encryption.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * Verse encryption routines. Implements RSA encryption/decryption plus fast XORx.
-*/
-
-#if !defined(V_GENERATE_FUNC_MODE)
-
-#include
-#include
-#include
-
-#include "verse.h"
-#include "v_pack.h"
-#include "v_bignum.h"
-#include "v_encryption.h"
-
-#define BITS V_ENCRYPTION_LOGIN_KEY_BITS /* Save some typing. */
-
-extern void v_prime_set_random(VBigDig *x);
-extern void v_prime_set_table(VBigDig *x, int i);
-
-const uint8 * v_e_data_create_key(void) /* possibly the worst key gen ever */
-{
- static unsigned int counter = 0;
- static uint8 buffer[V_ENCRYPTION_DATA_KEY_SIZE];
- unsigned int i, temp;
-
- for(i = 0; i < V_ENCRYPTION_DATA_KEY_SIZE; i++)
- {
- counter++;
- temp = (counter << 13) ^ counter;
- temp = (temp * (temp * temp * 15731 + 789221) + 1376312589) & 0x7fffffff;
- buffer[i] = temp;
- }
- /* FIXME: This really isn't very pretty. */
- buffer[0] &= 0x3f; /* Make sure top word is... Low. For RSA compatibility. */
-
-/* memset(buffer, 0, sizeof buffer);
- fprintf(stderr, "**WARNING: XOR data encryption disabled\n");
-*/
- return buffer;
-}
-
-void v_e_data_encrypt_command(uint8 *packet, size_t packet_size, const uint8 *command, size_t command_size, const uint8 *key)
-{
- uint32 pos, i;
-
- vnp_raw_unpack_uint32(packet, &pos);
-/* printf("encrypting packet %u", pos);*/
- pos = key[pos % V_ENCRYPTION_DATA_KEY_SIZE] + packet_size;
-/* printf(" -> pos=%u (size %u)", pos, packet_size);
- printf(", key begins: [");
- for(i = 0; i < 16; i++)
- printf(" %02X", key[(pos + i) % V_ENCRYPTION_DATA_KEY_SIZE]);
- printf(" ]\n");
-*/
- for(i = 0; i < command_size; i++)
- packet[packet_size + i] = command[i] ^ key[(i + pos) % V_ENCRYPTION_DATA_KEY_SIZE];
-}
-
-void v_e_data_decrypt_packet(uint8 *to, const uint8 *from, size_t size, const uint8 *key)
-{
- uint32 pos, i;
-
- vnp_raw_unpack_uint32(from, &pos);
-/* printf("decrypting packet %u", pos);*/
- pos = key[pos % V_ENCRYPTION_DATA_KEY_SIZE];
-/* printf(" -> pos=%u", pos);
- printf(", key begins: [");
- for(i = 0; i < 16; i++)
- printf(" %02X", key[(i + pos) % V_ENCRYPTION_DATA_KEY_SIZE]);
- printf(" ]\n");
-*/ for(i = 0; i < 4; i++)
- to[i] = from[i];
- for(i = 4; i < size; i++)
- to[i] = from[i] ^ key[(i + pos) % V_ENCRYPTION_DATA_KEY_SIZE];
-}
-
-#endif
-
-/* From Knuth. Computes multiplicative inverse of u, modulo v. */
-void v_e_math_inv(VBigDig *inv, const VBigDig *u, const VBigDig *v)
-{
- VBigDig VBIGNUM(u1, 2*BITS), VBIGNUM(u3, 2*BITS), VBIGNUM(v1, 2*BITS), VBIGNUM(v3, 2 *BITS),
- VBIGNUM(t1, 2*BITS), VBIGNUM(t3, 2*BITS), VBIGNUM(q, 2*BITS), VBIGNUM(w, 2*BITS);
- int iter = 1;
-
- v_bignum_set_one(u1);
- v_bignum_set_bignum(u3, u);
- v_bignum_set_zero(v1);
- v_bignum_set_bignum(v3, v);
-
- while(!v_bignum_eq_zero(v3))
- {
- v_bignum_set_bignum(q, u3);
- v_bignum_div(q, v3, t3);
- v_bignum_set_bignum(w, q);
- v_bignum_mul(w, v1);
- v_bignum_set_bignum(t1, u1);
- v_bignum_add(t1, w);
-
- v_bignum_set_bignum(u1, v1);
- v_bignum_set_bignum(v1, t1);
- v_bignum_set_bignum(u3, v3);
- v_bignum_set_bignum(v3, t3);
- iter = -iter;
- }
- if(iter < 0)
- {
- v_bignum_set_bignum(inv, v);
- v_bignum_sub(inv, u1);
- }
- else
- v_bignum_set_bignum(inv, u1);
-}
-
-void v_e_connect_create_key(uint8 *private_key, uint8 *public_key, uint8 *n)
-{
- VBigDig VBIGNUM(p, BITS / 2), VBIGNUM(q, BITS / 2), VBIGNUM(qmo, BITS / 2), VBIGNUM(phi, BITS),
- VBIGNUM(pub, BITS), VBIGNUM(priv, BITS), VBIGNUM(mod, BITS);
-
-#if !defined _WIN32
- /* FIXME: This is a security backdoor. Intent is simply to save time during testing. */
- if(getenv("VERSE_NORSA") != NULL)
- {
- printf("VERSE: Found the NORSA envvar, using constant keys\n");
- v_prime_set_table(p, 0);
- v_prime_set_table(q, 1);
- goto compute_phi;
- }
-#endif
-/* printf("find prime p\n");*/
- v_prime_set_random(p);
-/* printf("find prime q\n");*/
- v_prime_set_random(q);
-compute_phi:
-/* printf("done, computing key\n");*/
-/* printf("p=");
- v_bignum_print_hex_lf(p);
- printf("q=");
- v_bignum_print_hex_lf(q);
-*/ v_bignum_set_bignum(phi, p);
- v_bignum_sub_digit(phi, 1);
- v_bignum_set_bignum(qmo, q);
- v_bignum_sub_digit(qmo, 1);
- v_bignum_mul(phi, qmo);
-/* printf("phi=");
- v_bignum_print_hex_lf(phi);
-*/ v_bignum_set_string_hex(pub, "0x10001");
- v_e_math_inv(priv, pub, phi);
-/* printf(" pub=");
- v_bignum_print_hex_lf(pub);
- printf("priv=");
- v_bignum_print_hex_lf(priv);
-*/
- v_bignum_set_bignum(mod, p);
- v_bignum_mul(mod, q);
-/* printf(" mod=");
- v_bignum_print_hex_lf(mod);
- printf("key-creation finished\n");
-*/ /* Write out the keys. */
- v_bignum_raw_export(pub, public_key);
- v_bignum_raw_export(priv, private_key);
- v_bignum_raw_export(mod, n);
-}
-
-void v_e_connect_encrypt(uint8 *output, const uint8 *data, const uint8 *key, const uint8 *key_n)
-{
- VBigDig VBIGNUM(packet, BITS), VBIGNUM(expo, BITS), VBIGNUM(mod, BITS);
-
- v_bignum_raw_import(packet, data);
- v_bignum_raw_import(expo, key);
- v_bignum_raw_import(mod, key_n);
-
- /* Verify that data is less than the modulo, this is a prerequisite for encryption. */
- if(!v_bignum_gte(mod, packet))
- {
- printf("*** WARNING. Data is not less than modulo, as it should be--encryption will break!\n");
- printf(" RSA modulo: ");
- v_bignum_print_hex_lf(mod);
- printf(" RSA data: ");
- v_bignum_print_hex_lf(packet);
- }
-/* printf("RSA key: ");
- v_bignum_print_hex_lf(expo);
- printf("RSA mod: ");
- v_bignum_print_hex_lf(mod);
- printf("RSA in: ");
- v_bignum_print_hex_lf(packet);
- printf("bits in packet: %d, ", v_bignum_bit_msb(packet) + 1);
- printf("bits in modulo: %d\n", v_bignum_bit_msb(mod) + 1);
-*/ v_bignum_pow_mod(packet, expo, mod); /* Blam. */
-/* printf("RSA out: ");
- v_bignum_print_hex_lf(packet);
-*/ v_bignum_raw_export(packet, output);
-}
-
-#if defined CRYPTALONE
-void v_encrypt_test(void)
-{
- uint8 k_priv[BITS / 8], k_pub[BITS / 8], k_n[BITS / 8], cipher[BITS / 8], plain[BITS / 8], decode[BITS / 8], i;
-
- printf("testing RSA-crypto\n");
- v_e_connect_create_key(k_pub, k_priv, k_n);
-/* exit(0);*/
- printf("key pair generated, encrypting something\n");
- memset(plain, 0, sizeof plain);
- strcpy(plain, "This is some text to encrypt, to give it something to chew on.");
- printf("plain: %02X (%u)\n", plain[0], strlen(plain));
- v_e_connect_encrypt(cipher, plain, k_pub, k_n);
- printf("plain: %02X, cipher: %02X\n", plain[0], cipher[0]);
- v_e_connect_encrypt(decode, cipher, k_priv, k_n);
- printf("decoded: %02X: '", decode[0]);
- for(i = 0; decode[i] != 0; i++)
- putchar(decode[i]);
- printf("'\n");
-/* printf("\npublic key: ");
- v_bignum_print_hex_lf(k_public);
- printf("private key: ");
- v_bignum_print_hex_lf(k_private);
- v_bignum_set_string(msg, "123");
- gettimeofday(&t1, NULL);
- v_bignum_pow_mod(msg, k_private, k_n);
- gettimeofday(&t2, NULL);
- printf("encrypted: ");
- v_bignum_print_hex_lf(msg);
- printf("encrypted %u bits in %g s\n", BITS, t2.tv_sec - t1.tv_sec + 1.0E-6 * (t2.tv_usec - t1.tv_usec));
-
- gettimeofday(&t1, NULL);
- v_bignum_pow_mod(msg, k_public, k_n);
- gettimeofday(&t2, NULL);
- printf("decrypted: ");
- v_bignum_print_hex_lf(msg);
- printf("decrypted %u bits in %g s\n", BITS, t2.tv_sec - t1.tv_sec + 1.0E-6 * (t2.tv_usec - t1.tv_usec));
- exit(0);
-*//* v_e_encrypt(cipher, plain, &k_private, &k_n);
- printf("encrypted data: ");
- for(i = 0; i < sizeof cipher; i++)
- printf("%c", isalnum(cipher[i]) ? cipher[i] : '?');
- printf("\n\n");
- printf("decrypting\n");
- v_e_encrypt(decode, cipher, &k_public, &k_n);
- printf("decrypted data: ");
- for(i = 0; i < sizeof cipher; i++)
- printf("%c", isalnum(decode[i]) ? decode[i] : '?');
- printf("\n\n");
-*/
-}
-
-int main(void)
-{
- v_encrypt_test();
-
- return 0;
-}
-#endif
diff --git a/extern/verse/dist/v_encryption.h b/extern/verse/dist/v_encryption.h
deleted file mode 100644
index cbfb5ff692f..00000000000
--- a/extern/verse/dist/v_encryption.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Verse encryption routines. There are two distinct flavors of encryption
- * in use: one "heavy" for login/connection establishment security, and
- * a far lighter symmetrical one that is applied to each data packet after
- * the key has been exchanged during connection.
-*/
-
-#include "verse.h"
-
-/* Internal key size definitions. *MUST* be kept in sync with V_HOST_ID_SIZE in verse_header.h! */
-#define V_ENCRYPTION_LOGIN_KEY_BITS 512
-#define V_ENCRYPTION_LOGIN_KEY_SIZE (V_ENCRYPTION_LOGIN_KEY_BITS / 8)
-#define V_ENCRYPTION_LOGIN_KEY_FULL_SIZE (3 * V_ENCRYPTION_LOGIN_KEY_SIZE)
-#define V_ENCRYPTION_LOGIN_KEY_HALF_SIZE (2 * V_ENCRYPTION_LOGIN_KEY_SIZE)
-
-#define V_ENCRYPTION_LOGIN_PUBLIC_START (0 * V_ENCRYPTION_LOGIN_KEY_SIZE)
-#define V_ENCRYPTION_LOGIN_PRIVATE_START (1 * V_ENCRYPTION_LOGIN_KEY_SIZE)
-#define V_ENCRYPTION_LOGIN_N_START (2 * V_ENCRYPTION_LOGIN_KEY_SIZE)
-
-#define V_ENCRYPTION_DATA_KEY_SIZE (V_ENCRYPTION_LOGIN_KEY_BITS / 8)
-
-/* Connection encryption. Heavy, and symmetrical, so encrypt() does both encryption
- * and decryption given the proper key. Current algorithm used is RSA.
-*/
-extern void v_e_connect_create_key(uint8 *private_key, uint8 *public_key, uint8 *n);
-extern void v_e_connect_encrypt(uint8 *output, const uint8 *data, const uint8 *key, const uint8 *key_n);
-
-/* Actual data traffic encryption. Also symmetrical, with a single key. Uses XOR. */
-extern const uint8 * v_e_data_create_key(void);
-extern void v_e_data_encrypt_command(uint8 *packet, size_t packet_length,
- const uint8 *command, size_t command_length, const uint8 *key);
-extern void v_e_data_decrypt_packet(uint8 *to, const uint8 *from, size_t size, const uint8 *key);
diff --git a/extern/verse/dist/v_func_storage.c b/extern/verse/dist/v_func_storage.c
deleted file mode 100644
index 86c7815c2af..00000000000
--- a/extern/verse/dist/v_func_storage.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- *
-*/
-
-#include
-#include
-#include "verse_header.h"
-#include "v_pack.h"
-#include "v_cmd_gen.h"
-#include "v_connection.h"
-#if !defined(V_GENERATE_FUNC_MODE)
-#include "verse.h"
-#include "v_cmd_buf.h"
-#include "v_network_out_que.h"
-
-#define V_FS_MAX_CMDS 256
-
-extern void init_pack_and_unpack(void);
-
-static struct {
- unsigned int (*unpack_func[V_FS_MAX_CMDS])(const char *data, size_t length);
- void *pack_func[V_FS_MAX_CMDS];
- void *user_func[V_FS_MAX_CMDS];
- void *user_data[V_FS_MAX_CMDS];
- void *alias_pack_func[V_FS_MAX_CMDS];
- void *alias_user_func[V_FS_MAX_CMDS];
- void *alias_user_data[V_FS_MAX_CMDS];
- boolean call;
-} VCmdData;
-
-static boolean v_fs_initialized = FALSE;
-
-extern void verse_send_packet_ack(uint32 packet_id);
-extern void callback_send_packet_ack(void *user, uint32 packet_id);
-extern void verse_send_packet_nak(uint32 packet_id);
-extern void callback_send_packet_nak(void *user, uint32 packet_id);
-
-void v_fs_init(void)
-{
- unsigned int i;
- if(v_fs_initialized)
- return;
- for(i = 0; i < V_FS_MAX_CMDS; i++)
- {
- VCmdData.unpack_func[i] = NULL;
- VCmdData.pack_func[i] = NULL;
- VCmdData.user_func[i] = NULL;
- VCmdData.user_data[i] = NULL;
- VCmdData.alias_pack_func[i] = NULL;
- VCmdData.alias_user_func[i] = NULL;
- VCmdData.alias_user_data[i] = NULL;
- }
- #if !defined(V_GENERATE_FUNC_MODE)
- init_pack_and_unpack();
- #endif
- for(i = 0; i < V_FS_MAX_CMDS && VCmdData.pack_func[i] != verse_send_packet_ack; i++);
- VCmdData.user_func[i] = callback_send_packet_ack;
- for(i = 0; i < V_FS_MAX_CMDS && VCmdData.pack_func[i] != verse_send_packet_nak; i++);
- VCmdData.user_func[i] = callback_send_packet_nak;
-
- v_fs_initialized = TRUE;
-}
-
-
-void v_fs_add_func(unsigned int cmd_id, unsigned int (*unpack_func)(const char *data, size_t length), void *pack_func, void *alias_func)
-{
- VCmdData.unpack_func[cmd_id] = unpack_func;
- VCmdData.pack_func[cmd_id] = pack_func;
- VCmdData.alias_pack_func[cmd_id] = alias_func;
-}
-
-void *v_fs_get_user_func(unsigned int cmd_id)
-{
-/* if(VCmdData.call)*/
- return VCmdData.user_func[cmd_id];
- return NULL;
-}
-
-void *v_fs_get_user_data(unsigned int cmd_id)
-{
- return VCmdData.user_data[cmd_id];
-}
-
-void *v_fs_get_alias_user_func(unsigned int cmd_id)
-{
-/* if(VCmdData.call)*/
- return VCmdData.alias_user_func[cmd_id];
- return NULL;
-}
-
-void *v_fs_get_alias_user_data(unsigned int cmd_id)
-{
- return VCmdData.alias_user_data[cmd_id];
-}
-
-void verse_callback_set(void *command, void *callback, void *user)
-{
- unsigned int i;
- if(!v_fs_initialized)
- v_fs_init();
-
- for(i = 0; i < V_FS_MAX_CMDS; i++)
- {
- if(VCmdData.pack_func[i] == command)
- {
- VCmdData.user_data[i] = user;
- VCmdData.user_func[i] = callback;
- return;
- }
- if(VCmdData.alias_pack_func[i] == command)
- {
- VCmdData.alias_user_data[i] = user;
- VCmdData.alias_user_func[i] = callback;
- return;
- }
- }
-}
-
-/* Do we accept incoming connections, i.e. are we a host implementation? */
-boolean v_fs_func_accept_connections(void)
-{
- return VCmdData.user_func[0] != NULL;
-}
-
-/* Inspect beginning of packet, looking for ACK or NAK commands. */
-void v_fs_unpack_beginning(const uint8 *data, unsigned int length)
-{
- uint32 id, i = 4;
- uint8 cmd_id;
-
- i += vnp_raw_unpack_uint8(&data[i], &cmd_id);
- while(i < length && (cmd_id == 7 || cmd_id == 8))
- {
- i += vnp_raw_unpack_uint32(&data[i], &id);
- if(cmd_id == 7)
- callback_send_packet_ack(NULL, id);
- else
- callback_send_packet_nak(NULL, id);
- i += vnp_raw_unpack_uint8(&data[i], &cmd_id);
- }
-}
-
-void v_fs_unpack(uint8 *data, unsigned int length)
-{
- uint32 i, output, pack_id;
- uint8 cmd_id, last = 255;
-
- i = vnp_raw_unpack_uint32(data, &pack_id); /* each packet starts with a 32 bit id */
- vnp_raw_unpack_uint8(&data[i], &cmd_id);
- while(i < length && (cmd_id == 7 || cmd_id == 8))
- {
- i += 5;
- vnp_raw_unpack_uint8(&data[i], &cmd_id);
- }
- while(i < length)
- {
- i += vnp_raw_unpack_uint8(&data[i], &cmd_id);
- if(VCmdData.unpack_func[cmd_id] != NULL)
- {
- VCmdData.call = TRUE;
- output = VCmdData.unpack_func[cmd_id](&data[i], length - i);
- if(output == (unsigned int) -1) /* Can this happen? Should be size_t or int, depending. */
- {
- printf("** Aborting decode, command %u unpacker returned failure\n", cmd_id);
-/* verse_send_packet_nak(pack_id);*/
- return;
- }
- last = cmd_id;
- i += output;
- }
- else /* If unknown command byte was found, complain loudly and stop parsing packet. */
- {
- size_t j;
-
- printf("\n** Unknown command ID %u (0x%02X) encountered--aborting packet decode len=%u pos=%u last=%u\n", cmd_id, cmd_id, length, i, last);
- printf(" decoded %u bytes: ", --i);
- for(j = 0; j < i; j++)
- printf("%02X ", data[j]);
- printf("\n (packet id=%u)", pack_id);
- printf(" remaining %u bytes: ", length - i);
- for(j = i; j < length; j++)
- printf("%02X ", data[j]);
- printf("\n");
-/* *(char *) 0 = 0;*/
- break;
- }
- }
-/* if(expected != NULL)
- verse_send_packet_ack(pack_id);*/
-}
-
-extern unsigned int v_unpack_connection(const char *data, size_t length);
-
-#endif
diff --git a/extern/verse/dist/v_gen_pack_a_node.c b/extern/verse/dist/v_gen_pack_a_node.c
deleted file mode 100644
index dc8e53e1a7f..00000000000
--- a/extern/verse/dist/v_gen_pack_a_node.c
+++ /dev/null
@@ -1,521 +0,0 @@
-/*
-** This is automatically generated source code -- do not edit.
-** Changes are affected either by editing the corresponding protocol
-** definition file (v_cmd_def_X.c where X=node type), or by editing
-** the code generator itself, in v_cmd_gen.c.
-*/
-
-#include
-#include
-
-#include "v_cmd_gen.h"
-#if !defined(V_GENERATE_FUNC_MODE)
-#include "verse.h"
-#include "v_cmd_buf.h"
-#include "v_network_out_que.h"
-#include "v_network.h"
-#include "v_connection.h"
-#include "v_util.h"
-
-void verse_send_a_buffer_create(VNodeID node_id, VBufferID buffer_id, const char *name, VNABlockType type, real64 frequency)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_80);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 160); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_a_buffer_create(node_id = %u buffer_id = %u name = %s type = %u frequency = %f );\n", node_id, buffer_id, name, type, frequency);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], buffer_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], name, 16);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)type);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], frequency);
- if(node_id == (uint32) ~0u || buffer_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_a_buffer_destroy(VNodeID node_id, VBufferID buffer_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_80);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 160); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_a_buffer_destroy(node_id = %u buffer_id = %u );\n", node_id, buffer_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], buffer_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)-1);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], V_REAL64_MAX);
- if(node_id == (uint32) ~0u || buffer_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_a_buffer_create(const char *buf, size_t buffer_length)
-{
- uint8 enum_temp;
- unsigned int buffer_pos = 0;
- void (* func_a_buffer_create)(void *user_data, VNodeID node_id, VBufferID buffer_id, const char *name, VNABlockType type, real64 frequency);
- VNodeID node_id;
- VBufferID buffer_id;
- char name[16];
- VNABlockType type;
- real64 frequency;
-
- func_a_buffer_create = v_fs_get_user_func(160);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &buffer_id);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], name, 16, buffer_length - buffer_pos);
- if(buffer_length < 9 + buffer_pos)
- return -1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &enum_temp);
- type = (VNABlockType)enum_temp;
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frequency);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(name[0] == 0)
- printf("receive: verse_send_a_buffer_destroy(node_id = %u buffer_id = %u ); callback = %p\n", node_id, buffer_id, v_fs_get_alias_user_func(160));
- else
- printf("receive: verse_send_a_buffer_create(node_id = %u buffer_id = %u name = %s type = %u frequency = %f ); callback = %p\n", node_id, buffer_id, name, type, frequency, v_fs_get_user_func(160));
-#endif
- if(name[0] == 0)
- {
- void (* alias_a_buffer_destroy)(void *user_data, VNodeID node_id, VBufferID buffer_id);
- alias_a_buffer_destroy = v_fs_get_alias_user_func(160);
- if(alias_a_buffer_destroy != NULL)
- alias_a_buffer_destroy(v_fs_get_alias_user_data(160), node_id, buffer_id);
- return buffer_pos;
- }
- if(func_a_buffer_create != NULL)
- func_a_buffer_create(v_fs_get_user_data(160), node_id, buffer_id, name, (VNABlockType) type, frequency);
-
- return buffer_pos;
-}
-
-void verse_send_a_buffer_subscribe(VNodeID node_id, VBufferID layer_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 161); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_a_buffer_subscribe(node_id = %u layer_id = %u );\n", node_id, layer_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], TRUE);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_a_buffer_unsubscribe(VNodeID node_id, VBufferID layer_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 161); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_a_buffer_unsubscribe(node_id = %u layer_id = %u );\n", node_id, layer_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], FALSE);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_a_buffer_subscribe(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_a_buffer_subscribe)(void *user_data, VNodeID node_id, VBufferID layer_id);
- VNodeID node_id;
- VBufferID layer_id;
- uint8 alias_bool;
-
- func_a_buffer_subscribe = v_fs_get_user_func(161);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
- if(buffer_length < buffer_pos + 1)
- return -1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &alias_bool);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(!alias_bool)
- printf("receive: verse_send_a_buffer_unsubscribe(node_id = %u layer_id = %u ); callback = %p\n", node_id, layer_id, v_fs_get_alias_user_func(161));
- else
- printf("receive: verse_send_a_buffer_subscribe(node_id = %u layer_id = %u ); callback = %p\n", node_id, layer_id, v_fs_get_user_func(161));
-#endif
- if(!alias_bool)
- {
- void (* alias_a_buffer_unsubscribe)(void *user_data, VNodeID node_id, VBufferID layer_id);
- alias_a_buffer_unsubscribe = v_fs_get_alias_user_func(161);
- if(alias_a_buffer_unsubscribe != NULL)
- alias_a_buffer_unsubscribe(v_fs_get_alias_user_data(161), node_id, layer_id);
- return buffer_pos;
- }
- if(func_a_buffer_subscribe != NULL)
- func_a_buffer_subscribe(v_fs_get_user_data(161), node_id, layer_id);
-
- return buffer_pos;
-}
-
-void verse_send_a_block_set(VNodeID node_id, VLayerID buffer_id, uint32 block_index, VNABlockType type, const VNABlock *samples)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 162); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_a_block_set(node_id = %u buffer_id = %u block_index = %u type = %u samples = %p );\n", node_id, buffer_id, block_index, type, samples);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], buffer_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], block_index);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)type);
- buffer_pos += vnp_pack_audio_block(&buf[buffer_pos], type, samples);
- if(node_id == (uint32) ~0u || buffer_id == (uint16) ~0u || block_index == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 11);
- else
- v_cmd_buf_set_address_size(head, 11);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_a_block_clear(VNodeID node_id, VLayerID buffer_id, uint32 block_index)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 162); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_a_block_clear(node_id = %u buffer_id = %u block_index = %u );\n", node_id, buffer_id, block_index);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], buffer_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], block_index);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)-1);
- if(node_id == (uint32) ~0u || buffer_id == (uint16) ~0u || block_index == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 11);
- else
- v_cmd_buf_set_address_size(head, 11);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_a_block_set(const char *buf, size_t buffer_length)
-{
- uint8 enum_temp;
- unsigned int buffer_pos = 0;
- void (* func_a_block_set)(void *user_data, VNodeID node_id, VLayerID buffer_id, uint32 block_index, VNABlockType type, const VNABlock *samples);
- VNodeID node_id;
- VLayerID buffer_id;
- uint32 block_index;
- VNABlockType type;
- const VNABlock *samples;
-
- func_a_block_set = v_fs_get_user_func(162);
- if(buffer_length < 10)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &buffer_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &block_index);
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &enum_temp);
- type = (VNABlockType)enum_temp;
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(type > VN_A_BLOCK_REAL64)
- printf("receive: verse_send_a_block_clear(node_id = %u buffer_id = %u block_index = %u ); callback = %p\n", node_id, buffer_id, block_index, v_fs_get_alias_user_func(162));
- else
- printf("receive: verse_send_a_block_set(node_id = %u buffer_id = %u block_index = %u type = %u ); callback = %p\n", node_id, buffer_id, block_index, type, v_fs_get_user_func(162));
-#endif
- if(type <= VN_A_BLOCK_REAL64)
- {
- VNABlock block;
- buffer_pos += vnp_unpack_audio_block(&buf[buffer_pos], type, &block);
- if(func_a_block_set != NULL)
- func_a_block_set(v_fs_get_user_data(162), node_id, buffer_id, block_index, (VNABlockType) type, &block);
- return buffer_pos;
- }
-
- if(type > VN_A_BLOCK_REAL64)
- {
- void (* alias_a_block_clear)(void *user_data, VNodeID node_id, VLayerID buffer_id, uint32 block_index);
- alias_a_block_clear = v_fs_get_alias_user_func(162);
- if(alias_a_block_clear != NULL)
- alias_a_block_clear(v_fs_get_alias_user_data(162), node_id, buffer_id, block_index);
- return buffer_pos;
- }
- if(func_a_block_set != NULL)
- func_a_block_set(v_fs_get_user_data(162), node_id, buffer_id, block_index, (VNABlockType) type, samples);
-
- return buffer_pos;
-}
-
-void verse_send_a_stream_create(VNodeID node_id, VLayerID stream_id, const char *name)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 163); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_a_stream_create(node_id = %u stream_id = %u name = %s );\n", node_id, stream_id, name);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], stream_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], name, 16);
- if(node_id == (uint32) ~0u || stream_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_a_stream_destroy(VNodeID node_id, VLayerID stream_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 163); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_a_stream_destroy(node_id = %u stream_id = %u );\n", node_id, stream_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], stream_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
- if(node_id == (uint32) ~0u || stream_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_a_stream_create(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_a_stream_create)(void *user_data, VNodeID node_id, VLayerID stream_id, const char *name);
- VNodeID node_id;
- VLayerID stream_id;
- char name[16];
-
- func_a_stream_create = v_fs_get_user_func(163);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &stream_id);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], name, 16, buffer_length - buffer_pos);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(name[0] == 0)
- printf("receive: verse_send_a_stream_destroy(node_id = %u stream_id = %u ); callback = %p\n", node_id, stream_id, v_fs_get_alias_user_func(163));
- else
- printf("receive: verse_send_a_stream_create(node_id = %u stream_id = %u name = %s ); callback = %p\n", node_id, stream_id, name, v_fs_get_user_func(163));
-#endif
- if(name[0] == 0)
- {
- void (* alias_a_stream_destroy)(void *user_data, VNodeID node_id, VLayerID stream_id);
- alias_a_stream_destroy = v_fs_get_alias_user_func(163);
- if(alias_a_stream_destroy != NULL)
- alias_a_stream_destroy(v_fs_get_alias_user_data(163), node_id, stream_id);
- return buffer_pos;
- }
- if(func_a_stream_create != NULL)
- func_a_stream_create(v_fs_get_user_data(163), node_id, stream_id, name);
-
- return buffer_pos;
-}
-
-void verse_send_a_stream_subscribe(VNodeID node_id, VLayerID stream_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 164); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_a_stream_subscribe(node_id = %u stream_id = %u );\n", node_id, stream_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], stream_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], TRUE);
- if(node_id == (uint32) ~0u || stream_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_a_stream_unsubscribe(VNodeID node_id, VLayerID stream_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 164); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_a_stream_unsubscribe(node_id = %u stream_id = %u );\n", node_id, stream_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], stream_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], FALSE);
- if(node_id == (uint32) ~0u || stream_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_a_stream_subscribe(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_a_stream_subscribe)(void *user_data, VNodeID node_id, VLayerID stream_id);
- VNodeID node_id;
- VLayerID stream_id;
- uint8 alias_bool;
-
- func_a_stream_subscribe = v_fs_get_user_func(164);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &stream_id);
- if(buffer_length < buffer_pos + 1)
- return -1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &alias_bool);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(!alias_bool)
- printf("receive: verse_send_a_stream_unsubscribe(node_id = %u stream_id = %u ); callback = %p\n", node_id, stream_id, v_fs_get_alias_user_func(164));
- else
- printf("receive: verse_send_a_stream_subscribe(node_id = %u stream_id = %u ); callback = %p\n", node_id, stream_id, v_fs_get_user_func(164));
-#endif
- if(!alias_bool)
- {
- void (* alias_a_stream_unsubscribe)(void *user_data, VNodeID node_id, VLayerID stream_id);
- alias_a_stream_unsubscribe = v_fs_get_alias_user_func(164);
- if(alias_a_stream_unsubscribe != NULL)
- alias_a_stream_unsubscribe(v_fs_get_alias_user_data(164), node_id, stream_id);
- return buffer_pos;
- }
- if(func_a_stream_subscribe != NULL)
- func_a_stream_subscribe(v_fs_get_user_data(164), node_id, stream_id);
-
- return buffer_pos;
-}
-
-void verse_send_a_stream(VNodeID node_id, VLayerID stream_id, uint32 time_s, uint32 time_f, VNABlockType type, real64 frequency, const VNABlock *samples)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 165); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_a_stream(node_id = %u stream_id = %u time_s = %u time_f = %u type = %u frequency = %f samples = %p );\n", node_id, stream_id, time_s, time_f, type, frequency, samples);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], stream_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], time_s);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], time_f);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)type);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], frequency);
- buffer_pos += vnp_pack_audio_block(&buf[buffer_pos], type, samples);
- if(node_id == (uint32) ~0u || stream_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_a_stream(const char *buf, size_t buffer_length)
-{
- uint8 enum_temp;
- unsigned int buffer_pos = 0;
- void (* func_a_stream)(void *user_data, VNodeID node_id, VLayerID stream_id, uint32 time_s, uint32 time_f, VNABlockType type, real64 frequency, const VNABlock *samples);
- VNodeID node_id;
- VLayerID stream_id;
- uint32 time_s;
- uint32 time_f;
- VNABlockType type;
- real64 frequency;
- const VNABlock *samples;
-
- func_a_stream = v_fs_get_user_func(165);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &stream_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &time_s);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &time_f);
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &enum_temp);
- type = (VNABlockType)enum_temp;
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frequency);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_a_stream(node_id = %u stream_id = %u time_s = %u time_f = %u type = %u frequency = %f ); callback = %p\n", node_id, stream_id, time_s, time_f, type, frequency, v_fs_get_user_func(165));
-#endif
- {
- VNABlock block;
- buffer_pos += vnp_unpack_audio_block(&buf[buffer_pos], type, &block);
- if(func_a_stream != NULL)
- func_a_stream(v_fs_get_user_data(165), node_id, stream_id, time_s, time_f, (VNABlockType) type, frequency, &block);
- return buffer_pos;
- }
-
- if(func_a_stream != NULL)
- func_a_stream(v_fs_get_user_data(165), node_id, stream_id, time_s, time_f, (VNABlockType) type, frequency, samples);
-
- return buffer_pos;
-}
-
-#endif
-
diff --git a/extern/verse/dist/v_gen_pack_b_node.c b/extern/verse/dist/v_gen_pack_b_node.c
deleted file mode 100644
index a4792a10fe4..00000000000
--- a/extern/verse/dist/v_gen_pack_b_node.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
-** This is automatically generated source code -- do not edit.
-** Changes are affected either by editing the corresponding protocol
-** definition file (v_cmd_def_X.c where X=node type), or by editing
-** the code generator itself, in v_cmd_gen.c.
-*/
-
-#include
-#include
-
-#include "v_cmd_gen.h"
-#if !defined(V_GENERATE_FUNC_MODE)
-#include "verse.h"
-#include "v_cmd_buf.h"
-#include "v_network_out_que.h"
-#include "v_network.h"
-#include "v_connection.h"
-#include "v_util.h"
-
-void verse_send_b_dimensions_set(VNodeID node_id, uint16 width, uint16 height, uint16 depth)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_20);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 80); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_b_dimensions_set(node_id = %u width = %u height = %u depth = %u );\n", node_id, width, height, depth);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], width);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], height);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], depth);
- if(node_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 5);
- else
- v_cmd_buf_set_address_size(head, 5);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_b_dimensions_set(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_b_dimensions_set)(void *user_data, VNodeID node_id, uint16 width, uint16 height, uint16 depth);
- VNodeID node_id;
- uint16 width;
- uint16 height;
- uint16 depth;
-
- func_b_dimensions_set = v_fs_get_user_func(80);
- if(buffer_length < 4)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &width);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &height);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &depth);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_b_dimensions_set(node_id = %u width = %u height = %u depth = %u ); callback = %p\n", node_id, width, height, depth, v_fs_get_user_func(80));
-#endif
- if(func_b_dimensions_set != NULL)
- func_b_dimensions_set(v_fs_get_user_data(80), node_id, width, height, depth);
-
- return buffer_pos;
-}
-
-void verse_send_b_layer_create(VNodeID node_id, VLayerID layer_id, const char *name, VNBLayerType type)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 81); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_b_layer_create(node_id = %u layer_id = %u name = %s type = %u );\n", node_id, layer_id, name, type);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], name, 16);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)type);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_b_layer_destroy(VNodeID node_id, VLayerID layer_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 81); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_b_layer_destroy(node_id = %u layer_id = %u );\n", node_id, layer_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)-1);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_b_layer_create(const char *buf, size_t buffer_length)
-{
- uint8 enum_temp;
- unsigned int buffer_pos = 0;
- void (* func_b_layer_create)(void *user_data, VNodeID node_id, VLayerID layer_id, const char *name, VNBLayerType type);
- VNodeID node_id;
- VLayerID layer_id;
- char name[16];
- VNBLayerType type;
-
- func_b_layer_create = v_fs_get_user_func(81);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], name, 16, buffer_length - buffer_pos);
- if(buffer_length < 1 + buffer_pos)
- return -1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &enum_temp);
- type = (VNBLayerType)enum_temp;
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(name[0] == 0)
- printf("receive: verse_send_b_layer_destroy(node_id = %u layer_id = %u ); callback = %p\n", node_id, layer_id, v_fs_get_alias_user_func(81));
- else
- printf("receive: verse_send_b_layer_create(node_id = %u layer_id = %u name = %s type = %u ); callback = %p\n", node_id, layer_id, name, type, v_fs_get_user_func(81));
-#endif
- if(name[0] == 0)
- {
- void (* alias_b_layer_destroy)(void *user_data, VNodeID node_id, VLayerID layer_id);
- alias_b_layer_destroy = v_fs_get_alias_user_func(81);
- if(alias_b_layer_destroy != NULL)
- alias_b_layer_destroy(v_fs_get_alias_user_data(81), node_id, layer_id);
- return buffer_pos;
- }
- if(func_b_layer_create != NULL)
- func_b_layer_create(v_fs_get_user_data(81), node_id, layer_id, name, (VNBLayerType) type);
-
- return buffer_pos;
-}
-
-void verse_send_b_layer_subscribe(VNodeID node_id, VLayerID layer_id, uint8 level)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 82); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_b_layer_subscribe(node_id = %u layer_id = %u level = %u );\n", node_id, layer_id, level);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], level);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_b_layer_unsubscribe(VNodeID node_id, VLayerID layer_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 82); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_b_layer_unsubscribe(node_id = %u layer_id = %u );\n", node_id, layer_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], -1);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_b_layer_subscribe(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_b_layer_subscribe)(void *user_data, VNodeID node_id, VLayerID layer_id, uint8 level);
- VNodeID node_id;
- VLayerID layer_id;
- uint8 level;
-
- func_b_layer_subscribe = v_fs_get_user_func(82);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &level);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(level == 255)
- printf("receive: verse_send_b_layer_unsubscribe(node_id = %u layer_id = %u ); callback = %p\n", node_id, layer_id, v_fs_get_alias_user_func(82));
- else
- printf("receive: verse_send_b_layer_subscribe(node_id = %u layer_id = %u level = %u ); callback = %p\n", node_id, layer_id, level, v_fs_get_user_func(82));
-#endif
- if(level == 255)
- {
- void (* alias_b_layer_unsubscribe)(void *user_data, VNodeID node_id, VLayerID layer_id);
- alias_b_layer_unsubscribe = v_fs_get_alias_user_func(82);
- if(alias_b_layer_unsubscribe != NULL)
- alias_b_layer_unsubscribe(v_fs_get_alias_user_data(82), node_id, layer_id);
- return buffer_pos;
- }
- if(func_b_layer_subscribe != NULL)
- func_b_layer_subscribe(v_fs_get_user_data(82), node_id, layer_id, level);
-
- return buffer_pos;
-}
-
-#endif
-
diff --git a/extern/verse/dist/v_gen_pack_c_node.c b/extern/verse/dist/v_gen_pack_c_node.c
deleted file mode 100644
index b75fa213383..00000000000
--- a/extern/verse/dist/v_gen_pack_c_node.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
-** This is automatically generated source code -- do not edit.
-** Changes are affected either by editing the corresponding protocol
-** definition file (v_cmd_def_X.c where X=node type), or by editing
-** the code generator itself, in v_cmd_gen.c.
-*/
-
-#include
-#include
-
-#include "v_cmd_gen.h"
-#if !defined(V_GENERATE_FUNC_MODE)
-#include "verse.h"
-#include "v_cmd_buf.h"
-#include "v_network_out_que.h"
-#include "v_network.h"
-#include "v_connection.h"
-#include "v_util.h"
-
-void verse_send_c_curve_create(VNodeID node_id, VLayerID curve_id, const char *name, uint8 dimensions)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 128); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_c_curve_create(node_id = %u curve_id = %u name = %s dimensions = %u );\n", node_id, curve_id, name, dimensions);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], curve_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], name, 16);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], dimensions);
- if(node_id == (uint32) ~0u || curve_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_c_curve_destroy(VNodeID node_id, VLayerID curve_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 128); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_c_curve_destroy(node_id = %u curve_id = %u );\n", node_id, curve_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], curve_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], -1);
- if(node_id == (uint32) ~0u || curve_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_c_curve_create(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_c_curve_create)(void *user_data, VNodeID node_id, VLayerID curve_id, const char *name, uint8 dimensions);
- VNodeID node_id;
- VLayerID curve_id;
- char name[16];
- uint8 dimensions;
-
- func_c_curve_create = v_fs_get_user_func(128);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &curve_id);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], name, 16, buffer_length - buffer_pos);
- if(buffer_length < 1 + buffer_pos)
- return -1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &dimensions);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(name[0] == 0)
- printf("receive: verse_send_c_curve_destroy(node_id = %u curve_id = %u ); callback = %p\n", node_id, curve_id, v_fs_get_alias_user_func(128));
- else
- printf("receive: verse_send_c_curve_create(node_id = %u curve_id = %u name = %s dimensions = %u ); callback = %p\n", node_id, curve_id, name, dimensions, v_fs_get_user_func(128));
-#endif
- if(name[0] == 0)
- {
- void (* alias_c_curve_destroy)(void *user_data, VNodeID node_id, VLayerID curve_id);
- alias_c_curve_destroy = v_fs_get_alias_user_func(128);
- if(alias_c_curve_destroy != NULL)
- alias_c_curve_destroy(v_fs_get_alias_user_data(128), node_id, curve_id);
- return buffer_pos;
- }
- if(func_c_curve_create != NULL)
- func_c_curve_create(v_fs_get_user_data(128), node_id, curve_id, name, dimensions);
-
- return buffer_pos;
-}
-
-void verse_send_c_curve_subscribe(VNodeID node_id, VLayerID curve_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 129); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_c_curve_subscribe(node_id = %u curve_id = %u );\n", node_id, curve_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], curve_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], TRUE);
- if(node_id == (uint32) ~0u || curve_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_c_curve_unsubscribe(VNodeID node_id, VLayerID curve_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 129); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_c_curve_unsubscribe(node_id = %u curve_id = %u );\n", node_id, curve_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], curve_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], FALSE);
- if(node_id == (uint32) ~0u || curve_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_c_curve_subscribe(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_c_curve_subscribe)(void *user_data, VNodeID node_id, VLayerID curve_id);
- VNodeID node_id;
- VLayerID curve_id;
- uint8 alias_bool;
-
- func_c_curve_subscribe = v_fs_get_user_func(129);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &curve_id);
- if(buffer_length < buffer_pos + 1)
- return -1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &alias_bool);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(!alias_bool)
- printf("receive: verse_send_c_curve_unsubscribe(node_id = %u curve_id = %u ); callback = %p\n", node_id, curve_id, v_fs_get_alias_user_func(129));
- else
- printf("receive: verse_send_c_curve_subscribe(node_id = %u curve_id = %u ); callback = %p\n", node_id, curve_id, v_fs_get_user_func(129));
-#endif
- if(!alias_bool)
- {
- void (* alias_c_curve_unsubscribe)(void *user_data, VNodeID node_id, VLayerID curve_id);
- alias_c_curve_unsubscribe = v_fs_get_alias_user_func(129);
- if(alias_c_curve_unsubscribe != NULL)
- alias_c_curve_unsubscribe(v_fs_get_alias_user_data(129), node_id, curve_id);
- return buffer_pos;
- }
- if(func_c_curve_subscribe != NULL)
- func_c_curve_subscribe(v_fs_get_user_data(129), node_id, curve_id);
-
- return buffer_pos;
-}
-
-#endif
-
diff --git a/extern/verse/dist/v_gen_pack_g_node.c b/extern/verse/dist/v_gen_pack_g_node.c
deleted file mode 100644
index 5a70173554d..00000000000
--- a/extern/verse/dist/v_gen_pack_g_node.c
+++ /dev/null
@@ -1,1154 +0,0 @@
-/*
-** This is automatically generated source code -- do not edit.
-** Changes are affected either by editing the corresponding protocol
-** definition file (v_cmd_def_X.c where X=node type), or by editing
-** the code generator itself, in v_cmd_gen.c.
-*/
-
-#include
-#include
-
-#include "v_cmd_gen.h"
-#if !defined(V_GENERATE_FUNC_MODE)
-#include "verse.h"
-#include "v_cmd_buf.h"
-#include "v_network_out_que.h"
-#include "v_network.h"
-#include "v_connection.h"
-#include "v_util.h"
-
-void verse_send_g_layer_create(VNodeID node_id, VLayerID layer_id, const char *name, VNGLayerType type, uint32 def_uint, real64 def_real)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_80);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 48); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_layer_create(node_id = %u layer_id = %u name = %s type = %u def_uint = %u def_real = %f );\n", node_id, layer_id, name, type, def_uint, def_real);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], name, 16);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)type);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], def_uint);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], def_real);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_g_layer_destroy(VNodeID node_id, VLayerID layer_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_80);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 48); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_layer_destroy(node_id = %u layer_id = %u );\n", node_id, layer_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)-1);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], -1);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], V_REAL64_MAX);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_g_layer_create(const char *buf, size_t buffer_length)
-{
- uint8 enum_temp;
- unsigned int buffer_pos = 0;
- void (* func_g_layer_create)(void *user_data, VNodeID node_id, VLayerID layer_id, const char *name, VNGLayerType type, uint32 def_uint, real64 def_real);
- VNodeID node_id;
- VLayerID layer_id;
- char name[16];
- VNGLayerType type;
- uint32 def_uint;
- real64 def_real;
-
- func_g_layer_create = v_fs_get_user_func(48);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], name, 16, buffer_length - buffer_pos);
- if(buffer_length < 13 + buffer_pos)
- return -1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &enum_temp);
- type = (VNGLayerType)enum_temp;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &def_uint);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &def_real);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(name[0] == 0)
- printf("receive: verse_send_g_layer_destroy(node_id = %u layer_id = %u ); callback = %p\n", node_id, layer_id, v_fs_get_alias_user_func(48));
- else
- printf("receive: verse_send_g_layer_create(node_id = %u layer_id = %u name = %s type = %u def_uint = %u def_real = %f ); callback = %p\n", node_id, layer_id, name, type, def_uint, def_real, v_fs_get_user_func(48));
-#endif
- if(name[0] == 0)
- {
- void (* alias_g_layer_destroy)(void *user_data, VNodeID node_id, VLayerID layer_id);
- alias_g_layer_destroy = v_fs_get_alias_user_func(48);
- if(alias_g_layer_destroy != NULL)
- alias_g_layer_destroy(v_fs_get_alias_user_data(48), node_id, layer_id);
- return buffer_pos;
- }
- if(func_g_layer_create != NULL)
- func_g_layer_create(v_fs_get_user_data(48), node_id, layer_id, name, (VNGLayerType) type, def_uint, def_real);
-
- return buffer_pos;
-}
-
-void verse_send_g_layer_subscribe(VNodeID node_id, VLayerID layer_id, VNRealFormat type)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 49); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_layer_subscribe(node_id = %u layer_id = %u type = %u );\n", node_id, layer_id, type);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)type);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_g_layer_unsubscribe(VNodeID node_id, VLayerID layer_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 49); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_layer_unsubscribe(node_id = %u layer_id = %u );\n", node_id, layer_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)-1);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_g_layer_subscribe(const char *buf, size_t buffer_length)
-{
- uint8 enum_temp;
- unsigned int buffer_pos = 0;
- void (* func_g_layer_subscribe)(void *user_data, VNodeID node_id, VLayerID layer_id, VNRealFormat type);
- VNodeID node_id;
- VLayerID layer_id;
- VNRealFormat type;
-
- func_g_layer_subscribe = v_fs_get_user_func(49);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &enum_temp);
- type = (VNRealFormat)enum_temp;
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(type > VN_FORMAT_REAL64)
- printf("receive: verse_send_g_layer_unsubscribe(node_id = %u layer_id = %u ); callback = %p\n", node_id, layer_id, v_fs_get_alias_user_func(49));
- else
- printf("receive: verse_send_g_layer_subscribe(node_id = %u layer_id = %u type = %u ); callback = %p\n", node_id, layer_id, type, v_fs_get_user_func(49));
-#endif
- if(type > VN_FORMAT_REAL64)
- {
- void (* alias_g_layer_unsubscribe)(void *user_data, VNodeID node_id, VLayerID layer_id);
- alias_g_layer_unsubscribe = v_fs_get_alias_user_func(49);
- if(alias_g_layer_unsubscribe != NULL)
- alias_g_layer_unsubscribe(v_fs_get_alias_user_data(49), node_id, layer_id);
- return buffer_pos;
- }
- if(func_g_layer_subscribe != NULL)
- func_g_layer_subscribe(v_fs_get_user_data(49), node_id, layer_id, (VNRealFormat) type);
-
- return buffer_pos;
-}
-
-void verse_send_g_vertex_set_xyz_real32(VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real32 x, real32 y, real32 z)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 50); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_vertex_set_xyz_real32(node_id = %u layer_id = %u vertex_id = %u x = %f y = %f z = %f );\n", node_id, layer_id, vertex_id, x, y, z);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], vertex_id);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], x);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], y);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], z);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || vertex_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 11);
- else
- v_cmd_buf_set_address_size(head, 11);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_g_vertex_delete_real32(VNodeID node_id, uint32 vertex_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 50); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_vertex_delete_real32(node_id = %u vertex_id = %u );\n", node_id, vertex_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], 0);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], vertex_id);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], V_REAL32_MAX);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], V_REAL32_MAX);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], V_REAL32_MAX);
- if(node_id == (uint32) ~0u || vertex_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 11);
- else
- v_cmd_buf_set_address_size(head, 11);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_g_vertex_set_xyz_real32(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_g_vertex_set_xyz_real32)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real32 x, real32 y, real32 z);
- VNodeID node_id;
- VLayerID layer_id;
- uint32 vertex_id;
- real32 x;
- real32 y;
- real32 z;
-
- func_g_vertex_set_xyz_real32 = v_fs_get_user_func(50);
- if(buffer_length < 10)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &vertex_id);
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &x);
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &y);
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &z);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(x == V_REAL32_MAX || y == V_REAL32_MAX || z == V_REAL32_MAX)
- printf("receive: verse_send_g_vertex_delete_real32(node_id = %u vertex_id = %u ); callback = %p\n", node_id, vertex_id, v_fs_get_alias_user_func(50));
- else
- printf("receive: verse_send_g_vertex_set_xyz_real32(node_id = %u layer_id = %u vertex_id = %u x = %f y = %f z = %f ); callback = %p\n", node_id, layer_id, vertex_id, x, y, z, v_fs_get_user_func(50));
-#endif
- if(x == V_REAL32_MAX || y == V_REAL32_MAX || z == V_REAL32_MAX)
- {
- void (* alias_g_vertex_delete_real32)(void *user_data, VNodeID node_id, uint32 vertex_id);
- alias_g_vertex_delete_real32 = v_fs_get_alias_user_func(50);
- if(alias_g_vertex_delete_real32 != NULL)
- alias_g_vertex_delete_real32(v_fs_get_alias_user_data(50), node_id, vertex_id);
- return buffer_pos;
- }
- if(func_g_vertex_set_xyz_real32 != NULL)
- func_g_vertex_set_xyz_real32(v_fs_get_user_data(50), node_id, layer_id, vertex_id, x, y, z);
-
- return buffer_pos;
-}
-
-void verse_send_g_vertex_set_xyz_real64(VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real64 x, real64 y, real64 z)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_80);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 51); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_vertex_set_xyz_real64(node_id = %u layer_id = %u vertex_id = %u x = %f y = %f z = %f );\n", node_id, layer_id, vertex_id, x, y, z);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], vertex_id);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], x);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], y);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], z);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || vertex_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 11);
- else
- v_cmd_buf_set_address_size(head, 11);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_g_vertex_delete_real64(VNodeID node_id, uint32 vertex_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_80);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 51); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_vertex_delete_real64(node_id = %u vertex_id = %u );\n", node_id, vertex_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], 0);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], vertex_id);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], V_REAL64_MAX);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], V_REAL64_MAX);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], V_REAL64_MAX);
- if(node_id == (uint32) ~0u || vertex_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 11);
- else
- v_cmd_buf_set_address_size(head, 11);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_g_vertex_set_xyz_real64(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_g_vertex_set_xyz_real64)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real64 x, real64 y, real64 z);
- VNodeID node_id;
- VLayerID layer_id;
- uint32 vertex_id;
- real64 x;
- real64 y;
- real64 z;
-
- func_g_vertex_set_xyz_real64 = v_fs_get_user_func(51);
- if(buffer_length < 10)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &vertex_id);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &x);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &y);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &z);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(x == V_REAL64_MAX || y == V_REAL64_MAX || z == V_REAL64_MAX)
- printf("receive: verse_send_g_vertex_delete_real64(node_id = %u vertex_id = %u ); callback = %p\n", node_id, vertex_id, v_fs_get_alias_user_func(51));
- else
- printf("receive: verse_send_g_vertex_set_xyz_real64(node_id = %u layer_id = %u vertex_id = %u x = %f y = %f z = %f ); callback = %p\n", node_id, layer_id, vertex_id, x, y, z, v_fs_get_user_func(51));
-#endif
- if(x == V_REAL64_MAX || y == V_REAL64_MAX || z == V_REAL64_MAX)
- {
- void (* alias_g_vertex_delete_real64)(void *user_data, VNodeID node_id, uint32 vertex_id);
- alias_g_vertex_delete_real64 = v_fs_get_alias_user_func(51);
- if(alias_g_vertex_delete_real64 != NULL)
- alias_g_vertex_delete_real64(v_fs_get_alias_user_data(51), node_id, vertex_id);
- return buffer_pos;
- }
- if(func_g_vertex_set_xyz_real64 != NULL)
- func_g_vertex_set_xyz_real64(v_fs_get_user_data(51), node_id, layer_id, vertex_id, x, y, z);
-
- return buffer_pos;
-}
-
-void verse_send_g_vertex_set_uint32(VNodeID node_id, VLayerID layer_id, uint32 vertex_id, uint32 value)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_20);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 52); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_vertex_set_uint32(node_id = %u layer_id = %u vertex_id = %u value = %u );\n", node_id, layer_id, vertex_id, value);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], vertex_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], value);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || vertex_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 11);
- else
- v_cmd_buf_set_address_size(head, 11);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_g_vertex_set_uint32(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_g_vertex_set_uint32)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 vertex_id, uint32 value);
- VNodeID node_id;
- VLayerID layer_id;
- uint32 vertex_id;
- uint32 value;
-
- func_g_vertex_set_uint32 = v_fs_get_user_func(52);
- if(buffer_length < 10)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &vertex_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &value);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_g_vertex_set_uint32(node_id = %u layer_id = %u vertex_id = %u value = %u ); callback = %p\n", node_id, layer_id, vertex_id, value, v_fs_get_user_func(52));
-#endif
- if(func_g_vertex_set_uint32 != NULL)
- func_g_vertex_set_uint32(v_fs_get_user_data(52), node_id, layer_id, vertex_id, value);
-
- return buffer_pos;
-}
-
-void verse_send_g_vertex_set_real64(VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real64 value)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_20);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 53); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_vertex_set_real64(node_id = %u layer_id = %u vertex_id = %u value = %f );\n", node_id, layer_id, vertex_id, value);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], vertex_id);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], value);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || vertex_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 11);
- else
- v_cmd_buf_set_address_size(head, 11);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_g_vertex_set_real64(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_g_vertex_set_real64)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real64 value);
- VNodeID node_id;
- VLayerID layer_id;
- uint32 vertex_id;
- real64 value;
-
- func_g_vertex_set_real64 = v_fs_get_user_func(53);
- if(buffer_length < 10)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &vertex_id);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &value);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_g_vertex_set_real64(node_id = %u layer_id = %u vertex_id = %u value = %f ); callback = %p\n", node_id, layer_id, vertex_id, value, v_fs_get_user_func(53));
-#endif
- if(func_g_vertex_set_real64 != NULL)
- func_g_vertex_set_real64(v_fs_get_user_data(53), node_id, layer_id, vertex_id, value);
-
- return buffer_pos;
-}
-
-void verse_send_g_vertex_set_real32(VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real32 value)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_20);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 54); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_vertex_set_real32(node_id = %u layer_id = %u vertex_id = %u value = %f );\n", node_id, layer_id, vertex_id, value);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], vertex_id);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], value);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || vertex_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 11);
- else
- v_cmd_buf_set_address_size(head, 11);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_g_vertex_set_real32(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_g_vertex_set_real32)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real32 value);
- VNodeID node_id;
- VLayerID layer_id;
- uint32 vertex_id;
- real32 value;
-
- func_g_vertex_set_real32 = v_fs_get_user_func(54);
- if(buffer_length < 10)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &vertex_id);
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &value);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_g_vertex_set_real32(node_id = %u layer_id = %u vertex_id = %u value = %f ); callback = %p\n", node_id, layer_id, vertex_id, value, v_fs_get_user_func(54));
-#endif
- if(func_g_vertex_set_real32 != NULL)
- func_g_vertex_set_real32(v_fs_get_user_data(54), node_id, layer_id, vertex_id, value);
-
- return buffer_pos;
-}
-
-void verse_send_g_polygon_set_corner_uint32(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint32 v0, uint32 v1, uint32 v2, uint32 v3)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 55); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_polygon_set_corner_uint32(node_id = %u layer_id = %u polygon_id = %u v0 = %u v1 = %u v2 = %u v3 = %u );\n", node_id, layer_id, polygon_id, v0, v1, v2, v3);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], polygon_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], v0);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], v1);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], v2);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], v3);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || polygon_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 11);
- else
- v_cmd_buf_set_address_size(head, 11);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_g_polygon_delete(VNodeID node_id, uint32 polygon_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 55); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_polygon_delete(node_id = %u polygon_id = %u );\n", node_id, polygon_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], 1);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], polygon_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], -1);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], -1);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], -1);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], -1);
- if(node_id == (uint32) ~0u || polygon_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 11);
- else
- v_cmd_buf_set_address_size(head, 11);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_g_polygon_set_corner_uint32(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_g_polygon_set_corner_uint32)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint32 v0, uint32 v1, uint32 v2, uint32 v3);
- VNodeID node_id;
- VLayerID layer_id;
- uint32 polygon_id;
- uint32 v0;
- uint32 v1;
- uint32 v2;
- uint32 v3;
-
- func_g_polygon_set_corner_uint32 = v_fs_get_user_func(55);
- if(buffer_length < 10)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &polygon_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &v0);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &v1);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &v2);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &v3);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(layer_id == 1 && v0 == ~0u)
- printf("receive: verse_send_g_polygon_delete(node_id = %u polygon_id = %u ); callback = %p\n", node_id, polygon_id, v_fs_get_alias_user_func(55));
- else
- printf("receive: verse_send_g_polygon_set_corner_uint32(node_id = %u layer_id = %u polygon_id = %u v0 = %u v1 = %u v2 = %u v3 = %u ); callback = %p\n", node_id, layer_id, polygon_id, v0, v1, v2, v3, v_fs_get_user_func(55));
-#endif
- if(layer_id == 1 && v0 == ~0u)
- {
- void (* alias_g_polygon_delete)(void *user_data, VNodeID node_id, uint32 polygon_id);
- alias_g_polygon_delete = v_fs_get_alias_user_func(55);
- if(alias_g_polygon_delete != NULL)
- alias_g_polygon_delete(v_fs_get_alias_user_data(55), node_id, polygon_id);
- return buffer_pos;
- }
- if(func_g_polygon_set_corner_uint32 != NULL)
- func_g_polygon_set_corner_uint32(v_fs_get_user_data(55), node_id, layer_id, polygon_id, v0, v1, v2, v3);
-
- return buffer_pos;
-}
-
-void verse_send_g_polygon_set_corner_real64(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real64 v0, real64 v1, real64 v2, real64 v3)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_80);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 56); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_polygon_set_corner_real64(node_id = %u layer_id = %u polygon_id = %u v0 = %f v1 = %f v2 = %f v3 = %f );\n", node_id, layer_id, polygon_id, v0, v1, v2, v3);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], polygon_id);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], v0);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], v1);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], v2);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], v3);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || polygon_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 11);
- else
- v_cmd_buf_set_address_size(head, 11);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_g_polygon_set_corner_real64(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_g_polygon_set_corner_real64)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real64 v0, real64 v1, real64 v2, real64 v3);
- VNodeID node_id;
- VLayerID layer_id;
- uint32 polygon_id;
- real64 v0;
- real64 v1;
- real64 v2;
- real64 v3;
-
- func_g_polygon_set_corner_real64 = v_fs_get_user_func(56);
- if(buffer_length < 10)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &polygon_id);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &v0);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &v1);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &v2);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &v3);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_g_polygon_set_corner_real64(node_id = %u layer_id = %u polygon_id = %u v0 = %f v1 = %f v2 = %f v3 = %f ); callback = %p\n", node_id, layer_id, polygon_id, v0, v1, v2, v3, v_fs_get_user_func(56));
-#endif
- if(func_g_polygon_set_corner_real64 != NULL)
- func_g_polygon_set_corner_real64(v_fs_get_user_data(56), node_id, layer_id, polygon_id, v0, v1, v2, v3);
-
- return buffer_pos;
-}
-
-void verse_send_g_polygon_set_corner_real32(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real32 v0, real32 v1, real32 v2, real32 v3)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 57); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_polygon_set_corner_real32(node_id = %u layer_id = %u polygon_id = %u v0 = %f v1 = %f v2 = %f v3 = %f );\n", node_id, layer_id, polygon_id, v0, v1, v2, v3);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], polygon_id);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], v0);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], v1);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], v2);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], v3);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || polygon_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 11);
- else
- v_cmd_buf_set_address_size(head, 11);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_g_polygon_set_corner_real32(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_g_polygon_set_corner_real32)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real32 v0, real32 v1, real32 v2, real32 v3);
- VNodeID node_id;
- VLayerID layer_id;
- uint32 polygon_id;
- real32 v0;
- real32 v1;
- real32 v2;
- real32 v3;
-
- func_g_polygon_set_corner_real32 = v_fs_get_user_func(57);
- if(buffer_length < 10)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &polygon_id);
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &v0);
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &v1);
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &v2);
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &v3);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_g_polygon_set_corner_real32(node_id = %u layer_id = %u polygon_id = %u v0 = %f v1 = %f v2 = %f v3 = %f ); callback = %p\n", node_id, layer_id, polygon_id, v0, v1, v2, v3, v_fs_get_user_func(57));
-#endif
- if(func_g_polygon_set_corner_real32 != NULL)
- func_g_polygon_set_corner_real32(v_fs_get_user_data(57), node_id, layer_id, polygon_id, v0, v1, v2, v3);
-
- return buffer_pos;
-}
-
-void verse_send_g_polygon_set_face_uint8(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint8 value)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_20);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 58); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_polygon_set_face_uint8(node_id = %u layer_id = %u polygon_id = %u value = %u );\n", node_id, layer_id, polygon_id, value);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], polygon_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], value);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || polygon_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 11);
- else
- v_cmd_buf_set_address_size(head, 11);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_g_polygon_set_face_uint8(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_g_polygon_set_face_uint8)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint8 value);
- VNodeID node_id;
- VLayerID layer_id;
- uint32 polygon_id;
- uint8 value;
-
- func_g_polygon_set_face_uint8 = v_fs_get_user_func(58);
- if(buffer_length < 10)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &polygon_id);
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &value);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_g_polygon_set_face_uint8(node_id = %u layer_id = %u polygon_id = %u value = %u ); callback = %p\n", node_id, layer_id, polygon_id, value, v_fs_get_user_func(58));
-#endif
- if(func_g_polygon_set_face_uint8 != NULL)
- func_g_polygon_set_face_uint8(v_fs_get_user_data(58), node_id, layer_id, polygon_id, value);
-
- return buffer_pos;
-}
-
-void verse_send_g_polygon_set_face_uint32(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint32 value)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_20);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 59); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_polygon_set_face_uint32(node_id = %u layer_id = %u polygon_id = %u value = %u );\n", node_id, layer_id, polygon_id, value);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], polygon_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], value);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || polygon_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 11);
- else
- v_cmd_buf_set_address_size(head, 11);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_g_polygon_set_face_uint32(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_g_polygon_set_face_uint32)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint32 value);
- VNodeID node_id;
- VLayerID layer_id;
- uint32 polygon_id;
- uint32 value;
-
- func_g_polygon_set_face_uint32 = v_fs_get_user_func(59);
- if(buffer_length < 10)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &polygon_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &value);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_g_polygon_set_face_uint32(node_id = %u layer_id = %u polygon_id = %u value = %u ); callback = %p\n", node_id, layer_id, polygon_id, value, v_fs_get_user_func(59));
-#endif
- if(func_g_polygon_set_face_uint32 != NULL)
- func_g_polygon_set_face_uint32(v_fs_get_user_data(59), node_id, layer_id, polygon_id, value);
-
- return buffer_pos;
-}
-
-void verse_send_g_polygon_set_face_real64(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real64 value)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_20);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 60); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_polygon_set_face_real64(node_id = %u layer_id = %u polygon_id = %u value = %f );\n", node_id, layer_id, polygon_id, value);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], polygon_id);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], value);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || polygon_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 11);
- else
- v_cmd_buf_set_address_size(head, 11);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_g_polygon_set_face_real64(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_g_polygon_set_face_real64)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real64 value);
- VNodeID node_id;
- VLayerID layer_id;
- uint32 polygon_id;
- real64 value;
-
- func_g_polygon_set_face_real64 = v_fs_get_user_func(60);
- if(buffer_length < 10)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &polygon_id);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &value);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_g_polygon_set_face_real64(node_id = %u layer_id = %u polygon_id = %u value = %f ); callback = %p\n", node_id, layer_id, polygon_id, value, v_fs_get_user_func(60));
-#endif
- if(func_g_polygon_set_face_real64 != NULL)
- func_g_polygon_set_face_real64(v_fs_get_user_data(60), node_id, layer_id, polygon_id, value);
-
- return buffer_pos;
-}
-
-void verse_send_g_polygon_set_face_real32(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real32 value)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_20);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 61); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_polygon_set_face_real32(node_id = %u layer_id = %u polygon_id = %u value = %f );\n", node_id, layer_id, polygon_id, value);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], polygon_id);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], value);
- if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || polygon_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 11);
- else
- v_cmd_buf_set_address_size(head, 11);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_g_polygon_set_face_real32(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_g_polygon_set_face_real32)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real32 value);
- VNodeID node_id;
- VLayerID layer_id;
- uint32 polygon_id;
- real32 value;
-
- func_g_polygon_set_face_real32 = v_fs_get_user_func(61);
- if(buffer_length < 10)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &polygon_id);
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &value);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_g_polygon_set_face_real32(node_id = %u layer_id = %u polygon_id = %u value = %f ); callback = %p\n", node_id, layer_id, polygon_id, value, v_fs_get_user_func(61));
-#endif
- if(func_g_polygon_set_face_real32 != NULL)
- func_g_polygon_set_face_real32(v_fs_get_user_data(61), node_id, layer_id, polygon_id, value);
-
- return buffer_pos;
-}
-
-void verse_send_g_crease_set_vertex(VNodeID node_id, const char *layer, uint32 def_crease)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 62); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_crease_set_vertex(node_id = %u layer = %s def_crease = %u );\n", node_id, layer, def_crease);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], layer, 16);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], def_crease);
- if(node_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 5);
- else
- v_cmd_buf_set_address_size(head, 5);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_g_crease_set_vertex(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_g_crease_set_vertex)(void *user_data, VNodeID node_id, const char *layer, uint32 def_crease);
- VNodeID node_id;
- char layer[16];
- uint32 def_crease;
-
- func_g_crease_set_vertex = v_fs_get_user_func(62);
- if(buffer_length < 4)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], layer, 16, buffer_length - buffer_pos);
- if(buffer_length < 4 + buffer_pos)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &def_crease);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_g_crease_set_vertex(node_id = %u layer = %s def_crease = %u ); callback = %p\n", node_id, layer, def_crease, v_fs_get_user_func(62));
-#endif
- if(func_g_crease_set_vertex != NULL)
- func_g_crease_set_vertex(v_fs_get_user_data(62), node_id, layer, def_crease);
-
- return buffer_pos;
-}
-
-void verse_send_g_crease_set_edge(VNodeID node_id, const char *layer, uint32 def_crease)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 63); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_crease_set_edge(node_id = %u layer = %s def_crease = %u );\n", node_id, layer, def_crease);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], layer, 16);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], def_crease);
- if(node_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 5);
- else
- v_cmd_buf_set_address_size(head, 5);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_g_crease_set_edge(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_g_crease_set_edge)(void *user_data, VNodeID node_id, const char *layer, uint32 def_crease);
- VNodeID node_id;
- char layer[16];
- uint32 def_crease;
-
- func_g_crease_set_edge = v_fs_get_user_func(63);
- if(buffer_length < 4)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], layer, 16, buffer_length - buffer_pos);
- if(buffer_length < 4 + buffer_pos)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &def_crease);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_g_crease_set_edge(node_id = %u layer = %s def_crease = %u ); callback = %p\n", node_id, layer, def_crease, v_fs_get_user_func(63));
-#endif
- if(func_g_crease_set_edge != NULL)
- func_g_crease_set_edge(v_fs_get_user_data(63), node_id, layer, def_crease);
-
- return buffer_pos;
-}
-
-void verse_send_g_bone_create(VNodeID node_id, uint16 bone_id, const char *weight, const char *reference, uint16 parent, real64 pos_x, real64 pos_y, real64 pos_z, const char *position_label, const char *rotation_label, const char *scale_label)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_160);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 64); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_bone_create(node_id = %u bone_id = %u weight = %s reference = %s parent = %u pos_x = %f pos_y = %f pos_z = %f position_label = %s rotation_label = %s scale_label = %s );\n", node_id, bone_id, weight, reference, parent, pos_x, pos_y, pos_z, position_label, rotation_label, scale_label);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], bone_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], weight, 16);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], reference, 16);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], parent);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], pos_x);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], pos_y);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], pos_z);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], position_label, 16);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], rotation_label, 16);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], scale_label, 16);
- if(node_id == (uint32) ~0u || bone_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_g_bone_destroy(VNodeID node_id, uint16 bone_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_160);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 64); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_g_bone_destroy(node_id = %u bone_id = %u );\n", node_id, bone_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], bone_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], -1);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], V_REAL64_MAX);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], V_REAL64_MAX);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], V_REAL64_MAX);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
- if(node_id == (uint32) ~0u || bone_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_g_bone_create(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_g_bone_create)(void *user_data, VNodeID node_id, uint16 bone_id, const char *weight, const char *reference, uint16 parent, real64 pos_x, real64 pos_y, real64 pos_z, const char *position_label, const char *rotation_label, const char *scale_label);
- VNodeID node_id;
- uint16 bone_id;
- char weight[16];
- char reference[16];
- uint16 parent;
- real64 pos_x;
- real64 pos_y;
- real64 pos_z;
- char position_label[16];
- char rotation_label[16];
- char scale_label[16];
-
- func_g_bone_create = v_fs_get_user_func(64);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &bone_id);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], weight, 16, buffer_length - buffer_pos);
- if(buffer_length < 0 + buffer_pos)
- return -1;
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], reference, 16, buffer_length - buffer_pos);
- if(buffer_length < 26 + buffer_pos)
- return -1;
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &parent);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &pos_x);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &pos_y);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &pos_z);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], position_label, 16, buffer_length - buffer_pos);
- if(buffer_length < 0 + buffer_pos)
- return -1;
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], rotation_label, 16, buffer_length - buffer_pos);
- if(buffer_length < 0 + buffer_pos)
- return -1;
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], scale_label, 16, buffer_length - buffer_pos);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(weight[0] == 0)
- printf("receive: verse_send_g_bone_destroy(node_id = %u bone_id = %u ); callback = %p\n", node_id, bone_id, v_fs_get_alias_user_func(64));
- else
- printf("receive: verse_send_g_bone_create(node_id = %u bone_id = %u weight = %s reference = %s parent = %u pos_x = %f pos_y = %f pos_z = %f position_label = %s rotation_label = %s scale_label = %s ); callback = %p\n", node_id, bone_id, weight, reference, parent, pos_x, pos_y, pos_z, position_label, rotation_label, scale_label, v_fs_get_user_func(64));
-#endif
- if(weight[0] == 0)
- {
- void (* alias_g_bone_destroy)(void *user_data, VNodeID node_id, uint16 bone_id);
- alias_g_bone_destroy = v_fs_get_alias_user_func(64);
- if(alias_g_bone_destroy != NULL)
- alias_g_bone_destroy(v_fs_get_alias_user_data(64), node_id, bone_id);
- return buffer_pos;
- }
- if(func_g_bone_create != NULL)
- func_g_bone_create(v_fs_get_user_data(64), node_id, bone_id, weight, reference, parent, pos_x, pos_y, pos_z, position_label, rotation_label, scale_label);
-
- return buffer_pos;
-}
-
-#endif
-
diff --git a/extern/verse/dist/v_gen_pack_init.c b/extern/verse/dist/v_gen_pack_init.c
deleted file mode 100644
index e568cb989cb..00000000000
--- a/extern/verse/dist/v_gen_pack_init.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-** This is automatically generated source code -- do not edit.
-** Changes are affected either by editing the corresponding protocol
-** definition file (v_cmd_def_X.c where X=node type), or by editing
-** the code generator itself, in v_cmd_gen.c.
-*/
-
-#include
-#include
-
-#include "v_cmd_gen.h"
-#if !defined(V_GENERATE_FUNC_MODE)
-#include "verse.h"
-#include "v_cmd_buf.h"
-#include "v_network_out_que.h"
-#include "v_network.h"
-#include "v_connection.h"
-#include "v_util.h"
-
-#include "v_gen_unpack_func.h"
-
-#include "verse.h"
-
-
-extern void verse_send_packet_ack(uint32 packet_id);
-extern void verse_send_packet_nak(uint32 packet_id);
-
-void init_pack_and_unpack(void)
-{
- v_fs_add_func(0, v_unpack_connect, (void *) verse_send_connect, NULL);
- v_fs_add_func(1, v_unpack_connect_accept, (void *) verse_send_connect_accept, NULL);
- v_fs_add_func(2, v_unpack_connect_terminate, (void *) verse_send_connect_terminate, NULL);
- v_fs_add_func(5, v_unpack_ping, (void *) verse_send_ping, NULL);
- v_fs_add_func(7, v_unpack_packet_ack, verse_send_packet_ack, NULL);
- v_fs_add_func(8, v_unpack_packet_nak, verse_send_packet_nak, NULL);
- v_fs_add_func(9, v_unpack_node_index_subscribe, verse_send_node_index_subscribe, NULL);
- v_fs_add_func(10, v_unpack_node_create, verse_send_node_create, verse_send_node_destroy);
- v_fs_add_func(11, v_unpack_node_subscribe, verse_send_node_subscribe, verse_send_node_unsubscribe);
- v_fs_add_func(16, v_unpack_tag_group_create, verse_send_tag_group_create, verse_send_tag_group_destroy);
- v_fs_add_func(17, v_unpack_tag_group_subscribe, verse_send_tag_group_subscribe, verse_send_tag_group_unsubscribe);
- v_fs_add_func(18, v_unpack_tag_create, verse_send_tag_create, verse_send_tag_destroy);
- v_fs_add_func(19, v_unpack_node_name_set, verse_send_node_name_set, NULL);
- v_fs_add_func(32, v_unpack_o_transform_pos_real32, verse_send_o_transform_pos_real32, NULL);
- v_fs_add_func(33, v_unpack_o_transform_rot_real32, verse_send_o_transform_rot_real32, NULL);
- v_fs_add_func(34, v_unpack_o_transform_scale_real32, verse_send_o_transform_scale_real32, NULL);
- v_fs_add_func(35, v_unpack_o_transform_pos_real64, verse_send_o_transform_pos_real64, NULL);
- v_fs_add_func(36, v_unpack_o_transform_rot_real64, verse_send_o_transform_rot_real64, NULL);
- v_fs_add_func(37, v_unpack_o_transform_scale_real64, verse_send_o_transform_scale_real64, NULL);
- v_fs_add_func(38, v_unpack_o_transform_subscribe, verse_send_o_transform_subscribe, verse_send_o_transform_unsubscribe);
- v_fs_add_func(39, v_unpack_o_light_set, verse_send_o_light_set, NULL);
- v_fs_add_func(40, v_unpack_o_link_set, verse_send_o_link_set, verse_send_o_link_destroy);
- v_fs_add_func(41, v_unpack_o_method_group_create, verse_send_o_method_group_create, verse_send_o_method_group_destroy);
- v_fs_add_func(42, v_unpack_o_method_group_subscribe, verse_send_o_method_group_subscribe, verse_send_o_method_group_unsubscribe);
- v_fs_add_func(43, v_unpack_o_method_create, verse_send_o_method_create, verse_send_o_method_destroy);
- v_fs_add_func(44, v_unpack_o_method_call, verse_send_o_method_call, NULL);
- v_fs_add_func(45, v_unpack_o_anim_run, verse_send_o_anim_run, NULL);
- v_fs_add_func(46, v_unpack_o_hide, verse_send_o_hide, NULL);
- v_fs_add_func(48, v_unpack_g_layer_create, verse_send_g_layer_create, verse_send_g_layer_destroy);
- v_fs_add_func(49, v_unpack_g_layer_subscribe, verse_send_g_layer_subscribe, verse_send_g_layer_unsubscribe);
- v_fs_add_func(50, v_unpack_g_vertex_set_xyz_real32, verse_send_g_vertex_set_xyz_real32, verse_send_g_vertex_delete_real32);
- v_fs_add_func(51, v_unpack_g_vertex_set_xyz_real64, verse_send_g_vertex_set_xyz_real64, verse_send_g_vertex_delete_real64);
- v_fs_add_func(52, v_unpack_g_vertex_set_uint32, verse_send_g_vertex_set_uint32, NULL);
- v_fs_add_func(53, v_unpack_g_vertex_set_real64, verse_send_g_vertex_set_real64, NULL);
- v_fs_add_func(54, v_unpack_g_vertex_set_real32, verse_send_g_vertex_set_real32, NULL);
- v_fs_add_func(55, v_unpack_g_polygon_set_corner_uint32, verse_send_g_polygon_set_corner_uint32, verse_send_g_polygon_delete);
- v_fs_add_func(56, v_unpack_g_polygon_set_corner_real64, verse_send_g_polygon_set_corner_real64, NULL);
- v_fs_add_func(57, v_unpack_g_polygon_set_corner_real32, verse_send_g_polygon_set_corner_real32, NULL);
- v_fs_add_func(58, v_unpack_g_polygon_set_face_uint8, verse_send_g_polygon_set_face_uint8, NULL);
- v_fs_add_func(59, v_unpack_g_polygon_set_face_uint32, verse_send_g_polygon_set_face_uint32, NULL);
- v_fs_add_func(60, v_unpack_g_polygon_set_face_real64, verse_send_g_polygon_set_face_real64, NULL);
- v_fs_add_func(61, v_unpack_g_polygon_set_face_real32, verse_send_g_polygon_set_face_real32, NULL);
- v_fs_add_func(62, v_unpack_g_crease_set_vertex, verse_send_g_crease_set_vertex, NULL);
- v_fs_add_func(63, v_unpack_g_crease_set_edge, verse_send_g_crease_set_edge, NULL);
- v_fs_add_func(64, v_unpack_g_bone_create, verse_send_g_bone_create, verse_send_g_bone_destroy);
- v_fs_add_func(68, v_unpack_m_fragment_create, verse_send_m_fragment_create, verse_send_m_fragment_destroy);
- v_fs_add_func(80, v_unpack_b_dimensions_set, verse_send_b_dimensions_set, NULL);
- v_fs_add_func(81, v_unpack_b_layer_create, verse_send_b_layer_create, verse_send_b_layer_destroy);
- v_fs_add_func(82, v_unpack_b_layer_subscribe, verse_send_b_layer_subscribe, verse_send_b_layer_unsubscribe);
- v_fs_add_func(83, v_unpack_b_tile_set, (void *) verse_send_b_tile_set, NULL);
- v_fs_add_func(96, v_unpack_t_language_set, verse_send_t_language_set, NULL);
- v_fs_add_func(97, v_unpack_t_buffer_create, verse_send_t_buffer_create, verse_send_t_buffer_destroy);
- v_fs_add_func(98, v_unpack_t_buffer_subscribe, verse_send_t_buffer_subscribe, verse_send_t_buffer_unsubscribe);
- v_fs_add_func(99, v_unpack_t_text_set, (void *) verse_send_t_text_set, NULL);
- v_fs_add_func(128, v_unpack_c_curve_create, verse_send_c_curve_create, verse_send_c_curve_destroy);
- v_fs_add_func(129, v_unpack_c_curve_subscribe, verse_send_c_curve_subscribe, verse_send_c_curve_unsubscribe);
- v_fs_add_func(130, v_unpack_c_key_set, (void *) verse_send_c_key_set, (void *) verse_send_c_key_destroy);
- v_fs_add_func(160, v_unpack_a_buffer_create, verse_send_a_buffer_create, verse_send_a_buffer_destroy);
- v_fs_add_func(161, v_unpack_a_buffer_subscribe, verse_send_a_buffer_subscribe, verse_send_a_buffer_unsubscribe);
- v_fs_add_func(162, v_unpack_a_block_set, verse_send_a_block_set, verse_send_a_block_clear);
- v_fs_add_func(163, v_unpack_a_stream_create, verse_send_a_stream_create, verse_send_a_stream_destroy);
- v_fs_add_func(164, v_unpack_a_stream_subscribe, verse_send_a_stream_subscribe, verse_send_a_stream_unsubscribe);
- v_fs_add_func(165, v_unpack_a_stream, verse_send_a_stream, NULL);
-}
-#endif
-
diff --git a/extern/verse/dist/v_gen_pack_m_node.c b/extern/verse/dist/v_gen_pack_m_node.c
deleted file mode 100644
index 376b6c51c39..00000000000
--- a/extern/verse/dist/v_gen_pack_m_node.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
-** This is automatically generated source code -- do not edit.
-** Changes are affected either by editing the corresponding protocol
-** definition file (v_cmd_def_X.c where X=node type), or by editing
-** the code generator itself, in v_cmd_gen.c.
-*/
-
-#include
-#include
-
-#include "v_cmd_gen.h"
-#if !defined(V_GENERATE_FUNC_MODE)
-#include "verse.h"
-#include "v_cmd_buf.h"
-#include "v_network_out_que.h"
-#include "v_network.h"
-#include "v_connection.h"
-#include "v_util.h"
-
-void verse_send_m_fragment_create(VNodeID node_id, VNMFragmentID frag_id, VNMFragmentType type, const VMatFrag *fragment)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 68); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_m_fragment_create(node_id = %u frag_id = %u type = %u fragment = %p );\n", node_id, frag_id, type, fragment);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], frag_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)type);
- switch(type)
- {
- case VN_M_FT_COLOR :
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->color.red);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->color.green);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->color.blue);
- break;
- case VN_M_FT_LIGHT :
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)fragment->light.type);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->light.normal_falloff);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], fragment->light.brdf);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->light.brdf_r, 16);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->light.brdf_g, 16);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->light.brdf_b, 16);
- break;
- case VN_M_FT_REFLECTION :
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->reflection.normal_falloff);
- break;
- case VN_M_FT_TRANSPARENCY :
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->transparency.normal_falloff);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->transparency.refraction_index);
- break;
- case VN_M_FT_GEOMETRY :
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->geometry.layer_r, 16);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->geometry.layer_g, 16);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->geometry.layer_b, 16);
- break;
- case VN_M_FT_VOLUME :
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->volume.diffusion);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->volume.col_r);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->volume.col_g);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->volume.col_b);
- break;
- case VN_M_FT_VIEW :
- break;
- case VN_M_FT_TEXTURE :
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], fragment->texture.bitmap);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->texture.layer_r, 16);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->texture.layer_g, 16);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->texture.layer_b, 16);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)fragment->texture.filtered);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->texture.mapping);
- break;
- case VN_M_FT_NOISE :
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)fragment->noise.type);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->noise.mapping);
- break;
- case VN_M_FT_BLENDER :
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)fragment->blender.type);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->blender.data_a);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->blender.data_b);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->blender.control);
- break;
- case VN_M_FT_CLAMP :
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)fragment->clamp.min);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->clamp.red);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->clamp.green);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->clamp.blue);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->clamp.data);
- break;
- case VN_M_FT_MATRIX :
- {
- unsigned int i;
- for(i = 0; i < 16; i++)
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->matrix.matrix[i]);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->matrix.data);
- }
- break;
- case VN_M_FT_RAMP :
- if(fragment->ramp.point_count == 0)
- return;
- {
- unsigned int i, pos;
- double last;
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)fragment->ramp.type);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)fragment->ramp.channel);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->ramp.mapping);
- pos = buffer_pos;
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], fragment->ramp.point_count);
- last = fragment->ramp.ramp[0].pos - 1;
- for(i = 0; i < fragment->ramp.point_count && fragment->ramp.ramp[i].pos > last && i < 48; i++)
- {
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->ramp.ramp[i].pos);
- last = fragment->ramp.ramp[i].pos;
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->ramp.ramp[i].red);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->ramp.ramp[i].green);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], fragment->ramp.ramp[i].blue);
- }
- if(i != fragment->ramp.point_count)
- vnp_raw_pack_uint8(&buf[pos], i);
- }
- break;
- case VN_M_FT_ANIMATION :
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->animation.label, 16);
- break;
- case VN_M_FT_ALTERNATIVE :
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->alternative.alt_a);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->alternative.alt_b);
- break;
- case VN_M_FT_OUTPUT :
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], fragment->output.label, 16);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->output.front);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], fragment->output.back);
- break;
- }
- if(node_id == (uint32) ~0u || frag_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_m_fragment_destroy(VNodeID node_id, VNMFragmentID frag_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 68); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_m_fragment_destroy(node_id = %u frag_id = %u );\n", node_id, frag_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], frag_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)-1);
- if(node_id == (uint32) ~0u || frag_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_m_fragment_create(const char *buf, size_t buffer_length)
-{
- uint8 enum_temp;
- unsigned int buffer_pos = 0;
- void (* func_m_fragment_create)(void *user_data, VNodeID node_id, VNMFragmentID frag_id, VNMFragmentType type, const VMatFrag *fragment);
- VNodeID node_id;
- VNMFragmentID frag_id;
- VNMFragmentType type;
- const VMatFrag *fragment;
-
- func_m_fragment_create = v_fs_get_user_func(68);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag_id);
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &enum_temp);
- type = (VNMFragmentType)enum_temp;
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(type > VN_M_FT_OUTPUT)
- printf("receive: verse_send_m_fragment_destroy(node_id = %u frag_id = %u ); callback = %p\n", node_id, frag_id, v_fs_get_alias_user_func(68));
- else
- printf("receive: verse_send_m_fragment_create(node_id = %u frag_id = %u type = %u ); callback = %p\n", node_id, frag_id, type, v_fs_get_user_func(68));
-#endif
- if(type <= VN_M_FT_OUTPUT)
- {
- VMatFrag frag;
- uint8 temp;
- switch(type)
- {
- case VN_M_FT_COLOR :
- if(buffer_pos + 3 * 8 > buffer_length)
- return -1;
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.color.red);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.color.green);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.color.blue);
- break;
- case VN_M_FT_LIGHT :
- if(buffer_pos + 13 > buffer_length)
- return -1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &temp);
- frag.light.type = (VNMLightType)temp;
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.light.normal_falloff);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &frag.light.brdf);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.light.brdf_r, 16, buffer_length - buffer_pos);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.light.brdf_g, 16, buffer_length - buffer_pos);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.light.brdf_b, 16, buffer_length - buffer_pos);
- break;
- case VN_M_FT_REFLECTION :
- if(buffer_pos + 8 > buffer_length)
- return -1;
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.reflection.normal_falloff);
- break;
- case VN_M_FT_TRANSPARENCY :
- if(buffer_pos + 16 > buffer_length)
- return -1;
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.transparency.normal_falloff);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.transparency.refraction_index);
- break;
- case VN_M_FT_VOLUME :
- if(buffer_pos + 32 > buffer_length)
- return -1;
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.volume.diffusion);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.volume.col_r);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.volume.col_g);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.volume.col_b);
- break;
- case VN_M_FT_VIEW :
- break;
- case VN_M_FT_GEOMETRY :
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.geometry.layer_r, 16, buffer_length - buffer_pos);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.geometry.layer_g, 16, buffer_length - buffer_pos);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.geometry.layer_b, 16, buffer_length - buffer_pos);
- break;
- case VN_M_FT_TEXTURE :
- if(buffer_pos + 10 > buffer_length)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &frag.texture.bitmap);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.texture.layer_r, 16, buffer_length - buffer_pos);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.texture.layer_g, 16, buffer_length - buffer_pos);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.texture.layer_b, 16, buffer_length - buffer_pos);
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &temp);
- frag.texture.filtered = (VNMNoiseType)temp;
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.texture.mapping);
- break;
- case VN_M_FT_NOISE :
- if(buffer_pos + 3 > buffer_length)
- return -1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &temp);
- frag.noise.type = (VNMNoiseType)temp;
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.noise.mapping);
- break;
- case VN_M_FT_BLENDER :
- if(buffer_pos + 7 > buffer_length)
- return -1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &temp);
- frag.blender.type = (VNMBlendType)temp;
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.blender.data_a);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.blender.data_b);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.blender.control);
- break;
- case VN_M_FT_CLAMP :
- if(buffer_pos + 27 > buffer_length)
- return -1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &temp);
- frag.clamp.min = (VNMBlendType)temp;
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.clamp.red);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.clamp.green);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.clamp.blue);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.clamp.data);
- break;
- case VN_M_FT_MATRIX :
- if(buffer_pos + 8 * 16 + 2 > buffer_length)
- return -1;
- else
- {
- unsigned int i;
- for(i = 0; i < 16; i++)
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.matrix.matrix[i]);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.matrix.data);
- }
- break;
- case VN_M_FT_RAMP :
- if(buffer_pos + 5 + 4 * 8 > buffer_length)
- return -1;
- else
- {
- unsigned int i, pos;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &temp);
- frag.ramp.type = (VNMRampType)temp;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &temp);
- frag.ramp.channel = (VNMRampChannel)temp;
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.ramp.mapping);
- pos = buffer_pos;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &frag.ramp.point_count);
- for(i = 0; i < frag.ramp.point_count && buffer_pos + 8 * 4 <= buffer_length && i < 48; i++)
- {
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.ramp.ramp[i].pos);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.ramp.ramp[i].red);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.ramp.ramp[i].green);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &frag.ramp.ramp[i].blue);
- }if(i != frag.ramp.point_count)
- frag.ramp.point_count = i;
- }
- break;
- case VN_M_FT_ANIMATION :
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.animation.label, 16, buffer_length - buffer_pos);
- break;
- case VN_M_FT_ALTERNATIVE :
- if(buffer_pos + 4 > buffer_length)
- return -1;
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.alternative.alt_a);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.alternative.alt_b);
- break;
- case VN_M_FT_OUTPUT :
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], frag.output.label, 16, buffer_length - buffer_pos);
- if(buffer_pos + 4 > buffer_length)
- return -1;
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.output.front);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &frag.output.back);
- break;
- }
- if(func_m_fragment_create != NULL)
- func_m_fragment_create(v_fs_get_user_data(68), node_id, frag_id, type, &frag);
- return buffer_pos;
- }
-
- if(type > VN_M_FT_OUTPUT)
- {
- void (* alias_m_fragment_destroy)(void *user_data, VNodeID node_id, VNMFragmentID frag_id);
- alias_m_fragment_destroy = v_fs_get_alias_user_func(68);
- if(alias_m_fragment_destroy != NULL)
- alias_m_fragment_destroy(v_fs_get_alias_user_data(68), node_id, frag_id);
- return buffer_pos;
- }
- if(func_m_fragment_create != NULL)
- func_m_fragment_create(v_fs_get_user_data(68), node_id, frag_id, (VNMFragmentType) type, fragment);
-
- return buffer_pos;
-}
-
-#endif
-
diff --git a/extern/verse/dist/v_gen_pack_o_node.c b/extern/verse/dist/v_gen_pack_o_node.c
deleted file mode 100644
index 5d60bafe1d0..00000000000
--- a/extern/verse/dist/v_gen_pack_o_node.c
+++ /dev/null
@@ -1,1297 +0,0 @@
-/*
-** This is automatically generated source code -- do not edit.
-** Changes are affected either by editing the corresponding protocol
-** definition file (v_cmd_def_X.c where X=node type), or by editing
-** the code generator itself, in v_cmd_gen.c.
-*/
-
-#include
-#include
-
-#include "v_cmd_gen.h"
-#if !defined(V_GENERATE_FUNC_MODE)
-#include "verse.h"
-#include "v_cmd_buf.h"
-#include "v_network_out_que.h"
-#include "v_network.h"
-#include "v_connection.h"
-#include "v_util.h"
-
-void verse_send_o_transform_pos_real32(VNodeID node_id, uint32 time_s, uint32 time_f, const real32 *pos, const real32 *speed, const real32 *accelerate, const real32 *drag_normal, real32 drag)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 32); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_o_transform_pos_real32(node_id = %u time_s = %u time_f = %u pos = %p speed = %p accelerate = %p drag_normal = %p drag = %f );\n", node_id, time_s, time_f, pos, speed, accelerate, drag_normal, drag);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], time_s);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], time_f);
- {
- unsigned char mask = 0;
- unsigned int cmd;
- cmd = buffer_pos++;
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], pos[0]);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], pos[1]);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], pos[2]);
- if(speed != NULL && (speed[0] > 0.0000001 || speed[0] < -0.0000001 || speed[1] > 0.0000001 || speed[1] < -0.0000001 || speed[2] > 0.0000001 || speed[2] < -0.0000001))
- {
- mask |= 1;
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], speed[0]);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], speed[1]);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], speed[2]);
- }
- if(accelerate != NULL && (accelerate[0] > 0.0000001 || accelerate[0] < -0.0000001 || accelerate[1] > 0.0000001 || accelerate[1] < -0.0000001 || accelerate[2] > 0.0000001 || accelerate[2] < -0.0000001))
- {
- mask |= 2;
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], accelerate[0]);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], accelerate[1]);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], accelerate[2]);
- }
- if(drag_normal != NULL && (drag > 0.0000001 || drag < -0.0000001) && (drag_normal[0] > 0.0000001 || drag_normal[0] < -0.0000001 || drag_normal[1] > 0.0000001 || drag_normal[1] < -0.0000001 || drag_normal[2] > 0.0000001 || drag_normal[2] < -0.0000001))
- {
- mask |= 4;
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], drag_normal[0]);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], drag_normal[1]);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], drag_normal[2]);
- }
- if(drag > 0.0000001 || drag < -0.0000001)
- {
- mask |= 8;
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], drag);
- }
- vnp_raw_pack_uint8(&buf[cmd], mask);
- }if(FALSE)
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], drag);
- if(node_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 5);
- else
- v_cmd_buf_set_address_size(head, 5);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_o_transform_pos_real32(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_o_transform_pos_real32)(void *user_data, VNodeID node_id, uint32 time_s, uint32 time_f, const real32 *pos, const real32 *speed, const real32 *accelerate, const real32 *drag_normal, real32 drag);
- VNodeID node_id;
- uint32 time_s;
- uint32 time_f;
- const real32 *pos;
- const real32 *speed;
- const real32 *accelerate;
- const real32 *drag_normal;
- real32 drag;
-
- func_o_transform_pos_real32 = v_fs_get_user_func(32);
- if(buffer_length < 4)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &time_s);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &time_f);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_o_transform_pos_real32(node_id = %u time_s = %u time_f = %u drag = %f ); callback = %p\n", node_id, time_s, time_f, drag, v_fs_get_user_func(32));
-#endif
- {
- float output[4][3];
- unsigned int i, j;
- char mask, pow = 1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &mask);
- for(j = 0; j < 3; j++)
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &output[0][j]);
- for(i = 1; i < 4; i++)
- {
- if((mask & pow) != 0)
- for(j = 0; j < 3; j++)
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &output[i][j]);
- else
- for(j = 0; j < 3; j++)
- output[i][j] = 0;
- pow *= 2;
- }
- if((mask & pow) != 0)
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &drag);
- else
- drag = 0.0f;
- if(func_o_transform_pos_real32 != NULL)
- func_o_transform_pos_real32(v_fs_get_user_data(32), node_id, time_s, time_f, &output[0][0], &output[1][0], &output[2][0], &output[3][0], drag);
- return buffer_pos;
- }
-
- if(func_o_transform_pos_real32 != NULL)
- func_o_transform_pos_real32(v_fs_get_user_data(32), node_id, time_s, time_f, pos, speed, accelerate, drag_normal, drag);
-
- return buffer_pos;
-}
-
-void verse_send_o_transform_rot_real32(VNodeID node_id, uint32 time_s, uint32 time_f, const VNQuat32 *rot, const VNQuat32 *speed, const VNQuat32 *accelerate, const VNQuat32 *drag_normal, real32 drag)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 33); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_o_transform_rot_real32(node_id = %u time_s = %u time_f = %u rot = %p speed = %p accelerate = %p drag_normal = %p drag = %f );\n", node_id, time_s, time_f, rot, speed, accelerate, drag_normal, drag);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], time_s);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], time_f);
- {
- uint8 mask = 0;
- unsigned int maskpos;
- maskpos = buffer_pos++; /* Remember location, and reserve a byte for the mask. */
- buffer_pos += vnp_pack_quat32(&buf[buffer_pos], rot);
- if(v_quat32_valid(speed))
- {
- mask |= 1;
- buffer_pos += vnp_pack_quat32(&buf[buffer_pos], speed);
- }
- if(v_quat32_valid(accelerate))
- {
- mask |= 2;
- buffer_pos += vnp_pack_quat32(&buf[buffer_pos], accelerate);
- }
- if(v_quat32_valid(drag_normal))
- {
- mask |= 4;
- buffer_pos += vnp_pack_quat32(&buf[buffer_pos], drag_normal);
- }
- if(drag > 0.0000001 || drag < -0.0000001)
- {
- mask |= 8;
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], drag);
- }
- vnp_raw_pack_uint8(&buf[maskpos], mask); /* Write the mask into start of command. */
- }
- if(FALSE)
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], drag);
- if(node_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 5);
- else
- v_cmd_buf_set_address_size(head, 5);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_o_transform_rot_real32(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_o_transform_rot_real32)(void *user_data, VNodeID node_id, uint32 time_s, uint32 time_f, const VNQuat32 *rot, const VNQuat32 *speed, const VNQuat32 *accelerate, const VNQuat32 *drag_normal, real32 drag);
- VNodeID node_id;
- uint32 time_s;
- uint32 time_f;
- const VNQuat32 *rot;
- const VNQuat32 *speed;
- const VNQuat32 *accelerate;
- const VNQuat32 *drag_normal;
- real32 drag;
-
- func_o_transform_rot_real32 = v_fs_get_user_func(33);
- if(buffer_length < 4)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &time_s);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &time_f);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_o_transform_rot_real32(node_id = %u time_s = %u time_f = %u drag = %f ); callback = %p\n", node_id, time_s, time_f, drag, v_fs_get_user_func(33));
-#endif
- {
- VNQuat32 trot, temp[3], *q[3];
- unsigned int i;
- uint8 mask, test;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &mask);
- buffer_pos += vnp_unpack_quat32(&buf[buffer_pos], &trot);
- for(i = 0, test = 1; i < sizeof temp / sizeof *temp; i++, test <<= 1)
- {
- if(mask & test) /* Field present? */
- {
- buffer_pos += vnp_unpack_quat32(&buf[buffer_pos], &temp[i]);
- q[i] = &temp[i];
- }
- else
- q[i] = NULL;
- }
- if(mask & test)
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &drag);
- else
- drag = 0.0;
- if(func_o_transform_rot_real32 != NULL)
- func_o_transform_rot_real32(v_fs_get_user_data(33), node_id, time_s, time_f, &trot, q[0], q[1], q[2], drag);
- return buffer_pos;
- }
-
- if(func_o_transform_rot_real32 != NULL)
- func_o_transform_rot_real32(v_fs_get_user_data(33), node_id, time_s, time_f, rot, speed, accelerate, drag_normal, drag);
-
- return buffer_pos;
-}
-
-void verse_send_o_transform_scale_real32(VNodeID node_id, real32 scale_x, real32 scale_y, real32 scale_z)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_20);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 34); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_o_transform_scale_real32(node_id = %u scale_x = %f scale_y = %f scale_z = %f );\n", node_id, scale_x, scale_y, scale_z);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], scale_x);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], scale_y);
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], scale_z);
- if(node_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 5);
- else
- v_cmd_buf_set_address_size(head, 5);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_o_transform_scale_real32(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_o_transform_scale_real32)(void *user_data, VNodeID node_id, real32 scale_x, real32 scale_y, real32 scale_z);
- VNodeID node_id;
- real32 scale_x;
- real32 scale_y;
- real32 scale_z;
-
- func_o_transform_scale_real32 = v_fs_get_user_func(34);
- if(buffer_length < 4)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &scale_x);
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &scale_y);
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &scale_z);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_o_transform_scale_real32(node_id = %u scale_x = %f scale_y = %f scale_z = %f ); callback = %p\n", node_id, scale_x, scale_y, scale_z, v_fs_get_user_func(34));
-#endif
- if(func_o_transform_scale_real32 != NULL)
- func_o_transform_scale_real32(v_fs_get_user_data(34), node_id, scale_x, scale_y, scale_z);
-
- return buffer_pos;
-}
-
-void verse_send_o_transform_pos_real64(VNodeID node_id, uint32 time_s, uint32 time_f, const real64 *pos, const real64 *speed, const real64 *accelerate, const real64 *drag_normal, real64 drag)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 35); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_o_transform_pos_real64(node_id = %u time_s = %u time_f = %u pos = %p speed = %p accelerate = %p drag_normal = %p drag = %f );\n", node_id, time_s, time_f, pos, speed, accelerate, drag_normal, drag);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], time_s);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], time_f);
- {
- unsigned char mask = 0;
- unsigned int cmd;
- cmd = buffer_pos++;
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], pos[0]);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], pos[1]);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], pos[2]);
- if(speed != NULL && (speed[0] > 0.0000001 || speed[0] < -0.0000001 || speed[1] > 0.0000001 || speed[1] < -0.0000001 || speed[2] > 0.0000001 || speed[2] < -0.0000001))
- {
- mask |= 1;
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], speed[0]);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], speed[1]);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], speed[2]);
- }
- if(accelerate != NULL && (accelerate[0] > 0.0000001 || accelerate[0] < -0.0000001 || accelerate[1] > 0.0000001 || accelerate[1] < -0.0000001 || accelerate[2] > 0.0000001 || accelerate[2] < -0.0000001))
- {
- mask |= 2;
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], accelerate[0]);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], accelerate[1]);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], accelerate[2]);
- }
- if(drag_normal != NULL && (drag > 0.0000001 || drag < -0.0000001) && (drag_normal[0] > 0.0000001 || drag_normal[0] < -0.0000001 || drag_normal[1] > 0.0000001 || drag_normal[1] < -0.0000001 || drag_normal[2] > 0.0000001 || drag_normal[2] < -0.0000001))
- {
- mask |= 4;
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], drag_normal[0]);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], drag_normal[1]);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], drag_normal[2]);
- }
- if(drag > 0.0000001 || drag < -0.0000001)
- {
- mask |= 8;
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], drag);
- }
- vnp_raw_pack_uint8(&buf[cmd], mask);
- }if(FALSE)
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], drag);
- if(node_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 5);
- else
- v_cmd_buf_set_address_size(head, 5);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_o_transform_pos_real64(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_o_transform_pos_real64)(void *user_data, VNodeID node_id, uint32 time_s, uint32 time_f, const real64 *pos, const real64 *speed, const real64 *accelerate, const real64 *drag_normal, real64 drag);
- VNodeID node_id;
- uint32 time_s;
- uint32 time_f;
- const real64 *pos;
- const real64 *speed;
- const real64 *accelerate;
- const real64 *drag_normal;
- real64 drag;
-
- func_o_transform_pos_real64 = v_fs_get_user_func(35);
- if(buffer_length < 4)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &time_s);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &time_f);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_o_transform_pos_real64(node_id = %u time_s = %u time_f = %u drag = %f ); callback = %p\n", node_id, time_s, time_f, drag, v_fs_get_user_func(35));
-#endif
- {
- double output[4][3];
- unsigned int i, j;
- char mask, pow = 1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &mask);
- for(j = 0; j < 3; j++)
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &output[0][j]);
- for(i = 1; i < 4; i++)
- {
- if((mask & pow) != 0)
- for(j = 0; j < 3; j++)
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &output[i][j]);
- else
- for(j = 0; j < 3; j++)
- output[i][j] = 0;
- pow *= 2;
- }
- if((mask & pow) != 0)
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &drag);
- else
- drag = 0.0;
- if(func_o_transform_pos_real64 != NULL)
- func_o_transform_pos_real64(v_fs_get_user_data(35), node_id, time_s, time_f, &output[0][0], &output[1][0], &output[2][0], &output[3][0], drag);
- return buffer_pos;
- }
-
- if(func_o_transform_pos_real64 != NULL)
- func_o_transform_pos_real64(v_fs_get_user_data(35), node_id, time_s, time_f, pos, speed, accelerate, drag_normal, drag);
-
- return buffer_pos;
-}
-
-void verse_send_o_transform_rot_real64(VNodeID node_id, uint32 time_s, uint32 time_f, const VNQuat64 *rot, const VNQuat64 *speed, const VNQuat64 *accelerate, const VNQuat64 *drag_normal, real64 drag)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 36); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_o_transform_rot_real64(node_id = %u time_s = %u time_f = %u rot = %p speed = %p accelerate = %p drag_normal = %p drag = %f );\n", node_id, time_s, time_f, rot, speed, accelerate, drag_normal, drag);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], time_s);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], time_f);
- {
- uint8 mask = 0;
- unsigned int maskpos;
- maskpos = buffer_pos++; /* Remember location, and reserve a byte for the mask. */
- buffer_pos += vnp_pack_quat64(&buf[buffer_pos], rot);
- if(v_quat64_valid(speed))
- {
- mask |= 1;
- buffer_pos += vnp_pack_quat64(&buf[buffer_pos], speed);
- }
- if(v_quat64_valid(accelerate))
- {
- mask |= 2;
- buffer_pos += vnp_pack_quat64(&buf[buffer_pos], accelerate);
- }
- if(v_quat64_valid(drag_normal))
- {
- mask |= 4;
- buffer_pos += vnp_pack_quat64(&buf[buffer_pos], drag_normal);
- }
- if(drag > 0.0000001 || drag < -0.0000001)
- {
- mask |= 8;
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], drag);
- }
- vnp_raw_pack_uint8(&buf[maskpos], mask); /* Write the mask into start of command. */
- }
- if(FALSE)
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], drag);
- if(node_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 5);
- else
- v_cmd_buf_set_address_size(head, 5);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_o_transform_rot_real64(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_o_transform_rot_real64)(void *user_data, VNodeID node_id, uint32 time_s, uint32 time_f, const VNQuat64 *rot, const VNQuat64 *speed, const VNQuat64 *accelerate, const VNQuat64 *drag_normal, real64 drag);
- VNodeID node_id;
- uint32 time_s;
- uint32 time_f;
- const VNQuat64 *rot;
- const VNQuat64 *speed;
- const VNQuat64 *accelerate;
- const VNQuat64 *drag_normal;
- real64 drag;
-
- func_o_transform_rot_real64 = v_fs_get_user_func(36);
- if(buffer_length < 4)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &time_s);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &time_f);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_o_transform_rot_real64(node_id = %u time_s = %u time_f = %u drag = %f ); callback = %p\n", node_id, time_s, time_f, drag, v_fs_get_user_func(36));
-#endif
- {
- VNQuat64 trot, temp[3], *q[3];
- unsigned int i;
- uint8 mask, test;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &mask);
- buffer_pos += vnp_unpack_quat64(&buf[buffer_pos], &trot);
- for(i = 0, test = 1; i < sizeof temp / sizeof *temp; i++, test <<= 1)
- {
- if(mask & test) /* Field present? */
- {
- buffer_pos += vnp_unpack_quat64(&buf[buffer_pos], &temp[i]);
- q[i] = &temp[i];
- }
- else
- q[i] = NULL;
- }
- if(mask & test)
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &drag);
- else
- drag = 0.0;
- if(func_o_transform_rot_real64 != NULL)
- func_o_transform_rot_real64(v_fs_get_user_data(36), node_id, time_s, time_f, &trot, q[0], q[1], q[2], drag);
- return buffer_pos;
- }
-
- if(func_o_transform_rot_real64 != NULL)
- func_o_transform_rot_real64(v_fs_get_user_data(36), node_id, time_s, time_f, rot, speed, accelerate, drag_normal, drag);
-
- return buffer_pos;
-}
-
-void verse_send_o_transform_scale_real64(VNodeID node_id, real64 scale_x, real64 scale_y, real64 scale_z)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 37); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_o_transform_scale_real64(node_id = %u scale_x = %f scale_y = %f scale_z = %f );\n", node_id, scale_x, scale_y, scale_z);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], scale_x);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], scale_y);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], scale_z);
- if(node_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 5);
- else
- v_cmd_buf_set_address_size(head, 5);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_o_transform_scale_real64(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_o_transform_scale_real64)(void *user_data, VNodeID node_id, real64 scale_x, real64 scale_y, real64 scale_z);
- VNodeID node_id;
- real64 scale_x;
- real64 scale_y;
- real64 scale_z;
-
- func_o_transform_scale_real64 = v_fs_get_user_func(37);
- if(buffer_length < 4)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &scale_x);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &scale_y);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &scale_z);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_o_transform_scale_real64(node_id = %u scale_x = %f scale_y = %f scale_z = %f ); callback = %p\n", node_id, scale_x, scale_y, scale_z, v_fs_get_user_func(37));
-#endif
- if(func_o_transform_scale_real64 != NULL)
- func_o_transform_scale_real64(v_fs_get_user_data(37), node_id, scale_x, scale_y, scale_z);
-
- return buffer_pos;
-}
-
-void verse_send_o_transform_subscribe(VNodeID node_id, VNRealFormat type)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 38); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_o_transform_subscribe(node_id = %u type = %u );\n", node_id, type);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)type);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], TRUE);
- if(node_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 5);
- else
- v_cmd_buf_set_address_size(head, 5);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_o_transform_unsubscribe(VNodeID node_id, VNRealFormat type)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 38); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_o_transform_unsubscribe(node_id = %u type = %u );\n", node_id, type);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)type);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], FALSE);
- if(node_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 5);
- else
- v_cmd_buf_set_address_size(head, 5);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_o_transform_subscribe(const char *buf, size_t buffer_length)
-{
- uint8 enum_temp;
- unsigned int buffer_pos = 0;
- void (* func_o_transform_subscribe)(void *user_data, VNodeID node_id, VNRealFormat type);
- VNodeID node_id;
- VNRealFormat type;
- uint8 alias_bool;
-
- func_o_transform_subscribe = v_fs_get_user_func(38);
- if(buffer_length < 4)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &enum_temp);
- type = (VNRealFormat)enum_temp;
- if(buffer_length < buffer_pos + 1)
- return -1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &alias_bool);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(!alias_bool)
- printf("receive: verse_send_o_transform_unsubscribe(node_id = %u type = %u ); callback = %p\n", node_id, type, v_fs_get_alias_user_func(38));
- else
- printf("receive: verse_send_o_transform_subscribe(node_id = %u type = %u ); callback = %p\n", node_id, type, v_fs_get_user_func(38));
-#endif
- if(!alias_bool)
- {
- void (* alias_o_transform_unsubscribe)(void *user_data, VNodeID node_id, VNRealFormat type);
- alias_o_transform_unsubscribe = v_fs_get_alias_user_func(38);
- if(alias_o_transform_unsubscribe != NULL)
- alias_o_transform_unsubscribe(v_fs_get_alias_user_data(38), node_id, (VNRealFormat)type);
- return buffer_pos;
- }
- if(func_o_transform_subscribe != NULL)
- func_o_transform_subscribe(v_fs_get_user_data(38), node_id, (VNRealFormat) type);
-
- return buffer_pos;
-}
-
-void verse_send_o_light_set(VNodeID node_id, real64 light_r, real64 light_g, real64 light_b)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 39); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_o_light_set(node_id = %u light_r = %f light_g = %f light_b = %f );\n", node_id, light_r, light_g, light_b);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], light_r);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], light_g);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], light_b);
- if(node_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 5);
- else
- v_cmd_buf_set_address_size(head, 5);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_o_light_set(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_o_light_set)(void *user_data, VNodeID node_id, real64 light_r, real64 light_g, real64 light_b);
- VNodeID node_id;
- real64 light_r;
- real64 light_g;
- real64 light_b;
-
- func_o_light_set = v_fs_get_user_func(39);
- if(buffer_length < 4)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &light_r);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &light_g);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &light_b);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_o_light_set(node_id = %u light_r = %f light_g = %f light_b = %f ); callback = %p\n", node_id, light_r, light_g, light_b, v_fs_get_user_func(39));
-#endif
- if(func_o_light_set != NULL)
- func_o_light_set(v_fs_get_user_data(39), node_id, light_r, light_g, light_b);
-
- return buffer_pos;
-}
-
-void verse_send_o_link_set(VNodeID node_id, uint16 link_id, VNodeID link, const char *label, uint32 target_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_80);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 40); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_o_link_set(node_id = %u link_id = %u link = %u label = %s target_id = %u );\n", node_id, link_id, link, label, target_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], link_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], link);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], label, 16);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], target_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], TRUE);
- if(node_id == (uint32) ~0u || link_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_o_link_destroy(VNodeID node_id, uint16 link_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_80);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 40); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_o_link_destroy(node_id = %u link_id = %u );\n", node_id, link_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], link_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], -1);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], -1);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], FALSE);
- if(node_id == (uint32) ~0u || link_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_o_link_set(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_o_link_set)(void *user_data, VNodeID node_id, uint16 link_id, VNodeID link, const char *label, uint32 target_id);
- VNodeID node_id;
- uint16 link_id;
- VNodeID link;
- char label[16];
- uint32 target_id;
- uint8 alias_bool;
-
- func_o_link_set = v_fs_get_user_func(40);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &link_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &link);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], label, 16, buffer_length - buffer_pos);
- if(buffer_length < 4 + buffer_pos)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &target_id);
- if(buffer_length < buffer_pos + 1)
- return -1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &alias_bool);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(!alias_bool)
- printf("receive: verse_send_o_link_destroy(node_id = %u link_id = %u ); callback = %p\n", node_id, link_id, v_fs_get_alias_user_func(40));
- else
- printf("receive: verse_send_o_link_set(node_id = %u link_id = %u link = %u label = %s target_id = %u ); callback = %p\n", node_id, link_id, link, label, target_id, v_fs_get_user_func(40));
-#endif
- if(!alias_bool)
- {
- void (* alias_o_link_destroy)(void *user_data, VNodeID node_id, uint16 link_id);
- alias_o_link_destroy = v_fs_get_alias_user_func(40);
- if(alias_o_link_destroy != NULL)
- alias_o_link_destroy(v_fs_get_alias_user_data(40), node_id, link_id);
- return buffer_pos;
- }
- if(func_o_link_set != NULL)
- func_o_link_set(v_fs_get_user_data(40), node_id, link_id, link, label, target_id);
-
- return buffer_pos;
-}
-
-void verse_send_o_method_group_create(VNodeID node_id, uint16 group_id, const char *name)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 41); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_o_method_group_create(node_id = %u group_id = %u name = %s );\n", node_id, group_id, name);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], group_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], name, 16);
- if(node_id == (uint32) ~0u || group_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_o_method_group_destroy(VNodeID node_id, uint16 group_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 41); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_o_method_group_destroy(node_id = %u group_id = %u );\n", node_id, group_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], group_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
- if(node_id == (uint32) ~0u || group_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_o_method_group_create(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_o_method_group_create)(void *user_data, VNodeID node_id, uint16 group_id, const char *name);
- VNodeID node_id;
- uint16 group_id;
- char name[16];
-
- func_o_method_group_create = v_fs_get_user_func(41);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &group_id);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], name, 16, buffer_length - buffer_pos);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(name[0] == 0)
- printf("receive: verse_send_o_method_group_destroy(node_id = %u group_id = %u ); callback = %p\n", node_id, group_id, v_fs_get_alias_user_func(41));
- else
- printf("receive: verse_send_o_method_group_create(node_id = %u group_id = %u name = %s ); callback = %p\n", node_id, group_id, name, v_fs_get_user_func(41));
-#endif
- if(name[0] == 0)
- {
- void (* alias_o_method_group_destroy)(void *user_data, VNodeID node_id, uint16 group_id);
- alias_o_method_group_destroy = v_fs_get_alias_user_func(41);
- if(alias_o_method_group_destroy != NULL)
- alias_o_method_group_destroy(v_fs_get_alias_user_data(41), node_id, group_id);
- return buffer_pos;
- }
- if(func_o_method_group_create != NULL)
- func_o_method_group_create(v_fs_get_user_data(41), node_id, group_id, name);
-
- return buffer_pos;
-}
-
-void verse_send_o_method_group_subscribe(VNodeID node_id, uint16 group_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 42); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_o_method_group_subscribe(node_id = %u group_id = %u );\n", node_id, group_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], group_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], TRUE);
- if(node_id == (uint32) ~0u || group_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_o_method_group_unsubscribe(VNodeID node_id, uint16 group_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 42); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_o_method_group_unsubscribe(node_id = %u group_id = %u );\n", node_id, group_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], group_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], FALSE);
- if(node_id == (uint32) ~0u || group_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_o_method_group_subscribe(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_o_method_group_subscribe)(void *user_data, VNodeID node_id, uint16 group_id);
- VNodeID node_id;
- uint16 group_id;
- uint8 alias_bool;
-
- func_o_method_group_subscribe = v_fs_get_user_func(42);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &group_id);
- if(buffer_length < buffer_pos + 1)
- return -1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &alias_bool);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(!alias_bool)
- printf("receive: verse_send_o_method_group_unsubscribe(node_id = %u group_id = %u ); callback = %p\n", node_id, group_id, v_fs_get_alias_user_func(42));
- else
- printf("receive: verse_send_o_method_group_subscribe(node_id = %u group_id = %u ); callback = %p\n", node_id, group_id, v_fs_get_user_func(42));
-#endif
- if(!alias_bool)
- {
- void (* alias_o_method_group_unsubscribe)(void *user_data, VNodeID node_id, uint16 group_id);
- alias_o_method_group_unsubscribe = v_fs_get_alias_user_func(42);
- if(alias_o_method_group_unsubscribe != NULL)
- alias_o_method_group_unsubscribe(v_fs_get_alias_user_data(42), node_id, group_id);
- return buffer_pos;
- }
- if(func_o_method_group_subscribe != NULL)
- func_o_method_group_subscribe(v_fs_get_user_data(42), node_id, group_id);
-
- return buffer_pos;
-}
-
-void verse_send_o_method_create(VNodeID node_id, uint16 group_id, uint16 method_id, const char *name, uint8 param_count, const VNOParamType *param_types, const char * *param_names)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 43); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_o_method_create(node_id = %u group_id = %u method_id = %u name = %s param_count = %u param_types = %p param_names = %p );\n", node_id, group_id, method_id, name, param_count, param_types, param_names);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], group_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], method_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], name, 512);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], param_count);
- {
- unsigned int i, j, sum = 1;
- for(i = 0; i < param_count; i++)
- {
- sum += 3;
- for(j = 0; param_names[i][j] != 0; j++);
- }
- if(sum + buffer_pos > 1500)
- return;
- for(i = 0; i < param_count; i++)
- {
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], param_types[i]);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], param_names[i], 1500 - buffer_pos);
- }
- }
- if(node_id == (uint32) ~0u || group_id == (uint16) ~0u || method_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 9);
- else
- v_cmd_buf_set_address_size(head, 9);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_o_method_destroy(VNodeID node_id, uint16 group_id, uint16 method_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 43); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_o_method_destroy(node_id = %u group_id = %u method_id = %u );\n", node_id, group_id, method_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], group_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], method_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 512);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], -1);
- if(node_id == (uint32) ~0u || group_id == (uint16) ~0u || method_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 9);
- else
- v_cmd_buf_set_address_size(head, 9);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_o_method_create(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_o_method_create)(void *user_data, VNodeID node_id, uint16 group_id, uint16 method_id, const char *name, uint8 param_count, const VNOParamType *param_types, const char * *param_names);
- VNodeID node_id;
- uint16 group_id;
- uint16 method_id;
- char name[512];
- uint8 param_count;
- const VNOParamType *param_types;
- const char * *param_names;
-
- func_o_method_create = v_fs_get_user_func(43);
- if(buffer_length < 8)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &group_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &method_id);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], name, 512, buffer_length - buffer_pos);
- if(buffer_length < 1 + buffer_pos)
- return -1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], ¶m_count);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(name[0] == 0)
- printf("receive: verse_send_o_method_destroy(node_id = %u group_id = %u method_id = %u ); callback = %p\n", node_id, group_id, method_id, v_fs_get_alias_user_func(43));
- else
- printf("receive: verse_send_o_method_create(node_id = %u group_id = %u method_id = %u name = %s param_count = %u ); callback = %p\n", node_id, group_id, method_id, name, param_count, v_fs_get_user_func(43));
-#endif
- if(param_count != 255)
- {
- unsigned int i, size, text = 0;
- VNOParamType types[256];
- uint8 t;
- char name_buf[1500], *names[256];
- for(i = 0; i < param_count; i++)
- {
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &t);
- types[i] = t;
- names[i] = &name_buf[text];
- size = vnp_raw_unpack_string(&buf[buffer_pos], names[i], 1500 - buffer_pos, buffer_length - buffer_pos);
- buffer_pos += size;
- text += size;
- }
- if(func_o_method_create != NULL)
- func_o_method_create(v_fs_get_user_data(43), node_id, group_id, method_id, name, param_count, types, (const char **) names);
- return buffer_pos;
- }
-
- if(name[0] == 0)
- {
- void (* alias_o_method_destroy)(void *user_data, VNodeID node_id, uint16 group_id, uint16 method_id);
- alias_o_method_destroy = v_fs_get_alias_user_func(43);
- if(alias_o_method_destroy != NULL)
- alias_o_method_destroy(v_fs_get_alias_user_data(43), node_id, group_id, method_id);
- return buffer_pos;
- }
- if(func_o_method_create != NULL)
- func_o_method_create(v_fs_get_user_data(43), node_id, group_id, method_id, name, param_count, param_types, param_names);
-
- return buffer_pos;
-}
-
-void verse_send_o_method_call(VNodeID node_id, uint16 group_id, uint16 method_id, VNodeID sender, const VNOPackedParams *params)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 44); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_o_method_call(node_id = %u group_id = %u method_id = %u sender = %u params = %p );\n", node_id, group_id, method_id, sender, params);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], group_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], method_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], sender);
- {
- unsigned int i;
- uint16 size;
- vnp_raw_unpack_uint16(params, &size);
- for(i = 0; i < size; i++)
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], ((uint8 *)params)[i]);
- free((void *) params); /* Drop the const. */
- }
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_o_method_call(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_o_method_call)(void *user_data, VNodeID node_id, uint16 group_id, uint16 method_id, VNodeID sender, const VNOPackedParams *params);
- VNodeID node_id;
- uint16 group_id;
- uint16 method_id;
- VNodeID sender;
- const VNOPackedParams *params;
-
- func_o_method_call = v_fs_get_user_func(44);
- if(buffer_length < 12)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &group_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &method_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &sender);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_o_method_call(node_id = %u group_id = %u method_id = %u sender = %u ); callback = %p\n", node_id, group_id, method_id, sender, v_fs_get_user_func(44));
-#endif
- {
- unsigned int i;
- uint8 par[1500];
- uint16 size;
- vnp_raw_unpack_uint16(&buf[buffer_pos], &size);
- for(i = 0; i < size; i++)
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &par[i]);
- if(func_o_method_call != NULL)
- func_o_method_call(v_fs_get_user_data(44), node_id, group_id, method_id, sender, par);
- return buffer_pos;
- }
-
- if(func_o_method_call != NULL)
- func_o_method_call(v_fs_get_user_data(44), node_id, group_id, method_id, sender, params);
-
- return buffer_pos;
-}
-
-void verse_send_o_anim_run(VNodeID node_id, uint16 link_id, uint32 time_s, uint32 time_f, uint8 dimensions, const real64 *pos, const real64 *speed, const real64 *accel, const real64 *scale, const real64 *scale_speed)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 45); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_o_anim_run(node_id = %u link_id = %u time_s = %u time_f = %u dimensions = %u pos = %p speed = %p accel = %p scale = %p scale_speed = %p );\n", node_id, link_id, time_s, time_f, dimensions, pos, speed, accel, scale, scale_speed);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], link_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], time_s);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], time_f);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], dimensions);
- {
- unsigned char mask = 0;
- unsigned int cmd, i;
- cmd = buffer_pos++;
- if(dimensions > 4)
- dimensions = 4;
- for(i = 0; i < dimensions; i++)
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], pos[i]);
- if(speed != NULL)
- {
- mask |= 1;
- for(i = 0; i < dimensions; i++)
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], speed[i]);
- }
- if(accel != NULL)
- {
- mask |= 2;
- for(i = 0; i < dimensions; i++)
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], accel[i]);
- }
- if(scale != NULL)
- {
- mask |= 3;
- for(i = 0; i < dimensions; i++)
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], scale[i]);
- }
- if(scale_speed != NULL)
- {
- mask |= 4;
- for(i = 0; i < dimensions; i++)
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], scale_speed[i]);
- }
- vnp_raw_pack_uint8(&buf[cmd], mask);
- }
- if(node_id == (uint32) ~0u || link_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_o_anim_run(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_o_anim_run)(void *user_data, VNodeID node_id, uint16 link_id, uint32 time_s, uint32 time_f, uint8 dimensions, const real64 *pos, const real64 *speed, const real64 *accel, const real64 *scale, const real64 *scale_speed);
- VNodeID node_id;
- uint16 link_id;
- uint32 time_s;
- uint32 time_f;
- uint8 dimensions;
- const real64 *pos;
- const real64 *speed;
- const real64 *accel;
- const real64 *scale;
- const real64 *scale_speed;
-
- func_o_anim_run = v_fs_get_user_func(45);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &link_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &time_s);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &time_f);
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &dimensions);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_o_anim_run(node_id = %u link_id = %u time_s = %u time_f = %u dimensions = %u ); callback = %p\n", node_id, link_id, time_s, time_f, dimensions, v_fs_get_user_func(45));
-#endif
- {
- double output[5][4];
- unsigned int i, j;
- char mask, pow = 1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &mask);
- if(dimensions > 4)
- dimensions = 4;
- for(j = 0; j < dimensions; j++)
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &output[0][j]);
- for(i = 1; i < 5; i++)
- {
- if((mask & pow) != 0)
- for(j = 0; j < dimensions; j++)
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &output[i][j]);
- else
- for(j = 0; j < dimensions; j++)
- output[i][j] = 0;
- pow *= 2;
- }
- if(func_o_anim_run != NULL)
- func_o_anim_run(v_fs_get_user_data(45), node_id, link_id, time_s, time_f, dimensions, &output[0][0], &output[1][0], &output[2][0], &output[3][0], &output[4][0]);
- return buffer_pos;
- }
-
- if(func_o_anim_run != NULL)
- func_o_anim_run(v_fs_get_user_data(45), node_id, link_id, time_s, time_f, dimensions, pos, speed, accel, scale, scale_speed);
-
- return buffer_pos;
-}
-
-void verse_send_o_hide(VNodeID node_id, uint8 hidden)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 46); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_o_hide(node_id = %u hidden = %u );\n", node_id, hidden);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], hidden);
- if(node_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 5);
- else
- v_cmd_buf_set_address_size(head, 5);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_o_hide(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_o_hide)(void *user_data, VNodeID node_id, uint8 hidden);
- VNodeID node_id;
- uint8 hidden;
-
- func_o_hide = v_fs_get_user_func(46);
- if(buffer_length < 4)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &hidden);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_o_hide(node_id = %u hidden = %u ); callback = %p\n", node_id, hidden, v_fs_get_user_func(46));
-#endif
- if(func_o_hide != NULL)
- func_o_hide(v_fs_get_user_data(46), node_id, hidden);
-
- return buffer_pos;
-}
-
-#endif
-
diff --git a/extern/verse/dist/v_gen_pack_s_node.c b/extern/verse/dist/v_gen_pack_s_node.c
deleted file mode 100644
index 6a9f4a05a0b..00000000000
--- a/extern/verse/dist/v_gen_pack_s_node.c
+++ /dev/null
@@ -1,711 +0,0 @@
-/*
-** This is automatically generated source code -- do not edit.
-** Changes are affected either by editing the corresponding protocol
-** definition file (v_cmd_def_X.c where X=node type), or by editing
-** the code generator itself, in v_cmd_gen.c.
-*/
-
-#include
-#include
-
-#include "v_cmd_gen.h"
-#if !defined(V_GENERATE_FUNC_MODE)
-#include "verse.h"
-#include "v_cmd_buf.h"
-#include "v_network_out_que.h"
-#include "v_network.h"
-#include "v_connection.h"
-#include "v_util.h"
-
-void verse_send_packet_ack(uint32 packet_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 7); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], packet_id);
- v_cmd_buf_set_unique_address_size(head, buffer_pos);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_ack_nak_buf(v_con_get_network_queue(), head);
- return;
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_packet_ack(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_packet_ack)(void *user_data, uint32 packet_id);
- uint32 packet_id;
-
- func_packet_ack = v_fs_get_user_func(7);
- if(buffer_length < 4)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &packet_id);
-#if defined V_PRINT_RECEIVE_COMMANDS
-#endif
- if(func_packet_ack != NULL)
- func_packet_ack(v_fs_get_user_data(7), packet_id);
-
- return buffer_pos;
-}
-
-void verse_send_packet_nak(uint32 packet_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 8); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], packet_id);
- v_cmd_buf_set_unique_address_size(head, buffer_pos);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_ack_nak_buf(v_con_get_network_queue(), head);
- return;
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_packet_nak(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_packet_nak)(void *user_data, uint32 packet_id);
- uint32 packet_id;
-
- func_packet_nak = v_fs_get_user_func(8);
- if(buffer_length < 4)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &packet_id);
-#if defined V_PRINT_RECEIVE_COMMANDS
-#endif
- if(func_packet_nak != NULL)
- func_packet_nak(v_fs_get_user_data(8), packet_id);
-
- return buffer_pos;
-}
-
-void verse_send_node_index_subscribe(uint32 mask)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 9); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_node_index_subscribe(mask = %u );\n", mask);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], mask);
- if(mask == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 5);
- else
- v_cmd_buf_set_address_size(head, 5);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_node_index_subscribe(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_node_index_subscribe)(void *user_data, uint32 mask);
- uint32 mask;
-
- func_node_index_subscribe = v_fs_get_user_func(9);
- if(buffer_length < 4)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &mask);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_node_index_subscribe(mask = %u ); callback = %p\n", mask, v_fs_get_user_func(9));
-#endif
- if(func_node_index_subscribe != NULL)
- func_node_index_subscribe(v_fs_get_user_data(9), mask);
-
- return buffer_pos;
-}
-
-void verse_send_node_create(VNodeID node_id, VNodeType type, VNodeOwner owner)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 10); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_node_create(node_id = %u type = %u owner = %u );\n", node_id, type, owner);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)type);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)owner);
- if(node_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 5);
- else
- v_cmd_buf_set_address_size(head, 5);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_node_destroy(VNodeID node_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 10); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_node_destroy(node_id = %u );\n", node_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)-1);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)-1);
- if(node_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 5);
- else
- v_cmd_buf_set_address_size(head, 5);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_node_create(const char *buf, size_t buffer_length)
-{
- uint8 enum_temp;
- unsigned int buffer_pos = 0;
- void (* func_node_create)(void *user_data, VNodeID node_id, VNodeType type, VNodeOwner owner);
- VNodeID node_id;
- VNodeType type;
- VNodeOwner owner;
-
- func_node_create = v_fs_get_user_func(10);
- if(buffer_length < 4)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &enum_temp);
- type = (VNodeType)enum_temp;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &enum_temp);
- owner = (VNodeOwner)enum_temp;
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(owner == (uint8) ~0u || type >= V_NT_NUM_TYPES)
- printf("receive: verse_send_node_destroy(node_id = %u ); callback = %p\n", node_id, v_fs_get_alias_user_func(10));
- else
- printf("receive: verse_send_node_create(node_id = %u type = %u owner = %u ); callback = %p\n", node_id, type, owner, v_fs_get_user_func(10));
-#endif
- if(owner == (uint8) ~0u || type >= V_NT_NUM_TYPES)
- {
- void (* alias_node_destroy)(void *user_data, VNodeID node_id);
- alias_node_destroy = v_fs_get_alias_user_func(10);
- if(alias_node_destroy != NULL)
- alias_node_destroy(v_fs_get_alias_user_data(10), node_id);
- return buffer_pos;
- }
- if(func_node_create != NULL)
- func_node_create(v_fs_get_user_data(10), node_id, (VNodeType) type, (VNodeOwner) owner);
-
- return buffer_pos;
-}
-
-void verse_send_node_subscribe(VNodeID node_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 11); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_node_subscribe(node_id = %u );\n", node_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], TRUE);
- if(node_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 5);
- else
- v_cmd_buf_set_address_size(head, 5);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_node_unsubscribe(VNodeID node_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 11); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_node_unsubscribe(node_id = %u );\n", node_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], FALSE);
- if(node_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 5);
- else
- v_cmd_buf_set_address_size(head, 5);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_node_subscribe(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_node_subscribe)(void *user_data, VNodeID node_id);
- VNodeID node_id;
- uint8 alias_bool;
-
- func_node_subscribe = v_fs_get_user_func(11);
- if(buffer_length < 4)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- if(buffer_length < buffer_pos + 1)
- return -1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &alias_bool);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(!alias_bool)
- printf("receive: verse_send_node_unsubscribe(node_id = %u ); callback = %p\n", node_id, v_fs_get_alias_user_func(11));
- else
- printf("receive: verse_send_node_subscribe(node_id = %u ); callback = %p\n", node_id, v_fs_get_user_func(11));
-#endif
- if(!alias_bool)
- {
- void (* alias_node_unsubscribe)(void *user_data, VNodeID node_id);
- alias_node_unsubscribe = v_fs_get_alias_user_func(11);
- if(alias_node_unsubscribe != NULL)
- alias_node_unsubscribe(v_fs_get_alias_user_data(11), node_id);
- return buffer_pos;
- }
- if(func_node_subscribe != NULL)
- func_node_subscribe(v_fs_get_user_data(11), node_id);
-
- return buffer_pos;
-}
-
-void verse_send_tag_group_create(VNodeID node_id, uint16 group_id, const char *name)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 16); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_tag_group_create(node_id = %u group_id = %u name = %s );\n", node_id, group_id, name);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], group_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], name, 16);
- if(node_id == (uint32) ~0u || group_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_tag_group_destroy(VNodeID node_id, uint16 group_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 16); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_tag_group_destroy(node_id = %u group_id = %u );\n", node_id, group_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], group_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
- if(node_id == (uint32) ~0u || group_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_tag_group_create(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_tag_group_create)(void *user_data, VNodeID node_id, uint16 group_id, const char *name);
- VNodeID node_id;
- uint16 group_id;
- char name[16];
-
- func_tag_group_create = v_fs_get_user_func(16);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &group_id);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], name, 16, buffer_length - buffer_pos);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(name[0] == 0)
- printf("receive: verse_send_tag_group_destroy(node_id = %u group_id = %u ); callback = %p\n", node_id, group_id, v_fs_get_alias_user_func(16));
- else
- printf("receive: verse_send_tag_group_create(node_id = %u group_id = %u name = %s ); callback = %p\n", node_id, group_id, name, v_fs_get_user_func(16));
-#endif
- if(name[0] == 0)
- {
- void (* alias_tag_group_destroy)(void *user_data, VNodeID node_id, uint16 group_id);
- alias_tag_group_destroy = v_fs_get_alias_user_func(16);
- if(alias_tag_group_destroy != NULL)
- alias_tag_group_destroy(v_fs_get_alias_user_data(16), node_id, group_id);
- return buffer_pos;
- }
- if(func_tag_group_create != NULL)
- func_tag_group_create(v_fs_get_user_data(16), node_id, group_id, name);
-
- return buffer_pos;
-}
-
-void verse_send_tag_group_subscribe(VNodeID node_id, uint16 group_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 17); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_tag_group_subscribe(node_id = %u group_id = %u );\n", node_id, group_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], group_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], TRUE);
- if(node_id == (uint32) ~0u || group_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_tag_group_unsubscribe(VNodeID node_id, uint16 group_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 17); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_tag_group_unsubscribe(node_id = %u group_id = %u );\n", node_id, group_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], group_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], FALSE);
- if(node_id == (uint32) ~0u || group_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_tag_group_subscribe(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_tag_group_subscribe)(void *user_data, VNodeID node_id, uint16 group_id);
- VNodeID node_id;
- uint16 group_id;
- uint8 alias_bool;
-
- func_tag_group_subscribe = v_fs_get_user_func(17);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &group_id);
- if(buffer_length < buffer_pos + 1)
- return -1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &alias_bool);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(!alias_bool)
- printf("receive: verse_send_tag_group_unsubscribe(node_id = %u group_id = %u ); callback = %p\n", node_id, group_id, v_fs_get_alias_user_func(17));
- else
- printf("receive: verse_send_tag_group_subscribe(node_id = %u group_id = %u ); callback = %p\n", node_id, group_id, v_fs_get_user_func(17));
-#endif
- if(!alias_bool)
- {
- void (* alias_tag_group_unsubscribe)(void *user_data, VNodeID node_id, uint16 group_id);
- alias_tag_group_unsubscribe = v_fs_get_alias_user_func(17);
- if(alias_tag_group_unsubscribe != NULL)
- alias_tag_group_unsubscribe(v_fs_get_alias_user_data(17), node_id, group_id);
- return buffer_pos;
- }
- if(func_tag_group_subscribe != NULL)
- func_tag_group_subscribe(v_fs_get_user_data(17), node_id, group_id);
-
- return buffer_pos;
-}
-
-void verse_send_tag_create(VNodeID node_id, uint16 group_id, uint16 tag_id, const char *name, VNTagType type, const VNTag *tag)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 18); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_tag_create(node_id = %u group_id = %u tag_id = %u name = %s type = %u tag = %p );\n", node_id, group_id, tag_id, name, type, tag);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], group_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], tag_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], name, 16);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)type);
- if(type > VN_TAG_BLOB)
- {
- v_cmd_buf_free(head);
- return;
- }
- switch(type)
- {
- case VN_TAG_BOOLEAN :
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], ((VNTag *)tag)->vboolean);
- break;
- case VN_TAG_UINT32 :
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], ((VNTag *)tag)->vuint32);
- break;
- case VN_TAG_REAL64 :
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], ((VNTag *)tag)->vreal64);
- break;
- case VN_TAG_STRING :
- {
- unsigned int i;
- for(i = 0; ((VNTag *)tag)->vstring[i] != 0 && i < VN_TAG_MAX_BLOB_SIZE; i++)
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], ((VNTag *)tag)->vstring[i]);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 0);
- }
- break;
- case VN_TAG_REAL64_VEC3 :
- {
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], ((VNTag *)tag)->vreal64_vec3[0]);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], ((VNTag *)tag)->vreal64_vec3[1]);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], ((VNTag *)tag)->vreal64_vec3[2]);
- }
- break;
- case VN_TAG_LINK :
- {
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], ((VNTag *)tag)->vlink);
- }
- break;
- case VN_TAG_ANIMATION :
- {
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], ((VNTag *)tag)->vanimation.curve);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], ((VNTag *)tag)->vanimation.start);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], ((VNTag *)tag)->vanimation.end);
- }
- break;
- case VN_TAG_BLOB :
- {
- unsigned int i;
- if(((VNTag *)tag)->vblob.size > VN_TAG_MAX_BLOB_SIZE)
- ((VNTag *)tag)->vblob.size = VN_TAG_MAX_BLOB_SIZE;
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], ((VNTag *)tag)->vblob.size);
- for(i = 0; i < ((VNTag *)tag)->vblob.size; i++)
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], ((uint8 *)((VNTag *)tag)->vblob.blob)[i]);
- }
- break;
- default :
- ;
- }
- if(node_id == (uint32) ~0u || group_id == (uint16) ~0u || tag_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 9);
- else
- v_cmd_buf_set_address_size(head, 9);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_tag_destroy(VNodeID node_id, uint16 group_id, uint16 tag_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 18); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_tag_destroy(node_id = %u group_id = %u tag_id = %u );\n", node_id, group_id, tag_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], group_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], tag_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)-1);
- if(node_id == (uint32) ~0u || group_id == (uint16) ~0u || tag_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 9);
- else
- v_cmd_buf_set_address_size(head, 9);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_tag_create(const char *buf, size_t buffer_length)
-{
- uint8 enum_temp;
- unsigned int buffer_pos = 0;
- void (* func_tag_create)(void *user_data, VNodeID node_id, uint16 group_id, uint16 tag_id, const char *name, VNTagType type, const VNTag *tag);
- VNodeID node_id;
- uint16 group_id;
- uint16 tag_id;
- char name[16];
- VNTagType type;
- const VNTag *tag;
-
- func_tag_create = v_fs_get_user_func(18);
- if(buffer_length < 8)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &group_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &tag_id);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], name, 16, buffer_length - buffer_pos);
- if(buffer_length < 1 + buffer_pos)
- return -1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &enum_temp);
- type = (VNTagType)enum_temp;
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(type >= VN_TAG_TYPE_COUNT)
- printf("receive: verse_send_tag_destroy(node_id = %u group_id = %u tag_id = %u ); callback = %p\n", node_id, group_id, tag_id, v_fs_get_alias_user_func(18));
- else
- printf("receive: verse_send_tag_create(node_id = %u group_id = %u tag_id = %u name = %s type = %u ); callback = %p\n", node_id, group_id, tag_id, name, type, v_fs_get_user_func(18));
-#endif
- if(type < VN_TAG_TYPE_COUNT)
- {
- VNTag tag;
- unsigned int i;
- char string[VN_TAG_MAX_BLOB_SIZE];
- switch(type)
- {
- case VN_TAG_BOOLEAN :
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &tag.vboolean);
- break;
- case VN_TAG_UINT32 :
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &tag.vuint32);
- break;
- case VN_TAG_REAL64 :
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &tag.vreal64);
- break;
- case VN_TAG_STRING :
- {
- tag.vstring = string;
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], string, VN_TAG_MAX_BLOB_SIZE, buffer_length - buffer_pos);
- }
- break;
- case VN_TAG_REAL64_VEC3 :
- {
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &tag.vreal64_vec3[0]);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &tag.vreal64_vec3[1]);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &tag.vreal64_vec3[2]);
- }
- break;
- case VN_TAG_LINK :
- {
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &tag.vlink);
- }
- break;
- case VN_TAG_ANIMATION :
- {
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &tag.vanimation.curve);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &tag.vanimation.start);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &tag.vanimation.end);
- }
- break;
- case VN_TAG_BLOB :
- {
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &tag.vblob.size);
- if(tag.vblob.size > VN_TAG_MAX_BLOB_SIZE)
- tag.vblob.size = VN_TAG_MAX_BLOB_SIZE;
- tag.vblob.blob = string;
- for(i = 0; i < tag.vblob.size; i++)
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &string[i]);
- }
- break;
- default :
- ;
- }
- if(func_tag_create != NULL)
- func_tag_create(v_fs_get_user_data(18), node_id, group_id, tag_id, name, type, &tag);
- return buffer_pos;
- }
-
- if(type >= VN_TAG_TYPE_COUNT)
- {
- void (* alias_tag_destroy)(void *user_data, VNodeID node_id, uint16 group_id, uint16 tag_id);
- alias_tag_destroy = v_fs_get_alias_user_func(18);
- if(alias_tag_destroy != NULL)
- alias_tag_destroy(v_fs_get_alias_user_data(18), node_id, group_id, tag_id);
- return buffer_pos;
- }
- if(func_tag_create != NULL)
- func_tag_create(v_fs_get_user_data(18), node_id, group_id, tag_id, name, (VNTagType) type, tag);
-
- return buffer_pos;
-}
-
-void verse_send_node_name_set(VNodeID node_id, const char *name)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 19); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_node_name_set(node_id = %u name = %s );\n", node_id, name);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], name, 512);
- if(node_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 5);
- else
- v_cmd_buf_set_address_size(head, 5);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_node_name_set(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_node_name_set)(void *user_data, VNodeID node_id, const char *name);
- VNodeID node_id;
- char name[512];
-
- func_node_name_set = v_fs_get_user_func(19);
- if(buffer_length < 4)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], name, 512, buffer_length - buffer_pos);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_node_name_set(node_id = %u name = %s ); callback = %p\n", node_id, name, v_fs_get_user_func(19));
-#endif
- if(func_node_name_set != NULL)
- func_node_name_set(v_fs_get_user_data(19), node_id, name);
-
- return buffer_pos;
-}
-
-#endif
-
diff --git a/extern/verse/dist/v_gen_pack_t_node.c b/extern/verse/dist/v_gen_pack_t_node.c
deleted file mode 100644
index 0cfbf8b7f21..00000000000
--- a/extern/verse/dist/v_gen_pack_t_node.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
-** This is automatically generated source code -- do not edit.
-** Changes are affected either by editing the corresponding protocol
-** definition file (v_cmd_def_X.c where X=node type), or by editing
-** the code generator itself, in v_cmd_gen.c.
-*/
-
-#include
-#include
-
-#include "v_cmd_gen.h"
-#if !defined(V_GENERATE_FUNC_MODE)
-#include "verse.h"
-#include "v_cmd_buf.h"
-#include "v_network_out_que.h"
-#include "v_network.h"
-#include "v_connection.h"
-#include "v_util.h"
-
-void verse_send_t_language_set(VNodeID node_id, const char *language)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 96); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_t_language_set(node_id = %u language = %s );\n", node_id, language);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], language, 512);
- if(node_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 5);
- else
- v_cmd_buf_set_address_size(head, 5);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_t_language_set(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_t_language_set)(void *user_data, VNodeID node_id, const char *language);
- VNodeID node_id;
- char language[512];
-
- func_t_language_set = v_fs_get_user_func(96);
- if(buffer_length < 4)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], language, 512, buffer_length - buffer_pos);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_t_language_set(node_id = %u language = %s ); callback = %p\n", node_id, language, v_fs_get_user_func(96));
-#endif
- if(func_t_language_set != NULL)
- func_t_language_set(v_fs_get_user_data(96), node_id, language);
-
- return buffer_pos;
-}
-
-void verse_send_t_buffer_create(VNodeID node_id, VBufferID buffer_id, const char *name)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 97); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_t_buffer_create(node_id = %u buffer_id = %u name = %s );\n", node_id, buffer_id, name);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], buffer_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], name, 16);
- if(node_id == (uint32) ~0u || buffer_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_t_buffer_destroy(VNodeID node_id, VBufferID buffer_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 97); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_t_buffer_destroy(node_id = %u buffer_id = %u );\n", node_id, buffer_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], buffer_id);
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
- if(node_id == (uint32) ~0u || buffer_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_t_buffer_create(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_t_buffer_create)(void *user_data, VNodeID node_id, VBufferID buffer_id, const char *name);
- VNodeID node_id;
- VBufferID buffer_id;
- char name[16];
-
- func_t_buffer_create = v_fs_get_user_func(97);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &buffer_id);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], name, 16, buffer_length - buffer_pos);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(name[0] == 0)
- printf("receive: verse_send_t_buffer_destroy(node_id = %u buffer_id = %u ); callback = %p\n", node_id, buffer_id, v_fs_get_alias_user_func(97));
- else
- printf("receive: verse_send_t_buffer_create(node_id = %u buffer_id = %u name = %s ); callback = %p\n", node_id, buffer_id, name, v_fs_get_user_func(97));
-#endif
- if(name[0] == 0)
- {
- void (* alias_t_buffer_destroy)(void *user_data, VNodeID node_id, VBufferID buffer_id);
- alias_t_buffer_destroy = v_fs_get_alias_user_func(97);
- if(alias_t_buffer_destroy != NULL)
- alias_t_buffer_destroy(v_fs_get_alias_user_data(97), node_id, buffer_id);
- return buffer_pos;
- }
- if(func_t_buffer_create != NULL)
- func_t_buffer_create(v_fs_get_user_data(97), node_id, buffer_id, name);
-
- return buffer_pos;
-}
-
-void verse_send_t_buffer_subscribe(VNodeID node_id, VBufferID buffer_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 98); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_t_buffer_subscribe(node_id = %u buffer_id = %u );\n", node_id, buffer_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], buffer_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], TRUE);
- if(node_id == (uint32) ~0u || buffer_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_t_buffer_unsubscribe(VNodeID node_id, VBufferID buffer_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 98); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_t_buffer_unsubscribe(node_id = %u buffer_id = %u );\n", node_id, buffer_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], buffer_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], FALSE);
- if(node_id == (uint32) ~0u || buffer_id == (uint16) ~0u)
- v_cmd_buf_set_unique_address_size(head, 7);
- else
- v_cmd_buf_set_address_size(head, 7);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_t_buffer_subscribe(const char *buf, size_t buffer_length)
-{
- unsigned int buffer_pos = 0;
- void (* func_t_buffer_subscribe)(void *user_data, VNodeID node_id, VBufferID buffer_id);
- VNodeID node_id;
- VBufferID buffer_id;
- uint8 alias_bool;
-
- func_t_buffer_subscribe = v_fs_get_user_func(98);
- if(buffer_length < 6)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &buffer_id);
- if(buffer_length < buffer_pos + 1)
- return -1;
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &alias_bool);
-#if defined V_PRINT_RECEIVE_COMMANDS
- if(!alias_bool)
- printf("receive: verse_send_t_buffer_unsubscribe(node_id = %u buffer_id = %u ); callback = %p\n", node_id, buffer_id, v_fs_get_alias_user_func(98));
- else
- printf("receive: verse_send_t_buffer_subscribe(node_id = %u buffer_id = %u ); callback = %p\n", node_id, buffer_id, v_fs_get_user_func(98));
-#endif
- if(!alias_bool)
- {
- void (* alias_t_buffer_unsubscribe)(void *user_data, VNodeID node_id, VBufferID buffer_id);
- alias_t_buffer_unsubscribe = v_fs_get_alias_user_func(98);
- if(alias_t_buffer_unsubscribe != NULL)
- alias_t_buffer_unsubscribe(v_fs_get_alias_user_data(98), node_id, buffer_id);
- return buffer_pos;
- }
- if(func_t_buffer_subscribe != NULL)
- func_t_buffer_subscribe(v_fs_get_user_data(98), node_id, buffer_id);
-
- return buffer_pos;
-}
-
-#endif
-
diff --git a/extern/verse/dist/v_gen_unpack_func.h b/extern/verse/dist/v_gen_unpack_func.h
deleted file mode 100644
index 462777608c7..00000000000
--- a/extern/verse/dist/v_gen_unpack_func.h
+++ /dev/null
@@ -1,63 +0,0 @@
-extern unsigned int v_unpack_connect(const char *data, size_t length);
-extern unsigned int v_unpack_connect_accept(const char *data, size_t length);
-extern unsigned int v_unpack_connect_terminate(const char *data, size_t length);
-extern unsigned int v_unpack_ping(const char *data, size_t length);
-extern unsigned int v_unpack_packet_ack(const char *data, size_t length);
-extern unsigned int v_unpack_packet_nak(const char *data, size_t length);
-extern unsigned int v_unpack_node_index_subscribe(const char *data, size_t length);
-extern unsigned int v_unpack_node_create(const char *data, size_t length);
-extern unsigned int v_unpack_node_subscribe(const char *data, size_t length);
-extern unsigned int v_unpack_tag_group_create(const char *data, size_t length);
-extern unsigned int v_unpack_tag_group_subscribe(const char *data, size_t length);
-extern unsigned int v_unpack_tag_create(const char *data, size_t length);
-extern unsigned int v_unpack_node_name_set(const char *data, size_t length);
-extern unsigned int v_unpack_o_transform_pos_real32(const char *data, size_t length);
-extern unsigned int v_unpack_o_transform_rot_real32(const char *data, size_t length);
-extern unsigned int v_unpack_o_transform_scale_real32(const char *data, size_t length);
-extern unsigned int v_unpack_o_transform_pos_real64(const char *data, size_t length);
-extern unsigned int v_unpack_o_transform_rot_real64(const char *data, size_t length);
-extern unsigned int v_unpack_o_transform_scale_real64(const char *data, size_t length);
-extern unsigned int v_unpack_o_transform_subscribe(const char *data, size_t length);
-extern unsigned int v_unpack_o_light_set(const char *data, size_t length);
-extern unsigned int v_unpack_o_link_set(const char *data, size_t length);
-extern unsigned int v_unpack_o_method_group_create(const char *data, size_t length);
-extern unsigned int v_unpack_o_method_group_subscribe(const char *data, size_t length);
-extern unsigned int v_unpack_o_method_create(const char *data, size_t length);
-extern unsigned int v_unpack_o_method_call(const char *data, size_t length);
-extern unsigned int v_unpack_o_anim_run(const char *data, size_t length);
-extern unsigned int v_unpack_o_hide(const char *data, size_t length);
-extern unsigned int v_unpack_g_layer_create(const char *data, size_t length);
-extern unsigned int v_unpack_g_layer_subscribe(const char *data, size_t length);
-extern unsigned int v_unpack_g_vertex_set_xyz_real32(const char *data, size_t length);
-extern unsigned int v_unpack_g_vertex_set_xyz_real64(const char *data, size_t length);
-extern unsigned int v_unpack_g_vertex_set_uint32(const char *data, size_t length);
-extern unsigned int v_unpack_g_vertex_set_real64(const char *data, size_t length);
-extern unsigned int v_unpack_g_vertex_set_real32(const char *data, size_t length);
-extern unsigned int v_unpack_g_polygon_set_corner_uint32(const char *data, size_t length);
-extern unsigned int v_unpack_g_polygon_set_corner_real64(const char *data, size_t length);
-extern unsigned int v_unpack_g_polygon_set_corner_real32(const char *data, size_t length);
-extern unsigned int v_unpack_g_polygon_set_face_uint8(const char *data, size_t length);
-extern unsigned int v_unpack_g_polygon_set_face_uint32(const char *data, size_t length);
-extern unsigned int v_unpack_g_polygon_set_face_real64(const char *data, size_t length);
-extern unsigned int v_unpack_g_polygon_set_face_real32(const char *data, size_t length);
-extern unsigned int v_unpack_g_crease_set_vertex(const char *data, size_t length);
-extern unsigned int v_unpack_g_crease_set_edge(const char *data, size_t length);
-extern unsigned int v_unpack_g_bone_create(const char *data, size_t length);
-extern unsigned int v_unpack_m_fragment_create(const char *data, size_t length);
-extern unsigned int v_unpack_b_dimensions_set(const char *data, size_t length);
-extern unsigned int v_unpack_b_layer_create(const char *data, size_t length);
-extern unsigned int v_unpack_b_layer_subscribe(const char *data, size_t length);
-extern unsigned int v_unpack_b_tile_set(const char *data, size_t length);
-extern unsigned int v_unpack_t_language_set(const char *data, size_t length);
-extern unsigned int v_unpack_t_buffer_create(const char *data, size_t length);
-extern unsigned int v_unpack_t_buffer_subscribe(const char *data, size_t length);
-extern unsigned int v_unpack_t_text_set(const char *data, size_t length);
-extern unsigned int v_unpack_c_curve_create(const char *data, size_t length);
-extern unsigned int v_unpack_c_curve_subscribe(const char *data, size_t length);
-extern unsigned int v_unpack_c_key_set(const char *data, size_t length);
-extern unsigned int v_unpack_a_buffer_create(const char *data, size_t length);
-extern unsigned int v_unpack_a_buffer_subscribe(const char *data, size_t length);
-extern unsigned int v_unpack_a_block_set(const char *data, size_t length);
-extern unsigned int v_unpack_a_stream_create(const char *data, size_t length);
-extern unsigned int v_unpack_a_stream_subscribe(const char *data, size_t length);
-extern unsigned int v_unpack_a_stream(const char *data, size_t length);
diff --git a/extern/verse/dist/v_gen_unpack_funcs.h b/extern/verse/dist/v_gen_unpack_funcs.h
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/extern/verse/dist/v_internal_verse.h b/extern/verse/dist/v_internal_verse.h
deleted file mode 100644
index ce838351437..00000000000
--- a/extern/verse/dist/v_internal_verse.h
+++ /dev/null
@@ -1,2 +0,0 @@
-extern void verse_send_packet_ack(uint32 packet_id);
-extern void verse_send_packet_nak(uint32 packet_id);
diff --git a/extern/verse/dist/v_man_pack_node.c b/extern/verse/dist/v_man_pack_node.c
deleted file mode 100644
index cc85c4383df..00000000000
--- a/extern/verse/dist/v_man_pack_node.c
+++ /dev/null
@@ -1,498 +0,0 @@
-/*
-**
-*/
-
-#include
-#include
-#include
-
-#include "v_cmd_gen.h"
-
-#if !defined V_GENERATE_FUNC_MODE
-
-#include "verse.h"
-#include "v_cmd_buf.h"
-#include "v_network_out_que.h"
-#include "v_network.h"
-#include "v_connection.h"
-#include "v_encryption.h"
-
-unsigned int v_unpack_connect(const char *buf, unsigned int buffer_length)
-{
- return -1; /* this command is illegal to send */
-}
-
-unsigned int v_unpack_connect_accept(const char *buf, unsigned int buffer_length)
-{
- return -1; /* this command is illegal to send */
-}
-
-extern void v_callback_connect_terminate(const char *bye);
-
-unsigned int v_unpack_connect_terminate(const char *buf, unsigned int buffer_length)
-{
- unsigned int buffer_pos = 0;
- char bye[512];
-
- buffer_pos = vnp_raw_unpack_string(buf, bye, sizeof bye, buffer_length);
- v_callback_connect_terminate(bye);
-
- return buffer_pos;
-}
-
-static unsigned int pack_b_tile_set_head(VCMDBufHead *head, VNodeID node_id, VLayerID layer_id, uint16 tile_x, uint16 tile_y, uint16 z, VNBLayerType type, const VNBTile *tile)
-{
- unsigned int buffer_pos = 0;
- uint8 *buf;
- buf = ((VCMDBuffer30 *)head)->buf;
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 83); /* Pack the command. */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_b_tile_set(node_id = %u layer_id = %u tile_x = %u tile_y = %u z = %u type = %u tile = %p );\n", node_id, layer_id, tile_x, tile_y, z, type, tile);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], tile_x);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], tile_y);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], z);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)type);
- return buffer_pos;
- v_cmd_buf_set_address_size(head, 13);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_b_tile_set(VNodeID node_id, VLayerID layer_id, uint16 tile_x, uint16 tile_y, uint16 z, VNBLayerType type, const VNBTile *tile)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
-
- switch(type)
- {
- case VN_B_LAYER_UINT1 :
- head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
- buf = ((VCMDBuffer30 *)head)->buf;
- buffer_pos += pack_b_tile_set_head(head, node_id, layer_id, tile_x, tile_y, z, type, tile);
- buffer_pos += vnp_raw_pack_uint8_vector(&buf[buffer_pos], tile->vuint1, VN_B_TILE_SIZE * VN_B_TILE_SIZE / 8);
- break;
- case VN_B_LAYER_UINT8 :
- head = v_cmd_buf_allocate(VCMDBS_80);/* Allocating the buffer */
- buf = ((VCMDBuffer80 *)head)->buf;
- buffer_pos += pack_b_tile_set_head(head, node_id, layer_id, tile_x, tile_y, z, type, tile);
- buffer_pos += vnp_raw_pack_uint8_vector(&buf[buffer_pos], tile->vuint8, VN_B_TILE_SIZE * VN_B_TILE_SIZE);
- break;
- case VN_B_LAYER_UINT16 :
- head = v_cmd_buf_allocate(VCMDBS_160);/* Allocating the buffer */
- buf = ((VCMDBuffer160 *)head)->buf;
- buffer_pos += pack_b_tile_set_head(head, node_id, layer_id, tile_x, tile_y, z, type, tile);
- buffer_pos += vnp_raw_pack_uint16_vector(&buf[buffer_pos], tile->vuint16, VN_B_TILE_SIZE * VN_B_TILE_SIZE);
- break;
- case VN_B_LAYER_REAL32 :
- head = v_cmd_buf_allocate(VCMDBS_320);/* Allocating the buffer */
- buf = ((VCMDBuffer320 *)head)->buf;
- buffer_pos += pack_b_tile_set_head(head, node_id, layer_id, tile_x, tile_y, z, type, tile);
- buffer_pos += vnp_raw_pack_real32_vector(&buf[buffer_pos], tile->vreal32, VN_B_TILE_SIZE * VN_B_TILE_SIZE);
- break;
- case VN_B_LAYER_REAL64 :
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
- buffer_pos += pack_b_tile_set_head(head, node_id, layer_id, tile_x, tile_y, z, type, tile);
- buffer_pos += vnp_raw_pack_real64_vector(&buf[buffer_pos], tile->vreal64, VN_B_TILE_SIZE * VN_B_TILE_SIZE);
- break;
- default:
- head = NULL;
- }
- v_cmd_buf_set_address_size(head, 13);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_b_tile_set(const char *buf, size_t buffer_length)
-{
- uint8 enum_temp;
- unsigned int buffer_pos = 0;
- void (* func_b_tile_set)(void *user_data, VNodeID node_id, VLayerID layer_id, uint16 tile_x, uint16 tile_y, uint16 z, VNBLayerType type, const VNBTile *tile);
- VNodeID node_id;
- VLayerID layer_id;
- uint16 tile_x;
- uint16 tile_y;
- uint16 z;
- VNBLayerType type;
- const VNBTile *tile;
-
- func_b_tile_set = v_fs_get_user_func(83);
- if(buffer_length < 12)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &tile_x);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &tile_y);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &z);
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &enum_temp);
- type = (VNBLayerType)enum_temp;
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_b_tile_set(node_id = %u layer_id = %u tile_x = %u tile_y = %u z = %u type = %u ); callback = %p\n", node_id, layer_id, tile_x, tile_y, z, type, v_fs_get_user_func(83));
-#endif
- {
- VNBTile tile;
- switch(type)
- {
- case VN_B_LAYER_UINT1 :
- buffer_pos += vnp_raw_unpack_uint8_vector(&buf[buffer_pos], tile.vuint1, VN_B_TILE_SIZE * VN_B_TILE_SIZE / 8);
- break;
- case VN_B_LAYER_UINT8 :
- buffer_pos += vnp_raw_unpack_uint8_vector(&buf[buffer_pos], tile.vuint8, VN_B_TILE_SIZE * VN_B_TILE_SIZE);
- break;
- case VN_B_LAYER_UINT16 :
- buffer_pos += vnp_raw_unpack_uint16_vector(&buf[buffer_pos], tile.vuint16, VN_B_TILE_SIZE * VN_B_TILE_SIZE);
- break;
- case VN_B_LAYER_REAL32 :
- buffer_pos += vnp_raw_unpack_real32_vector(&buf[buffer_pos], tile.vreal32, VN_B_TILE_SIZE * VN_B_TILE_SIZE);
- break;
- case VN_B_LAYER_REAL64 :
- buffer_pos += vnp_raw_unpack_real64_vector(&buf[buffer_pos], tile.vreal64, VN_B_TILE_SIZE * VN_B_TILE_SIZE);
- break;
- }
- if(func_b_tile_set != NULL && type <= VN_B_LAYER_REAL64)
- func_b_tile_set(v_fs_get_user_data(83), node_id, layer_id, tile_x, tile_y, z, type, &tile);
- return buffer_pos;
- }
-
- if(func_b_tile_set != NULL)
- func_b_tile_set(v_fs_get_user_data(83), node_id, layer_id, tile_x, tile_y, z, (VNBLayerType)type, tile);
-
- return buffer_pos;
-}
-
-typedef struct VTempText VTempText;
-
-struct VTempText {
- VNodeID node_id;
- VBufferID buffer_id;
- uint32 pos;
- uint32 length;
- uint16 index;
- char *text;
- VTempText *next;
-};
-
-typedef struct {
- VTempText *text_temp;
- uint16 text_send_id;
- uint16 text_receive_id;
-} VOrderedStorage;
-
-VOrderedStorage * v_create_ordered_storage(void)
-{
- VOrderedStorage *s;
-
- s = malloc(sizeof *s);
- s->text_temp = NULL;
- s->text_send_id = 0;
- s->text_receive_id = 0;
- return s;
-}
-
-void v_destroy_ordered_storage(VOrderedStorage *s)
-{
- VTempText *line, *next;
-
- for(line = s->text_temp; line != NULL; line = next)
- {
- next = line->next;
- if(line->text != NULL)
- free(line->text);
- free(line);
- }
- free(s);
-}
-
-void verse_send_t_text_set(VNodeID node_id, VBufferID buffer_id, uint32 pos, uint32 length, const char *text)
-{
- uint8 *buf;
- VOrderedStorage *s;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 99);/* Packing the command */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_t_text_set(node_id = %u buffer_id = %u pos = %u length = %u text = %s );\n", node_id, buffer_id, pos, length, text);
-#endif
- s = v_con_get_ordered_storage();
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], buffer_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], pos);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], length);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], s->text_send_id++);
- if(text == NULL)
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 0);
- else
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], text, VN_T_MAX_TEXT_CMD_SIZE);
- v_cmd_buf_set_unique_address_size(head, buffer_pos);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-static void call_text_set(VTempText *line)
-{
- const char *t;
- void (* func_t_text_set)(void *user_data, VNodeID node_id, VBufferID buffer_id, uint32 pos, uint16 length, const char *text);
-
- func_t_text_set = v_fs_get_user_func(99);
-#if defined V_PRINT_RECEIVE_COMMANDS
- printf("receive: verse_send_t_text_set(node_id = %u buffer_id = %u pos = %u length = %u text = %s ); callback = %p\n", line->node_id, line->buffer_id, line->pos, line->length, line->text, v_fs_get_user_func(99));
-#endif
- if(line->text == NULL)
- t = "";
- else
- t = line->text;
- if(func_t_text_set != NULL)
- func_t_text_set(v_fs_get_user_data(99), line->node_id, line->buffer_id, line->pos, line->length, t);
-}
-
-unsigned int v_unpack_t_text_set(const char *buf, size_t buffer_length)
-{
- unsigned int i, buffer_pos = 0;
- VOrderedStorage *s;
- VTempText l, *line, *past = NULL;
- char text[1500];
-
- if(buffer_length < 12)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &l.node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &l.buffer_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &l.pos);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &l.length);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &l.index);
- buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], text, sizeof text, buffer_length - buffer_pos);
- if(text[0] == 0)
- l.text = NULL;
- else
- l.text = text;
- s = v_con_get_ordered_storage();
- if(s->text_receive_id == l.index)
- {
- call_text_set(&l);
- s->text_receive_id++;
- line = s->text_temp;
- while(line != NULL)
- {
- if(line->index == s->text_receive_id)
- {
- call_text_set(line);
- if(past == NULL)
- s->text_temp = line->next;
- else
- past->next = line->next;
- if(line->text != NULL)
- free(line->text);
- past = NULL;
- free(line);
- line = s->text_temp;
- s->text_receive_id++;
- }
- else
- {
- past = line;
- line = line->next;
- }
- }
- }
- else
- {
- line = malloc(sizeof *line);
- *line = l;
- line->next = s->text_temp;
- s->text_temp = line;
- i = strlen(text);
- if(i > 0)
- {
- line->text = malloc(i + 1);
- strcpy(line->text, text);
- }
- else
- line->text = NULL;
- }
- return buffer_pos;
-}
-
-void verse_send_c_key_set(VNodeID node_id, VLayerID curve_id, uint32 key_id, uint8 dimensions,
- const real64 *pre_value, const uint32 *pre_pos,
- const real64 *value, real64 pos,
- const real64 *post_value, const uint32 *post_pos)
-{
- uint8 *buf;
- unsigned int i, buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- if(dimensions == 0 || dimensions > 4)
- return;
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 130);/* Packing the command */
-#if defined V_PRINT_SEND_COMMANDS
- switch(dimensions)
- {
- case 1:
- printf("send: verse_send_c_key_set(node_id = %u curve_id = %u key_id = %u dimensions = %u pre_value = %f pre_pos = %u value = %f pos = %f, pre_value = %f pre_pos = %u ); callback = %p\n", node_id, curve_id, key_id, dimensions, pre_value[0], pre_pos[0], value[0], pos, pre_value[0], pre_pos[0], v_fs_get_user_func(130));
- break;
- case 2:
- printf("sende: verse_send_c_key_set(node_id = %u curve_id = %u key_id = %u dimensions = %u pre_value = {%f, %f} pre_pos = {%u, %u} value = {%f, %f} pos = %f, pre_value = {%f, %f} pre_pos = {%u, %u}); callback = %p\n",
- node_id, curve_id, key_id, dimensions,
- pre_value[0], pre_value[1],
- pre_pos[0], pre_pos[1],
- value[0], value[1], pos,
- pre_value[0], pre_value[1],
- pre_pos[0], pre_pos[1], v_fs_get_user_func(130));
- break;
- case 3:
- printf("send: verse_send_c_key_set(node_id = %u curve_id = %u key_id = %u dimensions = %u pre_value = {%f, %f, %f} pre_pos = {%u, %u, %u} value = {%f, %f, %f} pos = %f, pre_value = {%f, %f, %f} pre_pos = {%u, %u, %u}); callback = %p\n",
- node_id, curve_id, key_id, dimensions,
- pre_value[0], pre_value[1], pre_value[2],
- pre_pos[0], pre_pos[1], pre_pos[2],
- value[0], value[1], value[2], pos,
- pre_value[0], pre_value[1], pre_value[2],
- pre_pos[0], pre_pos[1], pre_pos[2], v_fs_get_user_func(130));
-
- break;
- case 4:
- printf("send: verse_send_c_key_set(node_id = %u curve_id = %u key_id = %u dimensions = %u pre_value = {%f, %f, %f, %f} pre_pos = {%u, %u, %u, %u} value = {%f, %f, %f, %f} pos = %f, pre_value = {%f, %f, %f, %f} pre_pos = {%u, %u, %u, %u}); callback = %p\n",
- node_id, curve_id, key_id, dimensions,
- pre_value[0], pre_value[1], pre_value[2], pre_value[3],
- pre_pos[0], pre_pos[1], pre_pos[2], pre_pos[3],
- value[0], value[1], value[2], value[3], pos,
- pre_value[0], pre_value[1], pre_value[2], pre_value[3],
- pre_pos[0], pre_pos[1], pre_pos[2], pre_pos[3], v_fs_get_user_func(130));
- break;
- }
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], curve_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], key_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], dimensions);
-
- for(i = 0; i < dimensions; i++)
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], pre_value[i]);
- for(i = 0; i < dimensions; i++)
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], pre_pos[i]);
- for(i = 0; i < dimensions; i++)
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], value[i]);
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], pos);
- for(i = 0; i < dimensions; i++)
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], post_value[i]);
- for(i = 0; i < dimensions; i++)
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], post_pos[i]);
-
- if(key_id == (uint32) ~0u)
- v_cmd_buf_set_unique_address_size(head, 11);
- else
- v_cmd_buf_set_address_size(head, 11);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-void verse_send_c_key_destroy(VNodeID node_id, VLayerID curve_id, uint32 key_id)
-{
- uint8 *buf;
- unsigned int buffer_pos = 0;
- VCMDBufHead *head;
- head = v_cmd_buf_allocate(VCMDBS_1500);/* Allocating the buffer */
- buf = ((VCMDBuffer10 *)head)->buf;
-
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 130);/* Packing the command */
-#if defined V_PRINT_SEND_COMMANDS
- printf("send: verse_send_c_key_destroy(node_id = %u curve_id = %u key_id = %u );\n", node_id, curve_id, key_id);
-#endif
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], curve_id);
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], key_id);
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 0);
- v_cmd_buf_set_address_size(head, 11);
- v_cmd_buf_set_size(head, buffer_pos);
- v_noq_send_buf(v_con_get_network_queue(), head);
-}
-
-unsigned int v_unpack_c_key_set(const char *buf, size_t buffer_length)
-{
- unsigned int i, buffer_pos = 0;
- VNodeID node_id;
- VLayerID curve_id;
- uint32 key_id;
- uint8 dimensions;
- real64 pre_value[4], value[4], pos, post_value[4];
- uint32 post_pos[4], pre_pos[4];
-
- if(buffer_length < 11)
- return -1;
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &curve_id);
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &key_id);
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &dimensions);
- if(dimensions != 0 && dimensions < 5)
- {
- void (* func_c_key_set)(void *user_data, VNodeID node_id, VLayerID curve_id, uint32 key_id, uint8 dimensions, real64 *pre_value, uint32 *pre_pos, real64 *value, real64 pos, real64 *post_value, uint32 *post_pos);
- for(i = 0; i < dimensions; i++)
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &pre_value[i]);
- for(i = 0; i < dimensions; i++)
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &pre_pos[i]);
- for(i = 0; i < dimensions; i++)
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &value[i]);
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &pos);
- for(i = 0; i < dimensions; i++)
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &post_value[i]);
- for(i = 0; i < dimensions; i++)
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &post_pos[i]);
- #if defined V_PRINT_RECEIVE_COMMANDS
- switch(dimensions)
- {
- case 1:
- printf("receive: verse_send_c_key_set(node_id = %u curve_id = %u key_id = %u dimensions = %u pre_value = %f pre_pos = %u value = %f pos = %f, pre_value = %f pre_pos = %u ); callback = %p\n", node_id, curve_id, key_id, dimensions, pre_value[0], pre_pos[0], value[0], pos, pre_value[0], pre_pos[0], v_fs_get_user_func(130));
- break;
- case 2:
- printf("receive: verse_send_c_key_set(node_id = %u curve_id = %u key_id = %u dimensions = %u pre_value = {%f, %f} pre_pos = {%u, %u} value = {%f, %f} pos = %f, pre_value = {%f, %f} pre_pos = {%u, %u}); callback = %p\n",
- node_id, curve_id, key_id, dimensions,
- pre_value[0], pre_value[1],
- pre_pos[0], pre_pos[1],
- value[0], value[1], pos,
- pre_value[0], pre_value[1],
- pre_pos[0], pre_pos[1], v_fs_get_user_func(130));
- break;
- case 3:
- printf("receive: verse_send_c_key_set(node_id = %u curve_id = %u key_id = %u dimensions = %u pre_value = {%f, %f, %f} pre_pos = {%u, %u, %u} value = {%f, %f, %f} pos = %f, pre_value = {%f, %f, %f} pre_pos = {%u, %u, %u}); callback = %p\n",
- node_id, curve_id, key_id, dimensions,
- pre_value[0], pre_value[1], pre_value[2],
- pre_pos[0], pre_pos[1], pre_pos[2],
- value[0], value[1], value[2], pos,
- pre_value[0], pre_value[1], pre_value[2],
- pre_pos[0], pre_pos[1], pre_pos[2], v_fs_get_user_func(130));
-
- break;
- case 4:
- printf("receive: verse_send_c_key_set(node_id = %u curve_id = %u key_id = %u dimensions = %u pre_value = {%f, %f, %f, %f} pre_pos = {%u, %u, %u, %u} value = {%f, %f, %f, %f} pos = %f, pre_value = {%f, %f, %f, %f} pre_pos = {%u, %u, %u, %u}); callback = %p\n",
- node_id, curve_id, key_id, dimensions,
- pre_value[0], pre_value[1], pre_value[2], pre_value[3],
- pre_pos[0], pre_pos[1], pre_pos[2], pre_pos[3],
- value[0], value[1], value[2], value[3], pos,
- pre_value[0], pre_value[1], pre_value[2], pre_value[3],
- pre_pos[0], pre_pos[1], pre_pos[2], pre_pos[3], v_fs_get_user_func(130));
- break;
- }
- #endif
- func_c_key_set = v_fs_get_user_func(130);
- if(func_c_key_set != NULL)
- func_c_key_set(v_fs_get_user_data(130), node_id, curve_id, key_id, dimensions, pre_value, pre_pos, value, pos, post_value, post_pos);
- return buffer_pos;
- }else
- {
- void (* alias_c_key_destroy)(void *user_data, VNodeID node_id, VLayerID curve_id, uint32 key_id);
- alias_c_key_destroy = v_fs_get_alias_user_func(130);
- printf("receive: verse_send_c_key_destroy(node_id = %u curve_id = %u key_id = %u); callback = %p\n", node_id, curve_id, key_id, alias_c_key_destroy);
- if(alias_c_key_destroy != NULL)
- alias_c_key_destroy(v_fs_get_alias_user_data(130), node_id, curve_id, key_id);
- return buffer_pos;
- }
-}
-
-#endif
diff --git a/extern/verse/dist/v_network.c b/extern/verse/dist/v_network.c
deleted file mode 100644
index 408cc20e393..00000000000
--- a/extern/verse/dist/v_network.c
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
-**
-*/
-
-#if defined _WIN32
-#include
-typedef unsigned int uint;
-typedef SOCKET VSocket;
-#else
-typedef int VSocket;
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#endif
-#include
-#include
-
-typedef unsigned int uint32;
-typedef int int32;
-typedef unsigned short uint16;
-typedef short int16;
-typedef unsigned char uint8;
-typedef char int8;
-typedef unsigned char boolean;
-
-#include "v_cmd_gen.h"
-#include "v_network.h"
-
-#if !defined socklen_t
-#define socklen_t int
-#endif
-
-#define TRUE 1
-#define FALSE 0
-
-typedef struct{
- struct sockaddr_in address;
- struct hostent *he;
-} VNetworkConnection;
-
-#define VERSE_STD_CONNECT_TO_PORT 4950
-
-static VSocket my_socket = -1;
-static uint16 my_port = 0;
-
-void v_n_set_port(unsigned short port)
-{
- my_port = port;
-}
-
-VSocket v_n_socket_create(void)
-{
- static boolean initialized = FALSE;
- struct sockaddr_in address;
- int buffer_size = 1 << 20;
-
- if(my_socket != -1)
- return my_socket;
-#if defined _WIN32
- if(!initialized)
- {
- WSADATA wsaData;
-
- if(WSAStartup(MAKEWORD(1, 1), &wsaData) != 0)
- {
- fprintf(stderr, "WSAStartup failed.\n");
- exit(1);
- }
-
- }
-#endif
- initialized = TRUE;
- if((my_socket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1)
- return -1;
-#if defined _WIN32
- {
- unsigned long one = 1UL;
- if(ioctlsocket(my_socket, FIONBIO, &one) != 0)
- return -1;
- }
-#else
- if(fcntl(my_socket, F_SETFL, O_NONBLOCK) != 0)
- {
- fprintf(stderr, "v_network: Couldn't make socket non-blocking\n");
- return -1;
- }
-#endif
- address.sin_family = AF_INET; /* host byte order */
- address.sin_port = htons(my_port); /* short, network byte order */
- address.sin_addr.s_addr = INADDR_ANY;
- if(bind(my_socket, (struct sockaddr *) &address, sizeof(struct sockaddr)) != 0)
- {
- fprintf(stderr, "v_network: Failed to bind(), code %d (%s)\n", errno, strerror(errno));
- exit(0); /* FIX ME */
- }
- if(setsockopt(my_socket, SOL_SOCKET, SO_SNDBUF, (const char *) &buffer_size, sizeof buffer_size) != 0)
- fprintf(stderr, "v_network: Couldn't set send buffer size of socket to %d\n", buffer_size);
- if(setsockopt(my_socket, SOL_SOCKET, SO_RCVBUF, (const char *) &buffer_size, sizeof buffer_size) != 0)
- fprintf(stderr, "v_network: Couldn't set receive buffer size of socket to %d\n", buffer_size);
- return my_socket;
-}
-
-void v_n_socket_destroy(void)
-{
-#if defined _WIN32
- closesocket(my_socket);
-#else
- close(my_socket);
-#endif
- my_socket = -1;
-}
-
-boolean v_n_set_network_address(VNetworkAddress *address, const char *host_name)
-{
- struct hostent *he;
- char *colon = NULL, *buf = NULL;
- boolean ok = FALSE;
-
- v_n_socket_create();
- address->port = VERSE_STD_CONNECT_TO_PORT;
- /* If a port number is included, as indicated by a colon, we need to work a bit more. */
- if((colon = strchr(host_name, ':')) != NULL)
- {
- size_t hl = strlen(host_name);
-
- if((buf = malloc(hl + 1)) != NULL)
- {
- unsigned int tp;
-
- strcpy(buf, host_name);
- colon = buf + (colon - host_name);
- *colon = '\0';
- host_name = buf;
- if(sscanf(colon + 1, "%u", &tp) == 1)
- {
- address->port = (unsigned short) tp;
- if(address->port != tp) /* Protect against overflow. */
- host_name = NULL;
- }
- else
- host_name = NULL; /* Protect against parse error. */
- }
- else
- return FALSE;
- }
- if(host_name != NULL && (he = gethostbyname(host_name)) != NULL)
- {
- memcpy(&address->ip, he->h_addr_list[0], he->h_length);
- address->ip = ntohl(address->ip);
- ok = TRUE;
- }
- if(buf != NULL)
- free(buf);
-
- return ok;
-}
-
-int v_n_send_data(VNetworkAddress *address, const char *data, size_t length)
-{
- struct sockaddr_in address_in;
- VSocket sock;
- int ret;
-
- if((sock = v_n_socket_create()) == -1 || length == 0)
- return 0;
- address_in.sin_family = AF_INET; /* host byte order */
- address_in.sin_port = htons(address->port); /* short, network byte order */
- address_in.sin_addr.s_addr = htonl(address->ip);
- memset(&address_in.sin_zero, 0, sizeof address_in.sin_zero);
- ret = sendto(sock, data, length, 0, (struct sockaddr *) &address_in, sizeof(struct sockaddr_in));
- if(ret < 0)
- fprintf(stderr, "Socket sendto() of %u bytes failed, code %d (%s)\n", (unsigned int) length, errno, strerror(errno));
- return ret;
-}
-
-#if !defined V_GENERATE_FUNC_MODE
-
-extern void *v_con_get_network_address_id(unsigned int id);
-extern unsigned int v_con_get_network_address_count();
-
-unsigned int v_n_wait_for_incoming(unsigned int microseconds)
-{
- struct timeval tv;
- fd_set fd_select;
- unsigned int s1, f1, s2, f2;
-
- if(microseconds == 0)
- return 0;
- v_n_socket_create();
- tv.tv_sec = microseconds / 1000000;
- tv.tv_usec = microseconds % 1000000;
- FD_ZERO(&fd_select);
- FD_SET(my_socket, &fd_select);
- v_n_get_current_time(&s1, &f1);
- select(1, &fd_select, NULL, NULL, &tv);
- v_n_get_current_time(&s2, &f2);
- return (unsigned int) (1000000 * (s2 - s1) + (1000000.0 / 0xffffffffu) * (long) (f2 - f1)); /* Must cast to (long) for f1 > f2 case! */
-}
-
-#endif
-
-int v_n_receive_data(VNetworkAddress *address, char *data, size_t length)
-{
- struct sockaddr_in address_in;
- socklen_t from_length = sizeof address_in;
- size_t len;
-
- if(v_n_socket_create() == -1)
- return 0;
- memset(&address_in, 0, sizeof address_in);
- address_in.sin_family = AF_INET;
- address_in.sin_port = htons(my_port);
- address_in.sin_addr.s_addr = INADDR_ANY;
- len = recvfrom(v_n_socket_create(), data, length, 0, (struct sockaddr *) &address_in, &from_length);
- if(len > 0)
- {
- address->ip = ntohl(address_in.sin_addr.s_addr);
- address->port = ntohs(address_in.sin_port);
- }
- return len;
-}
-
-#if defined _WIN32
-
-void v_n_get_current_time(uint32 *seconds, uint32 *fractions)
-{
- static LARGE_INTEGER frequency;
- static boolean init = FALSE;
- LARGE_INTEGER counter;
-
- if(!init)
- {
- init = TRUE;
- QueryPerformanceFrequency(&frequency);
- }
-
- QueryPerformanceCounter(&counter);
- if(seconds != NULL)
- *seconds = (uint32) (counter.QuadPart / frequency.QuadPart);
- if(fractions != NULL)
- *fractions = (uint32) ((0xffffffffUL * (counter.QuadPart % frequency.QuadPart)) / frequency.QuadPart);
-}
-
-#else
-
-void v_n_get_current_time(uint32 *seconds, uint32 *fractions)
-{
- struct timeval tv;
-
- gettimeofday(&tv, NULL);
- if(seconds != NULL)
- *seconds = tv.tv_sec;
- if(fractions != NULL)
- *fractions = tv.tv_usec * 1E-6 * (double) (uint32)~0;
-}
-
-#endif
-
-void v_n_get_address_string(const VNetworkAddress *address, char *string)
-{
- sprintf(string, "%u.%u.%u.%u:%u", address->ip >> 24, (address->ip >> 16) & 0xff,
- (address->ip >> 8) & 0xff, address->ip & 0xff, address->port);
-}
diff --git a/extern/verse/dist/v_network.h b/extern/verse/dist/v_network.h
deleted file mode 100644
index 52233cbe2bb..00000000000
--- a/extern/verse/dist/v_network.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-**
-*/
-
-#if !defined V_NETWORK_H
-#define V_NETWORK_H
-
-#define VERSE_STD_CONNECT_PORT 4950
-
-typedef struct{
- unsigned int ip;
- unsigned short port;
-}VNetworkAddress;
-
-extern void v_n_set_port(unsigned short port);
-extern unsigned int v_n_wait_for_incoming(unsigned int microseconds);
-extern boolean v_n_set_network_address(VNetworkAddress *address, const char *host_name);
-extern int v_n_send_data(VNetworkAddress *address, const char *data, size_t length);
-extern int v_n_receive_data(VNetworkAddress *address, char *data, size_t length);
-extern void v_n_get_address_string(const VNetworkAddress *address, char *string);
-
-extern void v_n_get_current_time(unsigned int *seconds, unsigned int *fractions);
-
-#endif /* V_NETWORK_H */
diff --git a/extern/verse/dist/v_network_in_que.c b/extern/verse/dist/v_network_in_que.c
deleted file mode 100644
index d99a4ad11ec..00000000000
--- a/extern/verse/dist/v_network_in_que.c
+++ /dev/null
@@ -1,140 +0,0 @@
-
-#include
-#include
-#include
-
-#include "verse_header.h"
-
-#include "v_cmd_buf.h"
-#include "v_cmd_gen.h"
-#include "v_connection.h"
-#include "v_internal_verse.h"
-#include "v_network.h"
-#include "v_pack.h"
-
-
-#if !defined(V_GENERATE_FUNC_MODE)
-
-#include "v_network_in_que.h"
-
-static VNetInPacked *v_niq_temp = NULL;
-
-void v_niq_clear(VNetInQueue *queue)
-{
- queue->oldest = NULL;
- queue->newest = NULL;
- queue->packet_id = 2;
- v_niq_timer_update(queue);
-}
-
-/* Set queue's last-used timestamp to "now". */
-void v_niq_timer_update(VNetInQueue *queue)
-{
- v_n_get_current_time(&queue->seconds, &queue->fractions);
- queue->acc_seconds = queue->acc_fractions = 0;
-}
-
-uint32 v_niq_time_out(VNetInQueue *queue)
-{
- uint32 fractions, f;
-
- /* Magic code to disregard if the clock moves forward more than one second at a time.
- * This should help keep Verse alive on e.g. a notebook that is suspended.
- */
- v_n_get_current_time(NULL, &fractions);
- if(fractions < queue->fractions)
- f = 0xffffffffu - queue->fractions + fractions;
- else
- f = fractions - queue->fractions;
-/* printf("now=%u last=%u -> f=%u\n", fractions, queue->fractions, f);*/
- if(queue->acc_fractions + f < queue->acc_fractions)
- queue->acc_seconds += 1;
- queue->acc_fractions += f;
- queue->fractions = fractions;
-
-/* printf("queue at %p has seconds=%u, now=%u -> diff=%u\n", queue, queue->seconds, seconds, seconds - queue->seconds);*/
- return queue->acc_seconds;
-}
-
-VNetInPacked * v_niq_get(VNetInQueue *queue, size_t *length)
-{
- VNetInPacked *p;
-
- if(queue->oldest == NULL)
- {
- *length = 0;
- return NULL;
- }
- /* pop oldest package */
- p = queue->oldest;
- queue->oldest = p->newer;
- if(queue->oldest == NULL)
- queue->newest = NULL;
- else
- ((VNetInPacked *)queue->oldest)->older = NULL;
- *length = p->size;
-
- return p;
-}
-
-unsigned int v_niq_free(VNetInQueue *queue)
-{
- unsigned int i;
- size_t length;
-
- for(i = 0; v_niq_get(queue, &length) != NULL; i++)
- ;
- return i;
-}
-
-void v_niq_release(VNetInQueue *queue, VNetInPacked *p)
-{
- /* push on v_niq_temp for re-use */
- p->older = v_niq_temp;
- v_niq_temp = p;
-}
-
-char *v_niq_store(VNetInQueue *queue, size_t length, unsigned int packet_id)
-{
- VNetInPacked *p;
-
- v_niq_timer_update(queue);
-
- if(packet_id < queue->packet_id)
- return NULL;
-
- while(queue->packet_id != packet_id)
- {
- verse_send_packet_nak(queue->packet_id++);
- if(queue->packet_id == 0)
- queue->packet_id++;
- }
- queue->packet_id++;
- if(queue->packet_id == 0)
- queue->packet_id++;
- verse_send_packet_ack(packet_id);
-
- if(v_niq_temp == NULL)
- p = malloc(sizeof *p);
- else
- {
- /* pop off v_niq_temp */
- p = v_niq_temp;
- v_niq_temp = p->older;
- }
- /* push as newest */
- p->older = queue->newest;
- p->newer = NULL;
-
- if(queue->newest == NULL)
- queue->oldest = p;
- else
- ((VNetInPacked *)queue->newest)->newer = p;
- queue->newest = p;
-
- p->size = length;
-
- return p->data;
-}
-
-#endif
diff --git a/extern/verse/dist/v_network_in_que.h b/extern/verse/dist/v_network_in_que.h
deleted file mode 100644
index 9241fe18fe8..00000000000
--- a/extern/verse/dist/v_network_in_que.h
+++ /dev/null
@@ -1,24 +0,0 @@
-
-typedef struct{
- void *oldest;
- void *newest;
- uint32 packet_id;
- uint32 seconds, fractions; /* Current time. */
- uint32 acc_seconds, acc_fractions; /* Accumulated time. */
-}VNetInQueue;
-
-typedef struct{
- void *newer;
- void *older;
- char data[1500];
- size_t size;
-}VNetInPacked;
-
-extern void v_niq_clear(VNetInQueue *queue);
-extern void v_niq_timer_update(VNetInQueue *queue);
-
-extern VNetInPacked * v_niq_get(VNetInQueue *queue, size_t *length);
-extern void v_niq_release(VNetInQueue *queue, VNetInPacked *p);
-extern char * v_niq_store(VNetInQueue *queue, size_t length, unsigned int packet_id);
-unsigned int v_niq_free(VNetInQueue *queue);
-extern uint32 v_niq_time_out(VNetInQueue *queue);
diff --git a/extern/verse/dist/v_network_out_que.c b/extern/verse/dist/v_network_out_que.c
deleted file mode 100644
index 10126a59779..00000000000
--- a/extern/verse/dist/v_network_out_que.c
+++ /dev/null
@@ -1,396 +0,0 @@
-/*
-**
-*/
-
-#include
-#include
-#include
-
-#include "verse_header.h"
-
-#include "v_cmd_buf.h"
-#include "v_cmd_gen.h"
-#include "v_connection.h"
-#include "v_network.h"
-#include "v_pack.h"
-#include "v_encryption.h"
-#include "v_network_out_que.h"
-#include "v_util.h"
-
-#if !defined(V_GENERATE_FUNC_MODE)
-
-#define STD_QUE_SIZE 64
-
-#define V_NOQ_OPTIMIZATION_SLOTS 2048
-
-#define V_NOQ_WINDOW_SIZE 100000
-#define V_NOQ_MAX_SORTED_COMMANDS 5000
-
-typedef struct{
- void *next;
- char *data;
- size_t size;
-} NetPacked;
-
-struct VNetOutQueue{
- uint8 packet_buffer[V_NOQ_MAX_PACKET_SIZE];
- size_t packet_buffer_use;
- NetPacked *packed;
- NetPacked *last;
- VCMDBufHead *unsent[V_NOQ_OPTIMIZATION_SLOTS];
- VCMDBufHead *history[V_NOQ_OPTIMIZATION_SLOTS];
- VCMDBufHead *ack_nak;
- VCMDBufHead *unsorted;
- VCMDBufHead *unsorted_end;
- uint32 unsorted_count; /* debug only */
- uint32 unsent_comands;
- size_t unsent_size;
- size_t sent_size;
- unsigned int packet_id;
- unsigned int slot;
- uint32 seconds;
- uint32 fractions;
-};
-
-size_t verse_session_get_size(void)
-{
- const VNetOutQueue *queue;
-
- queue = v_con_get_network_queue();
- return queue->unsent_size + queue->sent_size;
-}
-
-VNetOutQueue * v_noq_create_network_queue(void)
-{
- VNetOutQueue *queue;
- unsigned int i;
-
- queue = malloc(sizeof *queue);
- for(i = 0; i < V_NOQ_OPTIMIZATION_SLOTS; i++)
- {
- queue->unsent[i] = NULL;
- queue->history[i] = NULL;
- }
- queue->unsent_comands = 0;
- queue->unsent_size = 0;
- queue->sent_size = 0;
- queue->packet_id = 2;
- queue->slot = 0;
- queue->packed = NULL;
- queue->last = NULL;
- queue->ack_nak = NULL;
- queue->unsorted = NULL;
- queue->unsorted_end = NULL;
- queue->unsorted_count = 0;
- queue->packet_buffer_use = 0;
- v_n_get_current_time(&queue->seconds, &queue->fractions);
- return queue;
-}
-
-unsigned int v_noq_get_next_out_packet_id(VNetOutQueue *queue)
-{
- queue->packet_id++;
- if(queue->packet_id == 0)
- queue->packet_id++;
- return queue->packet_id;
-}
-
-void v_noq_destroy_network_queue(VNetOutQueue *queue)
-{
- VCMDBufHead *buf, *b;
- unsigned int i;
- for(i = 0; i < V_NOQ_OPTIMIZATION_SLOTS; i++)
- {
- for(buf = queue->history[i]; buf != NULL; buf = b)
- {
- b = buf->next;
- v_cmd_buf_free(buf);
- }
- for(buf = queue->unsent[i]; buf != NULL; buf = b)
- {
- b = buf->next;
- v_cmd_buf_free(buf);
- }
- }
- for(buf = queue->unsorted; buf != NULL; buf = b)
- {
- b = buf->next;
- v_cmd_buf_free(buf);
- }
- free(queue);
-}
-
-
-void v_noq_sort_and_collapse_buf(VNetOutQueue *queue, VCMDBufHead *buf)
-{
- VCMDBufHead *b, *last = NULL;
- unsigned int slot;
-
- slot = buf->address_sum % V_NOQ_OPTIMIZATION_SLOTS;
- queue->unsent_size += buf->size;
- queue->unsent_comands++;
- if(queue->unsent[slot] != NULL)
- {
- for(b = queue->unsent[slot]; !v_cmd_buf_compare(buf, b) && b->next != NULL; b = b->next)
- last = b;
- if(v_cmd_buf_compare(buf, b)) /* found a command to replace */
- {
- queue->unsent_size -= b->size;
- queue->unsent_comands--;
- if(last != NULL) /* if its not the first */
- last->next = buf;
- else
- queue->unsent[slot] = buf;
- buf->next = b->next;
- v_cmd_buf_free(b);
- }else /* inserting the command last in queue */
- {
- buf->next = NULL;
- b->next = buf;
- }
- }else /* inserting the first command */
- {
- queue->unsent[slot] = buf;
- buf->next = NULL;
- }
- if(queue->history[slot] != NULL) /* if there is a history clear it from any commnds with same address */
- {
- last = NULL;
- for(b = queue->history[slot]; b != NULL && !v_cmd_buf_compare(buf, b); b = b->next)
- last = b;
- if(b != NULL) /* found a command to replace */
- {
- if(last == NULL)
- queue->history[slot] = b->next;
- else
- last->next = b->next;
- queue->sent_size -= b->size;
- v_cmd_buf_free(b);
- }
- }
-}
-
-void v_noq_send_buf(VNetOutQueue *queue, VCMDBufHead *buf)
-{
- static int count = 0;
-/* if(queue->unsent_comands > V_NOQ_MAX_SORTED_COMMANDS)
- {
-
-*/ if(queue->unsorted == NULL)
- {
- queue->unsorted_end = buf;
- queue->unsorted = buf;
- }else
- {
- queue->unsorted_end->next = buf;
- queue->unsorted_end = buf;
- }
- queue->unsorted_count++;
-/* }else
- v_noq_sort_and_colapse_buf(queue, buf);
-*/ count = (count + 1) % 30;
- if(count == 0)
- {
- v_con_network_listen();
- v_noq_send_queue(queue, v_con_get_network_address());
- }
-}
-
-void v_noq_sort_unsorted(VNetOutQueue *queue)
-{
- VCMDBufHead *buf;
-
- while(queue->unsent_comands < V_NOQ_MAX_SORTED_COMMANDS && queue->unsorted != NULL)
- {
- buf = queue->unsorted;
- if(queue->unsorted == queue->unsorted_end)
- {
- queue->unsorted_end = NULL;
- queue->unsorted = NULL;
- }else
- {
- queue->unsorted = buf->next;
- buf->next = NULL;
- }
- queue->unsorted_count--;
- v_noq_sort_and_collapse_buf(queue, buf);
- }
-}
-
-boolean v_noq_send_queue(VNetOutQueue *queue, void *address)
-{
- static unsigned int my_counter = 0;
- VCMDBufHead *buf;
- unsigned int size;
- uint8 *data;
- uint32 seconds, fractions;
- double delta;
-
- data = queue->packet_buffer;
- v_n_get_current_time(&seconds, &fractions);
- delta = seconds - queue->seconds + (fractions - queue->fractions) / (double) 0xffffffff;
-
- if(queue->unsorted != NULL)
- v_noq_sort_unsorted(queue);
-
- if(queue->unsent_size == 0 && delta < 1.0 && (queue->ack_nak == NULL || queue->ack_nak->next == NULL))
- return FALSE;
-
- if(delta > 3.0 && queue->unsent_size == 0 && queue->ack_nak == NULL && queue->packet_buffer_use != 0)
- {
-/* printf("A) re-sending last delta=%g\n", delta);*/
- v_n_send_data(address, data, queue->packet_buffer_use);
- queue->seconds = seconds;
- queue->fractions = fractions;
- return TRUE;
- }
-
- size = 4;
- buf = queue->ack_nak;
- while(buf != NULL && size + buf->size < V_NOQ_MAX_PACKET_SIZE)
- {
- vnp_raw_pack_uint32(data, queue->packet_id);
- queue->ack_nak = buf->next;
- buf->next = queue->history[queue->slot];
- queue->history[queue->slot] = buf;
- buf->packet = queue->packet_id;
- v_e_data_encrypt_command(data, size, ((VCMDBuffer1500 *)buf)->buf, buf->size, v_con_get_data_key());
- size += buf->size;
- queue->sent_size += buf->size;
- buf = queue->ack_nak;
- }
- if(queue->unsent_size == 0 || queue->sent_size >= V_NOQ_WINDOW_SIZE)
- {
- if(size > 5)
- {
-/* printf("ACK: sending actual size=%u id=%u\n", size, queue->packet_id);*/
- v_n_send_data(address, data, size);
- queue->packet_buffer_use = size;
- queue->seconds = seconds;
- queue->fractions = fractions;
- queue->packet_id++;
- return TRUE;
- }
-/* printf("returning FALSE from send_queue()\n");*/
- return FALSE;
- }
-/* if(queue->sent_size < V_NOQ_WINDOW_SIZE && queue->unsent_size != 0)*/
- {
- vnp_raw_pack_uint32(data, queue->packet_id);
- while(queue->unsent_size != 0)
- {
- queue->slot = ((1 + queue->slot) % V_NOQ_OPTIMIZATION_SLOTS);
- buf = queue->unsent[queue->slot];
- if(buf != NULL)
- {
- if(buf->size + size > V_NOQ_MAX_PACKET_SIZE)
- break;
- queue->unsent[queue->slot] = buf->next;
- buf->next = queue->history[queue->slot];
- queue->history[queue->slot] = buf;
- buf->packet = queue->packet_id;
-
- v_e_data_encrypt_command(data, size, ((VCMDBuffer1500 *)buf)->buf, buf->size, v_con_get_data_key());
- size += buf->size;
- queue->unsent_comands--;
- queue->unsent_size -= buf->size;
- queue->sent_size += buf->size;
- my_counter++;
- }
- }
- v_n_send_data(address, data, size);
- queue->packet_buffer_use = size;
- queue->packet_id++;
-/* size = vnp_raw_pack_uint32(data, queue->packet_id);*/
- queue->seconds = seconds;
- queue->fractions = fractions;
- }
- return TRUE;
-}
-
-void v_noq_send_ack_nak_buf(VNetOutQueue *queue, VCMDBufHead *buf)
-{
- buf->next = queue->ack_nak;
- queue->ack_nak = buf;
-}
-
-void callback_send_packet_ack(void *user, uint32 packet_id)
-{
- VNetOutQueue *queue;
- VCMDBufHead *buf, *last;
- unsigned int slot;
-
- queue = v_con_get_network_queue();
- for(slot = 0; slot < V_NOQ_OPTIMIZATION_SLOTS; slot++)
- {
- last = NULL;
- for(buf = queue->history[slot]; buf != NULL && buf->packet != packet_id; buf = buf->next)
- last = buf;
-
- if(buf != NULL)
- {
- if(last == NULL)
- {
- while(queue->history[slot] != NULL && queue->history[slot]->packet == packet_id)
- {
- queue->sent_size -= queue->history[slot]->size;
- buf = queue->history[slot]->next;
- v_cmd_buf_free(queue->history[slot]);
- queue->history[slot] = buf;
- }
- }else
- {
- for(; buf != NULL && buf->packet == packet_id; buf = last->next)
- {
- queue->sent_size -= buf->size;
- last->next = buf->next;
- v_cmd_buf_free(buf);
- }
- }
- }
- }
-}
-
-void callback_send_packet_nak(void *user, uint32 packet_id)
-{
- VNetOutQueue *queue;
- VCMDBufHead *buf, *last;
- unsigned int slot;
-
- queue = v_con_get_network_queue();
- for(slot = 0; slot < V_NOQ_OPTIMIZATION_SLOTS; slot++)
- {
- last = NULL;
- for(buf = queue->history[slot]; buf != NULL && buf->packet != packet_id; buf = buf->next)
- last = buf;
- if(buf != NULL)
- {
- if(last == NULL)
- {
- for(; queue->history[slot] != NULL && queue->history[slot]->packet == packet_id; queue->history[slot] = buf)
- {
- queue->unsent_comands++;
- queue->unsent_size += queue->history[slot]->size;
- queue->sent_size -= queue->history[slot]->size;
- buf = queue->history[slot]->next;
- queue->history[slot]->next = queue->unsent[slot];
- queue->unsent[slot] = queue->history[slot];
- }
- }else
- {
- for(; last->next != NULL && ((VCMDBufHead *)last->next)->packet == packet_id;)
- {
- queue->unsent_comands++;
- queue->unsent_size += ((VCMDBufHead *)last->next)->size;
- queue->sent_size -= ((VCMDBufHead *)last->next)->size;
- buf = last->next;
- last->next = buf->next;
- buf->next = queue->unsent[slot];
- queue->unsent[slot] = buf;
- }
- }
- }
- }
-}
-
-#endif
diff --git a/extern/verse/dist/v_network_out_que.h b/extern/verse/dist/v_network_out_que.h
deleted file mode 100644
index 6746475e84f..00000000000
--- a/extern/verse/dist/v_network_out_que.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
-**
-*/
-
-typedef struct VNetOutQueue VNetOutQueue;
-
-extern VNetOutQueue * v_noq_create_network_queue(void);
-extern void v_noq_destroy_network_queue(VNetOutQueue *queue);
-extern void v_noq_send_buf(VNetOutQueue *queue, VCMDBufHead *buf);
-extern void v_noq_send_ack_nak_buf(VNetOutQueue *queue, VCMDBufHead *buf);
-
-extern void v_noq_send_ack(VNetOutQueue *queue, unsigned int id);
-extern void v_noq_send_nak(VNetOutQueue *queue, unsigned int id);
-
-extern boolean v_noq_send_queue(VNetOutQueue *queue, void *address);
-
-extern unsigned int v_noq_get_next_out_packet_id(VNetOutQueue *queue);
diff --git a/extern/verse/dist/v_pack.c b/extern/verse/dist/v_pack.c
deleted file mode 100644
index f521360b11f..00000000000
--- a/extern/verse/dist/v_pack.c
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
-** v_pack.c
-**
-** These functions are used to pack and unpack various quantities to/from network
-** packet buffers. They do not care about alignment, operating at byte level internally.
-** The external byte-ordering used is big-endian (aka "network byte order") for all
-** quantities larger than a single byte.
-*/
-
-#include
-#include
-#include
-
-#include "v_pack.h"
-
-size_t vnp_raw_pack_uint8(void *buffer, uint8 data)
-{
- *(uint8 *) buffer = data;
-
- return sizeof data;
-}
-
-size_t vnp_raw_unpack_uint8(const void *buffer, uint8 *data)
-{
- *data = *(uint8 *) buffer;
-
- return sizeof *data;
-}
-
-size_t vnp_raw_pack_uint8_vector(void *buffer, const uint8 *data, unsigned int length)
-{
- memcpy(buffer, data, length);
- return length;
-}
-
-size_t vnp_raw_unpack_uint8_vector(const void *buffer, uint8 *data, unsigned int length)
-{
- memcpy(data, buffer, length);
- return length;
-}
-
-size_t vnp_raw_pack_uint16(void *buffer, uint16 data)
-{
- *(uint8 *) buffer = (data & 0xFF00) >> 8;
- *((uint8 *) buffer + 1) = data & 0xFF;
- return sizeof data;
-}
-
-size_t vnp_raw_unpack_uint16(const void *buffer, uint16 *data)
-{
- register const uint8 *b = buffer;
- register uint16 tmp;
-
- tmp = ((uint16) *b++) << 8;
- tmp |= (uint16) *b;
- *data = tmp;
- return sizeof *data;
-}
-
-size_t vnp_raw_pack_uint16_vector(void *buffer, const uint16 *data, unsigned int length)
-{
- register uint8 *b = buffer;
- unsigned int i;
- for(i = 0; i < length; i++)
- {
- *b++ = (*data & 0xFF00) >> 8;
- *b++ = *data & 0xFF;
- data++;
- }
- return length * 2;
-}
-
-size_t vnp_raw_unpack_uint16_vector(const void *buffer, uint16 *data, unsigned int length)
-{
- register const uint8 *b = buffer;
- uint16 *end;
-
- for(end = data + length; end != data; data++)
- {
- *data = ((uint16) *b++) << 8;
- *data |= (uint16) *b++;
- }
- return length * 2;
-}
-
-size_t vnp_raw_pack_uint24(void *buffer, uint32 data)
-{
- register uint8 *p = buffer;
-
- data >>= 8;
- *(p++) = (data >> 24) & 0xFF;
- *(p++) = (data >> 16) & 0xFF;
- *(p++) = (data >> 8) & 0xFF;
-
- return 3;
-}
-
-size_t vnp_raw_unpack_uint24(const void *buffer, uint32 *data)
-{
- register const uint8 *p = buffer;
- register uint32 tmp = 0;
-
- tmp |= ((uint32) *p++) << 24;
- tmp |= ((uint32) *p++) << 16;
- tmp |= ((uint32) *p++) << 8;
- tmp |= tmp >> 24;
-
- return 3;
-}
-
-size_t vnp_raw_pack_uint24_vector(void *buffer, const uint32 *data, unsigned int length)
-{
- register uint8 *b = buffer;
- unsigned int i;
-
- for(i = 0; i < length; i++)
- {
- *b++ = (*data >> 24) & 0xFF;
- *b++ = (*data >> 16) & 0xFF;
- *b++ = (*data >> 8) & 0xFF;
- data++;
- }
- return length * 3;
-}
-
-size_t vnp_raw_unpack_uint24_vector(const void *buffer, uint32 *data, unsigned int length)
-{
- register const uint8 *b = buffer;
- register uint32 tmp;
- uint32 *end;
- for(end = data + length; end != data; data++)
- {
- tmp = ((uint32) *b++) << 24;
- tmp |= ((uint32) *b++) << 16;
- tmp |= ((uint32) *b++) << 8;
- tmp |= tmp >> 24;
- *data = tmp;
- }
- return length * 3;
-}
-
-size_t vnp_raw_pack_uint32(void *buffer, uint32 data)
-{
- register uint8 *b = buffer;
-
- *b++ = (data >> 24) & 0xFF;
- *b++ = (data >> 16) & 0xFF;
- *b++ = (data >> 8) & 0xFF;
- *b++ = data & 0xFF;
-
- return sizeof data;
-}
-
-size_t vnp_raw_unpack_uint32(const void *buffer, uint32 *data)
-{
- register const uint8 *b = buffer;
-
- *data = ((uint32) *b++) << 24;
- *data |= ((uint32) *b++) << 16;
- *data |= ((uint32) *b++) << 8;
- *data |= *b;
- return sizeof *data;
-}
-
-size_t vnp_raw_pack_uint32_vector(void *buffer, const uint32 *data, unsigned int length)
-{
- register uint8 *b = buffer;
- unsigned int i;
-
- for(i = 0; i < length; i++)
- {
- *b++ = (*data >> 24) & 0xFF;
- *b++ = (*data >> 16) & 0xFF;
- *b++ = (*data >> 8) & 0xFF;
- *b++ = *data & 0xFF;
- data++;
- }
- return length * 4;
-}
-
-size_t vnp_raw_unpack_uint32_vector(const void *buffer, uint32 *data, unsigned int length)
-{
- register const uint8 *b = buffer;
- uint32 *end;
- for(end = data + length; end != data; data++)
- {
- *data = ((uint32) *b++) << 24;
- *data |= ((uint32) *b++) << 16;
- *data |= ((uint32) *b++) << 8;
- *data |= ((uint32) *b++);
- }
- return length * 4;
-}
-
-size_t vnp_raw_pack_real32(void *buffer, real32 data)
-{
- union { uint32 uint; real32 real; } punt;
- punt.real = data;
- return vnp_raw_pack_uint32(buffer, punt.uint);
-}
-
-size_t vnp_raw_unpack_real32(const void *buffer, real32 *data)
-{
- return vnp_raw_unpack_uint32(buffer, (uint32 *) data);
-}
-
-size_t vnp_raw_pack_real32_vector(void *buffer, const real32 *data, unsigned int length)
-{
- uint32 i;
- for(i = 0; i < length; i++)
- vnp_raw_pack_real32(&((uint8 *)buffer)[i * 4], data[i]);
- return length * 4;
-}
-
-size_t vnp_raw_unpack_real32_vector(const void *buffer, real32 *data, unsigned int length)
-{
- uint32 i;
- for(i = 0; i < length; i++)
- vnp_raw_unpack_real32(&((uint8 *)buffer)[i * 4], &data[i]);
- return length * 4;
-}
-
-size_t vnp_raw_pack_real64(void *buffer, real64 data)
-{
- union { uint32 uint[2]; real64 real; } punt;
- uint32 size;
-
- punt.real = data;
- size = vnp_raw_pack_uint32(buffer, punt.uint[0]);
- buffer = (uint8 *) buffer + size;
- size += vnp_raw_pack_uint32(buffer, punt.uint[1]);
- return size;
-}
-
-size_t vnp_raw_unpack_real64(const void *buffer, real64 *data)
-{
- union { uint32 uint[2]; real64 real; } punt;
- uint32 size;
-
- size = vnp_raw_unpack_uint32(buffer, &punt.uint[0]);
- size += vnp_raw_unpack_uint32(((uint8 *)buffer) + size, &punt.uint[1]);
- *data = punt.real;
- return size;
-}
-
-size_t vnp_raw_pack_real64_vector(void *buffer, const real64 *data, unsigned int length)
-{
- uint32 i;
- for(i = 0; i < length; i++)
- vnp_raw_pack_real64(&((uint8 *)buffer)[i * 8], data[i]);
- return length * 8;
-}
-
-size_t vnp_raw_unpack_real64_vector(const void *buffer, real64 *data, unsigned int length)
-{
- uint32 i;
- for(i = 0; i < length; i++)
- vnp_raw_unpack_real64(&((uint8 *)buffer)[i * 8], &data[i]);
- return length * 8;
-}
-
-size_t vnp_raw_pack_string(void *buffer, const char *string, size_t max_size)
-{
- unsigned int i = 0;
- char *p = buffer;
- if(string != 0)
- for(; i < max_size && string[i] != 0; i++)
- p[i] = string[i];
- p[i] = 0;
- return ++i;
-}
-
-size_t vnp_raw_unpack_string(const void *buffer, char *string, size_t max_size, size_t max_size2)
-{
- unsigned int i;
- const char *p = buffer;
-
- max_size--;
- max_size2--;
- for(i = 0; i < max_size && i < max_size2 && p[i] != 0; i++)
- string[i] = p[i];
- string[i] = 0;
- return ++i;
-}
-
-/* --------------------------------------------------------------------------------------------------- */
-
-size_t vnp_pack_quat32(void *buffer, const VNQuat32 *data)
-{
- uint8 *out = buffer;
-
- if(data == NULL)
- return 0;
- out += vnp_raw_pack_real32(out, data->x);
- out += vnp_raw_pack_real32(out, data->y);
- out += vnp_raw_pack_real32(out, data->z);
- out += vnp_raw_pack_real32(out, data->w);
-
- return out - (uint8 *) buffer;
-}
-
-size_t vnp_unpack_quat32(const void *buffer, VNQuat32 *data)
-{
- const uint8 *in = buffer;
-
- if(data == NULL)
- return 0;
- in += vnp_raw_unpack_real32(in, &data->x);
- in += vnp_raw_unpack_real32(in, &data->y);
- in += vnp_raw_unpack_real32(in, &data->z);
- in += vnp_raw_unpack_real32(in, &data->w);
-
- return in - (uint8 *) buffer;
-}
-
-size_t vnp_pack_quat64(void *buffer, const VNQuat64 *data)
-{
- uint8 *out = buffer;
-
- if(data == NULL)
- return 0;
- out += vnp_raw_pack_real64(out, data->x);
- out += vnp_raw_pack_real64(out, data->y);
- out += vnp_raw_pack_real64(out, data->z);
- out += vnp_raw_pack_real64(out, data->w);
-
- return out - (uint8 *) buffer;
-}
-
-size_t vnp_unpack_quat64(const void *buffer, VNQuat64 *data)
-{
- const uint8 *in = buffer;
-
- if(data == NULL)
- return 0;
- in += vnp_raw_unpack_real64(in, &data->x);
- in += vnp_raw_unpack_real64(in, &data->y);
- in += vnp_raw_unpack_real64(in, &data->z);
- in += vnp_raw_unpack_real64(in, &data->w);
-
- return in - (uint8 *) buffer;
-}
-
-size_t vnp_pack_audio_block(void *buffer, VNABlockType type, const VNABlock *block)
-{
- if(block == NULL)
- return 0;
- switch(type)
- {
- case VN_A_BLOCK_INT8:
- return vnp_raw_pack_uint8_vector(buffer, block->vint8, sizeof block->vint8 / sizeof *block->vint8);
- case VN_A_BLOCK_INT16:
- return vnp_raw_pack_uint16_vector(buffer, block->vint16, sizeof block->vint16 / sizeof *block->vint16);
- case VN_A_BLOCK_INT24:
- return vnp_raw_pack_uint24_vector(buffer, block->vint24, sizeof block->vint24 / sizeof *block->vint24);
- case VN_A_BLOCK_INT32:
- return vnp_raw_pack_uint32_vector(buffer, block->vint32, sizeof block->vint32 / sizeof *block->vint32);
- case VN_A_BLOCK_REAL32:
- return vnp_raw_pack_real32_vector(buffer, block->vreal32, sizeof block->vreal32 / sizeof *block->vreal32);
- case VN_A_BLOCK_REAL64:
- return vnp_raw_pack_real64_vector(buffer, block->vreal64, sizeof block->vreal64 / sizeof *block->vreal64);
- }
- return 0;
-}
-
-size_t vnp_unpack_audio_block(const void *buffer, VNABlockType type, VNABlock *block)
-{
- if(block == NULL)
- return 0;
- switch(type)
- {
- case VN_A_BLOCK_INT8:
- return vnp_raw_unpack_uint8_vector(buffer, block->vint8, sizeof block->vint8 / sizeof *block->vint8);
- case VN_A_BLOCK_INT16:
- return vnp_raw_unpack_uint16_vector(buffer, block->vint16, sizeof block->vint16 / sizeof *block->vint16);
- case VN_A_BLOCK_INT24:
- return vnp_raw_unpack_uint24_vector(buffer, block->vint24, sizeof block->vint24 / sizeof *block->vint24);
- case VN_A_BLOCK_INT32:
- return vnp_raw_unpack_uint32_vector(buffer, block->vint32, sizeof block->vint32 / sizeof *block->vint32);
- case VN_A_BLOCK_REAL32:
- return vnp_raw_unpack_real32_vector(buffer, block->vreal32, sizeof block->vreal32 / sizeof *block->vreal32);
- case VN_A_BLOCK_REAL64:
- return vnp_raw_unpack_real64_vector(buffer, block->vreal64, sizeof block->vreal64 / sizeof *block->vreal64);
- }
- return 0;
-}
diff --git a/extern/verse/dist/v_pack.h b/extern/verse/dist/v_pack.h
deleted file mode 100644
index 60cb7225642..00000000000
--- a/extern/verse/dist/v_pack.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-** v_pack.h
-**
-** These functions are used to pack and unpack various quantities to/from network
-** packet buffers. They do not care about alignment, operating at byte level internally.
-** The external byte-ordering used is big-endian (aka "network byte order") for all
-** quantities larger than a single byte.
-*/
-
-#include "verse_header.h"
-
-extern size_t vnp_raw_pack_uint8(void *buffer, uint8 data);
-extern size_t vnp_raw_unpack_uint8(const void *buffer, uint8 *data);
-
-extern size_t vnp_raw_pack_uint16(void *buffer, uint16 data);
-extern size_t vnp_raw_unpack_uint16(const void *buffer, uint16 *data);
-
-extern size_t vnp_raw_pack_uint24(void *buffer, uint32 data);
-extern size_t vnp_raw_unpack_uint24(const void *buffer, uint32 *data);
-
-extern size_t vnp_raw_pack_uint32(void *buffer, uint32 data);
-extern size_t vnp_raw_unpack_uint32(const void *buffer, uint32 *data);
-
-extern size_t vnp_raw_pack_real32(void *buffer, real32 data);
-extern size_t vnp_raw_unpack_real32(const void *buffer, real32 *data);
-
-extern size_t vnp_raw_pack_real64(void *buffer, real64 data);
-extern size_t vnp_raw_unpack_real64(const void *buffer, real64 *data);
-
-extern size_t vnp_raw_pack_string(void *buffer, const char *string, size_t max_size);
-extern size_t vnp_raw_unpack_string(const void *buffer, char *string, size_t max_size, size_t max_size2);
-
-extern size_t vnp_raw_pack_uint8_vector(void *buffer, const uint8 *data, unsigned int length);
-extern size_t vnp_raw_unpack_uint8_vector(const void *buffer, uint8 *data, unsigned int length);
-
-extern size_t vnp_raw_pack_uint16_vector(void *buffer, const uint16 *data, unsigned int length);
-extern size_t vnp_raw_unpack_uint16_vector(const void *buffer, uint16 *data, unsigned int length);
-
-extern size_t vnp_raw_pack_uint24_vector(void *buffer, const uint32 *data, unsigned int length);
-extern size_t vnp_raw_unpack_uint24_vector(const void *buffer, uint32 *data, unsigned int length);
-
-extern size_t vnp_raw_pack_uint32_vector(void *buffer, const uint32 *data, unsigned int length);
-extern size_t vnp_raw_unpack_uint32_vector(const void *buffer, uint32 *data, unsigned int length);
-
-extern size_t vnp_raw_pack_real32_vector(void *buffer, const real32 *data, unsigned int length);
-extern size_t vnp_raw_unpack_real32_vector(const void *buffer, real32 *data, unsigned int length);
-
-extern size_t vnp_raw_pack_real64_vector(void *buffer, const real64 *data, unsigned int length);
-extern size_t vnp_raw_unpack_real64_vector(const void *buffer, real64 *data, unsigned int length);
-
-/* --------------------------------------------------------------------------------------------------- */
-
-extern size_t vnp_pack_quat32(void *buffer, const VNQuat32 *data);
-extern size_t vnp_unpack_quat32(const void *buffer, VNQuat32 *data);
-extern size_t vnp_pack_quat64(void *buffer, const VNQuat64 *data);
-extern size_t vnp_unpack_quat64(const void *buffer, VNQuat64 *data);
-
-extern size_t vnp_pack_audio_block(void *buffer, VNABlockType type, const VNABlock *block);
-extern size_t vnp_unpack_audio_block(const void *buffer, VNABlockType type, VNABlock *block);
diff --git a/extern/verse/dist/v_pack_method.c b/extern/verse/dist/v_pack_method.c
deleted file mode 100644
index c79ae92ba31..00000000000
--- a/extern/verse/dist/v_pack_method.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
-**
-*/
-
-#include
-
-#include "v_cmd_gen.h"
-
-#if !defined(V_GENERATE_FUNC_MODE)
-
-#include "verse.h"
-#include "v_pack.h"
-
-VNOPackedParams * verse_method_call_pack(unsigned int param_count, const VNOParamType *param_type, const VNOParam *params)
-{
- unsigned int i, j, buffer_pos;
- uint8 *buf;
-
- buf = malloc(1500 + 8 * 16);
- buffer_pos = vnp_raw_pack_uint16(buf, 0);
- for(i = 0; i < param_count; i++)
- {
- switch(param_type[i])
- {
- case VN_O_METHOD_PTYPE_INT8 :
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], params[i].vint8);
- break;
- case VN_O_METHOD_PTYPE_INT16 :
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], params[i].vint16);
- break;
- case VN_O_METHOD_PTYPE_INT32 :
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], params[i].vint32);
- break;
- case VN_O_METHOD_PTYPE_UINT8 :
- buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], params[i].vuint8);
- break;
- case VN_O_METHOD_PTYPE_UINT16 :
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], params[i].vuint16);
- break;
- case VN_O_METHOD_PTYPE_UINT32 :
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], params[i].vuint32);
- break;
- case VN_O_METHOD_PTYPE_REAL32 :
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], params[i].vreal32);
- break;
- case VN_O_METHOD_PTYPE_REAL64 :
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], params[i].vreal64);
- break;
- case VN_O_METHOD_PTYPE_STRING :
- buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], params[i].vstring, (1500 + 8 * 16) - buffer_pos);
- break;
- case VN_O_METHOD_PTYPE_NODE :
- buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], params[i].vnode);
- break;
- case VN_O_METHOD_PTYPE_LAYER :
- buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], params[i].vlayer);
- break;
- case VN_O_METHOD_PTYPE_REAL32_VEC2 :
- for(j = 0; j < 2; j++)
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], params[i].vreal32_vec[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL32_VEC3 :
- for(j = 0; j < 3; j++)
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], params[i].vreal32_vec[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL32_VEC4 :
- for(j = 0; j < 4; j++)
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], params[i].vreal32_vec[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL64_VEC2 :
- for(j = 0; j < 2; j++)
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], params[i].vreal64_vec[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL64_VEC3 :
- for(j = 0; j < 3; j++)
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], params[i].vreal64_vec[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL64_VEC4 :
- for(j = 0; j < 4; j++)
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], params[i].vreal64_vec[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL32_MAT4 :
- for(j = 0; j < 4; j++)
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], params[i].vreal32_mat[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL32_MAT9 :
- for(j = 0; j < 9; j++)
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], params[i].vreal32_mat[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL32_MAT16 :
- for(j = 0; j < 16; j++)
- buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], params[i].vreal32_mat[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL64_MAT4 :
- for(j = 0; j < 4; j++)
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], params[i].vreal64_mat[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL64_MAT9 :
- for(j = 0; j < 9; j++)
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], params[i].vreal64_mat[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL64_MAT16 :
- for(j = 0; j < 16; j++)
- buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], params[i].vreal64_mat[j]);
- break;
- }
- if(buffer_pos > 1500)
- {
- free(buf);
- return NULL;
- }
- }
- vnp_raw_pack_uint16(buf, buffer_pos);
- return buf;
-}
-
-boolean verse_method_call_unpack(const VNOPackedParams *data, unsigned int param_count, const VNOParamType *param_type, VNOParam *params)
-{
- unsigned int i, j, buffer_pos = 0, len;
- uint16 size;
- const uint8 *buf;
- static char string[2048];
- char *stringput = string;
-
- buf = data;
- buffer_pos += vnp_raw_unpack_uint16(buf, &size);
- for(i = 0; i < param_count; i++)
- {
- switch(param_type[i])
- {
- case VN_O_METHOD_PTYPE_INT8 :
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], ¶ms[i].vint8);
- break;
- case VN_O_METHOD_PTYPE_INT16 :
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], ¶ms[i].vint16);
- break;
- case VN_O_METHOD_PTYPE_INT32 :
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], ¶ms[i].vint32);
- break;
- case VN_O_METHOD_PTYPE_UINT8 :
- buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], ¶ms[i].vuint8);
- break;
- case VN_O_METHOD_PTYPE_UINT16 :
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], ¶ms[i].vuint16);
- break;
- case VN_O_METHOD_PTYPE_UINT32 :
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], ¶ms[i].vuint32);
- break;
- case VN_O_METHOD_PTYPE_REAL32 :
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], ¶ms[i].vreal32);
- break;
- case VN_O_METHOD_PTYPE_REAL64 :
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], ¶ms[i].vreal64);
- break;
- case VN_O_METHOD_PTYPE_STRING :
- params[i].vstring = stringput;
- len = vnp_raw_unpack_string(&buf[buffer_pos], stringput, (1500 + 8 * 16) - buffer_pos, -1);
- stringput += len;
- buffer_pos += len;
- break;
- case VN_O_METHOD_PTYPE_NODE :
- buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], ¶ms[i].vnode);
- break;
- case VN_O_METHOD_PTYPE_LAYER :
- buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], ¶ms[i].vlayer);
- break;
- case VN_O_METHOD_PTYPE_REAL32_VEC2 :
- for(j = 0; j < 2; j++)
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], ¶ms[i].vreal32_vec[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL32_VEC3 :
- for(j = 0; j < 3; j++)
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], ¶ms[i].vreal32_vec[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL32_VEC4 :
- for(j = 0; j < 4; j++)
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], ¶ms[i].vreal32_vec[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL64_VEC2 :
- for(j = 0; j < 2; j++)
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], ¶ms[i].vreal64_vec[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL64_VEC3 :
- for(j = 0; j < 3; j++)
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], ¶ms[i].vreal64_vec[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL64_VEC4 :
- for(j = 0; j < 4; j++)
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], ¶ms[i].vreal64_vec[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL32_MAT4 :
- for(j = 0; j < 4; j++)
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], ¶ms[i].vreal32_mat[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL32_MAT9 :
- for(j = 0; j < 9; j++)
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], ¶ms[i].vreal32_mat[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL32_MAT16 :
- for(j = 0; j < 16; j++)
- buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], ¶ms[i].vreal32_mat[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL64_MAT4 :
- for(j = 0; j < 4; j++)
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], ¶ms[i].vreal64_mat[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL64_MAT9 :
- for(j = 0; j < 9; j++)
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], ¶ms[i].vreal64_mat[j]);
- break;
- case VN_O_METHOD_PTYPE_REAL64_MAT16 :
- for(j = 0; j < 16; j++)
- buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], ¶ms[i].vreal64_mat[j]);
- break;
- }
- }
- return TRUE;
-}
-#endif
diff --git a/extern/verse/dist/v_prime.c b/extern/verse/dist/v_prime.c
deleted file mode 100644
index cebdf4fb03d..00000000000
--- a/extern/verse/dist/v_prime.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Program to generate primes of the form p = 2 * q + 1,
- * where p and q are both primes.
- *
- * Originally written by Pontus Nyman ,
- * ported to Verse's bignums and rewritten from scratch by
- * Emil Brink.
- */
-
-#include
-#include
-#include
-
-#include "v_bignum.h"
-#include "v_encryption.h"
-#include "verse_header.h"
-
-#define BITS V_ENCRYPTION_LOGIN_KEY_BITS /* Save some typing. */
-
-#define CYCLES 10 /* Number of times to apply Miller-Rabin test. */
-
-/* Test divisibility of against table of small known primes. Returns 1 if n looks prime, 0 if it IS not. */
-static int quick_filter(const VBigDig *n)
-{
- VBigDig VBIGNUM(m, 16), VBIGNUM(tmp, BITS / 2);
- const unsigned int prime[] = { 3, 5, 7, 11, 13, 17, 19, 23, 39, 31, 37, 41, 43, 47, 53 };
- unsigned int i;
-
- for(i = 0; i < sizeof prime / sizeof *prime; i++)
- {
- v_bignum_set_bignum(tmp, n);
- v_bignum_set_digit(m, prime[i]);
- v_bignum_mod(tmp, m);
- if(v_bignum_eq_zero(tmp))
- return 0;
- }
- return 1;
-}
-
-/* The Miller-Rabin primality test. Returns 1 if the candidate looks prime, 0 if
- * it IS NOT prime. Assumes that n is BITS / 2 bits, so that its square fits in BITS.
-*/
-static int miller_rabin(const VBigDig *n, VRandGen *gen)
-{
- int i, k;
- VBigDig VBIGNUM(a, BITS / 2), VBIGNUM(d, BITS), VBIGNUM(nmo, BITS / 2), VBIGNUM(x, BITS);
- const VBigDig *mu;
-
- mu = v_bignum_reduce_begin(n);
-
- /* Pick a "witness", a number in the [1, n) range. */
- v_bignum_set_random(a, gen);
- v_bignum_reduce(a, n, mu);
-
- v_bignum_set_one(d);
- v_bignum_set_bignum(nmo, n);
- v_bignum_sub_digit(nmo, 1); /* nmo = n - 1 (say it). */
- k = v_bignum_bit_msb(nmo);
- for(i = k; i >= 0; i--)
- {
- v_bignum_set_bignum(x, d);
- v_bignum_square_half(d);
- v_bignum_reduce(d, n, mu);
- if(v_bignum_eq_one(d) && !v_bignum_eq_one(x) && !v_bignum_eq(x, nmo))
- {
- v_bignum_reduce_end(mu);
- return 0; /* Composite found. */
- }
- if(v_bignum_bit_test(nmo, i))
- {
- v_bignum_mul(d, a);
- v_bignum_reduce(d, n, mu);
- }
- }
- v_bignum_reduce_end(mu);
- return v_bignum_eq_one(d); /* It might be prime. */
-}
-
-/* Test q for primality, returning 1 if it seems prime, 0 if it certainly IS not. */
-int v_prime_test(const VBigDig *q, VRandGen *gen)
-{
- int i;
-
- if(!quick_filter(q))
- return 0;
-
- for(i = 0; i < CYCLES; i++)
- {
- if(!miller_rabin(q, gen))
- return 0;
- }
- return 1;
-}
-
-void v_prime_set_random(VBigDig *x)
-{
- int bits = v_bignum_bit_size(x);
- VRandGen *gen;
-
- gen = v_randgen_new();
- do
- {
- /* Create candidate, making sure it's both odd and non-zero. */
- v_bignum_set_random(x, gen);
- /* Set topmost two bits, makes sure products are big. */
- v_bignum_bit_set(x, bits - 1);
- v_bignum_bit_set(x, bits - 2);
- /* Set lowermost bit, makes sure it is odd (better prime candidate that way). */
- v_bignum_bit_set(x, 0);
- } while(!v_prime_test(x, gen));
-/* printf("Prime found after %d iterations: ", count);
- v_bignum_print_hex_lf(x);
-*/
- v_randgen_destroy(gen);
-}
-
-/* Big (small?) primes from . */
-void v_prime_set_table(VBigDig *x, unsigned int i)
-{
- if(i == 0)
- v_bignum_set_string_hex(x, "0xCBC2C5536E3D6283FDAF36B1D0F91C3EAAB1D12892B961B866907930F6471851");
- else if(i == 1)
- v_bignum_set_string_hex(x, "0xC14F93E7A1543BD57C1DFBE98C29F9E4C13077FD27A0FEC05CCBC913CD213F19");
- else
- v_bignum_set_string(x, "65537"); /* It ain't big, but it's prime. */
-}
-
-#if PRIMEALONE
-#include
-
-#define REPS 300
-
-static double elapsed(const struct timeval *t1, const struct timeval *t2)
-{
- return t2->tv_sec - t1->tv_sec + 1E-6 * (t2->tv_usec - t1->tv_usec);
-}
-
-int main(void)
-{
- struct timeval now, then;
- VBigDig VBIGNUM(x, BITS / 2);
- int i;
-
- srand(clock());
-
-/* gettimeofday(&then, NULL);
- for(i = 0; i < REPS; i++)
- {
- v_prime_set_random_incr(x);
- }
- gettimeofday(&now, NULL);
- printf("incr: %g\n", elapsed(&then, &now));
-*/
- gettimeofday(&then, NULL);
- for(i = 0; i < REPS; i++)
- {
- v_prime_set_random(x);
- }
- gettimeofday(&now, NULL);
- printf("rand: %g\n", elapsed(&then, &now));
-
- return EXIT_SUCCESS;
-}
-
-#endif
diff --git a/extern/verse/dist/v_randgen.c b/extern/verse/dist/v_randgen.c
deleted file mode 100644
index c65b48be60b..00000000000
--- a/extern/verse/dist/v_randgen.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Random number generator module. Defines a simple API to allocate, use and
- * destroy a generator of randomness. Relies on platform-specific APIs.
-*/
-
-#include
-#include
-
-#include "v_randgen.h"
-
-#if defined _WIN32
-
-/* This is a fall-back to the old style of simply using rand(). It should
- * be replaced by something using the proper Win32 cryptography APIs.
- * The CryptAcquireContext() and CryptGenRandom() calls sound interesting.
- *
- * FIXME: Replace ASAP.
-*/
-
-VRandGen * v_randgen_new(void)
-{
- return (VRandGen *) 1; /* Anything that isn't NULL. */
-}
-
-void v_randgen_get(VRandGen *gen, void *bytes, size_t num)
-{
- if(gen != NULL && bytes != NULL)
- {
- unsigned char *put = bytes, *get;
- size_t i;
- int x;
-
- while(num > 0)
- {
- x = rand();
- get = (unsigned char *) &x;
- for(i = 0; i < sizeof x && num > 0; i++, num--)
- *put++ = *get++;
- }
- }
-}
-
-void v_randgen_destroy(VRandGen *gen)
-{
- /* Nothing to do here. */
-}
-
-#else
-
-/* On non-Win32 platforms (which is Linux and Darwin, at the moment), we
- * read random data from a file, which is assumed to be one of the kernel's
- * virtual files.
-*/
-
-#include
-#include
-#include
-#include
-
-struct VRandGen {
- int fd;
-};
-
-#define SOURCE "/dev/urandom" /* Name of file to read random bits from. */
-
-VRandGen * v_randgen_new(void)
-{
- VRandGen *gen;
-
- if((gen = malloc(sizeof *gen)) != NULL)
- {
- gen->fd = open(SOURCE, O_RDONLY);
- if(gen->fd < 0)
- {
- fprintf(stderr, __FILE__ ": Couldn't open " SOURCE " for reading\n");
- free(gen);
- gen = NULL;
- }
- }
- return gen;
-}
-
-void v_randgen_get(VRandGen *gen, void *bytes, size_t num)
-{
- if(gen != NULL && bytes != NULL)
- {
- if(read(gen->fd, bytes, num) != (int) num)
- fprintf(stderr, __FILE__ ": Failed to read %u bytes of random data from " SOURCE "\n", (unsigned int) num);
- }
-}
-
-void v_randgen_destroy(VRandGen *gen)
-{
- if(gen != NULL)
- {
- close(gen->fd);
- free(gen);
- }
-}
-
-#endif
diff --git a/extern/verse/dist/v_randgen.h b/extern/verse/dist/v_randgen.h
deleted file mode 100644
index ee14ce6c36f..00000000000
--- a/extern/verse/dist/v_randgen.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Random number generator API. A way to improve over rand().
-*/
-
-#if !defined V_RANDGEN_H
-#define V_RANDGEN_H
-
-typedef struct VRandGen VRandGen;
-
-extern VRandGen * v_randgen_new(void);
-extern void v_randgen_get(VRandGen *gen, void *bytes, size_t num);
-extern void v_randgen_destroy(VRandGen *gen);
-
-#endif /* V_RANDGEN_H */
diff --git a/extern/verse/dist/v_util.c b/extern/verse/dist/v_util.c
deleted file mode 100644
index a36f4c77791..00000000000
--- a/extern/verse/dist/v_util.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Utility functions.
-*/
-
-#include
-
-#include "verse_header.h"
-#include "v_network.h"
-#include "v_util.h"
-
-/* Safe string copy. Copies from to , not using more than
- * bytes of destination space. Always 0-terminates the destination. Returns
- * the beginning of the destination string.
-*/
-char * v_strlcpy(char *dst, const char *src, size_t size)
-{
- char *base = dst;
-
- if(size == 0)
- return NULL;
- for(size--; size > 0 && *src != '\0'; size--)
- *dst++ = *src++;
- *dst = '\0';
-
- return base;
-}
-
-void v_timer_start(VUtilTimer *timer)
-{
- v_n_get_current_time(&timer->seconds, &timer->fractions);
-}
-
-void v_timer_advance(VUtilTimer *timer, double seconds)
-{
- if(timer == NULL)
- return;
- timer->seconds += (uint32) seconds;
- timer->fractions += (uint32) ((seconds - (int) seconds) * (double) 0xffffffff);
-}
-
-double v_timer_elapsed(const VUtilTimer *timer)
-{
- uint32 cur_seconds, cur_fractions;
-
- v_n_get_current_time(&cur_seconds, &cur_fractions);
- return (double)(cur_seconds - timer->seconds) + ((double)cur_fractions - (double)timer->fractions) / (double) 0xffffffff;
-}
-
-void v_timer_print(const VUtilTimer *timer)
-{
- uint32 cur_seconds, cur_fractions;
-
- v_n_get_current_time(&cur_seconds, &cur_fractions);
- printf("%f", (double)(cur_seconds - timer->seconds) + ((double)cur_fractions - (double)timer->fractions) / (double) 0xffffffff);
-}
-
-/* Compare |x| against built-in semi-magical constant, and return 1 if it's larger, 0 if not. */
-static int quat_valid(real64 x)
-{
- const real64 EPSILON = 0.0000001;
- return x > 0.0 ? x > EPSILON : x < -EPSILON;
-}
-
-int v_quat32_valid(const VNQuat32 *q)
-{
- if(q == NULL)
- return 0;
- return quat_valid(q->x) && quat_valid(q->y) && quat_valid(q->z) && quat_valid(q->w);
-}
-
-int v_quat64_valid(const VNQuat64 *q)
-{
- if(q == NULL)
- return 0;
- return quat_valid(q->x) && quat_valid(q->y) && quat_valid(q->z) && quat_valid(q->w);
-}
-
-VNQuat32 * v_quat32_from_quat64(VNQuat32 *dst, const VNQuat64 *src)
-{
- if(dst == NULL || src == NULL)
- return NULL;
- dst->x = (real32) src->x;
- dst->y = (real32) src->y;
- dst->z = (real32) src->z;
- dst->w = (real32) src->w;
- return dst;
-}
-
-VNQuat64 * v_quat64_from_quat32(VNQuat64 *dst, const VNQuat32 *src)
-{
- if(dst == NULL || src == NULL)
- return NULL;
- dst->x = src->x;
- dst->y = src->y;
- dst->z = src->z;
- dst->w = src->w;
- return dst;
-}
diff --git a/extern/verse/dist/v_util.h b/extern/verse/dist/v_util.h
deleted file mode 100644
index d252d958549..00000000000
--- a/extern/verse/dist/v_util.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Miscellaneous utility routines for generic use throughout the code.
-*/
-
-/* Safe, buffer size limited, string copy. */
-extern char * v_strlcpy(char *dst, const char *src, size_t size);
-
-typedef struct {
- uint32 seconds;
- uint32 fractions;
-} VUtilTimer;
-
-extern void v_timer_start(VUtilTimer *timer);
-extern void v_timer_advance(VUtilTimer *timer, double seconds);
-extern double v_timer_elapsed(const VUtilTimer *timer);
-extern void v_timer_print(const VUtilTimer *timer);
-
-extern int v_quat32_valid(const VNQuat32 *q);
-extern int v_quat64_valid(const VNQuat64 *q);
-extern VNQuat32*v_quat32_from_quat64(VNQuat32 *dst, const VNQuat64 *src);
-extern VNQuat64*v_quat64_from_quat32(VNQuat64 *dst, const VNQuat32 *src);
diff --git a/extern/verse/dist/verse.h b/extern/verse/dist/verse.h
deleted file mode 100644
index 53ce674725a..00000000000
--- a/extern/verse/dist/verse.h
+++ /dev/null
@@ -1,530 +0,0 @@
-/*
-** Verse API Header file (for use with libverse.a).
-** This is automatically generated code; do not edit.
-*/
-
-
-#if !defined VERSE_H
-
-#if defined __cplusplus /* Declare as C symbols for C++ users. */
-extern "C" {
-#endif
-
-#define VERSE_H
-
-#if !defined VERSE_TYPES
-#define VERSE_TYPES
-
-#include
-
-/* Release information. */
-#define V_RELEASE_NUMBER 6
-#define V_RELEASE_PATCH 1
-#define V_RELEASE_LABEL ""
-
-typedef unsigned char boolean;
-typedef signed char int8;
-typedef unsigned char uint8;
-typedef short int16;
-typedef unsigned short uint16;
-typedef int int32;
-typedef unsigned int uint32;
-typedef float real32;
-typedef double real64;
-
-#define V_REAL64_MAX 1.7976931348623158e+308
-#define V_REAL32_MAX 3.402823466e+38f
-
-#if !defined TRUE
-#define TRUE 1
-#define FALSE 0
-#endif
-
-#define V_HOST_ID_SIZE (3 * (512 / 8)) /* The size of host IDs (keys), in 8-bit bytes. */
-
-typedef enum {
- V_NT_OBJECT = 0,
- V_NT_GEOMETRY,
- V_NT_MATERIAL,
- V_NT_BITMAP,
- V_NT_TEXT,
- V_NT_CURVE,
- V_NT_AUDIO,
- V_NT_NUM_TYPES,
- V_NT_SYSTEM = V_NT_NUM_TYPES,
- V_NT_NUM_TYPES_NETPACK
-} VNodeType;
-
-typedef uint32 VNodeID;
-typedef uint16 VLayerID; /* Commonly used to identify layers, nodes that have them. */
-typedef uint16 VBufferID; /* Commonly used to identify buffers, nodes that have them. */
-typedef uint16 VNMFragmentID;
-
-typedef void * VSession;
-
-#define V_MAX_NAME_LENGTH_SHORT 16
-#define V_MAX_NAME_LENGTH_LONG 48
-#define V_MAX_NAME_PASS_LENGTH 128
-
-typedef enum {
- VN_OWNER_OTHER = 0,
- VN_OWNER_MINE
-} VNodeOwner;
-
-typedef enum {
- VN_O_METHOD_PTYPE_INT8 = 0,
- VN_O_METHOD_PTYPE_INT16,
- VN_O_METHOD_PTYPE_INT32,
-
- VN_O_METHOD_PTYPE_UINT8,
- VN_O_METHOD_PTYPE_UINT16,
- VN_O_METHOD_PTYPE_UINT32,
-
- VN_O_METHOD_PTYPE_REAL32,
- VN_O_METHOD_PTYPE_REAL64,
-
- VN_O_METHOD_PTYPE_REAL32_VEC2,
- VN_O_METHOD_PTYPE_REAL32_VEC3,
- VN_O_METHOD_PTYPE_REAL32_VEC4,
-
- VN_O_METHOD_PTYPE_REAL64_VEC2,
- VN_O_METHOD_PTYPE_REAL64_VEC3,
- VN_O_METHOD_PTYPE_REAL64_VEC4,
-
- VN_O_METHOD_PTYPE_REAL32_MAT4,
- VN_O_METHOD_PTYPE_REAL32_MAT9,
- VN_O_METHOD_PTYPE_REAL32_MAT16,
-
- VN_O_METHOD_PTYPE_REAL64_MAT4,
- VN_O_METHOD_PTYPE_REAL64_MAT9,
- VN_O_METHOD_PTYPE_REAL64_MAT16,
-
- VN_O_METHOD_PTYPE_STRING,
-
- VN_O_METHOD_PTYPE_NODE,
- VN_O_METHOD_PTYPE_LAYER
-} VNOParamType;
-
-typedef union {
- int8 vint8;
- int16 vint16;
- int32 vint32;
- uint8 vuint8;
- uint16 vuint16;
- uint32 vuint32;
- real32 vreal32;
- real64 vreal64;
- real32 vreal32_vec[4];
- real32 vreal32_mat[16];
- real64 vreal64_vec[4];
- real64 vreal64_mat[16];
- char *vstring;
- VNodeID vnode;
- VLayerID vlayer;
-} VNOParam;
-
-#define VN_TAG_MAX_BLOB_SIZE 500
-
-typedef enum {
- VN_TAG_BOOLEAN = 0,
- VN_TAG_UINT32,
- VN_TAG_REAL64,
- VN_TAG_STRING,
- VN_TAG_REAL64_VEC3,
- VN_TAG_LINK,
- VN_TAG_ANIMATION,
- VN_TAG_BLOB,
- VN_TAG_TYPE_COUNT
-} VNTagType;
-
-typedef enum {
- VN_TAG_GROUP_SIZE = 16,
- VN_TAG_NAME_SIZE = 16,
- VN_TAG_FULL_NAME_SIZE = 64,
- VN_TAG_STRING_SIZE = 128
-} VNTagConstants;
-
-typedef union {
- boolean vboolean;
- uint32 vuint32;
- real64 vreal64;
- char *vstring;
- real64 vreal64_vec3[3];
- VNodeID vlink;
- struct {
- VNodeID curve;
- uint32 start;
- uint32 end;
- } vanimation;
- struct {
- uint16 size;
- void *blob;
- } vblob;
-} VNTag;
-
-typedef enum {
- VN_S_CONNECT_NAME_SIZE = 32,
- VN_S_CONNECT_KEY_SIZE = 4,
- VN_S_CONNECT_DATA_SIZE = 32,
- VS_S_CONNECT_HOSTID_PRIVATE_SIZE = 3 * 2048 / 8,
- VS_S_CONNECT_HOSTID_PUBLIC_SIZE = 2 * 2048 / 8
-} VNSConnectConstants;
-
-typedef enum {
- VN_FORMAT_REAL32,
- VN_FORMAT_REAL64
-} VNRealFormat;
-
-typedef struct {
- real32 x, y, z, w;
-} VNQuat32;
-
-typedef struct {
- real64 x, y, z, w;
-} VNQuat64;
-
-typedef enum {
- VN_O_METHOD_GROUP_NAME_SIZE = 16,
- VN_O_METHOD_NAME_SIZE = 16,
- VN_O_METHOD_SIG_SIZE = 256
-} VNOMethodConstants;
-
-typedef void VNOPackedParams; /* Opaque type. */
-
-typedef enum {
- VN_G_LAYER_VERTEX_XYZ = 0,
- VN_G_LAYER_VERTEX_UINT32,
- VN_G_LAYER_VERTEX_REAL,
- VN_G_LAYER_POLYGON_CORNER_UINT32 = 128,
- VN_G_LAYER_POLYGON_CORNER_REAL,
- VN_G_LAYER_POLYGON_FACE_UINT8,
- VN_G_LAYER_POLYGON_FACE_UINT32,
- VN_G_LAYER_POLYGON_FACE_REAL
-} VNGLayerType;
-
-typedef enum {
- VN_M_LIGHT_DIRECT = 0,
- VN_M_LIGHT_AMBIENT,
- VN_M_LIGHT_DIRECT_AND_AMBIENT,
- VN_M_LIGHT_BACK_DIRECT,
- VN_M_LIGHT_BACK_AMBIENT,
- VN_M_LIGHT_BACK_DIRECT_AND_AMBIENT
-} VNMLightType;
-
-typedef enum {
- VN_M_NOISE_PERLIN_ZERO_TO_ONE = 0,
- VN_M_NOISE_PERLIN_MINUS_ONE_TO_ONE,
- VN_M_NOISE_POINT_ZERO_TO_ONE,
- VN_M_NOISE_POINT_MINUS_ONE_TO_ONE
-} VNMNoiseType;
-
-typedef enum {
- VN_M_RAMP_SQUARE = 0,
- VN_M_RAMP_LINEAR,
- VN_M_RAMP_SMOOTH
-} VNMRampType;
-
-typedef enum {
- VN_M_RAMP_RED = 0,
- VN_M_RAMP_GREEN,
- VN_M_RAMP_BLUE
-} VNMRampChannel;
-
-typedef struct {
- real64 pos;
- real64 red;
- real64 green;
- real64 blue;
-} VNMRampPoint;
-
-typedef enum {
- VN_M_BLEND_FADE = 0,
- VN_M_BLEND_ADD,
- VN_M_BLEND_SUBTRACT,
- VN_M_BLEND_MULTIPLY,
- VN_M_BLEND_DIVIDE,
-} VNMBlendType;
-
-typedef enum {
- VN_M_FT_COLOR = 0,
- VN_M_FT_LIGHT,
- VN_M_FT_REFLECTION,
- VN_M_FT_TRANSPARENCY,
- VN_M_FT_VOLUME,
- VN_M_FT_VIEW,
- VN_M_FT_GEOMETRY,
- VN_M_FT_TEXTURE,
- VN_M_FT_NOISE,
- VN_M_FT_BLENDER,
- VN_M_FT_CLAMP,
- VN_M_FT_MATRIX,
- VN_M_FT_RAMP,
- VN_M_FT_ANIMATION,
- VN_M_FT_ALTERNATIVE,
- VN_M_FT_OUTPUT
-} VNMFragmentType;
-
-typedef union {
- struct {
- real64 red;
- real64 green;
- real64 blue;
- } color;
- struct {
- uint8 type;
- real64 normal_falloff;
- VNodeID brdf;
- char brdf_r[16];
- char brdf_g[16];
- char brdf_b[16];
- } light;
- struct {
- real64 normal_falloff;
- } reflection;
- struct {
- real64 normal_falloff;
- real64 refraction_index;
- } transparency;
- struct {
- real64 diffusion;
- real64 col_r;
- real64 col_g;
- real64 col_b;
- } volume;
- struct {
- char layer_r[16];
- char layer_g[16];
- char layer_b[16];
- } geometry;
- struct{
- VNodeID bitmap;
- char layer_r[16];
- char layer_g[16];
- char layer_b[16];
- boolean filtered;
- VNMFragmentID mapping;
- } texture;
- struct {
- uint8 type;
- VNMFragmentID mapping;
- } noise;
- struct {
- uint8 type;
- VNMFragmentID data_a;
- VNMFragmentID data_b;
- VNMFragmentID control;
- } blender;
- struct {
- boolean min;
- real64 red;
- real64 green;
- real64 blue;
- VNMFragmentID data;
- } clamp;
- struct {
- real64 matrix[16];
- VNMFragmentID data;
- } matrix;
- struct {
- uint8 type;
- uint8 channel;
- VNMFragmentID mapping;
- uint8 point_count;
- VNMRampPoint ramp[48];
- } ramp;
- struct {
- char label[16];
- } animation;
- struct {
- VNMFragmentID alt_a;
- VNMFragmentID alt_b;
- } alternative;
- struct {
- char label[16];
- VNMFragmentID front;
- VNMFragmentID back;
- } output;
-} VMatFrag;
-
-typedef enum {
- VN_B_LAYER_UINT1 = 0,
- VN_B_LAYER_UINT8,
- VN_B_LAYER_UINT16,
- VN_B_LAYER_REAL32,
- VN_B_LAYER_REAL64
-} VNBLayerType;
-
-#define VN_B_TILE_SIZE 8
-
-typedef union{
- uint8 vuint1[8];
- uint8 vuint8[64];
- uint16 vuint16[64];
- real32 vreal32[64];
- real64 vreal64[64];
-} VNBTile;
-
-typedef enum {
- VN_T_CONTENT_LANGUAGE_SIZE = 32,
- VN_T_CONTENT_INFO_SIZE = 256,
- VN_T_BUFFER_NAME_SIZE = 16,
- VN_T_MAX_TEXT_CMD_SIZE = 1450
-} VNTConstants;
-
-/* This is how many *samples* are included in a block of the given type. Not bytes. */
-typedef enum {
- VN_A_BLOCK_SIZE_INT8 = 1024,
- VN_A_BLOCK_SIZE_INT16 = 512,
- VN_A_BLOCK_SIZE_INT24 = 384,
- VN_A_BLOCK_SIZE_INT32 = 256,
- VN_A_BLOCK_SIZE_REAL32 = 256,
- VN_A_BLOCK_SIZE_REAL64 = 128
-} VNAConstants;
-
-typedef enum {
- VN_A_BLOCK_INT8,
- VN_A_BLOCK_INT16,
- VN_A_BLOCK_INT24,
- VN_A_BLOCK_INT32,
- VN_A_BLOCK_REAL32,
- VN_A_BLOCK_REAL64
-} VNABlockType;
-
-/* Audio commands take pointers to blocks of these. They are not packed as unions. */
-typedef union {
- int8 vint8[VN_A_BLOCK_SIZE_INT8];
- int16 vint16[VN_A_BLOCK_SIZE_INT16];
- int32 vint24[VN_A_BLOCK_SIZE_INT24];
- int32 vint32[VN_A_BLOCK_SIZE_INT32];
- real32 vreal32[VN_A_BLOCK_SIZE_REAL32];
- real64 vreal64[VN_A_BLOCK_SIZE_REAL64];
-} VNABlock;
-
-extern void verse_set_port(uint16 port);
-extern void verse_host_id_create(uint8 *id);
-extern void verse_host_id_set(uint8 *id);
-extern void verse_callback_set(void *send_func, void *callback, void *user_data);
-extern void verse_callback_update(uint32 microseconds);
-extern void verse_session_set(VSession session);
-extern VSession verse_session_get(void);
-extern void verse_session_destroy(VSession session);
-extern size_t verse_session_get_size(void);
-extern VNodeID verse_session_get_avatar(void);
-extern void verse_session_get_time(uint32 *seconds, uint32 *fractions);
-
-extern VNOPackedParams * verse_method_call_pack(uint32 param_count, const VNOParamType *param_type, const VNOParam *params);
-extern boolean verse_method_call_unpack(const VNOPackedParams *data, uint32 param_count, const VNOParamType *param_type, VNOParam *params);
-
-/*
-#define V_PRINT_SEND_COMMANDS
-#define V_PRINT_RECEIVE_COMMANDS
-*/
-
-#endif /* VERSE_TYPES */
-
-/* Command sending functions begin. ----------------------------------------- */
-
-extern VSession verse_send_connect(const char *name, const char *pass, const char *address, const uint8 *expected_host_id);
-extern VSession verse_send_connect_accept(VNodeID avatar, const char *address, uint8 *host_id);
-extern void verse_send_connect_terminate(const char *address, const char *bye);
-extern void verse_send_ping(const char *address, const char *message);
-extern void verse_send_node_index_subscribe(uint32 mask);
-extern void verse_send_node_create(VNodeID node_id, VNodeType type, VNodeOwner owner);
-extern void verse_send_node_destroy(VNodeID node_id);
-extern void verse_send_node_subscribe(VNodeID node_id);
-extern void verse_send_node_unsubscribe(VNodeID node_id);
-extern void verse_send_tag_group_create(VNodeID node_id, uint16 group_id, const char *name);
-extern void verse_send_tag_group_destroy(VNodeID node_id, uint16 group_id);
-extern void verse_send_tag_group_subscribe(VNodeID node_id, uint16 group_id);
-extern void verse_send_tag_group_unsubscribe(VNodeID node_id, uint16 group_id);
-extern void verse_send_tag_create(VNodeID node_id, uint16 group_id, uint16 tag_id, const char *name, VNTagType type, const VNTag *tag);
-extern void verse_send_tag_destroy(VNodeID node_id, uint16 group_id, uint16 tag_id);
-extern void verse_send_node_name_set(VNodeID node_id, const char *name);
-
-extern void verse_send_o_transform_pos_real32(VNodeID node_id, uint32 time_s, uint32 time_f, const real32 *pos, const real32 *speed, const real32 *accelerate, const real32 *drag_normal, real32 drag);
-extern void verse_send_o_transform_rot_real32(VNodeID node_id, uint32 time_s, uint32 time_f, const VNQuat32 *rot, const VNQuat32 *speed, const VNQuat32 *accelerate, const VNQuat32 *drag_normal, real32 drag);
-extern void verse_send_o_transform_scale_real32(VNodeID node_id, real32 scale_x, real32 scale_y, real32 scale_z);
-extern void verse_send_o_transform_pos_real64(VNodeID node_id, uint32 time_s, uint32 time_f, const real64 *pos, const real64 *speed, const real64 *accelerate, const real64 *drag_normal, real64 drag);
-extern void verse_send_o_transform_rot_real64(VNodeID node_id, uint32 time_s, uint32 time_f, const VNQuat64 *rot, const VNQuat64 *speed, const VNQuat64 *accelerate, const VNQuat64 *drag_normal, real64 drag);
-extern void verse_send_o_transform_scale_real64(VNodeID node_id, real64 scale_x, real64 scale_y, real64 scale_z);
-extern void verse_send_o_transform_subscribe(VNodeID node_id, VNRealFormat type);
-extern void verse_send_o_transform_unsubscribe(VNodeID node_id, VNRealFormat type);
-extern void verse_send_o_light_set(VNodeID node_id, real64 light_r, real64 light_g, real64 light_b);
-extern void verse_send_o_link_set(VNodeID node_id, uint16 link_id, VNodeID link, const char *label, uint32 target_id);
-extern void verse_send_o_link_destroy(VNodeID node_id, uint16 link_id);
-extern void verse_send_o_method_group_create(VNodeID node_id, uint16 group_id, const char *name);
-extern void verse_send_o_method_group_destroy(VNodeID node_id, uint16 group_id);
-extern void verse_send_o_method_group_subscribe(VNodeID node_id, uint16 group_id);
-extern void verse_send_o_method_group_unsubscribe(VNodeID node_id, uint16 group_id);
-extern void verse_send_o_method_create(VNodeID node_id, uint16 group_id, uint16 method_id, const char *name, uint8 param_count, const VNOParamType *param_types, const char * *param_names);
-extern void verse_send_o_method_destroy(VNodeID node_id, uint16 group_id, uint16 method_id);
-extern void verse_send_o_method_call(VNodeID node_id, uint16 group_id, uint16 method_id, VNodeID sender, const VNOPackedParams *params);
-extern void verse_send_o_anim_run(VNodeID node_id, uint16 link_id, uint32 time_s, uint32 time_f, uint8 dimensions, const real64 *pos, const real64 *speed, const real64 *accel, const real64 *scale, const real64 *scale_speed);
-extern void verse_send_o_hide(VNodeID node_id, uint8 hidden);
-
-extern void verse_send_g_layer_create(VNodeID node_id, VLayerID layer_id, const char *name, VNGLayerType type, uint32 def_uint, real64 def_real);
-extern void verse_send_g_layer_destroy(VNodeID node_id, VLayerID layer_id);
-extern void verse_send_g_layer_subscribe(VNodeID node_id, VLayerID layer_id, VNRealFormat type);
-extern void verse_send_g_layer_unsubscribe(VNodeID node_id, VLayerID layer_id);
-extern void verse_send_g_vertex_set_xyz_real32(VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real32 x, real32 y, real32 z);
-extern void verse_send_g_vertex_delete_real32(VNodeID node_id, uint32 vertex_id);
-extern void verse_send_g_vertex_set_xyz_real64(VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real64 x, real64 y, real64 z);
-extern void verse_send_g_vertex_delete_real64(VNodeID node_id, uint32 vertex_id);
-extern void verse_send_g_vertex_set_uint32(VNodeID node_id, VLayerID layer_id, uint32 vertex_id, uint32 value);
-extern void verse_send_g_vertex_set_real64(VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real64 value);
-extern void verse_send_g_vertex_set_real32(VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real32 value);
-extern void verse_send_g_polygon_set_corner_uint32(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint32 v0, uint32 v1, uint32 v2, uint32 v3);
-extern void verse_send_g_polygon_delete(VNodeID node_id, uint32 polygon_id);
-extern void verse_send_g_polygon_set_corner_real64(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real64 v0, real64 v1, real64 v2, real64 v3);
-extern void verse_send_g_polygon_set_corner_real32(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real32 v0, real32 v1, real32 v2, real32 v3);
-extern void verse_send_g_polygon_set_face_uint8(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint8 value);
-extern void verse_send_g_polygon_set_face_uint32(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint32 value);
-extern void verse_send_g_polygon_set_face_real64(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real64 value);
-extern void verse_send_g_polygon_set_face_real32(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real32 value);
-extern void verse_send_g_crease_set_vertex(VNodeID node_id, const char *layer, uint32 def_crease);
-extern void verse_send_g_crease_set_edge(VNodeID node_id, const char *layer, uint32 def_crease);
-extern void verse_send_g_bone_create(VNodeID node_id, uint16 bone_id, const char *weight, const char *reference, uint16 parent, real64 pos_x, real64 pos_y, real64 pos_z, const char *position_label, const char *rotation_label, const char *scale_label);
-extern void verse_send_g_bone_destroy(VNodeID node_id, uint16 bone_id);
-
-extern void verse_send_m_fragment_create(VNodeID node_id, VNMFragmentID frag_id, VNMFragmentType type, const VMatFrag *fragment);
-extern void verse_send_m_fragment_destroy(VNodeID node_id, VNMFragmentID frag_id);
-
-extern void verse_send_b_dimensions_set(VNodeID node_id, uint16 width, uint16 height, uint16 depth);
-extern void verse_send_b_layer_create(VNodeID node_id, VLayerID layer_id, const char *name, VNBLayerType type);
-extern void verse_send_b_layer_destroy(VNodeID node_id, VLayerID layer_id);
-extern void verse_send_b_layer_subscribe(VNodeID node_id, VLayerID layer_id, uint8 level);
-extern void verse_send_b_layer_unsubscribe(VNodeID node_id, VLayerID layer_id);
-extern void verse_send_b_tile_set(VNodeID node_id, VLayerID layer_id, uint16 tile_x, uint16 tile_y, uint16 z, VNBLayerType type, const VNBTile *tile);
-
-extern void verse_send_t_language_set(VNodeID node_id, const char *language);
-extern void verse_send_t_buffer_create(VNodeID node_id, VBufferID buffer_id, const char *name);
-extern void verse_send_t_buffer_destroy(VNodeID node_id, VBufferID buffer_id);
-extern void verse_send_t_buffer_subscribe(VNodeID node_id, VBufferID buffer_id);
-extern void verse_send_t_buffer_unsubscribe(VNodeID node_id, VBufferID buffer_id);
-extern void verse_send_t_text_set(VNodeID node_id, VBufferID buffer_id, uint32 pos, uint32 length, const char *text);
-
-extern void verse_send_c_curve_create(VNodeID node_id, VLayerID curve_id, const char *name, uint8 dimensions);
-extern void verse_send_c_curve_destroy(VNodeID node_id, VLayerID curve_id);
-extern void verse_send_c_curve_subscribe(VNodeID node_id, VLayerID curve_id);
-extern void verse_send_c_curve_unsubscribe(VNodeID node_id, VLayerID curve_id);
-extern void verse_send_c_key_set(VNodeID node_id, VLayerID curve_id, uint32 key_id, uint8 dimensions, const real64 *pre_value, const uint32 *pre_pos, const real64 *value, real64 pos, const real64 *post_value, const uint32 *post_pos);
-extern void verse_send_c_key_destroy(VNodeID node_id, VLayerID curve_id, uint32 key_id);
-
-extern void verse_send_a_buffer_create(VNodeID node_id, VBufferID buffer_id, const char *name, VNABlockType type, real64 frequency);
-extern void verse_send_a_buffer_destroy(VNodeID node_id, VBufferID buffer_id);
-extern void verse_send_a_buffer_subscribe(VNodeID node_id, VBufferID layer_id);
-extern void verse_send_a_buffer_unsubscribe(VNodeID node_id, VBufferID layer_id);
-extern void verse_send_a_block_set(VNodeID node_id, VLayerID buffer_id, uint32 block_index, VNABlockType type, const VNABlock *samples);
-extern void verse_send_a_block_clear(VNodeID node_id, VLayerID buffer_id, uint32 block_index);
-extern void verse_send_a_stream_create(VNodeID node_id, VLayerID stream_id, const char *name);
-extern void verse_send_a_stream_destroy(VNodeID node_id, VLayerID stream_id);
-extern void verse_send_a_stream_subscribe(VNodeID node_id, VLayerID stream_id);
-extern void verse_send_a_stream_unsubscribe(VNodeID node_id, VLayerID stream_id);
-extern void verse_send_a_stream(VNodeID node_id, VLayerID stream_id, uint32 time_s, uint32 time_f, VNABlockType type, real64 frequency, const VNABlock *samples);
-
-
-#if defined __cplusplus
-}
-#endif
-
-#endif /* VERSE_H */
diff --git a/extern/verse/dist/verse_header.h b/extern/verse/dist/verse_header.h
deleted file mode 100644
index 3f3403265fd..00000000000
--- a/extern/verse/dist/verse_header.h
+++ /dev/null
@@ -1,409 +0,0 @@
-#if !defined VERSE_TYPES
-#define VERSE_TYPES
-
-#include
-
-/* Release information. */
-#define V_RELEASE_NUMBER 6
-#define V_RELEASE_PATCH 1
-#define V_RELEASE_LABEL ""
-
-typedef unsigned char boolean;
-typedef signed char int8;
-typedef unsigned char uint8;
-typedef short int16;
-typedef unsigned short uint16;
-typedef int int32;
-typedef unsigned int uint32;
-typedef float real32;
-typedef double real64;
-
-#define V_REAL64_MAX 1.7976931348623158e+308
-#define V_REAL32_MAX 3.402823466e+38f
-
-#if !defined TRUE
-#define TRUE 1
-#define FALSE 0
-#endif
-
-#define V_HOST_ID_SIZE (3 * (512 / 8)) /* The size of host IDs (keys), in 8-bit bytes. */
-
-typedef enum {
- V_NT_OBJECT = 0,
- V_NT_GEOMETRY,
- V_NT_MATERIAL,
- V_NT_BITMAP,
- V_NT_TEXT,
- V_NT_CURVE,
- V_NT_AUDIO,
- V_NT_NUM_TYPES,
- V_NT_SYSTEM = V_NT_NUM_TYPES,
- V_NT_NUM_TYPES_NETPACK
-} VNodeType;
-
-typedef uint32 VNodeID;
-typedef uint16 VLayerID; /* Commonly used to identify layers, nodes that have them. */
-typedef uint16 VBufferID; /* Commonly used to identify buffers, nodes that have them. */
-typedef uint16 VNMFragmentID;
-
-typedef void * VSession;
-
-#define V_MAX_NAME_LENGTH_SHORT 16
-#define V_MAX_NAME_LENGTH_LONG 48
-#define V_MAX_NAME_PASS_LENGTH 128
-
-typedef enum {
- VN_OWNER_OTHER = 0,
- VN_OWNER_MINE
-} VNodeOwner;
-
-typedef enum {
- VN_O_METHOD_PTYPE_INT8 = 0,
- VN_O_METHOD_PTYPE_INT16,
- VN_O_METHOD_PTYPE_INT32,
-
- VN_O_METHOD_PTYPE_UINT8,
- VN_O_METHOD_PTYPE_UINT16,
- VN_O_METHOD_PTYPE_UINT32,
-
- VN_O_METHOD_PTYPE_REAL32,
- VN_O_METHOD_PTYPE_REAL64,
-
- VN_O_METHOD_PTYPE_REAL32_VEC2,
- VN_O_METHOD_PTYPE_REAL32_VEC3,
- VN_O_METHOD_PTYPE_REAL32_VEC4,
-
- VN_O_METHOD_PTYPE_REAL64_VEC2,
- VN_O_METHOD_PTYPE_REAL64_VEC3,
- VN_O_METHOD_PTYPE_REAL64_VEC4,
-
- VN_O_METHOD_PTYPE_REAL32_MAT4,
- VN_O_METHOD_PTYPE_REAL32_MAT9,
- VN_O_METHOD_PTYPE_REAL32_MAT16,
-
- VN_O_METHOD_PTYPE_REAL64_MAT4,
- VN_O_METHOD_PTYPE_REAL64_MAT9,
- VN_O_METHOD_PTYPE_REAL64_MAT16,
-
- VN_O_METHOD_PTYPE_STRING,
-
- VN_O_METHOD_PTYPE_NODE,
- VN_O_METHOD_PTYPE_LAYER
-} VNOParamType;
-
-typedef union {
- int8 vint8;
- int16 vint16;
- int32 vint32;
- uint8 vuint8;
- uint16 vuint16;
- uint32 vuint32;
- real32 vreal32;
- real64 vreal64;
- real32 vreal32_vec[4];
- real32 vreal32_mat[16];
- real64 vreal64_vec[4];
- real64 vreal64_mat[16];
- char *vstring;
- VNodeID vnode;
- VLayerID vlayer;
-} VNOParam;
-
-#define VN_TAG_MAX_BLOB_SIZE 500
-
-typedef enum {
- VN_TAG_BOOLEAN = 0,
- VN_TAG_UINT32,
- VN_TAG_REAL64,
- VN_TAG_STRING,
- VN_TAG_REAL64_VEC3,
- VN_TAG_LINK,
- VN_TAG_ANIMATION,
- VN_TAG_BLOB,
- VN_TAG_TYPE_COUNT
-} VNTagType;
-
-typedef enum {
- VN_TAG_GROUP_SIZE = 16,
- VN_TAG_NAME_SIZE = 16,
- VN_TAG_FULL_NAME_SIZE = 64,
- VN_TAG_STRING_SIZE = 128
-} VNTagConstants;
-
-typedef union {
- boolean vboolean;
- uint32 vuint32;
- real64 vreal64;
- char *vstring;
- real64 vreal64_vec3[3];
- VNodeID vlink;
- struct {
- VNodeID curve;
- uint32 start;
- uint32 end;
- } vanimation;
- struct {
- uint16 size;
- void *blob;
- } vblob;
-} VNTag;
-
-typedef enum {
- VN_S_CONNECT_NAME_SIZE = 32,
- VN_S_CONNECT_KEY_SIZE = 4,
- VN_S_CONNECT_DATA_SIZE = 32,
- VS_S_CONNECT_HOSTID_PRIVATE_SIZE = 3 * 2048 / 8,
- VS_S_CONNECT_HOSTID_PUBLIC_SIZE = 2 * 2048 / 8
-} VNSConnectConstants;
-
-typedef enum {
- VN_FORMAT_REAL32,
- VN_FORMAT_REAL64
-} VNRealFormat;
-
-typedef struct {
- real32 x, y, z, w;
-} VNQuat32;
-
-typedef struct {
- real64 x, y, z, w;
-} VNQuat64;
-
-typedef enum {
- VN_O_METHOD_GROUP_NAME_SIZE = 16,
- VN_O_METHOD_NAME_SIZE = 16,
- VN_O_METHOD_SIG_SIZE = 256
-} VNOMethodConstants;
-
-typedef void VNOPackedParams; /* Opaque type. */
-
-typedef enum {
- VN_G_LAYER_VERTEX_XYZ = 0,
- VN_G_LAYER_VERTEX_UINT32,
- VN_G_LAYER_VERTEX_REAL,
- VN_G_LAYER_POLYGON_CORNER_UINT32 = 128,
- VN_G_LAYER_POLYGON_CORNER_REAL,
- VN_G_LAYER_POLYGON_FACE_UINT8,
- VN_G_LAYER_POLYGON_FACE_UINT32,
- VN_G_LAYER_POLYGON_FACE_REAL
-} VNGLayerType;
-
-typedef enum {
- VN_M_LIGHT_DIRECT = 0,
- VN_M_LIGHT_AMBIENT,
- VN_M_LIGHT_DIRECT_AND_AMBIENT,
- VN_M_LIGHT_BACK_DIRECT,
- VN_M_LIGHT_BACK_AMBIENT,
- VN_M_LIGHT_BACK_DIRECT_AND_AMBIENT
-} VNMLightType;
-
-typedef enum {
- VN_M_NOISE_PERLIN_ZERO_TO_ONE = 0,
- VN_M_NOISE_PERLIN_MINUS_ONE_TO_ONE,
- VN_M_NOISE_POINT_ZERO_TO_ONE,
- VN_M_NOISE_POINT_MINUS_ONE_TO_ONE
-} VNMNoiseType;
-
-typedef enum {
- VN_M_RAMP_SQUARE = 0,
- VN_M_RAMP_LINEAR,
- VN_M_RAMP_SMOOTH
-} VNMRampType;
-
-typedef enum {
- VN_M_RAMP_RED = 0,
- VN_M_RAMP_GREEN,
- VN_M_RAMP_BLUE
-} VNMRampChannel;
-
-typedef struct {
- real64 pos;
- real64 red;
- real64 green;
- real64 blue;
-} VNMRampPoint;
-
-typedef enum {
- VN_M_BLEND_FADE = 0,
- VN_M_BLEND_ADD,
- VN_M_BLEND_SUBTRACT,
- VN_M_BLEND_MULTIPLY,
- VN_M_BLEND_DIVIDE,
-} VNMBlendType;
-
-typedef enum {
- VN_M_FT_COLOR = 0,
- VN_M_FT_LIGHT,
- VN_M_FT_REFLECTION,
- VN_M_FT_TRANSPARENCY,
- VN_M_FT_VOLUME,
- VN_M_FT_VIEW,
- VN_M_FT_GEOMETRY,
- VN_M_FT_TEXTURE,
- VN_M_FT_NOISE,
- VN_M_FT_BLENDER,
- VN_M_FT_CLAMP,
- VN_M_FT_MATRIX,
- VN_M_FT_RAMP,
- VN_M_FT_ANIMATION,
- VN_M_FT_ALTERNATIVE,
- VN_M_FT_OUTPUT
-} VNMFragmentType;
-
-typedef union {
- struct {
- real64 red;
- real64 green;
- real64 blue;
- } color;
- struct {
- uint8 type;
- real64 normal_falloff;
- VNodeID brdf;
- char brdf_r[16];
- char brdf_g[16];
- char brdf_b[16];
- } light;
- struct {
- real64 normal_falloff;
- } reflection;
- struct {
- real64 normal_falloff;
- real64 refraction_index;
- } transparency;
- struct {
- real64 diffusion;
- real64 col_r;
- real64 col_g;
- real64 col_b;
- } volume;
- struct {
- char layer_r[16];
- char layer_g[16];
- char layer_b[16];
- } geometry;
- struct{
- VNodeID bitmap;
- char layer_r[16];
- char layer_g[16];
- char layer_b[16];
- boolean filtered;
- VNMFragmentID mapping;
- } texture;
- struct {
- uint8 type;
- VNMFragmentID mapping;
- } noise;
- struct {
- uint8 type;
- VNMFragmentID data_a;
- VNMFragmentID data_b;
- VNMFragmentID control;
- } blender;
- struct {
- boolean min;
- real64 red;
- real64 green;
- real64 blue;
- VNMFragmentID data;
- } clamp;
- struct {
- real64 matrix[16];
- VNMFragmentID data;
- } matrix;
- struct {
- uint8 type;
- uint8 channel;
- VNMFragmentID mapping;
- uint8 point_count;
- VNMRampPoint ramp[48];
- } ramp;
- struct {
- char label[16];
- } animation;
- struct {
- VNMFragmentID alt_a;
- VNMFragmentID alt_b;
- } alternative;
- struct {
- char label[16];
- VNMFragmentID front;
- VNMFragmentID back;
- } output;
-} VMatFrag;
-
-typedef enum {
- VN_B_LAYER_UINT1 = 0,
- VN_B_LAYER_UINT8,
- VN_B_LAYER_UINT16,
- VN_B_LAYER_REAL32,
- VN_B_LAYER_REAL64
-} VNBLayerType;
-
-#define VN_B_TILE_SIZE 8
-
-typedef union{
- uint8 vuint1[8];
- uint8 vuint8[64];
- uint16 vuint16[64];
- real32 vreal32[64];
- real64 vreal64[64];
-} VNBTile;
-
-typedef enum {
- VN_T_CONTENT_LANGUAGE_SIZE = 32,
- VN_T_CONTENT_INFO_SIZE = 256,
- VN_T_BUFFER_NAME_SIZE = 16,
- VN_T_MAX_TEXT_CMD_SIZE = 1450
-} VNTConstants;
-
-/* This is how many *samples* are included in a block of the given type. Not bytes. */
-typedef enum {
- VN_A_BLOCK_SIZE_INT8 = 1024,
- VN_A_BLOCK_SIZE_INT16 = 512,
- VN_A_BLOCK_SIZE_INT24 = 384,
- VN_A_BLOCK_SIZE_INT32 = 256,
- VN_A_BLOCK_SIZE_REAL32 = 256,
- VN_A_BLOCK_SIZE_REAL64 = 128
-} VNAConstants;
-
-typedef enum {
- VN_A_BLOCK_INT8,
- VN_A_BLOCK_INT16,
- VN_A_BLOCK_INT24,
- VN_A_BLOCK_INT32,
- VN_A_BLOCK_REAL32,
- VN_A_BLOCK_REAL64
-} VNABlockType;
-
-/* Audio commands take pointers to blocks of these. They are not packed as unions. */
-typedef union {
- int8 vint8[VN_A_BLOCK_SIZE_INT8];
- int16 vint16[VN_A_BLOCK_SIZE_INT16];
- int32 vint24[VN_A_BLOCK_SIZE_INT24];
- int32 vint32[VN_A_BLOCK_SIZE_INT32];
- real32 vreal32[VN_A_BLOCK_SIZE_REAL32];
- real64 vreal64[VN_A_BLOCK_SIZE_REAL64];
-} VNABlock;
-
-extern void verse_set_port(uint16 port);
-extern void verse_host_id_create(uint8 *id);
-extern void verse_host_id_set(uint8 *id);
-extern void verse_callback_set(void *send_func, void *callback, void *user_data);
-extern void verse_callback_update(uint32 microseconds);
-extern void verse_session_set(VSession session);
-extern VSession verse_session_get(void);
-extern void verse_session_destroy(VSession session);
-extern size_t verse_session_get_size(void);
-extern VNodeID verse_session_get_avatar(void);
-extern void verse_session_get_time(uint32 *seconds, uint32 *fractions);
-
-extern VNOPackedParams * verse_method_call_pack(uint32 param_count, const VNOParamType *param_type, const VNOParam *params);
-extern boolean verse_method_call_unpack(const VNOPackedParams *data, uint32 param_count, const VNOParamType *param_type, VNOParam *params);
-
-/*
-#define V_PRINT_SEND_COMMANDS
-#define V_PRINT_RECEIVE_COMMANDS
-*/
-
-#endif /* VERSE_TYPES */
diff --git a/extern/verse/dist/verse_ms.c b/extern/verse/dist/verse_ms.c
deleted file mode 100644
index 84f3fdb837b..00000000000
--- a/extern/verse/dist/verse_ms.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * A helper library to send and parse master server pings. See the relevant
- * header for details.
- *
- * This code was written in 2006 by Emil Brink. It is released as public domain.
-*/
-
-#include
-#include
-#include
-#include
-
-#include "verse.h"
-#include "verse_ms.h"
-
-/* Build and send a MS:GET packet. */
-void verse_ms_get_send(const char *address, int fields, const char *tags)
-{
- char req[128];
-
- strcpy(req, "MS:GET IP=");
- if(fields & VERSE_MS_FIELD_DESCRIPTION)
- strcat(req, "DE");
- if(tags != NULL)
- {
- strcat(req, " TA=");
- strcat(req, tags);
- }
- verse_send_ping(address, req);
-}
-
-/* Skip assign, i.e. "NAME=" string, at . Stores name into , and then updates
- * it. Returns NULL on parse error, in which case the pointer is not advanced.
-*/
-static const char * skip_assign(char **put, const char *msg)
-{
- if(isalpha(*msg))
- {
- char *p = put != NULL ? *put : NULL;
-
- if(p != NULL)
- *p++ = *msg;
- msg++;
- while(*msg && (isalnum(*msg) || *msg == '_'))
- {
- if(p != NULL)
- *p++ = *msg;
- msg++;
- }
- if(*msg == '=')
- {
- if(p != NULL)
- *p++ = '\0';
- if(put != NULL)
- *put = p;
- return msg + 1;
- }
- }
- return NULL;
-}
-
-/** Skip value at , optionally storing de-quoted version through ,
- * which is advanced. Returns NULL on parse error, without updating .
-*/
-static const char * skip_value(char **put, const char *msg)
-{
- char *p = (put != NULL) ? *put : NULL;
-
- if(*msg == '"')
- {
- msg++;
- while(*msg != '\0' && *msg != '"')
- {
- if(*msg == '\\')
- {
- if(msg[1] != '\0')
- msg++;
- else
- return NULL;
- }
- if(p != NULL)
- *p++ = *msg;
- msg++;
- }
- if(*msg == '"')
- {
- if(p != NULL)
- *p++ = '\0';
- if(put != NULL)
- *put = p;
- msg++;
- if(*msg == '\0' || isspace(*msg))
- return msg;
- }
- return NULL;
- }
- while(*msg && !isspace(*msg))
- {
- if(*msg == '"')
- return NULL;
- if(p != NULL)
- *p++ = *msg;
- msg++;
- }
- if(p != NULL)
- *p++ = '\0';
- if(put != NULL)
- *put = p;
- return msg;
-}
-
-static const char * put_field(VMSField *field, char **put, const char *src)
-{
- const char *ptr;
- char *base = *put;
-
- if((ptr = skip_assign(put, src)) != NULL && ptr - src > 1)
- {
- field->name = base;
- src = ptr;
- base = *put;
- if((ptr = skip_value(put, src)) != NULL)
- {
- field->value = base;
- return ptr;
- }
- }
- return NULL;
-}
-
-static int cmp_fields(const void *a, const void *b)
-{
- return strcmp(((const VMSField *) a)->name, ((const VMSField *) b)->name);
-}
-
-VMSServer ** verse_ms_list_parse(const char *msg)
-{
- const char *word[384]; /* Takes quite a lot of stack space. */
- const char *ptr;
- char *put;
- size_t num_word = 0, i, j, num_ip = 0, num_field, space = 0;
- VMSServer **desc, *next;
- VMSField *field;
-
- if(strncmp(msg, "MS:LIST", 7) == 0)
- msg += 7;
- if(*msg != ' ')
- return NULL;
-
- /* Step one: split the string into words, at whitespace. Split is aware
- * of quoting rules for value assignment, this is crucial. This split is
- * non-invasive, meaning each "word" will be a suffix.
- */
- while(*msg)
- {
- while(isspace(*msg))
- msg++;
- ptr = skip_assign(NULL, msg);
- if(ptr != NULL)
- {
- space += ptr - msg;
- word[num_word++] = msg;
- msg = ptr;
- ptr = skip_value(NULL, msg);
- if(ptr == NULL)
- {
- fprintf(stderr, "Parse error\n");
- return NULL;
- }
- space += ptr - msg + 1;
- msg = ptr;
- }
- else if(*msg != '\0')
- {
- fprintf(stderr, "Parse error\n");
- return NULL;
- }
- }
- /* Now, count how many words begin with "IP=". */
- for(i = 0; i < num_word; i++)
- {
- if(strncmp(word[i], "IP=", 3) == 0)
- num_ip++;
- }
-/* printf("found %u IPs, %u bytes\n", num_ip, space);
- printf("%u IP and %u words -> %u fields total\n", num_ip, num_word, num_word - num_ip);
-*/ num_field = num_word - num_ip;
- /* Allocate the descriptions. */
-/* printf("allocating %u bytes\n", (num_ip + 1) * (sizeof *desc) + num_ip * sizeof **desc + num_field * sizeof (VMSField) + space);
- printf(" %u for pointers, %u for structs, %u for fields, %u string\n",
- (num_ip + 1) * (sizeof *desc), num_ip * sizeof **desc, num_field * sizeof (VMSField), space);
-*/ desc = malloc((num_ip + 1) * (sizeof *desc) + num_ip * sizeof **desc + num_field * sizeof (VMSField) + space);
- next = (VMSServer *) (desc + (num_ip + 1));
-/* printf("desc store at %u\n", (char *) next - (char *) desc);*/
- field = (VMSField *) (next + num_ip);
-/* printf("field store at %u\n", (char *) field - (char *) desc);*/
- put = (char *) (field + num_field);
-/* printf("string store at %u\n", put - (char *) desc);*/
- for(i = j = 0; i < num_word;)
- {
- if(strncmp(word[i], "IP=", 3) == 0)
- {
- desc[j] = next;
- next->ip = put;
- ptr = skip_value(&put, word[i] + 3);
- next->num_fields = 0;
- next->field = field;
- for(i++; i < num_word && strncmp(word[i], "IP=", 3) != 0; i++, next->num_fields++, field++)
- put_field(&next->field[next->num_fields], &put, word[i]);
- if(next->num_fields > 0) /* Sort the fields, for binary search later. */
- qsort(next->field, next->num_fields, sizeof *next->field, cmp_fields);
- j++;
- next++;
- }
- else
- i++;
- }
- desc[j] = NULL;
- return desc;
-}
-
-/* A binary search, exploiting that the fields are sorted. */
-static const VMSField * field_find(const VMSServer *ms, const char *name)
-{
- int lo, hi, mid, rel;
-
- if(ms == NULL || name == NULL)
- return NULL;
- lo = 0;
- hi = ms->num_fields;
- while(lo <= hi)
- {
- mid = (lo + hi) / 2;
- rel = strcmp(name, ms->field[mid].name);
- if(rel == 0)
- return &ms->field[mid];
- if(rel < 0)
- hi = mid - 1;
- else
- lo = mid + 1;
- }
- return NULL;
-}
-
-int verse_ms_field_exists(const VMSServer *ms, const char *name)
-{
- if(ms == NULL || name == NULL)
- return 0;
- return field_find(ms, name) != NULL;
-}
-
-const char * verse_ms_field_value(const VMSServer *ms, const char *name)
-{
- const VMSField *f;
-
- if((f = field_find(ms, name)) != NULL)
- return f->value;
- return NULL;
-}
-
-#if defined VERSE_MS_STANDALONE
-
-int main(void)
-{
- VMSServer **servers = verse_ms_list_parse("MS:LIST IP=127.0.0.1:4951 DE=\"A test server, mainly for Eskil\" COOL=yes BACKUP=daily LANG=sv_SE "
- "IP=130.237.221.74 DE=\"Test server on a puny laptop\" COOL=yes DORKY=no OPEN=absolutely "
- "IP=127.0.0.1:5151 DE=\"This is a back slash: '\\\\', cool huh?\" "
- "IP=127.0.0.1:6676 DE=\"a quote looks like this: \\\"\" IP=127.0.0.1:1122 ");
-
- if(servers != NULL)
- {
- int i, j;
-
- printf("Server info:\n");
- for(i = 0; servers[i] != NULL; i++)
- {
- printf("%u: IP=%s\n", i, servers[i]->ip);
- for(j = 0; j < servers[i]->num_fields; j++)
- printf(" %s='%s'\n", servers[i]->field[j].name, servers[i]->field[j].value);
- }
- free(servers);
- }
- return EXIT_SUCCESS;
-}
-
-#endif /* VERSE_MS_STANDALONE */
diff --git a/extern/verse/dist/verse_ms.h b/extern/verse/dist/verse_ms.h
deleted file mode 100644
index 5a27d3fd446..00000000000
--- a/extern/verse/dist/verse_ms.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * This is Verse Master Server, a small help library to aid application developers
- * make their applications interact with a Verse master server.
- *
- * There are two steps to the process:
- *
- * 1) Send a MS:GET request to a master server. This is done by the verse_ms_get_send()
- * function, which calls verse_send_ping() internally.
- *
- * 2) Parse any returned MS:LIST packets. This is a two-step process. The application
- * still owns the ping callback, and will need to check for received pings that
- * start with MS:LIST, and call the verse_ms_list_parse() function to parse those.
- *
- * A successfully parsed MS:LIST packet will result in an array of VMSServer pointers
- * being returned. Each VMSServer instance describes one server. Use the provided
- * functions to query each server structure.
- *
- * The application should call free() on the returned vector, whenever it is done with
- * the data (perhaps after copying it into application-defined data structures).
- *
- * For a lot more detail about the Verse master server protocol, please see
- * the spec at .
- *
- * This code was written in 2006 by Emil Brink. It is released as public domain.
- *
-*/
-
-#define VERSE_MS_VERSION "1.0"
-
-#if defined __cplusplus
-extern "C" {
-#endif
-
-typedef struct {
- const char *name; /* Field name. Upper-case. */
- const char *value; /* Field value. Fully parsed, might contain spaces. */
-} VMSField;
-
-typedef struct {
- const char *ip; /* IP address of server, in dotted decimal:port. */
- unsigned int num_fields; /* Number of fields of extra info. */
- VMSField *field; /* Vector of fields, or NULL if none. */
-} VMSServer;
-
-/* Formats and sends a MS:GET ping packet to the master server. The argument
- * should be a combination of VERSE_MS_FIELD_ mask values. If is set, it should
- * be a comma-separated set of include/exclude tags, like "a,b,-c,d,-e".
-*/
-#define VERSE_MS_FIELD_DESCRIPTION (1 << 0)
-extern void verse_ms_get_send(const char *address, int fields, const char *tags);
-
-/* Parses a master server response. This will be a string of the form "MS:LIST IP=blah ...",
- * which is split into one struct per IP, and any additional fields parsed (unquoted etc).
- * Returns an array of VMSServer pointers, which is NULL-terminated. Returns NULL if there
- * was a parse error somewhere in the string, no partial success is possible.
-*/
-extern VMSServer ** verse_ms_list_parse(const char *list);
-
-/* This is the only standard field name, currently. */
-#define VERSE_MS_FIELD_DESCRIPTION_NAME "DE" /* Human-readable server description. */
-
-/* Checks wether the given server has a field with the given name. */
-extern int verse_ms_field_exists(const VMSServer *ms, const char *name);
-
-/* Returns the value for the named field in the given server, if present.
- * If not, NULL is returned.
-*/
-extern const char * verse_ms_field_value(const VMSServer *ms, const char *name);
-
-#if defined __cplusplus
-}
-#endif
diff --git a/extern/verse/dist/vs_connection.c b/extern/verse/dist/vs_connection.c
deleted file mode 100644
index 06614a5dc66..00000000000
--- a/extern/verse/dist/vs_connection.c
+++ /dev/null
@@ -1,179 +0,0 @@
-#include
-
-#include "v_cmd_gen.h"
-
-#if !defined(V_GENERATE_FUNC_MODE)
-
-#include "verse.h"
-#include "v_util.h"
-
-#define VS_CONNECTION_CHUNK_SIZE 64
-
-typedef struct{
- VSession *session;
- unsigned int session_count;
-} VSSubscriptionList;
-
-typedef struct{
- VSession session;
- uint32 node_id;
- char name[128];
- char pass[128];
-} VSConnection;
-
-static struct {
- VSConnection *connection;
- unsigned int connection_length;
- VSSubscriptionList **list;
- unsigned int list_length;
- unsigned int current_session;
-} VSConnectionStorage;
-
-void vs_init_connection_storage(void)
-{
- VSConnectionStorage.connection = NULL;
- VSConnectionStorage.connection_length = 0;
- VSConnectionStorage.list = NULL;
- VSConnectionStorage.list_length = 0;
- VSConnectionStorage.current_session = 0;
-}
-
-void vs_add_new_connection(VSession session, const char *name, const char *pass, VNodeID node_id)
-{
- VSConnection *conn;
-
- if(VSConnectionStorage.connection_length % VS_CONNECTION_CHUNK_SIZE == 0)
- VSConnectionStorage.connection = realloc(VSConnectionStorage.connection, (sizeof *VSConnectionStorage.connection) * (VSConnectionStorage.connection_length + VS_CONNECTION_CHUNK_SIZE));
- conn = &VSConnectionStorage.connection[VSConnectionStorage.connection_length];
-
- conn->session = session;
- conn->node_id = node_id;
- v_strlcpy(conn->name, name, sizeof conn->name);
- v_strlcpy(conn->pass, pass, sizeof conn->pass);
-
- VSConnectionStorage.connection_length++;
-}
-
-uint32 vs_get_avatar(void)
-{
- return VSConnectionStorage.connection[VSConnectionStorage.current_session].node_id;
-}
-
-VSession vs_get_session(void)
-{
- return VSConnectionStorage.connection[VSConnectionStorage.current_session].session;
-}
-
-const char * vs_get_user_name(void)
-{
- return VSConnectionStorage.connection[VSConnectionStorage.current_session].name;
-}
-
-const char * vs_get_user_pass(void)
-{
- return VSConnectionStorage.connection[VSConnectionStorage.current_session].pass;
-}
-
-
-void vs_remove_connection(void)
-{
- unsigned int i, j;
- VSession *session;
- VSSubscriptionList *list;
-
- session = VSConnectionStorage.connection[VSConnectionStorage.current_session].session;
- for(i = 0; i < VSConnectionStorage.list_length; i++)
- {
- list = VSConnectionStorage.list[i];
- for(j = 0; j < list->session_count && list->session[j] != session; j++);
- if(j < list->session_count)
- list->session[j] = list->session[--list->session_count];
- }
- j = --VSConnectionStorage.connection_length;
-
- if(VSConnectionStorage.current_session < j)
- {
- VSConnectionStorage.connection[VSConnectionStorage.current_session].session = VSConnectionStorage.connection[j].session;
- VSConnectionStorage.connection[VSConnectionStorage.current_session].node_id = VSConnectionStorage.connection[j].node_id;
- }
- else
- VSConnectionStorage.current_session = 0;
-}
-
-void vs_set_next_session(void)
-{
- if(++VSConnectionStorage.current_session >= VSConnectionStorage.connection_length)
- VSConnectionStorage.current_session = 0;
- if(VSConnectionStorage.connection_length != 0)
- verse_session_set(VSConnectionStorage.connection[VSConnectionStorage.current_session].session);
-}
-
-VSSubscriptionList *vs_create_subscription_list(void)
-{
- VSSubscriptionList *list;
- list = malloc(sizeof *list);
- if(VSConnectionStorage.list_length % VS_CONNECTION_CHUNK_SIZE == 0)
- VSConnectionStorage.list = realloc(VSConnectionStorage.list, (sizeof *VSConnectionStorage.list) * (VSConnectionStorage.list_length + VS_CONNECTION_CHUNK_SIZE));
- VSConnectionStorage.list[VSConnectionStorage.list_length] = list;
- list->session = NULL;
- list->session_count = 0;
- VSConnectionStorage.list_length++;
- return list;
-}
-
-void vs_destroy_subscription_list(VSSubscriptionList *list)
-{
- unsigned int i;
-
- if(list == NULL)
- return;
- if(list->session != NULL)
- free(list->session);
- for(i = 0; i < VSConnectionStorage.list_length && VSConnectionStorage.list[i] != list; i++)
- ;
- if(i < VSConnectionStorage.list_length)
- VSConnectionStorage.list[i] = VSConnectionStorage.list[--VSConnectionStorage.list_length];
- free(list);
-}
-
-/* Returns 1 if subscriber was added, 0 if not (typically meaning it was already on the list). */
-int vs_add_new_subscriptor(VSSubscriptionList *list)
-{
- unsigned int i;
- if(list->session_count % VS_CONNECTION_CHUNK_SIZE == 0)
- list->session = realloc(list->session, (sizeof *list->session) * (list->session_count + VS_CONNECTION_CHUNK_SIZE));
- for(i = 0; i < list->session_count; i++)
- if(list->session[i] == VSConnectionStorage.connection[VSConnectionStorage.current_session].session)
- return 0;
- list->session[list->session_count] = VSConnectionStorage.connection[VSConnectionStorage.current_session].session;
- list->session_count++;
- return 1;
-}
-
-
-void vs_remove_subscriptor(VSSubscriptionList *list)
-{
- unsigned int i;
- VSession *session;
- session = VSConnectionStorage.connection[VSConnectionStorage.current_session].session;
- for(i = 0; i < list->session_count && list->session[i] != session; i++);
- if(i < list->session_count)
- list->session[i] = list->session[--list->session_count];
-}
-
-size_t vs_get_subscript_count(const VSSubscriptionList *list)
-{
- return list != NULL ? list->session_count : 0;
-}
-
-void vs_set_subscript_session(VSSubscriptionList *list, unsigned int session)
-{
- verse_session_set(list->session[session]);
-}
-
-void vs_reset_subscript_session(void)
-{
- verse_session_set(VSConnectionStorage.connection[VSConnectionStorage.current_session].session);
-}
-
-#endif
diff --git a/extern/verse/dist/vs_main.c b/extern/verse/dist/vs_main.c
deleted file mode 100644
index 3b388eecc56..00000000000
--- a/extern/verse/dist/vs_main.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
-** A simple Verse server.
-*/
-
-#include
-#include
-#include
-#include
-
-#include "v_cmd_gen.h"
-
-#if !defined V_GENERATE_FUNC_MODE
-
-#include "verse.h"
-#include "v_network.h"
-#include "v_util.h"
-#include "vs_server.h"
-
-extern VNodeID vs_node_create(VNodeID owner_id, unsigned int type);
-extern void callback_send_node_destroy(void *user_data, VNodeID node_id);
-extern void vs_reset_owner(VNodeID owner_id);
-
-static void callback_send_connect(void *user, const char *name, const char *pass, const char *address, const uint8 *host_id)
-{
- VNodeID avatar;
- VSession *session;
-
- printf("Connecting '%s'\n", name);
- if(TRUE)
- {
- avatar = vs_node_create(~0, V_NT_OBJECT);
- session = verse_send_connect_accept(avatar, address, NULL);
- vs_add_new_connection(session, name, pass, avatar);
-/* vs_avatar_init(avatar, name);*/
- }
- else
- {
- verse_send_connect_terminate(address, "I'm sorry but you are not welcome here.");
- }
-}
-
-static void callback_send_connect_terminate(void *user, char *address, char *bye)
-{
- printf("callback_send_connect_terminate\n");
- vs_reset_owner(vs_get_avatar());
- callback_send_node_destroy(NULL, vs_get_avatar());
- verse_session_destroy(vs_get_session());
- vs_remove_connection();
-}
-
-static void vs_load_host_id(const char *file_name)
-{
- FILE *f;
- uint8 id[V_HOST_ID_SIZE];
- size_t got;
-
- /* Attempt to read key from given filename. Fails silently. */
- if((f = fopen(file_name, "rb")) != NULL)
- {
- if((got = fread(id, 1, sizeof id, f)) > 0)
- {
- printf("Loaded %u-bit host ID key successfully\n", 8 * (got / 3));
- verse_host_id_set(id);
- }
- fclose(f);
- if(got)
- return;
- }
- /* If file didn't open, or reading failed, generate a new key and write it out. */
- verse_host_id_create(id);
- verse_host_id_set(id);
- if((f = fopen(file_name, "wb")) != NULL)
- {
- if(fwrite(id, sizeof id, 1, f) != 1)
- fprintf(stderr, "Warning: Couldn't write host ID to \"%s\"\n", file_name);
- fclose(f);
- }
- else
- fprintf(stderr, "Warning: Couldn't open \"%s\" for host ID writing\n", file_name);
-}
-
-static void cb_sigint_handler(int sig)
-{
- if(sig == SIGINT)
- {
- printf("Verse server terminating\n");
- exit(EXIT_SUCCESS);
- }
-}
-
-static void callback_send_ping(void *user, const char *address, const char *message)
-{
- if(strncmp(message, "DESCRIBE", 8) == 0 && message[8] == ' ')
- vs_master_handle_describe(address, message + 9);
-}
-
-static void usage(void)
-{
- printf("Verse server usage:\n");
- printf(" -h\t\t\tShow this usage information.\n");
- printf(" -ms\t\t\tRegisters the server with a master server at the address\n");
- printf(" \t\t\tgiven with the -ms:ip= option. Off by default.\n");
- printf(" -ms:ip=IP[:PORT]\tSet master server to register with. Implies -ms.\n");
- printf(" \t\t\tThe default address is <%s>.\n", vs_master_get_address());
- printf(" -ms:de=DESC\t\tSet description, sent to master server.\n");
- printf(" -ms:ta=TAGS\t\tSet tags, sent to master server.\n");
- printf(" -port=PORT\t\tSet port to use for incoming connections.\n");
- printf(" -version\t\tPrint version information and exit.\n");
-}
-
-int main(int argc, char **argv)
-{
- uint32 i, seconds, fractions, port = VERSE_STD_CONNECT_PORT;
-
- signal(SIGINT, cb_sigint_handler);
-
- vs_master_set_address("master.uni-verse.org"); /* The default master address. */
- vs_master_set_enabled(FALSE); /* Make sure master server support is disabled. */
- for(i = 1; i < (uint32) argc; i++)
- {
- if(strcmp(argv[i], "-h") == 0)
- {
- usage();
- return EXIT_SUCCESS;
- }
- else if(strcmp(argv[i], "-ms") == 0)
- vs_master_set_enabled(TRUE);
- else if(strncmp(argv[i], "-ms:ip=", 7) == 0)
- {
- vs_master_set_address(argv[i] + 7);
- vs_master_set_enabled(TRUE);
- }
- else if(strncmp(argv[i], "-ms:de=", 7) == 0)
- vs_master_set_desc(argv[i] + 7);
- else if(strncmp(argv[i], "-ms:ta=", 7) == 0)
- vs_master_set_tags(argv[i] + 7);
- else if(strncmp(argv[i], "-port=", 6) == 0)
- port = strtoul(argv[i] + 6, NULL, 0);
- else if(strcmp(argv[i], "-version") == 0)
- {
- printf("r%up%u%s\n", V_RELEASE_NUMBER, V_RELEASE_PATCH, V_RELEASE_LABEL);
- return EXIT_SUCCESS;
- }
- else
- fprintf(stderr, "Ignoring unknown argument \"%s\", try -h for help\n", argv[i]);
- }
-
- printf("Verse Server r%up%u%s by Eskil Steenberg \n", V_RELEASE_NUMBER, V_RELEASE_PATCH, V_RELEASE_LABEL);
- verse_set_port(port); /* The Verse standard port. */
- printf(" Listening on port %d\n", port);
-
- /* Seed the random number generator. Still rather too weak for crypto, I guess. */
- v_n_get_current_time(&seconds, &fractions);
- srand(seconds ^ fractions);
-
- vs_load_host_id("host_id.rsa");
- vs_init_node_storage();
- vs_o_callback_init();
- vs_g_callback_init();
- vs_m_callback_init();
- vs_b_callback_init();
- vs_t_callback_init();
- vs_c_callback_init();
- vs_a_callback_init();
- vs_h_callback_init();
- init_callback_node_storage();
- verse_callback_set(verse_send_ping, callback_send_ping, NULL);
- verse_callback_set(verse_send_connect, callback_send_connect, NULL);
- verse_callback_set(verse_send_connect_terminate, callback_send_connect_terminate, NULL);
-
- while(TRUE)
- {
- vs_set_next_session();
- verse_callback_update(1000000);
- vs_master_update();
- }
- return EXIT_SUCCESS;
-}
-
-#endif /* V_GENERATE_FUNC_MODE */
diff --git a/extern/verse/dist/vs_master.c b/extern/verse/dist/vs_master.c
deleted file mode 100644
index 4fa020d58b6..00000000000
--- a/extern/verse/dist/vs_master.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Master server communication code.
-*/
-
-#include
-#include
-
-#include "verse.h"
-#include "v_util.h"
-#include "vs_server.h"
-
-#define MASTER_SERVER_PERIOD (60.0) /* Period between ANNOUNCE to master server, in seconds. */
-
-static struct {
- boolean enabled;
- boolean started;
- const char *master;
- char desc[64];
- const char *tags;
- VUtilTimer timer;
-} server_info;
-
-#define LEFT(d) (sizeof server_info.desc - (d - server_info.desc) - 1)
-
-void vs_master_set_enabled(boolean enabled)
-{
- server_info.enabled = enabled;
-}
-
-const char * vs_master_get_address(void)
-{
- return server_info.master;
-}
-
-void vs_master_set_address(const char *address)
-{
- server_info.master = address;
-}
-
-void vs_master_set_desc(const char *desc)
-{
- const char *src = desc;
- char *dst = server_info.desc;
-
- for(; *src != '\0' && LEFT(dst) > 0;)
- {
- if(*src == '"')
- {
- if(LEFT(dst) < 2)
- break;
- *dst++ = '\\';
- }
- else if(*src == '\\')
- {
- if(LEFT(dst) < 2)
- break;
- *dst++ = '\\';
- }
- *dst++ = *src++;
- }
- *dst = '\0';
-}
-
-void vs_master_set_tags(const char *tags)
-{
- server_info.tags = tags; /* This needs more protection, instead of relying on the master server. */
-}
-
-void vs_master_update(void)
-{
- if(!server_info.enabled || server_info.master == NULL)
- return;
-
- if(!server_info.started)
- {
- v_timer_start(&server_info.timer);
- v_timer_advance(&server_info.timer, MASTER_SERVER_PERIOD);
- server_info.started = TRUE;
- return;
- }
- if(v_timer_elapsed(&server_info.timer) < MASTER_SERVER_PERIOD)
- return;
- verse_send_ping(server_info.master, "MS:ANNOUNCE");
- v_timer_start(&server_info.timer);
-/* printf("MS:ANNOUNCE sent to %s\n", server_info.master);*/
-}
-
-/* Check if a description request, of the form "A,B,C,...,D" includes the given keyword. This needs to
- * do more than just a simple strstr(), since the keyword may be a prefix. Shades of OpenGL extensions.
-*/
-static int desc_has_keyword(const char *desc, const char *keyword)
-{
- const char *ptr;
-
- if(desc == NULL || *desc == '\0') /* Quick-check for empty description. */
- return 0;
-
- if((ptr = strstr(desc, keyword)) != NULL)
- {
- size_t kl = strlen(keyword);
-
- return ptr[kl] == ',' || ptr[kl] == '\0';
- }
- return 0;
-}
-
-static int keyword_fits(size_t used, size_t max, const char *key, const char *value)
-{
- size_t vsize = 0;
-
- if(key != NULL && value != NULL)
- vsize += 1 + strlen(key) + 1 + 1 + strlen(value) + 1;
-
- return max - 1 - used >= vsize;
-}
-
-static char * append_desc(char *buf, const char *key, const char *value)
-{
- return buf + sprintf(buf, " %s=\"%s\"", key, value);
-}
-
-void vs_master_handle_describe(const char *address, const char *message)
-{
- char desc[1380] = "DESCRIPTION", *put = desc + 11;
-
- if(desc_has_keyword(message, "DE") && server_info.desc != NULL && keyword_fits(put - desc, sizeof desc, "DE", server_info.desc))
- put = append_desc(put, "DE", server_info.desc);
- if(desc_has_keyword(message, "TA") && server_info.tags != NULL && keyword_fits(put - desc, sizeof desc, "TA", server_info.tags))
- put = append_desc(put, "TA", server_info.tags);
- verse_send_ping(address, desc);
-}
diff --git a/extern/verse/dist/vs_node_audio.c b/extern/verse/dist/vs_node_audio.c
deleted file mode 100644
index e69d3d9b3ec..00000000000
--- a/extern/verse/dist/vs_node_audio.c
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
-**
-*/
-
-#include
-#include
-#include
-
-#include "v_cmd_gen.h"
-
-#if !defined V_GENERATE_FUNC_MODE
-
-#include "verse.h"
-#include "vs_server.h"
-
-typedef struct {
- void **data;
- unsigned int length;
- char name[16];
- VNABlockType type;
- real64 frequency;
- VSSubscriptionList *subscribers;
-} VSNLayer;
-
-typedef struct {
- char name[16];
- VSSubscriptionList *subscribers;
-} VSNStream;
-
-typedef struct{
- VSNodeHead head;
- VSNLayer *buffers;
- unsigned int buffer_count;
- VSNStream *streams;
- unsigned int stream_count;
-} VSNodeAudio;
-
-VSNodeAudio * vs_a_create_node(unsigned int owner)
-{
- VSNodeAudio *node;
- char name[48];
- unsigned int i;
-
- node = malloc(sizeof *node);
- vs_add_new_node(&node->head, V_NT_AUDIO);
- sprintf(name, "Audio_Node_%u", node->head.id);
- create_node_head(&node->head, name, owner);
- node->buffer_count = 16;
- node->buffers = malloc((sizeof *node->buffers) * node->buffer_count);
- for(i = 0; i < node->buffer_count; i++)
- node->buffers[i].name[0] = 0;
- node->stream_count = 16;
- node->streams = malloc((sizeof *node->streams) * node->stream_count);
- for(i = 0; i < node->stream_count; i++)
- node->streams[i].name[0] = 0;
-
- return node;
-}
-
-void vs_a_destroy_node(VSNodeAudio *node)
-{
- unsigned int i, j;
- destroy_node_head(&node->head);
-
- for(i = 0; i < node->buffer_count; i++)
- {
- if(node->buffers[i].name[0] != 0)
- {
- for(j = 0; j < node->buffers[i].length; j++)
- if(node->buffers[i].data[j] != NULL)
- free(node->buffers[i].data[j]);
- free(node->buffers[i].data);
- }
- }
- free(node->buffers);
- free(node->streams);
- free(node);
-}
-
-void vs_a_subscribe(VSNodeAudio *node)
-{
- unsigned int i;
- if(node == NULL)
- return;
- for(i = 0; i < node->buffer_count; i++)
- if(node->buffers[i].name[0] != 0)
- verse_send_a_buffer_create(node->head.id, i, node->buffers[i].name, node->buffers[i].type,
- node->buffers[i].frequency);
- for(i = 0; i < node->stream_count; i++)
- if(node->streams[i].name[0] != 0)
- verse_send_a_stream_create(node->head.id, i, node->streams[i].name);
-}
-
-void vs_a_unsubscribe(VSNodeAudio *node)
-{
- unsigned int i;
- for(i = 0; i < node->buffer_count; i++)
- if(node->buffers[i].name[0] != 0)
- vs_remove_subscriptor(node->buffers[i].subscribers);
- for(i = 0; i < node->stream_count; i++)
- if(node->streams[i].name[0] != 0)
- vs_remove_subscriptor(node->streams[i].subscribers);
-}
-
-static void callback_send_a_stream_create(void *user, VNodeID node_id, VLayerID stream_id, const char *name)
-{
- VSNodeAudio *node;
- unsigned int i, j, count;
-
- node = (VSNodeAudio *) vs_get_node(node_id, V_NT_AUDIO);
- if(node == NULL)
- return;
-
- for(i = 0; i < node->stream_count; i++)
- {
- if(stream_id != i)
- {
- for(j = 0; name[j] == node->streams[i].name[j] && name[j] != 0; j++);
- if(name[j] == node->streams[i].name[j])
- return;
- }
- }
- if(stream_id >= node->stream_count || node->streams[stream_id].name[0] == 0)
- {
- for(stream_id = 0; stream_id < node->stream_count && node->streams[stream_id].name[0] != 0; stream_id++);
- if(stream_id == node->stream_count)
- {
- stream_id = node->stream_count;
- node->stream_count += 16;
- node->streams = realloc(node->streams, (sizeof *node->streams) * node->stream_count);
- for(i = stream_id; i < node->stream_count; i++)
- node->streams[i].name[0] = 0;
- }
- node->streams[stream_id].subscribers = vs_create_subscription_list();
- }
- for(i = 0; name[i] != 0 && i < 15; i++)
- node->streams[stream_id].name[i] = name[i];
- node->streams[stream_id].name[i] = 0;
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_a_stream_create(node_id, stream_id, name);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_a_stream_destroy(void *user, VNodeID node_id, VLayerID stream_id)
-{
- VSNodeAudio *node;
- unsigned int i, count;
-
- node = (VSNodeAudio *)vs_get_node(node_id, V_NT_AUDIO);
- if(node == NULL || stream_id >= node->stream_count || node->streams[stream_id].name[0] == 0)
- return;
- vs_remove_subscriptor(node->streams[stream_id].subscribers);
- node->streams[stream_id].name[0] = 0;
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_a_stream_destroy(node_id, stream_id);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_a_buffer_create(void *user, VNodeID node_id, VBufferID buffer_id, const char *name,
- VNABlockType type, real64 frequency)
-{
- VSNodeAudio *node;
- unsigned int i, j, count;
-
- if(frequency < 0.0)
- return;
- node = (VSNodeAudio *)vs_get_node(node_id, V_NT_AUDIO);
- if(node == NULL)
- return;
-
- for(i = 0; i < node->buffer_count; i++)
- {
- if(buffer_id != i)
- {
- for(j = 0; name[j] == node->buffers[i].name[j] && name[j] != 0; j++);
- if(name[j] == node->buffers[i].name[j])
- return;
- }
- }
-
- if(buffer_id < node->buffer_count && node->buffers[buffer_id].name[0] != 0 && type != node->buffers[buffer_id].type)
- {
- free(node->buffers[buffer_id].data);
- vs_destroy_subscription_list(node->buffers[buffer_id].subscribers);
- node->buffers[buffer_id].name[0] = 0;
- }
-
- if(buffer_id >= node->buffer_count || node->buffers[buffer_id].name[0] == 0)
- {
- for(buffer_id = 0; buffer_id < node->buffer_count && node->buffers[buffer_id].name[0] != 0; buffer_id++);
- if(buffer_id == node->buffer_count)
- {
- buffer_id = node->buffer_count;
- node->buffer_count += 16;
- node->buffers = realloc(node->buffers, (sizeof *node->buffers) * node->buffer_count);
- for(i = buffer_id; i < node->buffer_count; i++)
- node->buffers[i].name[0] = 0;
- }
- node->buffers[buffer_id].subscribers = vs_create_subscription_list();
- node->buffers[buffer_id].type = type;
- node->buffers[buffer_id].frequency = frequency;
- node->buffers[buffer_id].length = 64;
- node->buffers[buffer_id].data = malloc(sizeof(*node->buffers[buffer_id].data) * node->buffers[buffer_id].length);
- for(i = 0; i < node->buffers[buffer_id].length; i++)
- node->buffers[buffer_id].data[i] = NULL;
- }
- for(i = 0; name[i] != 0 && i < 15; i++)
- node->buffers[buffer_id].name[i] = name[i];
- node->buffers[buffer_id].name[i] = 0;
-
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_a_buffer_create(node_id, buffer_id, name, type, frequency);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_a_buffer_destroy(void *user, VNodeID node_id, VBufferID buffer_id)
-{
- VSNodeAudio *node;
- unsigned int i, count;
-
- node = (VSNodeAudio *)vs_get_node(node_id, V_NT_AUDIO);
- if(node == NULL || buffer_id >= node->buffer_count || node->buffers[buffer_id].name[0] == 0)
- return;
- vs_remove_subscriptor(node->buffers[buffer_id].subscribers);
- node->buffers[buffer_id].name[0] = 0;
- free(node->buffers[buffer_id].data);
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_a_buffer_destroy(node_id, buffer_id);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_a_buffer_subscribe(void *user, VNodeID node_id, VLayerID buffer_id)
-{
- VSNodeAudio *node;
- unsigned int i;
-
- node = (VSNodeAudio *)vs_get_node(node_id, V_NT_AUDIO);
- if(node == NULL)
- return;
- if(node->buffer_count <= buffer_id)
- return;
- if(node->buffers[buffer_id].name[0] == 0)
- return;
- vs_add_new_subscriptor(node->buffers[buffer_id].subscribers);
- for(i = 0; i < node->buffers[buffer_id].length; i++)
- {
- if(node->buffers[buffer_id].data[i] != NULL)
- verse_send_a_block_set(node_id, buffer_id, i, node->buffers[buffer_id].type, node->buffers[buffer_id].data[i]);
- }
-}
-
-static void callback_send_a_buffer_unsubscribe(void *user, VNodeID node_id, VLayerID buffer_id)
-{
- VSNodeAudio *node;
- node = (VSNodeAudio *)vs_get_node(node_id, V_NT_AUDIO);
- if(node == NULL)
- return;
- if(node->buffer_count <= buffer_id)
- return;
- if(node->buffers[buffer_id].name[0] == 0)
- return;
- vs_remove_subscriptor(node->buffers[buffer_id].subscribers);
-}
-
-static void callback_send_a_block_set(void *user, VNodeID node_id, VLayerID buffer_id, uint32 block_index,
- VNABlockType type, const VNABlock *data)
-{
- static const size_t blocksize[] = {
- VN_A_BLOCK_SIZE_INT8 * sizeof (int8),
- VN_A_BLOCK_SIZE_INT16 * sizeof (int16),
- VN_A_BLOCK_SIZE_INT24 * 3 * sizeof (int8),
- VN_A_BLOCK_SIZE_INT32 * sizeof (int32),
- VN_A_BLOCK_SIZE_REAL32 * sizeof (real32),
- VN_A_BLOCK_SIZE_REAL64 * sizeof (real64)
- };
- VSNodeAudio *node;
- unsigned int i, count;
-
- if(type > VN_A_BLOCK_REAL64) /* Protect blocksize array. */
- return;
-
- node = (VSNodeAudio *)vs_get_node(node_id, V_NT_AUDIO);
- if(node == NULL)
- return;
- if(node->buffers[buffer_id].name[0] == 0)
- return;
- if(type != node->buffers[buffer_id].type) /* Disregard attempts to set data of wrong type. */
- return;
- if(block_index > node->buffers[buffer_id].length)
- {
- node->buffers[buffer_id].data = realloc(node->buffers[buffer_id].data,
- (sizeof *node->buffers[buffer_id].data) * (block_index + 64));
- for(i = node->buffers[buffer_id].length; i < block_index + 64; i++)
- node->buffers[buffer_id].data[i] = NULL;
- node->buffers[buffer_id].length = block_index + 64;
- }
-
- if(node->buffers[buffer_id].data[block_index] == NULL)
- node->buffers[buffer_id].data[block_index] = malloc(blocksize[type]);
- if(node->buffers[buffer_id].data[block_index] != NULL)
- {
- memcpy(node->buffers[buffer_id].data[block_index], data, blocksize[type]);
- count = vs_get_subscript_count(node->buffers[buffer_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->buffers[buffer_id].subscribers, i);
- verse_send_a_block_set(node_id, buffer_id, block_index, type, data);
- }
- vs_reset_subscript_session();
- }
-}
-
-static void callback_send_a_block_clear(void *user, VNodeID node_id, VLayerID buffer_id, uint32 id)
-{
- VSNodeAudio *node;
- unsigned int i, count;
- node = (VSNodeAudio *)vs_get_node(node_id, V_NT_AUDIO);
- if(node == NULL)
- return;
- if(node->buffer_count <= buffer_id)
- return;
- if(node->buffers[buffer_id].name[0] == 0)
- return;
- if(id >= node->buffers[buffer_id].length)
- return;
- if(node->buffers[buffer_id].data[id] == NULL)
- return;
- free(node->buffers[buffer_id].data[id]);
- node->buffers[buffer_id].data[id] = NULL;
- count = vs_get_subscript_count(node->buffers[buffer_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->buffers[buffer_id].subscribers, i);
- verse_send_a_block_clear(node_id, buffer_id, id);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_a_stream_subscribe(void *user, VNodeID node_id, VLayerID stream_id)
-{
- VSNodeAudio *node;
- node = (VSNodeAudio *)vs_get_node(node_id, V_NT_AUDIO);
- if(node == NULL)
- return;
- if(node->stream_count <= stream_id)
- return;
- if(node->streams[stream_id].name[0] == 0)
- return;
- vs_add_new_subscriptor(node->streams[stream_id].subscribers);
-}
-
-static void callback_send_a_stream_unsubscribe(void *user, VNodeID node_id, VLayerID stream_id)
-{
- VSNodeAudio *node;
- node = (VSNodeAudio *)vs_get_node(node_id, V_NT_AUDIO);
- if(node == NULL)
- return;
- if(node->stream_count <= stream_id)
- return;
- if(node->streams[stream_id].name[0] == 0)
- return;
- vs_remove_subscriptor(node->streams[stream_id].subscribers);
-}
-
-static void callback_send_a_stream(void *user, VNodeID node_id, VLayerID stream_id, uint32 time_s, uint32 time_f,
- VNABlockType type, real64 frequency, const VNABlock *data)
-{
- VSNodeAudio *node;
- unsigned int i, count;
-
- if(frequency < 0)
- return;
- node = (VSNodeAudio *)vs_get_node(node_id, V_NT_AUDIO);
- if(node == NULL)
- return;
- if(node->stream_count <= stream_id)
- return;
- if(node->streams[stream_id].name[0] == 0)
- return;
- count = vs_get_subscript_count(node->streams[stream_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->streams[stream_id].subscribers, i);
- verse_send_a_stream(node_id, stream_id, time_s, time_f, type, frequency, data);
- }
- vs_reset_subscript_session();
-}
-
-void vs_a_callback_init(void)
-{
- verse_callback_set(verse_send_a_buffer_create, callback_send_a_buffer_create, NULL);
- verse_callback_set(verse_send_a_buffer_destroy, callback_send_a_buffer_destroy, NULL);
- verse_callback_set(verse_send_a_buffer_subscribe, callback_send_a_buffer_subscribe, NULL);
- verse_callback_set(verse_send_a_buffer_unsubscribe, callback_send_a_buffer_unsubscribe, NULL);
- verse_callback_set(verse_send_a_block_set, callback_send_a_block_set, NULL);
- verse_callback_set(verse_send_a_block_clear, callback_send_a_block_clear, NULL);
- verse_callback_set(verse_send_a_stream_create, callback_send_a_stream_create, NULL);
- verse_callback_set(verse_send_a_stream_destroy, callback_send_a_stream_destroy, NULL);
- verse_callback_set(verse_send_a_stream_subscribe, callback_send_a_stream_subscribe, NULL);
- verse_callback_set(verse_send_a_stream_unsubscribe, callback_send_a_stream_unsubscribe, NULL);
- verse_callback_set(verse_send_a_stream, callback_send_a_stream, NULL);
-}
-
-#endif
diff --git a/extern/verse/dist/vs_node_bitmap.c b/extern/verse/dist/vs_node_bitmap.c
deleted file mode 100644
index 566287a86d4..00000000000
--- a/extern/verse/dist/vs_node_bitmap.c
+++ /dev/null
@@ -1,560 +0,0 @@
-/*
-**
-*/
-
-#include
-#include
-#include
-
-#include "v_cmd_gen.h"
-
-#if !defined V_GENERATE_FUNC_MODE
-
-#include "verse.h"
-#include "vs_server.h"
-
-typedef struct {
- VNBLayerType type;
- char name[16];
- void *layer;
- VSSubscriptionList *subscribers;
-} VSNBLayers;
-
-typedef struct {
- VSNodeHead head;
- uint16 size[3];
- uint32 partial_tile_col, partial_tile_row; /* These rows/columns are partial. ~0 for none. */
- VSNBLayers *layers;
- unsigned int layer_count;
-} VSNodeBitmap;
-
-static unsigned long tile_counter = 0;
-
-VSNodeBitmap * vs_b_create_node(unsigned int owner)
-{
- VSNodeBitmap *node;
- char name[48];
- node = malloc(sizeof *node);
- vs_add_new_node(&node->head, V_NT_BITMAP);
- sprintf(name, "Bitmap_Node_%u", node->head.id);
- create_node_head(&node->head, name, owner);
-
- node->size[0] = 0;
- node->size[1] = 0;
- node->size[2] = 0;
- node->partial_tile_col = ~0;
- node->partial_tile_row = ~0;
- node->layers = NULL;
- node->layer_count = 0;
-
- return node;
-}
-
-void vs_b_destroy_node(VSNodeBitmap *node)
-{
- unsigned int i;
- destroy_node_head(&node->head);
- if(node->layers != NULL)
- {
- for(i = 0; i < node->layer_count; i++)
- if(node->layers[i].layer != NULL)
- free(node->layers[i].layer);
- free(node->layers);
- }
- free(node);
-}
-
-void vs_b_subscribe(VSNodeBitmap *node)
-{
- unsigned int i;
- verse_send_b_dimensions_set(node->head.id, node->size[0], node->size[1], node->size[2]);
- for(i = 0; i < node->layer_count; i++)
- if(node->layers[i].name[0] != 0)
- verse_send_b_layer_create(node->head.id, (uint16)i, node->layers[i].name, (uint8)node->layers[i].type);
-}
-
-
-void vs_b_unsubscribe(VSNodeBitmap *node)
-{
- unsigned int i;
- for(i = 0; i < node->layer_count; i++)
- if(node->layers[i].name[0] != 0)
- vs_remove_subscriptor(node->layers[i].subscribers);
-}
-
-static void callback_send_b_dimensions_set(void *user, VNodeID node_id, uint16 width, uint16 height, uint16 depth)
-{
- VSNodeBitmap *node;
- unsigned int i, j, k, count, tiles[2], read, write, end = 0;
-
- if((node = (VSNodeBitmap *)vs_get_node(node_id, V_NT_BITMAP)) == NULL)
- return;
- tiles[0] = (width + VN_B_TILE_SIZE - 1) / VN_B_TILE_SIZE;
- tiles[1] = (height + VN_B_TILE_SIZE - 1) / VN_B_TILE_SIZE;
- node->size[0] = (node->size[0] + VN_B_TILE_SIZE - 1) / VN_B_TILE_SIZE;
- node->size[1] = (node->size[1] + VN_B_TILE_SIZE - 1) / VN_B_TILE_SIZE;
- if(node->size[0] > tiles[0])
- node->size[0] = tiles[0];
- if(node->size[1] > tiles[1])
- node->size[1] = tiles[1];
- if(node->size[2] > depth)
- node->size[2] = depth;
-
- for(i = 0; i < node->layer_count; i++)
- {
- if(node->layers[i].name[0] != 0)
- {
- switch(node->layers[i].type)
- {
- case VN_B_LAYER_UINT1 :
- {
- uint16 *array, *old;
- write = 0;
- old = node->layers[i].layer;
- array = node->layers[i].layer = malloc((sizeof *array) * tiles[0] * tiles[1] * depth);
- for(j = 0; j < node->size[2]; j++)
- {
- for(k = 0; k < node->size[1]; k++)
- {
- read = (j * node->size[1] * node->size[0] + k * node->size[0]);
-
- end = (j * tiles[1] * tiles[0] + k * tiles[0] + node->size[0]);
- while(write < end)
- array[write++] = old[read++];
-
- end = (j * tiles[1] * tiles[0] + (k + 1) * tiles[0]);
- while(write < end)
- array[write++] = 0;
- }
- end = ((j + 1) * tiles[1] * tiles[0]);
- while(write < end)
- array[write++] = 0;
- }
- k = depth * tiles[1] * tiles[0];
- while(write < end)
- array[write++] = 0;
- }
- break;
- case VN_B_LAYER_UINT8 :
- {
- uint8 *array, *old;
- write = 0;
- old = node->layers[i].layer;
- array = node->layers[i].layer = malloc((sizeof *array) * tiles[0] * tiles[1] * depth * VN_B_TILE_SIZE * VN_B_TILE_SIZE);
- for(j = 0; j < node->size[2]; j++)
- {
- for(k = 0; k < node->size[1]; k++)
- {
- read = (j * node->size[1] * node->size[0] + k * node->size[0]) * VN_B_TILE_SIZE * VN_B_TILE_SIZE;
-
- end = (j * tiles[1] * tiles[0] + k * tiles[0] + node->size[0]) * VN_B_TILE_SIZE * VN_B_TILE_SIZE;
- while(write < end)
- array[write++] = old[read++];
-
- end = (j * tiles[1] * tiles[0] + (k + 1) * tiles[0]) * VN_B_TILE_SIZE * VN_B_TILE_SIZE;
- while(write < end)
- array[write++] = 0;
- }
- end = ((j + 1) * tiles[1] * tiles[0]) * VN_B_TILE_SIZE * VN_B_TILE_SIZE;
- while(write < end)
- array[write++] = 0;
- }
- end = depth * tiles[1] * tiles[0] * VN_B_TILE_SIZE * VN_B_TILE_SIZE;
- while(write < end)
- array[write++] = 0;
- }
- break;
- case VN_B_LAYER_UINT16 :
- {
- uint16 *array, *old;
- write = 0;
- old = node->layers[i].layer;
- array = node->layers[i].layer = malloc((sizeof *array) * tiles[0] * tiles[1] * depth * VN_B_TILE_SIZE * VN_B_TILE_SIZE);
- for(j = 0; j < node->size[2]; j++)
- {
- for(k = 0; k < node->size[1]; k++)
- {
- read = (j * node->size[1] * node->size[0] + k * node->size[0]) * VN_B_TILE_SIZE * VN_B_TILE_SIZE;
-
- end = (j * tiles[1] * tiles[0] + k * tiles[0] + node->size[0]) * VN_B_TILE_SIZE * VN_B_TILE_SIZE;
- while(write < end)
- array[write++] = old[read++];
-
- end = (j * tiles[1] * tiles[0] + (k + 1) * tiles[0]) * VN_B_TILE_SIZE * VN_B_TILE_SIZE;
- while(write < end)
- array[write++] = 0;
- }
- end = ((j + 1) * tiles[1] * tiles[0]) * VN_B_TILE_SIZE * VN_B_TILE_SIZE;
- while(write < end)
- array[write++] = 0;
- }
- end = depth * tiles[1] * tiles[0] * VN_B_TILE_SIZE * VN_B_TILE_SIZE;
- while(write < end)
- array[write++] = 0;
- }
- break;
- case VN_B_LAYER_REAL32 :
- {
- real32 *array, *old;
- write = 0;
- old = node->layers[i].layer;
- array = node->layers[i].layer = malloc((sizeof *array) * tiles[0] * tiles[1] * depth * VN_B_TILE_SIZE * VN_B_TILE_SIZE);
- for(j = 0; j < node->size[2]; j++)
- {
- for(k = 0; k < node->size[1]; k++)
- {
- read = (j * node->size[1] * node->size[0] + k * node->size[0]) * VN_B_TILE_SIZE * VN_B_TILE_SIZE;
-
- end = (j * tiles[1] * tiles[0] + k * tiles[0] + node->size[0]) * VN_B_TILE_SIZE * VN_B_TILE_SIZE;
- while(write < end)
- array[write++] = old[read++];
-
- end = (j * tiles[1] * tiles[0] + (k + 1) * tiles[0]) * VN_B_TILE_SIZE * VN_B_TILE_SIZE;
- while(write < end)
- array[write++] = 0;
- }
- end = ((j + 1) * tiles[1] * tiles[0]) * VN_B_TILE_SIZE * VN_B_TILE_SIZE;
- while(write < end)
- array[write++] = 0;
- }
- end = depth * tiles[1] * tiles[0] * VN_B_TILE_SIZE * VN_B_TILE_SIZE;
- while(write < end)
- array[write++] = 0;
- }
- break;
- case VN_B_LAYER_REAL64 :
- {
- real64 *array, *old;
- write = 0;
- old = node->layers[i].layer;
- array = node->layers[i].layer = malloc((sizeof *array) * tiles[0] * tiles[1] * depth * VN_B_TILE_SIZE * VN_B_TILE_SIZE);
- for(j = 0; j < node->size[2]; j++)
- {
- for(k = 0; k < node->size[1]; k++)
- {
- read = (j * node->size[1] * node->size[0] + k * node->size[0]) * VN_B_TILE_SIZE * VN_B_TILE_SIZE;
-
- end = (j * tiles[1] * tiles[0] + k * tiles[0] + node->size[0]) * VN_B_TILE_SIZE * VN_B_TILE_SIZE;
- while(write < end)
- array[write++] = old[read++];
-
- end = (j * tiles[1] * tiles[0] + (k + 1) * tiles[0]) * VN_B_TILE_SIZE * VN_B_TILE_SIZE;
- while(write < end)
- array[write++] = 0;
- }
- end = ((j + 1) * tiles[1] * tiles[0]) * VN_B_TILE_SIZE * VN_B_TILE_SIZE;
- while(write < end)
- array[write++] = 0;
- }
- end = depth * tiles[1] * tiles[0] * VN_B_TILE_SIZE * VN_B_TILE_SIZE;
- while(write < end)
- array[write++] = 0;
- }
- break;
- }
- }
- }
-
- node->size[0] = width;
- node->size[1] = height;
- node->size[2] = depth;
- node->partial_tile_col = (width % VN_B_TILE_SIZE) != 0 ? (width + VN_B_TILE_SIZE - 1) / VN_B_TILE_SIZE - 1 : ~0;
- node->partial_tile_row = (height % VN_B_TILE_SIZE) != 0 ? (height + VN_B_TILE_SIZE - 1) / VN_B_TILE_SIZE - 1 : ~0;
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_b_dimensions_set(node_id, width, height, depth);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_b_layer_create(void *user, VNodeID node_id, VLayerID layer_id, char *name, uint8 type)
-{
- VSNodeBitmap *node;
- unsigned int i, count;
-
- if((node = (VSNodeBitmap *)vs_get_node(node_id, V_NT_BITMAP)) == NULL)
- return;
- if(node->layer_count <= layer_id || node->layers[layer_id].name[0] == 0)
- {
- for(layer_id = 0; layer_id < node->layer_count && node->layers[layer_id].name[0] != 0; layer_id++)
- ;
- if(layer_id == node->layer_count)
- {
- node->layers = realloc(node->layers, (sizeof *node->layers) * (node->layer_count + 16));
- for(i = node->layer_count; i < node->layer_count + 16; i++)
- {
- node->layers[i].layer = NULL;
- node->layers[i].type = 0;
- node->layers[i].name[0] = 0;
- node->layers[i].subscribers = NULL;
- }
- node->layer_count += 16;
- }
- node->layers[layer_id].subscribers = vs_create_subscription_list();
- node->layers[layer_id].type = type + 1;
- }
-
- if(node->layers[layer_id].type != type || node->layers[layer_id].name[0] == 0)
- {
- count = ((node->size[0] + VN_B_TILE_SIZE - 1) / VN_B_TILE_SIZE) * ((node->size[1] + VN_B_TILE_SIZE - 1) / VN_B_TILE_SIZE);
- count *= VN_B_TILE_SIZE * VN_B_TILE_SIZE * node->size[2];
- if(node->layers[layer_id].layer != NULL)
- free(node->layers[layer_id].layer);
- if(count != 0)
- {
- switch(type)
- {
- case VN_B_LAYER_UINT1 :
- node->layers[layer_id].layer = malloc(sizeof(uint8) * count / 8);
- memset(node->layers[layer_id].layer, 0, count * sizeof(uint8) / 8);
- break;
- case VN_B_LAYER_UINT8 :
- node->layers[layer_id].layer = malloc(sizeof(uint8) * count);
- memset(node->layers[layer_id].layer, 0, count * sizeof(uint8));
- break;
- case VN_B_LAYER_UINT16 :
- node->layers[layer_id].layer = malloc(sizeof(uint16) * count);
- memset(node->layers[layer_id].layer, 0, count * sizeof(uint16));
- break;
- case VN_B_LAYER_REAL32 :
- node->layers[layer_id].layer = malloc(sizeof(real32) * count);
- memset(node->layers[layer_id].layer, 0, count * sizeof(real32));
- break;
- case VN_B_LAYER_REAL64 :
- node->layers[layer_id].layer = malloc(sizeof(real64) * count);
- memset(node->layers[layer_id].layer, 0, count * sizeof(real64));
- break;
- }
- }else
- node->layers[layer_id].layer = NULL;
- }
- node->layers[layer_id].type = type;
- for(i = 0; i < 15 && name[i] != 0; i++)
- node->layers[layer_id].name[i] = name[i];
- node->layers[layer_id].name[i] = 0;
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_b_layer_create(node_id, layer_id, name, type);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_b_layer_destroy(void *user, VNodeID node_id, VLayerID layer_id)
-{
- VSNodeBitmap *node;
- unsigned int i, count;
- if((node = (VSNodeBitmap *)vs_get_node(node_id, V_NT_BITMAP)) == NULL)
- return;
- if(layer_id >= node->layer_count || node->layers[layer_id].layer == NULL)
- return;
- if(node->layers[layer_id].layer != NULL)
- free(node->layers[layer_id].layer);
- node->layers[layer_id].layer = NULL;
- node->layers[layer_id].type = 0;
- node->layers[layer_id].name[0] = 0;
- vs_destroy_subscription_list(node->layers[layer_id].subscribers);
- node->layers[layer_id].subscribers = NULL;
-
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_b_layer_destroy(node_id, layer_id);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_b_layer_subscribe(void *user, VNodeID node_id, VLayerID layer_id, uint8 level)
-{
- VSNodeBitmap *node;
- const void *data;
- unsigned int i, j, k, tile[3];
-
- if((node = (VSNodeBitmap *)vs_get_node(node_id, V_NT_BITMAP)) == NULL)
- return;
- if(layer_id >= node->layer_count || node->layers[layer_id].layer == NULL)
- return;
- if(vs_add_new_subscriptor(node->layers[layer_id].subscribers) == 0)
- return;
- tile[0] = ((node->size[0] + VN_B_TILE_SIZE - 1) / VN_B_TILE_SIZE);
- tile[1] = ((node->size[1] + VN_B_TILE_SIZE - 1) / VN_B_TILE_SIZE);
- tile[2] = node->size[2];
- data = node->layers[layer_id].layer;
- switch(node->layers[layer_id].type)
- {
- case VN_B_LAYER_UINT1:
- for(i = 0; i < tile[0]; i++)
- for(j = 0; j < tile[1]; j++)
- for(k = 0; k < tile[2]; k++)
- verse_send_b_tile_set(node_id, layer_id, i, j, k, VN_B_LAYER_UINT1, (VNBTile *) &((uint8*)data)[(tile[0] * tile[1] * k + j * tile[0] + i) * VN_B_TILE_SIZE * VN_B_TILE_SIZE / 8]);
- break;
- case VN_B_LAYER_UINT8 :
- for(i = 0; i < tile[0]; i++)
- for(j = 0; j < tile[1]; j++)
- for(k = 0; k < tile[2]; k++)
- verse_send_b_tile_set(node_id, layer_id, i, j, k, VN_B_LAYER_UINT8, (VNBTile *) &((uint8*)data)[(tile[0] * tile[1] * k + j * tile[0] + i) * VN_B_TILE_SIZE * VN_B_TILE_SIZE]);
- break;
- case VN_B_LAYER_UINT16 :
- for(i = 0; i < tile[0]; i++)
- for(j = 0; j < tile[1]; j++)
- for(k = 0; k < tile[2]; k++)
- verse_send_b_tile_set(node_id, layer_id, i, j, k, VN_B_LAYER_UINT16, (VNBTile *) &((uint16*)data)[(tile[0] * tile[1] * k + j * tile[0] + i) * VN_B_TILE_SIZE * VN_B_TILE_SIZE]);
- break;
- case VN_B_LAYER_REAL32 :
- for(i = 0; i < tile[0]; i++)
- for(j = 0; j < tile[1]; j++)
- for(k = 0; k < tile[2]; k++)
- verse_send_b_tile_set(node_id, layer_id, i, j, k, VN_B_LAYER_REAL32, (VNBTile *) &((real32*)data)[(tile[0] * tile[1] * k + j * tile[0] + i) * VN_B_TILE_SIZE * VN_B_TILE_SIZE]);
- break;
- case VN_B_LAYER_REAL64 :
- for(i = 0; i < tile[0]; i++)
- for(j = 0; j < tile[1]; j++)
- for(k = 0; k < tile[2]; k++)
- verse_send_b_tile_set(node_id, layer_id, i, j, k, VN_B_LAYER_REAL64, (VNBTile *) &((real64*)data)[(tile[0] * tile[1] * k + j * tile[0] + i) * VN_B_TILE_SIZE * VN_B_TILE_SIZE]);
- break;
- }
-}
-
-static void callback_send_b_layer_unsubscribe(void *user, VNodeID node_id, VLayerID layer_id)
-{
- VSNodeBitmap *node;
- if((node = (VSNodeBitmap *)vs_get_node(node_id, V_NT_BITMAP)) == NULL)
- return;
- if(layer_id >= node->layer_count || node->layers[layer_id].layer == NULL)
- return;
- vs_remove_subscriptor(node->layers[layer_id].subscribers);
-}
-
-/* Clear any pixels that lie outside the image, so we don't violoate specs when
- * sending (stored version of) the tile out to subscribers.
-*/
-static void clear_outside(const VSNodeBitmap *node, uint16 tile_x, uint16 tile_y, uint8 type, VNBTile *tile)
-{
- int x, y, bx, by, p;
-
- by = tile_y * VN_B_TILE_SIZE;
- for(y = p = 0; y < VN_B_TILE_SIZE; y++, by++)
- {
- bx = tile_x * VN_B_TILE_SIZE;
- for(x = 0; x < VN_B_TILE_SIZE; x++, bx++, p++)
- {
- /* Simply test current pixel against bitmap size. Not quick, but simple. */
- if(bx >= node->size[0] || by >= node->size[1])
- {
- switch(type)
- {
- case VN_B_LAYER_UINT1:
- tile->vuint1[y] &= ~(128 >> x);
- break;
- case VN_B_LAYER_UINT8:
- tile->vuint8[p] = 0;
- break;
- case VN_B_LAYER_UINT16:
- tile->vuint16[p] = 0;
- break;
- case VN_B_LAYER_REAL32:
- tile->vreal32[p] = 0.0f;
- break;
- case VN_B_LAYER_REAL64:
- tile->vreal64[p] = 0.0;
- break;
- }
- }
- }
- }
-}
-
-static void callback_send_b_tile_set(void *user, VNodeID node_id, VLayerID layer_id,
- uint16 tile_x, uint16 tile_y, uint16 tile_z, uint8 type, VNBTile *data)
-{
- VSNodeBitmap *node;
- unsigned int i, count, tile[3];
-
- if((node = (VSNodeBitmap *)vs_get_node(node_id, V_NT_BITMAP)) == NULL)
- {
- printf("got tile for unknown bitmpa node %u, aborting\n", node_id);
- return;
- }
- if(layer_id >= node->layer_count || node->layers[layer_id].layer == NULL || node->layers[layer_id].type != type)
- {
- printf("node %u got tile for bad layer %u (have %u) %p\n", node_id, layer_id, node->layer_count, layer_id < node->layer_count ? node->layers[layer_id].layer : NULL);
- return;
- }
- if(tile_x >= ((node->size[0] + VN_B_TILE_SIZE - 1) / VN_B_TILE_SIZE) || tile_y >= ((node->size[1] + VN_B_TILE_SIZE - 1) / VN_B_TILE_SIZE) || tile_z >= node->size[2])
- {
- printf("got tile that is outside image, at (%u,%u,%u)\n", tile_x, tile_y, tile_z);
- return;
- }
-
- tile_counter++;
-
- tile[0] = ((node->size[0] + VN_B_TILE_SIZE - 1) / VN_B_TILE_SIZE);
- tile[1] = ((node->size[1] + VN_B_TILE_SIZE - 1) / VN_B_TILE_SIZE);
- tile[2] = node->size[2];
-
- /* If tile is in a partial column or row, clear the "outside" pixels. */
- if((uint32) tile_x == node->partial_tile_col || (uint32) tile_y == node->partial_tile_row)
- clear_outside(node, tile_x, tile_y, type, data);
-
- switch(node->layers[layer_id].type)
- {
- case VN_B_LAYER_UINT1 :
- {
- uint8 *p;
- p = &((uint8 *)node->layers[layer_id].layer)[(tile[0] * tile[1] * tile_z + tile_y * tile[0] + tile_x) * VN_B_TILE_SIZE * VN_B_TILE_SIZE/8];
- memcpy(p, data->vuint1, VN_B_TILE_SIZE * sizeof(uint8));
- }
- break;
- case VN_B_LAYER_UINT8 :
- {
- uint8 *p;
- p = &((uint8 *)node->layers[layer_id].layer)[(tile[0] * tile[1] * tile_z + tile_y * tile[0] + tile_x) * VN_B_TILE_SIZE * VN_B_TILE_SIZE];
- memcpy(p, data->vuint8, VN_B_TILE_SIZE * VN_B_TILE_SIZE * sizeof(uint8));
- }
- break;
- case VN_B_LAYER_UINT16 :
- {
- uint16 *p;
- p = &((uint16 *)node->layers[layer_id].layer)[(tile[0] * tile[1] * tile_z + tile_y * tile[0] + tile_x) * VN_B_TILE_SIZE * VN_B_TILE_SIZE];
- memcpy(p, data->vuint16, VN_B_TILE_SIZE * VN_B_TILE_SIZE * sizeof(uint16));
- }
- break;
- case VN_B_LAYER_REAL32 :
- {
- real32 *p;
- p = &((real32 *)node->layers[layer_id].layer)[(tile[0] * tile[1] * tile_z + tile_y * tile[0] + tile_x) * VN_B_TILE_SIZE * VN_B_TILE_SIZE];
- memcpy(p, data->vreal32, VN_B_TILE_SIZE * VN_B_TILE_SIZE * sizeof(real32));
- }
- break;
- case VN_B_LAYER_REAL64 :
- {
- real64 *p;
- p = &((real64 *)node->layers[layer_id].layer)[(tile[0] * tile[1] * tile_z + tile_y * tile[0] + tile_x) * VN_B_TILE_SIZE * VN_B_TILE_SIZE];
- memcpy(p, data->vreal64, VN_B_TILE_SIZE * VN_B_TILE_SIZE * sizeof(real64));
- }
- break;
- }
- count = vs_get_subscript_count(node->layers[layer_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layers[layer_id].subscribers, i);
- verse_send_b_tile_set(node_id, layer_id, tile_x, tile_y, tile_z, type, data);
- }
- vs_reset_subscript_session();
-}
-
-void vs_b_callback_init(void)
-{
- verse_callback_set(verse_send_b_dimensions_set, callback_send_b_dimensions_set, NULL);
- verse_callback_set(verse_send_b_layer_create, callback_send_b_layer_create, NULL);
- verse_callback_set(verse_send_b_layer_destroy, callback_send_b_layer_destroy, NULL);
- verse_callback_set(verse_send_b_layer_subscribe, callback_send_b_layer_subscribe, NULL);
- verse_callback_set(verse_send_b_layer_unsubscribe, callback_send_b_layer_unsubscribe, NULL);
- verse_callback_set(verse_send_b_tile_set, callback_send_b_tile_set, NULL);
-}
-
-#endif
diff --git a/extern/verse/dist/vs_node_curve.c b/extern/verse/dist/vs_node_curve.c
deleted file mode 100644
index 3787526202d..00000000000
--- a/extern/verse/dist/vs_node_curve.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
-**
-*/
-
-#include
-#include
-
-#include "v_cmd_gen.h"
-
-#if !defined V_GENERATE_FUNC_MODE
-
-#include "verse.h"
-#include "vs_server.h"
-
-typedef struct {
- real64 pre_value[4];
- uint32 pre_pos[4];
- real64 value[4];
- real64 pos;
- real64 post_value[4];
- uint32 post_pos[4];
-} VSNKey;
-
-typedef struct {
- VSNKey *keys;
- unsigned int length;
- char name[16];
- uint8 dimensions;
- VSSubscriptionList *subscribers;
-} VSNCurve;
-
-typedef struct{
- VSNodeHead head;
- VSNCurve *curves;
- unsigned int curve_count;
-} VSNodeCurve;
-
-VSNodeCurve * vs_c_create_node(unsigned int owner)
-{
- VSNodeCurve *node;
- char name[48];
- unsigned int i;
- node = malloc(sizeof *node);
- vs_add_new_node(&node->head, V_NT_CURVE);
- sprintf(name, "Curve_Node_%u", node->head.id);
- create_node_head(&node->head, name, owner);
- node->curves = malloc((sizeof *node->curves) * 16);
- node->curve_count = 16;
- for(i = 0; i < 16; i++)
- node->curves[i].name[0] = 0;
- return node;
-}
-
-void vs_c_destroy_node(VSNodeCurve *node)
-{
- destroy_node_head(&node->head);
- free(node);
-}
-
-void vs_c_subscribe(VSNodeCurve *node)
-{
- unsigned int i;
- if(node == NULL)
- return;
- for(i = 0; i < node->curve_count; i++)
- if(node->curves[i].name[0] != 0)
- verse_send_c_curve_create(node->head.id, i, node->curves[i].name, node->curves[i].dimensions);
-
-}
-
-void vs_c_unsubscribe(VSNodeCurve *node)
-{
- unsigned int i;
- for(i = 0; i < node->curve_count; i++)
- if(node->curves[i].name[0] != 0)
- vs_remove_subscriptor(node->curves[i].subscribers);
-}
-
-static void callback_send_c_curve_create(void *user, VNodeID node_id, VLayerID curve_id, const char *name, uint8 dimensions)
-{
- VSNodeCurve *node;
- unsigned int i, j, count;
- node = (VSNodeCurve *)vs_get_node(node_id, V_NT_CURVE);
- if(node == NULL)
- return;
-
- for(i = 0; i < node->curve_count; i++)
- {
- if(curve_id != i)
- {
- for(j = 0; name[j] == node->curves[i].name[j] && name[j] != 0; j++);
- if(name[j] == node->curves[i].name[j])
- return;
- }
- }
- if(curve_id >= node->curve_count || node->curves[curve_id].name[0] == 0)
- {
- for(curve_id = 0; curve_id < node->curve_count && node->curves[curve_id].name[0] != 0; curve_id++);
- if(curve_id == node->curve_count)
- {
- curve_id = node->curve_count;
- node->curve_count += 16;
- node->curves = realloc(node->curves, (sizeof *node->curves) * node->curve_count);
- for(i = curve_id; i < node->curve_count; i++)
- node->curves[i].name[0] = 0;
- }
- node->curves[curve_id].subscribers = vs_create_subscription_list();
- node->curves[curve_id].length = 64;
- node->curves[curve_id].keys = malloc((sizeof *node->curves[curve_id].keys) * 64);
- for(i = 0; i < 64; i++)
- node->curves[curve_id].keys[i].pos = V_REAL64_MAX;
-
- }else if(node->curves[curve_id].dimensions != dimensions)
- {
- for(i = 0; i < node->curves[curve_id].length; i++)
- {
- if(node->curves[curve_id].keys[i].pos != V_REAL64_MAX)
- {
- for(j = node->curves[curve_id].dimensions; j < dimensions; j++)
- {
- node->curves[curve_id].keys[i].pre_value[j] = node->curves[curve_id].keys[i].pre_value[0];
- node->curves[curve_id].keys[i].pre_pos[j] = node->curves[curve_id].keys[i].pre_pos[0];
- node->curves[curve_id].keys[i].value[j] = node->curves[curve_id].keys[i].value[0];
- node->curves[curve_id].keys[i].post_value[j] = node->curves[curve_id].keys[i].post_value[0];
- node->curves[curve_id].keys[i].post_pos[j] = node->curves[curve_id].keys[i].post_pos[0];
- }
- }
- }
- vs_destroy_subscription_list(node->curves[curve_id].subscribers);
- node->curves[curve_id].subscribers = vs_create_subscription_list();
- }
- for(i = 0; name[i] != 0 && i < 15; i++)
- node->curves[curve_id].name[i] = name[i];
- node->curves[curve_id].name[i] = 0;
- node->curves[curve_id].dimensions = dimensions;
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_c_curve_create(node_id, curve_id, name, dimensions);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_c_curve_destroy(void *user, VNodeID node_id, VLayerID curve_id)
-{
- VSNodeCurve *node;
- unsigned int i, count;
- node = (VSNodeCurve *)vs_get_node(node_id, V_NT_CURVE);
- if(node == NULL || node->curve_count >= curve_id || node->curves[curve_id].name[0] == 0)
- return;
- vs_remove_subscriptor(node->curves[curve_id].subscribers);
- node->curves[curve_id].name[0] = 0;
- free(node->curves[curve_id].keys);
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_c_curve_destroy(node_id, curve_id);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_c_key_set(void *user, VNodeID node_id, VLayerID curve_id, uint32 key_id, uint8 dimensions, real64 *pre_value, uint32 *pre_pos, real64 *value, real64 pos, real64 *post_value, uint32 *post_pos)
-{
- VSNodeCurve *node;
- unsigned int i, count;
- node = (VSNodeCurve *)vs_get_node(node_id, V_NT_CURVE);
- if(node == NULL)
- return;
- if(node->curve_count <= curve_id)
- return;
- if(node->curves[curve_id].name[0] == 0)
- return;
- if(node == NULL || node->curve_count <= curve_id || node->curves[curve_id].name[0] == 0 || node->curves[curve_id].dimensions != dimensions)
- return;
- if(node->curves[curve_id].length <= key_id || node->curves[curve_id].keys[key_id].pos == V_REAL64_MAX)
- {
- for(key_id = 0; key_id < node->curves[curve_id].length && node->curves[curve_id].keys[key_id].pos != V_REAL64_MAX; key_id++);
- if(key_id == node->curves[curve_id].length)
- for(i = 0; i < 64; i++)
- node->curves[curve_id].keys[node->curves[curve_id].length++].pos = V_REAL64_MAX;
- }
- for(i = 0; i < dimensions; i++)
- node->curves[curve_id].keys[key_id].pre_value[i] = pre_value[i];
- for(i = 0; i < dimensions; i++)
- node->curves[curve_id].keys[key_id].pre_pos[i] = pre_pos[i];
- for(i = 0; i < dimensions; i++)
- node->curves[curve_id].keys[key_id].value[i] = value[i];
- node->curves[curve_id].keys[key_id].pos = pos;
- for(i = 0; i < dimensions; i++)
- node->curves[curve_id].keys[key_id].post_value[i] = post_value[i];
- for(i = 0; i < dimensions; i++)
- node->curves[curve_id].keys[key_id].post_pos[i] = post_pos[i];
- count = vs_get_subscript_count(node->curves[curve_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->curves[curve_id].subscribers, i);
- verse_send_c_key_set(node_id, curve_id, key_id, dimensions, pre_value, pre_pos, value, pos, post_value, post_pos);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_c_key_destroy(void *user, VNodeID node_id, VLayerID curve_id, uint32 key_id)
-{
- VSNodeCurve *node;
- unsigned int i, count;
- node = (VSNodeCurve *)vs_get_node(node_id, V_NT_CURVE);
- if(node == NULL || node->curve_count <= curve_id || node->curves[curve_id].name[0] == 0)
- return;
- if(node->curves[curve_id].length <= key_id || node->curves[curve_id].keys[key_id].pos == V_REAL64_MAX)
- return;
- node->curves[curve_id].keys[key_id].pos = V_REAL64_MAX;
- count = vs_get_subscript_count(node->curves[curve_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->curves[curve_id].subscribers, i);
- verse_send_c_key_destroy(node_id, curve_id, key_id);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_c_curve_subscribe(void *user, VNodeID node_id, VLayerID curve_id)
-{
- VSNodeCurve *node;
- unsigned int i;
- node = (VSNodeCurve *)vs_get_node(node_id, V_NT_CURVE);
- if(node == NULL || node->curve_count <= curve_id || node->curves[curve_id].name[0] == 0)
- return;
-
- vs_add_new_subscriptor(node->curves[curve_id].subscribers);
-
- for(i = 0; i < node->curves[curve_id].length; i++)
- if(node->curves[curve_id].keys[i].pos != V_REAL64_MAX)
- verse_send_c_key_set(node_id, curve_id, i, node->curves[curve_id].dimensions, node->curves[curve_id].keys[i].pre_value, node->curves[curve_id].keys[i].pre_pos, node->curves[curve_id].keys[i].value, node->curves[curve_id].keys[i].pos, node->curves[curve_id].keys[i].post_value, node->curves[curve_id].keys[i].post_pos);
-}
-
-static void callback_send_c_curve_unsubscribe(void *user, VNodeID node_id, VLayerID curve_id)
-{
- VSNodeCurve *node;
-
- node = (VSNodeCurve *)vs_get_node(node_id, V_NT_CURVE);
- if(node == NULL || curve_id >= node->curve_count || node->curves[curve_id].name[0] == 0)
- return;
- vs_remove_subscriptor(node->curves[curve_id].subscribers);
-}
-
-void vs_c_callback_init(void)
-{
- verse_callback_set(verse_send_c_curve_create, callback_send_c_curve_create, NULL);
- verse_callback_set(verse_send_c_curve_destroy, callback_send_c_curve_destroy, NULL);
- verse_callback_set(verse_send_c_curve_subscribe, callback_send_c_curve_subscribe, NULL);
- verse_callback_set(verse_send_c_curve_unsubscribe, callback_send_c_curve_unsubscribe, NULL);
- verse_callback_set(verse_send_c_key_set, callback_send_c_key_set, NULL);
- verse_callback_set(verse_send_c_key_destroy, callback_send_c_key_destroy, NULL);
-}
-
-#endif
diff --git a/extern/verse/dist/vs_node_geometry.c b/extern/verse/dist/vs_node_geometry.c
deleted file mode 100644
index 4b1f88c8ac2..00000000000
--- a/extern/verse/dist/vs_node_geometry.c
+++ /dev/null
@@ -1,1047 +0,0 @@
-/*
-**
-*/
-
-#include
-#include
-#include
-
-#include "v_cmd_gen.h"
-
-#if !defined V_GENERATE_FUNC_MODE
-
-#include "verse.h"
-#include "v_util.h"
-#include "vs_server.h"
-
-#define VS_G_LAYER_CHUNK 32
-
-typedef struct {
- VNGLayerType type;
- char name[16];
- void *layer;
- VSSubscriptionList *subscribers;
- VSSubscriptionList *subscribersd;
- union{
- uint32 integer;
- real64 real;
- } def;
-} VSNGLayer;
-
-typedef struct {
- char weight[16];
- char reference[16];
- uint16 parent;
- real64 pos_x;
- real64 pos_y;
- real64 pos_z;
- char position_label[16];
- char rotation_label[16];
- char scale_label[16];
-} VSNGBone;
-
-typedef struct {
- VSNodeHead head;
- VSNGLayer *layer;
- uint16 layer_count;
- uint32 vertex_size;
- uint32 poly_size;
- uint32 vertex_hole;
- uint32 polygon_hole;
- uint32 crease_vertex;
- char crease_vertex_layer[16];
- uint32 crease_edge;
- char crease_edge_layer[16];
- VSNGBone *bones;
- uint32 bone_count;
-} VSNodeGeometry;
-
-VSNodeGeometry * vs_g_create_node(unsigned int owner)
-{
- VSNodeGeometry *node;
- unsigned int i;
- char name[48];
- node = malloc(sizeof *node);
- vs_add_new_node(&node->head, V_NT_GEOMETRY);
- sprintf(name, "Geometry_Node_%u", node->head.id);
- create_node_head(&node->head, name, owner);
-
- node->bones = malloc((sizeof *node->bones) * 16);
- node->bone_count = 16;
- for(i = 0; i < node->bone_count; i++)
- node->bones[i].weight[0] = '\0';
-
- node->layer = malloc((sizeof *node->layer) * 16);
- node->layer_count = 16;
- node->vertex_size = VS_G_LAYER_CHUNK;
- node->poly_size = VS_G_LAYER_CHUNK;
-
- strcpy(node->layer[0].name, "vertex");
- node->layer[0].type = VN_G_LAYER_VERTEX_XYZ;
- node->layer[0].layer = malloc(sizeof(real64) * VS_G_LAYER_CHUNK * 3);
- for(i = 0; i < VS_G_LAYER_CHUNK * 3; i++)
- ((real64 *)node->layer[0].layer)[i] = V_REAL64_MAX;
- node->layer[0].subscribers = NULL;/*vs_create_subscription_list();*/
- node->layer[0].subscribersd = NULL;/*vs_create_subscription_list();*/
- node->layer[0].def.real = 0;
-
- strcpy(node->layer[1].name, "polygon");
- node->layer[1].type = VN_G_LAYER_POLYGON_CORNER_UINT32;
- node->layer[1].layer = malloc(sizeof(uint32) * VS_G_LAYER_CHUNK * 4);
- for(i = 0; i < VS_G_LAYER_CHUNK * 4; i++)
- ((uint32 *)node->layer[1].layer)[i] = -1;
- node->layer[1].subscribers = NULL;/*vs_create_subscription_list();*/
- node->layer[1].subscribersd = NULL;
- node->layer[1].def.integer = 0;
- node->layer[1].def.real = 0.0;
-
- for(i = 2; i < 16; i++)
- {
- node->layer[i].type = -1;
- node->layer[i].name[0] = 0;
- node->layer[i].layer = NULL;
- node->layer[i].subscribers = NULL;
- node->layer[i].subscribersd = NULL;
- node->layer[i].def.real = 0;
- }
- node->crease_vertex = 0;
- node->crease_vertex_layer[0] = 0;
- node->crease_edge = 0;
- node->crease_edge_layer[0] = 0;
- node->vertex_hole = 0;
- node->polygon_hole = 0;
- return node;
-}
-
-void vs_g_destroy_node(VSNodeGeometry *node)
-{
- destroy_node_head(&node->head);
- free(node);
-}
-
-void vs_g_subscribe(VSNodeGeometry *node)
-{
- unsigned int i;
- for(i = 0; i < node->layer_count; i++)
- {
- if(node->layer[i].layer != NULL)
- {
- verse_send_g_layer_create(node->head.id, (uint16)i, node->layer[i].name, node->layer[i].type,
- node->layer[i].def.integer, node->layer[i].def.real);
- }
- }
- verse_send_g_crease_set_vertex(node->head.id, node->crease_vertex_layer, node->crease_vertex);
- verse_send_g_crease_set_edge(node->head.id, node->crease_edge_layer, node->crease_edge);
- for(i = 0; i < node->bone_count; i++)
- {
- if(node->bones[i].weight[0] != 0)
- verse_send_g_bone_create(node->head.id, (uint16)i, node->bones[i].weight, node->bones[i].reference, node->bones[i].parent,
- node->bones[i].pos_x, node->bones[i].pos_y, node->bones[i].pos_z, node->bones[i].position_label,
- node->bones[i].rotation_label, node->bones[i].scale_label);
- }
-}
-
-
-void vs_g_unsubscribe(VSNodeGeometry *node)
-{
- unsigned int i;
- for(i = 0; i < node->layer_count; i++) {
- if(node->layer[i].layer != NULL) {
- if(node->layer[i].subscribers)
- vs_remove_subscriptor(node->layer[i].subscribers);
- if(node->layer[i].subscribersd)
- vs_remove_subscriptor(node->layer[i].subscribersd);
- }
- }
-}
-
-static void callback_send_g_layer_create(void *user, VNodeID node_id, VLayerID layer_id, char *name, uint8 type, uint32 def_uint, real64 def_real)
-{
- VSNodeGeometry *node;
- unsigned int i, j, count;
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
-
- if(node == NULL)
- return;
- if((type < VN_G_LAYER_POLYGON_CORNER_UINT32 && type > VN_G_LAYER_VERTEX_REAL) ||
- (type > VN_G_LAYER_POLYGON_FACE_REAL))
- return;
-
- if(layer_id < 2)
- layer_id = -1;
- for(i = 0; i < node->layer_count; i++)
- {
- if(node->layer[i].layer != NULL && i != layer_id)
- {
- for(j = 0; name[j] == node->layer[i].name[j] && name[j] != 0; j++);
- if(name[j] == node->layer[i].name[j])
- return;
- }
- }
- if(layer_id >= node->layer_count || node->layer[layer_id].layer == NULL)
- {
- for(layer_id = 0; layer_id < node->layer_count && node->layer[layer_id].layer != NULL; layer_id++);
- if(layer_id == node->layer_count)
- {
- layer_id = node->layer_count;
- node->layer_count += 16;
- node->layer = realloc(node->layer, (sizeof *node->layer) * node->layer_count);
- for(i = layer_id; i < node->layer_count; i++)
- {
- node->layer[i].type = -1;
- node->layer[i].name[0] = 0;
- node->layer[i].layer = 0;
- node->layer[i].subscribers = NULL;
- node->layer[i].subscribersd = NULL;
- }
- }
- }
- for(i = 0; i < 16; i++)
- node->layer[layer_id].name[i] = name[i];
-
- if(node->layer[layer_id].type != type)
- {
- if(node->layer[layer_id].subscribers) {
- vs_destroy_subscription_list(node->layer[layer_id].subscribers);
- node->layer[layer_id].subscribers = NULL;
- }
- if(node->layer[layer_id].subscribersd) {
- vs_destroy_subscription_list(node->layer[layer_id].subscribersd);
- node->layer[layer_id].subscribersd = NULL;
- }
- node->layer[layer_id].type = type;
- free(node->layer[layer_id].layer);
- switch(type)
- {
- case VN_G_LAYER_VERTEX_XYZ :
- node->layer[layer_id].layer = malloc(sizeof(real64) * node->vertex_size * 3);
- for(i = 0; i < node->vertex_size * 3; i++)
- ((real64 *)node->layer[layer_id].layer)[i] = ((real64 *)node->layer[0].layer)[i];
- break;
- case VN_G_LAYER_VERTEX_UINT32 :
- node->layer[layer_id].layer = malloc(sizeof(uint32) * node->vertex_size);
- for(i = 0; i < node->vertex_size; i++)
- ((uint32 *)node->layer[layer_id].layer)[i] = def_uint;
- node->layer[layer_id].def.integer = def_uint;
- break;
- case VN_G_LAYER_VERTEX_REAL :
- node->layer[layer_id].layer = malloc(sizeof(real64) * node->vertex_size);
- for(i = 0; i < node->vertex_size; i++)
- ((real64 *)node->layer[layer_id].layer)[i] = def_real;
- node->layer[layer_id].def.real = def_real;
- break;
- case VN_G_LAYER_POLYGON_CORNER_UINT32 :
- node->layer[layer_id].layer = malloc(sizeof(uint32) * node->poly_size * 4);
- for(i = 0; i < node->poly_size * 4; i++)
- ((uint32 *)node->layer[layer_id].layer)[i] = def_uint;
- node->layer[layer_id].def.integer = def_uint;
- break;
- case VN_G_LAYER_POLYGON_CORNER_REAL :
- node->layer[layer_id].layer = malloc(sizeof(real64) * node->poly_size * 4);
- for(i = 0; i < node->poly_size * 4; i++)
- ((real64 *)node->layer[layer_id].layer)[i] = def_real;
- node->layer[layer_id].def.real = def_real;
- break;
- case VN_G_LAYER_POLYGON_FACE_UINT8 :
- node->layer[layer_id].layer = malloc(sizeof(uint8) * node->poly_size);
- for(i = 0; i < node->poly_size; i++)
- ((uint8 *)node->layer[layer_id].layer)[i] = def_uint;
- node->layer[layer_id].def.integer = def_uint;
- break;
- case VN_G_LAYER_POLYGON_FACE_UINT32 :
- node->layer[layer_id].layer = malloc(sizeof(uint32) * node->poly_size);
- for(i = 0; i < node->poly_size; i++)
- ((uint32 *)node->layer[layer_id].layer)[i] = def_uint;
- node->layer[layer_id].def.integer = def_uint;
- break;
- case VN_G_LAYER_POLYGON_FACE_REAL :
- node->layer[layer_id].layer = malloc(sizeof(real64) * node->poly_size);
- for(i = 0; i < node->poly_size; i++)
- ((real64 *)node->layer[layer_id].layer)[i] = def_real;
- node->layer[layer_id].def.real = def_real;
- break;
- }
- }
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_g_layer_create(node_id, layer_id, name, type, def_uint, def_real);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_g_layer_destroy(void *user, VNodeID node_id, VLayerID layer_id)
-{
- VSNodeGeometry *node;
- unsigned int i, count;
-
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
- if(layer_id >= node->layer_count || node->layer[layer_id].layer == NULL || layer_id < 2)
- return;
- free(node->layer[layer_id].layer);
- node->layer[layer_id].layer = NULL;
- node->layer[layer_id].name[0] = 0;
- node->layer[layer_id].type = -1;
- if(node->layer[layer_id].subscribers) {
- vs_destroy_subscription_list(node->layer[layer_id].subscribers);
- node->layer[layer_id].subscribers = NULL;
- }
- if(node->layer[layer_id].subscribersd) {
- vs_destroy_subscription_list(node->layer[layer_id].subscribersd);
- node->layer[layer_id].subscribersd = NULL;
- }
-
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_g_layer_destroy(node_id, layer_id);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_g_layer_subscribe(void *user, VNodeID node_id, VLayerID layer_id, uint8 type)
-{
- VSNodeGeometry *node;
- VSNGLayer *layer;
- VSSubscriptionList **list = NULL;
- unsigned int i;
-
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
-
- if(layer_id >= node->layer_count || node->layer[layer_id].layer == NULL)
- return;
- /* Pick subscription list to add subscriber to. */
- layer = &node->layer[layer_id];
- if(type == VN_FORMAT_REAL64 && (layer->type == VN_G_LAYER_VERTEX_XYZ || layer->type == VN_G_LAYER_VERTEX_REAL ||
- layer->type == VN_G_LAYER_POLYGON_CORNER_REAL || layer->type == VN_G_LAYER_POLYGON_FACE_REAL))
- {
- list = &node->layer[layer_id].subscribersd;
- }
- else
- list = &node->layer[layer_id].subscribers;
-
- /* Add new subscriptor to whichever list was chosen by precision-test above. Create list if necessary. */
- if(list == NULL)
- return;
- if(*list == NULL)
- *list = vs_create_subscription_list();
- vs_add_new_subscriptor(*list);
-
- switch(layer->type)
- {
- case VN_G_LAYER_VERTEX_XYZ :
- if(type == VN_FORMAT_REAL64)
- {
- for(i = 0; i < node->vertex_size; i++)
- if(((real64 *)node->layer[0].layer)[i * 3] != V_REAL64_MAX)
- verse_send_g_vertex_set_xyz_real64(node_id, layer_id, i, ((real64 *)layer->layer)[i * 3], ((real64 *)layer->layer)[i * 3 + 1], ((real64 *)layer->layer)[i * 3 + 2]);
- }else
- {
- for(i = 0; i < node->vertex_size; i++)
- if(((real64 *)node->layer[0].layer)[i * 3] != V_REAL64_MAX)
- verse_send_g_vertex_set_xyz_real32(node_id, layer_id, i, (float)((real64 *)layer->layer)[i * 3], (float)((real64 *)layer->layer)[i * 3 + 1], (float)((real64 *)layer->layer)[i * 3 + 2]);
- }
- break;
- case VN_G_LAYER_VERTEX_UINT32 :
- for(i = 0; i < node->vertex_size; i++)
- if(((real64 *)node->layer[0].layer)[i * 3] != V_REAL64_MAX && ((uint32 *)layer->layer)[i] != layer->def.integer)
- verse_send_g_vertex_set_uint32(node_id, layer_id, i, ((uint32 *)layer->layer)[i]);
- break;
- case VN_G_LAYER_VERTEX_REAL :
- if(type == VN_FORMAT_REAL64)
- {
- for(i = 0; i < node->vertex_size; i++)
- if(((real64 *)node->layer[0].layer)[i * 3] != V_REAL64_MAX && ((real64 *)layer->layer)[i] != layer->def.real)
- verse_send_g_vertex_set_real64(node_id, layer_id, i, ((real64 *)layer->layer)[i]);
- }else
- {
- for(i = 0; i < node->vertex_size; i++)
- if(((real64 *)node->layer[0].layer)[i * 3] != V_REAL64_MAX && ((real64 *)layer->layer)[i] != layer->def.real)
- verse_send_g_vertex_set_real32(node_id, layer_id, i, (float)((real64 *)layer->layer)[i]);
- }
- break;
- case VN_G_LAYER_POLYGON_CORNER_UINT32 :
- for(i = 0; i < node->poly_size; i++)
- if(((uint32 *)node->layer[1].layer)[i * 4] != (uint32) ~0u && !(((uint32 *)layer->layer)[i * 4] == layer->def.integer && ((uint32 *)layer->layer)[i * 4 + 1] == layer->def.integer && ((uint32 *)layer->layer)[i * 4 + 2] == layer->def.integer && ((uint32 *)layer->layer)[i * 4 + 3] == layer->def.integer))
- verse_send_g_polygon_set_corner_uint32(node_id, layer_id, i, ((uint32 *)layer->layer)[i * 4], ((uint32 *)layer->layer)[i * 4 + 1], ((uint32 *)layer->layer)[i * 4 + 2], ((uint32 *)layer->layer)[i * 4 + 3]);
- break;
- case VN_G_LAYER_POLYGON_CORNER_REAL :
- if(type == VN_FORMAT_REAL64)
- {
- for(i = 0; i < node->poly_size; i++)
- if(((uint32 *)node->layer[1].layer)[i * 4] != (uint32) ~0u && !(((real64 *)layer->layer)[i * 4] == layer->def.real && ((real64 *)layer->layer)[i * 4 + 1] == layer->def.real && ((real64 *)layer->layer)[i * 4 + 2] == layer->def.real && ((real64 *)layer->layer)[i * 4 + 3] == layer->def.real))
- verse_send_g_polygon_set_corner_real64(node_id, layer_id, i, ((real64 *)layer->layer)[i * 4], ((real64 *)layer->layer)[i * 4 + 1], ((real64 *)layer->layer)[i * 4 + 2], ((real64 *)layer->layer)[i * 4 + 3]);
- }else
- {
- for(i = 0; i < node->poly_size; i++)
- if(((uint32 *)node->layer[1].layer)[i * 4] != (uint32) ~0u && !(((real64 *)layer->layer)[i * 4] == layer->def.real && ((real64 *)layer->layer)[i * 4 + 1] == layer->def.real && ((real64 *)layer->layer)[i * 4 + 2] == layer->def.real && ((real64 *)layer->layer)[i * 4 + 3] == layer->def.real))
- verse_send_g_polygon_set_corner_real32(node_id, layer_id, i, (float)((real64 *)layer->layer)[i * 4], (float)((real64 *)layer->layer)[i * 4 + 1], (float)((real64 *)layer->layer)[i * 4 + 2], (float)((real64 *)layer->layer)[i * 4 + 3]);
- }
- break;
- case VN_G_LAYER_POLYGON_FACE_UINT8 :
- for(i = 0; i < node->poly_size; i++)
- if(((uint32 *)node->layer[1].layer)[i * 4] != (uint32) ~0u && ((uint8 *)layer->layer)[i] != layer->def.integer)
- verse_send_g_polygon_set_face_uint8(node_id, layer_id, i, ((uint8 *)layer->layer)[i]);
- break;
- case VN_G_LAYER_POLYGON_FACE_UINT32 :
- for(i = 0; i < node->poly_size; i++)
- if(((uint32 *)node->layer[1].layer)[i * 4] != (uint32) ~0u && ((uint32 *)layer->layer)[i] != layer->def.integer)
- verse_send_g_polygon_set_face_uint32(node_id, layer_id, i, ((uint32 *)layer->layer)[i]);
- break;
- case VN_G_LAYER_POLYGON_FACE_REAL :
- if(type == VN_FORMAT_REAL64)
- {
- for(i = 0; i < node->poly_size; i++)
- if(((uint32 *)node->layer[1].layer)[i * 4] != (uint32) ~0u && ((real64 *)layer->layer)[i] != layer->def.real)
- verse_send_g_polygon_set_face_real64(node_id, layer_id, i, ((real64 *)layer->layer)[i]);
- }else
- {
- for(i = 0; i < node->poly_size; i++)
- if(((uint32 *)node->layer[1].layer)[i * 4] != (uint32) ~0u && ((real64 *)layer->layer)[i] != layer->def.real)
- verse_send_g_polygon_set_face_real32(node_id, layer_id, i, (float)((real64 *)layer->layer)[i]);
- }
- break;
- }
-}
-
-static void callback_send_g_layer_unsubscribe(void *user, VNodeID node_id, VLayerID layer_id)
-{
- VSNodeGeometry *node;
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
- if(layer_id >= node->layer_count || node->layer[layer_id].layer == NULL)
- return;
- if(node->layer[layer_id].subscribers)
- vs_remove_subscriptor(node->layer[layer_id].subscribers);
- if(node->layer[layer_id].subscribersd)
- vs_remove_subscriptor(node->layer[layer_id].subscribersd);
-}
-
-
-static unsigned int vs_g_extend_arrays(VSNodeGeometry *node, boolean vertex, boolean base_layer, unsigned int id)
-{
- unsigned int i, j;
-
- if(base_layer && id == ~0u)
- {
- if(vertex)
- {
- while(node->vertex_hole < node->vertex_size && ((real64 *)node->layer[0].layer)[node->vertex_hole * 3] != V_REAL64_MAX)
- node->vertex_hole++;
- id = node->vertex_hole;
- }else
- {
- while(node->polygon_hole < node->poly_size && ((uint32 *)node->layer[1].layer)[node->polygon_hole * 4] != ~0u)
- node->polygon_hole++;
- id = node->polygon_hole;
- }
- }
-
- if(vertex)
- {
- if(node->vertex_size + 4096 < id)
- return -1;
- if(node->vertex_size > id)
- return id;
- }else
- {
- if(node->poly_size + 4096 < id)
- return -1;
- if(node->poly_size > id)
- return id;
- }
-
- for(i = 0; i < node->layer_count; i++)
- {
- if((vertex && node->layer[i].type < VN_G_LAYER_POLYGON_CORNER_UINT32) || (!vertex && node->layer[i].type >= VN_G_LAYER_POLYGON_CORNER_UINT32))
- {
- switch(node->layer[i].type)
- {
- case VN_G_LAYER_VERTEX_XYZ :
- node->layer[i].layer = realloc(node->layer[i].layer, sizeof(real64) * (id + VS_G_LAYER_CHUNK) * 3);
- for(j = node->vertex_size * 3; j < (id + VS_G_LAYER_CHUNK) * 3; j++)
- ((real64 *)node->layer[i].layer)[j] = V_REAL64_MAX;
- break;
- case VN_G_LAYER_VERTEX_UINT32 :
- node->layer[i].layer = realloc(node->layer[i].layer, sizeof(uint32) * (id + VS_G_LAYER_CHUNK));
- for(j = node->vertex_size; j < (id + VS_G_LAYER_CHUNK); j++)
- ((uint32 *)node->layer[i].layer)[j] = node->layer[i].def.integer;
- break;
- case VN_G_LAYER_VERTEX_REAL :
- node->layer[i].layer = realloc(node->layer[i].layer, sizeof(real64) * (id + VS_G_LAYER_CHUNK));
- for(j = node->vertex_size; j < (id + VS_G_LAYER_CHUNK); j++)
- ((real64 *)node->layer[i].layer)[j] = node->layer[i].def.real;
- break;
- case VN_G_LAYER_POLYGON_CORNER_UINT32 :
- node->layer[i].layer = realloc(node->layer[i].layer, sizeof(uint32) * (id + VS_G_LAYER_CHUNK) * 4);
- for(j = node->poly_size * 4; j < (id + VS_G_LAYER_CHUNK) * 4; j++)
- ((uint32 *)node->layer[i].layer)[j] = node->layer[i].def.integer;
- break;
- case VN_G_LAYER_POLYGON_CORNER_REAL :
- node->layer[i].layer = realloc(node->layer[i].layer, sizeof(real64) * (id + VS_G_LAYER_CHUNK) * 4);
- for(j = node->poly_size * 4; j < (id + VS_G_LAYER_CHUNK) * 4; j++)
- ((real64 *)node->layer[i].layer)[j] = node->layer[i].def.real;
- break;
- case VN_G_LAYER_POLYGON_FACE_UINT8 :
- node->layer[i].layer = realloc(node->layer[i].layer, sizeof(uint8) * (id + VS_G_LAYER_CHUNK));
- for(j = node->poly_size; j < (id + VS_G_LAYER_CHUNK); j++)
- ((uint8 *)node->layer[i].layer)[j] = node->layer[i].def.integer;
- break;
- case VN_G_LAYER_POLYGON_FACE_UINT32 :
- node->layer[i].layer = realloc(node->layer[i].layer, sizeof(uint32) * (id + VS_G_LAYER_CHUNK));
- for(j = node->poly_size; j < (id + VS_G_LAYER_CHUNK); j++)
- ((uint32 *)node->layer[i].layer)[j] = node->layer[i].def.integer;
- break;
- case VN_G_LAYER_POLYGON_FACE_REAL :
- node->layer[i].layer = realloc(node->layer[i].layer, sizeof(real64) * (id + VS_G_LAYER_CHUNK));
- for(j = node->poly_size; j < (id + VS_G_LAYER_CHUNK); j++)
- ((real64 *)node->layer[i].layer)[j] = node->layer[i].def.real;
- break;
- }
- }
- }
- if(vertex)
- node->vertex_size = id + VS_G_LAYER_CHUNK;
- else
- node->poly_size = id + VS_G_LAYER_CHUNK;
- return id;
-}
-
-
-static void callback_send_g_vertex_set_xyz_real32(void *user, VNodeID node_id, VLayerID layer_id, uint32 vertex_id, float x, float y, float z)
-{
- VSNodeGeometry *node;
- unsigned int i, count;
-
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
- if(layer_id >= node->layer_count || node->layer[layer_id].layer == NULL || node->layer[layer_id].type != VN_G_LAYER_VERTEX_XYZ)
- return;
- if((vertex_id = vs_g_extend_arrays(node, TRUE, layer_id == 0, vertex_id)) == ~0u)
- return;
- if(((real64 *)node->layer[0].layer)[vertex_id * 3] == V_REAL64_MAX)
- {
- for(i = 0; i < node->layer_count; i++)
- {
- if(node->layer[i].name[0] != 0 && node->layer[i].type == VN_G_LAYER_VERTEX_XYZ && node->layer[i].layer != NULL)
- {
- ((real64 *)node->layer[i].layer)[vertex_id * 3] = x;
- ((real64 *)node->layer[i].layer)[vertex_id * 3 + 1] = y;
- ((real64 *)node->layer[i].layer)[vertex_id * 3 + 2] = z;
- }
- }
- layer_id = 0;
- }else
- {
- ((real64 *)node->layer[layer_id].layer)[vertex_id * 3] = x;
- ((real64 *)node->layer[layer_id].layer)[vertex_id * 3 + 1] = y;
- ((real64 *)node->layer[layer_id].layer)[vertex_id * 3 + 2] = z;
- }
- count = vs_get_subscript_count(node->layer[layer_id].subscribersd);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[layer_id].subscribersd, i);
- verse_send_g_vertex_set_xyz_real64(node_id, layer_id, vertex_id, (real64)x, (real64)y, (real64)z);
- }
- count = vs_get_subscript_count(node->layer[layer_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[layer_id].subscribers, i);
- verse_send_g_vertex_set_xyz_real32(node_id, layer_id, vertex_id, x, y, z);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_g_vertex_set_xyz_real64(void *user, VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real64 x, real64 y, real64 z)
-{
- VSNodeGeometry *node;
- unsigned int i, count;
-
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
- if(layer_id >= node->layer_count || node->layer[layer_id].layer == NULL || node->layer[layer_id].type != VN_G_LAYER_VERTEX_XYZ)
- return;
- if((vertex_id = vs_g_extend_arrays(node, TRUE, layer_id == 0, vertex_id)) == ~0u)
- return;
- if(((real64 *)node->layer[0].layer)[vertex_id * 3] == V_REAL64_MAX)
- {
- for(i = 0; i < node->layer_count; i++)
- {
- if(node->layer[i].name[0] != 0 && node->layer[i].type == VN_G_LAYER_VERTEX_XYZ && node->layer[i].layer != NULL)
- {
- ((real64 *)node->layer[i].layer)[vertex_id * 3] = x;
- ((real64 *)node->layer[i].layer)[vertex_id * 3 + 1] = y;
- ((real64 *)node->layer[i].layer)[vertex_id * 3 + 2] = z;
- }
- }
- layer_id = 0;
- }else
- {
- ((real64 *)node->layer[layer_id].layer)[vertex_id * 3] = x;
- ((real64 *)node->layer[layer_id].layer)[vertex_id * 3 + 1] = y;
- ((real64 *)node->layer[layer_id].layer)[vertex_id * 3 + 2] = z;
- }
- count = vs_get_subscript_count(node->layer[layer_id].subscribersd);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[layer_id].subscribersd, i);
- verse_send_g_vertex_set_xyz_real64(node_id, layer_id, vertex_id, x, y, z);
- }
- count = vs_get_subscript_count(node->layer[layer_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[layer_id].subscribers, i);
- verse_send_g_vertex_set_xyz_real32(node_id, layer_id, vertex_id, (float)x, (float)y, (float)z);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_g_vertex_delete_real(void *user, VNodeID node_id, uint32 vertex_id)
-{
- VSNodeGeometry *node;
- unsigned int i, count;
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
- if(vertex_id >= node->vertex_size)
- return;
- if(vertex_id < node->vertex_hole)
- node->vertex_hole = vertex_id;
- for(i = 0; i < node->layer_count; i++)
- if(node->layer[i].name[0] != 0 && node->layer[i].type == VN_G_LAYER_VERTEX_XYZ && node->layer[i].layer != NULL)
- ((real64 *)node->layer[i].layer)[vertex_id * 3] = V_REAL64_MAX;
- count = vs_get_subscript_count(node->layer[0].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[0].subscribers, i);
- verse_send_g_vertex_delete_real32(node_id, vertex_id);
- }
- count = vs_get_subscript_count(node->layer[0].subscribersd);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[0].subscribersd, i);
- verse_send_g_vertex_delete_real64(node_id, vertex_id);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_g_vertex_set_uint32(void *user, VNodeID node_id, VLayerID layer_id, uint32 vertex_id, uint32 value)
-{
- VSNodeGeometry *node;
- unsigned int i, count;
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
- if(layer_id >= node->layer_count || node->layer[layer_id].layer == NULL || node->layer[layer_id].type != VN_G_LAYER_VERTEX_UINT32)
- return;
- if((vertex_id = vs_g_extend_arrays(node, TRUE, FALSE, vertex_id)) == ~0u)
- return;
- ((uint32 *)node->layer[layer_id].layer)[vertex_id] = value;
- count = vs_get_subscript_count(node->layer[layer_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[layer_id].subscribers, i);
- verse_send_g_vertex_set_uint32(node_id, layer_id, vertex_id, value);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_g_vertex_set_real64(void *user, VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real64 value)
-{
- VSNodeGeometry *node;
- unsigned int i, count;
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
- if(layer_id >= node->layer_count || node->layer[layer_id].layer == NULL || node->layer[layer_id].type != VN_G_LAYER_VERTEX_REAL)
- return;
- if((vertex_id = vs_g_extend_arrays(node, TRUE, FALSE, vertex_id)) == ~0u)
- return;
- ((real64 *)node->layer[layer_id].layer)[vertex_id] = value;
- count = vs_get_subscript_count(node->layer[layer_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[layer_id].subscribers, i);
- verse_send_g_vertex_set_real32(node_id, layer_id, vertex_id, (float)value);
- }
- count = vs_get_subscript_count(node->layer[layer_id].subscribersd);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[layer_id].subscribersd, i);
- verse_send_g_vertex_set_real64(node_id, layer_id, vertex_id, value);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_g_vertex_set_real32(void *user, VNodeID node_id, VLayerID layer_id, uint32 vertex_id, float value)
-{
- VSNodeGeometry *node;
- unsigned int i, count;
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
- if(layer_id >= node->layer_count || node->layer[layer_id].layer == NULL || node->layer[layer_id].type != VN_G_LAYER_VERTEX_REAL)
- return;
- if((vertex_id = vs_g_extend_arrays(node, TRUE, FALSE, vertex_id)) == ~0u)
- return;
- ((real64 *)node->layer[layer_id].layer)[vertex_id] = (real64)value;
- count = vs_get_subscript_count(node->layer[layer_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[layer_id].subscribers, i);
- verse_send_g_vertex_set_real32(node_id, layer_id, vertex_id, value);
- }
- count = vs_get_subscript_count(node->layer[layer_id].subscribersd);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[layer_id].subscribersd, i);
- verse_send_g_vertex_set_real64(node_id, layer_id, vertex_id, (real64)value);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_g_polygon_set_corner_uint32(void *user, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint32 v0, uint32 v1, uint32 v2, uint32 v3)
-{
- VSNodeGeometry *node;
- unsigned int i, count;
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
- if(layer_id >= node->layer_count || node->layer[layer_id].layer == NULL || node->layer[layer_id].type != VN_G_LAYER_POLYGON_CORNER_UINT32)
- return;
- if(layer_id == 1 && (v0 == v1 || v1 == v2 || v2 == v3 || v3 == v0 || v0 == v2 || v1 == v3))
- return;
- if((polygon_id = vs_g_extend_arrays(node, FALSE, layer_id == 1, polygon_id)) == ~0u)
- return;
- ((uint32 *)node->layer[layer_id].layer)[polygon_id * 4] = v0;
- ((uint32 *)node->layer[layer_id].layer)[polygon_id * 4 + 1] = v1;
- ((uint32 *)node->layer[layer_id].layer)[polygon_id * 4 + 2] = v2;
- ((uint32 *)node->layer[layer_id].layer)[polygon_id * 4 + 3] = v3;
- count = vs_get_subscript_count(node->layer[layer_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[layer_id].subscribers, i);
- verse_send_g_polygon_set_corner_uint32(node_id, layer_id, polygon_id, v0, v1, v2, v3);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_g_polygon_set_corner_real64(void *user, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real64 v0, real64 v1, real64 v2, real64 v3)
-{
- VSNodeGeometry *node;
- unsigned int i, count;
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
- if(layer_id >= node->layer_count || node->layer[layer_id].layer == NULL || node->layer[layer_id].type != VN_G_LAYER_POLYGON_CORNER_REAL)
- return;
- if((polygon_id = vs_g_extend_arrays(node, FALSE, FALSE, polygon_id)) == ~0u)
- return;
- ((real64 *)node->layer[layer_id].layer)[polygon_id * 4] = v0;
- ((real64 *)node->layer[layer_id].layer)[polygon_id * 4 + 1] = v1;
- ((real64 *)node->layer[layer_id].layer)[polygon_id * 4 + 2] = v2;
- ((real64 *)node->layer[layer_id].layer)[polygon_id * 4 + 3] = v3;
- count = vs_get_subscript_count(node->layer[layer_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[layer_id].subscribers, i);
- verse_send_g_polygon_set_corner_real32(node_id, layer_id, polygon_id, (float)v0, (float)v1, (float)v2, (float)v3);
- }
- count = vs_get_subscript_count(node->layer[layer_id].subscribersd);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[layer_id].subscribersd, i);
- verse_send_g_polygon_set_corner_real64(node_id, layer_id, polygon_id, v0, v1, v2, v3);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_g_polygon_set_corner_real32(void *user, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, float v0, float v1, float v2, float v3)
-{
- VSNodeGeometry *node;
- unsigned int i, count;
-
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
- if(layer_id >= node->layer_count || node->layer[layer_id].layer == NULL || node->layer[layer_id].type != VN_G_LAYER_POLYGON_CORNER_REAL)
- return;
- if((polygon_id = vs_g_extend_arrays(node, FALSE, FALSE, polygon_id)) == ~0u)
- return;
- ((real64 *)node->layer[layer_id].layer)[polygon_id * 4] = v0;
- ((real64 *)node->layer[layer_id].layer)[polygon_id * 4 + 1] = v1;
- ((real64 *)node->layer[layer_id].layer)[polygon_id * 4 + 2] = v2;
- ((real64 *)node->layer[layer_id].layer)[polygon_id * 4 + 3] = v3;
- count = vs_get_subscript_count(node->layer[layer_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[layer_id].subscribers, i);
- verse_send_g_polygon_set_corner_real32(node_id, layer_id, polygon_id, v0, v1, v2, v3);
- }
- count = vs_get_subscript_count(node->layer[layer_id].subscribersd);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[layer_id].subscribersd, i);
- verse_send_g_polygon_set_corner_real64(node_id, layer_id, polygon_id, (real64)v0, (real64)v1, (real64)v2, (real64)v3);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_g_polygon_set_face_uint8(void *user, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint8 value)
-{
- VSNodeGeometry *node;
- unsigned int i, count;
-
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
- if(layer_id >= node->layer_count || node->layer[layer_id].layer == NULL || node->layer[layer_id].type != VN_G_LAYER_POLYGON_FACE_UINT8)
- return;
- if((polygon_id = vs_g_extend_arrays(node, FALSE, FALSE, polygon_id)) == ~0u)
- return;
- ((uint8 *)node->layer[layer_id].layer)[polygon_id] = value;
- count = vs_get_subscript_count(node->layer[layer_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[layer_id].subscribers, i);
- verse_send_g_polygon_set_face_uint8(node_id, layer_id, polygon_id, value);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_g_polygon_set_face_uint32(void *user, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint32 value)
-{
- VSNodeGeometry *node;
- unsigned int i, count;
-
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
- if(layer_id >= node->layer_count || node->layer[layer_id].layer == NULL || node->layer[layer_id].type != VN_G_LAYER_POLYGON_FACE_UINT32)
- return;
- if((polygon_id = vs_g_extend_arrays(node, FALSE, FALSE, polygon_id)) == ~0u)
- return;
- ((uint32 *)node->layer[layer_id].layer)[polygon_id] = value;
- count = vs_get_subscript_count(node->layer[layer_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[layer_id].subscribers, i);
- verse_send_g_polygon_set_face_uint32(node_id, layer_id, polygon_id, value);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_g_polygon_set_face_real64(void *user, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real64 value)
-{
- VSNodeGeometry *node;
- unsigned int i, count;
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
- if(layer_id >= node->layer_count || node->layer[layer_id].layer == NULL || node->layer[layer_id].type != VN_G_LAYER_POLYGON_FACE_REAL)
- return;
- if((polygon_id = vs_g_extend_arrays(node, FALSE, FALSE, polygon_id)) == ~0u)
- return;
- ((real64 *)node->layer[layer_id].layer)[polygon_id] = value;
- count = vs_get_subscript_count(node->layer[layer_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[layer_id].subscribers, i);
- verse_send_g_polygon_set_face_real32(node_id, layer_id, polygon_id, (float)value);
- }
- count = vs_get_subscript_count(node->layer[layer_id].subscribersd);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[layer_id].subscribersd, i);
- verse_send_g_polygon_set_face_real64(node_id, layer_id, polygon_id, value);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_g_polygon_set_face_real32(void *user, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, float value)
-{
- VSNodeGeometry *node;
- unsigned int i, count;
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
- if(layer_id >= node->layer_count || node->layer[layer_id].layer == NULL || node->layer[layer_id].type != VN_G_LAYER_POLYGON_FACE_REAL)
- return;
- if((polygon_id = vs_g_extend_arrays(node, FALSE, FALSE, polygon_id)) == ~0u)
- return;
- ((real64 *)node->layer[layer_id].layer)[polygon_id] = (real64)value;
- count = vs_get_subscript_count(node->layer[layer_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[layer_id].subscribers, i);
- verse_send_g_polygon_set_face_real32(node_id, layer_id, polygon_id, value);
- }
- count = vs_get_subscript_count(node->layer[layer_id].subscribersd);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[layer_id].subscribersd, i);
- verse_send_g_polygon_set_face_real64(node_id, layer_id, polygon_id, (real64)value);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_g_polygon_delete(void *user, VNodeID node_id, uint32 polygon_id)
-{
- VSNodeGeometry *node;
- unsigned int i, count;
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
-
- if(polygon_id >= node->poly_size || ((uint32 *)node->layer[1].layer)[polygon_id * 4] == ~0u)
- return;
- if(polygon_id < node->polygon_hole)
- node->polygon_hole = polygon_id;
-
- ((uint32 *)node->layer[1].layer)[polygon_id * 4] = ~0u;
- count = vs_get_subscript_count(node->layer[1].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->layer[1].subscribers, i);
- verse_send_g_polygon_delete(node_id, polygon_id);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_g_crease_set_vertex(void *user, VNodeID node_id, const char *layer, uint32 def_crease)
-{
- VSNodeGeometry *node;
- unsigned int i, count;
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
- node->crease_vertex = def_crease;
- v_strlcpy(node->crease_vertex_layer, layer, sizeof node->crease_vertex_layer);
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_g_crease_set_vertex(node_id, layer, def_crease);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_g_crease_set_edge(void *user, VNodeID node_id, const char *layer, uint32 def_crease)
-{
- VSNodeGeometry *node;
- unsigned int i, count;
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
- node->crease_edge = def_crease;
- v_strlcpy(node->crease_edge_layer, layer, sizeof node->crease_edge_layer);
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_g_crease_set_edge(node_id, layer, def_crease);
- }
- vs_reset_subscript_session();
-}
-
-void callback_send_g_bone_create(void *user, VNodeID node_id, uint16 bone_id, const char *weight,
- const char *reference, uint16 parent,
- real64 pos_x, real64 pos_y, real64 pos_z,
- const char *position_label, const char *rotation_label, const char *scale_label)
-{
- VSNodeGeometry *node;
- unsigned int i, count;
-
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
- if(bone_id >= node->bone_count || node->bones[bone_id].weight[0] == '\0')
- {
- /* Find free bone to re-use, if any. */
- for(bone_id = 0; bone_id < node->bone_count && node->bones[bone_id].weight[0] != '\0'; bone_id++)
- ;
- if(bone_id == node->bone_count)
- {
- bone_id = node->bone_count;
- node->bone_count += 16;
- node->bones = realloc(node->bones, (sizeof *node->bones) * node->bone_count);
- for(i = bone_id; i < node->bone_count; i++)
- node->bones[i].weight[0] = '\0';
- }
- }
- v_strlcpy(node->bones[bone_id].weight, weight, sizeof node->bones[bone_id].weight);
- v_strlcpy(node->bones[bone_id].reference, reference, sizeof node->bones[bone_id].reference);
- node->bones[bone_id].parent = parent;
- node->bones[bone_id].pos_x = pos_x;
- node->bones[bone_id].pos_y = pos_y;
- node->bones[bone_id].pos_z = pos_z;
- v_strlcpy(node->bones[bone_id].position_label, position_label, sizeof node->bones[bone_id].position_label);
- v_strlcpy(node->bones[bone_id].rotation_label, rotation_label, sizeof node->bones[bone_id].rotation_label);
- v_strlcpy(node->bones[bone_id].scale_label, scale_label, sizeof node->bones[bone_id].scale_label);
-
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_g_bone_create(node_id, bone_id, weight, reference, parent, pos_x, pos_y, pos_z, position_label, rotation_label, scale_label);
- }
- vs_reset_subscript_session();
-}
-
-void callback_send_g_bone_destroy(void *user, VNodeID node_id, uint32 bone_id)
-{
- VSNodeGeometry *node;
- unsigned int i, count;
- node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
- if(node == NULL)
- return;
- if(bone_id >= node->bone_count || node->bones[bone_id].weight[0] == 0)
- return;
- node->bones[bone_id].weight[0] = 0;
-
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_g_bone_destroy(node_id, bone_id);
- }
- vs_reset_subscript_session();
-}
-
-void vs_g_callback_init(void)
-{
- verse_callback_set(verse_send_g_layer_create, callback_send_g_layer_create, NULL);
- verse_callback_set(verse_send_g_layer_destroy, callback_send_g_layer_destroy, NULL);
- verse_callback_set(verse_send_g_layer_subscribe, callback_send_g_layer_subscribe, NULL);
- verse_callback_set(verse_send_g_layer_unsubscribe, callback_send_g_layer_unsubscribe, NULL);
- verse_callback_set(verse_send_g_vertex_set_xyz_real32, callback_send_g_vertex_set_xyz_real32, NULL);
- verse_callback_set(verse_send_g_vertex_set_xyz_real64, callback_send_g_vertex_set_xyz_real64, NULL);
- verse_callback_set(verse_send_g_vertex_set_uint32, callback_send_g_vertex_set_uint32, NULL);
- verse_callback_set(verse_send_g_vertex_set_real32, callback_send_g_vertex_set_real32, NULL);
- verse_callback_set(verse_send_g_vertex_set_real64, callback_send_g_vertex_set_real64, NULL);
- verse_callback_set(verse_send_g_vertex_delete_real32, callback_send_g_vertex_delete_real, NULL);
- verse_callback_set(verse_send_g_vertex_delete_real64, callback_send_g_vertex_delete_real, NULL);
- verse_callback_set(verse_send_g_polygon_set_corner_uint32, callback_send_g_polygon_set_corner_uint32, NULL);
- verse_callback_set(verse_send_g_polygon_set_corner_real32, callback_send_g_polygon_set_corner_real32, NULL);
- verse_callback_set(verse_send_g_polygon_set_corner_real64, callback_send_g_polygon_set_corner_real64, NULL);
- verse_callback_set(verse_send_g_polygon_set_face_uint8, callback_send_g_polygon_set_face_uint8, NULL);
- verse_callback_set(verse_send_g_polygon_set_face_uint32, callback_send_g_polygon_set_face_uint32, NULL);
- verse_callback_set(verse_send_g_polygon_set_face_real32, callback_send_g_polygon_set_face_real32, NULL);
- verse_callback_set(verse_send_g_polygon_set_face_real64, callback_send_g_polygon_set_face_real64, NULL);
- verse_callback_set(verse_send_g_polygon_delete, callback_send_g_polygon_delete, NULL);
- verse_callback_set(verse_send_g_crease_set_vertex, callback_send_g_crease_set_vertex, NULL);
- verse_callback_set(verse_send_g_crease_set_edge, callback_send_g_crease_set_edge, NULL);
- verse_callback_set(verse_send_g_bone_create, callback_send_g_bone_create, NULL);
- verse_callback_set(verse_send_g_bone_destroy, callback_send_g_bone_destroy, NULL);
-}
-
-#endif
diff --git a/extern/verse/dist/vs_node_head.c b/extern/verse/dist/vs_node_head.c
deleted file mode 100644
index 9e926411542..00000000000
--- a/extern/verse/dist/vs_node_head.c
+++ /dev/null
@@ -1,414 +0,0 @@
-/*
-**
-*/
-
-#include
-#include
-#include
-
-#include "v_cmd_gen.h"
-
-#if !defined(V_GENERATE_FUNC_MODE)
-
-#include "verse.h"
-#include "v_util.h"
-#include "vs_server.h"
-
-typedef struct {
- VNTag tag;
- VNTagType type;
- char tag_name[16];
-} VSTag;
-
-typedef struct {
- VSTag *tags;
- unsigned int tag_count;
- char group_name[16];
- VSSubscriptionList *subscribers;
-} VSTagGroup;
-
-void create_node_head(VSNodeHead *node, const char *name, unsigned int owner)
-{
- size_t len;
-
- len = strlen(name) + 1;
- node->name = malloc(len);
- v_strlcpy(node->name, name, len);
- node->owner = owner;
- node->tag_groups = NULL;
- node->group_count = 0;
- node->subscribers = vs_create_subscription_list();
-}
-
-void destroy_node_head(VSNodeHead *node)
-{
- unsigned int i, j;
- if(node->name != NULL)
- free(node->name);
- if(node->tag_groups != NULL)
- {
- for(i = 0; i < node->group_count; i++)
- {
- for(j = 0; j < ((VSTagGroup *)node->tag_groups)[i].tag_count; j++)
- {
- if(((VSTagGroup *)node->tag_groups)[i].tags[j].type == VN_TAG_STRING)
- free(((VSTagGroup *)node->tag_groups)[i].tags[j].tag.vstring);
- if(((VSTagGroup *)node->tag_groups)[i].tags[j].type == VN_TAG_BLOB)
- free(((VSTagGroup *)node->tag_groups)[i].tags[j].tag.vblob.blob);
- }
- if(((VSTagGroup *)node->tag_groups)[i].tags != NULL)
- free(((VSTagGroup *)node->tag_groups)[i].tags);
- }
- if(node->tag_groups != NULL)
- free(node->tag_groups);
- }
-}
-
- void callback_send_tag_group_create(void *user, VNodeID node_id, uint16 group_id, const char *name)
-{
- VSNodeHead *node;
- unsigned int count, i, j, element;
-
- if((node = vs_get_node_head(node_id)) == 0)
- return;
- if(name[0] == 0)
- return;
-
- for(i = 0; i < node->group_count; i++) /* see if a tag group with this name alredy exists*/
- {
- if(((VSTagGroup *)node->tag_groups)[i].group_name[0] != 0)
- {
- for(j = 0; name[j] == ((VSTagGroup *)node->tag_groups)[i].group_name[j] && name[j] != 0; j++);
- if(name[j] == ((VSTagGroup *)node->tag_groups)[i].group_name[j])
- return;
- }
- }
- if(group_id < node->group_count && ((VSTagGroup *)node->tag_groups)[group_id].group_name[0] != 0) /* rename existing group */
- {
- element = group_id;
- }else /* create new game group */
- {
- for(element = 0; element < node->group_count && ((VSTagGroup *)node->tag_groups)[element].group_name[0] != 0; element++);
- if(element == node->group_count)
- {
- node->tag_groups = realloc(node->tag_groups, sizeof(VSTagGroup) * (node->group_count + 16));
- for(i = node->group_count; i < node->group_count + 16U; i++)
- {
- ((VSTagGroup *)node->tag_groups)[i].group_name[0] = 0;
- ((VSTagGroup *)node->tag_groups)[i].tags = NULL;
- ((VSTagGroup *)node->tag_groups)[i].tag_count = 0;
- ((VSTagGroup *)node->tag_groups)[i].subscribers = NULL;
- }
- node->group_count += 16;
- }
- ((VSTagGroup *)node->tag_groups)[element].subscribers = vs_create_subscription_list();
- }
- v_strlcpy(((VSTagGroup *)node->tag_groups)[element].group_name, name,
- sizeof ((VSTagGroup *)node->tag_groups)[element].group_name);
-
- count = vs_get_subscript_count(node->subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->subscribers, i);
- verse_send_tag_group_create(node_id, element, name);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_tag_group_destroy(void *user, VNodeID node_id, uint16 group_id)
-{
- VSNodeHead *node;
- unsigned int count, i;
- if((node = vs_get_node_head(node_id)) == 0)
- return;
-
- if(node->group_count <= group_id || ((VSTagGroup *)node->tag_groups)[group_id].group_name[0] == 0)
- return;
-
- vs_destroy_subscription_list(((VSTagGroup *)node->tag_groups)[group_id].subscribers);
- for(i = 0; i < ((VSTagGroup *)node->tag_groups)[group_id].tag_count; i++)
- {
- if(((VSTagGroup *)node->tag_groups)[group_id].tags[i].type == VN_TAG_STRING)
- free(((VSTagGroup *)node->tag_groups)[group_id].tags[i].tag.vstring);
- if(((VSTagGroup *)node->tag_groups)[group_id].tags[i].type == VN_TAG_BLOB)
- free(((VSTagGroup *)node->tag_groups)[group_id].tags[i].tag.vblob.blob);
- }
- if(((VSTagGroup *)node->tag_groups)[group_id].tags != NULL)
- free(((VSTagGroup *)node->tag_groups)[group_id].tags);
- ((VSTagGroup *)node->tag_groups)[group_id].group_name[0] = 0;
- ((VSTagGroup *)node->tag_groups)[group_id].tags = NULL;
- ((VSTagGroup *)node->tag_groups)[group_id].tag_count = 0;
-
- count = vs_get_subscript_count(node->subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->subscribers, i);
- verse_send_tag_group_destroy(node_id, group_id);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_tag_group_subscribe(void *user, VNodeID node_id, uint16 group_id)
-{
- VSNodeHead *node;
- unsigned int i;
- if((node = vs_get_node_head(node_id)) == 0)
- return;
-
- if(group_id < node->group_count && ((VSTagGroup *)node->tag_groups)[group_id].group_name[0] != 0)
- {
- vs_add_new_subscriptor(((VSTagGroup *)node->tag_groups)[group_id].subscribers);
- for(i = 0; i < ((VSTagGroup *)node->tag_groups)[group_id].tag_count; i++)
- {
- if(((VSTagGroup *)node->tag_groups)[group_id].tags[i].tag_name[0] != 0)
- {
- verse_send_tag_create(node_id, group_id, (uint16)i, ((VSTagGroup *)node->tag_groups)[group_id].tags[i].tag_name, ((VSTagGroup *)node->tag_groups)[group_id].tags[i].type, &((VSTagGroup *)node->tag_groups)[group_id].tags[i].tag);
- }
- }
- }
-}
-
-static void callback_send_tag_group_unsubscribe(void *user, VNodeID node_id, uint16 group_id)
-{
- VSNodeHead *node;
- if((node = vs_get_node_head(node_id)) == 0)
- return;
- if(group_id < node->group_count && ((VSTagGroup *)node->tag_groups)[group_id].group_name[0] != 0)
- vs_remove_subscriptor(((VSTagGroup *)node->tag_groups)[group_id].subscribers);
-}
-
-static void callback_send_tag_create(void *user, VNodeID node_id, uint16 group_id, uint16 tag_id, char *name, uint8 type, void *tag)
-{
- VSNodeHead *node;
- VSTag *t = NULL;
- unsigned int i, count;
-
- if((node = vs_get_node_head(node_id)) == 0)
- return;
- if(group_id >= node->group_count || ((VSTagGroup *)node->tag_groups)[group_id].group_name[0] == 0)
- return;
-
-/* for(i = 0; i < ((VSTagGroup *)node->tag_groups)[group_id].tag_count; i++)
- {
- if(((VSTagGroup *)node->tag_groups)[group_id].tags[i].tag_name != NULL && i != tag_id)
- {
- for(j = 0; name[j] == ((VSTagGroup *)node->tag_groups)[group_id].tags[i].tag_name[j] && name[j] != 0; j++);
- if(name[j] == ((VSTagGroup *)node->tag_groups)[group_id].tags[i].tag_name[j])
- return;
- }
- }*/
- if(tag_id < ((VSTagGroup *)node->tag_groups)[group_id].tag_count && ((VSTagGroup *)node->tag_groups)[group_id].tags[tag_id].tag_name[0] != 0)
- ;
- else
- {
- for(tag_id = 0; tag_id < ((VSTagGroup *)node->tag_groups)[group_id].tag_count && ((VSTagGroup *)node->tag_groups)[group_id].tags[tag_id].tag_name[0] != 0; tag_id++)
- ;
- if(tag_id == ((VSTagGroup *)node->tag_groups)[group_id].tag_count)
- {
- ((VSTagGroup *)node->tag_groups)[group_id].tags = realloc(((VSTagGroup *)node->tag_groups)[group_id].tags, sizeof(VSTag) * (((VSTagGroup *)node->tag_groups)[group_id].tag_count + 16));
- for(i = tag_id; i < ((VSTagGroup *)node->tag_groups)[group_id].tag_count + 16; i++)
- ((VSTagGroup *)node->tag_groups)[group_id].tags[i].tag_name[0] = 0;
- ((VSTagGroup *)node->tag_groups)[group_id].tag_count += 16;
- }
- }
- t = &((VSTagGroup *)node->tag_groups)[group_id].tags[tag_id];
- if(t->tag_name[0] != '\0') /* Old tag being re-set? */
- {
- if(t->type == VN_TAG_STRING)
- free(t->tag.vstring);
- else if(t->type == VN_TAG_BLOB)
- free(t->tag.vblob.blob);
- }
- t->type = type;
- v_strlcpy(t->tag_name, name, sizeof t->tag_name);
- switch(type)
- {
- case VN_TAG_BOOLEAN :
- t->tag.vboolean = ((VNTag *)tag)->vboolean;
- break;
- case VN_TAG_UINT32 :
- t->tag.vuint32 = ((VNTag *)tag)->vuint32;
- break;
- case VN_TAG_REAL64 :
- t->tag.vreal64 = ((VNTag *)tag)->vreal64;
- break;
- case VN_TAG_STRING :
- i = strlen(((VNTag *) tag)->vstring);
- t->tag.vstring = malloc(i + 1);
- strcpy(t->tag.vstring, ((VNTag *) tag)->vstring);
- break;
- case VN_TAG_REAL64_VEC3 :
- t->tag.vreal64_vec3[0] = ((VNTag *)tag)->vreal64_vec3[0];
- t->tag.vreal64_vec3[1] = ((VNTag *)tag)->vreal64_vec3[1];
- t->tag.vreal64_vec3[2] = ((VNTag *)tag)->vreal64_vec3[2];
- break;
- case VN_TAG_LINK :
- t->tag.vlink = ((VNTag *)tag)->vlink;
- break;
- case VN_TAG_ANIMATION :
- t->tag.vanimation.curve = ((VNTag *)tag)->vanimation.curve;
- t->tag.vanimation.start = ((VNTag *)tag)->vanimation.start;
- t->tag.vanimation.end = ((VNTag *)tag)->vanimation.end;
- break;
- case VN_TAG_BLOB :
- t->tag.vblob.blob = malloc(((VNTag *)tag)->vblob.size);
- t->tag.vblob.size = ((VNTag *)tag)->vblob.size;
- memcpy(t->tag.vblob.blob, ((VNTag *)tag)->vblob.blob, ((VNTag *)tag)->vblob.size);
- break;
- }
-
- count = vs_get_subscript_count(((VSTagGroup *) node->tag_groups)[group_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(((VSTagGroup *) node->tag_groups)[group_id].subscribers, i);
- verse_send_tag_create(node_id, group_id, tag_id, name, type, tag);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_tag_destroy(void *user, VNodeID node_id, uint16 group_id, uint16 tag_id)
-{
- VSNodeHead *node;
- unsigned int count, i;
- if((node = vs_get_node_head(node_id)) == 0)
- return;
-
- count = vs_get_subscript_count(((VSTagGroup *) node->tag_groups)[group_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(((VSTagGroup *) node->tag_groups)[group_id].subscribers, i);
- verse_send_tag_destroy(node_id, group_id, tag_id);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_node_name_set(void *user, VNodeID node_id, char *name)
-{
- VSNodeHead *node;
- unsigned int count, i;
- size_t len;
-
- if((node = vs_get_node_head(node_id)) == 0)
- return;
- len = strlen(name);
- if(len == 0)
- return;
- free(node->name);
- len++;
- node->name = malloc(len);
- v_strlcpy(node->name, name, len);
- count = vs_get_subscript_count(node->subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->subscribers, i);
- verse_send_node_name_set(node_id, name);
- }
- vs_reset_subscript_session();
-}
-
-extern void vs_o_subscribe(VSNodeHead *node);
-extern void vs_g_subscribe(VSNodeHead *node);
-extern void vs_m_subscribe(VSNodeHead *node);
-extern void vs_b_subscribe(VSNodeHead *node);
-extern void vs_t_subscribe(VSNodeHead *node);
-extern void vs_c_subscribe(VSNodeHead *node);
-extern void vs_a_subscribe(VSNodeHead *node);
-
-static void callback_send_node_subscribe(void *user, VNodeID node_id)
-{
- unsigned int i;
- VSNodeHead *node;
-
- if((node = vs_get_node_head(node_id)) == NULL)
- return;
- switch(node->type)
- {
- case V_NT_OBJECT :
- vs_o_subscribe(node);
- break;
- case V_NT_GEOMETRY :
- vs_g_subscribe(node);
- break;
- case V_NT_MATERIAL :
- vs_m_subscribe(node);
- break;
- case V_NT_BITMAP :
- vs_b_subscribe(node);
- break;
- case V_NT_TEXT:
- vs_t_subscribe(node);
- break;
- case V_NT_CURVE:
- vs_c_subscribe(node);
- break;
- case V_NT_AUDIO:
- vs_a_subscribe(node);
- break;
- default:
- fprintf(stderr, "Not subscribing to node type %d\n", node->type);
- }
- verse_send_node_name_set(node->id, node->name);
- for(i = 0; i < node->group_count; i++)
- if(((VSTagGroup *)node->tag_groups)[i].group_name[0] != 0)
- verse_send_tag_group_create(node->id, (uint16)i, ((VSTagGroup *)node->tag_groups)[i].group_name);
- vs_add_new_subscriptor(node->subscribers);
-}
-
-extern void vs_o_unsubscribe(VSNodeHead *node);
-extern void vs_g_unsubscribe(VSNodeHead *node);
-extern void vs_m_unsubscribe(VSNodeHead *node);
-extern void vs_b_unsubscribe(VSNodeHead *node);
-extern void vs_t_unsubscribe(VSNodeHead *node);
-extern void vs_c_unsubscribe(VSNodeHead *node);
-extern void vs_a_unsubscribe(VSNodeHead *node);
-
-static void callback_send_node_unsubscribe(void *user, VNodeID node_id)
-{
- VSNodeHead *node;
-
- if((node = vs_get_node_head(node_id)) == NULL)
- return;
- vs_remove_subscriptor(node->subscribers);
-
- switch(node->type)
- {
- case V_NT_OBJECT :
- vs_o_unsubscribe(node);
- break;
- case V_NT_GEOMETRY :
- vs_g_unsubscribe(node);
- break;
- case V_NT_MATERIAL :
- vs_m_unsubscribe(node);
- break;
- case V_NT_BITMAP :
- vs_b_unsubscribe(node);
- break;
- case V_NT_TEXT:
- vs_t_unsubscribe(node);
- break;
- case V_NT_CURVE:
- vs_c_unsubscribe(node);
- break;
- case V_NT_AUDIO:
- vs_a_unsubscribe(node);
- break;
- default:
- fprintf(stderr, "Not unsubscribing from node type %d\n", node->type);
- }
-}
-
-void vs_h_callback_init(void)
-{
- verse_callback_set(verse_send_tag_group_create, callback_send_tag_group_create, NULL);
- verse_callback_set(verse_send_tag_group_destroy, callback_send_tag_group_destroy, NULL);
- verse_callback_set(verse_send_tag_group_subscribe, callback_send_tag_group_subscribe, NULL);
- verse_callback_set(verse_send_tag_group_unsubscribe, callback_send_tag_group_unsubscribe, NULL);
- verse_callback_set(verse_send_tag_create, callback_send_tag_create, NULL);
- verse_callback_set(verse_send_tag_destroy, callback_send_tag_destroy, NULL);
- verse_callback_set(verse_send_node_name_set, callback_send_node_name_set, NULL);
- verse_callback_set(verse_send_node_subscribe, callback_send_node_subscribe, NULL);
- verse_callback_set(verse_send_node_unsubscribe, callback_send_node_unsubscribe, NULL);
-}
-
-#endif
diff --git a/extern/verse/dist/vs_node_material.c b/extern/verse/dist/vs_node_material.c
deleted file mode 100644
index b22c070e348..00000000000
--- a/extern/verse/dist/vs_node_material.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-**
-*/
-
-#include
-#include
-
-#include "v_cmd_gen.h"
-
-#if !defined V_GENERATE_FUNC_MODE
-
-#include "verse.h"
-#include "vs_server.h"
-
-typedef struct {
- VNMFragmentType type;
- VMatFrag frag;
-} VSMatFrag;
-
-typedef struct{
- VSNodeHead head;
- VSMatFrag *frag;
- unsigned int frag_count;
-} VSNodeMaterial;
-
-VSNodeMaterial * vs_m_create_node(unsigned int owner)
-{
- VSNodeMaterial *node;
- char name[48];
- node = malloc(sizeof *node);
- vs_add_new_node(&node->head, V_NT_MATERIAL);
- sprintf(name, "Material_Node_%u", node->head.id);
- create_node_head(&node->head, name, owner);
- node->frag = NULL;
- node->frag_count = 0;
- return node;
-}
-
-void vs_m_destroy_node(VSNodeMaterial *node)
-{
- destroy_node_head(&node->head);
- free(node->frag);
- free(node);
-}
-
-void vs_m_subscribe(VSNodeMaterial *node)
-{
- uint16 i;
- for(i = 0; i < node->frag_count; i++)
- if(node->frag[i].type <= VN_M_FT_OUTPUT)
- verse_send_m_fragment_create(node->head.id, (uint16)i, (uint8)node->frag[i].type, &node->frag[i].frag);
-}
-
-void vs_m_unsubscribe(VSNodeMaterial *node)
-{
-}
-
-static void callback_send_m_fragment_create(void *user, VNodeID node_id, VNMFragmentID frag_id, uint8 type, VMatFrag *fragment)
-{
- unsigned int count;
- uint16 i;
- VSNodeMaterial *node;
- node = (VSNodeMaterial *)vs_get_node(node_id, V_NT_MATERIAL);
- if(node == NULL)
- return;
- if(node->frag_count + 32 < frag_id)
- frag_id = (uint16)-1;
- if(frag_id == (uint16) ~0u)
- for(frag_id = 0; frag_id < node->frag_count && node->frag[frag_id].type < VN_M_FT_OUTPUT + 1; frag_id++)
- ;
- if(frag_id >= node->frag_count)
- {
- node->frag = realloc(node->frag, (sizeof *node->frag) * (node->frag_count + 32));
- for(i = node->frag_count; i < (node->frag_count + 32); i++)
- node->frag[i].type = 255;
- node->frag_count += 32;
- }
- node->frag[frag_id].type = type;
- node->frag[frag_id].frag = *fragment;
-
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_m_fragment_create(node_id, frag_id, type, fragment);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_m_fragment_destroy(void *user, VNodeID node_id, VNMFragmentID frag_id)
-{
- unsigned int count, i;
- VSNodeMaterial *node;
- node = (VSNodeMaterial *)vs_get_node(node_id, V_NT_MATERIAL);
- printf("callback_send_m_fragment_destroy %p\n", node);
- if(node == NULL)
- return;
- if(node->frag_count <= frag_id || node->frag[frag_id].type > VN_M_FT_OUTPUT)
- return;
- node->frag[frag_id].type = 255;
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_m_fragment_destroy(node_id, frag_id);
- }
- vs_reset_subscript_session();
-}
-
-void vs_m_callback_init(void)
-{
- verse_callback_set(verse_send_m_fragment_create, callback_send_m_fragment_create, NULL);
- verse_callback_set(verse_send_m_fragment_destroy, callback_send_m_fragment_destroy, NULL);
-}
-
-#endif
diff --git a/extern/verse/dist/vs_node_object.c b/extern/verse/dist/vs_node_object.c
deleted file mode 100644
index d269a8ddb99..00000000000
--- a/extern/verse/dist/vs_node_object.c
+++ /dev/null
@@ -1,837 +0,0 @@
-/*
-**
-*/
-
-#include
-#include
-
-#include "v_cmd_gen.h"
-
-#if !defined V_GENERATE_FUNC_MODE
-
-#include "verse.h"
-#include "v_util.h"
-#include "vs_server.h"
-
-extern void verse_send_o_link_set(VNodeID node_id, uint16 link_id, VNodeID link, const char *name, uint32 target_id);
-extern void verse_send_o_link_destroy(VNodeID node_id, uint16 link_id);
-
-typedef struct {
- VNodeID link;
- char name[16];
- uint32 target_id;
- /* Animation parameters. */
- uint32 time_s;
- uint32 time_f;
- uint32 dimensions;
- real64 pos[4];
- real64 speed[4];
- real64 accel[4];
- real64 scale[4];
- real64 scale_speed[4];
-} VSLink;
-
-typedef struct {
- char name[16];
- uint8 param_count;
- VNOParamType *param_types;
- char *param_names;
-} VSMethod;
-
-typedef struct {
- char name[VN_O_METHOD_GROUP_NAME_SIZE];
- VSMethod *methods;
- unsigned int method_count;
- VSSubscriptionList *subscribers;
-} VSMethodGroup;
-
-typedef struct {
- real64 position[3];
- VNQuat64 rotation;
- real64 scale[3];
-/* VSSubscriptionList *subscribers;*/
-} VSTransform;
-
-typedef struct {
- VSNodeHead head;
- VSTransform transform;
- VSSubscriptionList *trans_sub64;
- VSSubscriptionList *trans_sub32;
- real64 light[3];
- VSMethodGroup *groups;
- uint16 group_count;
- VSLink *links;
- uint16 link_count;
- boolean hidden;
-} VSNodeObject;
-
-VSNodeObject * vs_o_create_node(unsigned int owner)
-{
- VSNodeObject *node;
- unsigned int i, j;
- char name[48];
- node = malloc(sizeof *node);
- vs_add_new_node(&node->head, V_NT_OBJECT);
- sprintf(name, "Object_Node_%u", node->head.id);
- create_node_head(&node->head, name, owner);
- node->trans_sub64 = vs_create_subscription_list();
- node->trans_sub32 = vs_create_subscription_list();
- node->transform.position[0] = node->transform.position[1] = node->transform.position[2] = 0;
- node->transform.rotation.x = node->transform.rotation.y = node->transform.rotation.z = 0.0;
- node->transform.rotation.w = 1.0;
- node->transform.scale[0] = node->transform.scale[1] = node->transform.scale[2] = 1.0;
- node->light[0] = node->light[1] = node->light[2] = V_REAL64_MAX;
- node->groups = malloc((sizeof *node->groups) * 16);
- node->group_count = 16;
- for(i = 0; i < 16; i++)
- {
- node->groups[i].name[0] = 0;
- node->groups[i].methods = NULL;
- node->groups[i].method_count = 0;
- node->groups[i].subscribers = NULL;
- }
-
- node->link_count = 16;
- node->links = malloc((sizeof *node->links) * node->link_count);
- for(i = 0; i < node->link_count; i++)
- {
- node->links[i].link = -1;
- node->links[i].name[0] = 0;
- node->links[i].target_id = -1;
- node->links[i].dimensions = 0;
- for(j = 0; j < 4; j++)
- {
- node->links[i].pos[j] = 0.0;
- node->links[i].speed[j] = 0.0;
- node->links[i].accel[j] = 0.0;
- node->links[i].scale[j] = 0.0;
- node->links[i].scale_speed[j] = 0.0;
- }
- }
- node->hidden = FALSE;
- return node;
-}
-
-void vs_o_destroy_node(VSNodeObject *node)
-{
- unsigned int i, j;
- destroy_node_head(&node->head);
- for(i = 0; i < node->group_count; i++)
- {
- if(node->groups[i].name[0] != 0)
- {
- for(j = 0; j < node->groups[i].method_count; j++)
- {
- if(node->groups[i].methods[j].name[0] != 0 && node->groups[i].methods[j].param_count != 0)
- {
- free(node->groups[i].methods[j].param_types);
- free(node->groups[i].methods[j].param_names);
- }
- }
- if(node->groups[i].methods != NULL)
- free(node->groups[i].methods);
- }
- }
- free(node->groups);
- free(node);
-}
-
-void vs_o_subscribe(VSNodeObject *node)
-{
- unsigned int i;
- for(i = 0; i < node->link_count; i++)
- {
- const VSLink *lnk = node->links + i;
-
- if(lnk->name[0] != 0)
- {
- verse_send_o_link_set(node->head.id, i, lnk->link, lnk->name, lnk->target_id);
- if(lnk->dimensions != 0)
- {
- verse_send_o_anim_run(node->head.id, i, lnk->time_s, lnk->time_f, lnk->dimensions,
- lnk->pos, lnk->speed, lnk->accel,
- lnk->scale, lnk->scale_speed);
- }
- }
- }
- if(node->light[0] != V_REAL64_MAX || node->light[1] != V_REAL64_MAX || node->light[2] != V_REAL64_MAX)
- verse_send_o_light_set(node->head.id, node->light[0], node->light[1], node->light[2]);
- for(i = 0; i < node->group_count; i++)
- {
- if(node->groups[i].name[0] != 0)
- verse_send_o_method_group_create(node->head.id, i, node->groups[i].name);
- }
- if(node->hidden)
- verse_send_o_hide(node->head.id, TRUE);
-}
-
-void vs_o_unsubscribe(VSNodeObject *node)
-{
- unsigned int i;
- for(i = 0; i < node->group_count; i++)
- if(node->groups[i].name[0] != 0)
- vs_remove_subscriptor(node->groups[i].subscribers);
- vs_remove_subscriptor(node->trans_sub64);
- vs_remove_subscriptor(node->trans_sub32);
-}
-
-static void callback_send_o_transform_pos_real32(void *user, VNodeID node_id, uint32 time_s, uint32 time_f, real32 *pos, real32 *speed, real32 *accelerate, real32 *drag_normal, real32 drag)
-{
- VSNodeObject *node;
- unsigned int i, count;
-
- node = (VSNodeObject *)vs_get_node(node_id, V_NT_OBJECT);
- if(node == NULL)
- return;
- node->transform.position[0] = pos[0];
- node->transform.position[1] = pos[1];
- node->transform.position[2] = pos[2];
-
- if((count = vs_get_subscript_count(node->trans_sub64)) > 0) /* Anyone listening at 64 bits? */
- {
- real64 spd[3], acc[3], drn[3], *pspd = NULL, *pacc = NULL, *pdrn = NULL;
-
- pspd = (speed != NULL) ? spd : NULL;
- pacc = (accelerate != NULL) ? acc : NULL;
- pdrn = (drag_normal != NULL) ? drn : NULL;
- /* Convert non-position values to 64-bit. */
- for(i = 0; i < 3; i++)
- {
- if(speed != NULL)
- spd[i] = speed[i];
- if(accelerate != NULL)
- acc[i] = accelerate[i];
- if(drag_normal != NULL)
- drn[i] = drag_normal[i];
- }
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->trans_sub64, i);
- verse_send_o_transform_pos_real64(node_id, time_s, time_f, node->transform.position, pspd, pacc, pdrn, drag);
- }
- }
- count = vs_get_subscript_count(node->trans_sub32);
- for(i = 0; i < count; i++)
- {
-
- vs_set_subscript_session(node->trans_sub32, i);
- verse_send_o_transform_pos_real32(node_id, time_s, time_f, pos, speed, accelerate, drag_normal, drag);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_o_transform_rot_real32(void *user, VNodeID node_id, uint32 time_s, uint32 time_f, const VNQuat32 *rot,
- const VNQuat32 *speed, const VNQuat32 *accelerate, const VNQuat32 *drag_normal, real32 drag)
-{
- VSNodeObject *node;
- unsigned int i, count;
- node = (VSNodeObject *)vs_get_node(node_id, V_NT_OBJECT);
- if(node == NULL)
- return;
- node->transform.rotation.x = rot->x;
- node->transform.rotation.y = rot->y;
- node->transform.rotation.z = rot->z;
- node->transform.rotation.w = rot->w;
- if((count = vs_get_subscript_count(node->trans_sub64)) > 0)
- {
- VNQuat64 spd, acc, drn, *p[3];
-
- /* Convert 32-bit quaternions to 64-bit. Converter handles NULLs, has nice return semantics. */
- p[0] = v_quat64_from_quat32(&spd, speed);
- p[1] = v_quat64_from_quat32(&acc, accelerate);
- p[2] = v_quat64_from_quat32(&drn, drag_normal);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->trans_sub64, i);
- verse_send_o_transform_rot_real64(node_id, time_s, time_f, &node->transform.rotation, p[0], p[1], p[2], drag);
- }
- }
- count = vs_get_subscript_count(node->trans_sub32);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->trans_sub32, i);
- verse_send_o_transform_rot_real32(node_id, time_s, time_f, rot, speed, accelerate, drag_normal, drag);
- }
- vs_reset_subscript_session();
-}
-
-
-static void callback_send_o_transform_scale_real32(void *user, VNodeID node_id, real32 scale_x, real32 scale_y, real32 scale_z)
-{
- VSNodeObject *node;
- unsigned int i, count;
- node = (VSNodeObject *)vs_get_node(node_id, V_NT_OBJECT);
- if(node == NULL)
- return;
- node->transform.scale[0] = scale_x;
- node->transform.scale[1] = scale_y;
- node->transform.scale[2] = scale_z;
- count = vs_get_subscript_count(node->trans_sub64);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->trans_sub64, i);
- verse_send_o_transform_scale_real64(node_id, scale_x, scale_y, scale_z);
- }
- count = vs_get_subscript_count(node->trans_sub32);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->trans_sub32, i);
- verse_send_o_transform_scale_real32(node_id, scale_x, scale_y, scale_z);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_o_transform_pos_real64(void *user, VNodeID node_id, uint32 time_s, uint32 time_f, const real64 *pos,
- const real64 *speed, const real64 *accelerate, const real64 *drag_normal, real64 drag)
-{
- VSNodeObject *node;
- unsigned int i, count;
-
- node = (VSNodeObject *)vs_get_node(node_id, V_NT_OBJECT);
- if(node == NULL)
- return;
- node->transform.position[0] = pos[0];
- node->transform.position[1] = pos[1];
- node->transform.position[2] = pos[2];
- count = vs_get_subscript_count(node->trans_sub64);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->trans_sub64, i);
- verse_send_o_transform_pos_real64(node_id, time_s, time_f, node->transform.position, speed, accelerate, drag_normal, drag);
- }
- if((count = vs_get_subscript_count(node->trans_sub32)) > 0) /* Anyone listening at 32 bits? */
- {
- real32 ps[3], spd[3], acc[3], drn[3], *p[] = { NULL, NULL, NULL };
-
- ps[0] = pos[0];
- ps[1] = pos[1];
- ps[2] = pos[2];
- if(speed != NULL)
- {
- p[0] = spd;
- spd[0] = speed[0];
- spd[1] = speed[1];
- spd[2] = speed[2];
- }
- else
- p[0] = NULL;
- if(accelerate != NULL)
- {
- p[1] = acc;
- acc[0] = accelerate[0];
- acc[1] = accelerate[1];
- acc[2] = accelerate[2];
- }
- else
- p[1] = NULL;
- if(drag_normal != NULL)
- {
- p[1] = drn;
- drn[0] = drag_normal[0];
- drn[1] = drag_normal[1];
- drn[2] = drag_normal[2];
- }
- else
- p[2] = NULL;
-
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->trans_sub32, i);
- verse_send_o_transform_pos_real32(node_id, time_s, time_f, ps, p[0], p[1], p[2], (real32) drag);
- }
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_o_transform_rot_real64(void *user, VNodeID node_id, uint32 time_s, uint32 time_f, const VNQuat64 *rot,
- const VNQuat64 *speed, const VNQuat64 *accelerate, const VNQuat64 *drag_normal, real64 drag)
-{
- VSNodeObject *node;
- unsigned int i, count;
-
- node = (VSNodeObject *)vs_get_node(node_id, V_NT_OBJECT);
- if(node == NULL)
- return;
- node->transform.rotation = *rot;
- count = vs_get_subscript_count(node->trans_sub64);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->trans_sub64, i);
- verse_send_o_transform_rot_real64(node_id, time_s, time_f, &node->transform.rotation, speed, accelerate, drag_normal, drag);
- }
- if((count = vs_get_subscript_count(node->trans_sub32)) > 0) /* Anyone listening at 32 bits? */
- {
- VNQuat32 rt, spd, acc, drn, *p[3];
-
- v_quat32_from_quat64(&rt, rot);
- p[0] = v_quat32_from_quat64(&spd, speed);
- p[1] = v_quat32_from_quat64(&acc, accelerate);
- p[2] = v_quat32_from_quat64(&drn, drag_normal);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->trans_sub32, i);
- verse_send_o_transform_rot_real32(node_id, time_s, time_f, &rt, p[0], p[1], p[2], (real32) drag);
- }
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_o_transform_scale_real64(void *user, VNodeID node_id, real64 scale_x, real64 scale_y, real64 scale_z)
-{
- VSNodeObject *node;
- unsigned int i, count;
- node = (VSNodeObject *)vs_get_node(node_id, V_NT_OBJECT);
- if(node == NULL)
- return;
- node->transform.scale[0] = scale_x;
- node->transform.scale[1] = scale_y;
- node->transform.scale[2] = scale_z;
- count = vs_get_subscript_count(node->trans_sub64);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->trans_sub64, i);
- verse_send_o_transform_scale_real64(node_id, scale_x, scale_y, scale_z);
- }
- count = vs_get_subscript_count(node->trans_sub32);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->trans_sub32, i);
- verse_send_o_transform_scale_real32(node_id, (real32) scale_x, (real32) scale_y, (real32) scale_z);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_o_transform_subscribe(void *user, VNodeID node_id, VNRealFormat type)
-{
- VSNodeObject *node;
- uint32 time_s, time_f;
-
- node = (VSNodeObject *)vs_get_node(node_id, V_NT_OBJECT);
- if(node == NULL)
- return;
- verse_session_get_time(&time_s, &time_f);
- if(type == VN_FORMAT_REAL32)
- {
- real32 tpos[3];
- VNQuat32 rot;
-
- vs_add_new_subscriptor(node->trans_sub32);
- tpos[0] = node->transform.position[0];
- tpos[1] = node->transform.position[1];
- tpos[2] = node->transform.position[2];
- verse_send_o_transform_pos_real32(node_id, time_s, time_f, tpos, NULL, NULL, NULL, 0.0f);
- v_quat32_from_quat64(&rot, &node->transform.rotation);
- verse_send_o_transform_rot_real32(node_id, time_s, time_f, &rot, NULL, NULL, NULL, 0.0f);
- verse_send_o_transform_scale_real32(node_id, (real32) node->transform.scale[0], (real32) node->transform.scale[1], (real32) node->transform.scale[2]);
- }
- else
- {
- vs_add_new_subscriptor(node->trans_sub64);
- verse_send_o_transform_pos_real64(node_id, time_s, time_f, node->transform.position, NULL, NULL, NULL, 0);
- verse_send_o_transform_rot_real64(node_id, time_s, time_f, &node->transform.rotation, NULL, NULL, NULL, 0);
- verse_send_o_transform_scale_real64(node_id, node->transform.scale[0], node->transform.scale[1], node->transform.scale[2]);
- }
-}
-
-static void callback_send_o_transform_unsubscribe(void *user, VNodeID node_id, VNRealFormat type)
-{
- VSNodeObject *node;
- node = (VSNodeObject *)vs_get_node(node_id, V_NT_OBJECT);
- if(node == NULL)
- return;
- if(type == VN_FORMAT_REAL32)
- vs_remove_subscriptor(node->trans_sub32);
- else
- vs_remove_subscriptor(node->trans_sub64);
-}
-
-static void callback_send_o_light_set(void *user, VNodeID node_id, real64 light_r, real64 light_g, real64 light_b)
-{
- VSNodeObject *node;
- unsigned int i, count;
- node = (VSNodeObject *)vs_get_node(node_id, V_NT_OBJECT);
- if(node == NULL)
- return;
- node->light[0] = light_r;
- node->light[1] = light_g;
- node->light[2] = light_b;
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_o_light_set(node_id, light_r, light_g, light_b);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_o_link_set(void *user, VNodeID node_id, uint16 link_id, VNodeID link, const char *name, uint32 target_id)
-{
- VSNodeObject *node;
- unsigned int i, count;
- node = (VSNodeObject *)vs_get_node(node_id, V_NT_OBJECT);
-
- if(node == NULL)
- return;
-
- if(name[0] == 0)
- return;
- if(vs_get_node_head(link) == 0)
- link = 0;
-
- if(link_id >= node->link_count || node->links[link_id].name[0] == 0)
- {
- for(link_id = 0; link_id < node->link_count && node->links[link_id].name[0] != 0; link_id++);
-
- if(link_id == node->link_count)
- {
- i = node->link_count;
- node->link_count += 16;
- node->links = realloc(node->links, (sizeof *node->links) * node->link_count);
- for(; i < node->link_count; i++)
- {
- node->links[i].name[0] = 0;
- node->links[i].dimensions = 0;
- }
- }
- }
-
- node->links[link_id].link = link;
- for(i = 0; i < 15 && name[i] != 0; i++)
- node->links[link_id].name[i] = name[i];
- node->links[link_id].name[i] = 0;
- node->links[link_id].target_id = target_id;
-
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_o_link_set(node_id, link_id, link, name, target_id);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_o_link_destroy(void *user, VNodeID node_id, uint16 link_id)
-{
- VSNodeObject *node;
- unsigned int i, count;
- node = (VSNodeObject *)vs_get_node(node_id, V_NT_OBJECT);
- if(node == NULL)
- return;
-
- if(link_id >= node->link_count || node->links[link_id].name[0] == 0)
- return;
-
- node->links[link_id].name[0] = 0;
-
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_o_link_destroy(node_id, link_id);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_o_method_group_create(void *user, VNodeID node_id, uint16 group_id, char *name)
-{
- VSNodeObject *node;
- unsigned int i, j, count;
-
- node = (VSNodeObject *)vs_get_node(node_id, V_NT_OBJECT);
- if(node == NULL || vs_get_node(node_id, V_NT_OBJECT) == NULL)
- return;
-
- for(i = 0; i < node->group_count; i++)
- {
- for(j = 0; node->groups[i].name[j] == name[j] && node->groups[i].name[j] != 0; j++);
- if(node->groups[i].name[j] == name[j])
- return;
- }
- if(group_id >= node->group_count || node->groups[group_id].name[0] == 0)
- {
- for(group_id = 0; group_id < node->group_count && node->groups[group_id].name[0] != 0; group_id++)
- if(group_id == node->group_count)
- {
- node->groups = realloc(node->groups, sizeof(*node->groups) * (node->group_count + 16));
- for(i = node->group_count; i < node->group_count + 16u; i++)
- {
- node->groups[i].name[0] = 0;
- node->groups[i].methods = NULL;
- node->groups[i].method_count = 0;
- }
- node->group_count += 16;
- }
- node->groups[group_id].subscribers = vs_create_subscription_list();
- }
- for(i = 0; i < 15 && name[i] != 0; i++)
- node->groups[group_id].name[i] = name[i];
- node->groups[group_id].name[i] = 0;
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_o_method_group_create(node_id, group_id, name);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_o_method_group_destroy(void *user, VNodeID node_id, uint16 group_id)
-{
- VSNodeObject *node;
- unsigned int i, count;
- node = (VSNodeObject *)vs_get_node(node_id, V_NT_OBJECT);
- if(node == NULL || vs_get_node(node_id, V_NT_OBJECT) == NULL)
- return;
-
- if(group_id >= node->group_count || node->groups[group_id].name[0] == 0)
- return;
- node->groups[group_id].name[0] = 0;
- for(i = 0; i < node->groups[group_id].method_count; i++)
- {
- if(node->groups[group_id].methods[i].name[0] != 0 && node->groups[group_id].methods[i].param_count > 0)
- {
- free(node->groups[group_id].methods[i].param_names);
- free(node->groups[group_id].methods[i].param_types);
- }
- }
- free(node->groups[group_id].methods);
- node->groups[group_id].methods = NULL;
- node->groups[group_id].method_count = 0;
- vs_destroy_subscription_list(node->groups[group_id].subscribers);
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_o_method_group_destroy(node_id, group_id);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_o_method_group_subscribe(void *user, VNodeID node_id, uint16 group_id)
-{
- VSNodeObject *node;
- unsigned int i, j;
-
- node = (VSNodeObject *)vs_get_node(node_id, V_NT_OBJECT);
- if(node == NULL || vs_get_node(node_id, V_NT_OBJECT) == NULL)
- return;
- if(group_id < node->group_count && node->groups[group_id].name[0] != 0)
- vs_add_new_subscriptor(node->groups[group_id].subscribers);
- for(i = 0; i < node->groups[group_id].method_count; i++)
- {
- if(node->groups[group_id].methods[i].name[0] != 0)
- {
- char *names[255];
- for(j = 0; j < node->groups[group_id].methods[i].param_count; j++)
- names[j] = &node->groups[group_id].methods[i].param_names[j * 16];
- verse_send_o_method_create(node_id, group_id, i, node->groups[group_id].methods[i].name, node->groups[group_id].methods[i].param_count, node->groups[group_id].methods[i].param_types, (const char **) names);
- }
- }
-}
-
-static void callback_send_o_method_group_unsubscribe(void *user, VNodeID node_id, uint16 group_id)
-{
- VSNodeObject *node;
- node = (VSNodeObject *)vs_get_node(node_id, V_NT_OBJECT);
- if(node == NULL || vs_get_node(node_id, V_NT_OBJECT) == NULL)
- return;
- if(group_id < node->group_count && node->groups[group_id].name[0] != 0)
- vs_remove_subscriptor(node->groups[group_id].subscribers);
-}
-
-static void callback_send_o_method_create(void *user, VNodeID node_id, uint16 group_id, uint16 method_id, char *name, uint8 param_count, VNOParamType *param_types, char * *param_names)
-{
- VSNodeObject *node;
- unsigned int i, j, count;
- VSMethodGroup *group;
-
- node = (VSNodeObject *) vs_get_node(node_id, V_NT_OBJECT);
- if(node == NULL || vs_get_node(node_id, V_NT_OBJECT) == NULL)
- return;
- if(group_id >= node->group_count || node->groups[group_id].name[0] == 0)
- return;
- group = &node->groups[group_id];
- for(i = 0; i < group->method_count; i++)
- {
- if(i != method_id)
- {
- for(j = 0; group->methods[i].name[j] == name[j] && group->methods[i].name[j] != 0; j++);
- if(group->methods[i].name[j] == name[j])
- return;
- }
- }
- if(method_id < group->method_count && group->methods[method_id].name[0] != 0)
- {
- for(i = 0; i < 16; i++)
- group->methods[method_id].name[i] = name[i];
- if(group->methods[method_id].param_count != 0)
- {
- free(group->methods[method_id].param_names);
- free(group->methods[method_id].param_types);
- }
- }else
- {
- for(method_id = 0; method_id < group->method_count && group->methods[method_id].name[0] != 0; method_id++);
- if(method_id == group->method_count)
- {
- group->methods = realloc(group->methods, sizeof(*group->methods) * (group->method_count + 16));
- for(i = group->method_count; i < group->method_count + 16; i++)
- group->methods[i].name[0] = 0;
- group->method_count += 16;
- }
- }
- for(i = 0; i < VN_O_METHOD_NAME_SIZE && name[i] != 0; i++)
- group->methods[method_id].name[i] = name[i];
- group->methods[method_id].name[i] = '\0';
- group->methods[method_id].param_count = param_count;
- if(param_count > 0)
- {
- group->methods[method_id].param_types = malloc((sizeof *group->methods[method_id].param_types) * param_count);
- group->methods[method_id].param_names = malloc((sizeof *group->methods[method_id].param_names) * param_count * 16);
- }
- for(i = 0; i < param_count; i++)
- {
- group->methods[method_id].param_types[i] = param_types[i];
- for(j = 0; j < 15 && param_names[i][j] != 0; j++)
- group->methods[method_id].param_names[i * 16 + j] = param_names[i][j];
- group->methods[method_id].param_names[i * 16 + j] = 0;
- }
- count = vs_get_subscript_count(node->groups[group_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->groups[group_id].subscribers, i);
- verse_send_o_method_create(node_id, group_id, method_id, name, param_count, param_types, (const char **) param_names);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_o_method_destroy(void *user, VNodeID node_id, uint16 group_id, uint16 method_id)
-{
- VSNodeObject *node;
- unsigned int i, count;
- node = (VSNodeObject *)vs_get_node(node_id, V_NT_OBJECT);
- if(node == NULL || vs_get_node(node_id, V_NT_OBJECT) == NULL)
- return;
- if(group_id >= node->group_count || node->groups[group_id].name[0] == 0 || method_id >= node->groups[group_id].method_count || node->groups[group_id].methods[method_id].name[0] == 0)
- return;
-
- node->groups[group_id].methods[method_id].name[0] = 0;
- if(node->groups[group_id].methods[method_id].param_count != 0)
- {
- free(node->groups[group_id].methods[method_id].param_names);
- free(node->groups[group_id].methods[method_id].param_types);
- }
- count = vs_get_subscript_count(node->groups[group_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->groups[group_id].subscribers, i);
- verse_send_o_method_destroy(node_id, group_id, method_id);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_o_method_call(void *user, VNodeID node_id, uint16 group_id, uint16 method_id, VNodeID sender, void *params)
-{
- VNOParam unpacked_params[255];
- void *data;
- VSNodeObject *node;
- unsigned int i, count;
-
- node = (VSNodeObject *)vs_get_node(node_id, V_NT_OBJECT);
- if(node == NULL || vs_get_node(node_id, V_NT_OBJECT) == NULL)
- return;
-
- if(group_id >= node->group_count || node->groups[group_id].name[0] == 0 || method_id >= node->groups[group_id].method_count || node->groups[group_id].methods[method_id].name[0] == 0)
- return;
- if(!verse_method_call_unpack(params, node->groups[group_id].methods[method_id].param_count, node->groups[group_id].methods[method_id].param_types, unpacked_params))
- return;
- sender = vs_get_avatar();
- count = vs_get_subscript_count(node->groups[group_id].subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->groups[group_id].subscribers, i);
- data = verse_method_call_pack(node->groups[group_id].methods[method_id].param_count, node->groups[group_id].methods[method_id].param_types, unpacked_params);
- if(data != NULL)
- verse_send_o_method_call(node_id, group_id, method_id, sender, data);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_o_anim_run(void *user, VNodeID node_id, uint16 link_id, uint32 time_s, uint32 time_f, uint8 dimensions, real64 *pos,
- real64 *speed, real64 *accel, real64 *scale, real64 *scale_speed)
-{
- VSNodeObject *node;
- unsigned int i, count;
-
- node = (VSNodeObject *)vs_get_node(node_id, V_NT_OBJECT);
- if(node == NULL)
- return;
- if(link_id >= node->link_count || node->links[link_id].name[0] == 0)
- return;
- if(NULL == vs_get_node(node->links[link_id].link, V_NT_CURVE))
- return;
- node->links[link_id].time_s = time_s;
- node->links[link_id].time_f = time_f;
- node->links[link_id].dimensions = dimensions;
- for(i = 0; i < dimensions && i < 4; i++)
- {
- node->links[link_id].pos[i] = pos[i];
- node->links[link_id].speed[i] = speed[i];
- node->links[link_id].accel[i] = accel[i];
- node->links[link_id].scale[i] = scale[i];
- node->links[link_id].scale_speed[i] = scale_speed[i];
- }
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_o_anim_run(node_id, link_id, time_s, time_f, dimensions, pos, speed, accel, scale, scale_speed);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_o_hide(void *user, VNodeID node_id, uint8 hidden)
-{
- VSNodeObject *node;
- unsigned int i, count;
-
- node = (VSNodeObject *)vs_get_node(node_id, V_NT_OBJECT);
- if(node == NULL || hidden == node->hidden)
- return;
- node->hidden = hidden;
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_o_hide(node_id, hidden);
- }
- vs_reset_subscript_session();
-}
-
-void vs_o_callback_init(void)
-{
-
- verse_callback_set(verse_send_o_transform_pos_real32, callback_send_o_transform_pos_real32, NULL);
- verse_callback_set(verse_send_o_transform_rot_real32, callback_send_o_transform_rot_real32, NULL);
- verse_callback_set(verse_send_o_transform_scale_real32, callback_send_o_transform_scale_real32, NULL);
- verse_callback_set(verse_send_o_transform_pos_real64, callback_send_o_transform_pos_real64, NULL);
- verse_callback_set(verse_send_o_transform_rot_real64, callback_send_o_transform_rot_real64, NULL);
- verse_callback_set(verse_send_o_transform_scale_real64, callback_send_o_transform_scale_real64, NULL);
- verse_callback_set(verse_send_o_transform_subscribe, callback_send_o_transform_subscribe, NULL);
- verse_callback_set(verse_send_o_transform_unsubscribe, callback_send_o_transform_unsubscribe, NULL);
- verse_callback_set(verse_send_o_link_set, callback_send_o_link_set, NULL);
- verse_callback_set(verse_send_o_light_set, callback_send_o_light_set, NULL);
- verse_callback_set(verse_send_o_link_set, callback_send_o_link_set, NULL);
- verse_callback_set(verse_send_o_link_destroy, callback_send_o_link_destroy, NULL);
- verse_callback_set(verse_send_o_method_group_create, callback_send_o_method_group_create, NULL);
- verse_callback_set(verse_send_o_method_group_destroy, callback_send_o_method_group_destroy, NULL);
- verse_callback_set(verse_send_o_method_group_subscribe, callback_send_o_method_group_subscribe, NULL);
- verse_callback_set(verse_send_o_method_group_unsubscribe, callback_send_o_method_group_unsubscribe, NULL);
- verse_callback_set(verse_send_o_method_create, callback_send_o_method_create, NULL);
- verse_callback_set(verse_send_o_method_destroy, callback_send_o_method_destroy, NULL);
- verse_callback_set(verse_send_o_method_call, callback_send_o_method_call, NULL);
- verse_callback_set(verse_send_o_anim_run, callback_send_o_anim_run, NULL);
- verse_callback_set(verse_send_o_hide, callback_send_o_hide, NULL);
-}
-
-#endif
diff --git a/extern/verse/dist/vs_node_particle.c b/extern/verse/dist/vs_node_particle.c
deleted file mode 100644
index 8c7b1ce3c82..00000000000
--- a/extern/verse/dist/vs_node_particle.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-**
-*/
-
-#include
-#include
-
-#include "v_cmd_gen.h"
-
-#if !defined V_GENERATE_FUNC_MODE
-
-#include "verse.h"
-#include "vs_server.h"
-
-/*
-typedef struct {
- VSNodeHead head;
-} VSNodeObject;
-
-VSNodeObject *vs_o_create_node(unsigned int owner)
-{
- VSNodeObject *node;
- node = malloc(sizeof *node);
- create_node_head(&node->head, name, owner);
- vs_add_new_node(&node->head, V_NT_OBJECT);
- return node;
-}
-
-void vs_o_destroy_node(VSNodeObject *node)
-{
- destroy_node_head(&node->head);
- free(node);
-}
-
-void vs_o_subscribe(VSNodeObject *node)
-{
-}
-
-static void callback_send_o_unsubscribe(void *user, VNodeID node_id)
-{
- VSNodeObject *node;
- node = (VSNodeObject *)vs_get_node(node_id);
- if(node == NULL)
- return;
- vs_remove_subscriptor(node->head.subscribers);
-}
-
-void vs_o_callback_init(void)
-{
-}
-*/
-#endif
diff --git a/extern/verse/dist/vs_node_storage.c b/extern/verse/dist/vs_node_storage.c
deleted file mode 100644
index 480ceb1f900..00000000000
--- a/extern/verse/dist/vs_node_storage.c
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
-**
-*/
-
-#include
-#include
-#include "v_cmd_gen.h"
-
-#if !defined V_GENERATE_FUNC_MODE
-
-#include "verse.h"
-#include "vs_server.h"
-
-#define VS_NODE_STORAGE_CHUNK_SIZE 16
-
-static struct {
- VSNodeHead **nodes;
- unsigned int node_length;
- unsigned int node_allocated;
- VSSubscriptionList *list[V_NT_NUM_TYPES];
-} VSNodeStorage;
-
-extern void callback_send_tag_group_create(void *user, VNodeID node_id, uint16 group_id, const char *name);
-
-void vs_init_node_storage(void)
-{
- unsigned int i;
- VSNodeStorage.nodes = malloc((sizeof *VSNodeStorage.nodes) * VS_NODE_STORAGE_CHUNK_SIZE);
- VSNodeStorage.nodes[0] = NULL;
- VSNodeStorage.node_length = 0;
- VSNodeStorage.node_allocated = VS_NODE_STORAGE_CHUNK_SIZE;
- for(i = 0; i < V_NT_NUM_TYPES; i++)
- VSNodeStorage.list[i] = vs_create_subscription_list();
-}
-
-unsigned int vs_add_new_node(VSNodeHead *node, VNodeType type)
-{
- unsigned int i, j;
- for(i = 0; i < VSNodeStorage.node_length && VSNodeStorage.nodes[i] != NULL; i++);
- if(i >= VSNodeStorage.node_allocated)
- {
- j = VSNodeStorage.node_allocated;
- VSNodeStorage.node_allocated += VS_NODE_STORAGE_CHUNK_SIZE;
- VSNodeStorage.nodes = realloc(VSNodeStorage.nodes, (sizeof *VSNodeStorage.nodes) * VSNodeStorage.node_allocated);
- while(j < VSNodeStorage.node_allocated)
- VSNodeStorage.nodes[j++] = NULL;
- }
- VSNodeStorage.nodes[i] = node;
- if(i >= VSNodeStorage.node_length)
- VSNodeStorage.node_length = i + 1;
- node->id = i;
- node->type = type;
-
- return node->id;
-}
-
-VSNodeHead *vs_get_node(unsigned int node_id, VNodeType type)
-{
- if(VSNodeStorage.node_length > node_id)
- {
- VSNodeHead *node = VSNodeStorage.nodes[node_id];
-
- if(node != NULL && node->type == type)
- return node;
- }
- return NULL;
-}
-
-VSNodeHead *vs_get_node_head(unsigned int node_id)
-{
- if(VSNodeStorage.node_length > node_id)
- return VSNodeStorage.nodes[node_id];
- return NULL;
-}
-
-extern VSNodeHead *vs_o_create_node(unsigned int owner);
-extern VSNodeHead *vs_g_create_node(unsigned int owner);
-extern VSNodeHead *vs_m_create_node(unsigned int owner);
-extern VSNodeHead *vs_b_create_node(unsigned int owner);
-extern VSNodeHead *vs_t_create_node(unsigned int owner);
-extern VSNodeHead *vs_c_create_node(unsigned int owner);
-extern VSNodeHead *vs_p_create_node(unsigned int owner);
-extern VSNodeHead *vs_a_create_node(unsigned int owner);
-
-extern void vs_o_destroy_node(VSNodeHead *node);
-extern void vs_g_destroy_node(VSNodeHead *node);
-extern void vs_m_destroy_node(VSNodeHead *node);
-extern void vs_b_destroy_node(VSNodeHead *node);
-extern void vs_t_destroy_node(VSNodeHead *node);
-extern void vs_c_destroy_node(VSNodeHead *node);
-extern void vs_p_destroy_node(VSNodeHead *node);
-extern void vs_a_destroy_node(VSNodeHead *node);
-
-
-VNodeID vs_node_create(VNodeID owner_id, unsigned int type)
-{
- unsigned int count, i;
- VSNodeHead *node;
- VNodeID node_id;
-
- printf("vs_node_create(%u, %u)\n", owner_id, type);
- switch(type)
- {
- case V_NT_OBJECT :
- node = vs_o_create_node(owner_id);
- break;
- case V_NT_GEOMETRY :
- node = vs_g_create_node(owner_id);
- break;
- case V_NT_MATERIAL :
- node = vs_m_create_node(owner_id);
- break;
- case V_NT_BITMAP :
- node = vs_b_create_node(owner_id);
- break;
- case V_NT_TEXT :
- node = vs_t_create_node(owner_id);
- break;
- case V_NT_CURVE :
- node = vs_c_create_node(owner_id);
- break;
- case V_NT_AUDIO :
- node = vs_a_create_node(owner_id);
- break;
- default:
- fprintf(stderr, "Can't create node of unknown type %u\n", type);
- return 0U;
- }
- node_id = node->id;
-
- count = vs_get_subscript_count(VSNodeStorage.list[type]);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(VSNodeStorage.list[type], i);
- if(owner_id != verse_session_get_avatar())
- verse_send_node_create(node_id, type, VN_OWNER_OTHER);
- else
- verse_send_node_create(node_id, type, VN_OWNER_MINE);
- }
- if(count != 0)
- vs_reset_subscript_session();
- return node_id;
-}
-
-/* Initialize an object node into being an avatar. */
-void vs_avatar_init(VNodeID id, const char *name)
-{
- callback_send_tag_group_create(NULL, id, (short) ~0u, "avatar");
- /* FIXME: Populate the group, too. */
-}
-
-void vs_reset_owner(VNodeID owner_id)
-{
- unsigned int i;
-
- for(i = 0; i < VSNodeStorage.node_length; i++)
- if(VSNodeStorage.nodes[i] != NULL)
- if(VSNodeStorage.nodes[i]->owner == owner_id)
- VSNodeStorage.nodes[i]->owner = ~0;
-}
-
-static void callback_send_node_create(void *user_data, VNodeID node_id, uint8 type, VNodeOwner owner_id)
-{
- vs_node_create(vs_get_avatar(), type);
-}
-
-void callback_send_node_destroy(void *user_data, VNodeID node_id)
-{
- unsigned int count, i;
- VSNodeHead *node;
- VNodeType type;
- node = vs_get_node_head(node_id);
- if(node == NULL)
- return;
- VSNodeStorage.nodes[node_id] = NULL;
- type = node->type;
- switch(type)
- {
- case V_NT_OBJECT :
- vs_o_destroy_node(node);
- break;
- case V_NT_GEOMETRY :
- vs_g_destroy_node(node);
- break;
- case V_NT_MATERIAL :
- vs_m_destroy_node(node);
- break;
- case V_NT_BITMAP :
- vs_b_destroy_node(node);
- break;
- case V_NT_TEXT :
- vs_t_destroy_node(node);
- break;
- case V_NT_CURVE :
- vs_c_destroy_node(node);
- break;
- case V_NT_AUDIO :
- vs_c_destroy_node(node);
- break;
- default:
- fprintf(stderr, __FILE__ " Can't handle node_destroy for type %d--not implemented", type);
- return;
- }
- count = vs_get_subscript_count(VSNodeStorage.list[type]);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(VSNodeStorage.list[type], i);
- verse_send_node_destroy(node_id);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_node_index_subscribe(void *user_data, uint32 mask)
-{
- unsigned int i, j, pow = 1;
-
- for(i = 0; i < V_NT_NUM_TYPES; i++, pow <<= 1)
- {
- if((mask & pow) != 0)
- {
- for(j = 0; j < VSNodeStorage.node_length; j++)
- {
- if(VSNodeStorage.nodes[j] != NULL && VSNodeStorage.nodes[j]->type == (VNodeType)i)
- {
- if(VSNodeStorage.nodes[j]->owner == verse_session_get_avatar())
- verse_send_node_create(VSNodeStorage.nodes[j]->id, i, VN_OWNER_MINE);
- else
- verse_send_node_create(VSNodeStorage.nodes[j]->id, i, VN_OWNER_OTHER);
- }
- }
- vs_add_new_subscriptor(VSNodeStorage.list[i]);
- }
- else
- vs_remove_subscriptor(VSNodeStorage.list[i]);
- }
-}
-
-void init_callback_node_storage(void)
-{
- verse_callback_set(verse_send_node_index_subscribe, callback_send_node_index_subscribe, NULL);
- verse_callback_set(verse_send_node_create, callback_send_node_create, NULL);
- verse_callback_set(verse_send_node_destroy, callback_send_node_destroy, NULL);
-}
-
-#endif
diff --git a/extern/verse/dist/vs_node_text.c b/extern/verse/dist/vs_node_text.c
deleted file mode 100644
index ae7c3c737c3..00000000000
--- a/extern/verse/dist/vs_node_text.c
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
-**
-*/
-
-#include
-#include
-#include
-
-#include "v_cmd_gen.h"
-
-#if !defined V_GENERATE_FUNC_MODE
-
-#include "verse.h"
-#include "vs_server.h"
-
-#define VS_TEXT_CHUNK_SIZE 4096
-
-typedef struct {
- char name[16];
- char *text;
- size_t length;
- size_t allocated;
- VSSubscriptionList *subscribers;
-} VSTextBuffer;
-
-typedef struct {
- VSNodeHead head;
- char language[512];
- VSTextBuffer *buffer;
- unsigned int buffer_count;
-} VSNodeText;
-
-VSNodeText * vs_t_create_node(unsigned int owner)
-{
- VSNodeText *node;
- char name[48];
- unsigned int i;
- node = malloc(sizeof *node);
- vs_add_new_node(&node->head, V_NT_TEXT);
- sprintf(name, "Text_Node_%u", node->head.id);
- create_node_head(&node->head, name, owner);
- node->language[0] = 0;
- node->buffer_count = 16;
- node->buffer = malloc((sizeof *node->buffer) * node->buffer_count);
- for(i = 0; i < node->buffer_count; i++)
- node->buffer[i].name[0] = 0;
-
- return node;
-}
-
-void vs_t_destroy_node(VSNodeText *node)
-{
- unsigned int i;
- destroy_node_head(&node->head);
- for(i = 0; i < node->buffer_count; i++)
- {
- if(node->buffer[i].name[0] != 0)
- {
- free(node->buffer[i].text);
- vs_destroy_subscription_list(node->buffer[i].subscribers);
- }
- }
- free(node->buffer);
- free(node);
-}
-
-void vs_t_subscribe(VSNodeText *node)
-{
- unsigned int i;
- verse_send_t_language_set(node->head.id, node->language);
- for(i = 0; i < node->buffer_count; i++)
- if(node->buffer[i].name[0] != 0)
- verse_send_t_buffer_create(node->head.id, i, node->buffer[i].name);
-}
-
-void vs_t_unsubscribe(VSNodeText *node)
-{
- unsigned int i;
- for(i = 0; i < node->buffer_count; i++)
- if(node->buffer[i].name[0] != 0)
- vs_remove_subscriptor(node->buffer[i].subscribers);
-}
-
-static void callback_send_t_language_set(void *user, VNodeID node_id, char *language)
-{
- VSNodeText *node;
- unsigned int i, count;
- node = (VSNodeText *)vs_get_node(node_id, V_NT_TEXT);
- if(node == NULL)
- return;
- for(i = 0; i < 511 && language[i]; i++)
- node->language[i] = language[i];
- node->language[i] = 0;
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_t_language_set(node_id, language);
- }
- vs_reset_subscript_session();
-
-}
-
-static void callback_send_t_buffer_create(void *user, VNodeID node_id, VBufferID buffer_id, const char *name)
-{
- VSNodeText *node;
- unsigned int i, count;
- node = (VSNodeText *)vs_get_node(node_id, V_NT_TEXT);
- if(node == NULL)
- return;
-
- if(buffer_id >= node->buffer_count || node->buffer[buffer_id].name[0] != 0)
- {
- for(buffer_id = 0; buffer_id < node->buffer_count && node->buffer[buffer_id].name[0] != 0; buffer_id++)
- ;
- if(buffer_id == node->buffer_count)
- {
- node->buffer = realloc(node->buffer, (sizeof *node->buffer) * node->buffer_count);
- for(i = node->buffer_count; i < node->buffer_count + 16; i++)
- node->buffer[i].name[0] = 0;
- node->buffer_count = i;
- }
- }
-
- if(node->buffer[buffer_id].name[0] == 0)
- {
- node->buffer[buffer_id].allocated = VS_TEXT_CHUNK_SIZE;
- node->buffer[buffer_id].text = malloc(node->buffer[buffer_id].allocated);
- node->buffer[buffer_id].length = 0;
- node->buffer[buffer_id].subscribers = vs_create_subscription_list();
- }
- for(i = 0; i < 15 && name[i] != 0; i++)
- node->buffer[buffer_id].name[i] = name[i];
- node->buffer[buffer_id].name[i] = 0;
-
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_t_buffer_create(node_id, buffer_id, name);
- }
- vs_reset_subscript_session();
-}
-
-void callback_send_t_buffer_destroy(void *user, VNodeID node_id, VBufferID buffer_id)
-{
- VSNodeText *node;
- unsigned int i, count;
- node = (VSNodeText *)vs_get_node(node_id, V_NT_TEXT);
- if(node == NULL)
- return;
-
- if(buffer_id >= node->buffer_count || node->buffer[buffer_id].name[0] == 0)
- return;
-
- node->buffer[buffer_id].name[0] = 0;
- free(node->buffer[buffer_id].text);
- vs_destroy_subscription_list(node->buffer[buffer_id].subscribers);
-
- count = vs_get_subscript_count(node->head.subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(node->head.subscribers, i);
- verse_send_t_buffer_destroy(node_id, buffer_id);
- }
- vs_reset_subscript_session();
-}
-
-static void callback_send_t_buffer_subscribe(void *user, VNodeID node_id, VBufferID buffer_id)
-{
- VSNodeText *node;
- unsigned int i;
-
- node = (VSNodeText *)vs_get_node(node_id, V_NT_TEXT);
- if(node == NULL)
- return;
- if(buffer_id >= node->buffer_count || node->buffer[buffer_id].name[0] == 0)
- return;
- if(vs_add_new_subscriptor(node->buffer[buffer_id].subscribers) == 0)
- return;
- for(i = 0; i < node->buffer[buffer_id].length; i += VN_T_MAX_TEXT_CMD_SIZE)
- {
- if(i + VN_T_MAX_TEXT_CMD_SIZE > node->buffer[buffer_id].length)
- verse_send_t_text_set(node_id, buffer_id, i, node->buffer[buffer_id].length - i, &node->buffer[buffer_id].text[i]);
- else
- verse_send_t_text_set(node_id, buffer_id, i, VN_T_MAX_TEXT_CMD_SIZE, &node->buffer[buffer_id].text[i]);
- }
-}
-
-static void callback_send_t_buffer_unsubscribe(void *user, VNodeID node_id, VBufferID buffer_id)
-{
- VSNodeText *node;
- node = (VSNodeText *)vs_get_node(node_id, V_NT_TEXT);
- if(node == NULL)
- return;
- if(buffer_id >= node->buffer_count || node->buffer[buffer_id].name[0] == 0)
- return;
- vs_remove_subscriptor(node->buffer[buffer_id].subscribers);
-}
-
-static void callback_send_t_text_set(void *user, VNodeID node_id, VBufferID buffer_id, uint32 pos, uint32 length, const char *text)
-{
- VSNodeText *node;
- VSTextBuffer *tb;
- unsigned int i, count, text_length;
- char *buf;
-
- node = (VSNodeText *) vs_get_node(node_id, V_NT_TEXT);
- if(node == NULL)
- return;
- if(buffer_id >= node->buffer_count || node->buffer[buffer_id].name[0] == 0)
- return;
- tb = &node->buffer[buffer_id];
-
- text_length = strlen(text);
-
- /* Clamp position and length of deleted region. */
- if(pos > tb->length)
- pos = tb->length;
- if(pos + length > tb->length)
- length = tb->length - pos;
-
- buf = tb->text;
-
- if(tb->length + text_length - length > tb->allocated)
- {
- buf = realloc(buf, tb->length + text_length - length + VS_TEXT_CHUNK_SIZE);
- tb->allocated = tb->length + text_length - length + VS_TEXT_CHUNK_SIZE;
- }
-
- if(text_length < length) /* Insert smaller than delete? */
- {
- memmove(buf + pos + text_length, buf + pos + length, tb->length - (pos + length));
- memcpy(buf + pos, text, text_length);
- }
- else /* Insert is larger than delete. */
- {
- memmove(buf + pos + text_length, buf + pos + length, tb->length - pos);
- memcpy(buf + pos, text, text_length);
- }
-
- tb->length += (int) text_length - length;
- buf[tb->length] = '\0';
-
- /* Buffer very much larger than content? Then shrink it. */
- if(tb->allocated > VS_TEXT_CHUNK_SIZE * 8 && tb->allocated * 2 > tb->length)
- {
- buf = realloc(buf, tb->length + VS_TEXT_CHUNK_SIZE);
- tb->allocated = tb->length + VS_TEXT_CHUNK_SIZE;
- }
-
- tb->text = buf;
-
- count = vs_get_subscript_count(tb->subscribers);
- for(i = 0; i < count; i++)
- {
- vs_set_subscript_session(tb->subscribers, i);
- verse_send_t_text_set(node_id, buffer_id, pos, length, text);
- }
- vs_reset_subscript_session();
-}
-
-
-void vs_t_callback_init(void)
-{
- verse_callback_set(verse_send_t_language_set, callback_send_t_language_set, NULL);
- verse_callback_set(verse_send_t_buffer_create, callback_send_t_buffer_create, NULL);
- verse_callback_set(verse_send_t_buffer_destroy, callback_send_t_buffer_destroy, NULL);
- verse_callback_set(verse_send_t_buffer_subscribe, callback_send_t_buffer_subscribe, NULL);
- verse_callback_set(verse_send_t_buffer_unsubscribe, callback_send_t_buffer_unsubscribe, NULL);
- verse_callback_set(verse_send_t_text_set, callback_send_t_text_set, NULL);
-}
-
-#endif
diff --git a/extern/verse/dist/vs_server.h b/extern/verse/dist/vs_server.h
deleted file mode 100644
index 76e1b482eb9..00000000000
--- a/extern/verse/dist/vs_server.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-**
-*/
-
-#include
-
-extern void vs_init_connection_storage(void);
-extern void vs_add_new_connection(VSession session, const char *name, const char *pass, VNodeID node_id);
-extern void vs_remove_connection(void);
-extern void vs_set_next_session(void);
-
-typedef void VSSubscriptionList;
-
-extern VSSubscriptionList * vs_create_subscription_list(void);
-extern void vs_destroy_subscription_list(VSSubscriptionList *list);
-extern int vs_add_new_subscriptor(VSSubscriptionList *list);
-extern void vs_remove_subscriptor(VSSubscriptionList *list);
-extern unsigned int vs_get_subscript_count(const VSSubscriptionList *list);
-extern void vs_set_subscript_session(VSSubscriptionList *list, unsigned int session);
-extern void vs_reset_subscript_session(void);
-extern uint32 vs_get_avatar(void);
-extern VSession vs_get_session(void);
-extern const char * vs_get_user_name(void);
-extern const char * vs_get_user_pass(void);
-
-
-typedef struct {
- VNodeID id;
- VNodeType type;
- VNodeID owner;
- char *name;
- void *tag_groups;
- uint16 group_count;
- VSSubscriptionList *subscribers;
-} VSNodeHead;
-
-extern void vs_init_node_storage(void);
-extern uint32 vs_add_new_node(VSNodeHead *node, VNodeType type);
-extern VSNodeHead * vs_get_node(unsigned int node_id, VNodeType type);
-extern VSNodeHead * vs_get_node_head(unsigned int node_id);
-
-extern void create_node_head(VSNodeHead *node, const char *name, unsigned int owner);
-extern void destroy_node_head(VSNodeHead *node);
-extern void vs_send_node_head(VSNodeHead *node);
-
-extern void vs_h_callback_init(void); /* "Head", not an actual node type. */
-extern void vs_o_callback_init(void);
-extern void vs_g_callback_init(void);
-extern void vs_m_callback_init(void);
-extern void vs_b_callback_init(void);
-extern void vs_t_callback_init(void);
-extern void vs_c_callback_init(void);
-extern void vs_a_callback_init(void);
-extern void init_callback_node_storage(void);
-
-extern void vs_master_set_enabled(boolean enabled);
-extern void vs_master_set_address(const char *address);
-extern const char * vs_master_get_address(void);
-extern void vs_master_set_desc(const char *desc);
-extern void vs_master_set_tags(const char *tags);
-extern void vs_master_update(void);
-extern void vs_master_handle_describe(const char *address, const char *message);
diff --git a/extern/verse/make/msvc_7_0/libverse.vcproj b/extern/verse/make/msvc_7_0/libverse.vcproj
deleted file mode 100644
index 1c9bfbfce33..00000000000
--- a/extern/verse/make/msvc_7_0/libverse.vcproj
+++ /dev/null
@@ -1,279 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extern/verse/make/msvc_7_0/verse.vcproj b/extern/verse/make/msvc_7_0/verse.vcproj
deleted file mode 100644
index 563e33e7be9..00000000000
--- a/extern/verse/make/msvc_7_0/verse.vcproj
+++ /dev/null
@@ -1,481 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extern/verse/make/msvc_9_0/libverse.vcproj b/extern/verse/make/msvc_9_0/libverse.vcproj
deleted file mode 100644
index cbe236d5b55..00000000000
--- a/extern/verse/make/msvc_9_0/libverse.vcproj
+++ /dev/null
@@ -1,368 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extern/verse/make/msvc_9_0/verse.vcproj b/extern/verse/make/msvc_9_0/verse.vcproj
deleted file mode 100644
index 39363156181..00000000000
--- a/extern/verse/make/msvc_9_0/verse.vcproj
+++ /dev/null
@@ -1,669 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/source/Makefile b/source/Makefile
index 85fbc364ce1..7f02ab5cb44 100644
--- a/source/Makefile
+++ b/source/Makefile
@@ -200,18 +200,6 @@ ifeq ($(WITH_FREETYPE2), true)
endif
endif
-ifeq ($(WITH_VERSE), true)
- ifeq ($(OS), windows)
- ifeq ($(FREE_WINDOWS), true)
- COMLIB += $(NAN_VERSE)/lib/libverse.a
- else
- COMLIB += $(NAN_VERSE)/lib/verse.lib
- endif
- else
- COMLIB += $(NAN_VERSE)/lib/libverse.a
- endif
-endif
-
ifeq ($(OS), irix)
COMLIB += $(NAN_SDL)/lib/libSDL.a
endif
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h
index 60d7c09c7a3..3e03ac3fb9f 100644
--- a/source/blender/blenkernel/BKE_DerivedMesh.h
+++ b/source/blender/blenkernel/BKE_DerivedMesh.h
@@ -83,7 +83,7 @@ struct DerivedMesh {
/* copy a single vert/edge/face from the derived mesh into
* *{vert/edge/face}_r. note that the current implementation
* of this function can be quite slow, iterating over all
- * elements (editmesh, verse mesh)
+ * elements (editmesh)
*/
void (*getVert)(DerivedMesh *dm, int index, struct MVert *vert_r);
void (*getEdge)(DerivedMesh *dm, int index, struct MEdge *edge_r);
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index 99ce091621e..1803e9ff7db 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -152,10 +152,7 @@ typedef struct Global {
#define G_DRAW_EDGEANG (1 << 24)
/* #define G_RECORDKEYS (1 << 25) also removed */
-/*#ifdef WITH_VERSE*/
-#define G_VERSE_CONNECTED (1 << 26)
-#define G_DRAW_VERSE_DEBUG (1 << 27)
-/*#endif*/
+
#define G_DRAWSHARP (1 << 28) /* draw edges with the sharp flag */
#define G_SCULPTMODE (1 << 29)
#define G_PARTICLEEDIT (1 << 30)
diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h
index b0cf58d8216..d1bcd63c936 100644
--- a/source/blender/blenkernel/BKE_image.h
+++ b/source/blender/blenkernel/BKE_image.h
@@ -82,7 +82,6 @@ struct RenderResult;
#define IMA_TYPE_MULTILAYER 1
/* generated */
#define IMA_TYPE_UV_TEST 2
-#define IMA_TYPE_VERSE 3
/* viewers */
#define IMA_TYPE_R_RESULT 4
#define IMA_TYPE_COMPOSITE 5
diff --git a/source/blender/blenkernel/BKE_verse.h b/source/blender/blenkernel/BKE_verse.h
deleted file mode 100644
index e67696dc62a..00000000000
--- a/source/blender/blenkernel/BKE_verse.h
+++ /dev/null
@@ -1,583 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Contributor(s): Jiri Hnidek.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/* #define WITH_VERSE */
-
-#ifndef BKE_VERSE_H
-#define BKE_VERSE_H
-
-#include "DNA_listBase.h"
-#include "BLI_dynamiclist.h"
-
-#include "verse.h"
-#include "verse_ms.h"
-
-struct VNode;
-struct VerseEdge;
-
-/*
- * Verse Edge Hash (similar to edit edge hash)
- */
-#define VEDHASHSIZE (512*512)
-#define VEDHASH(a, b) ((a1 is 3D bitmap */
- /* blender internals */
- uint16 t_width; /* = (width/VN_B_TILE_SIZE + 1)*VN_B_TILE_SIZE */
- uint16 t_height; /* = (height/VN_B_TILE_SIZE + 1)*VN_B_TILE_SIZE */
- void *image; /* pointer at image */
- /* client dependent methods */
- void (*post_bitmap_dimension_set)(struct VNode *vnode);
- void (*post_bitmap_layer_create)(struct VBitmapLayer *vblayer);
- void (*post_bitmap_layer_destroy)(struct VBitmapLayer *vblayer);
- void (*post_bitmap_tile_set)(struct VBitmapLayer *vblayer, unsigned int xs, unsigned int ys);
-}VBitmapData;
-
-/*
- * data of geometry node
- */
-typedef struct VGeomData {
- struct DynamicList layers; /* dynamic list with access array of Layers */
- struct VLink *vlink; /* pointer at VerseLink connecting object node and geom node */
- struct ListBase queue; /* queue of our layers waiting for receiving from verse server */
- void *mesh; /* pointer at Mesh (object node) */
- void *editmesh; /* pointer at EditMesh (edit mode) */
- struct HashVerseEdge *hash; /* verse edge hash */
- struct ListBase edges; /* list of fake verse edges */
- /* client dependent methods */
- void (*post_vertex_create)(struct VerseVert *vvert);
- void (*post_vertex_set_xyz)(struct VerseVert *vvert);
- void (*post_vertex_delete)(struct VerseVert *vvert);
- void (*post_vertex_free_constraint)(struct VerseVert *vvert);
- void (*post_polygon_create)(struct VerseFace *vface);
- void (*post_polygon_set_corner)(struct VerseFace *vface);
- void (*post_polygon_delete)(struct VerseFace *vface);
- void (*post_polygon_free_constraint)(struct VerseFace *vface);
- void (*post_geometry_free_constraint)(struct VNode *vnode);
- void (*post_polygon_set_uint8)(struct VerseFace *vface);
-} VGeomData;
-
-/*
- * data of object node
- */
-typedef struct VObjectData {
- struct DynamicList links; /* dynamic list with access array of links between other nodes */
- struct ListBase queue; /* queue of links waiting for sending and receiving from verse server */
- float pos[3]; /* position of object VerseNode */
- float quat[4]; /* rotation of object VerseNode stored in quat */
- float scale[3]; /* scale of object VerseNode */
- void *object; /* pointer at object */
- short flag; /* flag: POS_RECEIVE_READY, ROT_RECEIVE_READY. SCALE_RECEIVE_READY */
- /* client dependent methods */
-/* void (*post_transform)(struct VNode *vnode);*/
- void (*post_transform_pos)(struct VNode *vnode);
- void (*post_transform_rot)(struct VNode *vnode);
- void (*post_transform_scale)(struct VNode *vnode);
- void (*post_object_free_constraint)(struct VNode *vnode);
-} VObjectData;
-
-/*
- * Verse Tag
- */
-typedef struct VTag {
- struct VTag *next, *prev;
- /* verse data*/
- struct VTagGroup *vtaggroup; /* pointer at Verse Tag Group */
- uint16 id; /* id of this tag */
- char *name; /* name of this tag*/
- VNTagType type; /* type: VN_TAG_BOOLEAN, VN_TAG_UINT32, VN_TAG_REAL64, VN_TAG_REAL64_VEC3,
- VN_TAG_LINK, VN_TAG_ANIMATION, VN_TAG_BLOB */
- VNTag *tag; /* pointer at value (enum: vboolean, vuint32, vreal64, vstring,
- vreal64_vec3, vlink, vanimation, vblob)*/
- /* blender internals */
- void *value; /* pointer at blender value */
-} VTag;
-
-/*
- * Verse Tag Group (verse tags are grouped in tag groups)
- */
-typedef struct VTagGroup {
- struct VTagGroup *next, *prev;
- /* verse data*/
- struct VNode *vnode; /* pointer at Verse Node */
- uint16 id; /* id of this tag group */
- char *name; /* name of this tag group */
- /* blender internals */
- struct DynamicList tags; /* dynamic list with access array containing tags */
- struct ListBase queue; /* list of tags waiting for receiving from verse server */
- /* client dependent methods */
- void (*post_tag_change)(struct VTag *vatg);
- void (*post_taggroup_create)(struct VTagGroup *vtaggroup);
-} VTagGroup;
-
- /*
- * Verse Method Group
- */
-typedef struct VMethodGroup
-{
- struct VMethodGroup *next, *prev;
- uint16 group_id;
- char name[16];
- struct ListBase methods;
-} VMethodGroup;
-
-/*
- * Verse Method
- */
-typedef struct VMethod
-{
- struct VMethod *next, *prev;
- uint16 id;
- char name[500];
- uint8 param_count;
- VNOParamType *param_type;
- char **param_name;
-} VMethod;
-
-/*
- * Verse Node
- */
-typedef struct VNode {
- struct VNode *next, *prev;
- /* verse data*/
- struct VerseSession *session; /* session pointer */
- VNodeID id; /* node id */
- VNodeID owner_id; /* owner's id of this node */
- char *name; /* name of this node */
- uint32 type; /* type of node (V_NT_OBJECT, V_NT_GEOMETRY, V_NT_BITMAP) */
- /* blender internals */
- char flag; /* flags: NODE_SENT, NODE_RECEIVED, NODE_DELTED, NODE_OBSOLETE */
- struct DynamicList taggroups; /* dynamic list with access array of taggroups */
- struct ListBase methodgroups; /* method groups */
- struct ListBase queue; /* list of taggroups waiting for receiving from verse server */
- void *data; /* generic pointer at some data (VObjectData, VGeomData, ...) */
- int counter; /* counter of verse link pointing at this vnode (vlink->target) */
- /* client dependent methods */
- void (*post_node_create)(struct VNode *vnode);
- void (*post_node_destroy)(struct VNode *vnode);
- void (*post_node_name_set)(struct VNode *vnode);
-#ifdef VERSECHAT
- /* verse chat */
- int chat_flag; /* CHAT_LOGGED, CHAT_NOTLOGGED */
-#endif
-} VNode;
-
-
-/*
- * Verse Session: verse client can be connected to several verse servers
- * it is neccessary to store some information about each session
- */
-typedef struct VerseSession {
- struct VerseSession *next, *prev;
- /* verse data */
- VSession *vsession; /* pointer at VSeesion (verse.h) */
- uint32 avatar; /* id of avatar */
- char *address; /* string containg IP/domain name of verse server and number of port */
- void *connection; /* no clue */
- uint8 *host_id; /* no clue */
- /* blender internals */
- short flag; /* flag: VERSE_CONNECTING, VERSE_CONNECTED */
- DynamicList nodes; /* list of verse nodes */
- ListBase queue; /* list of nodes waiting for sending to verse server */
- unsigned int counter; /* count of events, when connection wasn't accepted */
- /* client dependent methods */
- void (*post_connect_accept)(struct VerseSession *session);
- void (*post_connect_terminated)(struct VerseSession *session);
- void (*post_connect_update)(struct VerseSession *session);
-} VerseSession;
-
-typedef struct VerseServer {
- struct VerseServer *next, *prev;
- char *name; /* human-readable server name */
- char *ip; /* string containing IP/domain name of verse server and number of port */
- short flag; /* flag: VERSE_CONNECTING, VERSE_CONNECTED */
- struct VerseSession *session; /* pointer to related session */
-} VerseServer;
-/*
- * list of post callback functions
- */
-typedef struct PostCallbackFunction {
- void (*function)(void *arg);
- void *param;
-} PostCallbackFunction;
-
-/* VerseSession->flag */
-#define VERSE_CONNECTING 1
-#define VERSE_CONNECTED 2
-#define VERSE_AUTOSUBSCRIBE 4
-
-/* max VerseSession->counter value */
-#define MAX_UNCONNECTED_EVENTS 100
-
-/* VNode flags */
-#define NODE_SENT 1
-#define NODE_RECEIVED 2
-#define NODE_DELTED 4
-#define NODE_OBSOLETE 8
-
-#ifdef VERSECHAT
-#define CHAT_NOTLOGGED 0
-#define CHAT_LOGGED 1
-#endif
-
-/* VLayer flags */
-#define LAYER_SENT 1
-#define LAYER_RECEIVED 2
-#define LAYER_DELETED 4
-#define LAYER_OBSOLETE 8
-
-/* VLink->flag */
-#define LINK_SEND_READY 1
-
-/* VObjectData->flag */
-#define POS_RECEIVE_READY 1
-#define ROT_RECEIVE_READY 2
-#define SCALE_RECEIVE_READY 4
-#define POS_SEND_READY 8
-#define ROT_SEND_READY 16
-#define SCALE_SEND_READY 32
-
-/* VLayer->content */
-#define VERTEX_LAYER 0
-#define POLYGON_LAYER 1
-
-/* VerseVert->flag */
-#define VERT_DELETED 1 /* vertex delete command was received from verse server */
-#define VERT_RECEIVED 2 /* VerseVert was received from verse server (is not in sending queue) */
-#define VERT_LOCKED 4 /* VerseVert is ready to send local position to verse server */
-#define VERT_POS_OBSOLETE 8 /* position of vertex was changed during sending to verse server */
-#define VERT_OBSOLETE 16 /* vertex delete command was sent to verse server; it means, that
- * no information related to this vertex shoudln't be sent to verse
- * until verse vertex is completely deleted ... then this vertex id
- * can be reused again for new vertex */
-
-/* VerseFace->flag */
-#define FACE_SEND_READY 1 /* VerseFace is ready for sending to verse server */
-#define FACE_RECEIVED 2 /* VerseFace was received from verse server */
-#define FACE_SENT 4 /* VerseFace was sent to verse server and we expect receiving from verse server */
-#define FACE_DELETED 8 /* delete command was sent to verse server */
-#define FACE_CHANGED 16 /* VerseFace was only changed not created */
-#define FACE_OBSOLETE 32 /* VerseFace was changed during sending to verse server */
-
-/* Queue type */
-#define VERSE_NODE 1
-#define VERSE_LINK 2
-#define VERSE_LAYER 3
-#define VERSE_VERT 4
-#define VERSE_FACE 5
-
-#define VERSE_TAG 6
-#define VERSE_TAG_GROUP 7
-
-#define VERSE_VERT_UINT32 8
-#define VERSE_VERT_REAL32 9
-#define VERSE_VERT_VEC_REAL32 10
-
-#define VERSE_FACE_UINT8 11
-#define VERSE_FACE_UINT32 12
-#define VERSE_FACE_REAL32 13
-#define VERSE_FACE_QUAT_UINT32 14
-#define VERSE_FACE_QUAT_REAL32 15
-
-/* Verse Bitmap Layer flags */
-#define VBLAYER_SUBSCRIBED 1
-
-/* function prototypes */
-
-/* functions from verse_session.c */
-void set_verse_session_callbacks(void);
-struct VerseSession *versesession_from_vsession(VSession *vsession);
-struct VerseSession *current_verse_session(void);
-struct VerseSession *create_verse_session(const char *name, const char *pass, const char *address, uint8 *expected_key);
-void free_verse_session(struct VerseSession *session);
-void b_verse_update(void);
-void b_verse_ms_get(void);
-void b_verse_connect(char *address);
-void end_verse_session(struct VerseSession *session);
-void end_all_verse_sessions(void);
-
-/* functions from verse_node.c */
-void send_verse_tag(struct VTag *vtag);
-void send_verse_taggroup(struct VTagGroup *vtaggroup);
-void send_verse_node(struct VNode *vnode);
-void free_verse_node_data(struct VNode *vnode);
-void free_verse_node(struct VNode *vnode);
-struct VNode* lookup_vnode(VerseSession *session, VNodeID node_id);
-struct VNode* create_verse_node(VerseSession *session, VNodeID node_id, uint8 type, VNodeID owner_id);
-void set_node_callbacks(void);
-
-/* functions from verse_object_node.c */
-struct VLink *find_unsent_parent_vlink(struct VerseSession *session, struct VNode *vnode);
-struct VLink *find_unsent_child_vlink(struct VerseSession *session, struct VNode *vnode);
-struct VLink *create_verse_link(VerseSession *session, struct VNode *source, struct VNode *target, uint16 link_id, uint32 target_id, const char *label);
-void send_verse_object_position(struct VNode *vnode);
-void send_verse_object_rotation(struct VNode *vnode);
-void send_verse_object_scale(struct VNode *vnode);
-void send_verse_link(struct VLink *vlink);
-
-void free_object_data(struct VNode *vnode);
-void set_object_callbacks(void);
-struct VObjectData *create_object_data(void);
-
-
-/* functions from verse_method.c */
-void free_verse_methodgroup(VMethodGroup *vmg);
-#ifdef VERSECHAT
-void send_say(const char *chan, const char *utter);
-void send_login(struct VNode *vnode);
-void send_logout(struct VNode *vnode);
-void send_join(struct VNode *vnode, const char *chan);
-void send_leave(struct VNode *vnode, const char *chan);
-#endif
-void set_method_callbacks(void);
-
-/* functions from verse_geometry_node.c */
-struct VerseFace* create_verse_face(struct VLayer *vlayer, uint32 polygon_id, uint32 v0, uint32 v1, uint32 v2, uint32 v3);
-struct VerseVert* create_verse_vertex(struct VLayer *vlayer, uint32 vertex_id, real32 x, real32 y, real32 z);
-struct VLayer *create_verse_layer(struct VNode *vnode, VLayerID layer_id, const char *name, VNGLayerType type, uint32 def_integer, real64 def_real);
-struct VGeomData *create_geometry_data(void);
-
-void send_verse_layer(struct VLayer *vlayer);
-
-void send_verse_face_corner_quat_real32(struct quat_real32_item *item, short type);
-void send_verse_face_corner_quat_uint32(struct quat_uint32_item *item, short type);
-void send_verse_face_real32(struct real32_item *item, short type);
-void send_verse_face_uint32(struct uint32_item *item, short type);
-void send_verse_face_uint8(struct uint8_item *item, short type);
-
-void send_verse_vert_vec_real32(struct vec_real32_item *item, short type);
-void send_verse_vert_real32(struct real32_item *item, short type);
-void send_verse_vert_uint32(struct uint32_item *item, short type);
-
-void send_verse_vertex_delete(struct VerseVert *vvert);
-void send_verse_vertex(struct VerseVert *vvert);
-void send_verse_face_delete(struct VerseFace *vface);
-
-void destroy_geometry(struct VNode *vnode);
-
-struct VLayer* find_verse_layer_type(struct VGeomData *geom, short content);
-void add_item_to_send_queue(struct ListBase *lb, void *item, short type);
-void free_geom_data(struct VNode *vnode);
-void set_geometry_callbacks(void);
-
-/* functions prototypes from verse_bitmap.c */
-void set_bitmap_callbacks(void);
-void free_bitmap_layer_data(struct VBitmapLayer *vblayer);
-struct VBitmapLayer *create_bitmap_layer(struct VNode *vnode, VLayerID layer_id, const char *name, VNBLayerType type);
-void free_bitmap_node_data(struct VNode *vnode);
-struct VBitmapData *create_bitmap_data(void);
-
-#endif
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 0680827c548..8f11928e63f 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -37,11 +37,6 @@ SET(INC
${ZLIB_INC}
)
-IF(WITH_VERSE)
- ADD_DEFINITIONS(-DWITH_VERSE)
- SET(INC ${INC} ${VERSE_INC})
-ENDIF(WITH_VERSE)
-
IF(WITH_OPENEXR)
ADD_DEFINITIONS(-DWITH_OPENEXR)
ENDIF(WITH_OPENEXR)
@@ -72,10 +67,6 @@ ENDIF(WITH_PYTHON)
BLENDERLIB(bf_blenkernel "${SRC}" "${INC}")
-IF(WITH_VERSE)
- ADD_DEPENDENCIES(bf_blenkernel mkprot verse)
-ENDIF(WITH_VERSE)
-
IF(WITH_INTERNATIONAL)
ADD_DEFINITIONS(-DWITH_FREETYPE2)
ENDIF(WITH_INTERNATIONAL)
diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript
index 5d9ce532d89..9fef30381a8 100644
--- a/source/blender/blenkernel/SConscript
+++ b/source/blender/blenkernel/SConscript
@@ -31,13 +31,6 @@ if env['WITH_BF_SDL']:
if env['WITH_BF_INTERNATIONAL']:
defs += ' WITH_FREETYPE2'
-
-if env['WITH_BF_VERSE']:
- defs += ' WITH_VERSE'
- incs += ' ' + env['BF_VERSE_INCLUDE']
-
-if env['WITH_BF_VERSE']:
- defs += ' WITH_VERSE'
if env['WITH_BF_OPENEXR']:
defs += ' WITH_OPENEXR'
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 2aeef91538c..f056d1fa61b 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -80,10 +80,6 @@
#include "BLO_sys_types.h" // for intptr_t support
-#ifdef WITH_VERSE
-#include "BKE_verse.h"
-#endif
-
#include "BIF_gl.h"
#include "BIF_glutil.h"
@@ -1388,573 +1384,6 @@ static DerivedMesh *getEditMeshDerivedMesh(EditMesh *em, Object *ob,
return (DerivedMesh*) emdm;
}
-#ifdef WITH_VERSE
-
-/* verse derived mesh */
-typedef struct {
- struct DerivedMesh dm;
- struct VNode *vnode;
- struct VLayer *vertex_layer;
- struct VLayer *polygon_layer;
- struct ListBase *edges;
- float (*vertexCos)[3];
-} VDerivedMesh;
-
-/* this function set up border points of verse mesh bounding box */
-static void vDM_getMinMax(DerivedMesh *dm, float min_r[3], float max_r[3])
-{
- VDerivedMesh *vdm = (VDerivedMesh*)dm;
- struct VerseVert *vvert;
-
- if(!vdm->vertex_layer) return;
-
- vvert = (VerseVert*)vdm->vertex_layer->dl.lb.first;
-
- if(vdm->vertex_layer->dl.da.count > 0) {
- while(vvert) {
- DO_MINMAX(vdm->vertexCos ? vvert->cos : vvert->co, min_r, max_r);
- vvert = vvert->next;
- }
- }
- else {
- min_r[0] = min_r[1] = min_r[2] = max_r[0] = max_r[1] = max_r[2] = 0.0;
- }
-}
-
-/* this function return number of vertexes in vertex layer */
-static int vDM_getNumVerts(DerivedMesh *dm)
-{
- VDerivedMesh *vdm = (VDerivedMesh*)dm;
-
- if(!vdm->vertex_layer) return 0;
- else return vdm->vertex_layer->dl.da.count;
-}
-
-/* this function return number of 'fake' edges */
-static int vDM_getNumEdges(DerivedMesh *dm)
-{
- VDerivedMesh *vdm = (VDerivedMesh*)dm;
-
- return BLI_countlist(vdm->edges);
-}
-
-/* this function returns number of polygons in polygon layer */
-static int vDM_getNumFaces(DerivedMesh *dm)
-{
- VDerivedMesh *vdm = (VDerivedMesh*)dm;
-
- if(!vdm->polygon_layer) return 0;
- else return vdm->polygon_layer->dl.da.count;
-}
-
-/* this function doesn't return vertex with index of access array,
- * but it return 'indexth' vertex of dynamic list */
-void vDM_getVert(DerivedMesh *dm, int index, MVert *vert_r)
-{
- VDerivedMesh *vdm = (VDerivedMesh*)dm;
- struct VerseVert *vvert;
- int i;
-
- if(!vdm->vertex_layer) return;
-
- for(vvert = vdm->vertex_layer->dl.lb.first, i=0 ; inext;
-
- if(vvert) {
- VECCOPY(vert_r->co, vvert->co);
-
- vert_r->no[0] = vvert->no[0] * 32767.0;
- vert_r->no[1] = vvert->no[1] * 32767.0;
- vert_r->no[2] = vvert->no[2] * 32767.0;
-
- /* TODO what to do with vert_r->flag and vert_r->mat_nr? */
- vert_r->mat_nr = 0;
- vert_r->flag = 0;
- }
-}
-
-/* this function returns fake verse edge */
-void vDM_getEdge(DerivedMesh *dm, int index, MEdge *edge_r)
-{
- VDerivedMesh *vdm = (VDerivedMesh*)dm;
- struct VerseEdge *vedge;
- struct VLayer *vert_vlayer = vdm->vertex_layer;
- struct VerseVert *vvert;
- int j;
-
- if(!vdm->vertex_layer || !vdm->edges) return;
-
- if(vdm->edges->first) {
- struct VerseVert *vvert1, *vvert2;
-
- /* store vert indices in tmp union */
- for(vvert = vdm->vertex_layer->dl.lb.first, j = 0; vvert; vvert = vvert->next, j++)
- vvert->tmp.index = j;
-
- for(vedge = vdm->edges->first; vedge; vedge = vedge->next) {
- if(vedge->tmp.index==index) {
- vvert1 = BLI_dlist_find_link(&(vert_vlayer->dl), (unsigned int)vedge->v0);
- vvert2 = BLI_dlist_find_link(&(vert_vlayer->dl), (unsigned int)vedge->v1);
-
- if(vvert1 && vvert2) {
- edge_r->v1 = vvert1->tmp.index;
- edge_r->v2 = vvert2->tmp.index;
- }
- else {
- edge_r->v1 = 0;
- edge_r->v2 = 0;
- }
- /* not supported yet */
- edge_r->flag = 0;
- edge_r->crease = 0;
- edge_r->bweight = 0;
- break;
- }
- }
- }
-}
-
-/* this function doesn't return face with index of access array,
- * but it returns 'indexth' vertex of dynamic list */
-void vDM_getFace(DerivedMesh *dm, int index, MFace *face_r)
-{
- VDerivedMesh *vdm = (VDerivedMesh*)dm;
- struct VerseFace *vface;
- struct VerseVert *vvert;
- struct VerseVert *vvert0, *vvert1, *vvert2, *vvert3;
- int i;
-
- if(!vdm->vertex_layer || !vdm->polygon_layer) return;
-
- for(vface = vdm->polygon_layer->dl.lb.first, i = 0; i < index; ++i) vface = vface->next;
-
- face_r->mat_nr = 0;
- face_r->flag = 0;
-
- /* goddamn, we have to search all verts to find indices */
- vvert0 = vface->vvert0;
- vvert1 = vface->vvert1;
- vvert2 = vface->vvert2;
- vvert3 = vface->vvert3;
- if(!vvert3) face_r->v4 = 0;
-
- for(vvert = vdm->vertex_layer->dl.lb.first, i = 0; vvert0 || vvert1 || vvert2 || vvert3; i++, vvert = vvert->next) {
- if(vvert == vvert0) {
- face_r->v1 = i;
- vvert0 = NULL;
- }
- if(vvert == vvert1) {
- face_r->v2 = i;
- vvert1 = NULL;
- }
- if(vvert == vvert2) {
- face_r->v3 = i;
- vvert2 = NULL;
- }
- if(vvert == vvert3) {
- face_r->v4 = i;
- vvert3 = NULL;
- }
- }
-
- test_index_face(face_r, NULL, 0, vface->vvert3?4:3);
-}
-
-/* fill array of mvert */
-void vDM_copyVertArray(DerivedMesh *dm, MVert *vert_r)
-{
- VDerivedMesh *vdm = (VDerivedMesh*)dm;
- struct VerseVert *vvert;
-
- if(!vdm->vertex_layer) return;
-
- for(vvert = vdm->vertex_layer->dl.lb.first ; vvert; vvert = vvert->next, ++vert_r) {
- VECCOPY(vert_r->co, vvert->co);
-
- vert_r->no[0] = vvert->no[0] * 32767.0;
- vert_r->no[1] = vvert->no[1] * 32767.0;
- vert_r->no[2] = vvert->no[2] * 32767.0;
-
- vert_r->mat_nr = 0;
- vert_r->flag = 0;
- }
-}
-
-/* dummy function, edges arent supported in verse mesh */
-void vDM_copyEdgeArray(DerivedMesh *dm, MEdge *edge_r)
-{
- VDerivedMesh *vdm = (VDerivedMesh*)dm;
-
- if(!vdm->vertex_layer || !vdm->edges) return;
-
- if(vdm->edges->first) {
- struct VerseEdge *vedge;
- struct VLayer *vert_vlayer = vdm->vertex_layer;
- struct VerseVert *vvert, *vvert1, *vvert2;
- int j;
-
- /* store vert indices in tmp union */
- for(vvert = vdm->vertex_layer->dl.lb.first, j = 0; vvert; vvert = vvert->next, ++j)
- vvert->tmp.index = j;
-
- for(vedge = vdm->edges->first, j=0 ; vedge; vedge = vedge->next, ++edge_r, j++) {
- /* create temporary edge index */
- vedge->tmp.index = j;
- vvert1 = BLI_dlist_find_link(&(vert_vlayer->dl), (unsigned int)vedge->v0);
- vvert2 = BLI_dlist_find_link(&(vert_vlayer->dl), (unsigned int)vedge->v1);
- if(vvert1 && vvert2) {
- edge_r->v1 = vvert1->tmp.index;
- edge_r->v2 = vvert2->tmp.index;
- }
- else {
- printf("error: vDM_copyEdgeArray: %d, %d\n", vedge->v0, vedge->v1);
- edge_r->v1 = 0;
- edge_r->v2 = 0;
- }
- /* not supported yet */
- edge_r->flag = 0;
- edge_r->crease = 0;
- edge_r->bweight = 0;
- }
- }
-}
-
-/* fill array of mfaces */
-void vDM_copyFaceArray(DerivedMesh *dm, MFace *face_r)
-{
- VDerivedMesh *vdm = (VDerivedMesh*)dm;
- struct VerseFace *vface;
- struct VerseVert *vvert;
- int i;
-
- if(!vdm->vertex_layer || !vdm->polygon_layer) return;
-
- /* store vertexes indices in tmp union */
- for(vvert = vdm->vertex_layer->dl.lb.first, i = 0; vvert; vvert = vvert->next, ++i)
- vvert->tmp.index = i;
-
- for(vface = vdm->polygon_layer->dl.lb.first; vface; vface = vface->next, ++face_r) {
- face_r->mat_nr = 0;
- face_r->flag = 0;
-
- face_r->v1 = vface->vvert0->tmp.index;
- face_r->v2 = vface->vvert1->tmp.index;
- face_r->v3 = vface->vvert2->tmp.index;
- if(vface->vvert3) face_r->v4 = vface->vvert3->tmp.index;
- else face_r->v4 = 0;
-
- test_index_face(face_r, NULL, 0, vface->vvert3?4:3);
- }
-}
-
-/* return coordination of vertex with index */
-static void vDM_getVertCo(DerivedMesh *dm, int index, float co_r[3])
-{
- VDerivedMesh *vdm = (VDerivedMesh*)dm;
- struct VerseVert *vvert = NULL;
-
- if(!vdm->vertex_layer) return;
-
- vvert = BLI_dlist_find_link(&(vdm->vertex_layer->dl), index);
-
- if(vvert) {
- VECCOPY(co_r, vdm->vertexCos ? vvert->cos : vvert->co);
- }
- else {
- co_r[0] = co_r[1] = co_r[2] = 0.0;
- }
-}
-
-/* return array of vertex coordiantions */
-static void vDM_getVertCos(DerivedMesh *dm, float (*cos_r)[3])
-{
- VDerivedMesh *vdm = (VDerivedMesh*)dm;
- struct VerseVert *vvert;
- int i = 0;
-
- if(!vdm->vertex_layer) return;
-
- vvert = vdm->vertex_layer->dl.lb.first;
- while(vvert) {
- VECCOPY(cos_r[i], vdm->vertexCos ? vvert->cos : vvert->co);
- i++;
- vvert = vvert->next;
- }
-}
-
-/* return normal of vertex with index */
-static void vDM_getVertNo(DerivedMesh *dm, int index, float no_r[3])
-{
- VDerivedMesh *vdm = (VDerivedMesh*)dm;
- struct VerseVert *vvert = NULL;
-
- if(!vdm->vertex_layer) return;
-
- vvert = BLI_dlist_find_link(&(vdm->vertex_layer->dl), index);
- if(vvert) {
- VECCOPY(no_r, vvert->no);
- }
- else {
- no_r[0] = no_r[1] = no_r[2] = 0.0;
- }
-}
-
-/* draw all VerseVertexes */
-static void vDM_drawVerts(DerivedMesh *dm)
-{
- VDerivedMesh *vdm = (VDerivedMesh*)dm;
- struct VerseVert *vvert;
-
- if(!vdm->vertex_layer) return;
-
- vvert = vdm->vertex_layer->dl.lb.first;
-
- //XXX bglBegin(GL_POINTS);
- while(vvert) {
- //XXX bglVertex3fv(vdm->vertexCos ? vvert->cos : vvert->co);
- vvert = vvert->next;
- }
- //XXX bglEnd();
-}
-
-/* draw all edges of VerseFaces ... it isn't optimal, because verse
- * specification doesn't support edges :-( ... bother eskil ;-)
- * ... some edges (most of edges) are drawn twice */
-static void vDM_drawEdges(DerivedMesh *dm, int drawLooseEdges)
-{
- VDerivedMesh *vdm = (VDerivedMesh*)dm;
- struct VerseEdge *vedge;
- struct VLayer *vert_vlayer = vdm->vertex_layer;
-
- if(vert_vlayer && vdm->edges && (BLI_countlist(vdm->edges) > 0)) {
- struct VerseVert *vvert1, *vvert2;
-
- glBegin(GL_LINES);
- for(vedge = vdm->edges->first; vedge; vedge = vedge->next) {
- vvert1 = BLI_dlist_find_link(&(vert_vlayer->dl), (unsigned int)vedge->v0);
- vvert2 = BLI_dlist_find_link(&(vert_vlayer->dl), (unsigned int)vedge->v1);
- if(vvert1 && vvert2) {
- glVertex3fv(vdm->vertexCos ? vvert1->cos : vvert1->co);
- glVertex3fv(vdm->vertexCos ? vvert2->cos : vvert2->co);
- }
- }
- glEnd();
- }
-}
-
-/* verse spec doesn't support edges ... loose edges can't exist */
-void vDM_drawLooseEdges(DerivedMesh *dm)
-{
-}
-
-/* draw uv edges, not supported yet */
-static void vDM_drawUVEdges(DerivedMesh *dm)
-{
-}
-
-/* draw all VerseFaces */
-static void vDM_drawFacesSolid(DerivedMesh *dm, int (*setMaterial)(int, void *attribs))
-{
- VDerivedMesh *vdm = (VDerivedMesh*)dm;
- struct VerseFace *vface;
-
- if(!vdm->polygon_layer) return;
-
- vface = vdm->polygon_layer->dl.lb.first;
-
- glShadeModel(GL_FLAT);
- while(vface) {
- glBegin(vface->vvert3?GL_QUADS:GL_TRIANGLES);
- glNormal3fv(vface->no);
- glVertex3fv(vdm->vertexCos ? vface->vvert0->cos : vface->vvert0->co);
- glVertex3fv(vdm->vertexCos ? vface->vvert1->cos : vface->vvert1->co);
- glVertex3fv(vdm->vertexCos ? vface->vvert2->cos : vface->vvert2->co);
- if(vface->vvert3)
- glVertex3fv(vdm->vertexCos ? vface->vvert3->cos : vface->vvert3->co);
- glEnd();
- vface = vface->next;
- }
-}
-
-/* this function should draw mesh with mapped texture, but it isn't supported yet */
-static void vDM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, MCol *mcol, int matnr))
-{
- VDerivedMesh *vdm = (VDerivedMesh*)dm;
- struct VerseFace *vface;
-
- if(!vdm->polygon_layer) return;
-
- vface = vdm->polygon_layer->dl.lb.first;
-
- while(vface) {
- glBegin(vface->vvert3?GL_QUADS:GL_TRIANGLES);
- glVertex3fv(vdm->vertexCos ? vface->vvert0->cos : vface->vvert0->co);
- glVertex3fv(vdm->vertexCos ? vface->vvert1->cos : vface->vvert1->co);
- glVertex3fv(vdm->vertexCos ? vface->vvert2->cos : vface->vvert2->co);
- if(vface->vvert3)
- glVertex3fv(vdm->vertexCos ? vface->vvert3->cos : vface->vvert3->co);
- glEnd();
-
- vface = vface->next;
- }
-}
-
-/* this function should draw mesh with colored faces (weight paint, vertex
- * colors, etc.), but it isn't supported yet */
-static void vDM_drawFacesColored(DerivedMesh *dm, int useTwoSided, unsigned char *col1, unsigned char *col2)
-{
- VDerivedMesh *vdm = (VDerivedMesh*)dm;
- struct VerseFace *vface;
-
- if(!vdm->polygon_layer) return;
-
- vface = vdm->polygon_layer->dl.lb.first;
-
- while(vface) {
- glBegin(vface->vvert3?GL_QUADS:GL_TRIANGLES);
- glVertex3fv(vdm->vertexCos ? vface->vvert0->cos : vface->vvert0->co);
- glVertex3fv(vdm->vertexCos ? vface->vvert1->cos : vface->vvert1->co);
- glVertex3fv(vdm->vertexCos ? vface->vvert2->cos : vface->vvert2->co);
- if(vface->vvert3)
- glVertex3fv(vdm->vertexCos ? vface->vvert3->cos : vface->vvert3->co);
- glEnd();
-
- vface = vface->next;
- }
-}
-
-/**/
-static void vDM_foreachMappedVert(
- DerivedMesh *dm,
- void (*func)(void *userData, int index, float *co, float *no_f, short *no_s),
- void *userData)
-{
-}
-
-/**/
-static void vDM_foreachMappedEdge(
- DerivedMesh *dm,
- void (*func)(void *userData, int index, float *v0co, float *v1co),
- void *userData)
-{
-}
-
-/**/
-static void vDM_foreachMappedFaceCenter(
- DerivedMesh *dm,
- void (*func)(void *userData, int index, float *cent, float *no),
- void *userData)
-{
-}
-
-/**/
-static void vDM_drawMappedFacesTex(
- DerivedMesh *dm,
- int (*setDrawParams)(void *userData, int index),
- void *userData)
-{
- /* not supported yet */
- vDM_drawFacesTex(dm, NULL);
-}
-
-/**/
-static void vDM_drawMappedFaces(
- DerivedMesh *dm,
- int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r),
- void *userData,
- int useColors)
-{
-}
-
-/**/
-static void vDM_drawMappedEdges(
- DerivedMesh *dm,
- int (*setDrawOptions)(void *userData, int index),
- void *userData)
-{
-}
-
-/**/
-static void vDM_drawMappedEdgesInterp(
- DerivedMesh *dm,
- int (*setDrawOptions)(void *userData, int index),
- void (*setDrawInterpOptions)(void *userData, int index, float t),
- void *userData)
-{
-}
-
-/* free all DerivedMesh data */
-static void vDM_release(DerivedMesh *dm)
-{
- VDerivedMesh *vdm = (VDerivedMesh*)dm;
-
- if (DM_release(dm)) {
- if(vdm->vertexCos) MEM_freeN(vdm->vertexCos);
- MEM_freeN(vdm);
- }
-}
-
-/* create derived mesh from verse mesh ... it is used in object mode, when some other client can
- * change shared data and want to see this changes in real time too */
-DerivedMesh *derivedmesh_from_versemesh(VNode *vnode, float (*vertexCos)[3])
-{
- VDerivedMesh *vdm = MEM_callocN(sizeof(*vdm), "vdm");
-
- vdm->vnode = vnode;
- vdm->vertex_layer = find_verse_layer_type((VGeomData*)vnode->data, VERTEX_LAYER);
- vdm->polygon_layer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER);
- vdm->edges = &((VGeomData*)vnode->data)->edges;
-
- /* vertex and polygon layer has to exist */
- if(vdm->vertex_layer && vdm->polygon_layer)
- DM_init(&vdm->dm, vdm->vertex_layer->dl.da.count, BLI_countlist(vdm->edges), vdm->polygon_layer->dl.da.count);
- else
- DM_init(&vdm->dm, 0, 0, 0);
-
- vdm->dm.getMinMax = vDM_getMinMax;
-
- vdm->dm.getNumVerts = vDM_getNumVerts;
- vdm->dm.getNumEdges = vDM_getNumEdges;
- vdm->dm.getNumFaces = vDM_getNumFaces;
-
- vdm->dm.getVert = vDM_getVert;
- vdm->dm.getEdge = vDM_getEdge;
- vdm->dm.getFace = vDM_getFace;
- vdm->dm.copyVertArray = vDM_copyVertArray;
- vdm->dm.copyEdgeArray = vDM_copyEdgeArray;
- vdm->dm.copyFaceArray = vDM_copyFaceArray;
-
- vdm->dm.foreachMappedVert = vDM_foreachMappedVert;
- vdm->dm.foreachMappedEdge = vDM_foreachMappedEdge;
- vdm->dm.foreachMappedFaceCenter = vDM_foreachMappedFaceCenter;
-
- vdm->dm.getVertCos = vDM_getVertCos;
- vdm->dm.getVertCo = vDM_getVertCo;
- vdm->dm.getVertNo = vDM_getVertNo;
-
- vdm->dm.drawVerts = vDM_drawVerts;
-
- vdm->dm.drawEdges = vDM_drawEdges;
- vdm->dm.drawLooseEdges = vDM_drawLooseEdges;
- vdm->dm.drawUVEdges = vDM_drawUVEdges;
-
- vdm->dm.drawFacesSolid = vDM_drawFacesSolid;
- vdm->dm.drawFacesTex = vDM_drawFacesTex;
- vdm->dm.drawFacesColored = vDM_drawFacesColored;
-
- vdm->dm.drawMappedFacesTex = vDM_drawMappedFacesTex;
- vdm->dm.drawMappedFaces = vDM_drawMappedFaces;
- vdm->dm.drawMappedEdges = vDM_drawMappedEdges;
- vdm->dm.drawMappedEdgesInterp = vDM_drawMappedEdgesInterp;
-
- vdm->dm.release = vDM_release;
-
- vdm->vertexCos = vertexCos;
-
- return (DerivedMesh*) vdm;
-}
-
-#endif
-
/***/
DerivedMesh *mesh_create_derived_for_modifier(Scene *scene, Object *ob, ModifierData *md)
@@ -1973,12 +1402,7 @@ DerivedMesh *mesh_create_derived_for_modifier(Scene *scene, Object *ob, Modifier
float (*deformedVerts)[3] = mesh_getVertexCos(me, &numVerts);
mti->deformVerts(md, ob, NULL, deformedVerts, numVerts);
-#ifdef WITH_VERSE
- if(me->vnode) dm = derivedmesh_from_versemesh(me->vnode, deformedVerts);
- else dm = getMeshDerivedMesh(me, ob, deformedVerts);
-#else
dm = getMeshDerivedMesh(me, ob, deformedVerts);
-#endif
MEM_freeN(deformedVerts);
} else {
@@ -2163,22 +1587,11 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
* coordinates (vpaint, etc.)
*/
if (deform_r) {
-#ifdef WITH_VERSE
- if(me->vnode) *deform_r = derivedmesh_from_versemesh(me->vnode, deformedVerts);
- else {
- *deform_r = CDDM_from_mesh(me, ob);
- if(deformedVerts) {
- CDDM_apply_vert_coords(*deform_r, deformedVerts);
- CDDM_calc_normals(*deform_r);
- }
- }
-#else
*deform_r = CDDM_from_mesh(me, ob);
if(deformedVerts) {
CDDM_apply_vert_coords(*deform_r, deformedVerts);
CDDM_calc_normals(*deform_r);
}
-#endif
}
} else {
/* default behaviour for meshes */
@@ -2195,13 +1608,6 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
dm = NULL;
orcodm = NULL;
-#ifdef WITH_VERSE
- /* hack to make sure modifiers don't try to use mesh data from a verse
- * node
- */
- if(me->vnode) dm = derivedmesh_from_versemesh(me->vnode, deformedVerts);
-#endif
-
for(;md; md = md->next, curr = curr->next) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
@@ -2333,23 +1739,11 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
} else if(dm) {
finaldm = dm;
} else {
-#ifdef WITH_VERSE
- if(me->vnode)
- finaldm = derivedmesh_from_versemesh(me->vnode, deformedVerts);
- else {
- finaldm = CDDM_from_mesh(me, ob);
- if(deformedVerts) {
- CDDM_apply_vert_coords(finaldm, deformedVerts);
- CDDM_calc_normals(finaldm);
- }
- }
-#else
finaldm = CDDM_from_mesh(me, ob);
if(deformedVerts) {
CDDM_apply_vert_coords(finaldm, deformedVerts);
CDDM_calc_normals(finaldm);
}
-#endif
}
/* add an orco layer if needed */
diff --git a/source/blender/blenkernel/intern/Makefile b/source/blender/blenkernel/intern/Makefile
index 8919719d64d..3d8a47e3683 100644
--- a/source/blender/blenkernel/intern/Makefile
+++ b/source/blender/blenkernel/intern/Makefile
@@ -91,11 +91,6 @@ ifeq ($(WITH_FREETYPE2), true)
CPPFLAGS += -I$(NAN_FREETYPE)/include/freetype2
endif
-ifeq ($(WITH_VERSE), true)
- CPPFLAGS += -DWITH_VERSE
- CPPFLAGS += -I$(NAN_VERSE)/include
-endif
-
ifeq ($(WITH_FFMPEG),true)
CPPFLAGS += -DWITH_FFMPEG
CPPFLAGS += $(NAN_FFMPEGCFLAGS)
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 597687101b0..7890b72f6e2 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -1939,17 +1939,12 @@ ImBuf *BKE_image_get_ibuf(Image *ima, ImageUser *iuser)
}
else if(ima->source == IMA_SRC_GENERATED) {
/* generated is: ibuf is allocated dynamically */
- if(ima->type==IMA_TYPE_VERSE) {
- /* todo */
- }
- else { /* always fall back to IMA_TYPE_UV_TEST */
- /* UV testgrid or black or solid etc */
- if(ima->gen_x==0) ima->gen_x= 256;
- if(ima->gen_y==0) ima->gen_y= 256;
- ibuf= add_ibuf_size(ima->gen_x, ima->gen_y, ima->name, 0, ima->gen_type, color);
- image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0);
- ima->ok= IMA_OK_LOADED;
- }
+ /* UV testgrid or black or solid etc */
+ if(ima->gen_x==0) ima->gen_x= 256;
+ if(ima->gen_y==0) ima->gen_y= 256;
+ ibuf= add_ibuf_size(ima->gen_x, ima->gen_y, ima->name, 0, ima->gen_type, color);
+ image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0);
+ ima->ok= IMA_OK_LOADED;
}
else if(ima->source == IMA_SRC_VIEWER) {
if(ima->type==IMA_TYPE_R_RESULT) {
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index b41f82bbcf8..3f35e70114a 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -68,10 +68,6 @@
#include "BKE_object.h"
#include "BKE_utildefines.h"
-#ifdef WITH_VERSE
-#include "BKE_verse.h"
-#endif
-
#include "BLI_blenlib.h"
#include "BLI_editVert.h"
#include "BLI_arithb.h"
@@ -193,10 +189,6 @@ Mesh *add_mesh(char *name)
me->flag= ME_TWOSIDED;
me->bb= unit_boundbox();
-#ifdef WITH_VERSE
- me->vnode = NULL;
-#endif
-
return me;
}
@@ -240,10 +232,6 @@ Mesh *copy_mesh(Mesh *me)
men->key= copy_key(me->key);
if(men->key) men->key->from= (ID *)men;
-#ifdef WITH_VERSE
- men->vnode = NULL;
-#endif
-
return men;
}
@@ -1025,38 +1013,14 @@ void mesh_calc_normals(MVert *mverts, int numVerts, MFace *mfaces, int numFaces,
float (*mesh_getVertexCos(Mesh *me, int *numVerts_r))[3]
{
-#ifdef WITH_VERSE
- if(me->vnode) {
- struct VLayer *vlayer;
- struct VerseVert *vvert;
- unsigned int i, numVerts;
- float (*cos)[3];
-
- vlayer = find_verse_layer_type((VGeomData*)((VNode*)me->vnode)->data, VERTEX_LAYER);
-
- vvert = vlayer->dl.lb.first;
- numVerts = vlayer->dl.da.count;
- cos = MEM_mallocN(sizeof(*cos)*numVerts, "verse_vertexcos");
-
- for(i=0; inext, i++) {
- VECCOPY(cos[i], vvert->co);
- }
-
- return cos;
- }
- else {
-#endif
- int i, numVerts = me->totvert;
- float (*cos)[3] = MEM_mallocN(sizeof(*cos)*numVerts, "vertexcos1");
-
- if (numVerts_r) *numVerts_r = numVerts;
- for (i=0; imvert[i].co);
-
- return cos;
-#ifdef WITH_VERSE
- }
-#endif
+ int i, numVerts = me->totvert;
+ float (*cos)[3] = MEM_mallocN(sizeof(*cos)*numVerts, "vertexcos1");
+
+ if (numVerts_r) *numVerts_r = numVerts;
+ for (i=0; imvert[i].co);
+
+ return cos;
}
float (*mesh_getRefKeyCos(Mesh *me, int *numVerts_r))[3]
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 7f3f21e106a..185ce73c936 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1253,10 +1253,6 @@ Object *copy_object(Object *ob)
obn->derivedDeform = NULL;
obn->derivedFinal = NULL;
-#ifdef WITH_VERSE
- obn->vnode = NULL;
-#endif
-
obn->gpulamp.first = obn->gpulamp.last = NULL;
return obn;
diff --git a/source/blender/blenkernel/intern/verse_bitmap_node.c b/source/blender/blenkernel/intern/verse_bitmap_node.c
deleted file mode 100644
index 92bdd28027f..00000000000
--- a/source/blender/blenkernel/intern/verse_bitmap_node.c
+++ /dev/null
@@ -1,448 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Contributor(s): Jiri Hnidek.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef WITH_VERSE
-
-#include
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_listBase.h"
-
-#include "BLI_dynamiclist.h"
-#include "BLI_blenlib.h"
-
-//XXX #include "BIF_verse.h"
-
-#include "BKE_verse.h"
-
-#include "verse.h"
-
-/* function prototypes of static functions */
-static void cb_b_dimension_set(void *user_data, VNodeID node_id, uint16 width, uint16 height, uint16 depth);
-static void cb_b_layer_create(void *user_data, VNodeID node_id, VLayerID layer_id, const char *name, VNBLayerType type);
-static void cb_b_layer_destroy(void *user_data, VNodeID node_id, VLayerID layer_id);
-static void cb_b_tile_set(void *user_data, VNodeID node_id, VLayerID layer_id, uint16 tile_x, uint16 tile_y, uint16 z, VNBLayerType type, const VNBTile *tile);
-
-static void change_layer_dimension(
- VBitmapLayer *vblayer,
- unsigned int old_width,
- unsigned int old_height,
- unsigned int t_old_width,
- unsigned int t_old_height);
-static void *alloc_verse_bitmap_layer_data(struct VBitmapLayer *vblayer);
-
-/*
- * resize/crop verse bitmap layer
- */
-static void change_layer_dimension(
- VBitmapLayer *vblayer,
- unsigned int old_width,
- unsigned int old_height,
- unsigned int t_old_width,
- unsigned int t_old_height)
-{
- struct VNode *vnode = vblayer->vnode;
- unsigned int t_width = ((VBitmapData*)(vnode->data))->t_width;
- unsigned int width = ((VBitmapData*)(vnode->data))->width;
- unsigned int height = ((VBitmapData*)(vnode->data))->height;
- unsigned int x, y, i, j;
-
- i = j = 0;
-
- /* "copy" old data to new data */
- if(vblayer->type==VN_B_LAYER_UINT8) {
- unsigned char *data = (unsigned char*)vblayer->data;
- /* allocate new verse bitmap layer data */
- unsigned char *new_data = (unsigned char*)alloc_verse_bitmap_layer_data(vblayer);
- for(y=0; ydata);
- vblayer->data = new_data;
- }
-}
-
-/*
- * free data stored in verse bitmap layer
- */
-void free_bitmap_layer_data(VBitmapLayer *vblayer)
-{
- struct VerseSession *session = vblayer->vnode->session;
-
- /* free name of bitmap layer */
- MEM_freeN(vblayer->name);
-
- /* unsubscribe from verse bitmap layer */
- if(session->flag & VERSE_CONNECTED)
- verse_send_b_layer_unsubscribe(vblayer->vnode->id, vblayer->id);
-
- /* free image data of bitmap layer */
- if(vblayer->data) MEM_freeN(vblayer->data);
-}
-
-/*
- * allocate data of verse bitmap layer
- */
-static void *alloc_verse_bitmap_layer_data(VBitmapLayer *vblayer)
-{
- struct VNode *vnode = vblayer->vnode;
- unsigned int t_width = ((VBitmapData*)(vnode->data))->t_width;
- unsigned int t_height = ((VBitmapData*)(vnode->data))->t_height;
- unsigned int size;
- void *data;
-
- size = t_width*t_height;
-
- /* allocation of own data stored in verse bitmap layer */
- switch (vblayer->type) {
- case VN_B_LAYER_UINT1:
- data = (void*)MEM_mallocN(sizeof(unsigned char)*size, "VBLayer data uint1");
- break;
- case VN_B_LAYER_UINT8:
- data = (void*)MEM_mallocN(sizeof(unsigned char)*size, "VBLayer data uint8");
- break;
- case VN_B_LAYER_UINT16:
- data = (void*)MEM_mallocN(sizeof(unsigned int)*size, "VBLayer data uint16");
- break;
- case VN_B_LAYER_REAL32:
- data = (void*)MEM_mallocN(sizeof(float)*size, "VBLayer data float16");
- break;
- case VN_B_LAYER_REAL64:
- data = (void*)MEM_mallocN(sizeof(double)*size, "VBLayer data float32");
- break;
- default:
- data = NULL;
- break;
- }
-
- return data;
-}
-
-/*
- * create verse bitmap layer
- */
-VBitmapLayer *create_bitmap_layer(
- VNode *vnode,
- VLayerID layer_id,
- const char *name,
- VNBLayerType type)
-{
- struct VBitmapLayer *vblayer;
- unsigned int width = ((VBitmapData*)(vnode->data))->width;
- unsigned int height = ((VBitmapData*)(vnode->data))->height;
-
- /* allocate memory for own verse bitmap layer */
- vblayer = (VBitmapLayer*)MEM_mallocN(sizeof(VBitmapLayer), "Verse Bitmap Layer");
-
- /* verse bitmap layer will include pointer at parent verse node and own id */
- vblayer->vnode = vnode;
- vblayer->id = layer_id;
-
- /* name of verse layer */
- vblayer->name = (char*)MEM_mallocN(sizeof(char)*(strlen(name)+1), "Verse Bitmap Layer name");
- vblayer->name[0] = '\0';
- strcpy(vblayer->name, name);
-
- /* type of data stored in verse bitmap layer */
- vblayer->type = type;
-
- /* we can allocate memory for layer data, when we know dimmension of layers; when
- * we don't know it, then we will allocate this data when we will receive dimmension */
- if(width==0 || height==0)
- vblayer->data = NULL;
- else
- vblayer->data = alloc_verse_bitmap_layer_data(vblayer);
-
- vblayer->flag = 0;
-
- return vblayer;
-}
-
-/*
- * free data of bitmap node
- */
-void free_bitmap_node_data(VNode *vnode)
-{
- if(vnode->data) {
- struct VBitmapLayer *vblayer = (VBitmapLayer*)((VBitmapData*)(vnode->data))->layers.lb.first;
-
- /* free all VerseLayer data */
- while(vblayer) {
- free_bitmap_layer_data(vblayer);
- vblayer = vblayer->next;
- }
-
- /* free all VerseLayers */
- BLI_dlist_destroy(&(((VGeomData*)vnode->data)->layers));
- }
-}
-
-/*
- * create data of bitmap node
- */
-VBitmapData *create_bitmap_data()
-{
- struct VBitmapData *vbitmap;
-
- vbitmap = (VBitmapData*)MEM_mallocN(sizeof(VBitmapData), "Verse Bitmap Data");
-
- BLI_dlist_init(&(vbitmap->layers));
- vbitmap->queue.first = vbitmap->queue.last = NULL;
-
- vbitmap->width = 0;
- vbitmap->height = 0;
- vbitmap->depth = 0;
-
- vbitmap->image = NULL;
-
- //XXX vbitmap->post_bitmap_dimension_set = post_bitmap_dimension_set;
- //XXX vbitmap->post_bitmap_layer_create = post_bitmap_layer_create;
- //XXX vbitmap->post_bitmap_layer_destroy = post_bitmap_layer_destroy;
- //XXX vbitmap->post_bitmap_tile_set = post_bitmap_tile_set;
-
- return vbitmap;
-}
-
-/*
- * callback function, dimension of image was changed, it is neccessary to
- * crop all layers
- */
-static void cb_b_dimension_set(
- void *user_data,
- VNodeID node_id,
- uint16 width,
- uint16 height,
- uint16 depth)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VBitmapLayer *vblayer;
- unsigned int old_width, old_height, t_old_width, t_old_height;
-
- if(!session) return;
-
- vnode = (VNode*)BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
- if(!vnode) return;
-
-#ifdef VERSE_DEBUG_PRINT
- printf("\t cb_b_dimension_set()\n");
-#endif
-
- /* backup old width and height */
- old_width = ((VBitmapData*)(vnode->data))->width;
- old_height = ((VBitmapData*)(vnode->data))->height;
- t_old_width = ((VBitmapData*)(vnode->data))->t_width;
- t_old_height = ((VBitmapData*)(vnode->data))->t_height;
-
- /* set up new dimension of layers */
- ((VBitmapData*)(vnode->data))->width = width;
- ((VBitmapData*)(vnode->data))->height = height;
- ((VBitmapData*)(vnode->data))->depth = depth;
-
- /* we cache t_width because tiles aren't one pixel width */
- if((width % VN_B_TILE_SIZE)!=0)
- ((VBitmapData*)(vnode->data))->t_width = (width/VN_B_TILE_SIZE + 1)*VN_B_TILE_SIZE;
- else
- ((VBitmapData*)(vnode->data))->t_width = width;
-
- /* we cache t_height because tiles aren't one pixel height */
- if((height % VN_B_TILE_SIZE)!=0)
- ((VBitmapData*)(vnode->data))->t_height = (height/VN_B_TILE_SIZE + 1)*VN_B_TILE_SIZE;
- else
- ((VBitmapData*)(vnode->data))->t_height = height;
-
- /* crop resize all layers */
- vblayer = ((VBitmapData*)vnode->data)->layers.lb.first;
-
- while(vblayer) {
- /* when this callback function received after cb_b_layer_create,
- * then we have to allocate memory for verse bitmap layer data */
- if(!vblayer->data) vblayer->data = alloc_verse_bitmap_layer_data(vblayer);
- /* crop/resize all verse bitmap layers */
- else change_layer_dimension(vblayer, old_width, old_height, t_old_width, t_old_height);
-
- vblayer = vblayer->next;
- }
-
- /* post callback function */
- ((VBitmapData*)(vnode->data))->post_bitmap_dimension_set(vnode);
-}
-
-/*
- * callback function, new layer channel of image was created
- */
-static void cb_b_layer_create(
- void *user_data,
- VNodeID node_id,
- VLayerID layer_id,
- const char *name,
- VNBLayerType type)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VBitmapLayer *vblayer;
-
- if(!session) return;
-
- vnode = (VNode*)BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
- if(!vnode) return;
-
-#ifdef VERSE_DEBUG_PRINT
- printf("\t cb_b_layer_create()\n");
-#endif
-
- /* when no layer exists, then new layer will be created */
- vblayer = create_bitmap_layer(vnode, layer_id, name, type);
-
- /* add verse bitmap layer to list of layers */
- BLI_dlist_add_item_index(&((VBitmapData*)vnode->data)->layers, vblayer, layer_id);
-
- /* post callback function */
- ((VBitmapData*)(vnode->data))->post_bitmap_layer_create(vblayer);
-
-}
-
-/*
- * callback function, existing layer of image was destroyed
- */
-static void cb_b_layer_destroy(
- void *user_data,
- VNodeID node_id,
- VLayerID layer_id)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VBitmapLayer *vblayer;
-
- if(!session) return;
-
- /* find node of this layer*/
- vnode = (VNode*)BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
- if(!vnode) return;
-
- vblayer = (VBitmapLayer*)BLI_dlist_find_link(&(((VBitmapData*)vnode->data)->layers), layer_id);
- if(!vblayer) return;
-
-#ifdef VERSE_DEBUG_PRINT
- printf("\t cb_b_layer_destroy()\n");
-#endif
-
- /* remove verse bitmap layer from list of layers */
- BLI_dlist_rem_item(&(((VBitmapData*)vnode->data)->layers), layer_id);
-
- /* post callback function */
- ((VBitmapData*)(vnode->data))->post_bitmap_layer_destroy(vblayer);
-
- /* free data of verse bitmap layer */
- free_bitmap_layer_data(vblayer);
-
- /* free verse bitmap layer */
- MEM_freeN(vblayer);
-}
-
-/*
- * callback function, small part (8x8 pixels) was changed
- */
-static void cb_b_tile_set(
- void *user_data,
- VNodeID node_id,
- VLayerID layer_id,
- uint16 tile_x,
- uint16 tile_y,
- uint16 z,
- VNBLayerType type,
- const VNBTile *tile)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VBitmapLayer *vblayer;
- unsigned int x, y, xs, ys, width, height, t_height, t_width, i, j;
-
- if(!session) return;
-
- /* try to find verse node in dynamic list nodes */
- vnode = (VNode*)BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
- if(!vnode) return;
-
- /* try to find verse bitmap layer in list of layers */
- vblayer = (VBitmapLayer*)BLI_dlist_find_link(&(((VBitmapData*)vnode->data)->layers), layer_id);
- if(!vblayer) return;
-
- /* we have to have allocated memory for bitmap layer */
- if(!vblayer->data) return;
-
- width = ((VBitmapData*)vnode->data)->width;
- height = ((VBitmapData*)vnode->data)->height;
-
- /* width of verse image including all tiles */
- t_height = ((VBitmapData*)vnode->data)->t_height;
- /* height of verse image including all tiles */
- t_width = ((VBitmapData*)vnode->data)->t_width;
-
-#ifdef VERSE_DEBUG_PRINT
- printf("\t cb_b_tile_set()\n");
-#endif
-
- xs = tile_x*VN_B_TILE_SIZE;
- ys = tile_y*VN_B_TILE_SIZE;
-
- /* initial position in one dimension vblayer->data (y_start*width + x_start) */
- i = ys*t_width + xs;
- /* intial position in one dimension tile array */
- j = 0;
-
- if(type==VN_B_LAYER_UINT8) {
- unsigned char *data = (unsigned char*)vblayer->data;
- for(y=ys; yvuint8[j];
- }
-
- /* post callback function */
- ((VBitmapData*)(vnode->data))->post_bitmap_tile_set(vblayer, xs, ys);
-}
-
-/*
- * set up all callbacks functions for image nodes
- */
-void set_bitmap_callbacks(void)
-{
- /* dimension (size) of bitmap was set up or changes (image will be croped) */
- verse_callback_set(verse_send_b_dimensions_set, cb_b_dimension_set, NULL);
-
- /* new layer (chanell) of image was added or created */
- verse_callback_set(verse_send_b_layer_create, cb_b_layer_create, NULL);
-
- /* existing layer was destroyed */
- verse_callback_set(verse_send_b_layer_destroy, cb_b_layer_destroy, NULL);
-
- /* some tile (small part 8x8 pixels of image was changed) */
- verse_callback_set(verse_send_b_tile_set, cb_b_tile_set, NULL);
-}
-
-#endif
-
diff --git a/source/blender/blenkernel/intern/verse_geometry_node.c b/source/blender/blenkernel/intern/verse_geometry_node.c
deleted file mode 100644
index a0afd1ef5f0..00000000000
--- a/source/blender/blenkernel/intern/verse_geometry_node.c
+++ /dev/null
@@ -1,2098 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Contributor(s): Jiri Hnidek.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef WITH_VERSE
-
-#include
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_listBase.h"
-
-#include "BLI_dynamiclist.h"
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "BKE_verse.h"
-#include "BKE_utildefines.h"
-
-//XXX #include "BIF_verse.h"
-
-#include "verse.h"
-
-/* function prototypes of static functions */
-
-/* test functions for callback functions */
-static char test_polygon_set_corner_uint32(uint32 v0, uint32 v1, uint32 v2, uint32 v3);
-
-/* callback functions */
-static void cb_g_layer_create(void *user_data, VNodeID node_id, VLayerID layer_id, const char *name, VNGLayerType type, uint32 def_integer, real64 def_real);
-static void cb_g_layer_destroy(void *user_data, VNodeID node_id, VLayerID layer_id);
-static void cb_g_vertex_set_xyz_real32(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real32 x, real32 y, real32 z);
-static void cb_g_polygon_set_corner_uint32(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint32 v0, uint32 v1, uint32 v2, uint32 v3);
-static void cb_g_vertex_delete_real32(void *user_data, VNodeID node_id, uint32 vertex_id);
-static void cb_g_polygon_delete(void *user_data, VNodeID node_id, uint32 polygon_id);
-static void cb_g_crease_set_edge(void *user_data, VNodeID node_id, const char *layer, uint32 def_crease);
-static void cb_g_crease_set_vertex(void *user_data, VNodeID node_id, const char *layer, uint32 def_crease);
-
-/* other static functions */
-
-static void free_unneeded_verseverts_of_verseface(struct VNode *vnode, struct VerseFace *vface);
-static void free_verse_vertex(struct VLayer *vlayer, struct VerseVert *vvert);
-static void free_verse_face(struct VLayer *vlayer, struct VerseFace *vface);
-static void free_verse_layer_data(struct VNode *vnode, struct VLayer *vlayer);
-
-static void send_verse_face(struct VerseFace *vface);
-
-static VerseVert* find_verse_vert_in_queue(struct VLayer *vlayer, VNodeID node_id, uint32 vertex_id, real32 x, real32 y, real32 z);
-static VerseFace* find_verse_face_in_queue(struct VLayer *vlayer, VNodeID node_id, uint32 polygon_id, uint32 v0, uint32 v1, uint32 v2, uint32 v3);
-
-static unsigned short test_incoming_verseface(struct VGeomData *geom, struct VerseFace *vface);
-static void find_unsent_faces(struct VNode *vnode, struct VerseVert *vvert);
-static void find_vlayer_orphans(struct VNode *vnode, struct VerseVert *vvert);
-static void move_face_orphan_to_dlist(struct VNode *vnode, struct VLayer *vlayer, struct VerseFace *vface);
-static void increase_verse_verts_references(struct VerseFace *vface);
-static void recalculate_verseface_normals(struct VNode *vnode);
-
-/* verse edge functions */
-static VerseEdge* find_verse_edge(struct VNode *vnode, uint32 v0, uint32 v1);
-static void insert_verse_edgehash(struct VNode *vnode, struct VerseEdge *vedge);
-static void remove_verse_edgehash(struct VNode *vnode, struct VerseEdge *vedge);
-static void remove_verse_edge(struct VNode *vnode, uint32 v0, uint32 v1);
-static void add_verse_edge(struct VNode *vnode, uint32 v0, uint32 v1);
-static void update_edgehash_of_deleted_verseface(struct VNode *vnode, struct VerseFace *vface);
-static void update_edgehash_of_changed_verseface(struct VNode *vnode, struct VerseFace *vface, uint32 v0, uint32 v1, uint32 v2, uint32 v3);
-static void update_edgehash_of_new_verseface(struct VNode *vnode, uint32 v0, uint32 v1, uint32 v2, uint32 v3);
-
-/*
- * recalcute normals of all VerseFaces
- */
-static void recalculate_verseface_normals(VNode *vnode)
-{
- struct VLayer *vert_layer, *face_layer;
- struct VerseFace *vface;
- struct VerseVert *vvert;
-
- if(vnode->type != V_NT_GEOMETRY) return;
-
- vert_layer = find_verse_layer_type((VGeomData*)vnode->data, VERTEX_LAYER);
- face_layer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER);
-
- vvert = vert_layer->dl.lb.first;
- while(vvert) {
- vvert->no[0] = vvert->no[1] = vvert->no[2] = 0.0;
- vvert = vvert->next;
- }
-
- vface = face_layer->dl.lb.first;
- while(vface) {
- /* calculate face normals */
- if(vface->vvert3) {
- CalcNormFloat4(vface->vvert0->co, vface->vvert1->co,
- vface->vvert2->co, vface->vvert3->co, vface->no);
- VecAddf(vface->vvert3->no, vface->vvert3->no, vface->no);
- }
- else
- CalcNormFloat(vface->vvert0->co, vface->vvert1->co,
- vface->vvert2->co, vface->no);
-
- /* calculate vertex normals ... it is averadge of all face normals using the vertex */
- VecAddf(vface->vvert0->no, vface->vvert0->no, vface->no);
- VecAddf(vface->vvert1->no, vface->vvert1->no, vface->no);
- VecAddf(vface->vvert2->no, vface->vvert2->no, vface->no);
-
- vface = vface->next;
- }
-
- /* we have to normalize all vertex normals */
- vvert = vert_layer->dl.lb.first;
- while(vvert) {
- Normalize(vvert->no);
- vvert = vvert->next;
- }
-}
-
-/*
- * add created item to the queue and send it if possible
- */
-void add_item_to_send_queue(ListBase *lb, void *item, short type)
-{
- struct VNode *vnode;
- struct VLayer *vlayer;
- struct VerseVert *vvert;
- struct VerseFace *vface;
-
- /* this prevent from adding duplicated faces */
- if(type==VERSE_FACE) {
- struct Link *link = (Link*)lb->first;
- while(link) {
- if(link==item) {
- if(((VerseFace*)item)->flag & FACE_SENT) {
-/* printf("\tverse face %d marked as OBSOLETE\n", ((VerseFace*)item)->id);*/
- ((VerseFace*)item)->flag |= FACE_OBSOLETE;
- }
- return;
- }
- link = link->next;
- }
- }
-
- /* add item to sending queue (two way dynamic list) */
- BLI_addtail(lb, item);
-
- /* send item, when it is possible */
- switch (type) {
- case VERSE_NODE: /* only first node in queue can be sent */
- if(lb->first==lb->last)
- send_verse_node((VNode*)item);
- break;
- case VERSE_LINK: /* both object between have to exist */
- if(((VLink*)item)->flag & LINK_SEND_READY)
- send_verse_link((VLink*)item);
- break;
- case VERSE_LAYER:
- if(((VLayer*)item)->vnode->flag & NODE_RECEIVED)
- send_verse_layer((VLayer*)item);
- break;
- case VERSE_VERT:
- if(((VerseVert*)item)->vlayer->flag & LAYER_RECEIVED)
- send_verse_vertex((VerseVert*)item);
- break;
- case VERSE_FACE: /* all vertexes of face have to be received */
- if(((VerseFace*)item)->flag & FACE_SEND_READY)
- send_verse_face((VerseFace*)item);
- break;
- case VERSE_TAG:
- send_verse_tag((VTag*)item);
- break;
- case VERSE_TAG_GROUP:
- send_verse_taggroup((VTagGroup*)item);
- break;
- case VERSE_VERT_UINT32: /* parent item has to exist */
- vnode = (((uint32_item*)item)->vlayer)->vnode;
- vlayer = (VLayer*)BLI_dlist_find_link(&(((VGeomData*)vnode->data)->layers), 0 );
- vvert = (VerseVert*)BLI_dlist_find_link(&(vlayer->dl), ((uint32_item*)item)->id );
- if(vvert != NULL)
- send_verse_vert_uint32((uint32_item*)item, type);
- break;
- case VERSE_VERT_REAL32: /* parent item has to exist */
- vnode = (((real32_item*)item)->vlayer)->vnode;
- vlayer = (VLayer*)BLI_dlist_find_link(&(((VGeomData*)vnode->data)->layers), 0 );
- vvert = (VerseVert*)BLI_dlist_find_link(&(vlayer->dl), ((real32_item*)item)->id );
- if( vvert != NULL)
- send_verse_vert_real32((real32_item*)item, type);
- break;
- case VERSE_VERT_VEC_REAL32: /* parent item has to exist */
- vnode = (((vec_real32_item*)item)->vlayer)->vnode;
- vlayer = (VLayer*)BLI_dlist_find_link(&(((VGeomData*)vnode->data)->layers), 0 );
- vvert = (VerseVert*)BLI_dlist_find_link(&(vlayer->dl), ((vec_real32_item*)item)->id );
- if(vvert != NULL)
- send_verse_vert_vec_real32((vec_real32_item*)item, type);
- break;
- case VERSE_FACE_UINT8: /* parent item has to exist */
- vnode = (((uint8_item*)item)->vlayer)->vnode;
- vlayer = (VLayer*)BLI_dlist_find_link(&(((VGeomData*)vnode->data)->layers), 1 );
- vface = (VerseFace*)BLI_dlist_find_link(&(vlayer->dl), ((uint8_item*)item)->id );
- if(vface != NULL)
- send_verse_face_uint8((uint8_item*)item, type);
- break;
- case VERSE_FACE_UINT32: /* parent item has to exist */
- vnode = (((uint32_item*)item)->vlayer)->vnode;
- vlayer = (VLayer*)BLI_dlist_find_link(&(((VGeomData*)vnode->data)->layers), 1 );
- vface = (VerseFace*)BLI_dlist_find_link(&(vlayer->dl), ((uint32_item*)item)->id );
- if(vface != NULL)
- send_verse_face_uint32((uint32_item*)item, type);
- break;
- case VERSE_FACE_REAL32: /* parent item has to exist */
- vnode = (((real32_item*)item)->vlayer)->vnode;
- vlayer = (VLayer*)BLI_dlist_find_link(&(((VGeomData*)vnode->data)->layers), 1 );
- vface = (VerseFace*)BLI_dlist_find_link(&(vlayer->dl), ((real32_item*)item)->id );
- if(vface != NULL)
- send_verse_face_real32((real32_item*)item, type);
- break;
- case VERSE_FACE_QUAT_UINT32: /* parent item has to exist */
- vnode = (((quat_uint32_item*)item)->vlayer)->vnode;
- vlayer = (VLayer*)BLI_dlist_find_link(&(((VGeomData*)vnode->data)->layers), 1 );
- vface = (VerseFace*)BLI_dlist_find_link(&(vlayer->dl), ((quat_uint32_item*)item)->id );
- if(vface != NULL)
- send_verse_face_corner_quat_uint32((quat_uint32_item*)item, type);
- break;
- case VERSE_FACE_QUAT_REAL32: /* parent item has to exist */
- vnode = (((quat_real32_item*)item)->vlayer)->vnode;
- vlayer = (VLayer*)BLI_dlist_find_link(&(((VGeomData*)vnode->data)->layers), 1 );
- vface = (VerseFace*)BLI_dlist_find_link(&(vlayer->dl), ((quat_real32_item*)item)->id );
- if(vface != NULL)
- send_verse_face_corner_quat_real32((quat_real32_item*)item, type);
- break;
- }
-}
-
-/*
- * return VerseLayer with certain content (vertexes, polygons, in the
- * future: weight, red color, etc.)
- */
-VLayer* find_verse_layer_type(VGeomData *geom, short content)
-{
- struct VLayer *vlayer = NULL;
-
- switch(content) {
- case VERTEX_LAYER:
- /* VERTEX_LAYER equals 0 and vertex layer is
- * always in 1st layer */
- vlayer = geom->layers.da.items[VERTEX_LAYER];
- break;
- case POLYGON_LAYER:
- /* POLYGON_LAYER equals 1 and vertex layer is
- * always in 2nd layer */
- vlayer = geom->layers.da.items[POLYGON_LAYER];
- break;
- }
-
- return vlayer;
-}
-
-/*
- * increase references of VerseVerts of new VerseFace
- */
-static void increase_verse_verts_references(VerseFace *vface)
-{
- if(vface->vvert0) vface->vvert0->counter++;
- if(vface->vvert1) vface->vvert1->counter++;
- if(vface->vvert2) vface->vvert2->counter++;
- if(vface->vvert3) vface->vvert3->counter++;
-}
-
-/*
- * move VerseFace from list of orphans to dlist of VerseFaces (if VerseFace was only changed
- * then this VerseFace is only removed from list of orphans)
- */
-static void move_face_orphan_to_dlist(VNode *vnode, VLayer *vlayer, VerseFace *vface)
-{
- /* remove vface from list of orphans */
- BLI_remlink(&(vlayer->orphans), vface);
- /* increase references of all vertexes beying part of this face*/
- increase_verse_verts_references(vface);
-
- if(vface->flag & FACE_RECEIVED) {
- /* set up vface flag */
- vface->flag &= ~FACE_RECEIVED;
- /* move vface to dynamic list of faces */
- BLI_dlist_add_item_index(&(vlayer->dl), (void*)vface, vface->id);
- /* recalculate all vertex and faces normals */
- recalculate_verseface_normals(vnode);
- /* post create action (change local data) */
- ((VGeomData*)vnode->data)->post_polygon_create(vface);
- }
- else if(vface->flag & FACE_CHANGED) {
- /* set up vface flag */
- vface->flag &= ~FACE_CHANGED;
- /* move vface to dynamic list of faces */
- BLI_dlist_add_item_index(&(vlayer->dl), (void*)vface, vface->id);
- /* recalculate all vertex and faces normals */
- recalculate_verseface_normals(vnode);
- /* post create action (change local data) */
- ((VGeomData*)vnode->data)->post_polygon_set_corner(vface);
- }
-}
-
-/*
- * find all VerseFaces waiting in queue, which needs id of new VerseVert
- */
-static void find_unsent_faces(VNode *vnode, VerseVert *vvert)
-{
- VLayer *vlayer;
- VerseFace *vface, *next_vface;
-
- vlayer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER);
-
- if(vlayer) {
- vface = vlayer->queue.first;
- while(vface) {
- next_vface = vface->next;
- if(vface->vvert0==vvert) {
- vface->v0 = vvert->id;
- vface->counter--;
- }
- else if(vface->vvert1==vvert) {
- vface->v1 = vvert->id;
- vface->counter--;
- }
- else if(vface->vvert2==vvert) {
- vface->v2 = vvert->id;
- vface->counter--;
- }
- else if(vface->vvert3==vvert){
- vface->v3 = vvert->id;
- vface->counter--;
- }
-
- if(vface->counter<1 && !(vface->flag & FACE_SENT))
- send_verse_face(vface);
-
- vface = next_vface;
- }
- }
-}
-
-/*
- * find all VerseFace orphans, which needs incoming VerseVert
- */
-static void find_vlayer_orphans(VNode *vnode, VerseVert *vvert)
-{
- VLayer *vlayer;
- VerseFace *vface, *next_vface;
- unsigned int vertex_id = vvert->id;
-
- vlayer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER);
-
- if(vlayer) {
- vface = vlayer->orphans.first;
- while(vface){
- next_vface = vface->next;
- if(vface->v0 == vertex_id) {
- vface->vvert0 = vvert;
- vface->counter--;
- }
- else if(vface->v1 == vertex_id) {
- vface->vvert1 = vvert;
- vface->counter--;
- }
- else if(vface->v2 == vertex_id) {
- vface->vvert2 = vvert;
- vface->counter--;
- }
- else if(vface->v3 == vertex_id) {
- vface->vvert3 = vvert;
- vface->counter--;
- }
- if(vface->counter<1) {
- /* moving VerseFace orphan to dlist */
- move_face_orphan_to_dlist(vnode, vlayer, vface);
- }
- vface = next_vface;
- }
- }
-}
-
-/*
- * return number of VerseVerts missing to incoming VerseFace, set up pointers
- * at VerseVerts
- */
-static unsigned short test_incoming_verseface(VGeomData *geom, VerseFace *vface)
-{
- struct VLayer *vert_layer;
- struct VerseVert *vvert;
- int counter=0;
-
- vert_layer = find_verse_layer_type(geom, VERTEX_LAYER);
-
- if(vface->v0 != -1){
- vvert = BLI_dlist_find_link(&(vert_layer->dl), vface->v0);
- if(vvert==NULL) counter++;
- else vface->vvert0 = vvert;
- }
- if(vface->v1 != -1){
- vvert = BLI_dlist_find_link(&(vert_layer->dl), vface->v1);
- if(vvert==NULL) counter++;
- else vface->vvert1 = vvert;
- }
- if(vface->v2 != -1){
- vvert = BLI_dlist_find_link(&(vert_layer->dl), vface->v2);
- if(vvert==NULL) counter++;
- else vface->vvert2 = vvert;
- }
- if(vface->v3 != -1){
- vvert = BLI_dlist_find_link(&(vert_layer->dl), vface->v3);
- if(vvert==NULL) counter++;
- else vface->vvert3 = vvert;
- }
-
- return counter;
-}
-
-/*
- * try to find changed VerseFace in sending queue
- */
-static VerseFace* find_changed_verse_face_in_queue(VLayer *vlayer, uint32 polygon_id)
-{
- struct VerseFace *vface = vlayer->queue.first;
-
- while(vface){
- if(vface->id == polygon_id && vface->flag & FACE_CHANGED) {
- return vface;
- }
- vface = vface->next;
- }
- return NULL;
-}
-
-/*
- * try to find VerseFace in queue
- */
-static VerseFace* find_verse_face_in_queue(
- VLayer *vlayer,
- VNodeID node_id,
- uint32 polygon_id,
- uint32 v0,
- uint32 v1,
- uint32 v2,
- uint32 v3)
-{
- struct VerseFace *vface = vlayer->queue.first;
-
- while(vface){
- if((vface->v0==v0) && (vface->v1==v1) && (vface->v2==v2) && (vface->v3==v3)){
- vface->id = polygon_id;
- vface->vlayer = vlayer;
- return vface;
- }
- vface = vface->next;
- }
- return NULL;
-}
-
-/*
- * try to find VerseVert in queue
- */
-static VerseVert* find_verse_vert_in_queue(
- VLayer *vlayer,
- VNodeID node_id,
- uint32 vertex_id,
- real32 x,
- real32 y,
- real32 z)
-{
- struct VerseVert *vvert = vlayer->queue.first;
-
- while(vvert){
- if((vvert->vlayer->vnode->id == node_id) && (vvert->co[0] == x) && (vvert->co[1] == y) && (vvert->co[2] == z))
- {
- vvert->id = vertex_id;
- vvert->vlayer = vlayer;
-
- return vvert;
- }
- vvert = vvert->next;
- }
-
- return NULL;
-}
-
-
-/*
- * send quat of float values to verse server (4x32 bits)
- */
-void send_verse_face_corner_quat_real32(quat_real32_item *item, short type)
-{
- verse_send_g_polygon_set_corner_real32(
- item->vlayer->vnode->id,
- item->vlayer->id,
- item->id,
- item->value[0],
- item->value[1],
- item->value[2],
- item->value[3]);
-}
-
-/*
- * send quat of unsigned int values to verse server (4x32 bits)
- */
-void send_verse_face_corner_quat_uint32(quat_uint32_item *item, short type)
-{
- verse_send_g_polygon_set_corner_uint32(
- item->vlayer->vnode->id,
- item->vlayer->id,
- item->id,
- item->value[0],
- item->value[1],
- item->value[2],
- item->value[3]);
-}
-
-/*
- * send float value (32 bits) to verse server
- */
-void send_verse_face_real32(real32_item *item, short type)
-{
- verse_send_g_polygon_set_face_real32(
- item->vlayer->vnode->id,
- item->vlayer->id,
- item->id,
- item->value);
-}
-
-/*
- * send unsigned integer (32 bits) to verse server
- */
-void send_verse_face_uint32(uint32_item *item, short type)
-{
- verse_send_g_polygon_set_face_uint32(
- item->vlayer->vnode->id,
- item->vlayer->id,
- item->id,
- item->value);
-}
-
-/*
- * send unsigned char (8 bits) to verse server
- */
-void send_verse_face_uint8(uint8_item *item, short type)
-{
- verse_send_g_polygon_set_face_uint8(
- item->vlayer->vnode->id,
- item->vlayer->id,
- item->id,
- item->value);
-}
-
-/*
- * send vector of float values to verse server (3x32 bits)
- */
-void send_verse_vert_vec_real32(vec_real32_item *item, short type)
-{
- verse_send_g_vertex_set_xyz_real32(
- item->vlayer->vnode->id,
- item->vlayer->id,
- item->id,
- item->value[0],
- item->value[1],
- item->value[2]);
-}
-
-/*
- * send float value (32 bits) to verse server
- */
-void send_verse_vert_real32(real32_item *item, short type)
-{
- verse_send_g_vertex_set_real32(
- item->vlayer->vnode->id,
- item->vlayer->id,
- item->id,
- item->value);
-}
-
-/*
- * send unsigned integer (32 bits) to verse server
- */
-void send_verse_vert_uint32(uint32_item *item, short type)
-{
- verse_send_g_vertex_set_uint32(
- item->vlayer->vnode->id,
- item->vlayer->id,
- item->id,
- item->value);
-}
-
-/*
- * send delete command to verse server
- */
-void send_verse_vertex_delete(VerseVert *vvert)
-{
- verse_session_set(vvert->vlayer->vnode->session->vsession);
-
- vvert->flag |= VERT_OBSOLETE;
-
- verse_send_g_vertex_delete_real32(vvert->vlayer->vnode->id, vvert->id);
-}
-
-/*
- * send VerseLayer to verse server
- */
-void send_verse_layer(VLayer *vlayer)
-{
- verse_session_set(vlayer->vnode->session->vsession);
-
- verse_send_g_layer_create(
- vlayer->vnode->id,
- vlayer->id,
- vlayer->name,
- vlayer->type,
- vlayer->def_int,
- vlayer->def_real);
-}
-
-/*
- * send VerseVert to verse server
- */
-void send_verse_vertex(VerseVert *vvert)
-{
- /* new vertex position will not be sent, when vertex was deleted */
- if(vvert->flag & VERT_OBSOLETE) return;
-
- verse_session_set(vvert->vlayer->vnode->session->vsession);
-
- verse_send_g_vertex_set_xyz_real32(
- vvert->vlayer->vnode->id,
- vvert->vlayer->id,
- vvert->id,
- vvert->co[0],
- vvert->co[2],
- -vvert->co[1]);
-}
-
-/*
- * send delete command to verse server
- */
-void send_verse_face_delete(VerseFace *vface)
-{
- verse_session_set(vface->vlayer->vnode->session->vsession);
-
- vface->flag |= FACE_DELETED;
-
- verse_send_g_polygon_delete(vface->vlayer->vnode->id, vface->id);
-}
-
-/*
- * send VerseFace to verse server
- */
-static void send_verse_face(VerseFace *vface)
-{
- verse_session_set(vface->vlayer->vnode->session->vsession);
-
- vface->flag |= FACE_SENT;
-
- if(vface->v3 != -1) {
- verse_send_g_polygon_set_corner_uint32(
- vface->vlayer->vnode->id,
- vface->vlayer->id,
- vface->id,
- vface->v0,
- vface->v3, /* verse use clock-wise winding */
- vface->v2,
- vface->v1); /* verse use clock-wise winding */
- }
- else {
- verse_send_g_polygon_set_corner_uint32(
- vface->vlayer->vnode->id,
- vface->vlayer->id,
- vface->id,
- vface->v0,
- vface->v2, /* verse use clock-wise winding */
- vface->v1, /* verse use clock-wise winding */
- vface->v3);
- }
-}
-
-/*
- * free VerseVert
- */
-static void free_verse_vertex(VLayer *vlayer, VerseVert *vvert)
-{
- /* free VerseVert */
- BLI_freelinkN(&(vlayer->orphans), vvert);
-}
-
-/*
- * free VerseFace (and blender face)
- */
-static void free_verse_face(VLayer *vlayer, VerseFace *vface)
-{
- /* free VerseFace */
- BLI_dlist_free_item(&(vlayer->dl), (unsigned int)vface->id);
-}
-
-/*
- * free VerseLayer data
- */
-static void free_verse_layer_data(VNode *vnode, VLayer *vlayer)
-{
- struct VerseFace *vface;
- struct VerseVert *vvert;
-
- /* set up EditVert->vvert and EditFace->vface pointers to NULL */
- switch(vlayer->content) {
- case VERTEX_LAYER:
- vvert = (VerseVert*)vlayer->dl.lb.first;
- while(vvert) {
- ((VGeomData*)vnode->data)->post_vertex_free_constraint(vvert);
- vvert = vvert->next;
- }
- break;
- case POLYGON_LAYER:
- vface = (VerseFace*)vlayer->dl.lb.first;
- while(vface) {
- ((VGeomData*)vnode->data)->post_polygon_free_constraint(vface);
- vface = vface->next;
- }
- break;
- default:
- break;
- }
- /* free Verse Layer name */
- MEM_freeN(vlayer->name);
- /* destroy VerseLayer data (vertexes, polygons, etc.) */
- BLI_dlist_destroy(&(vlayer->dl));
- /* free unsent data */
- BLI_freelistN(&(vlayer->queue));
- /* free orphans */
- BLI_freelistN(&(vlayer->orphans));
-}
-
-/*
- * free all unneeded VerseVerts waiting for deleting
- */
-static void free_unneeded_verseverts_of_verseface(VNode *vnode, VerseFace *vface)
-{
- struct VLayer *vert_vlayer;
-
- /* find layer containing vertexes */
- vert_vlayer = find_verse_layer_type((VGeomData*)vnode->data, VERTEX_LAYER);
-
- /* free all "deleted" VerseVert waiting for deleting this VerseFace */
-
- if((vface->vvert0->counter < 1) && (vface->vvert0->flag & VERT_DELETED)) {
- ((VGeomData*)vnode->data)->post_vertex_delete(vface->vvert0);
- free_verse_vertex(vert_vlayer, vface->vvert0);
- vface->vvert0 = NULL;
- }
- if((vface->vvert1->counter < 1) && (vface->vvert1->flag & VERT_DELETED)) {
- ((VGeomData*)vnode->data)->post_vertex_delete(vface->vvert1);
- free_verse_vertex(vert_vlayer, vface->vvert1);
- vface->vvert1 = NULL;
- }
- if((vface->vvert2->counter < 1) && (vface->vvert2->flag & VERT_DELETED)) {
- ((VGeomData*)vnode->data)->post_vertex_delete(vface->vvert2);
- free_verse_vertex(vert_vlayer, vface->vvert2);
- vface->vvert2 = NULL;
- }
- if((vface->vvert3) && (vface->vvert3->counter < 1) && (vface->vvert3->flag & VERT_DELETED)) {
- ((VGeomData*)vnode->data)->post_vertex_delete(vface->vvert3);
- free_verse_vertex(vert_vlayer, vface->vvert3);
- vface->vvert3 = NULL;
- }
-}
-
-/*
- * This function create VerseVert and returns pointer on this vertex
- */
-VerseVert* create_verse_vertex(
- VLayer *vlayer,
- uint32 vertex_id,
- real32 x,
- real32 y,
- real32 z)
-{
- struct VerseVert *vvert;
-
- vvert = (VerseVert*)MEM_mallocN(sizeof(VerseVert), "VerseVert");
-
- /* set up pointer on parent node */
- vvert->vlayer = vlayer;
- vvert->id = vertex_id;
- /* position */
- vvert->co[0] = x;
- vvert->co[1] = y;
- vvert->co[2] = z;
- /* normal */
- vvert->no[0] = vvert->no[1] = vvert->no[2] = 0.0;
- /* blender internals */
- vvert->flag = 0;
- vvert->counter = 0;
- vvert->vertex = NULL;
-
- /* increase layer counter of vertexes */
- vlayer->counter++;
-
- return vvert;
-}
-
-/*
- * this function creates fake VerseEdge and returns pointer at this edge
- */
-VerseEdge *create_verse_edge(uint32 v0, uint32 v1)
-{
- struct VerseEdge *vedge;
-
- vedge = (VerseEdge*)MEM_mallocN(sizeof(VerseEdge), "VerseEdge");
-
- vedge->v0 = v0;
- vedge->v1 = v1;
- vedge->counter = 0;
-
- return vedge;
-}
-
-/*
- * this function will create new VerseFace and will return pointer on such Face
- */
-VerseFace* create_verse_face(
- VLayer *vlayer,
- uint32 polygon_id,
- uint32 v0,
- uint32 v1,
- uint32 v2,
- uint32 v3)
-{
- struct VerseFace *vface;
-
- vface = (VerseFace*)MEM_mallocN(sizeof(VerseFace), "VerseFace");
-
- /* verse data */
- vface->vlayer = vlayer;
- vface->id = polygon_id;
-
- vface->vvert0 = NULL;
- vface->vvert1 = NULL;
- vface->vvert2 = NULL;
- vface->vvert3 = NULL;
-
- vface->v0 = v0;
- vface->v1 = v1;
- vface->v2 = v2;
- vface->v3 = v3;
-
- /* blender data */
- vface->face = NULL;
- vface->flag = 0;
- vface->counter = 4;
-
- /* increase layer counter of faces */
- vlayer->counter++;
-
- return vface;
-}
-
-/*
- * create and return VerseLayer
- */
-VLayer *create_verse_layer(
- VNode *vnode,
- VLayerID layer_id,
- const char *name,
- VNGLayerType type,
- uint32 def_integer,
- real64 def_real)
-{
- struct VLayer *vlayer;
-
- /* add layer to the DynamicList */
- vlayer = (VLayer*)MEM_mallocN(sizeof(VLayer), "VerseLayer");
-
- /* store all relevant info to the vlayer and set up vlayer */
- vlayer->vnode = vnode;
- vlayer->id = layer_id;
- vlayer->name = (char*)MEM_mallocN(sizeof(char)*(sizeof(name)+1),"Verse Layer name");
- strcpy(vlayer->name, name);
- vlayer->type = type;
- vlayer->def_int = def_integer;
- vlayer->def_real = def_real;
-
- if((type == VN_G_LAYER_VERTEX_XYZ) && (layer_id == 0))
- vlayer->content = VERTEX_LAYER;
- else if((type == VN_G_LAYER_POLYGON_CORNER_UINT32) && (layer_id == 1))
- vlayer->content = POLYGON_LAYER;
- else
- vlayer->content = -1;
-
- /* initialize DynamicList in the vlayer (vertexes, polygons, etc.)*/
- BLI_dlist_init(&(vlayer->dl));
- /* initialization of queue of layer */
- vlayer->queue.first = vlayer->queue.last = NULL;
- /* initialization of list of orphans */
- vlayer->orphans.first = vlayer->orphans.last = NULL;
- /* initialize number of sent items (vertexes, faces, etc) */
- vlayer->counter = 0;
- /* initialize flag */
- vlayer->flag = 0;
-
- /* set up methods */
- //XXX vlayer->post_layer_create = post_layer_create;
- //XXX vlayer->post_layer_destroy = post_layer_destroy;
-
- return vlayer;
-}
-
-/*
- * create geometry data
- */
-VGeomData *create_geometry_data(void)
-{
- struct VGeomData *geom;
-
- geom = (VGeomData*)MEM_mallocN(sizeof(VGeomData), "VerseGeometryData");
- BLI_dlist_init(&(geom->layers));
- geom->vlink = NULL;
- geom->queue.first = geom->queue.last = NULL;
- geom->mesh = NULL;
- geom->editmesh = NULL;
-
- /* initialize list of fake verse edges and initialize verse edge hash */
- geom->edges.first = geom->edges.last = NULL;
- geom->hash = MEM_callocN(VEDHASHSIZE*sizeof(HashVerseEdge), "verse hashedge tab");
-
- /* set up methods */
- //XXX geom->post_vertex_create = post_vertex_create;
- //XXX geom->post_vertex_set_xyz = post_vertex_set_xyz;
- //XXX geom->post_vertex_delete = post_vertex_delete;
- //XXX geom->post_vertex_free_constraint = post_vertex_free_constraint;
- //XXX geom->post_polygon_create = post_polygon_create;
- //XXX geom->post_polygon_set_corner = post_polygon_set_corner;
- //XXX geom->post_polygon_delete = post_polygon_delete;
- //XXX geom->post_polygon_free_constraint = post_polygon_free_constraint;
- //XXX geom->post_geometry_free_constraint = post_geometry_free_constraint;
- //XXX geom->post_polygon_set_uint8 = post_polygon_set_uint8;
-
- return geom;
-}
-
-/* Create item containing 4 floats */
-static quat_real32_item *create_quat_real32_item(
- VLayer *vlayer,
- uint32 item_id,
- real32 v0,
- real32 v1,
- real32 v2,
- real32 v3)
-{
- struct quat_real32_item *item;
-
- item = (quat_real32_item*)MEM_mallocN(sizeof(quat_real32_item), "quat_real32_item");
-
- item->vlayer = vlayer;
- item->id = item_id;
- item->value[0] = v0;
- item->value[1] = v1;
- item->value[2] = v2;
- item->value[3] = v3;
-
- return item;
-}
-
-/* Create item containing 1 float */
-static real32_item *create_real32_item(VLayer *vlayer, uint32 item_id, real32 value)
-{
- struct real32_item *item;
-
- item = (real32_item*)MEM_mallocN(sizeof(real32_item), "real32_item");
-
- item->vlayer = vlayer;
- item->id = item_id;
- item->value = value;
-
- return item;
-}
-
-/* Create item containing 1 integer */
-static uint32_item *create_uint32_item(VLayer *vlayer, uint32 item_id, uint32 value)
-{
- struct uint32_item *item;
-
- item = (uint32_item*)MEM_mallocN(sizeof(uint32_item), "uint32_item");
-
- item->vlayer = vlayer;
- item->id = item_id;
- item->value = value;
-
- return item;
-}
-
-/* Create item containing 1 byte */
-static uint8_item *create_uint8_item(VLayer *vlayer, uint32 item_id, uint8 value)
-{
- struct uint8_item *item;
-
- item = (uint8_item*)MEM_mallocN(sizeof(uint8_item), "uint8_item");
-
- item->vlayer = vlayer;
- item->id = item_id;
- item->value = value;
-
- return item;
-}
-
-/*
- * callback function: vertex crease was set
- */
-static void cb_g_crease_set_vertex(
- void *user_data,
- VNodeID node_id,
- const char *layer,
- uint32 def_crease)
-{
-}
-
-/*
- * we have to test corretness of incoming data from verse server
- * no two vertexes can have the same index
- */
-static char test_polygon_set_corner_uint32(
- uint32 v0,
- uint32 v1,
- uint32 v2,
- uint32 v3)
-{
- if((v0==v1) || (v0==v2) || (v0==v3) || (v1==v2) || (v1==v3) || (v2==v3))
- return 0;
- else
- return 1;
-}
-
-/*
- * try to find verse layer in sending queue of verse geometry node
- */
-static VLayer *find_vlayer_in_sending_queue(VNode *vnode, VLayerID layer_id)
-{
- struct VLayer *vlayer;
-
- /* try to find verse layyer in sending queue */
- vlayer = ((VGeomData*)vnode->data)->queue.first;
- while(vlayer) {
- if(vlayer->id==layer_id) return vlayer;
- vlayer = vlayer->next;
- }
-
- return NULL;
-}
-
-/*
- * this function will find edge in hash table, hash function isn't too optimal (it needs
- * lot of memory for every verse node), but it works without any bug
- */
-static VerseEdge* find_verse_edge(VNode *vnode, uint32 v0, uint32 v1)
-{
- struct HashVerseEdge *hve;
-
- if(((VGeomData*)vnode->data)->hash==NULL)
- ((VGeomData*)vnode->data)->hash = MEM_callocN(VEDHASHSIZE*sizeof(HashVerseEdge), "verse hashedge tab");
-
- hve = ((VGeomData*)vnode->data)->hash + VEDHASH(v0, v1);;
- while(hve) {
- /* edge v0---v1 is the same edge as v1---v0 */
- if(hve->vedge && ((hve->vedge->v0==v0 && hve->vedge->v1==v1) || (hve->vedge->v0==v1 && hve->vedge->v1==v0))) return hve->vedge;
- hve = hve->next;
- }
-
- return NULL;
-}
-
-/*
- * insert hash of verse edge to hash table
- */
-static void insert_verse_edgehash(VNode *vnode, VerseEdge *vedge)
-{
- struct HashVerseEdge *first, *hve;
-
- if(((VGeomData*)vnode->data)->hash==NULL)
- ((VGeomData*)vnode->data)->hash = MEM_callocN(VEDHASHSIZE*sizeof(HashVerseEdge), "verse hashedge tab");
-
- first = ((VGeomData*)vnode->data)->hash + VEDHASH(vedge->v0, vedge->v1);
-
- if(first->vedge==NULL) {
- first->vedge = vedge;
- }
- else {
- hve = &(vedge->hash);
- hve->vedge = vedge;
- hve->next = first->next;
- first->next = hve;
- }
-}
-
-/*
- * remove hash of verse edge from hash table
- */
-static void remove_verse_edgehash(VNode *vnode, VerseEdge *vedge)
-{
- struct HashVerseEdge *first, *hve, *prev;
-
- hve = first = ((VGeomData*)vnode->data)->hash + VEDHASH(vedge->v0, vedge->v1);
-
- while(hve) {
- if(hve->vedge == vedge) {
- if(hve==first) {
- if(first->next) {
- hve = first->next;
- first->vedge = hve->vedge;
- first->next = hve->next;
- }
- else {
- hve->vedge = NULL;
- }
- }
- else {
- prev->next = hve->next;
- }
- return;
- }
- prev = hve;
- hve = hve->next;
- }
-}
-
-/*
- * this function will try to remove existing fake verse edge, when this verse
- * edge is still used by some faces, then counter will be only decremented
- */
-static void remove_verse_edge(VNode *vnode, uint32 v0, uint32 v1)
-{
- struct VerseEdge *vedge;
-
- vedge = find_verse_edge(vnode, v0, v1);
- if(vedge) {
- vedge->counter--;
- if(vedge->counter==0) {
- remove_verse_edgehash(vnode, vedge);
- BLI_freelinkN(&(((VGeomData*)vnode->data)->edges), vedge);
- }
- }
- else {
- printf("error: remove_verse_edge %d, %d\n", v0, v1);
- }
-}
-
-/*
- * this function will try to add new fake verse edge, when no such edge exist,
- * when such edge exist, then only counter of edge will be incremented
- */
-static void add_verse_edge(VNode *vnode, uint32 v0, uint32 v1)
-{
- struct VerseEdge *vedge;
-
- vedge = find_verse_edge(vnode, v0, v1);
- if(!vedge) {
- if(v0!=v1) {
- vedge = create_verse_edge(v0, v1);
- BLI_addtail(&(((VGeomData*)vnode->data)->edges), vedge);
- insert_verse_edgehash(vnode, vedge);
- }
- else {
- printf("error:add_verse_edge: %d, %d\n", v0, v1);
- return;
- }
- }
- vedge->counter++;
-}
-
-/*
- * verse face was deleted ... update edge hash
- */
-static void update_edgehash_of_deleted_verseface(VNode *vnode, VerseFace *vface)
-{
- uint32 v0, v1, v2, v3; /* verse vertex indexes of deleted verse face */
-
- v0 = vface->vvert0->id;
- v1 = vface->vvert1->id;
- v2 = vface->vvert2->id;
- v3 = vface->vvert3 ? vface->vvert3->id : -1;
-
- remove_verse_edge(vnode, v0, v1);
- remove_verse_edge(vnode, v1, v2);
- if(v3!=-1) {
- remove_verse_edge(vnode, v2, v3);
- remove_verse_edge(vnode, v3, v0);
- }
- else {
- remove_verse_edge(vnode, v2, v0);
- }
-}
-
-/*
- * existing verse face was changed ... update edge hash
- */
-static void update_edgehash_of_changed_verseface(
- VNode *vnode,
- VerseFace *vface,
- uint32 v0,
- uint32 v1,
- uint32 v2,
- uint32 v3)
-{
- uint32 ov0, ov1, ov2, ov3; /* old indexes at verse vertexes*/
-
- ov0 = vface->vvert0->id;
- ov1 = vface->vvert1->id;
- ov2 = vface->vvert2->id;
- ov3 = vface->vvert3 ? vface->vvert3->id : -1;
-
- /* 1st edge */
- if(v0!=ov0 || v1!=ov1) {
- remove_verse_edge(vnode, ov0, ov1);
- add_verse_edge(vnode, v0, v1);
- }
-
- /* 2nd edge */
- if(v1!=ov1 || v2!=ov2) {
- remove_verse_edge(vnode, ov1, ov2);
- add_verse_edge(vnode, v1, v2);
- }
-
- /* 3rd edge */
- if(v2!=ov2 || v3!=ov3 || v0!=ov0) {
- if(ov3!=-1) {
- remove_verse_edge(vnode, ov2, ov3);
- if(v3!=-1) {
- add_verse_edge(vnode, v2, v3); /* new 3rd edge (quat->quat) */
- }
- else {
- remove_verse_edge(vnode, ov3, ov0); /* old edge v3,v0 of quat have to be removed */
- add_verse_edge(vnode, v2, v0); /* new 3rd edge (quat->triangle) */
- }
- }
- else {
- remove_verse_edge(vnode, ov2, ov0);
- if(v3!=-1) {
- add_verse_edge(vnode, v2, v3); /* new 3rd edge (triangle->quat) */
- }
- else {
- add_verse_edge(vnode, v2, v0); /* new 3rd edge (triangle->triangle) */
- }
- }
- }
-
- /* 4th edge */
- if(v3!=-1 && (v3!=ov3 || v0!=ov0)) {
- remove_verse_edge(vnode, ov3, ov0);
- add_verse_edge(vnode, v3, v0);
- }
-}
-
-/*
- * new verse face was created ... update list of edges and edge has
- */
-static void update_edgehash_of_new_verseface(
- VNode *vnode,
- uint32 v0,
- uint32 v1,
- uint32 v2,
- uint32 v3)
-{
- /* when edge already exists, then only its counter is incremented,
- * look at commentary of add_verse_edge() function */
- add_verse_edge(vnode, v0, v1);
- add_verse_edge(vnode, v1, v2);
- if(v3!=-1) {
- add_verse_edge(vnode, v2, v3);
- add_verse_edge(vnode, v3, v0);
- }
- else {
- add_verse_edge(vnode, v2, v0);
- }
-}
-
-/*
- * callback function: edge crease was set
- */
-static void cb_g_crease_set_edge(
- void *user_data,
- VNodeID node_id,
- const char *layer,
- uint32 def_crease)
-{
-}
-
-/*
- * callback function: float value for polygon was set up
- */
-static void cb_g_polygon_set_face_real32(
- void *user_def,
- VNodeID node_id,
- VLayerID layer_id,
- uint32 polygon_id,
- real32 value)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VLayer *vlayer;
- struct real32_item *item;
-
- if(!session) return;
-
- /* find needed node (we can be sure, that it is geometry node) */
- vnode = (VNode*)BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
-
- /* find layer containing uint_8 data */
- vlayer = (VLayer*)BLI_dlist_find_link(&(((VGeomData*)vnode->data)->layers), (unsigned int)layer_id);
-
- /* try to find item*/
- item = BLI_dlist_find_link(&(vlayer->dl), polygon_id);
-
- if(item) {
- item->value = value;
- }
- else {
- item = create_real32_item(vlayer, polygon_id, value);
- BLI_dlist_add_item_index(&(vlayer->dl), item, item->id);
- }
-}
-
-/*
- * callback function: int values for polygon was set up
- */
-static void cb_g_polygon_set_face_uint32(
- void *user_def,
- VNodeID node_id,
- VLayerID layer_id,
- uint32 polygon_id,
- uint32 value)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VLayer *vlayer;
- struct uint32_item *item;
-
- if(!session) return;
-
- /* find needed node (we can be sure, that it is geometry node) */
- vnode = (VNode*)BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
-
- /* find layer containing uint_8 data */
- vlayer = (VLayer*)BLI_dlist_find_link(&(((VGeomData*)vnode->data)->layers), (unsigned int)layer_id);
-
- /* try to find item*/
- item = BLI_dlist_find_link(&(vlayer->dl), polygon_id);
-
- if(item) {
- item->value = value;
- }
- else {
- item = create_uint32_item(vlayer, polygon_id, value);
- BLI_dlist_add_item_index(&(vlayer->dl), item, item->id);
- }
-}
-
-/*
- * callback function: uint8 value for polygon was set up
- */
-static void cb_g_polygon_set_face_uint8(
- void *user_def,
- VNodeID node_id,
- VLayerID layer_id,
- uint32 polygon_id,
- uint8 value)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VLayer *vlayer;
- struct uint8_item *item;
-
- if(!session) return;
-
- /* find needed node (we can be sure, that it is geometry node) */
- vnode = (VNode*)BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
-
- /* find layer containing uint_8 data */
- vlayer = (VLayer*)BLI_dlist_find_link(&(((VGeomData*)vnode->data)->layers), (unsigned int)layer_id);
-
- /* try to find item*/
- item = BLI_dlist_find_link(&(vlayer->dl), polygon_id);
-
- if(item) {
- item->value = value;
- }
- else {
- item = create_uint8_item(vlayer, polygon_id, value);
- BLI_dlist_add_item_index(&(vlayer->dl), item, item->id);
- }
-}
-
-/*
- * callback function: float value for polygon corner was set up
- */
-static void cb_g_polygon_set_corner_real32(
- void *user_def,
- VNodeID node_id,
- VLayerID layer_id,
- uint32 polygon_id,
- real32 v0,
- real32 v1,
- real32 v2,
- real32 v3)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VLayer *vlayer;
- struct quat_real32_item *item;
-
- if(!session) return;
-
- /* find needed node (we can be sure, that it is geometry node) */
- vnode = (VNode*)BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
-
- /* find layer containing uint_8 data */
- vlayer = (VLayer*)BLI_dlist_find_link(&(((VGeomData*)vnode->data)->layers), (unsigned int)layer_id);
-
- /* try to find item*/
- item = BLI_dlist_find_link(&(vlayer->dl), polygon_id);
-
- if(item) {
- item->value[0] = v0;
- item->value[1] = v1;
- item->value[2] = v2;
- item->value[3] = v3;
- }
- else {
- item = create_quat_real32_item(vlayer, polygon_id, v0, v1, v2, v3);
- BLI_dlist_add_item_index(&(vlayer->dl), item, item->id);
- }
-}
-
-/*
- * callback function: polygon is deleted
- */
-static void cb_g_polygon_delete(
- void *user_data,
- VNodeID node_id,
- uint32 polygon_id)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- VNode *vnode;
- VLayer *vlayer;
- VerseFace *vface;
-
- if(!session) return;
-
- /* find needed node (we can be sure, that it is geometry node) */
- vnode = BLI_dlist_find_link(&(session->nodes), node_id);
-
- /* find layer containing faces */
- vlayer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER);
-
- /* find wanted VerseFace */
- vface = BLI_dlist_find_link(&(vlayer->dl), polygon_id);
-
- if(!vface) return;
-
- /* update edge hash */
- update_edgehash_of_deleted_verseface(vnode, vface);
-
- ((VGeomData*)vnode->data)->post_polygon_delete(vface);
-
- /* decrease references at coresponding VerseVertexes */
- vface->vvert0->counter--;
- vface->vvert1->counter--;
- vface->vvert2->counter--;
- if(vface->vvert3) vface->vvert3->counter--;
-
- /* delete unneeded VerseVertexes */
- free_unneeded_verseverts_of_verseface(vnode, vface);
-
- free_verse_face(vlayer, vface);
-}
-
-/*
- * callback function: new polygon (face) created or existing polygon was changed
- */
-static void cb_g_polygon_set_corner_uint32(
- void *user_data,
- VNodeID node_id,
- VLayerID layer_id,
- uint32 polygon_id,
- uint32 v0,
- uint32 v1,
- uint32 v2,
- uint32 v3)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VLayer *vlayer;
- struct VerseFace *vface=NULL;
-
- if(!session) return;
-
- /* try to find VerseNode */
- vnode = (VNode*)BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
- if(!vnode) return;
-
- /* try to find VerseLayer */
- vlayer = (VLayer*)BLI_dlist_find_link(&(((VGeomData*)vnode->data)->layers), (unsigned int)layer_id);
- if(!vlayer) return;
-
- /* we have to test coretness of incoming data */
- if(!test_polygon_set_corner_uint32(v0, v1, v2, v3)) return;
-
- /* Blender uses different order of vertexes */
- if(v3!=-1) { /* quat swap */
- unsigned int v; v = v1; v1 = v3; v3 = v;
- }
- else { /* triangle swap */
- unsigned int v; v = v1; v1 = v2; v2 = v;
- }
-
- /* try to find VerseFace */
- vface = (VerseFace*)BLI_dlist_find_link(&(vlayer->dl), (unsigned int)polygon_id);
-
- /* try to find modified VerseFace */
- if(!vface) {
- vface = find_changed_verse_face_in_queue(vlayer, polygon_id);
- if(vface) {
- BLI_remlink(&(vlayer->queue), (void*)vface);
- BLI_dlist_add_item_index(&(vlayer->dl), (void*)vface, (unsigned int)polygon_id);
- }
- }
-
- if(!vface) {
- /* try to find VerseFace in list of VerseVaces created by me and set up polygon and
- * layer ids */
- vface = find_verse_face_in_queue(vlayer, node_id, polygon_id, v0, v1, v2, v3);
-
- /* update edge hash */
- update_edgehash_of_new_verseface(vnode, v0, v1, v2, v3);
-
- if(vface){
- /* I creeated this face ... remove VerseFace from queue */
- BLI_remlink(&(vlayer->queue), (void*)vface);
- }
- else {
- /* some other client created this face*/
- vface = create_verse_face(vlayer, polygon_id, v0, v1, v2, v3);
- }
-
- vface->flag &= ~FACE_SENT;
-
- /* return number of missing verse vertexes */
- vface->counter = test_incoming_verseface((VGeomData*)vnode->data, vface);
-
- if(vface->counter < 1) {
- /* when VerseFace received all needed VerseFaces, then it is moved
- * to list of VerseFaces */
- BLI_dlist_add_item_index(&(vlayer->dl), (void*)vface, (unsigned int)polygon_id);
- increase_verse_verts_references(vface);
- recalculate_verseface_normals(vnode);
- ((VGeomData*)vnode->data)->post_polygon_create(vface);
- }
- else {
- /* when all needed VerseVertexes weren't received, then VerseFace is moved to
- * the list of orphans waiting on needed vertexes */
- vface->flag |= FACE_RECEIVED;
- BLI_addtail(&(vlayer->orphans), (void*)vface);
- }
- }
- else {
- VLayer *vert_vlayer = find_verse_layer_type((VGeomData*)vnode->data, VERTEX_LAYER);
- /* VerseVertexes of existing VerseFace were changed (VerseFace will use some different
- * VerseVertexes or it will use them in different order) */
-
- /* update fake verse edges */
- update_edgehash_of_changed_verseface(vnode, vface, v0, v1, v2, v3);
-
- /* initialize count of unreceived vertexes needed for this face */
- vface->counter = 4;
-
- /* 1st corner */
- if(vface->vvert0->id != v0) {
- /* decrease references of obsolete vertexes*/
- vface->vvert0->counter--;
- /* delete this vertex, when it isn't used by any face and it was marked as deleted */
- if((vface->vvert0->counter < 1) && (vface->vvert0->flag & VERT_DELETED)) {
- ((VGeomData*)vnode->data)->post_vertex_delete(vface->vvert0);
- free_verse_vertex(vert_vlayer, vface->vvert0);
- }
- /* try to set up new pointer at verse vertex */
- vface->v0 = v0;
- vface->vvert0 = BLI_dlist_find_link(&(vert_vlayer->dl), vface->v0);
- if(vface->vvert0) {
- /* increase references at new vertex */
- vface->vvert0->counter++;
- /* decrease count of needed vertex to receive */
- vface->counter--;
- }
-
- }
- else
- /* this corner wasn't changed */
- vface->counter--;
-
- /* 2nd corner */
- if(vface->vvert1->id != v1) {
- vface->vvert1->counter--;
- if((vface->vvert1->counter < 1) && (vface->vvert1->flag & VERT_DELETED)) {
- ((VGeomData*)vnode->data)->post_vertex_delete(vface->vvert1);
- free_verse_vertex(vert_vlayer, vface->vvert1);
- }
- vface->v1 = v1;
- vface->vvert1 = BLI_dlist_find_link(&(vert_vlayer->dl), vface->v1);
- if(vface->vvert1) {
- vface->vvert1->counter++;
- vface->counter--;
- }
- }
- else
- vface->counter--;
-
- /* 3rd corner */
- if(vface->vvert2->id != v2) {
- vface->vvert2->counter--;
- if((vface->vvert2->counter < 1) && (vface->vvert2->flag & VERT_DELETED)) {
- ((VGeomData*)vnode->data)->post_vertex_delete(vface->vvert2);
- free_verse_vertex(vert_vlayer, vface->vvert2);
- }
- vface->v2 = v2;
- vface->vvert2 = BLI_dlist_find_link(&(vert_vlayer->dl), vface->v2);
- if(vface->vvert2) {
- vface->vvert2->counter++;
- vface->counter--;
- }
- }
- else
- vface->counter--;
-
- /* 4th corner */
- if(vface->vvert3) {
- if(vface->vvert3->id != v3) {
- vface->vvert3->counter--;
- if((vface->vvert3->counter < 1) && (vface->vvert3->flag & VERT_DELETED)) {
- ((VGeomData*)vnode->data)->post_vertex_delete(vface->vvert3);
- free_verse_vertex(vert_vlayer, vface->vvert3);
- }
- vface->v3 = v3;
- if(v3 != -1) {
- vface->vvert3 = BLI_dlist_find_link(&(vert_vlayer->dl), vface->v3);
- if(vface->vvert3) {
- vface->vvert3->counter++;
- vface->counter--;
- }
- }
- else {
- /* this is some special case, this face hase now only 3 corners
- * quat -> triangle */
- vface->vvert3 = NULL;
- vface->counter--;
- }
- }
- }
- else if(v3 != -1)
- /* this is some special case, 4th corner of this polygon was created
- * triangle -> quat */
- vface->v3 = v3;
- vface->vvert3 = BLI_dlist_find_link(&(vert_vlayer->dl), vface->v3);
- if(vface->vvert3) {
- vface->vvert3->counter++;
- vface->counter--;
- }
- else {
- vface->v3 = -1;
- vface->counter--;
- }
-
- vface->flag &= ~FACE_SENT;
- vface->flag |= FACE_CHANGED;
-
- if(vface->counter<1) {
- vface->flag &= ~FACE_CHANGED;
- recalculate_verseface_normals(vnode);
- ((VGeomData*)vnode->data)->post_polygon_set_corner(vface);
- }
- else {
- /* when all needed VerseVertexes weren't received, then VerseFace is added to
- * the list of orphans waiting on needed vertexes */
- BLI_dlist_rem_item(&(vlayer->dl), vface->id);
- BLI_addtail(&(vlayer->orphans), (void*)vface);
- }
- }
-}
-
-/*
- * callback function: float value was set up for VerseVert with vertex_id
- */
-static void cb_g_vertex_set_real32(
- void *user_def,
- VNodeID node_id,
- VLayerID layer_id,
- uint32 vertex_id,
- real32 value)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VLayer *vlayer;
- struct real32_item *item;
-
- if(!session) return;
-
- /* find needed node (we can be sure, that it is geometry node) */
- vnode = (VNode*)BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
-
- /* find layer containing uint_8 data */
- vlayer = (VLayer*)BLI_dlist_find_link(&(((VGeomData*)vnode->data)->layers), (unsigned int)layer_id);
-
- /* try to find item*/
- item = BLI_dlist_find_link(&(vlayer->dl), vertex_id);
-
- if(item) {
- item->value = value;
- }
- else {
- item = create_real32_item(vlayer, vertex_id, value);
- BLI_dlist_add_item_index(&(vlayer->dl), item, item->id);
- }
-}
-
-/*
- * callback function: int value was set up for VerseVert with vertex_id
- */
-static void cb_g_vertex_set_uint32(
- void *user_def,
- VNodeID node_id,
- VLayerID layer_id,
- uint32 vertex_id,
- uint32 value)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VLayer *vlayer;
- struct uint32_item *item;
-
- if(!session) return;
-
- /* find needed node (we can be sure, that it is geometry node) */
- vnode = (VNode*)BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
-
- /* find layer containing uint_8 data */
- vlayer = (VLayer*)BLI_dlist_find_link(&(((VGeomData*)vnode->data)->layers), (unsigned int)layer_id);
-
- /* try to find item*/
- item = BLI_dlist_find_link(&(vlayer->dl), vertex_id);
-
- if(item) {
- item->value = value;
- }
- else {
- item = create_uint32_item(vlayer, vertex_id, value);
- BLI_dlist_add_item_index(&(vlayer->dl), item, item->id);
- }
-}
-
-/*
- * callback function: polygon was deleted
- */
-static void cb_g_vertex_delete_real32(
- void *user_data,
- VNodeID node_id,
- uint32 vertex_id)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- VNode *vnode=NULL;
- VLayer *vert_vlayer=NULL;
- VerseVert *vvert=NULL;
-
- if(!session) return;
-
- vnode = BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
-
- vert_vlayer = find_verse_layer_type((VGeomData*)vnode->data, VERTEX_LAYER);
-
- vvert = BLI_dlist_find_link(&(vert_vlayer->dl), (unsigned int)vertex_id);
-
- if(!vvert) return;
-
- if(vvert->counter < 1) {
- ((VGeomData*)vnode->data)->post_vertex_delete(vvert);
- BLI_dlist_free_item(&(vert_vlayer->dl), (unsigned int)vertex_id);
- }
- else {
- /* some VerseFace(s) still need VerseVert, remove verse vert from
- * list verse vertexes and put it to list of orphans */
- vvert->flag |= VERT_DELETED;
- BLI_dlist_rem_item(&(vert_vlayer->dl), (unsigned int)vertex_id);
- BLI_addtail(&(vert_vlayer->orphans), vvert);
- }
-}
-
-/*
- * callback function: position of one vertex was changed or new vertex was created
- */
-static void cb_g_vertex_set_xyz_real32(
- void *user_data,
- VNodeID node_id,
- VLayerID layer_id,
- uint32 vertex_id,
- real32 x,
- real32 y,
- real32 z)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode = NULL;
- struct VLayer *vlayer = NULL;
- struct VerseVert *vvert = NULL;
- real32 tmp;
-
- if(!session) return;
-
- vnode = (VNode*)BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
- if(!vnode)return;
-
- vlayer = (VLayer*)BLI_dlist_find_link(&(((VGeomData*)vnode->data)->layers), (unsigned int)layer_id);
- if(!vlayer) return;
-
- /* switch axis orientation */
- tmp = y;
- y = -z;
- z = tmp;
-
- if(vlayer->id == 0) {
- /* try to pick up verse vert from DynamicList */
- vvert = (VerseVert*)BLI_dlist_find_link(&(vlayer->dl), (unsigned int)vertex_id);
-
- if(vvert) {
- if(vvert->flag & VERT_OBSOLETE) return;
-
- if (vvert->flag & VERT_LOCKED) {
- /* this application changed position of this vertex */
- if((vvert->co[0]==x) && (vvert->co[1]==y) && (vvert->co[2]==z)) {
- /* unlock vertex position */
- vvert->flag &= ~VERT_LOCKED;
- /* call post_vertex_set_xyz only, when position of vertex is
- * obsolete ... the new vertex position will be sent to
- * verse server */
- if (vvert->flag & VERT_POS_OBSOLETE) {
- ((VGeomData*)vnode->data)->post_vertex_set_xyz(vvert);
- }
- }
- }
- else {
- /* somebody else changed position of this vertex*/
- if((vvert->co[0]!=x) || (vvert->co[1]!=y) || (vvert->co[2]!=z)) {
- vvert->co[0] = x;
- vvert->co[1] = y;
- vvert->co[2] = z;
- recalculate_verseface_normals(vnode);
- ((VGeomData*)vnode->data)->post_vertex_set_xyz(vvert);
- }
- }
- }
- else {
- /* create new verse vert */
-
- /* test if we are authors of this vertex :-) */
- vvert = find_verse_vert_in_queue(vlayer, node_id, vertex_id, x, y, z);
-
- if(vvert) {
- /* remove vert from queue */
- BLI_remlink(&(vlayer->queue), (void*)vvert);
- /* add vvert to the dynamic list */
- BLI_dlist_add_item_index(&(vlayer->dl), (void*)vvert, (unsigned int)vertex_id);
- /* set VerseVert flags */
- vvert->flag |= VERT_RECEIVED;
- if(!(vvert->flag & VERT_POS_OBSOLETE))
- vvert->flag &= ~VERT_LOCKED;
- /* find VerseFaces orphans */
- find_vlayer_orphans(vnode, vvert);
- /* find unsent VerseFaces */
- find_unsent_faces(vnode, vvert);
- }
- else {
- /* create new VerseVert */
- vvert = create_verse_vertex(vlayer, vertex_id, x, y, z);
- /* add VerseVert to list of VerseVerts */
- BLI_dlist_add_item_index(&(vlayer->dl), (void*)vvert, (unsigned int)vertex_id);
- /* set VerseVert flags */
- vvert->flag |= VERT_RECEIVED;
- /* find VerseFaces orphans */
- find_vlayer_orphans(vnode, vvert);
- }
-
- ((VGeomData*)vnode->data)->post_vertex_create(vvert);
- }
- }
-}
-
-/*
- * callback function for destroyng of verse layer
- */
-static void cb_g_layer_destroy(
- void *user_data,
- VNodeID node_id,
- VLayerID layer_id)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VLayer *vlayer;
-
- if(!session) return;
-
- vnode = (VNode*)BLI_dlist_find_link(&(session->nodes), node_id);
- if(!vnode) return;
-
- vlayer = (VLayer*) BLI_dlist_find_link(&(((VGeomData*)vnode->data)->layers), layer_id);
-
- if(vlayer){
- /* free VerseLayer data */
- free_verse_layer_data(vnode, vlayer);
- /* remove VerseLayer from list of verse layers */
- BLI_dlist_rem_item(&(((VGeomData*)vnode->data)->layers), layer_id);
- /* do client dependent actions */
- vlayer->post_layer_destroy(vlayer);
- /* free vlayer itself */
- MEM_freeN(vlayer);
- }
-
-}
-
-/*
- * callback function: new layer was created
- */
-static void cb_g_layer_create(
- void *user_data,
- VNodeID node_id,
- VLayerID layer_id,
- const char *name,
- VNGLayerType type,
- uint32 def_integer,
- real64 def_real)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode=NULL;
- struct VLayer *vlayer=NULL;
-
- if(!session) return;
-
- /* find node of this layer*/
- vnode = BLI_dlist_find_link(&(session->nodes), node_id);
- if(!vnode) return;
-
- /* when we created this layer, then subscribe to this layer */
- if(vnode->owner_id == VN_OWNER_MINE || session->flag & VERSE_AUTOSUBSCRIBE)
- verse_send_g_layer_subscribe(node_id, layer_id, 0);
-
- /* try to find */
- if(vnode->owner_id == VN_OWNER_MINE)
- vlayer = find_vlayer_in_sending_queue(vnode, layer_id);
-
- if(vlayer) {
- /* remove vlayer form sending queue add verse layer to list of verse layers */
- BLI_remlink(&((VGeomData*)vnode->data)->queue, vlayer);
- BLI_dlist_add_item_index(&((VGeomData*)vnode->data)->layers, (void*)vlayer, (unsigned int)vlayer->id);
- /* send all not sent vertexes to verse server
- * other items waiting in sending queue will be automaticaly sent to verse server,
- * when verse vertexes will be received from verse server */
- if((vlayer->type == VN_G_LAYER_VERTEX_XYZ) && (layer_id==0)) {
- struct VerseVert *vvert = (VerseVert*)vlayer->queue.first;
- while(vvert) {
- send_verse_vertex(vvert);
- vvert = vvert->next;
- }
- }
- }
- else {
- /* create new VerseLayer */
- vlayer = create_verse_layer(vnode, layer_id, name, type, def_integer, def_real);
- /* add layer to the list of VerseLayers */
- BLI_dlist_add_item_index(&(((VGeomData*)vnode->data)->layers), (void*)vlayer, (unsigned int)layer_id);
- }
-
- vlayer->flag |= LAYER_RECEIVED;
-
- /* post callback function */
- vlayer->post_layer_create(vlayer);
-}
-
-/*
- * this function will send destroy commands for all VerseVertexes and
- * VerseFaces to verse server, but it will not send destroy commands
- * for VerseLayers or geometry node, it can be used in other functions
- * (undo, destroy geom node, some edit mesh commands, ... ), parameter of
- * this function has to be geometry verse node
- */
-void destroy_geometry(VNode *vnode)
-{
- struct VLayer *vert_vlayer, *face_vlayer;
- struct VerseFace *vface;
- struct VerseVert *vvert;
-
- if(vnode->type != V_NT_GEOMETRY) return;
-
- face_vlayer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER);
- vface = face_vlayer->dl.lb.first;
-
- while(vface) {
- send_verse_face_delete(vface);
- vface = vface->next;
- }
-
- vert_vlayer = find_verse_layer_type((VGeomData*)vnode->data, VERTEX_LAYER);
- vvert = vert_vlayer->dl.lb.first;
-
- while(vvert) {
- send_verse_vertex_delete(vvert);
- vvert = vvert->next;
- }
-
- /* own destruction of local verse date will be executed, when client will
- * receive apropriate callback commands from verse server */
-}
-
-/*
- * free VGeomData
- */
-void free_geom_data(VNode *vnode)
-{
- struct VerseSession *session = vnode->session;
- struct VLayer *vlayer;
-
- if(vnode->data){
- vlayer = (VLayer*)((VGeomData*)vnode->data)->layers.lb.first;
- while(vlayer){
- /* unsubscribe from layer */
- if(session->flag & VERSE_CONNECTED)
- verse_send_g_layer_unsubscribe(vnode->id, vlayer->id);
- /* free VerseLayer data */
- free_verse_layer_data(vnode, vlayer);
- /* next layer */
- vlayer = vlayer->next;
- }
- /* free constraint between vnode and mesh */
- ((VGeomData*)vnode->data)->post_geometry_free_constraint(vnode);
- /* free all VerseLayers */
- BLI_dlist_destroy(&(((VGeomData*)vnode->data)->layers));
- /* free fake verse edges */
- BLI_freelistN(&((VGeomData*)vnode->data)->edges);
- /* free edge hash */
- MEM_freeN(((VGeomData*)vnode->data)->hash);
- }
-}
-
-void set_geometry_callbacks(void)
-{
- /* new layer created */
- verse_callback_set(verse_send_g_layer_create, cb_g_layer_create, NULL);
- /* layer was destroyed */
- verse_callback_set(verse_send_g_layer_destroy, cb_g_layer_destroy, NULL);
-
- /* position of vertex was changed */
- verse_callback_set(verse_send_g_vertex_set_xyz_real32, cb_g_vertex_set_xyz_real32, NULL);
- /* vertex was deleted */
- verse_callback_set(verse_send_g_vertex_delete_real32, cb_g_vertex_delete_real32, NULL);
-
- /* callback functions for values being associated with vertexes */
- verse_callback_set(verse_send_g_vertex_set_uint32, cb_g_vertex_set_uint32, NULL);
- verse_callback_set(verse_send_g_vertex_set_real32, cb_g_vertex_set_real32, NULL);
-
- /* new polygon was created / vertex(es) of polygon was set */
- verse_callback_set(verse_send_g_polygon_set_corner_uint32, cb_g_polygon_set_corner_uint32, NULL);
- /* polygon was deleted */
- verse_callback_set(verse_send_g_polygon_delete, cb_g_polygon_delete, NULL);
-
- /* callback functions for values being associated with polygon corners */
- verse_callback_set(verse_send_g_polygon_set_corner_real32, cb_g_polygon_set_corner_real32, NULL);
- /* callback functions for values being associated with faces */
- verse_callback_set(verse_send_g_polygon_set_face_uint8, cb_g_polygon_set_face_uint8, NULL);
- verse_callback_set(verse_send_g_polygon_set_face_uint32, cb_g_polygon_set_face_uint32, NULL);
- verse_callback_set(verse_send_g_polygon_set_face_real32, cb_g_polygon_set_face_real32, NULL);
-
- /* crease of vertex was set */
- verse_callback_set(verse_send_g_crease_set_vertex, cb_g_crease_set_vertex, NULL);
- /* crease of edge was set */
- verse_callback_set(verse_send_g_crease_set_edge, cb_g_crease_set_edge, NULL);
-}
-
-#endif
diff --git a/source/blender/blenkernel/intern/verse_method.c b/source/blender/blenkernel/intern/verse_method.c
deleted file mode 100644
index b95b302f6c6..00000000000
--- a/source/blender/blenkernel/intern/verse_method.c
+++ /dev/null
@@ -1,519 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Contributor(s): Nathan Letwory.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef WITH_VERSE
-
-#include
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_listBase.h"
-#include "DNA_userdef_types.h"
-#include "DNA_text_types.h"
-
-#include "BLI_dynamiclist.h"
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-//XXX #include "BIF_verse.h"
-
-#include "BKE_library.h"
-#include "BKE_text.h"
-#include "BKE_verse.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-
-#include "verse.h"
-
-/* helper struct for creating method descriptions */
-typedef struct VMethodInfo {
- const char *name;
- uint8 param_count;
- const VNOParamType param_type[4];
- const char *param_name[4];
- uint16 id;
-} VMethodInfo;
-
-#ifdef VERSECHAT
-/* array with methods for verse chat */
-static VMethodInfo vmethod_info[] = {
- { "join", 1, { VN_O_METHOD_PTYPE_STRING }, { "channel"}},
- { "leave", 1, { VN_O_METHOD_PTYPE_STRING }, { "channel"}},
- { "hear", 3, { VN_O_METHOD_PTYPE_STRING, VN_O_METHOD_PTYPE_STRING, VN_O_METHOD_PTYPE_STRING }, { "channel", "from", "msg"}}
-};
-#endif
-
-/* lookup a method group based on its name */
-struct VMethodGroup *lookup_vmethodgroup_name(ListBase *lb, const char *name) {
- struct VMethodGroup *vmg;
-
- for(vmg= lb->first; vmg; vmg= vmg->next)
- if(strcmp(vmg->name,name)==0) break;
-
- return vmg;
-}
-
-/* lookup a method group based on its group_id */
-struct VMethodGroup *lookup_vmethodgroup(ListBase *lb, uint16 group_id) {
- struct VMethodGroup *vmg;
-
- for(vmg= lb->first; vmg; vmg= vmg->next)
- if(vmg->group_id==group_id) break;
-
- return vmg;
-}
-
-/* lookup a method based on its name */
-struct VMethod *lookup_vmethod_name(ListBase *lb, const char *name) {
- struct VMethod *vm;
- for(vm= lb->first; vm; vm= vm->next)
- if(strcmp(vm->name,name)==0) break;
-
- return vm;
-}
-
-/* lookup a method based on its method_id */
-struct VMethod *lookup_vmethod(ListBase *lb, uint8 method_id) {
- struct VMethod *vm;
- for(vm= lb->first; vm; vm= vm->next)
- if(vm->id==method_id) break;
-
- return vm;
-}
-
-#ifdef VERSECHAT
-/*
- * send say command
- */
-void send_say(const char *chan, const char *utter)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VMethodGroup *vmg;
- struct VMethod *vm;
- VNOPackedParams *utterpack;
- VNOParam args[2];
-
- vnode= (VNode *)(session->nodes.lb.first);
-
- for( ; vnode; vnode= vnode->next) {
- if(strcmp(vnode->name, "tawksrv")==0) {
- vmg= lookup_vmethodgroup_name(&(vnode->methodgroups), "tawk");
- if(!vmg) break;
- vm= lookup_vmethod_name(&(vmg->methods), "say");
- if(!vm) break;
- args[0].vstring= (char *)chan;
- args[1].vstring= (char *)utter;
- if((utterpack= verse_method_call_pack(vm->param_count, vm->param_type, args))!=NULL) {
- verse_send_o_method_call(vnode->id, vmg->group_id, vm->id, vnode->session->avatar, utterpack);
- }
- break;
- }
-
- }
-}
-
-/*
- * send logout command
- */
-void send_logout(VNode *vnode)
-{
- struct VMethodGroup *vmg;
- struct VMethod *vm;
- VNOPackedParams *pack;
-
- vnode->chat_flag = CHAT_LOGGED;
- vmg= lookup_vmethodgroup_name(&(vnode->methodgroups), "tawk");
- if(!vmg) return;
- vm= lookup_vmethod_name(&(vmg->methods), "logout");
- if(!vm) return;
-
- if((pack= verse_method_call_pack(vm->param_count, vm->param_type, NULL))!=NULL) {
- verse_send_o_method_call(vnode->id, vmg->group_id, vm->id, vnode->session->avatar, pack);
- }
- vnode->chat_flag = CHAT_NOTLOGGED;
-}
-
-/*
- * send join command
- */
-void send_join(VNode *vnode, const char *chan)
-{
- struct VMethodGroup *vmg;
- struct VMethod *vm;
- VNOPackedParams *join;
- VNOParam channel[1];
-
- vmg= lookup_vmethodgroup_name(&(vnode->methodgroups), "tawk");
- if(!vmg) return;
- vm= lookup_vmethod_name(&(vmg->methods), "join");
- if(!vm) return;
-
- channel[0].vstring= (char *)chan;
- if((join= verse_method_call_pack(vm->param_count, vm->param_type, channel))!=NULL) {
- verse_send_o_method_call(vnode->id, vmg->group_id, vm->id, vnode->session->avatar, join);
- }
-}
-
-/*
- * send leave command
- */
-void send_leave(VNode *vnode, const char *chan)
-{
- struct VMethodGroup *vmg;
- struct VMethod *vm;
- VNOPackedParams *leave;
- VNOParam channel[1];
-
- vmg= lookup_vmethodgroup_name(&(vnode->methodgroups), "tawk");
- if(!vmg) return;
- vm= lookup_vmethod_name(&(vmg->methods), "leave");
- if(!vm) return;
-
- channel[0].vstring= (char *)chan;
- if((leave= verse_method_call_pack(vm->param_count, vm->param_type, channel))!=NULL) {
- verse_send_o_method_call(vnode->id, vmg->group_id, vm->id, vnode->session->avatar, leave);
- }
-}
-
-/*
- * send login command
- */
-void send_login(VNode *vnode)
-{
- struct VMethodGroup *vmg;
- struct VMethod *vm;
- VNOPackedParams *login;
- VNOParam param[1];
-
- vnode->chat_flag = CHAT_LOGGED;
- vmg= lookup_vmethodgroup_name(&(vnode->methodgroups), "tawk");
- if(!vmg) return;
- vm= lookup_vmethod_name(&(vmg->methods), "login");
- if(!vm) return;
-
- param[0].vstring= U.verseuser;
-
- if((login= verse_method_call_pack(vm->param_count, vm->param_type, param))!=NULL) {
- verse_send_o_method_call(vnode->id, vmg->group_id, vm->id, vnode->session->avatar, login);
- }
- vnode->chat_flag = CHAT_LOGGED;
-
- vnode= lookup_vnode(vnode->session, vnode->session->avatar);
- vmg= lookup_vmethodgroup_name(&(vnode->methodgroups), "tawk-client");
- if(!vmg)
- verse_send_o_method_group_create(vnode->session->avatar, ~0, "tawk-client");
-}
-#endif
-
-/*
- * Free a VMethod
- */
-void free_verse_method(VMethod *vm) {
- if(!vm) return;
-
- MEM_freeN(vm->param_type);
-}
-
-/*
- * Free methods for VMethodGroup
- */
-void free_verse_methodgroup(VMethodGroup *vmg)
-{
- struct VMethod *vm, *tmpvm;
-
- if(!vmg) return;
-
- vm= vmg->methods.first;
- while(vm) {
- tmpvm=vm->next;
- free_verse_method(vm);
- vm= tmpvm;
- }
- BLI_freelistN(&(vmg->methods));
-}
-
-/* callback for method group creation */
-static void cb_o_method_group_create(
- void *user_data,
- VNodeID node_id,
- uint16 group_id,
- const char *name)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VMethodGroup *vmg;
-
- if(!session) return;
-
- vnode = BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
-
- vmg = lookup_vmethodgroup(&(vnode->methodgroups), group_id);
-
- /* create method group holder in node node_id */
- if(!vmg) {
- vmg= MEM_mallocN(sizeof(VMethodGroup), "VMethodGroup");
- vmg->group_id = group_id;
- vmg->methods.first = vmg->methods.last = NULL;
- BLI_addtail(&(vnode->methodgroups), vmg);
- printf("new method group with name %s (group_id %d) for node %u created\n", name, group_id, node_id);
- }
-
- /* this ensures name of an existing group gets updated, in case it is changed */
- BLI_strncpy(vmg->name, (char *)name, 16);
-
- /* subscribe to method group */
- verse_send_o_method_group_subscribe(node_id, group_id);
-
-#ifdef VERSECHAT
- /* if this is our own method group, register our methods */
- if(node_id==session->avatar) {
- verse_send_o_method_create(node_id, group_id, (uint8)~0u, vmethod_info[0].name,
- vmethod_info[0].param_count,
- (VNOParamType *)vmethod_info[0].param_type,
- (const char **)vmethod_info[0].param_name);
- b_verse_update();
- verse_send_o_method_create(node_id, group_id, (uint8)~0u, vmethod_info[1].name,
- vmethod_info[1].param_count,
- (VNOParamType *)vmethod_info[1].param_type,
- (const char **)vmethod_info[1].param_name);
- b_verse_update();
- verse_send_o_method_create(node_id, group_id, (uint8)~0u, vmethod_info[2].name,
- vmethod_info[2].param_count,
- (VNOParamType *)vmethod_info[2].param_type,
- (const char **)vmethod_info[2].param_name);
- b_verse_update();
- }
-#endif
-}
-
-/* callback for method group destruction */
-static void cb_o_method_group_destroy(
- void *user_data,
- VNodeID node_id,
- uint16 group_id,
- const char *name)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VMethodGroup *vmg;
- struct VMethod *vm;
-
- printf("method group %d destroyed\n", group_id);
-
- if(!session) return;
-
- vnode = BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
- for(vmg= vnode->methodgroups.first; vmg; vmg= vmg->next)
- if(vmg->group_id==group_id) break;
-
- if(!vmg) return; /* method group doesn't exist? */
-
- vmg->group_id = 0;
- vmg->name[0] = '\0';
- vm= vmg->methods.first;
- while(vm) {
- /* free vm */
-
- }
-
- /* TODO: unsubscribe from method group */
- BLI_remlink(&(vnode->methodgroups),vmg);
- MEM_freeN(vmg);
-}
-
-/* callback for method creation */
-static void cb_o_method_create(
- void *user_data,
- VNodeID node_id,
- uint16 group_id,
- uint16 method_id,
- const char *name,
- uint8 param_count,
- const VNOParamType *param_type,
- const char *param_name[])
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VMethodGroup *vmg;
- struct VMethod *vm;
- unsigned int size;
- unsigned int i;
- char *put;
-
- if(!session) return;
-
- vnode = BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
-
- vmg= lookup_vmethodgroup((&vnode->methodgroups), group_id);
-
- if(!vmg) return;
-
- vm= lookup_vmethod((&vmg->methods), method_id);
-
- if(!vm) {
- vm= MEM_mallocN(sizeof(VMethod), "VMethod");
- vm->id= method_id;
- vm->param_count= param_count;
- size= param_count* (sizeof(*vm->param_type) + sizeof(*vm->param_name));
- for(i= 0; i param_type= MEM_mallocN(size, "param_type and param_name");
- memcpy(vm->param_type, param_type, sizeof(VNOParamType)*param_count);
- vm->param_name= (char **)(vm->param_type + param_count);
- put= (char *)(vm->param_name + param_count);
- for(i= 0; i < param_count; i++) {
- vm->param_name[i]= put;
- strcpy(put, param_name[i]);
- put += strlen(param_name[i]) + 1;
- }
-
- BLI_addtail(&(vmg->methods), vm);
-#ifdef VERSECHAT
- if(strcmp(vmethod_info[0].name, name)==0) {
- vmethod_info[0].id = method_id;
- }
-#endif
- printf("method %s in group %d of node %u created\n", name, group_id, node_id);
- }
-
- BLI_strncpy(vm->name, (char *)name, 500);
-}
-
-/* callback for method destruction */
-static void cb_o_method_destroy(
- void *user_data,
- VNodeID node_id,
- uint16 group_id,
- uint16 method_id,
- const char *name,
- uint8 param_count,
- const VNOParamType *param_type,
- const char *param_name[])
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VMethodGroup *vmg;
- struct VMethod *vm;
-
- if(!session) return;
-
- vnode = BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
- for(vmg= vnode->methodgroups.first; vmg; vmg= vmg->next)
- if(vmg->group_id==group_id) break;
-
- if(!vmg) return; /* method group doesn't exist? */
-
- for(vm= vmg->methods.first; vm; vm= vm->next)
- if(vm->id==method_id) break;
-
- if(!vm) return;
-
- BLI_remlink(&(vmg->methods), vm);
- MEM_freeN(vm->param_type);
- MEM_freeN(vm);
-}
-
-/* callback for method calls */
-static void cb_o_method_call(void *user_data, VNodeID node_id, uint8 group_id, uint8 method_id, VNodeID sender, VNOPackedParams *params)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VMethodGroup *vmg;
- struct VMethod *vm;
- Text *text;
- int method_idx= -1;
-
- VNOParam arg[3];
-
- if(!session) return;
-
- if(session->avatar!=node_id) return;
-
- vnode = BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
- vmg= lookup_vmethodgroup(&(vnode->methodgroups), group_id);
- if(!vmg) return;
-
- vm= lookup_vmethod(&(vmg->methods), method_id);
- if(!vm) return;
-#ifdef VERSECHAT
- if(strcmp(vm->name, "join")==0) method_idx=0;
- if(strcmp(vm->name, "leave")==0) method_idx=1;
- if(strcmp(vm->name, "hear")==0) method_idx=2;
- if(method_idx>-1)
- verse_method_call_unpack(params, vmethod_info[method_idx].param_count, vmethod_info[method_idx].param_type, arg);
-
- switch(method_idx) {
- case 0:
- printf("Joining channel %s\n",arg[0].vstring);
- text=add_empty_text();
- text->flags |= TXT_ISCHAT;
- rename_id(&(text->id), arg[0].vstring);
- break;
- case 1:
- printf("Leaving channel %s\n",arg[0].vstring);
- break;
- case 2:
- {
- ListBase lb = G.main->text;
- ID *id= (ID *)lb.first;
- char showstr[1024];
- showstr[0]='\0';
- text = NULL;
- sprintf(showstr, "%s: %s\n", arg[1].vstring, arg[2].vstring);
- for(; id; id= id->next) {
- if(strcmp(id->name+2, arg[0].vstring)==0 && strcmp(arg[0].vstring, "#server")!=0) {
- text = (Text *)id;
- break;
- }
- }
- if(text) {
- txt_insert_buf(text, showstr);
- txt_move_eof(text, 0);
-// XXX allqueue(REDRAWCHAT, 0);
- } else {
- printf("%s> %s: %s\n",arg[0].vstring, arg[1].vstring, arg[2].vstring);
- }
- }
- break;
- }
-#endif
-}
-
-void set_method_callbacks(void)
-{
- /* create and destroy method groups */
- verse_callback_set(verse_send_o_method_group_create, cb_o_method_group_create, NULL);
- verse_callback_set(verse_send_o_method_group_destroy, cb_o_method_group_destroy, NULL);
-
- /* create and destroy methods */
- verse_callback_set(verse_send_o_method_create, cb_o_method_create, NULL);
- verse_callback_set(verse_send_o_method_destroy, cb_o_method_destroy, NULL);
-
- /* call methods */
- verse_callback_set(verse_send_o_method_call, cb_o_method_call, NULL);
-}
-
-#endif
diff --git a/source/blender/blenkernel/intern/verse_node.c b/source/blender/blenkernel/intern/verse_node.c
deleted file mode 100644
index ee47896474a..00000000000
--- a/source/blender/blenkernel/intern/verse_node.c
+++ /dev/null
@@ -1,747 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Contributor(s): Jiri Hnidek.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef WITH_VERSE
-
-#include
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_listBase.h"
-#include "DNA_userdef_types.h"
-
-#include "BLI_dynamiclist.h"
-#include "BLI_blenlib.h"
-
-//XXX #include "BIF_verse.h"
-
-#include "BKE_verse.h"
-
-#include "verse.h"
-
-/* function prototypes of static functions */
- /* for tags */
-static void free_verse_tag_data(struct VTag *vtag);
-static struct VTag *find_tag_in_queue(struct VTagGroup *vtaggroup, const char *name);
-static struct VTag *create_verse_tag(struct VTagGroup *vtaggroup, uint16 tag_id, const char *name, VNTagType type, const VNTag *tag);
- /* for verse tag groups */
-static void free_verse_taggroup_data(struct VTagGroup *taggroup);
-static struct VTagGroup *find_taggroup_in_queue(struct VNode *vnode, const char *name);
-static struct VTagGroup *create_verse_taggroup(VNode *vnode, uint16 group_id, const char *name);
- /* for verse nodes */
-static void move_verse_node_to_dlist(struct VerseSession *session, VNodeID vnode_id);
- /* function prototypes of node callback functions */
-static void cb_tag_destroy(void *user_data, VNodeID node_id, uint16 group_id, uint16 tag_id);
-static void cb_tag_create(void *user_data, VNodeID node_id, uint16 group_id, uint16 tag_id, const char *name, VNTagType type, const VNTag *tag);
-static void cb_tag_group_destroy(void *user_data, VNodeID node_id, uint16 group_id);
-static void cb_tag_group_create(void *user_data, VNodeID node_id, uint16 group_id, const char *name);
-static void cb_node_name_set(void *user_data, VNodeID node_id, const char *name);
-static void cb_node_destroy(void *user_data, VNodeID node_id);
-static void cb_node_create(void *user_data, VNodeID node_id, uint8 type, VNodeID owner_id);
-
-/*
- * send new tag to verse server
- */
-void send_verse_tag(VTag *vtag)
-{
- verse_send_tag_create(vtag->vtaggroup->vnode->id,
- vtag->vtaggroup->id,
- vtag->id,
- vtag->name,
- vtag->type,
- vtag->tag);
-}
-
-/*
- * free tag data
- */
-static void free_verse_tag_data(VTag *vtag)
-{
- /* free name of verse tag */
- MEM_freeN(vtag->name);
- /* free value of tag */
- MEM_freeN(vtag->tag);
-}
-
-/*
- * try to find tag in sending queue ... if tag will be found, then
- * this function will removed tag from queue and will return pointer
- * at this tag
- */
-static VTag *find_tag_in_queue(VTagGroup *vtaggroup, const char *name)
-{
- struct VTag *vtag;
-
- vtag = vtaggroup->queue.first;
-
- while(vtag) {
- if(strcmp(vtag->name, name)==0) {
- BLI_remlink(&(vtaggroup->queue), vtag);
- break;
- }
- vtag = vtag->next;
- }
-
- return vtag;
-}
-
-/*
- * create new verse tag
- */
-static VTag *create_verse_tag(
- VTagGroup *vtaggroup,
- uint16 tag_id,
- const char *name,
- VNTagType type,
- const VNTag *tag)
-{
- struct VTag *vtag;
-
- vtag = (VTag*)MEM_mallocN(sizeof(VTag), "VTag");
-
- vtag->vtaggroup = vtaggroup;
- vtag->id = tag_id;
- vtag->name = (char*)MEM_mallocN(sizeof(char)*(strlen(name)+1), "VTag name");
- strcpy(vtag->name, name);
- vtag->type = type;
-
- vtag->tag = (VNTag*)MEM_mallocN(sizeof(VNTag), "VNTag");
- *vtag->tag = *tag;
-
- vtag->value = NULL;
-
- return vtag;
-}
-
-/*
- * send taggroup to verse server
- */
-void send_verse_taggroup(VTagGroup *vtaggroup)
-{
- verse_send_tag_group_create(
- vtaggroup->vnode->id,
- vtaggroup->id,
- vtaggroup->name);
-}
-
-/*
- * free taggroup data
- */
-static void free_verse_taggroup_data(VTagGroup *taggroup)
-{
- struct VerseSession *session = taggroup->vnode->session;
- struct VTag *vtag;
-
- vtag = taggroup->tags.lb.first;
-
- while(vtag) {
- free_verse_tag_data(vtag);
- vtag = vtag->next;
- }
-
- /* unsubscribe from taggroup */
- if(session->flag & VERSE_CONNECTED)
- verse_send_tag_group_unsubscribe(taggroup->vnode->id, taggroup->id);
-
- BLI_dlist_destroy(&(taggroup->tags));
- MEM_freeN(taggroup->name);
-}
-
-/*
- * move taggroup from queue to dynamic list with access array,
- * set up taggroup id and return pointer at this taggroup
- */
-static VTagGroup *find_taggroup_in_queue(VNode *vnode, const char *name)
-{
- struct VTagGroup *vtaggroup;
-
- vtaggroup = vnode->queue.first;
-
- while(vtaggroup) {
- if(strcmp(vtaggroup->name, name)==0) {
- BLI_remlink(&(vnode->queue), vtaggroup);
- break;
- }
- vtaggroup = vtaggroup->next;
- }
-
- return vtaggroup;
-}
-
-/*
- * create new verse group of tags
- */
-static VTagGroup *create_verse_taggroup(VNode *vnode, uint16 group_id, const char *name)
-{
- struct VTagGroup *taggroup;
-
- taggroup = (VTagGroup*)MEM_mallocN(sizeof(VTagGroup), "VTagGroup");
-
- taggroup->vnode = vnode;
- taggroup->id = group_id;
- taggroup->name = (char*)MEM_mallocN(sizeof(char)*(strlen(name)+1), "VTagGroup name");
- strcpy(taggroup->name, name);
-
- BLI_dlist_init(&(taggroup->tags));
- taggroup->queue.first = taggroup->queue.last = NULL;
-
- //XXX taggroup->post_tag_change = post_tag_change;
- //XXX taggroup->post_taggroup_create = post_taggroup_create;
-
- return taggroup;
-}
-
-/*
- * move first VerseNode waiting in sending queue to dynamic list of VerseNodes
- * (it usually happens, when "our" VerseNode was received from verse server)
- */
-static void move_verse_node_to_dlist(VerseSession *session, VNodeID vnode_id)
-{
- VNode *vnode;
-
- vnode = session->queue.first;
-
- if(vnode) {
- BLI_remlink(&(session->queue), vnode);
- BLI_dlist_add_item_index(&(session->nodes), (void*)vnode, vnode_id);
- }
-}
-
-/*
- * send VerseNode to verse server
- */
-void send_verse_node(VNode *vnode)
-{
- verse_send_node_create(
- vnode->id,
- vnode->type,
- vnode->session->avatar);
-}
-
-/*
- * free Verse Node data
- */
-void free_verse_node_data(VNode *vnode)
-{
- struct VerseSession *session = vnode->session;
- struct VTagGroup *vtaggroup;
-
- /* free node data (object, geometry, etc.) */
- switch(vnode->type){
- case V_NT_OBJECT:
- free_object_data(vnode);
- break;
- case V_NT_GEOMETRY:
- free_geom_data(vnode);
- break;
- case V_NT_BITMAP:
- free_bitmap_node_data(vnode);
- break;
- default:
- break;
- }
-
- /* free all tag groups in dynamic list with access array */
- vtaggroup = vnode->taggroups.lb.first;
- while(vtaggroup) {
- free_verse_taggroup_data(vtaggroup);
- vtaggroup = vtaggroup->next;
- }
- BLI_dlist_destroy(&(vnode->taggroups));
-
- /* free all tag groups still waiting in queue */
- vtaggroup = vnode->queue.first;
- while(vtaggroup) {
- free_verse_taggroup_data(vtaggroup);
- vtaggroup = vtaggroup->next;
- }
- BLI_freelistN(&(vnode->queue));
-
- /* unsubscribe from node */
- if(session->flag & VERSE_CONNECTED)
- verse_send_node_unsubscribe(vnode->id);
-
- /* free node name */
- MEM_freeN(vnode->name);
- vnode->name = NULL;
-
- /* free node data */
- MEM_freeN(vnode->data);
- vnode->data = NULL;
-
-}
-
-/*
- * free VerseNode
- */
-void free_verse_node(VNode *vnode)
-{
- free_verse_node_data(vnode);
-
- BLI_dlist_free_item(&(vnode->session->nodes), vnode->id);
-}
-
-/*
- * Find a Verse Node from session
- */
-VNode* lookup_vnode(VerseSession *session, VNodeID node_id)
-{
- struct VNode *vnode;
- vnode = BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
-
- return vnode;
-}
-
-/*
- * create new Verse Node
- */
-VNode* create_verse_node(VerseSession *session, VNodeID node_id, uint8 type, VNodeID owner_id)
-{
- struct VNode *vnode;
-
- vnode = (VNode*)MEM_mallocN(sizeof(VNode), "VerseNode");
-
- vnode->session = session;
- vnode->id = node_id;
- vnode->owner_id = owner_id;
- vnode->name = NULL;
- vnode->type = type;
-
- BLI_dlist_init(&(vnode->taggroups));
- vnode->queue.first = vnode->queue.last = NULL;
- vnode->methodgroups.first = vnode->methodgroups.last = NULL;
-
- vnode->data = NULL;
-
- vnode->counter = 0;
-
- vnode->flag = 0;
-#ifdef VERSECHAT
- vnode->chat_flag = CHAT_NOTLOGGED;
-#endif
-
- //XXX vnode->post_node_create = post_node_create;
- //XXX vnode->post_node_destroy = post_node_destroy;
- //XXX vnode->post_node_name_set = post_node_name_set;
-
- return vnode;
-}
-
-/*
- * callback function: tag was destroyed
- */
-static void cb_tag_destroy(
- void *user_data,
- VNodeID node_id,
- uint16 group_id,
- uint16 tag_id)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VTagGroup *vtaggroup;
- struct VTag *vtag;
-
- if(!session) return;
-
- vnode = (VNode*)BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
- if(!vnode) return;
-
- /* try to find tag group in list of tag groups */
- vtaggroup = BLI_dlist_find_link(&(vnode->taggroups), group_id);
-
- if(!vtaggroup) return;
-
- /* try to find verse tag in dynamic list of tags in tag group */
- vtag = (VTag*)BLI_dlist_find_link(&(vtaggroup->tags), tag_id);
-
- if(vtag) {
- free_verse_tag_data(vtag);
- BLI_dlist_free_item(&(vtaggroup->tags), vtag->id);
- }
-}
-
-/*
- * callback function: new tag was created
- */
-static void cb_tag_create(
- void *user_data,
- VNodeID node_id,
- uint16 group_id,
- uint16 tag_id,
- const char *name,
- VNTagType type,
- const VNTag *tag)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VTagGroup *vtaggroup;
- struct VTag *vtag;
-
- if(!session) return;
-
- vnode = (VNode*)BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
- if(!vnode) return;
-
- /* try to find tag group in list of tag groups */
- vtaggroup = BLI_dlist_find_link(&(vnode->taggroups), group_id);
-
- if(!vtaggroup) return;
-
- /* try to find verse tag in dynamic list of tags in tag group */
- vtag = (VTag*)BLI_dlist_find_link(&(vtaggroup->tags), tag_id);
-
- if(!vtag) {
- /* we will try to find vtag in sending queue */
- vtag = find_tag_in_queue(vtaggroup, name);
-
- /* when we didn't create this tag, then we will have to create one */
- if(!vtag) vtag = create_verse_tag(vtaggroup, tag_id, name, type, tag);
- else vtag->id = tag_id;
-
- /* add tag to the list of tags in tag group */
- BLI_dlist_add_item_index(&(vtaggroup->tags), vtag, tag_id);
-
- /* post change/create method */
- vtaggroup->post_tag_change(vtag);
- }
- else {
- /* this tag exists, then we will propably change value of this tag */
- if((vtag->type != type) || (strcmp(vtag->name, name)!=0)) {
- /* changes of type or name are not allowed and such
- * stupid changes will be returned back */
- send_verse_tag(vtag);
- }
- else {
- /* post change/create method */
- vtaggroup->post_tag_change(vtag);
- }
- }
-}
-
-/*
- * callback function: tag group was destroyed
- */
-static void cb_tag_group_destroy(
- void *user_data,
- VNodeID node_id,
- uint16 group_id)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VTagGroup *vtaggroup;
-
- if(!session) return;
-
- vnode = (VNode*)BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
- if(!vnode) return;
-
- vtaggroup = BLI_dlist_find_link(&(vnode->taggroups), group_id);
-
- if(vtaggroup) {
- free_verse_taggroup_data(vtaggroup);
- BLI_dlist_free_item(&(vnode->taggroups), vtaggroup->id);
- }
-}
-
-/*
- * callback function: new tag group was created
- */
-static void cb_tag_group_create(
- void *user_data,
- VNodeID node_id,
- uint16 group_id,
- const char *name)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VTagGroup *vtaggroup;
-
- if(!session) return;
-
- vnode = (VNode*)BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
- if(!vnode) return;
-
- /* name of taggroup has to begin with string "blender:" */
- if(strncmp("blender:", name, 8)) return;
-
- /* try to find tag group in list of tag groups */
- vtaggroup = BLI_dlist_find_link(&(vnode->taggroups), group_id);
-
- if(!vtaggroup) {
- /* subscribe to tag group (when new tag will be created, then blender will
- * receive command about it) */
- verse_send_tag_group_subscribe(vnode->id, group_id);
- verse_callback_update(0);
-
- /* try to find taggroup in waiting queue */
- vtaggroup = find_taggroup_in_queue(vnode, name);
-
- /* if no taggroup exist, then new has to be created */
- if(!vtaggroup) vtaggroup = create_verse_taggroup(vnode, group_id, name);
- else vtaggroup->id = group_id;
-
- /* add tag group to dynamic list with access array */
- BLI_dlist_add_item_index(&(vnode->taggroups), (void*)vtaggroup, (unsigned int)group_id);
-
- /* post create method */
- vtaggroup->post_taggroup_create(vtaggroup);
- }
- else {
- /* this taggroup exist and somebody try to change its name */
- if(strcmp(vtaggroup->name, name)!=0) {
- /* blender doesn't allow such stupid and dangerous things */
- send_verse_taggroup(vtaggroup);
- }
- }
-}
-
-/*
- * callback function: change name of node
- */
-static void cb_node_name_set(
- void *user_data,
- VNodeID node_id,
- const char *name)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
-
- if(!session) return;
-
- vnode = (VNode*)BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
- if(vnode && name) {
- if(!vnode->name) {
- vnode->name = (char*)MEM_mallocN(sizeof(char)*(strlen(name)+1), "VerseNode name");
- }
- else if(strlen(name) > strlen(vnode->name)) {
- MEM_freeN(vnode->name);
- vnode->name = (char*)MEM_mallocN(sizeof(char)*(strlen(name)+1), "VerseNode name");
- }
- strcpy(vnode->name, name);
-
- vnode->post_node_name_set(vnode);
- }
-}
-
-/*
- * callback function for deleting node
- */
-static void cb_node_destroy(
- void *user_data,
- VNodeID node_id)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
-
- if(!session) return;
-
- vnode = BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
-
- if(vnode) {
- /* remove VerseNode from dynamic list */
- BLI_dlist_rem_item(&(session->nodes), (unsigned int)node_id);
- /* do post destroy operations */
- vnode->post_node_destroy(vnode);
- /* free verse data */
- free_verse_node_data(vnode);
- /* free VerseNode */
- MEM_freeN(vnode);
- };
-}
-
-
-/*
- * callback function for new created node
- */
-static void cb_node_create(
- void *user_data,
- VNodeID node_id,
- uint8 type,
- VNodeID owner_id)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode = NULL;
-
- if(!session) return;
-
- /* subscribe to node */
- if((type==V_NT_OBJECT) || (type==V_NT_GEOMETRY) || (type==V_NT_BITMAP))
- verse_send_node_subscribe(node_id);
- else
- return;
-
- switch(type){
- case V_NT_OBJECT :
- if(owner_id==VN_OWNER_MINE) {
- struct VLink *vlink;
- /* collect VerseNode from VerseNode queue */
- move_verse_node_to_dlist(session, node_id);
- /* send next VerseNode waiting in queue */
- if(session->queue.first) send_verse_node(session->queue.first);
- /* get received VerseNode from list of VerseNodes */
- vnode = BLI_dlist_find_link(&(session->nodes), node_id);
- /* set up ID */
- vnode->id = node_id;
- /* set up flags */
- vnode->flag |= NODE_RECEIVED;
- /* find unsent link pointing at this VerseNode */
- vlink = find_unsent_child_vlink(session, vnode);
- /* send VerseLink */
- if(vlink) send_verse_link(vlink);
- /* send name of object node */
- verse_send_node_name_set(node_id, vnode->name);
- /* subscribe to changes of object node transformations */
- verse_send_o_transform_subscribe(node_id, 0);
- /* send object transformation matrix */
- send_verse_object_position(vnode);
- send_verse_object_rotation(vnode);
- send_verse_object_scale(vnode);
- }
- else {
- /* create new VerseNode */
- vnode = create_verse_node(session, node_id, type, owner_id);
- /* add VerseNode to list of nodes */
- BLI_dlist_add_item_index(&(session->nodes), (void*)vnode, (unsigned int)node_id);
- /* set up flags */
- vnode->flag |= NODE_RECEIVED;
- /* create object data */
- vnode->data = create_object_data();
- /* set up avatar's name */
- if(node_id == session->avatar) {
- verse_send_node_name_set(node_id, U.verseuser);
- }
- else if(session->flag & VERSE_AUTOSUBSCRIBE) {
- /* subscribe to changes of object node transformations */
- verse_send_o_transform_subscribe(node_id, 0);
- }
- }
- break;
- case V_NT_GEOMETRY :
- if(owner_id==VN_OWNER_MINE){
- struct VLink *vlink;
- struct VLayer *vlayer;
- /* collect VerseNode from VerseNode queue */
- move_verse_node_to_dlist(session, node_id);
- /* send next VerseNode waiting in queue */
- if(session->queue.first) send_verse_node(session->queue.first);
- /* get received VerseNode from list of VerseNodes */
- vnode = BLI_dlist_find_link(&(session->nodes), node_id);
- /* set up ID */
- vnode->id = node_id;
- /* set up flags */
- vnode->flag |= NODE_RECEIVED;
- /* find unsent link pointing at this VerseNode */
- vlink = find_unsent_parent_vlink(session, vnode);
- /* send VerseLink */
- if(vlink) send_verse_link(vlink);
- /* send name of geometry node */
- verse_send_node_name_set(node_id, vnode->name);
- /* send all not sent layer to verse server */
- vlayer = (VLayer*)((VGeomData*)vnode->data)->queue.first;
- if(vlayer) {
- while(vlayer) {
- send_verse_layer(vlayer);
- vlayer = vlayer->next;
- }
- }
- else {
- /* send two verse layers to verse server */
-/* verse_send_g_layer_create(node_id, 0, "vertex", VN_G_LAYER_VERTEX_XYZ, 0, 0);
- verse_send_g_layer_create(node_id, 1, "polygon", VN_G_LAYER_POLYGON_CORNER_UINT32, 0, 0);*/
- }
- }
- else {
- /* create new VerseNode*/
- vnode = create_verse_node(session, node_id, type, owner_id);
- /* add VerseNode to dlist of nodes */
- BLI_dlist_add_item_index(&(session->nodes), (void*)vnode, (unsigned int)node_id);
- /* set up flags */
- vnode->flag |= NODE_RECEIVED;
- /* create geometry data */
- vnode->data = (void*)create_geometry_data();
- }
- break;
- case V_NT_BITMAP :
- if(owner_id==VN_OWNER_MINE) {
- /* collect VerseNode from VerseNode queue */
- move_verse_node_to_dlist(session, node_id);
- /* send next VerseNode waiting in queue */
- if(session->queue.first) send_verse_node(session->queue.first);
- /* get received VerseNode from list of VerseNodes */
- vnode = BLI_dlist_find_link(&(session->nodes), node_id);
- /* set up ID */
- vnode->id = node_id;
- /* set up flags */
- vnode->flag |= NODE_RECEIVED;
- /* send name of object node */
- verse_send_node_name_set(node_id, vnode->name);
- /* send dimension of image to verse server */
- verse_send_b_dimensions_set(node_id,
- ((VBitmapData*)vnode->data)->width,
- ((VBitmapData*)vnode->data)->height,
- ((VBitmapData*)vnode->data)->depth);
- }
- else {
- /* create new VerseNode*/
- vnode = create_verse_node(session, node_id, type, owner_id);
- /* add VerseNode to dlist of nodes */
- BLI_dlist_add_item_index(&(session->nodes), (void*)vnode, (unsigned int)node_id);
- /* set up flags */
- vnode->flag |= NODE_RECEIVED;
- /* create bitmap data */
- vnode->data = (void*)create_bitmap_data();
- }
- break;
- default:
- vnode = NULL;
- break;
- }
-
- if(vnode) vnode->post_node_create(vnode);
-}
-
-/*
- * set up all callbacks for verse nodes
- */
-void set_node_callbacks(void)
-{
- /* new node created */
- verse_callback_set(verse_send_node_create, cb_node_create, NULL);
- /* node was deleted */
- verse_callback_set(verse_send_node_destroy, cb_node_destroy, NULL);
- /* name of node was set */
- verse_callback_set(verse_send_node_name_set, cb_node_name_set, NULL);
-
- /* new tag group was created */
- verse_callback_set(verse_send_tag_group_create, cb_tag_group_create, NULL);
- /* tag group was destroy */
- verse_callback_set(verse_send_tag_group_destroy, cb_tag_group_destroy, NULL);
-
- /* new tag was created */
- verse_callback_set(verse_send_tag_create, cb_tag_create, NULL);
- /* tag was destroy */
- verse_callback_set(verse_send_tag_destroy, cb_tag_destroy, NULL);
-}
-
-#endif
diff --git a/source/blender/blenkernel/intern/verse_object_node.c b/source/blender/blenkernel/intern/verse_object_node.c
deleted file mode 100644
index e7827c8dc46..00000000000
--- a/source/blender/blenkernel/intern/verse_object_node.c
+++ /dev/null
@@ -1,617 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Contributor(s): Jiri Hnidek.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef WITH_VERSE
-
-#include
-#include
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_listBase.h"
-#include "DNA_userdef_types.h"
-
-#include "BLI_dynamiclist.h"
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-//XXX #include "BIF_verse.h"
-
-#include "BKE_verse.h"
-#include "BKE_utildefines.h"
-
-#include "verse.h"
-
-/* function prototypes of static functions */
-
-/* callback functions */
-static void cb_o_transform_pos_real32(void *user_data, VNodeID node_id, uint32 time_s, uint32 time_f, const real32 *pos, const real32 *speed, const real32 *accelerate, const real32 *drag_normal, real32 drag);
-static void cb_o_transform_rot_real32(void *user_data, VNodeID node_id, uint32 time_s, uint32 time_f, const VNQuat32 *temp, const VNQuat32 *speed, const VNQuat32 *accelerate, const VNQuat32 *drag_normal, real32 drag);
-static void cb_o_transform_scale_real32(void *user_data, VNodeID node_id, real32 scale_x, real32 scale_y, real32 scale_z);
-static void cb_o_link_set(void *user_data, VNodeID node_id, uint16 link_id, VNodeID link, const char *label, uint32 target_id);
-static void cb_o_link_destroy(void *user_data, VNodeID node_id,uint16 link_id);
-
-/* other functions */
-static void set_target_node_link_pointer(struct VNode *vnode, struct VLink *vlink);
-static void free_verse_link_data(struct VLink *vlink);
-
-/*
- * find noy sent VerseLink in queue
- */
-VLink *find_unsent_child_vlink(VerseSession *session, VNode *vnode)
-{
- struct VLink *vlink;
-
- if(vnode->type!=V_NT_OBJECT) return NULL;
-
- vlink = ((VObjectData*)vnode->data)->queue.first;
- while(vlink) {
- if(vlink->target->id != -1) {
- printf("\t vlink found, vnode target id %d\n", vlink->target->id);
- return vlink;
- }
- vlink = vlink->next;
- }
- return NULL;
-}
-
-/*
- * find unsent VerseLink "pointing at this VerseNode"
- */
-VLink *find_unsent_parent_vlink(VerseSession *session, VNode *vnode)
-{
- struct VNode *tmp;
- struct VLink *vlink;
-
- tmp = session->nodes.lb.first;
-
- while(tmp) {
- if(tmp->type==V_NT_OBJECT) {
- vlink = ((VObjectData*)tmp->data)->queue.first;
- while(vlink) {
- if(vlink->target == vnode)
- return vlink;
- vlink = vlink->next;
- }
- }
- tmp = tmp->next;
- }
- return NULL;
-}
-
-/*
- * send object position to verse server
- */
-void send_verse_object_position(VNode *vnode)
-{
- float tmp;
-
- ((VObjectData*)vnode->data)->flag &= ~POS_SEND_READY;
-
- /* we have to do rotation around x axis (+pi/2) to be
- compatible with other verse applications */
- tmp = -((VObjectData*)vnode->data)->pos[1];
- ((VObjectData*)vnode->data)->pos[1] = ((VObjectData*)vnode->data)->pos[2];
- ((VObjectData*)vnode->data)->pos[2] = tmp;
-
- verse_send_o_transform_pos_real32(
- vnode->id, /* node id */
- 0, /* time_s ... no interpolation */
- 0, /* time_f ... no interpolation */
- ((VObjectData*)vnode->data)->pos,
- NULL, /* speed ... no interpolation */
- NULL, /* accelerate ... no interpolation */
- NULL, /* drag normal ... no interpolation */
- 0.0); /* drag ... no interpolation */
-}
-
-/*
- * send object rotation to verse server
- */
-void send_verse_object_rotation(VNode *vnode)
-{
- VNQuat32 quat;
- float q[4] = {cos(-M_PI/4), -sin(-M_PI/4), 0, 0}, v[4], tmp[4];
-
- /* inverse transformation to transformation in function cb_o_transform_rot_real32 */
- QuatMul(v, ((VObjectData*)vnode->data)->quat, q);
- q[1]= sin(-M_PI/4);
- QuatMul(tmp, q, v);
-
- quat.x = tmp[1];
- quat.y = tmp[2];
- quat.z = tmp[3];
- quat.w = tmp[0];
-
- ((VObjectData*)vnode->data)->flag &= ~ROT_SEND_READY;
-
- verse_send_o_transform_rot_real32(
- vnode->id, /* node id */
- 0, /* time_s ... no interpolation */
- 0, /* time_f ... no interpolation */
- &quat,
- NULL, /* speed ... no interpolation */
- NULL, /* accelerate ... no interpolation */
- NULL, /* drag normal ... no interpolation */
- 0.0); /* drag ... no interpolation */
-}
-
-/*
- * send object rotation to verse server
- */
-void send_verse_object_scale(VNode *vnode)
-{
- float tmp;
-
- ((VObjectData*)vnode->data)->flag &= ~SCALE_SEND_READY;
-
- /* we have to do rotation around x axis (+pi/2) to be
- compatible with other verse applications */
- tmp = ((VObjectData*)vnode->data)->scale[1];
- ((VObjectData*)vnode->data)->scale[1] = ((VObjectData*)vnode->data)->scale[2];
- ((VObjectData*)vnode->data)->scale[2] = tmp;
-
- verse_send_o_transform_scale_real32(
- vnode->id,
- ((VObjectData*)vnode->data)->scale[0],
- ((VObjectData*)vnode->data)->scale[1],
- ((VObjectData*)vnode->data)->scale[2]);
-}
-
-/*
- * send VerseLink to verse server
- */
-void send_verse_link(VLink *vlink)
-{
- verse_session_set(vlink->session->vsession);
-
- verse_send_o_link_set(
- vlink->source->id,
- vlink->id,
- vlink->target->id,
- vlink->label,
- vlink->target_id);
-}
-
-/*
- * set up pointer at VerseLink of target node (geometry node, material node, etc.)
- */
-static void set_target_node_link_pointer(VNode *vnode, VLink *vlink)
-{
- switch (vnode->type) {
- case V_NT_GEOMETRY:
- ((VGeomData*)vnode->data)->vlink = vlink;
- break;
- default:
- break;
- }
-}
-
-/*
- * free VerseLink and it's label
- */
-static void free_verse_link_data(VLink *vlink)
-{
- MEM_freeN(vlink->label);
-}
-
-/*
- * create new VerseLink
- */
-VLink *create_verse_link(
- VerseSession *session,
- VNode *source,
- VNode *target,
- uint16 link_id,
- uint32 target_id,
- const char *label)
-{
- struct VLink *vlink;
-
- vlink = (VLink*)MEM_mallocN(sizeof(VLink), "VerseLink");
- vlink->session = session;
- vlink->source = source;
- vlink->target = target;
- vlink->id = link_id;
- vlink->target_id = target_id;
-
- set_target_node_link_pointer(target, vlink);
-
- vlink->label = (char*)MEM_mallocN(sizeof(char)*(strlen(label)+1), "VerseLink label");
- vlink->label[0] = '\0';
- strcat(vlink->label, label);
-
- vlink->flag = 0;
-
- //XXX vlink->post_link_set = post_link_set;
- //XXX vlink->post_link_destroy = post_link_destroy;
-
- return vlink;
-}
-
-/*
- * free ObjectData (links, links in queue and lables of links)
- */
-void free_object_data(VNode *vnode)
-{
- struct VerseSession *session = vnode->session;
- struct VObjectData *obj = (VObjectData*)vnode->data;
- struct VLink *vlink;
- struct VMethodGroup *vmg;
-
- if(!obj) return;
-
- /* free all labels of links in dlist */
- vlink = obj->links.lb.first;
- while(vlink){
- free_verse_link_data(vlink);
- vlink = vlink->next;
- }
-
- /* free all labels of links waiting in queue */
- vlink = obj->queue.first;
- while(vlink){
- free_verse_link_data(vlink);
- vlink = vlink->next;
- }
- /* free dynamic list and sendig queue of links */
- BLI_dlist_destroy(&(obj->links));
- BLI_freelistN(&(obj->queue));
-
- /* free method groups and their methods */
- for(vmg = vnode->methodgroups.first; vmg; vmg= vmg->next) {
- free_verse_methodgroup(vmg);
- }
- BLI_freelistN(&(vnode->methodgroups));
-
- /* free constraint between VerseNode and Object */
- obj->post_object_free_constraint(vnode);
-
- /* unsubscribe from receiving changes of transformation matrix */
- if(session->flag & VERSE_CONNECTED)
- verse_send_o_transform_unsubscribe(vnode->id, 0);
-}
-
-/*
- * create new object data
- */
-VObjectData *create_object_data(void)
-{
- VObjectData *obj;
-
- obj = (VObjectData*)MEM_mallocN(sizeof(VObjectData), "VerseObjectData");
- obj->object = NULL;
- BLI_dlist_init(&(obj->links));
- obj->queue.first = obj->queue.last = NULL;
- obj->flag = 0;
-
- /* transformation matrix */
- obj->pos[0] = obj->pos[1] = obj->pos[2] = 0.0;
- obj->quat[0] = obj->quat[1] = obj->quat[2] = 0.0; obj->quat[3] = 1;
- obj->scale[0] = obj->scale[1] = obj->scale[2] = 1.0;
-
- /* transformation flags */
- obj->flag |= POS_SEND_READY;
- obj->flag |= ROT_SEND_READY;
- obj->flag |= SCALE_SEND_READY;
-
- /* set up pointers at post callback functions */
-/* obj->post_transform = post_transform;*/
- //XXX obj->post_transform_pos = post_transform_pos;
- //XXX obj->post_transform_rot = post_transform_rot;
- //XXX obj->post_transform_scale = post_transform_scale;
- //XXX obj->post_object_free_constraint = post_object_free_constraint;
-
- return obj;
-}
-
-/*
- * callback function:
- */
-static void cb_o_transform_pos_real32(
- void *user_data,
- VNodeID node_id,
- uint32 time_s,
- uint32 time_f,
- const real32 *pos,
- const real32 *speed,
- const real32 *accelerate,
- const real32 *drag_normal,
- real32 drag)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- float vec[3], dt, tmp;
-
- if(!session) return;
-
- vnode = BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
-
- ((VObjectData*)vnode->data)->flag |= POS_SEND_READY;
-
- /* verse server sends automaticaly some stupid default values ...
- * we have to ignore these values, when we created this object node */
- if( (vnode->owner_id==VN_OWNER_MINE) && !(((VObjectData*)vnode->data)->flag & POS_RECEIVE_READY) ) {
- ((VObjectData*)vnode->data)->flag |= POS_RECEIVE_READY;
- return;
- }
-
- dt = time_s + time_f/(0xffff);
-
- if(pos) {
- vec[0] = pos[0];
- vec[1] = pos[1];
- vec[2] = pos[2];
- }
- else {
- vec[0] = 0.0f;
- vec[1] = 0.0f;
- vec[2] = 0.0f;
- }
-
- if(speed) {
- vec[0] += speed[0]*dt;
- vec[1] += speed[1]*dt;
- vec[2] += speed[2]*dt;
- }
-
- if(accelerate) {
- vec[0] += accelerate[0]*dt*dt/2;
- vec[1] += accelerate[1]*dt*dt/2;
- vec[2] += accelerate[2]*dt*dt/2;
- }
-
- /* we have to do rotation around x axis (+pi/2) to be
- compatible with other verse applications */
- tmp = vec[1];
- vec[1] = -vec[2];
- vec[2] = tmp;
-
- if( (((VObjectData*)vnode->data)->pos[0] != vec[0]) ||
- (((VObjectData*)vnode->data)->pos[1] != vec[1]) ||
- (((VObjectData*)vnode->data)->pos[2] != vec[2]))
- {
- ((VObjectData*)vnode->data)->pos[0] = vec[0];
- ((VObjectData*)vnode->data)->pos[1] = vec[1];
- ((VObjectData*)vnode->data)->pos[2] = vec[2];
-
- ((VObjectData*)vnode->data)->post_transform_pos(vnode);
- }
-}
-
-/*
- * callback function:
- */
-static void cb_o_transform_rot_real32(
- void *user_data,
- VNodeID node_id,
- uint32 time_s,
- uint32 time_f,
- const VNQuat32 *quat,
- const VNQuat32 *speed,
- const VNQuat32 *accelerate,
- const VNQuat32 *drag_normal,
- real32 drag)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- float temp[4]={0, 0, 0, 0}, v[4], dt; /* temporary quaternions */
- float q[4]={cos(M_PI/4), -sin(M_PI/4), 0, 0}; /* conjugate quaternion (represents rotation
- around x-axis +90 degrees) */
-
- if(!session) return;
-
- vnode = BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
-
- ((VObjectData*)vnode->data)->flag |= ROT_SEND_READY;
-
- /* verse server sends automaticaly some stupid default values ...
- * we have to ignore these values, when we created this object node */
- if( (vnode->owner_id==VN_OWNER_MINE) && !(((VObjectData*)vnode->data)->flag & ROT_RECEIVE_READY) ) {
- ((VObjectData*)vnode->data)->flag |= ROT_RECEIVE_READY;
- return;
- }
-
- dt = time_s + time_f/(0xffff);
-
- if(quat) {
- temp[1] = quat->x;
- temp[2] = quat->y;
- temp[3] = quat->z;
- temp[0] = quat->w;
- }
-
- if(speed) {
- temp[1] += speed->x*dt;
- temp[2] += speed->y*dt;
- temp[3] += speed->z*dt;
- temp[0] += speed->w*dt;
- }
-
- if(accelerate) {
- temp[1] += accelerate->x*dt*dt/2;
- temp[2] += accelerate->y*dt*dt/2;
- temp[3] += accelerate->z*dt*dt/2;
- temp[0] += accelerate->w*dt*dt/2;
- }
-
- /* following matematical operation transform rotation:
- *
- * v' = quaternion * v * conjugate_quaternion
- *
- *, where v is original representation of rotation */
-
- QuatMul(v, temp, q);
- q[1]= sin(M_PI/4); /* normal quaternion */
- QuatMul(temp, q, v);
-
- if( (((VObjectData*)vnode->data)->quat[0] != temp[0]) ||
- (((VObjectData*)vnode->data)->quat[1] != temp[1]) ||
- (((VObjectData*)vnode->data)->quat[2] != temp[2]) ||
- (((VObjectData*)vnode->data)->quat[3] != temp[3]))
- {
- QUATCOPY(((VObjectData*)vnode->data)->quat, temp);
-
- ((VObjectData*)vnode->data)->post_transform_rot(vnode);
- }
-}
-
-/*
- * callback function:
- */
-static void cb_o_transform_scale_real32(
- void *user_data,
- VNodeID node_id,
- real32 scale_x,
- real32 scale_y,
- real32 scale_z)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- real32 tmp;
-
- if(!session) return;
-
- vnode = BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
-
- ((VObjectData*)vnode->data)->flag |= SCALE_SEND_READY;
-
- /* verse server sends automaticaly some stupid default values ...
- * we have to ignore these values, when we created this object node */
- if( (vnode->owner_id==VN_OWNER_MINE) && !(((VObjectData*)vnode->data)->flag & SCALE_RECEIVE_READY) ) {
- ((VObjectData*)vnode->data)->flag |= SCALE_RECEIVE_READY;
- return;
- }
-
- /* flip axis (verse spec) */
- tmp = scale_y;
- scale_y = scale_z;
- scale_z = tmp;
-
- /* z and y axis are flipped here too */
- if( (((VObjectData*)vnode->data)->scale[0] != scale_x) ||
- (((VObjectData*)vnode->data)->scale[1] != scale_y) ||
- (((VObjectData*)vnode->data)->scale[2] != scale_z))
- {
- ((VObjectData*)vnode->data)->scale[0] = scale_x;
- ((VObjectData*)vnode->data)->scale[1] = scale_y;
- ((VObjectData*)vnode->data)->scale[2] = scale_z;
-
- ((VObjectData*)vnode->data)->post_transform_scale(vnode);
- }
-}
-
-/*
- * callback function: link between object node and some other node was created
- */
-static void cb_o_link_set(
- void *user_data,
- VNodeID node_id,
- uint16 link_id,
- VNodeID link,
- const char *label,
- uint32 target_id)
-{
- struct VLink *vlink;
- struct VNode *source;
- struct VNode *target;
-
- struct VerseSession *session = (VerseSession*)current_verse_session();
-
- if(!session) return;
-
- source = BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
- target = BLI_dlist_find_link(&(session->nodes), (unsigned int)link);
-
- if(!(source && target)) return;
-
- vlink = ((VObjectData*)source->data)->queue.first;
-
- if(vlink && (vlink->source==source) && (vlink->target==target)) {
- /* remove VerseLink from sending queue */
- BLI_remlink(&(((VObjectData*)source->data)->queue), vlink);
- /* add VerseLink to dynamic list of VerseLinks */
- BLI_dlist_add_item_index(&(((VObjectData*)source->data)->links), vlink, (unsigned int)link_id);
- /* send next link from sending queue */
- if(((VObjectData*)source->data)->queue.first)
- send_verse_link(((VObjectData*)source->data)->queue.first);
- /* set up VerseLink variables */
- vlink->flag = 0;
- vlink->id = link_id;
- vlink->target_id = target_id;
- }
- else {
- /* create new VerseLink */
- vlink = create_verse_link(session, source, target, link_id, target_id, label);
- /* add VerseLink to dynamic list of VerseLinks */
- BLI_dlist_add_item_index(&(((VObjectData*)source->data)->links), vlink, (unsigned int)link_id);
- }
-
- target->counter++;
-
- vlink->post_link_set(vlink);
-}
-
-/*
- * callback function: destroy link between two VerseNodes
- */
-static void cb_o_link_destroy(
- void *user_data,
- VNodeID node_id,
- uint16 link_id)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VNode *vnode;
- struct VLink *vlink;
-
- if(!session) return;
-
- vnode = BLI_dlist_find_link(&(session->nodes), (unsigned int)node_id);
-
- vlink = BLI_dlist_find_link(&(((VObjectData*)vnode->data)->links), link_id);
-
- if(vlink) {
- vlink->target->counter--;
- free_verse_link_data(vlink);
- BLI_dlist_free_item(&(((VObjectData*)vnode->data)->links), link_id);
- }
-
- vlink->post_link_destroy(vlink);
-}
-
-void set_object_callbacks(void)
-{
- /* position of object was changed */
- verse_callback_set(verse_send_o_transform_pos_real32, cb_o_transform_pos_real32, NULL);
- /* rotation of object was changed */
- verse_callback_set(verse_send_o_transform_rot_real32, cb_o_transform_rot_real32, NULL);
- /* size of object was changed */
- verse_callback_set(verse_send_o_transform_scale_real32, cb_o_transform_scale_real32, NULL);
- /* new link between nodes was created */
- verse_callback_set(verse_send_o_link_set, cb_o_link_set, NULL);
- /* link between nodes was destroyed */
- verse_callback_set(verse_send_o_link_destroy, cb_o_link_destroy, NULL);
-}
-
-#endif
diff --git a/source/blender/blenkernel/intern/verse_session.c b/source/blender/blenkernel/intern/verse_session.c
deleted file mode 100644
index 9771c8a46de..00000000000
--- a/source/blender/blenkernel/intern/verse_session.c
+++ /dev/null
@@ -1,478 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Contributor(s): Jiri Hnidek.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef WITH_VERSE
-
-#include
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_mesh_types.h" /* temp */
-#include "DNA_listBase.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BLI_dynamiclist.h"
-#include "BLI_blenlib.h"
-
-//XXX #include "BIF_screen.h"
-//XXX #include "BIF_verse.h"
-
-#include "BKE_global.h"
-#include "BKE_verse.h"
-
-struct ListBase session_list={NULL, NULL};
-struct ListBase server_list={NULL, NULL};
-
-static int cb_ping_registered = 0;
-
-/* list of static function prototypes */
-static void cb_connect_terminate(const char *address, const char *bye);
-static void cb_connect_accept(void *user_data, uint32 avatar, void *address, void *connection, const uint8 *host_id);
-static void set_all_callbacks(void);
-static void free_verse_session_data(struct VerseSession *session);
-static void add_verse_server(VMSServer *server);
-static void check_connection_state(struct VerseServer *server);
-
-static void check_connection_state(struct VerseServer *server)
-{
- struct VerseSession *session;
- session = session_list.first;
- while(session) {
- if(strcmp(server->ip,session->address)==0) {
- server->flag = session->flag;
- return;
- }
- session = session->next;
- }
-}
-/*
- * add verse server to server_list. Prevents duplicate
- * entries
- */
-static void add_verse_server(VMSServer *server)
-{
- struct VerseServer *iter, *niter;
- VerseServer *newserver;
- const char *name = verse_ms_field_value(server, "DE");
- iter = server_list.first;
-
- while(iter) {
- niter = iter->next;
- if(strcmp(iter->ip, server->ip)==0) {
- return;
- }
- iter = niter;
- }
-
- newserver = (VerseServer *)MEM_mallocN(sizeof(VerseServer), "VerseServer");
- newserver->ip = (char *)MEM_mallocN(sizeof(char)*(strlen(server->ip)+1), "VerseServer ip");
- strcpy(newserver->ip, server->ip);
-
- if(name) {
- newserver->name = (char *)MEM_mallocN(sizeof(char)*(strlen(name)+strlen(newserver->ip)+4), "VerseServer name");
- strcpy(newserver->name, name);
- strcat(newserver->name, " (");
- strcat(newserver->name, newserver->ip);
- strcat(newserver->name, ")");
- }
-
- newserver->flag = 0;
- check_connection_state(newserver);
-
- printf("Adding new verse server: %s at %s\n", newserver->name, newserver->ip);
-
- BLI_addtail(&server_list, newserver);
- //XXX post_server_add();
-}
-
-/*
- * callback function for ping
- */
-static void cb_ping(void *user, const char *address, const char *message)
-{
- VMSServer **servers = verse_ms_list_parse(message);
- if(servers != NULL)
- {
- int i;
-
- for(i = 0; servers[i] != NULL; i++)
- add_verse_server(servers[i]);
-
- free(servers);
- }
-}
-
-/*
- * callback function for connection terminated
- */
-static void cb_connect_terminate(const char *address, const char *bye)
-{
- VerseSession *session = (VerseSession*)current_verse_session();
-
- if(!session) return;
-
- /* remove session from list of session */
- BLI_remlink(&session_list, session);
- /* do post connect operations */
- session->post_connect_terminated(session);
- /* free session data */
- free_verse_session_data(session);
- /* free session */
- MEM_freeN(session);
-}
-
-/*
- * callback function for accepted connection to verse server
- */
-static void cb_connect_accept(
- void *user_data,
- uint32 avatar,
- void *address,
- void *connection,
- const uint8 *host_id)
-{
- struct VerseSession *session = (VerseSession*)current_verse_session();
- struct VerseServer *server = server_list.first;
- uint32 i, mask=0;
-
- if(!session) return;
-
- session->flag |= VERSE_CONNECTED;
- session->flag &= ~VERSE_CONNECTING;
-
- while(server) {
- if(strcmp(session->address, server->ip)==0) {
- server->flag |= VERSE_CONNECTED;
- server->flag &= ~VERSE_CONNECTING;
- server->session = session;
- break;
- }
- server = server->next;
- }
-
- printf("\tBlender is connected to verse server: %s\n", (char*)address);
- printf("\tVerseSession->counter: %d\n", session->counter);
-
- session->avatar = avatar;
-
- session->post_connect_accept(session);
-
- for(i = 0; i < V_NT_NUM_TYPES; i++)
- mask = mask | (1 << i);
- verse_send_node_index_subscribe(mask);
- verse_send_node_subscribe(session->avatar); /* subscribe to avatar node, as well */
-
- /* create our own method group and method */
- /*verse_send_o_method_group_create(session->avatar, ~0, "tawk-client");*/
-}
-
-/*
- * set up all callbacks for sessions
- */
-void set_verse_session_callbacks(void)
-{
- /* connection */
- verse_callback_set(verse_send_connect_accept, cb_connect_accept, NULL);
- /* connection was terminated */
- verse_callback_set(verse_send_connect_terminate, cb_connect_terminate, NULL);
-
-}
-
-/*
- * set all callbacks used in Blender
- */
-static void set_all_callbacks(void)
-{
- /* set up all callbacks for sessions */
- set_verse_session_callbacks();
-
- /* set up callbacks for nodes */
- set_node_callbacks();
-
- /* set up all callbacks for object nodes */
- set_object_callbacks();
-
- /* set up all callbacks for geometry nodes */
- set_geometry_callbacks();
-
- /* set up all callbacks for bitmap nodes */
- set_bitmap_callbacks();
-
- /* set up all callbacks for method groups and methods */
- set_method_callbacks();
-}
-
-/*
- * this function sends and receive all packets for all sessions
- */
-void b_verse_update(void)
-{
- VerseSession *session, *next_session;
-
- session = session_list.first;
- while(session){
- next_session = session->next;
- verse_session_set(session->vsession);
- if((session->flag & VERSE_CONNECTED) || (session->flag & VERSE_CONNECTING)) {
- verse_callback_update(10);
- session->post_connect_update(session);
- }
- session = next_session;
- }
- if(cb_ping_registered>0) {
- verse_callback_update(10);
- }
-}
-
-/*
- * returns VerseSession coresponding to vsession pointer
- */
-VerseSession *versesession_from_vsession(VSession *vsession)
-{
- struct VerseSession *session;
-
- session = session_list.first;
-
- while(session) {
- if(session->vsession==vsession) return session;
- session = session->next;
- }
-
- return session;
-}
-
-/*
- * returns pointer at current VerseSession
- */
-VerseSession *current_verse_session(void)
-{
- struct VerseSession *session;
- VSession vsession = verse_session_get();
-
- session = session_list.first;
-
- while(session){
- if(session->vsession == vsession)
- return session;
- session = session->next;
- }
-
- printf("error: non-existing SESSION occured!\n");
- return NULL;
-}
-
-/*
- * free VerseSession
- */
-static void free_verse_session_data(VerseSession *session)
-{
- struct VNode *vnode;
-
- /* free data of all nodes */
- vnode = session->nodes.lb.first;
- while(vnode){
- free_verse_node_data(vnode);
- vnode = vnode->next;
- }
-
- /* free data of nodes waiting in queue */
- vnode = session->queue.first;
- while(vnode){
- free_verse_node_data(vnode);
- vnode = vnode->next;
- }
-
- /* free all VerseNodes */
- BLI_dlist_destroy(&(session->nodes));
- /* free all VerseNodes waiting in queque */
- BLI_freelistN(&(session->queue));
-
- /* free name of verse host for this session */
- MEM_freeN(session->address);
-}
-
-/*
- * free VerseSession
- */
-void free_verse_session(VerseSession *session)
-{
- /* remove session from session list*/
- BLI_remlink(&session_list, session);
- /* do post terminated operations */
- session->post_connect_terminated(session);
- /* free session data (nodes, layers) */
- free_verse_session_data(session);
- /* free session */
- MEM_freeN(session);
-}
-
-/*
- * create new verse session and return coresponding data structure
- */
-VerseSession *create_verse_session(
- const char *name,
- const char *pass,
- const char *address,
- uint8 *expected_key)
-{
- struct VerseSession *session;
- VSession *vsession;
-
- vsession = verse_send_connect(name, pass, address, expected_key);
-
- if(!vsession) return NULL;
-
- session = (VerseSession*)MEM_mallocN(sizeof(VerseSession), "VerseSession");
-
- session->flag = VERSE_CONNECTING;
-
- session->vsession = vsession;
- session->avatar = -1;
-
- session->address = (char*)MEM_mallocN(sizeof(char)*(strlen(address)+1),"session adress name");
- strcpy(session->address, address);
-
- session->connection = NULL;
- session->host_id = NULL;
- session->counter = 0;
-
- /* initialize dynamic list of nodes and node queue */
- BLI_dlist_init(&(session->nodes));
- session->queue.first = session->queue.last = NULL;
-
- /* set up all client dependent functions */
- //XXX session->post_connect_accept = post_connect_accept;
- //XXX session->post_connect_terminated = post_connect_terminated;
- //XXX session->post_connect_update = post_connect_update;
-
- //XXX post_server_add();
-
- return session;
-}
-
-/*
- * end verse session and free all session data
- */
-void end_verse_session(VerseSession *session)
-{
- /* send terminate command to verse server */
- verse_send_connect_terminate(session->address, "blender: bye bye");
- /* update callbacks */
- verse_callback_update(1000);
- /* send destroy session command to verse server */
- verse_session_destroy(session->vsession);
- /* set up flag of verse session */
- session->flag &= ~VERSE_CONNECTED;
- /* do post connect operations */
- session->post_connect_terminated(session);
- /* free structure of verse session */
- free_verse_session(session);
-}
-
-void free_all_servers(void)
-{
- VerseServer *server, *nextserver;
-
- server = server_list.first;
-
- while(server) {
- nextserver = server->next;
- BLI_remlink(&server_list, server);
- MEM_freeN(server->name);
- MEM_freeN(server->ip);
- MEM_freeN(server);
- server = nextserver;
- }
-
- BLI_freelistN(&server_list);
-}
-
-/*
- * end connection to all verse hosts (servers) ... free all VerseSessions
- * free all VerseServers
- */
-void end_all_verse_sessions(void)
-{
- VerseSession *session,*nextsession;
-
- session = session_list.first;
-
- while(session) {
- nextsession= session->next;
- end_verse_session(session);
- /* end next session */
- session = nextsession;
- }
-
- BLI_freelistN(&session_list);
-
- free_all_servers();
-}
-
-/*
- * do a get from ms
- */
-void b_verse_ms_get(void)
-{
- if(cb_ping_registered==0) {
- /* handle ping messages (for master server) */
- verse_callback_set(verse_send_ping, cb_ping, NULL);
- //XXX add_screenhandler(G.curscreen, SCREEN_HANDLER_VERSE, 1);
- cb_ping_registered++;
- }
- free_all_servers();
-
- verse_ms_get_send(U.versemaster, VERSE_MS_FIELD_DESCRIPTION, NULL);
- verse_callback_update(10);
-}
-
-/*
- * connect to verse host, set up all callbacks, create session
- */
-void b_verse_connect(char *address)
-{
- VerseSession *session = NULL;
-
- /* if no session was created before, then set up all callbacks */
- if((session_list.first==NULL) && (session_list.last==NULL))
- set_all_callbacks();
-
- /* create new session */
- if(address)
- session = create_verse_session("Blender", "pass", address, NULL);
-
- if(session) {
- /* add new session to the list of sessions */
- BLI_addtail(&session_list, session);
-
- /* add verse handler if this is first session */
- if(session_list.first == session_list.last) {
- //XXX add_screenhandler(G.curscreen, SCREEN_HANDLER_VERSE, 1);
- }
-
- }
-}
-
-#endif
diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c
index 1829a07d543..f84bd690347 100644
--- a/source/blender/blenkernel/intern/writeavi.c
+++ b/source/blender/blenkernel/intern/writeavi.c
@@ -171,7 +171,7 @@ void start_avi(RenderData *rd, int rectx, int recty)
printf("Created avi: %s\n", name);
}
-void append_avi(int frame, int *pixels, int rectx, int recty)
+void append_avi(RenderData *rd, int frame, int *pixels, int rectx, int recty)
{
unsigned int *rt1, *rt2, *rectot;
int x, y;
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index 908defb08cc..8fd2426a1b6 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -558,7 +558,7 @@ static AVStream* alloc_audio_stream(RenderData *rd, int codec_id, AVFormatContex
return NULL;
}
- set_ffmpeg_properties(c, "audio");
+ set_ffmpeg_properties(rd, c, "audio");
if (avcodec_open(c, codec) < 0) {
//XXX error("Couldn't initialize audio codec");
diff --git a/source/blender/blenlib/BLI_editVert.h b/source/blender/blenlib/BLI_editVert.h
index fec89690090..f0f54bae8ea 100644
--- a/source/blender/blenlib/BLI_editVert.h
+++ b/source/blender/blenlib/BLI_editVert.h
@@ -70,9 +70,6 @@ typedef struct EditVert
short fast; /* only 0 or 1, for editmesh_fastmalloc, do not store temp data here! */
int hash;
int keyindex; /* original index #, for restoring key information */
-/*#ifdef WITH_VERSE*/
- void *vvert;
-/*#endif*/
void *data; /* custom vertex data */
} EditVert;
@@ -132,9 +129,6 @@ typedef struct EditFace
unsigned char f, f1, h;
unsigned char fast; /* only 0 or 1, for editmesh_fastmalloc */
unsigned char fgonf; /* flag for fgon options */
-/*#ifdef WITH_VERSE*/
- void *vface;
-/*#endif*/
void *data; /* custom face data */
} EditFace;
@@ -187,9 +181,6 @@ typedef struct EditMesh
CustomData vdata, edata, fdata;
-#ifdef WITH_VERSE
- void *vnode;
-#endif
} EditMesh;
#endif
diff --git a/source/blender/blenlib/BLI_storage_types.h b/source/blender/blenlib/BLI_storage_types.h
index 01627f62e72..385aa39e6cb 100644
--- a/source/blender/blenlib/BLI_storage_types.h
+++ b/source/blender/blenlib/BLI_storage_types.h
@@ -74,9 +74,6 @@ struct direntry{
#define HIDDEN 1
#define FIRST 1
#define ACTIVE 2
-/*#ifdef WITH_VERSE*/
-#define VERSE 3
-/*#endif*/
#define DESELECT 0
#define NOT_YET 0
#define VISIBLE 0
diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt
index 4eb01a50f39..b22e7b1dd70 100644
--- a/source/blender/blenlib/CMakeLists.txt
+++ b/source/blender/blenlib/CMakeLists.txt
@@ -40,11 +40,6 @@ SET(INC
)
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
-IF(WITH_VERSE)
- ADD_DEFINITIONS(-DWITH_VERSE)
- SET(INC ${INC} ${VERSE_INC})
-ENDIF(WITH_VERSE)
-
IF(WITH_INTERNATIONAL)
ADD_DEFINITIONS(-DWITH_FREETYPE2)
ENDIF(WITH_INTERNATIONAL)
diff --git a/source/blender/blenlib/SConscript b/source/blender/blenlib/SConscript
index 39d4df62a93..142ffeb0a83 100644
--- a/source/blender/blenlib/SConscript
+++ b/source/blender/blenlib/SConscript
@@ -15,10 +15,6 @@ if env['WITH_BF_SDL']:
if env['WITH_BF_INTERNATIONAL']:
defs = 'WITH_FREETYPE2'
-if env['WITH_BF_VERSE']:
- defs += ' WITH_VERSE'
- incs += ' ' + env['BF_VERSE_INCLUDE']
-
if env['OURPLATFORM'] == 'linux2':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
diff --git a/source/blender/blenloader/CMakeLists.txt b/source/blender/blenloader/CMakeLists.txt
index 9101536c23f..1b9c5647702 100644
--- a/source/blender/blenloader/CMakeLists.txt
+++ b/source/blender/blenloader/CMakeLists.txt
@@ -34,10 +34,4 @@ SET(INC
${ZLIB_INC}
)
-IF(WITH_VERSE)
- ADD_DEFINITIONS(-DWITH_VERSE)
- SET(INC ${INC} ${VERSE_INC})
-ENDIF(WITH_VERSE)
-
BLENDERLIB(bf_blenloader "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_blenloader', sources, Split(incs), Split(defs), libtype=['core','player'], priority = [70, 30] )
diff --git a/source/blender/blenloader/SConscript b/source/blender/blenloader/SConscript
index c07170fea95..5a445ad0cfc 100644
--- a/source/blender/blenloader/SConscript
+++ b/source/blender/blenloader/SConscript
@@ -9,9 +9,6 @@ incs += ' ../render/extern/include'
incs += ' ' + env['BF_ZLIB_INC']
-defs = ''
-if env['WITH_BF_VERSE']:
- defs += ' WITH_VERSE'
- incs += ' ' + env['BF_VERSE_INCLUDE']
+defs = []
-env.BlenderLib ( 'bf_blenloader', sources, Split(incs), Split(defs), libtype=['core','player'], priority = [165, 30] )
+env.BlenderLib ( 'bf_blenloader', sources, Split(incs), defs, libtype=['core','player'], priority = [165, 30] )
diff --git a/source/blender/blenloader/intern/Makefile b/source/blender/blenloader/intern/Makefile
index 4f729d98d00..7382dd655b2 100644
--- a/source/blender/blenloader/intern/Makefile
+++ b/source/blender/blenloader/intern/Makefile
@@ -44,11 +44,6 @@ ifeq ($(OS),$(findstring $(OS), "solaris windows"))
CPPFLAGS += -I$(NAN_ZLIB)/include
endif
-ifeq ($(WITH_VERSE), true)
- CPPFLAGS += -DWITH_VERSE
- CPPFLAGS += -I$(NAN_VERSE)/include
-endif
-
# streaming write function
CPPFLAGS += -I../../writestreamglue
CPPFLAGS += -I../../readstreamglue
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index a34c3cc88a5..ebc6cb4dcbd 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -161,10 +161,6 @@ Any case: direct data is ALWAYS after the lib block
#include "BKE_utildefines.h" // for defines
#include "BKE_modifier.h"
#include "BKE_idprop.h"
-#ifdef WITH_VERSE
-#include "BKE_verse.h"
-//XXX #include "BIF_verse.h"
-#endif
#include "BLO_writefile.h"
#include "BLO_readfile.h"
@@ -918,15 +914,7 @@ static void write_objects(WriteData *wd, ListBase *idbase)
while(ob) {
if(ob->id.us>0 || wd->current) {
/* write LibData */
-#ifdef WITH_VERSE
- /* pointer at vnode stored in file have to be NULL */
- struct VNode *vnode = (VNode*)ob->vnode;
- if(vnode) ob->vnode = NULL;
-#endif
writestruct(wd, ID_OB, "Object", 1, ob);
-#ifdef WITH_VERSE
- if(vnode) ob->vnode = (void*)vnode;
-#endif
/*Write ID Properties -- and copy this comment EXACTLY for easy finding
of library blocks that implement this.*/
@@ -1204,20 +1192,7 @@ static void write_meshs(WriteData *wd, ListBase *idbase)
while(mesh) {
if(mesh->id.us>0 || wd->current) {
/* write LibData */
-#ifdef WITH_VERSE
- struct VNode *vnode = (VNode*)mesh->vnode;
- if(vnode) {
- /* mesh has to be created from verse geometry node*/
- //XXX create_meshdata_from_geom_node(mesh, vnode);
- /* pointer at verse node can't be stored in file */
- mesh->vnode = NULL;
- }
-#endif
-
writestruct(wd, ID_ME, "Mesh", 1, mesh);
-#ifdef WITH_VERSE
- if(vnode) mesh->vnode = (void*)vnode;
-#endif
/* direct data */
if (mesh->id.properties) IDP_WriteProperty(mesh->id.properties, wd);
diff --git a/source/blender/editors/CMakeLists.txt b/source/blender/editors/CMakeLists.txt
index 19a91d08d08..15c0bca8ffb 100644
--- a/source/blender/editors/CMakeLists.txt
+++ b/source/blender/editors/CMakeLists.txt
@@ -71,11 +71,6 @@ IF(WIN32)
SET(INC ${INC} ${PTHREADS_INC})
ENDIF(WIN32)
-IF(WITH_VERSE)
- SET(INC ${INC} ${VERSE_INC})
- ADD_DEFINITIONS(-DWITH_VERSE)
-ENDIF(WITH_VERSE)
-
# TODO buildinfo
IF(BF_BUILDINFO)
ADD_DEFINITIONS(-DNAN_BUILDINFO)
@@ -83,7 +78,3 @@ ENDIF(BF_BUILDINFO)
BLENDERLIB_NOLIST(bf_editors "${SRC}" "${INC}")
-IF(WITH_VERSE)
- ADD_DEPENDENCIES(bf_editors mkprot verse)
-ENDIF(WITH_VERSE)
-
diff --git a/source/blender/editors/screen/CMakeLists.txt b/source/blender/editors/screen/CMakeLists.txt
index c6d1288cf4f..42480f65268 100644
--- a/source/blender/editors/screen/CMakeLists.txt
+++ b/source/blender/editors/screen/CMakeLists.txt
@@ -74,11 +74,6 @@ IF(WIN32)
SET(INC ${INC} ${PTHREADS_INC})
ENDIF(WIN32)
-IF(WITH_VERSE)
- SET(INC ${INC} ${VERSE_INC})
- ADD_DEFINITIONS(-DWITH_VERSE)
-ENDIF(WITH_VERSE)
-
# TODO buildinfo
IF(BF_BUILDINFO)
ADD_DEFINITIONS(-DNAN_BUILDINFO)
@@ -86,7 +81,3 @@ ENDIF(BF_BUILDINFO)
BLENDERLIB_NOLIST(bf_editors "${SRC}" "${INC}")
-IF(WITH_VERSE)
- ADD_DEPENDENCIES(bf_editors mkprot verse)
-ENDIF(WITH_VERSE)
-
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c
index c7f49a31938..cfae1b127cf 100644
--- a/source/blender/editors/space_outliner/outliner.c
+++ b/source/blender/editors/space_outliner/outliner.c
@@ -3588,7 +3588,7 @@ static void outliner_draw_tree_element(Scene *scene, ARegion *ar, SpaceOops *soo
/* open/close icon, only when sublevels, except for scene */
if(te->subtree.first || (tselem->type==0 && te->idcode==ID_SCE) || (te->flag & TE_LAZY_CLOSED)) {
int icon_x;
- if((tselem->type==0 && ELEM(te->idcode, ID_OB, ID_SCE)) || ELEM4(te->idcode,ID_VN,ID_VS, ID_MS, ID_SS))
+ if(tselem->type==0 && ELEM(te->idcode, ID_OB, ID_SCE))
icon_x = startx;
else
icon_x = startx+5;
@@ -3680,7 +3680,7 @@ static void outliner_draw_hierarchy(SpaceOops *soops, ListBase *lb, int startx,
tselem= TREESTORE(te);
/* horizontal line? */
- if((tselem->type==0 && (te->idcode==ID_OB || te->idcode==ID_SCE)) || ELEM4(te->idcode,ID_VS,ID_VN,ID_MS,ID_SS))
+ if(tselem->type==0 && (te->idcode==ID_OB || te->idcode==ID_SCE))
glRecti(startx, *starty, startx+OL_X, *starty-1);
*starty-= OL_H;
@@ -3693,7 +3693,7 @@ static void outliner_draw_hierarchy(SpaceOops *soops, ListBase *lb, int startx,
te= lb->last;
if(te->parent || lb->first!=lb->last) {
tselem= TREESTORE(te);
- if((tselem->type==0 && te->idcode==ID_OB) || ELEM4(te->idcode,ID_VS,ID_VN,ID_MS,ID_SS)) {
+ if(tselem->type==0 && te->idcode==ID_OB) {
glRecti(startx, y1+OL_H, startx+1, y2);
}
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index 806afa8e624..3f123300c5a 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -170,9 +170,6 @@ typedef struct TransData {
void *extra; /* extra data (mirrored element pointer, in editmode mesh to EditVert) (editbone for roll fixing) (...) */
short flag; /* Various flags */
short protectflag; /* If set, copy of Object or PoseChannel protection */
-/*#ifdef WITH_VERSE*/
- void *verse; /* pointer at verse data struct (VerseVert, etc.) */
-/*#endif*/
} TransData;
typedef struct MouseInput {
@@ -318,10 +315,6 @@ typedef struct TransInfo {
#define TD_USEQUAT (1 << 3)
#define TD_NOTCONNECTED (1 << 4)
#define TD_SINGLESIZE (1 << 5) /* used for scaling of MetaElem->rad */
-#ifdef WITH_VERSE
- #define TD_VERSE_OBJECT (1 << 6)
- #define TD_VERSE_VERT (1 << 7)
-#endif
#define TD_TIMEONLY (1 << 8)
#define TD_NOCENTER (1 << 9)
#define TD_NO_EXT (1 << 10) /* ext abused for particle key timing */
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index cd06c27e12e..6b633600db7 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -1914,15 +1914,6 @@ static void VertsToTransData(TransInfo *t, TransData *td, EditMesh *em, EditVert
td->val = &(eve->bweight);
td->ival = eve->bweight;
}
-
-#ifdef WITH_VERSE
- if(eve->vvert) {
- td->verse = (void*)eve->vvert;
- td->flag |= TD_VERSE_VERT;
- }
- else
- td->flag &= ~TD_VERSE_VERT;
-#endif
}
/* *********************** CrazySpace correction. Now without doing subsurf optimal ****************** */
@@ -3320,15 +3311,6 @@ static void ObjectToTransData(bContext *C, TransInfo *t, TransData *td, Object *
{
td->flag |= TD_ACTIVE;
}
-
-#ifdef WITH_VERSE
- if(ob->vnode) {
- td->verse = (void*)ob;
- td->flag |= TD_VERSE_OBJECT;
- }
- else
- td->flag &= ~TD_VERSE_OBJECT;
-#endif
}
@@ -4215,6 +4197,11 @@ void createTransData(bContext *C, TransInfo *t)
else if(t->spacetype == SPACE_NODE) {
t->flag |= T_2D_EDIT|T_POINTS;
createTransNodeData(C, t);
+ if (t->data && (t->flag & T_PROP_EDIT)) {
+ sort_trans_data(t); // makes selected become first in array
+ set_prop_dist(t, 1);
+ sort_trans_data_dist(t);
+ }
}
else if (t->obedit) {
t->ext = NULL;
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index ea79a559f44..76e2e68e015 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -68,10 +68,6 @@
//#include "BSE_editipo.h"
//#include "BSE_editipo_types.h"
-#ifdef WITH_VERSE
-#include "BIF_verse.h"
-#endif
-
#include "BKE_action.h"
#include "BKE_anim.h"
#include "BKE_armature.h"
@@ -91,10 +87,6 @@
#include "BKE_utildefines.h"
#include "BKE_context.h"
-#ifdef WITH_VERSE
-#include "BKE_verse.h"
-#endif
-
#include "ED_view3d.h"
#include "ED_mesh.h"
@@ -272,9 +264,6 @@ void recalcData(TransInfo *t)
{
Scene *scene = t->scene;
Base *base;
-#ifdef WITH_VERSE
- struct TransData *td;
-#endif
#if 0 // TRANSFORM_FIX_ME
if (t->spacetype == SPACE_ACTION) {
@@ -639,17 +628,6 @@ void recalcData(TransInfo *t)
}
}
-#ifdef WITH_VERSE
- for (td = t->data; td < t->data + t->total; td++) {
- if(td->flag & TD_VERSE_VERT) {
- if(td->verse)
- send_versevert_pos((VerseVert*)td->verse);
- }
- else if(td->flag & TD_VERSE_OBJECT)
- if(td->verse) b_verse_send_transformation((Object*)td->verse);
- }
-#endif
-
/* update shaded drawmode while transform */
if(t->spacetype==SPACE_VIEW3D && ((View3D*)t->view)->drawtype == OB_SHADED)
reshadeall_displist(t->scene);
@@ -800,24 +778,6 @@ void postTrans (TransInfo *t)
TransData *td;
G.moving = 0; // Set moving flag off (display as usual)
-#ifdef WITH_VERSE
-
- for (td = t->data; td < t->data + t->total; td++) {
- if(td->flag & TD_VERSE_VERT) {
- if(td->verse) send_versevert_pos((VerseVert*)td->verse);
- }
- else if(td->flag & TD_VERSE_OBJECT) {
- if(td->verse) {
- struct VNode *vnode;
- vnode = (VNode*)((Object*)td->verse)->vnode;
- ((VObjectData*)vnode->data)->flag |= POS_SEND_READY;
- ((VObjectData*)vnode->data)->flag |= ROT_SEND_READY;
- ((VObjectData*)vnode->data)->flag |= SCALE_SEND_READY;
- b_verse_send_transformation((Object*)td->verse);
- }
- }
- }
-#endif
stopConstraint(t);
@@ -927,25 +887,6 @@ void restoreTransObjects(TransInfo *t)
for (td = t->data; td < t->data + t->total; td++) {
restoreElement(td);
-#ifdef WITH_VERSE
- /* position of vertexes and object transformation matrix is sent
- * extra, becuase blender uses synchronous sending of vertexes
- * position as well object trans. matrix and it isn't possible to
- * send it in recalcData sometimes */
- if(td->flag & TD_VERSE_VERT) {
- if(td->verse) {
- ((VerseVert*)td->verse)->flag |= VERT_POS_OBSOLETE;
- }
- }
- else if(td->flag & TD_VERSE_OBJECT)
- if(td->verse) {
- struct VNode *vnode;
- vnode = (VNode*)((Object*)td->verse)->vnode;
- ((VObjectData*)vnode->data)->flag |= POS_SEND_READY;
- ((VObjectData*)vnode->data)->flag |= ROT_SEND_READY;
- ((VObjectData*)vnode->data)->flag |= SCALE_SEND_READY;
- }
-#endif
}
Mat3One(t->mat);
diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt
index 2d41a6d73e6..61ec3430bff 100644
--- a/source/blender/imbuf/CMakeLists.txt
+++ b/source/blender/imbuf/CMakeLists.txt
@@ -35,11 +35,6 @@ SET(INC
${ZLIB_INC}
)
-IF(WITH_VERSE)
- ADD_DEFINITIONS(-DWITH_VERSE)
- SET(INC ${INC} VERSE_INC)
-ENDIF(WITH_VERSE)
-
IF(WITH_OPENEXR)
ADD_DEFINITIONS(-DWITH_OPENEXR)
ENDIF(WITH_OPENEXR)
diff --git a/source/blender/imbuf/SConscript b/source/blender/imbuf/SConscript
index 27337a0b15a..9da0cf21596 100644
--- a/source/blender/imbuf/SConscript
+++ b/source/blender/imbuf/SConscript
@@ -13,10 +13,6 @@ incs += ' ' + env['BF_ZLIB_INC']
defs = []
-if env['WITH_BF_VERSE']:
- defs.append('WITH_VERSE')
- incs += ' ' + env['BF_VERSE_INCLUDE']
-
if env['WITH_BF_OPENEXR']:
defs.append('WITH_OPENEXR')
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 243f236ce3b..2846d138fbf 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -200,15 +200,6 @@ typedef struct PreviewImage {
/* fluidsim Ipo */
#define ID_FLUIDSIM MAKE_ID2('F', 'S')
-
-/*#ifdef WITH_VERSE*/
-#define ID_VS MAKE_ID2('V', 'S') /* fake id for VerseSession, needed for outliner */
-#define ID_VN MAKE_ID2('V', 'N') /* fake id for VerseNode, needed for outliner */
-#define ID_MS MAKE_ID2('M', 'S') /* fake id for VerseServer root entry, needed for outliner */
-#define ID_SS MAKE_ID2('S', 'S') /* fake id for VerseServer entry, needed for ountliner */
-/*#endif*/
-
-
/* id->flag: set frist 8 bits always at zero while reading */
#define LIB_LOCAL 0
#define LIB_EXTERN 1
diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h
index 7a6e1707dad..371b0d75951 100644
--- a/source/blender/makesdna/DNA_image_types.h
+++ b/source/blender/makesdna/DNA_image_types.h
@@ -95,10 +95,6 @@ typedef struct Image {
/* display aspect - for UV editing images resized for faster openGL display */
float aspx, aspy;
-
-/*#ifdef WITH_VERSE*/
- void *vnode; /* pointer at verse bitmap node */
-/*#endif*/
} Image;
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index 8e9341cae0f..7da057efdb1 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -99,10 +99,6 @@ typedef struct Mesh {
struct Multires *mr; /* Multiresolution modeling data */
struct PartialVisibility *pv;
-/*ifdef WITH_VERSE*/
- /* not written in file, pointer at geometry VerseNode */
- void *vnode;
-/*#endif*/
} Mesh;
/* deprecated by MTFace, only here for file reading */
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index f3d18e0559b..7deea1899d1 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -225,10 +225,6 @@ typedef struct Object {
unsigned int init_state; /* bit masks of initial state as recorded by the users */
int pad2;
-/*#ifdef WITH_VERSE*/
- void *vnode; /* pointer at object VerseNode */
-/*#endif*/
-
ListBase gpulamp; /* runtime, for lamps only */
} Object;
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index 53359a9c39d..de81ff10ae8 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -92,7 +92,6 @@ static void rna_def_image(BlenderRNA *brna)
{IMA_TYPE_IMAGE, "IMAGE", "Image", ""},
{IMA_TYPE_MULTILAYER, "MULTILAYER", "Multilayer", ""},
{IMA_TYPE_UV_TEST, "UVTEST", "UV Test", ""},
- //{IMA_TYPE_VERSE, "VERSE", "Verse", ""},
{IMA_TYPE_R_RESULT, "RENDERRESULT", "Render Result", ""},
{IMA_TYPE_COMPOSITE, "COMPOSITING", "Compositing", ""},
{0, NULL, NULL, NULL}};
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt
index 4f8f4f38167..0b2bd9b4bfd 100644
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@ -35,11 +35,6 @@ SET(INC
${ZLIB_INC}
)
-IF(WITH_VERSE)
- ADD_DEFINITIONS(-DWITH_VERSE)
- SET(INC ${INC} ${VERSE_INC})
-ENDIF(WITH_VERSE)
-
IF(WITH_OPENEXR)
ADD_DEFINITIONS(-DWITH_OPENEXR)
ENDIF(WITH_OPENEXR)
@@ -64,10 +59,6 @@ ADD_DEFINITIONS(-DWITH_CCGSUBSURF)
BLENDERLIB(bf_nodes "${SRC}" "${INC}")
-IF(WITH_VERSE)
- ADD_DEPENDENCIES(bf_nodes mkprot verse)
-ENDIF(WITH_VERSE)
-
IF(WITH_INTERNATIONAL)
ADD_DEFINITIONS(-DWITH_FREETYPE2)
ENDIF(WITH_INTERNATIONAL)
diff --git a/source/blender/nodes/SConscript b/source/blender/nodes/SConscript
index 7efbbd83aba..c7be20e3ec0 100644
--- a/source/blender/nodes/SConscript
+++ b/source/blender/nodes/SConscript
@@ -28,13 +28,6 @@ else:
if env['WITH_BF_INTERNATIONAL']:
defs += ' WITH_FREETYPE2'
-if env['WITH_BF_VERSE']:
- defs += ' WITH_VERSE'
- incs += ' ' + env['BF_VERSE_INCLUDE']
-
-if env['WITH_BF_VERSE']:
- defs += ' WITH_VERSE'
-
if env['WITH_BF_OPENEXR']:
defs += ' WITH_OPENEXR'
diff --git a/source/blender/python/CMakeLists.txt b/source/blender/python/CMakeLists.txt
index 0ae8e5c421f..b94ae8749df 100644
--- a/source/blender/python/CMakeLists.txt
+++ b/source/blender/python/CMakeLists.txt
@@ -30,11 +30,6 @@ SET(INC
../blenkernel ../editors/include ../windowmanager ${PYTHON_INC}
)
-IF(WITH_VERSE)
- ADD_DEFINITIONS(-DWITH_VERSE)
- SET(INC ${INC} ${VERSE_INC})
-ENDIF(WITH_VERSE)
-
IF(WITH_OPENEXR)
ADD_DEFINITIONS(-DWITH_OPENEXR)
ENDIF(WITH_OPENEXR)
@@ -53,10 +48,6 @@ ADD_DEFINITIONS(-DWITH_CCGSUBSURF)
BLENDERLIB(bf_python "${SRC}" "${INC}")
-IF(WITH_VERSE)
- ADD_DEPENDENCIES(bf_nodes mkprot verse)
-ENDIF(WITH_VERSE)
-
IF(WITH_INTERNATIONAL)
ADD_DEFINITIONS(-DWITH_FREETYPE2)
ENDIF(WITH_INTERNATIONAL)
diff --git a/source/blender/python/intern/Makefile b/source/blender/python/intern/Makefile
index ef4fc8bb58a..ea08ecac945 100644
--- a/source/blender/python/intern/Makefile
+++ b/source/blender/python/intern/Makefile
@@ -62,15 +62,5 @@ CPPFLAGS += -I../../render/extern/include
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I$(NAN_MEMUTIL)/include
-
-ifeq ($(WITH_VERSE), true)
- CPPFLAGS += -DWITH_VERSE
- CPPFLAGS += -I$(NAN_VERSE)/include
- # print some other debug information
- ifeq ($(VERSE_DEBUG_PRINT), true)
- CPPFLAGS += -DVERSE_DEBUG_PRINT
- endif
-endif
-
# path to our own headerfiles
CPPFLAGS += -I..
diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt
index 10830d8d0aa..b381206cb8b 100644
--- a/source/blender/windowmanager/CMakeLists.txt
+++ b/source/blender/windowmanager/CMakeLists.txt
@@ -71,11 +71,6 @@ IF(WIN32)
SET(INC ${INC} ${PTHREADS_INC})
ENDIF(WIN32)
-IF(WITH_VERSE)
- SET(INC ${INC} ${VERSE_INC})
- ADD_DEFINITIONS(-DWITH_VERSE)
-ENDIF(WITH_VERSE)
-
# TODO buildinfo
IF(BF_BUILDINFO)
ADD_DEFINITIONS(-DNAN_BUILDINFO)
@@ -83,7 +78,3 @@ ENDIF(BF_BUILDINFO)
BLENDERLIB_NOLIST(bf_windowmanager "${SRC}" "${INC}")
-IF(WITH_VERSE)
- ADD_DEPENDENCIES(bf_windowmanager mkprot verse)
-ENDIF(WITH_VERSE)
-
diff --git a/source/blender/windowmanager/intern/Makefile b/source/blender/windowmanager/intern/Makefile
index 5ca68bef0a2..b5b04b11be7 100644
--- a/source/blender/windowmanager/intern/Makefile
+++ b/source/blender/windowmanager/intern/Makefile
@@ -71,15 +71,6 @@ ifeq ($(INTERNATIONAL), true)
CPPFLAGS += -DINTERNATIONAL
endif
-ifeq ($(WITH_VERSE), true)
- CPPFLAGS += -DWITH_VERSE
- CPPFLAGS += -I$(NAN_VERSE)/include
- # print some other debug information
- ifeq ($(VERSE_DEBUG_PRINT), true)
- CPPFLAGS += -DVERSE_DEBUG_PRINT
- endif
-endif
-
ifeq ($(WITH_QUICKTIME),true)
CPPFLAGS += -I../quicktime
CPPFLAGS += -DWITH_QUICKTIME
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 65df71a067a..4bac829c80a 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -200,9 +200,6 @@ void WM_exit(bContext *C)
free_ttfont(); /* bke_font.h */
-#ifdef WITH_VERSE
- end_all_verse_sessions();
-#endif
free_openrecent();
BKE_freecubetable();
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 7e249095868..ddd9b636660 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -240,7 +240,6 @@ IF(UNIX)
blender_CTR
bf_moto
bf_bmfont
- verse
bf_windowmanager
bf_editors
bf_ftfont
diff --git a/source/nan_definitions.mk b/source/nan_definitions.mk
index 04a1d107931..258cfc6f586 100644
--- a/source/nan_definitions.mk
+++ b/source/nan_definitions.mk
@@ -109,10 +109,6 @@ endif
export NAN_FFMPEGCFLAGS ?= -I$(NAN_FFMPEG)/include
endif
- ifeq ($(WITH_VERSE), true)
- export NAN_VERSE ?= $(LCGDIR)/verse
- endif
-
export WITH_OPENEXR ?= true
export WITH_DDS ?= true
diff --git a/source/nan_link.mk b/source/nan_link.mk
index 186fe07e09a..e92103f56d9 100644
--- a/source/nan_link.mk
+++ b/source/nan_link.mk
@@ -134,9 +134,6 @@ ifeq ($(OS),windows)
LDFLAGS += -mwindows -mno-cygwin -mconsole
DADD += -L/usr/lib/w32api -lnetapi32 -lopengl32 -lglu32 -lshfolder
DADD += -L/usr/lib/w32api -lwinmm -lwsock32
- ifeq ($(WITH_VERSE),true)
- DADD += -lws2_32
- endif
else
DADD = kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
DADD += advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
diff --git a/tools/btools.py b/tools/btools.py
index 21ab547b11a..6cf9058886b 100755
--- a/tools/btools.py
+++ b/tools/btools.py
@@ -56,8 +56,6 @@ def validate_arguments(args, bc):
'WITH_BF_BINRELOC',
'LCGDIR',
'BF_CXX', 'WITH_BF_STATICCXX', 'BF_CXX_LIB_STATIC',
- 'WITH_BF_VERSE', 'BF_VERSE_INCLUDE',
- 'VERSE_BUILD_BINARY', 'VERSE_BUILD_DIR', 'VERSE_REGEN_PROTO',
'BF_TWEAK_MODE', 'BF_SPLIT_SRC',
'WITHOUT_BF_INSTALL',
'WITH_BF_OPENMP',
@@ -146,17 +144,7 @@ def SetupSpawn( env ):
def read_opts(cfg, args):
localopts = Variables.Variables(cfg, args)
localopts.AddVariables(
- ('VERSE_BUILD_BINARY', 'Build a release or debug binary.', 'release'),
- ('VERSE_BUILD_DIR', 'Target directory for intermediate files.', "${BF_BUILDDIR}/extern/verse"),
- ('VERSE_REGEN_PROTO', 'Whether to regenerate the protocol files', 'yes'),
- (BoolVariable('WITH_BF_VERSE', 'Use VERSE if true', False)),
- ('BF_VERSE_INCLUDE', 'verse include dir', '/usr/include'),
('LCGDIR', 'location of cvs lib dir'),
- ('VERSE_BUILD_BINARY', 'Build a release or debug binary.', 'release'),
- ('VERSE_BUILD_DIR', 'Target directory for intermediate files.', "${BF_BUILDDIR}/extern/verse"),
- ('VERSE_REGEN_PROTO', 'Whether to regenerate the protocol files', 'yes'),
- ('BF_DEBUG_LIBS', 'list of libraries to build with debug symbols'),
-
(BoolVariable('WITH_BF_PYTHON', 'Compile with python', True)),
('BF_PYTHON', 'base path for python', ''),
('BF_PYTHON_VERSION', 'Python version to use', ''),
--
cgit v1.2.3