about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-01-19 10:57:25 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-01-19 10:57:25 +0000
commitdd21ae1bc7a648138d33727628983a3b25a07570 (patch)
treecaf87523cda90c3a0fb235ea6e642765136d3f88
parent4eb71856948077b4c0cf9b5ef7178075433b7259 (diff)
downloadzcatch-dd21ae1bc7a648138d33727628983a3b25a07570.tar.gz
zcatch-dd21ae1bc7a648138d33727628983a3b25a07570.zip
large commit. documented a bit. editor updates. general cleanup of everything
-rw-r--r--docs/conf/Data/ClassHierarchy.ndbin0 -> 433 bytes
-rw-r--r--docs/conf/Data/ConfigFileInfo.nd1
-rw-r--r--docs/conf/Data/FileInfo.nd51
-rw-r--r--docs/conf/Data/PreviousMenuState.ndbin0 -> 1059 bytes
-rw-r--r--docs/conf/Data/PreviousSettings.ndbin0 -> 102 bytes
-rw-r--r--docs/conf/Data/SymbolTable.ndbin0 -> 35403 bytes
-rw-r--r--docs/conf/Languages.txt113
-rw-r--r--docs/conf/Menu.txt79
-rw-r--r--docs/conf/Menu_Backup.txt66
-rw-r--r--docs/conf/Topics.txt84
-rwxr-xr-xscripts/make_docs.sh6
-rw-r--r--src/engine/client/ec_client.c17
-rw-r--r--src/engine/client/ec_gfx.c2
-rw-r--r--src/engine/client/ec_inp.c8
-rw-r--r--src/engine/client/ec_snd.c2
-rw-r--r--src/engine/client/ec_srvbrowse.c2
-rw-r--r--src/engine/docs/client_time.txt4
-rw-r--r--src/engine/docs/prediction.txt19
-rw-r--r--src/engine/e_client_interface.h21
-rw-r--r--src/engine/e_common_interface.h16
-rw-r--r--src/engine/e_engine.c3
-rw-r--r--src/engine/e_if_client.h376
-rw-r--r--src/engine/e_if_gfx.h578
-rw-r--r--src/engine/e_if_inp.h236
-rw-r--r--src/engine/e_if_modc.h133
-rw-r--r--src/engine/e_if_mods.h151
-rw-r--r--src/engine/e_if_msg.h136
-rw-r--r--src/engine/e_if_other.h349
-rw-r--r--src/engine/e_if_server.h137
-rw-r--r--src/engine/e_if_snd.h91
-rw-r--r--src/engine/e_interface.h2000
-rw-r--r--src/engine/e_msg.c2
-rw-r--r--src/engine/e_server_interface.h18
-rw-r--r--src/engine/e_snapshot.c2
-rw-r--r--src/engine/server/es_server.c2
-rw-r--r--src/game/client/gc_client.cpp5
-rw-r--r--src/game/client/gc_console.cpp4
-rw-r--r--src/game/client/gc_hooks.cpp2
-rw-r--r--src/game/client/gc_map_image.cpp2
-rw-r--r--src/game/client/gc_menu.cpp6
-rw-r--r--src/game/client/gc_render.cpp2
-rw-r--r--src/game/client/gc_render_map.cpp2
-rw-r--r--src/game/client/gc_render_obj.cpp6
-rw-r--r--src/game/client/gc_skin.cpp2
-rw-r--r--src/game/client/gc_ui.cpp2
-rw-r--r--src/game/editor/ed_editor.cpp2
-rw-r--r--src/game/editor/ed_editor.hpp2
-rw-r--r--src/game/g_collision.cpp2
-rw-r--r--src/game/g_game.cpp4
-rw-r--r--src/game/g_game.h2
-rw-r--r--src/game/g_layers.cpp2
-rw-r--r--src/game/server/gs_game.cpp3
-rw-r--r--src/game/server/gs_game_ctf.cpp3
-rw-r--r--src/game/server/gs_server.cpp11
54 files changed, 2714 insertions, 2055 deletions
diff --git a/docs/conf/Data/ClassHierarchy.nd b/docs/conf/Data/ClassHierarchy.nd
new file mode 100644
index 00000000..c541d655
--- /dev/null
+++ b/docs/conf/Data/ClassHierarchy.nd
Binary files differdiff --git a/docs/conf/Data/ConfigFileInfo.nd b/docs/conf/Data/ConfigFileInfo.nd
new file mode 100644
index 00000000..63dab0d0
--- /dev/null
+++ b/docs/conf/Data/ConfigFileInfo.nd
@@ -0,0 +1 @@
+#G‘ÖùG‘ITG‘ITG‘ITG‘IT
\ No newline at end of file
diff --git a/docs/conf/Data/FileInfo.nd b/docs/conf/Data/FileInfo.nd
new file mode 100644
index 00000000..70e121f3
--- /dev/null
+++ b/docs/conf/Data/FileInfo.nd
@@ -0,0 +1,51 @@
+1.35
+C/C++
+/home/kma/code/teewars/trunk/src/engine/e_memheap.h	1197706562	0	/home/kma/code/teewars/trunk/src/engine/e_memheap.h
+/home/kma/code/teewars/trunk/src/engine/client/ec_font.h	1200146774	0	/home/kma/code/teewars/trunk/src/engine/client/ec_font.h
+/home/kma/code/teewars/trunk/src/engine/e_console.c	1200611479	0	/home/kma/code/teewars/trunk/src/engine/e_console.c
+/home/kma/code/teewars/trunk/src/engine/e_if_modc.h	1200736124	1	Client Hooks
+/home/kma/code/teewars/trunk/src/engine/e_protocol.h	1197711693	0	/home/kma/code/teewars/trunk/src/engine/e_protocol.h
+/home/kma/code/teewars/trunk/src/engine/client/ec_inp.c	1200709481	0	/home/kma/code/teewars/trunk/src/engine/client/ec_inp.c
+/home/kma/code/teewars/trunk/src/engine/e_memheap.c	1197707815	0	/home/kma/code/teewars/trunk/src/engine/e_memheap.c
+/home/kma/code/teewars/trunk/src/engine/e_if_snd.h	1200736177	1	Sound
+/home/kma/code/teewars/trunk/src/engine/e_keynames.c	1197706547	0	/home/kma/code/teewars/trunk/src/engine/e_keynames.c
+/home/kma/code/teewars/trunk/src/engine/e_system.h	1197707754	1	/home/kma/code/teewars/trunk/src/engine/e_system.h
+/home/kma/code/teewars/trunk/src/engine/e_if_client.h	1200739934	1	Constants
+/home/kma/code/teewars/trunk/src/engine/e_if_gfx.h	1200736418	1	Structures
+/home/kma/code/teewars/trunk/src/engine/e_server_interface.h	1200739892	0	/home/kma/code/teewars/trunk/src/engine/e_server_interface.h
+/home/kma/code/teewars/trunk/src/engine/e_if_msg.h	1200736131	1	Messaging
+/home/kma/code/teewars/trunk/src/engine/e_msg.c	1200708999	0	/home/kma/code/teewars/trunk/src/engine/e_msg.c
+/home/kma/code/teewars/trunk/src/engine/server/es_server.c	1200709433	0	/home/kma/code/teewars/trunk/src/engine/server/es_server.c
+/home/kma/code/teewars/trunk/src/engine/client/ec_font.c	1200146774	0	/home/kma/code/teewars/trunk/src/engine/client/ec_font.c
+/home/kma/code/teewars/trunk/src/engine/docs/client_time.txt	1200739319	1	Time on the client
+/home/kma/code/teewars/trunk/src/engine/e_engine.c	1200708926	0	/home/kma/code/teewars/trunk/src/engine/e_engine.c
+/home/kma/code/teewars/trunk/src/engine/e_system.c	1200521738	0	/home/kma/code/teewars/trunk/src/engine/e_system.c
+/home/kma/code/teewars/trunk/src/engine/e_snapshot.h	1197707840	0	/home/kma/code/teewars/trunk/src/engine/e_snapshot.h
+/home/kma/code/teewars/trunk/src/engine/e_client_interface.h	1200739926	0	/home/kma/code/teewars/trunk/src/engine/e_client_interface.h
+/home/kma/code/teewars/trunk/src/engine/e_if_mods.h	1200736122	1	Server Hooks
+/home/kma/code/teewars/trunk/src/engine/client/ec_client.c	1200709471	0	/home/kma/code/teewars/trunk/src/engine/client/ec_client.c
+/home/kma/code/teewars/trunk/src/engine/client/ec_srvbrowse.c	1200709484	0	/home/kma/code/teewars/trunk/src/engine/client/ec_srvbrowse.c
+/home/kma/code/teewars/trunk/src/engine/e_detect.h	1197706565	0	/home/kma/code/teewars/trunk/src/engine/e_detect.h
+/home/kma/code/teewars/trunk/src/engine/e_compression.c	1197707819	0	/home/kma/code/teewars/trunk/src/engine/e_compression.c
+/home/kma/code/teewars/trunk/src/engine/e_config.c	1200521738	0	/home/kma/code/teewars/trunk/src/engine/e_config.c
+/home/kma/code/teewars/trunk/src/engine/e_packer.h	1197706544	0	/home/kma/code/teewars/trunk/src/engine/e_packer.h
+/home/kma/code/teewars/trunk/src/engine/e_config_variables.h	1200222141	0	/home/kma/code/teewars/trunk/src/engine/e_config_variables.h
+/home/kma/code/teewars/trunk/src/engine/e_map.c	1200169662	0	/home/kma/code/teewars/trunk/src/engine/e_map.c
+/home/kma/code/teewars/trunk/src/engine/e_if_server.h	1200736134	1	Server Hooks
+/home/kma/code/teewars/trunk/src/engine/e_network.h	1198020654	0	/home/kma/code/teewars/trunk/src/engine/e_network.h
+/home/kma/code/teewars/trunk/src/engine/e_packer.c	1197707860	0	/home/kma/code/teewars/trunk/src/engine/e_packer.c
+/home/kma/code/teewars/trunk/src/engine/e_config.h	1200521738	0	/home/kma/code/teewars/trunk/src/engine/e_config.h
+/home/kma/code/teewars/trunk/src/engine/e_keys.h	1197706560	0	/home/kma/code/teewars/trunk/src/engine/e_keys.h
+/home/kma/code/teewars/trunk/src/engine/docs/prediction.txt	1200739838	1	Prediction
+/home/kma/code/teewars/trunk/src/engine/e_datafile.h	1200146774	0	/home/kma/code/teewars/trunk/src/engine/e_datafile.h
+/home/kma/code/teewars/trunk/src/engine/e_engine.h	1197706566	0	/home/kma/code/teewars/trunk/src/engine/e_engine.h
+/home/kma/code/teewars/trunk/src/engine/e_snapshot.c	1200708962	0	/home/kma/code/teewars/trunk/src/engine/e_snapshot.c
+/home/kma/code/teewars/trunk/src/engine/e_compression.h	1197706556	0	/home/kma/code/teewars/trunk/src/engine/e_compression.h
+/home/kma/code/teewars/trunk/src/engine/e_console.h	1200611479	0	/home/kma/code/teewars/trunk/src/engine/e_console.h
+/home/kma/code/teewars/trunk/src/engine/client/ec_snd.c	1200709488	0	/home/kma/code/teewars/trunk/src/engine/client/ec_snd.c
+/home/kma/code/teewars/trunk/src/engine/e_common_interface.h	1200739880	0	/home/kma/code/teewars/trunk/src/engine/e_common_interface.h
+/home/kma/code/teewars/trunk/src/engine/e_network.c	1198110343	0	/home/kma/code/teewars/trunk/src/engine/e_network.c
+/home/kma/code/teewars/trunk/src/engine/e_if_inp.h	1200736117	1	Input
+/home/kma/code/teewars/trunk/src/engine/e_if_other.h	1200739887	1	Engine Interface
+/home/kma/code/teewars/trunk/src/engine/e_datafile.c	1200146774	0	/home/kma/code/teewars/trunk/src/engine/e_datafile.c
+/home/kma/code/teewars/trunk/src/engine/client/ec_gfx.c	1200709490	0	/home/kma/code/teewars/trunk/src/engine/client/ec_gfx.c
diff --git a/docs/conf/Data/PreviousMenuState.nd b/docs/conf/Data/PreviousMenuState.nd
new file mode 100644
index 00000000..1380d18b
--- /dev/null
+++ b/docs/conf/Data/PreviousMenuState.nd
Binary files differdiff --git a/docs/conf/Data/PreviousSettings.nd b/docs/conf/Data/PreviousSettings.nd
new file mode 100644
index 00000000..b397c128
--- /dev/null
+++ b/docs/conf/Data/PreviousSettings.nd
Binary files differdiff --git a/docs/conf/Data/SymbolTable.nd b/docs/conf/Data/SymbolTable.nd
new file mode 100644
index 00000000..29841a27
--- /dev/null
+++ b/docs/conf/Data/SymbolTable.nd
Binary files differdiff --git a/docs/conf/Languages.txt b/docs/conf/Languages.txt
new file mode 100644
index 00000000..aa9ce802
--- /dev/null
+++ b/docs/conf/Languages.txt
@@ -0,0 +1,113 @@
+Format: 1.35
+
+# This is the Natural Docs languages file for this project.  If you change
+# anything here, it will apply to THIS PROJECT ONLY.  If you'd like to change
+# something for all your projects, edit the Languages.txt in Natural Docs'
+# Config directory instead.
+
+
+# You can prevent certain file extensions from being scanned like this:
+# Ignore Extensions: [extension] [extension] ...
+
+
+#-------------------------------------------------------------------------------
+# SYNTAX:
+#
+# Unlike other Natural Docs configuration files, in this file all comments
+# MUST be alone on a line.  Some languages deal with the # character, so you
+# cannot put comments on the same line as content.
+#
+# Also, all lists are separated with spaces, not commas, again because some
+# languages may need to use them.
+#
+# Language: [name]
+# Alter Language: [name]
+#    Defines a new language or alters an existing one.  Its name can use any
+#    characters.  If any of the properties below have an add/replace form, you
+#    must use that when using Alter Language.
+#
+#    The language Shebang Script is special.  It's entry is only used for
+#    extensions, and files with those extensions have their shebang (#!) lines
+#    read to determine the real language of the file.  Extensionless files are
+#    always treated this way.
+#
+#    The language Text File is also special.  It's treated as one big comment
+#    so you can put Natural Docs content in them without special symbols.  Also,
+#    if you don't specify a package separator, ignored prefixes, or enum value
+#    behavior, it will copy those settings from the language that is used most
+#    in the source tree.
+#
+# Extensions: [extension] [extension] ...
+# [Add/Replace] Extensions: [extension] [extension] ...
+#    Defines the file extensions of the language's source files.  You can
+#    redefine extensions found in the main languages file.  You can use * to
+#    mean any undefined extension.
+#
+# Shebang Strings: [string] [string] ...
+# [Add/Replace] Shebang Strings: [string] [string] ...
+#    Defines a list of strings that can appear in the shebang (#!) line to
+#    designate that it's part of the language.  You can redefine strings found
+#    in the main languages file.
+#
+# Ignore Prefixes in Index: [prefix] [prefix] ...
+# [Add/Replace] Ignored Prefixes in Index: [prefix] [prefix] ...
+#
+# Ignore [Topic Type] Prefixes in Index: [prefix] [prefix] ...
+# [Add/Replace] Ignored [Topic Type] Prefixes in Index: [prefix] [prefix] ...
+#    Specifies prefixes that should be ignored when sorting symbols in an
+#    index.  Can be specified in general or for a specific topic type.
+#
+#------------------------------------------------------------------------------
+# For basic language support only:
+#
+# Line Comments: [symbol] [symbol] ...
+#    Defines a space-separated list of symbols that are used for line comments,
+#    if any.
+#
+# Block Comments: [opening sym] [closing sym] [opening sym] [closing sym] ...
+#    Defines a space-separated list of symbol pairs that are used for block
+#    comments, if any.
+#
+# Package Separator: [symbol]
+#    Defines the default package separator symbol.  The default is a dot.
+#
+# [Topic Type] Prototype Enders: [symbol] [symbol] ...
+#    When defined, Natural Docs will attempt to get a prototype from the code
+#    immediately following the topic type.  It stops when it reaches one of
+#    these symbols.  Use \n for line breaks.
+#
+# Line Extender: [symbol]
+#    Defines the symbol that allows a prototype to span multiple lines if
+#    normally a line break would end it.
+#
+# Enum Values: [global|under type|under parent]
+#    Defines how enum values are referenced.  The default is global.
+#    global       - Values are always global, referenced as 'value'.
+#    under type   - Values are under the enum type, referenced as
+#               'package.enum.value'.
+#    under parent - Values are under the enum's parent, referenced as
+#               'package.value'.
+#
+# Perl Package: [perl package]
+#    Specifies the Perl package used to fine-tune the language behavior in ways
+#    too complex to do in this file.
+#
+#------------------------------------------------------------------------------
+# For full language support only:
+#
+# Full Language Support: [perl package]
+#    Specifies the Perl package that has the parsing routines necessary for full
+#    language support.
+#
+#-------------------------------------------------------------------------------
+
+# The following languages are defined in the main file, if you'd like to alter
+# them:
+#
+#    Text File, Shebang Script, C/C++, C#, Java, JavaScript, Perl, Python,
+#    PHP, SQL, Visual Basic, Pascal, Assembly, Ada, Tcl, Ruby, Makefile,
+#    ActionScript, ColdFusion, R, Fortran
+
+# If you add a language that you think would be useful to other developers
+# and should be included in Natural Docs by default, please e-mail it to
+# languages [at] naturaldocs [dot] org.
diff --git a/docs/conf/Menu.txt b/docs/conf/Menu.txt
new file mode 100644
index 00000000..e3d50ddb
--- /dev/null
+++ b/docs/conf/Menu.txt
@@ -0,0 +1,79 @@
+Format: 1.35
+
+
+# You can add a title and sub-title to your menu like this:
+# Title: [project name]
+# SubTitle: [subtitle]
+
+# You can add a footer to your documentation like this:
+# Footer: [text]
+# If you want to add a copyright notice, this would be the place to do it.
+
+
+# --------------------------------------------------------------------------
+# 
+# Cut and paste the lines below to change the order in which your files
+# appear on the menu.  Don't worry about adding or removing files, Natural
+# Docs will take care of that.
+# 
+# You can further organize the menu by grouping the entries.  Add a
+# "Group: [name] {" line to start a group, and add a "}" to end it.
+# 
+# You can add text and web links to the menu by adding "Text: [text]" and
+# "Link: [name] ([URL])" lines, respectively.
+# 
+# The formatting and comments are auto-generated, so don't worry about
+# neatness when editing the file.  Natural Docs will clean it up the next
+# time it is run.  When working with groups, just deal with the braces and
+# forget about the indentation and comments.
+# 
+# --------------------------------------------------------------------------
+
+
+Group: Articles  {
+
+   File: Prediction  (docs/prediction.txt)
+   File: Time on the client  (docs/client_time.txt)
+   }  # Group: Articles
+
+Group: Reference  {
+
+   File: Lowlevel Library  (no auto-title, e_system.h)
+
+   Group: Common Interface  {
+
+      File: Engine Interface  (e_if_other.h)
+      File: Message Packing  (no auto-title, e_if_msg.h)
+      }  # Group: Common Interface
+
+   Group: Client Interface  {
+
+      File: General  (no auto-title, e_if_client.h)
+      File: Sound  (no auto-title, e_if_snd.h)
+      File: Input  (no auto-title, e_if_inp.h)
+      File: Graphics  (no auto-title, e_if_gfx.h)
+      }  # Group: Client Interface
+
+   Group: Server Interface  {
+
+      File: General  (no auto-title, e_if_server.h)
+      }  # Group: Server Interface
+
+   Group: Mod Hooks  {
+
+      File: Client Side  (no auto-title, e_if_modc.h)
+      File: Server Side  (no auto-title, e_if_mods.h)
+      }  # Group: Mod Hooks
+
+   }  # Group: Reference
+
+Group: Index  {
+
+   Index: Everything
+   Constant Index: Constants
+   File Index: Files
+   Function Index: Functions
+   Class Index: Classes
+   Variable Index: Variables
+   }  # Group: Index
+
diff --git a/docs/conf/Menu_Backup.txt b/docs/conf/Menu_Backup.txt
new file mode 100644
index 00000000..bbd7f561
--- /dev/null
+++ b/docs/conf/Menu_Backup.txt
@@ -0,0 +1,66 @@
+Format: 1.35
+
+
+# You can add a title and sub-title to your menu like this:
+# Title: [project name]
+# SubTitle: [subtitle]
+
+# You can add a footer to your documentation like this:
+# Footer: [text]
+# If you want to add a copyright notice, this would be the place to do it.
+
+
+# --------------------------------------------------------------------------
+# 
+# Cut and paste the lines below to change the order in which your files
+# appear on the menu.  Don't worry about adding or removing files, Natural
+# Docs will take care of that.
+# 
+# You can further organize the menu by grouping the entries.  Add a
+# "Group: [name] {" line to start a group, and add a "}" to end it.
+# 
+# You can add text and web links to the menu by adding "Text: [text]" and
+# "Link: [name] ([URL])" lines, respectively.
+# 
+# The formatting and comments are auto-generated, so don't worry about
+# neatness when editing the file.  Natural Docs will clean it up the next
+# time it is run.  When working with groups, just deal with the braces and
+# forget about the indentation and comments.
+# 
+# --------------------------------------------------------------------------
+
+
+File: e_system.h  (e_system.h)
+File: Engine Interface  (e_interface.h)
+
+Group: External  {
+
+   Group: Glfw  {
+
+      File: Does this work?  (external/glfw/lib/x11/x11_window.c)
+      File: glfw.h  (external/glfw/include/GL/glfw.h)
+      File: lib/win32/win32_window.c  (external/glfw/lib/win32/win32_window.c)
+      File: Only Linux joystick input is supported at the moment. Other  (external/glfw/lib/x11/x11_joystick.c)
+      File: Some compilers complains about hinst and x never being used -  (external/glfw/lib/win32/win32_dllmain.c)
+      }  # Group: Glfw
+
+   File: pnglite/pnglite.h  (external/pnglite/pnglite.h)
+
+   Group: Portaudio  {
+
+      File: for the default AudioUnit, we could use the  (external/portaudio/pa_mac_core.c)
+      File: make sure this validation list is kept syncronised with the one in  (external/portaudio/pa_front.c)
+      File: this code depends on the sample format constants being in  (external/portaudio/pa_converters.c)
+      }  # Group: Portaudio
+
+   File: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4  (external/zlib/deflate.c)
+   }  # Group: External
+
+Group: Index  {
+
+   Index: Everything
+   File Index: Files
+   Function Index: Functions
+   Variable Index: Variables
+   }  # Group: Index
+
diff --git a/docs/conf/Topics.txt b/docs/conf/Topics.txt
new file mode 100644
index 00000000..ee15ec83
--- /dev/null
+++ b/docs/conf/Topics.txt
@@ -0,0 +1,84 @@
+Format: 1.35
+
+# This is the Natural Docs topics file for this project.  If you change anything
+# here, it will apply to THIS PROJECT ONLY.  If you'd like to change something
+# for all your projects, edit the Topics.txt in Natural Docs' Config directory
+# instead.
+
+
+# If you'd like to prevent keywords from being recognized by Natural Docs, you
+# can do it like this:
+# Ignore Keywords: [keyword], [keyword], ...
+#
+# Or you can use the list syntax like how they are defined:
+# Ignore Keywords:
+#    [keyword]
+#    [keyword], [plural keyword]
+#    ...
+
+
+#-------------------------------------------------------------------------------
+# SYNTAX:
+#
+# Topic Type: [name]
+# Alter Topic Type: [name]
+#    Creates a new topic type or alters one from the main file.  Each type gets
+#    its own index and behavior settings.  Its name can have letters, numbers,
+#    spaces, and these charaters: - / . '
+#
+# Plural: [name]
+#    Sets the plural name of the topic type, if different.
+#
+# Keywords:
+#    [keyword]
+#    [keyword], [plural keyword]
+#    ...
+#    Defines or adds to the list of keywords for the topic type.  They may only
+#    contain letters, numbers, and spaces and are not case sensitive.  Plural
+#    keywords are used for list topics.  You can redefine keywords found in the
+#    main topics file.
+#
+# Index: [yes|no]
+#    Whether the topics get their own index.  Defaults to yes.  Everything is
+#    included in the general index regardless of this setting.
+#
+# Scope: [normal|start|end|always global]
+#    How the topics affects scope.  Defaults to normal.
+#    normal        - Topics stay within the current scope.
+#    start         - Topics start a new scope for all the topics beneath it,
+#                    like class topics.
+#    end           - Topics reset the scope back to global for all the topics
+#                    beneath it.
+#    always global - Topics are defined as global, but do not change the scope
+#                    for any other topics.
+#
+# Class Hierarchy: [yes|no]
+#    Whether the topics are part of the class hierarchy.  Defaults to no.
+#
+# Variable Type: [yes|no]
+#    Whether the topics can be a variable type.  Defaults to no.
+#
+# Page Title If First: [yes|no]
+#    Whether the topic's title becomes the page title if it's the first one in
+#    a file.  Defaults to no.
+#
+# Break Lists: [yes|no]
+#    Whether list topics should be broken into individual topics in the output.
+#    Defaults to no.
+#
+# Can Group With: [type], [type], ...
+#    Defines a list of topic types that this one can possibly be grouped with.
+#    Defaults to none.
+#-------------------------------------------------------------------------------
+
+# The following topics are defined in the main file, if you'd like to alter
+# their behavior or add keywords:
+#
+#    Generic, Class, Interface, Section, File, Group, Function, Variable,
+#    Property, Type, Constant, Enumeration, Event, Delegate, Macro,
+#    Database, Database Table, Database View, Database Index, Database
+#    Cursor, Database Trigger, Cookie, Build Target
+
+# If you add something that you think would be useful to other developers
+# and should be included in Natural Docs by default, please e-mail it to
+# topics [at] naturaldocs [dot] org.
diff --git a/scripts/make_docs.sh b/scripts/make_docs.sh
index 248b3efa..a7682d30 100755
--- a/scripts/make_docs.sh
+++ b/scripts/make_docs.sh
@@ -1,5 +1 @@
-#!/bin/sh
-docs/doctool/NaturalDocs -r -s Small -i src/ -i docs/articles -o HTML docs/output -p docs/config
-
-#rm -Rf ~/public_html/.docs
-#cp -Rf docs/output ~/public_html/.docs
+perl tools/naturaldocs/NaturalDocs -i src/engine -xi src/engine/external -p docs/conf -o html docs/output
diff --git a/src/engine/client/ec_client.c b/src/engine/client/ec_client.c
index 5957312a..1732b02b 100644
--- a/src/engine/client/ec_client.c
+++ b/src/engine/client/ec_client.c
@@ -8,7 +8,7 @@
 
 #include <engine/e_system.h>
 #include <engine/e_engine.h>
-#include <engine/e_interface.h>
+#include <engine/e_client_interface.h>
 
 #include <engine/e_protocol.h>
 #include <engine/e_snapshot.h>
@@ -65,7 +65,7 @@ static float ticktime = 0;
 
 /* predicted time */
 static int current_predtick = 0;
-static float intrapredtick = 0;
+static float predintratick = 0;
 
 static struct /* TODO: handle input better */
 {
@@ -237,7 +237,7 @@ int snap_num_items(int snapid)
 
 /* ------ time functions ------ */
 float client_intratick() { return intratick; }
-float client_intrapredtick() { return intrapredtick; }
+float client_predintratick() { return predintratick; }
 float client_ticktime() { return ticktime; }
 int client_tick() { return current_tick; }
 int client_predtick() { return current_predtick; }
@@ -924,7 +924,7 @@ static void client_update()
 			/*tg_add(&predicted_time_graph, pred_now, 0); */
 			int prev_pred_tick = (int)(pred_now*50/time_freq());
 			int new_pred_tick = prev_pred_tick+1;
-			static float last_intrapred = 0;
+			static float last_predintra = 0;
 
 			intratick = (now - prevtick_start) / (float)(curtick_start-prevtick_start);
 			ticktime = (now - curtick_start) / (freq/(float)SERVER_TICK_SPEED);
@@ -933,12 +933,11 @@ static void client_update()
 
 			curtick_start = new_pred_tick*time_freq()/50;
 			prevtick_start = prev_pred_tick*time_freq()/50;
-			intrapredtick = (pred_now - prevtick_start) / (float)(curtick_start-prevtick_start);
-			
+			predintratick = (pred_now - prevtick_start) / (float)(curtick_start-prevtick_start);
 			
 			if(new_pred_tick > current_predtick)
 			{
-				last_intrapred = intrapredtick;
+				last_predintra = predintratick;
 				current_predtick = new_pred_tick;
 				repredict = 1;
 				
@@ -946,9 +945,9 @@ static void client_update()
 				client_send_input();
 			}
 			
-			if(intrapredtick < last_intrapred)
+			if(predintratick < last_predintra)
 				dbg_msg("client", "prediction time goes backwards, that can't be good");
-			last_intrapred = intrapredtick;
+			last_predintra = predintratick;
 		}
 
 		/* only do sane predictions */
diff --git a/src/engine/client/ec_gfx.c b/src/engine/client/ec_gfx.c
index b71cb186..505c42f7 100644
--- a/src/engine/client/ec_gfx.c
+++ b/src/engine/client/ec_gfx.c
@@ -3,7 +3,7 @@
 #include <engine/external/pnglite/pnglite.h>
 
 #include <engine/e_system.h>
-#include <engine/e_interface.h>
+#include <engine/e_client_interface.h>
 #include <engine/e_engine.h>
 #include <engine/e_config.h>
 #include <engine/e_keys.h>
diff --git a/src/engine/client/ec_inp.c b/src/engine/client/ec_inp.c
index 57216ac4..41689d8a 100644
--- a/src/engine/client/ec_inp.c
+++ b/src/engine/client/ec_inp.c
@@ -3,7 +3,7 @@
 #include <engine/external/glfw/include/GL/glfw.h>
 
 #include <engine/e_system.h>
-#include <engine/e_interface.h>
+#include <engine/e_client_interface.h>
 #include <engine/e_config.h>
 
 static int keyboard_state[2][1024]; /* TODO: fix this!! */
@@ -53,7 +53,7 @@ enum
 	INPUT_BUFFER_SIZE=32
 };
 
-static INPUTEVENT input_events[INPUT_BUFFER_SIZE];
+static INPUT_EVENT input_events[INPUT_BUFFER_SIZE];
 static int num_events = 0;
 
 static void add_event(char c, int key)
@@ -76,11 +76,11 @@ void inp_clear_events()
 	num_events = 0;
 }
 
-INPUTEVENT inp_get_event(int index)
+INPUT_EVENT inp_get_event(int index)
 {
 	if(index < 0 || index >= num_events)
 	{
-		INPUTEVENT e = {0,0};
+		INPUT_EVENT e = {0,0};
 		return e;
 	}
 	
diff --git a/src/engine/client/ec_snd.c b/src/engine/client/ec_snd.c
index 49f050c9..6bcb242b 100644
--- a/src/engine/client/ec_snd.c
+++ b/src/engine/client/ec_snd.c
@@ -1,6 +1,6 @@
 /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
 #include <engine/e_system.h>
-#include <engine/e_interface.h>
+#include <engine/e_client_interface.h>
 #include <engine/e_config.h>
 
 #include <engine/external/portaudio/portaudio.h>
diff --git a/src/engine/client/ec_srvbrowse.c b/src/engine/client/ec_srvbrowse.c
index 3a07d86a..7459657f 100644
--- a/src/engine/client/ec_srvbrowse.c
+++ b/src/engine/client/ec_srvbrowse.c
@@ -1,7 +1,7 @@
 /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
 #include <engine/e_system.h>
 #include <engine/e_network.h>
-#include <engine/e_interface.h>
+#include <engine/e_client_interface.h>
 #include <engine/e_config.h>
 #include <engine/e_memheap.h>
 
diff --git a/src/engine/docs/client_time.txt b/src/engine/docs/client_time.txt
new file mode 100644
index 00000000..24ca2be5
--- /dev/null
+++ b/src/engine/docs/client_time.txt
@@ -0,0 +1,4 @@
+Title: Time on the client
+
+tick, intratick
+predtick, predintratick
diff --git a/src/engine/docs/prediction.txt b/src/engine/docs/prediction.txt
new file mode 100644
index 00000000..d5771d1a
--- /dev/null
+++ b/src/engine/docs/prediction.txt
@@ -0,0 +1,19 @@
+Title: Prediction
+
+The engine calls <modc_predict> when reprediction is required. This happens usally when new data has arrived from the server. <modc_predict> should to prediction from the current snapshot and current snapshot tick (<client_tick> + 1) upto and including the tick returned by <client_predtick>.
+
+Predicted input sent to the server can be retrived by calling <client_get_input> with the corresponding tick that you want the input for. Here is a simple example of how it might look.
+
+> void modc_predict()
+> {
+> 	int tick;
+> 	prediction_reset();
+> 
+> 	for(tick = client_tick()+1; tick <= client_predtick(); tick++)
+> 	{
+> 		MY_INPUT *input = (MY_INPUT *)client_get_input();
+> 		if(input)
+> 			prediction_apply_input(input);
+> 		prediction_tick();
+> 	}
+> }
diff --git a/src/engine/e_client_interface.h b/src/engine/e_client_interface.h
new file mode 100644
index 00000000..d82a27d6
--- /dev/null
+++ b/src/engine/e_client_interface.h
@@ -0,0 +1,21 @@
+/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
+#ifndef ENGINE_CLIENT_INTERFACE_H
+#define ENGINE_CLIENT_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "e_if_other.h"
+#include "e_if_client.h"
+#include "e_if_snd.h"
+#include "e_if_gfx.h"
+#include "e_if_inp.h"
+#include "e_if_msg.h"
+#include "e_if_modc.h"
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/engine/e_common_interface.h b/src/engine/e_common_interface.h
new file mode 100644
index 00000000..498bb6b4
--- /dev/null
+++ b/src/engine/e_common_interface.h
@@ -0,0 +1,16 @@
+/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
+#ifndef ENGINE_COMMON_INTERFACE_H
+#define ENGINE_COMMON_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "e_if_other.h"
+#include "e_if_msg.h"
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/engine/e_engine.c b/src/engine/e_engine.c
index 06b82f7f..5cd5d6bd 100644
--- a/src/engine/e_engine.c
+++ b/src/engine/e_engine.c
@@ -3,7 +3,8 @@
 #include <stdio.h>
 
 #include <engine/e_system.h>
-#include <engine/e_interface.h>
+#include <engine/e_server_interface.h>
+/*#include <engine/e_client_interface.h>*/
 #include <engine/e_config.h>
 #include <engine/e_console.h>
 
diff --git a/src/engine/e_if_client.h b/src/engine/e_if_client.h
new file mode 100644
index 00000000..ea29a17c
--- /dev/null
+++ b/src/engine/e_if_client.h
@@ -0,0 +1,376 @@
+/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
+#ifndef ENGINE_IF_CLIENT_H
+#define ENGINE_IF_CLIENT_H
+
+/*
+	Section: Constants
+*/
+
+enum
+{
+	/* Constants: Client States
+		CLIENTSTATE_OFFLINE - The client is offline.
+		CLIENTSTATE_CONNECTING - The client is trying to connect to a server.
+		CLIENTSTATE_LOADING - The client has connected to a server and is loading resources.
+		CLIENTSTATE_ONLINE - The client is connected to a server and running the game.
+		CLIENTSTATE_QUITING - The client is quiting.
+	*/
+	CLIENTSTATE_OFFLINE=0,
+	CLIENTSTATE_CONNECTING,
+	CLIENTSTATE_LOADING,
+	CLIENTSTATE_ONLINE,
+	CLIENTSTATE_QUITING,
+
+
+	/* Constants: Image Formats
+		IMG_AUTO - Lets the engine choose the format.
+		IMG_RGB - 8-Bit uncompressed RGB
+		IMG_RGBA - 8-Bit uncompressed RGBA
+		IMG_ALPHA - 8-Bit uncompressed alpha
+	*/
+	IMG_AUTO=-1,
+	IMG_RGB=0,
+	IMG_RGBA=1,
+	IMG_ALPHA=2,
+	
+	/* Constants: Server Browser Sorting
+		BROWSESORT_NAME - Sort by name.
+		BROWSESORT_PING - Sort by ping.
+		BROWSESORT_MAP - Sort by map
+		BROWSESORT_GAMETYPE - Sort by game type. DM, TDM etc.
+		BROWSESORT_PROGRESSION - Sort by progression.
+		BROWSESORT_NUMPLAYERS - Sort after how many players there are on the server.
+	*/
+	BROWSESORT_NAME = 0,
+	BROWSESORT_PING,
+	BROWSESORT_MAP,
+	BROWSESORT_GAMETYPE,
+	BROWSESORT_PROGRESSION,
+	BROWSESORT_NUMPLAYERS
+};
+
+/*
+	Section: Structures
+*/
+
+/*
+	Structure: SERVER_INFO
+*/
+typedef struct
+{
+	int sorted_index;
+	int server_index;
+	
+	int progression;
+	int game_type;
+	int max_players;
+	int num_players;
+	int flags;
+	int latency; /* in ms */
+	char name[64];
+	char map[32];
+	char version[32];
+	char address[24];
+	char player_names[16][48];
+	int player_scores[16];
+} SERVER_INFO;
+
+/*
+	Section: Functions
+*/
+
+/**********************************************************************************
+	Group: Time
+**********************************************************************************/
+/*
+	Function: client_tick
+		Returns the tick of the current snapshot.
+*/
+int client_tick();
+
+
+/*
+	Function: client_intratick
+		Returns the current intratick.
+	
+	Remarks:
+		The intratick is how far gone the time is from the previous snapshot to the current.
+		0.0 means that it on the previous snapshot. 0.5 means that it's halfway to the current,
+		and 1.0 means that it is on the current snapshot. It can go beyond 1.0 which means that
+		the client has started to extrapolate due to lack of data from the server.
+
+	See Also:
+		<client_tick>
+*/
+float client_intratick();
+
+/*
+	Function: client_predtick
+		Returns the current predicted tick.
+*/
+int client_predtick();
+
+/*
+	Function: client_predintratick
+		Returns the current preticted intra tick.
+	
+	Remarks:
+		This is the same as <client_intratick> but for the current predicted tick and
+		previous predicted tick.
+
+	See Also:
+		<client_intratick>
+*/
+float client_predintratick();
+
+/*
+	Function: client_ticktime
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+float client_ticktime();
+
+/*
+	Function: client_tickspeed
+		Returns how many ticks per second the client is doing.
+	
+	Remarks:
+		This will be the same as the server tick speed.
+*/
+int client_tickspeed();
+
+/*
+	Function: client_frametime
+		Returns how long time the last frame took to process.
+*/
+float client_frametime();
+
+/*
+	Function: client_localtime
+		Returns the clients local time.
+	
+	Remarks:
+		The local time is set to 0 when the client starts and when
+		it connects to a server. Can be used for client side effects.
+*/
+float client_localtime();
+
+/**********************************************************************************
+	Group: Server Browser
+**********************************************************************************/
+
+/*
+	Function: client_serverbrowse_refresh
+		Issues a refresh of the server browser.
+	
+	Arguments:
+		lan - Tells the function if it should do a LAN listing or an Internet listing.
+	
+	Remarks:
+		This will cause a broadcast on the local network if the lan argument is set.
+		Otherwise it call ask all the master servers for their servers lists.
+*/
+void client_serverbrowse_refresh(int lan);
+
+/*
+	Function: client_serverbrowse_sorted_get
+		Returns server info from the sorted list.
+	
+	Arguments:
+		index - Zero based index into the sorted list.
+	
+	See Also:
+		<client_serverbrowse_sorted_num>
+*/
+SERVER_INFO *client_serverbrowse_sorted_get(int index);
+
+/*
+	Function: client_serverbrowse_sorted_num
+		Returns how many servers there are in the sorted list.
+	
+	See Also:
+		<client_serverbrowse_sorted_get>
+*/
+int client_serverbrowse_sorted_num();
+
+/*
+	Function: client_serverbrowse_get
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+SERVER_INFO *client_serverbrowse_get(int index);
+
+/*
+	Function: client_serverbrowse_num
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int client_serverbrowse_num();
+
+/*
+	Function: client_serverbrowse_num_requests
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int client_serverbrowse_num_requests();
+
+/*
+	Function: client_serverbrowse_update
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void client_serverbrowse_update();
+
+
+/**********************************************************************************
+	Group: Actions
+**********************************************************************************/
+
+
+/*
+	Function: client_connect
+		Connects to a server at the specified address.
+	
+	Arguments:
+		address - Address of the server to connect to.
+	
+	See Also:
+		<client_disconnect>
+*/
+void client_connect(const char *address);
+
+/*
+	Function: client_disconnect
+		Disconnects from the current server.
+	
+	Remarks:
+		Does nothing if not connected to a server.
+
+	See Also:
+		<client_connect, client_quit>
+*/
+void client_disconnect();
+
+/*
+	Function: client_quit
+		Tells to client to shutdown.
+
+	See Also:
+		<client_disconnect>
+*/
+void client_quit();
+
+void client_entergame();
+
+/*
+	Function: client_rcon
+		Sends a command to the server to execute on it's console.
+	
+	Arguments:
+		cmd - The command to send.
+	
+	Remarks:
+		The client must have the correct rcon password to connect.
+*/
+void client_rcon(const char *cmd);
+
+/**********************************************************************************
+	Group: Other
+**********************************************************************************/
+/*
+	Function: client_get_input
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int *client_get_input(int tick);
+
+/*
+	Function: client_direct_input
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void client_direct_input(int *input, int size);
+
+/*
+	Function: client_error_string
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+const char *client_error_string();
+
+/*
+	Function: client_connection_problems
+		Returns 1 if the client is connection problems.
+	
+	Remarks:
+		Connections problems usually means that the client havn't recvived any data
+		from the server in a while.
+*/
+int client_connection_problems();
+
+/*
+	Function: client_state
+		Returns the state of the client.
+		
+	See Also:
+		<Client States>
+*/
+int client_state();
+
+#endif
diff --git a/src/engine/e_if_gfx.h b/src/engine/e_if_gfx.h
new file mode 100644
index 00000000..d49a3cda
--- /dev/null
+++ b/src/engine/e_if_gfx.h
@@ -0,0 +1,578 @@
+/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
+#ifndef ENGINE_IF_GFX_H
+#define ENGINE_IF_GFX_H
+
+/*
+	Section: Structures
+*/
+
+/*
+	Structure: IMAGE_INFO
+*/
+typedef struct
+{
+	/* Variable: width
+		Contains the width of the image */
+	int width;
+	
+	/* Variable: height
+		Contains the height of the image */
+	int height;
+	
+	/* Variable: format
+		Contains the format of the image. See <Image Formats> for more information. */
+	int format;
+
+	/* Variable: data
+		Pointer to the image data. */
+	void *data;
+} IMAGE_INFO;
+
+/*
+	Structure: VIDEO_MODE
+*/
+typedef struct 
+{
+	int width, height;
+	int red, green, blue;
+} VIDEO_MODE;
+
+/*
+	Section: Functions
+*/
+
+/*
+	Group: Quads
+*/
+
+/*
+	Function: gfx_quads_begin
+		Begins a quad drawing session.
+		
+	Remarks:
+		This functions resets the rotation, color and subset.
+		End the session by using <gfx_quads_end>.
+		You can't change texture or blending mode during a session.
+		
+	See Also:
+		<gfx_quads_end>
+*/
+void gfx_quads_begin();
+
+/*
+	Function: gfx_quads_end
+		Ends a quad session.
+		
+	See Also:
+		<gfx_quads_begin>
+*/
+void gfx_quads_end();
+
+/*
+	Function: gfx_quads_setrotation
+		Sets the rotation to use when drawing a quad.
+		
+	Arguments:
+		angle - Angle in radians.
+		
+	Remarks:
+		The angle is reset when <gfx_quads_begin> is called.
+*/
+void gfx_quads_setrotation(float angle);
+
+/*
+	Function: gfx_quads_setsubset
+		Sets the uv coordinates to use.
+		
+	Arguments:
+		tl_u - Top-left U value.
+		tl_v - Top-left V value.
+		br_u - Bottom-right U value.
+		br_v - Bottom-right V value.
+		
+	Remarks:
+		O,0 is top-left of the texture and 1,1 is bottom-right.
+		The color is reset when <gfx_quads_begin> is called.
+*/
+void gfx_quads_setsubset(float tl_u, float tl_v, float br_u, float br_v);
+
+/*
+	Function: gfx_quads_setsubset_free
+		TODO
+		
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void gfx_quads_setsubset_free(
+	float x0, float y0,
+	float x1, float y1,
+	float x2, float y2,
+	float x3, float y3);
+
+/*
+	Function: gfx_quads_drawTL
+		Draws a quad by specifying the top-left point.
+		
+	Arguments:
+		x - X coordinate of the top-left corner.
+		y - Y coordinate of the top-left corner.
+		width - Width of the quad.
+		height - Height of the quad.
+		
+	Remarks:
+		Rotation still occurs from the center of the quad.
+		You must call <gfx_quads_begin> before calling this function.
+
+	See Also:
+		<gfx_quads_draw, gfx_quads_draw_freeform>
+*/
+void gfx_quads_drawTL(float x, float y, float width, float height);
+
+/*
+	Function: gfx_quads_draw
+		Draws a quad by specifying the center point.
+		
+	Arguments:
+		x - X coordinate of the center.
+		y - Y coordinate of the center.
+		width - Width of the quad.
+		height - Height of the quad.
+
+	Remarks:
+		You must call <gfx_quads_begin> before calling this function.
+
+	See Also:
+		<gfx_quads_drawTL, gfx_quads_draw_freeform>
+*/
+void gfx_quads_draw(float x, float y, float w, float h);
+
+/*
+	Function: gfx_quads_draw_freeform
+		Draws a quad by specifying the corner points.
+	
+	Arguments:
+		x0, y0 - Coordinates of the upper left corner.
+		x1, y1 - Coordinates of the upper right corner.
+		x2, y2 - Coordinates of the lower left corner. // TODO: DOUBLE CHECK!!!
+		x3, y3 - Coordinates of the lower right corner. // TODO: DOUBLE CHECK!!!
+	
+	See Also:
+		<gfx_quads_draw, gfx_quads_drawTL>
+*/
+void gfx_quads_draw_freeform(
+	float x0, float y0,
+	float x1, float y1,
+	float x2, float y2,
+	float x3, float y3);
+
+/*
+	Function: gfx_quads_text
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void gfx_quads_text(float x, float y, float size, const char *text);
+
+/*
+	Group: Lines
+*/
+
+/*
+	Function: gfx_lines_begin
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void gfx_lines_begin();
+
+/*
+	Function: gfx_lines_draw
+		TODO
+		
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void gfx_lines_draw(float x0, float y0, float x1, float y1);
+
+/*
+	Function: gfx_lines_end
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void gfx_lines_end();
+
+/*
+	Group: Text
+*/
+
+
+/*
+	Function: gfx_text
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void gfx_text(void *font, float x, float y, float size, const char *text, int max_width);
+
+/*
+	Function: gfx_text_width
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+float gfx_text_width(void *font, float size, const char *text, int length);
+
+/*
+	Function: gfx_text_color
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void gfx_text_color(float r, float g, float b, float a);
+
+/*
+	Function: gfx_text_set_default_font
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void gfx_text_set_default_font(void *font);
+
+/*
+	Group: Other
+*/
+
+/*
+	Function: gfx_get_video_modes
+		Fetches a list of all the available video modes.
+		
+	Arguments:
+		list - An array to recive the modes. Must be able to contain maxcount number of modes.
+		maxcount - The maximum number of modes to fetch.
+	
+	Returns:
+		The number of video modes that was fetched.
+*/
+int gfx_get_video_modes(VIDEO_MODE *list, int maxcount);
+
+/* image loaders */
+
+/*
+	Function: gfx_load_png
+		Loads a PNG image from disk.
+	
+	Arguments:
+		img - Pointer to an structure to be filled out with the image information.
+		filename - Filename of the image to load.
+	
+	Returns:
+		Returns non-zero on success and zero on error.
+	
+	Remarks:
+		The caller are responsible for cleaning up the allocated memory in the IMAGE_INFO structure.
+	
+	See Also:
+		<gfx_load_texture>
+*/
+int gfx_load_png(IMAGE_INFO *img, const char *filename);
+
+/* textures */
+/*
+	Function: gfx_load_texture
+		Loads a texture from a file. TGA and PNG supported.
+	
+	Arguments:
+		filename - Null terminated string to the file to load.
+		store_format - What format to store on gfx card as.
+	
+	Returns:
+		An ID to the texture. -1 on failure.
+
+	See Also:
+		<gfx_unload_texture, gfx_load_png>
+*/
+int gfx_load_texture(const char *filename, int store_format);
+
+/*
+	Function: gfx_load_texture_raw
+		Loads a texture from memory.
+	
+	Arguments:
+		w - Width of the texture.
+		h - Height of the texture.
+		data - Pointer to the pixel data.
+		format - Format of the pixel data.
+		store_format - The format to store the texture on the graphics card.
+	
+	Returns:
+		An ID to the texture. -1 on failure.
+		
+	Remarks:
+		The pixel data should be in RGBA format with 8 bit per component.
+		So the total size of the data should be w*h*4.
+		
+	See Also:
+		<gfx_unload_texture>
+*/
+int gfx_load_texture_raw(int w, int h, int format, const void *data, int store_format);
+
+/*
+	Function: gfx_texture_set
+		Sets the active texture.
+	
+	Arguments:
+		id - ID to the texture to set.
+*/
+void gfx_texture_set(int id);
+
+/*
+	Function: gfx_unload_texture
+		Unloads a texture.
+	
+	Arguments:
+		id - ID to the texture to unload.
+		
+	See Also:
+		<gfx_load_texture_tga>, <gfx_load_texture_raw>
+		
+	Remarks:
+		NOT IMPLEMENTED
+*/
+int gfx_unload_texture(int id);
+
+/*
+	Function: gfx_clear
+		Clears the screen with the specified color.
+	
+	Arguments:
+		r - Red component.
+		g - Green component.
+		b - Red component.
+	
+	Remarks:
+		The value of the components are given in 0.0 - 1.0 ranges.
+*/
+void gfx_clear(float r, float g, float b);
+
+/*
+	Function: gfx_screenaspect
+		Returns the aspect ratio between width and height.
+
+	See Also:
+		<gfx_screenwidth>, <gfx_screenheight>
+*/
+float gfx_screenaspect();
+
+/*
+	Function: gfx_screenwidth
+		Returns the screen width.
+	
+	See Also:
+		<gfx_screenheight>
+*/
+int gfx_screenwidth();
+
+/*
+	Function: gfx_screenheight
+		Returns the screen height.
+	
+	See Also:
+		<gfx_screenwidth>
+*/
+int gfx_screenheight();
+
+/*
+	Function: gfx_mapscreen
+		Specifies the coordinate system for the screen.
+		
+	Arguments:
+		tl_x - Top-left X
+		tl_y - Top-left Y
+		br_x - Bottom-right X
+		br_y - Bottom-right y
+*/
+void gfx_mapscreen(float tl_x, float tl_y, float br_x, float br_y);
+
+/*
+	Function: gfx_blend_normal
+		Set the active blending mode to normal (src, 1-src).
+
+	Remarks:
+		This must be used before calling <gfx_quads_begin>.
+		This is equal to glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA).
+	
+	See Also:
+		<gfx_blend_additive>
+*/
+void gfx_blend_normal();
+
+/*
+	Function: gfx_blend_additive
+		Set the active blending mode to additive (src, one).
+
+	Remarks:
+		This must be used before calling <gfx_quads_begin>.
+		This is equal to glBlendFunc(GL_SRC_ALPHA, GL_ONE).
+	
+	See Also:
+		<gfx_blend_normal>
+*/
+void gfx_blend_additive();
+
+/*
+	Function: gfx_setcolorvertex
+		Sets the color of a vertex.
+		
+	Arguments:
+		i - Index to the vertex.
+		r - Red value.
+		g - Green value.
+		b - Blue value.
+		a - Alpha value.
+		
+	Remarks:
+		The color values are from 0.0 to 1.0.
+		The color is reset when <gfx_quads_begin> is called.
+*/
+void gfx_setcolorvertex(int i, float r, float g, float b, float a);
+
+/*
+	Function: gfx_setcolor
+		Sets the color of all the vertices.
+		
+	Arguments:
+		r - Red value.
+		g - Green value.
+		b - Blue value.
+		a - Alpha value.
+		
+	Remarks:
+		The color values are from 0.0 to 1.0.
+		The color is reset when <gfx_quads_begin> is called.
+*/
+void gfx_setcolor(float r, float g, float b, float a);
+
+/*
+	Function: gfx_getscreen
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void gfx_getscreen(float *tl_x, float *tl_y, float *br_x, float *br_y);
+
+/*
+	Function: gfx_memory_usage
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int gfx_memory_usage();
+
+/*
+	Function: gfx_screenshot
+		TODO		
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void gfx_screenshot();
+
+/*
+	Function: gfx_clip_enable
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void gfx_clip_enable(int x, int y, int w, int h);
+
+/*
+	Function: gfx_clip_disable
+		TODO	
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void gfx_clip_disable();
+
+#endif
diff --git a/src/engine/e_if_inp.h b/src/engine/e_if_inp.h
new file mode 100644
index 00000000..b95f1177
--- /dev/null
+++ b/src/engine/e_if_inp.h
@@ -0,0 +1,236 @@
+/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
+#ifndef ENGINE_IF_INP_H
+#define ENGINE_IF_INP_H
+
+/*
+	Section: Input
+*/
+
+
+/*
+	Structure: INPUT_EVENT
+*/
+typedef struct
+{
+	char ch;
+	int key;
+} INPUT_EVENT;
+
+/*
+	Function: inp_mouse_relative
+		Fetches the mouse movements.
+		
+	Arguments:
+		x - Pointer to the variable that should get the X movement.
+		y - Pointer to the variable that should get the Y movement.
+*/
+void inp_mouse_relative(int *x, int *y);
+
+/*
+	Function: inp_mouse_scroll
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int inp_mouse_scroll();
+
+/*
+	Function: inp_key_pressed
+		Checks if a key is pressed.
+		
+	Arguments:
+		key - Index to the key to check
+		
+	Returns:
+		Returns 1 if the button is pressed, otherwise 0.
+	
+	Remarks:
+		Check keys.h for the keys.
+*/
+int inp_key_pressed(int key);
+
+
+/* input */
+/*
+	Function: inp_key_was_pressed
+		TODO	
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int inp_key_was_pressed(int key);
+
+/*
+	Function: inp_key_down
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int inp_key_down(int key);
+
+
+/*
+	Function: inp_num_events
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int inp_num_events();
+
+/*
+	Function: inp_get_event
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+INPUT_EVENT inp_get_event(int index);
+
+/*
+	Function: inp_clear_events
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void inp_clear_events();
+
+/*
+	Function: inp_mouse_doubleclick
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int inp_mouse_doubleclick();
+
+/*
+	Function: inp_key_presses
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int inp_key_presses(int key);
+
+/*
+	Function: inp_key_releases
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int inp_key_releases(int key);
+
+/*
+	Function: inp_key_state
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int inp_key_state(int key);
+
+/*
+	Function: inp_key_name
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+const char *inp_key_name(int k);
+
+/*
+	Function: inp_key_code
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int inp_key_code(const char *key_name);
+
+
+
+/*
+	Function: inp_clear_key_states
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void inp_clear_key_states(); 
+
+void inp_update();
+void inp_init();
+void inp_mouse_mode_absolute();
+void inp_mouse_mode_relative();
+
+#endif
diff --git a/src/engine/e_if_modc.h b/src/engine/e_if_modc.h
new file mode 100644
index 00000000..581b0a67
--- /dev/null
+++ b/src/engine/e_if_modc.h
@@ -0,0 +1,133 @@
+/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
+#ifndef ENGINE_IF_MODC_H
+#define ENGINE_IF_MODC_H
+
+/**********************************************************************************
+	Section: Client Hooks
+*********************************************************************************/
+/*
+	Function: modc_preinit
+		TODO
+*/
+void modc_preinit();
+
+/*
+	Function: modc_init
+		Called when the client starts.
+	
+	Remarks:
+		The game should load resources that are used during the entire
+		time of the game. No map is loaded.
+*/
+void modc_init();
+
+/*
+	Function: modc_newsnapshot
+		Called when the client progressed to a new snapshot.
+	
+	Remarks:
+		The client can check for items in the snapshot and perform one time
+		events like playing sounds, spawning client side effects etc.
+*/
+void modc_newsnapshot();
+
+/*
+	Function: modc_entergame
+		Called when the client has successfully connect to a server and
+		loaded a map.
+	
+	Remarks:
+		The client can check for items in the map and load them.
+*/
+void modc_entergame();
+
+/*
+	Function: modc_shutdown
+		Called when the client closes down.
+*/
+void modc_shutdown();
+
+/*
+	Function: modc_render
+		Called every frame to let the game render it self.
+*/
+void modc_render();
+
+/*
+	Function: modc_statechange
+		Called every time client changes state.
+*/
+void modc_statechange(int new_state, int old_state);
+
+/* undocumented callbacks */
+/*
+	Function: modc_connected
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void modc_connected();
+
+/*
+	Function: modc_message
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void modc_message(int msg);
+
+/*
+	Function: modc_predict
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void modc_predict();
+
+/*
+	Function: modc_snap_input
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int modc_snap_input(int *data);
+
+/*
+	Function: modc_net_version
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+const char *modc_net_version();
+
+#endif
diff --git a/src/engine/e_if_mods.h b/src/engine/e_if_mods.h
new file mode 100644
index 00000000..1e6d9694
--- /dev/null
+++ b/src/engine/e_if_mods.h
@@ -0,0 +1,151 @@
+/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
+#ifndef ENGINE_IF_MOD_H
+#define ENGINE_IF_MOD_H
+
+/**********************************************************************************
+	Section: Server Hooks
+**********************************************************************************/
+
+/*
+	Function: mods_init
+		Called when the server is started.
+	
+	Remarks:
+		It's called after the map is loaded so all map items are available.
+*/
+void mods_init();
+
+/*
+	Function: mods_shutdown
+		Called when the server quits.
+	
+	Remarks:
+		Should be used to clean up all resources used.
+*/
+void mods_shutdown();
+
+/*
+	Function: mods_client_enter
+		Called when a client has joined the game.
+		
+	Arguments:
+		cid - Client ID. Is 0 - MAX_CLIENTS.
+	
+	Remarks:
+		It's called when the client is finished loading and should enter gameplay.
+*/
+void mods_client_enter(int cid);
+
+/*
+	Function: mods_client_drop
+		Called when a client drops from the server.
+
+	Arguments:
+		cid - Client ID. Is 0 - MAX_CLIENTS
+*/
+void mods_client_drop(int cid);
+
+/*
+	Function: mods_client_input
+		Called when the server recives new input from a client.
+
+	Arguments:
+		cid - Client ID. Is 0 - MAX_CLIENTS.
+		input - Pointer to the input data.
+		size - Size of the data. (NOT IMPLEMENTED YET)
+*/
+void mods_client_input(int cid, void *input);
+
+/*
+	Function: mods_tick
+		Called with a regular interval to progress the gameplay.
+		
+	Remarks:
+		The SERVER_TICK_SPEED tells the number of ticks per second.
+*/
+void mods_tick();
+
+/*
+	Function: mods_presnap
+		Called before the server starts to construct snapshots for the clients.
+*/
+void mods_presnap();
+
+/*
+	Function: mods_snap
+		Called to create the snapshot for a client.
+	
+	Arguments:
+		cid - Client ID. Is 0 - MAX_CLIENTS.
+	
+	Remarks:
+		The game should make a series of calls to <snap_new_item> to construct
+		the snapshot for the client.
+*/
+void mods_snap(int cid);
+
+/*
+	Function: mods_postsnap
+		Called after the server is done sending the snapshots.
+*/
+void mods_postsnap();
+
+
+/*
+	Function: mods_connected
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void mods_connected(int client_id);
+
+
+/*
+	Function: mods_net_version
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+const char *mods_net_version();
+
+/*
+	Function: mods_version
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+const char *mods_version();
+
+/*
+	Function: mods_message
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void mods_message(int msg, int client_id);
+
+#endif
diff --git a/src/engine/e_if_msg.h b/src/engine/e_if_msg.h
new file mode 100644
index 00000000..7355f8ce
--- /dev/null
+++ b/src/engine/e_if_msg.h
@@ -0,0 +1,136 @@
+/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
+#ifndef ENGINE_IF_MSG_H
+#define ENGINE_IF_MSG_H
+
+/*
+	Section: Messaging
+*/
+
+void msg_pack_start_system(int msg, int flags);
+
+/*
+	Function: msg_pack_start
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void msg_pack_start(int msg, int flags);
+
+/*
+	Function: msg_pack_int
+		TODO	
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void msg_pack_int(int i);
+
+/*
+	Function: msg_pack_string
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void msg_pack_string(const char *p, int limit);
+
+/*
+	Function: msg_pack_raw
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void msg_pack_raw(const void *data, int size);
+
+/*
+	Function: msg_pack_end
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void msg_pack_end();
+
+typedef struct
+{
+	int msg;
+	int flags;
+	const unsigned char *data;
+	int size;
+} MSG_INFO;
+
+const MSG_INFO *msg_get_info();
+
+/* message unpacking */
+int msg_unpack_start(const void *data, int data_size, int *system);
+
+/*
+	Function: msg_unpack_int
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int msg_unpack_int();
+
+/*
+	Function: msg_unpack_string
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+const char *msg_unpack_string();
+
+/*
+	Function: msg_unpack_raw
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+const unsigned char *msg_unpack_raw(int size);
+
+#endif
diff --git a/src/engine/e_if_other.h b/src/engine/e_if_other.h
new file mode 100644
index 00000000..931df64d
--- /dev/null
+++ b/src/engine/e_if_other.h
@@ -0,0 +1,349 @@
+/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
+#ifndef ENGINE_IF_OTHER_H
+#define ENGINE_IF_OTHER_H
+
+/*
+	Title: Engine Interface
+*/
+
+#include "e_keys.h"
+#include "e_system.h"
+
+enum 
+{
+	SERVER_TICK_SPEED=50,
+	MAX_CLIENTS=12,
+	
+	SNAP_CURRENT=0,
+	SNAP_PREV=1,
+	
+
+	MASK_NONE=0,
+	MASK_SET,
+	MASK_ZERO,
+
+	SNDFLAG_LOOP=1,
+	SNDFLAG_POS=2,
+	SNDFLAG_ALL=3
+};
+
+/*
+	Structure: SNAP_ITEM
+*/
+typedef struct
+{
+	int type;
+	int id;
+} SNAP_ITEM;
+
+/*
+	Structure: CLIENT_INFO
+*/
+typedef struct
+{
+	const char *name;
+	int latency;
+} CLIENT_INFO;
+
+typedef struct PERFORMACE_INFO_t
+{
+	const char *name;
+	struct PERFORMACE_INFO_t *parent;
+	struct PERFORMACE_INFO_t *first_child;
+	struct PERFORMACE_INFO_t *next_child;
+	int tick;
+	int64 start;
+	int64 total;
+	int64 biggest;
+	int64 last_delta;
+} PERFORMACE_INFO;
+
+void perf_init();
+void perf_next();
+void perf_start(PERFORMACE_INFO *info);
+void perf_end();
+void perf_dump();
+
+int gfx_init();
+void gfx_shutdown();
+void gfx_swap();
+int gfx_window_active();
+int gfx_window_open();
+
+void gfx_set_vsync(int val);
+void gfx_mask_op(int mask, int write);
+void gfx_clear_mask(int fill);
+
+int snd_init();
+int snd_shutdown();
+int snd_update();
+
+int map_load(const char *mapname);
+void map_unload();
+
+void map_set(void *m);
+
+/*
+#include "e_if_client.h"
+#include "e_if_server.h"
+#include "e_if_snd.h"
+#include "e_if_gfx.h"
+#include "e_if_inp.h"
+#include "e_if_msg.h"
+#include "e_if_mod.h"*/
+
+/*
+	Section: Map
+*/
+
+/*
+	Function: map_is_loaded
+		Checks if a map is loaded.
+		
+	Returns:
+		Returns 1 if the button is pressed, otherwise 0.
+*/
+int map_is_loaded();
+
+/*
+	Function: map_num_items
+		Checks the number of items in the loaded map.
+		
+	Returns:
+		Returns the number of items. 0 if no map is loaded.
+*/
+int map_num_items();
+
+/*
+	Function: map_find_item
+		Searches the map for an item.
+	
+	Arguments:
+		type - Item type.
+		id - Item ID.
+	
+	Returns:
+		Returns a pointer to the item if it exists, otherwise it returns NULL.
+*/
+void *map_find_item(int type, int id);
+
+/*
+	Function: map_get_item
+		Gets an item from the loaded map from index.
+	
+	Arguments:
+		index - Item index.
+		type - Pointer that recives the item type (can be NULL).
+		id - Pointer that recives the item id (can be NULL).
+	
+	Returns:
+		Returns a pointer to the item if it exists, otherwise it returns NULL.
+*/
+void *map_get_item(int index, int *type, int *id);
+
+/*
+	Function: map_get_type
+		Gets the index range of an item type.
+	
+	Arguments:
+		type - Item type to search for.
+		start - Pointer that recives the starting index.
+		num - Pointer that recives the number of items.
+	
+	Returns:
+		If the item type is not in the map, start and num will be set to 0.
+*/
+void map_get_type(int type, int *start, int *num);
+
+/*
+	Function: map_get_data
+		Fetches a pointer to a raw data chunk in the map.
+	
+	Arguments:
+		index - Index to the data to fetch.
+	
+	Returns:
+		A pointer to the raw data, otherwise 0.
+*/
+void *map_get_data(int index);
+
+/*
+	Function: map_get_data_swapped
+		TODO
+		
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void *map_get_data_swapped(int index);
+
+/*
+	Section: Network (Server)
+*/
+/*
+	Function: snap_new_item
+		Creates a new item that should be sent.
+	
+	Arguments:
+		type - Type of the item.
+		id - ID of the item.
+		size - Size of the item.
+	
+	Returns:
+		A pointer to the item data, otherwise 0.
+	
+	Remarks:
+		The item data should only consist pf 4 byte integers as
+		they are subject to byte swapping. This means that the size
+		argument should be dividable by 4.
+*/
+void *snap_new_item(int type, int id, int size);
+
+/*
+	Section:Section: Network (Client)
+*/
+/*
+	Function: snap_num_items
+		Check the number of items in a snapshot.
+	
+	Arguments:
+		snapid - Snapshot ID to the data to fetch.
+			* SNAP_PREV for previous snapshot.
+			* SNAP_CUR for current snapshot.
+	
+	Returns:
+		The number of items in the snapshot.
+*/
+int snap_num_items(int snapid);
+
+/*
+	Function: snap_get_item
+		Gets an item from a snapshot.
+	
+	Arguments:
+		snapid - Snapshot ID to the data to fetch.
+			* SNAP_PREV for previous snapshot.
+			* SNAP_CUR for current snapshot.
+		index - Index of the item.
+		item - Pointer that recives the item info.
+	
+	Returns:
+		Returns a pointer to the item if it exists, otherwise NULL.
+*/
+const void *snap_get_item(int snapid, int index, SNAP_ITEM *item);
+
+/*
+	Function: snap_find_item
+		Searches a snapshot for an item.
+	
+	Arguments:
+		snapid - Snapshot ID to the data to fetch.
+			* SNAP_PREV for previous snapshot.
+			* SNAP_CUR for current snapshot.
+		type - Type of the item.
+		id - ID of the item.
+	
+	Returns:
+		Returns a pointer to the item if it exists, otherwise NULL.
+*/
+const void *snap_find_item(int snapid, int type, int id);
+
+/*
+	Function: snap_input
+		Sets the input data to send to the server.
+	
+	Arguments:
+		data - Pointer to the data.
+		size - Size of the data.
+
+	Remarks:
+		The data should only consist of 4 bytes integer as they are
+		subject to byte swapping.
+*/
+void snap_input(void *data, int size);
+
+/* message packing */
+enum
+{
+	MSGFLAG_VITAL=1
+};
+
+/* message sending */
+/*
+	Function: server_send_msg
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int server_send_msg(int client_id); /* client_id == -1 == broadcast */
+
+/*
+	Function: client_send_msg
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int client_send_msg();
+/* undocumented graphics stuff */
+
+/* server snap id */
+/*
+	Function: snap_new_id
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int snap_new_id();
+
+/*
+	Function: snap_free_id
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void snap_free_id(int id);
+
+/* other */
+/*
+	Function: map_unload_data
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void map_unload_data(int index);
+
+#endif
diff --git a/src/engine/e_if_server.h b/src/engine/e_if_server.h
new file mode 100644
index 00000000..c9572b76
--- /dev/null
+++ b/src/engine/e_if_server.h
@@ -0,0 +1,137 @@
+/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
+#ifndef ENGINE_IF_SERVER_H
+#define ENGINE_IF_SERVER_H
+
+/*
+	Section: Server Hooks
+*/
+
+/* server */
+/*
+	Function: server_getclientinfo
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int server_getclientinfo(int client_id, CLIENT_INFO *info);
+
+/*
+	Function: server_clientname
+		TODO	
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+const char *server_clientname(int client_id);
+
+/* grabs the latest input for the client. not withholding anything */
+/*
+	Function: server_latestinput
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int *server_latestinput(int client_id, int *size);
+
+/*
+	Function: server_setclientname
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void server_setclientname(int client_id, const char *name);
+
+/*
+	Function: server_setclientscore
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void server_setclientscore(int client_id, int score);
+
+/*
+	Function: server_setbrowseinfo
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void server_setbrowseinfo(int game_type, int progression);
+
+/*
+	Function: server_kick
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+void server_kick(int client_id, const char *reason);
+
+/*
+	Function: server_tick
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int server_tick();
+
+/*
+	Function: server_tickspeed
+		TODO
+	
+	Arguments:
+		arg1 - desc
+	
+	Returns:
+
+	See Also:
+		<other_func>
+*/
+int server_tickspeed();
+
+#endif
diff --git a/src/engine/e_if_snd.h b/src/engine/e_if_snd.h
new file mode 100644
index 00000000..48376bad
--- /dev/null
+++ b/src/engine/e_if_snd.h
@@ -0,0 +1,91 @@
+/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
+#ifndef ENGINE_IF_SND_H
+#define ENGINE_IF_SND_H
+
+/*
+	Section: Sound
+*/
+
+/*
+	Function: snd_set_channel
+		Sets the parameters for a sound channel.
+	
+	Arguments:
+		cid - Channel ID
+		vol - Volume for the channel. 0.0 to 1.0.
+		pan - Panning for the channel. -1.0 is all left. 0.0 is equal distribution. 1.0 is all right.
+*/
+void snd_set_channel(int cid, float vol, float pan);
+
+/*
+	Function: snd_load_wv
+		Loads a wavpack compressed sound.
+	
+	Arguments:
+		filename - Filename of the file to load
+	
+	Returns:
+		The id of the loaded sound. -1 on failure.
+*/
+int snd_load_wv(const char *filename);
+
+/*
+	Function: snd_play_at
+		Plays a sound at a specified postition.
+	
+	Arguments:
+		cid - Channel id of the channel to use.
+		sid - Sound id of the sound to play.
+		flags - TODO
+		x - TODO
+		y - TODO
+	
+	Returns:
+		An id to the voice. -1 on failure.
+
+	See Also:
+		<snd_play, snd_stop>
+*/
+int snd_play_at(int cid, int sid, int flags, float x, float y);
+
+/*
+	Function: snd_play
+		Plays a sound.
+	
+	Arguments:
+	Arguments:
+		cid - Channel id of the channel to use.
+		sid - Sound id of the sound to play.
+		flags - TODO
+	
+	Returns:
+		An id to the voice. -1 on failure.
+
+	See Also:
+		<snd_play_at, snd_stop>
+*/
+int snd_play(int cid, int sid, int flags);
+
+/*
+	Function: snd_stop
+		Stops a currenly playing sound.
+	
+	Arguments:
+		id - The ID of the voice to stop.
+	
+	See Also:
+		<snd_play, snd_play_at>
+*/
+void snd_stop(int id);
+
+/*
+	Function: snd_set_listener_pos
+		Sets the listener posititon.
+	
+	Arguments:
+		x - TODO
+		y - TODO
+*/
+void snd_set_listener_pos(float x, float y);
+
+#endif
diff --git a/src/engine/e_interface.h b/src/engine/e_interface.h
deleted file mode 100644
index 73d2e01e..00000000
--- a/src/engine/e_interface.h
+++ /dev/null
@@ -1,2000 +0,0 @@
-/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
-#ifndef ENGINE_INTERFACE_H
-#define ENGINE_INTERFACE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-	Title: Engine Interface
-*/
-
-#include "e_keys.h"
-#include "e_system.h"
-
-enum 
-{
-	MAX_CLIENTS=12,
-	SERVER_TICK_SPEED=50, /* TODO: this should be removed */
-	SNAP_CURRENT=0,
-	SNAP_PREV=1,
-	
-	IMG_AUTO=-1,
-	IMG_RGB=0,
-	IMG_RGBA=1,
-	IMG_ALPHA=2,
-	
-	MASK_NONE=0,
-	MASK_SET,
-	MASK_ZERO,
-
-	SNDFLAG_LOOP=1,
-	SNDFLAG_POS=2,
-	SNDFLAG_ALL=3,
-	
-	CLIENTSTATE_OFFLINE=0,
-	CLIENTSTATE_CONNECTING,
-	CLIENTSTATE_LOADING,
-	CLIENTSTATE_ONLINE,
-	CLIENTSTATE_QUITING,
-	
-	BROWSESORT_NAME = 0,
-	BROWSESORT_PING,
-	BROWSESORT_MAP,
-	BROWSESORT_GAMETYPE,
-	BROWSESORT_PROGRESSION,
-	BROWSESORT_NUMPLAYERS
-};
-
-typedef struct
-{
-	int type;
-	int id;
-} SNAP_ITEM;
-
-typedef struct
-{
-	const char *name;
-	int latency;
-} CLIENT_INFO;
-
-typedef struct
-{
-	int width, height;
-	int format;
-	void *data;
-} IMAGE_INFO;
-
-typedef struct 
-{
-	int width, height;
-	int red, green, blue;
-} VIDEO_MODE;
-
-typedef struct
-{
-	int sorted_index;
-	int server_index;
-	
-	int progression;
-	int game_type;
-	int max_players;
-	int num_players;
-	int flags;
-	int latency; /* in ms */
-	char name[64];
-	char map[32];
-	char version[32];
-	char address[24];
-	char player_names[16][48];
-	int player_scores[16];
-} SERVER_INFO;
-
-typedef struct PERFORMACE_INFO_t
-{
-	const char *name;
-	struct PERFORMACE_INFO_t *parent;
-	struct PERFORMACE_INFO_t *first_child;
-	struct PERFORMACE_INFO_t *next_child;
-	int tick;
-	int64 start;
-	int64 total;
-	int64 biggest;
-	int64 last_delta;
-} PERFORMACE_INFO;
-
-void perf_init();
-void perf_next();
-void perf_start(PERFORMACE_INFO *info);
-void perf_end();
-void perf_dump();
-
-int gfx_init();
-void gfx_shutdown();
-void gfx_swap();
-int gfx_window_active();
-int gfx_window_open();
-
-void gfx_set_vsync(int val);
-void gfx_mask_op(int mask, int write);
-void gfx_clear_mask(int fill);
-
-int snd_init();
-int snd_shutdown();
-int snd_update();
-
-int map_load(const char *mapname);
-void map_unload();
-
-void map_set(void *m);
-
-
-/*
-	Group: Graphics
-*/
-
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-float gfx_screenaspect();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int gfx_get_video_modes(VIDEO_MODE *list, int maxcount);
-
-/* image loaders */
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int gfx_load_png(IMAGE_INFO *img, const char *filename);
-
-/* textures */
-/*
-	Function: gfx_load_texture
-		Loads a texture from a file. TGA and PNG supported.
-	
-	Arguments:
-		filename - Null terminated string to the file to load.
-		store_format - What format to store on gfx card as.
-	
-	Returns:
-		An ID to the texture. -1 on failure.
-
-	See Also:
-		<gfx_unload_texture>
-*/
-int gfx_load_texture(const char *filename, int store_format);
-
-/*
-	Function: gfx_load_texture_raw
-		Loads a texture from memory.
-	
-	Arguments:
-		w - Width of the texture.
-		h - Height of the texture.
-		data - Pointer to the pixel data.
-		format - Format of the pixel data.
-		store_format - The format to store the texture on the graphics card.
-	
-	Returns:
-		An ID to the texture. -1 on failure.
-		
-	Remarks:
-		The pixel data should be in RGBA format with 8 bit per component.
-		So the total size of the data should be w*h*4.
-		
-	See Also:
-		<gfx_unload_texture>
-*/
-int gfx_load_texture_raw(int w, int h, int format, const void *data, int store_format);
-
-/*
-	Function: gfx_texture_set
-		Sets the active texture.
-	
-	Arguments:
-		id - ID to the texture to set.
-*/
-void gfx_texture_set(int id);
-
-/*
-	Function: gfx_unload_texture
-		Unloads a texture.
-	
-	Arguments:
-		id - ID to the texture to unload.
-		
-	See Also:
-		<gfx_load_texture_tga>, <gfx_load_texture_raw>
-		
-	Remarks:
-		NOT IMPLEMENTED
-*/
-int gfx_unload_texture(int id);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void gfx_clear(float r, float g, float b);
-
-/*
-	Function: gfx_screenwidth
-		Returns the screen width.
-	
-	See Also:
-		<gfx_screenheight>
-*/
-int gfx_screenwidth();
-
-/*
-	Function: gfx_screenheight
-		Returns the screen height.
-	
-	See Also:
-		<gfx_screenwidth>
-*/
-int gfx_screenheight();
-
-/*
-	Function: gfx_mapscreen
-		Specifies the coordinate system for the screen.
-		
-	Arguments:
-		tl_x - Top-left X
-		tl_y - Top-left Y
-		br_x - Bottom-right X
-		br_y - Bottom-right y
-*/
-void gfx_mapscreen(float tl_x, float tl_y, float br_x, float br_y);
-
-/*
-	Function: gfx_blend_normal
-		Set the active blending mode to normal (src, 1-src).
-
-	Remarks:
-		This must be used before calling <gfx_quads_begin>.
-		This is equal to glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA).
-	
-	See Also:
-		<gfx_blend_additive>
-*/
-void gfx_blend_normal();
-
-/*
-	Function: gfx_blend_additive
-		Set the active blending mode to additive (src, one).
-
-	Remarks:
-		This must be used before calling <gfx_quads_begin>.
-		This is equal to glBlendFunc(GL_SRC_ALPHA, GL_ONE).
-	
-	See Also:
-		<gfx_blend_normal>
-*/
-void gfx_blend_additive();
-
-/*
-	Function: gfx_quads_begin
-		Begins a quad drawing session.
-		
-	Remarks:
-		This functions resets the rotation, color and subset.
-		End the session by using <gfx_quads_end>.
-		You can't change texture or blending mode during a session.
-		
-	See Also:
-		<gfx_quads_end>
-*/
-void gfx_quads_begin();
-
-/*
-	Function: gfx_quads_end
-		Ends a quad session.
-		
-	See Also:
-		<gfx_quads_begin>
-*/
-void gfx_quads_end();
-
-/*
-	Function: gfx_quads_setrotation
-		Sets the rotation to use when drawing a quad.
-		
-	Arguments:
-		angle - Angle in radians.
-		
-	Remarks:
-		The angle is reset when <gfx_quads_begin> is called.
-*/
-void gfx_quads_setrotation(float angle);
-
-/*
-	Function: gfx_quads_setcolorvertex
-		Sets the color of a vertex.
-		
-	Arguments:
-		i - Index to the vertex.
-		r - Red value.
-		g - Green value.
-		b - Blue value.
-		a - Alpha value.
-		
-	Remarks:
-		The color values are from 0.0 to 1.0.
-		The color is reset when <gfx_quads_begin> is called.
-*/
-void gfx_setcolorvertex(int i, float r, float g, float b, float a);
-
-/*
-	Function: gfx_quads_setcolor
-		Sets the color of all the vertices.
-		
-	Arguments:
-		r - Red value.
-		g - Green value.
-		b - Blue value.
-		a - Alpha value.
-		
-	Remarks:
-		The color values are from 0.0 to 1.0.
-		The color is reset when <gfx_quads_begin> is called.
-*/
-void gfx_setcolor(float r, float g, float b, float a);
-
-/*
-	Function: gfx_quads_setsubset
-		Sets the uv coordinates to use.
-		
-	Arguments:
-		tl_u - Top-left U value.
-		tl_v - Top-left V value.
-		br_u - Bottom-right U value.
-		br_v - Bottom-right V value.
-		
-	Remarks:
-		O,0 is top-left of the texture and 1,1 is bottom-right.
-		The color is reset when <gfx_quads_begin> is called.
-*/
-void gfx_quads_setsubset(float tl_u, float tl_v, float br_u, float br_v);
-
-/*
-	Function: gfx_quads_drawTL
-		Draws a quad by specifying the top-left point.
-		
-	Arguments:
-		x - X coordinate of the top-left corner.
-		y - Y coordinate of the top-left corner.
-		width - Width of the quad.
-		height - Height of the quad.
-		
-	Remarks:
-		Rotation still occurs from the center of the quad.
-		You must call <gfx_quads_begin> before calling this function.
-
-	See Also:
-		<gfx_quads_draw>
-*/
-void gfx_quads_drawTL(float x, float y, float width, float height);
-
-/*
-	Function: gfx_quads_draw
-		Draws a quad by specifying the center point.
-		
-	Arguments:
-		x - X coordinate of the center.
-		y - Y coordinate of the center.
-		width - Width of the quad.
-		height - Height of the quad.
-
-	Remarks:
-		You must call <gfx_quads_begin> before calling this function.
-
-	See Also:
-		<gfx_quads_drawTL>
-*/
-void gfx_quads_draw(float x, float y, float w, float h);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void gfx_quads_draw_freeform(
-	float x0, float y0,
-	float x1, float y1,
-	float x2, float y2,
-	float x3, float y3);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void gfx_quads_text(float x, float y, float size, const char *text);
-
-/* sound (client) */
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void snd_set_channel(int cid, float vol, float pan);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int snd_load_wv(const char *filename);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int snd_play_at(int cid, int sid, int flags, float x, float y);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int snd_play(int cid, int sid, int flags);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void snd_stop(int id);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void snd_set_listener_pos(float x, float y);
-
-/*
-	Group: Input
-*/
-
-/*
-	Function: inp_mouse_relative
-		Fetches the mouse movements.
-		
-	Arguments:
-		x - Pointer to the variable that should get the X movement.
-		y - Pointer to the variable that should get the Y movement.
-*/
-void inp_mouse_relative(int *x, int *y);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int inp_mouse_scroll();
-
-/*
-	Function: inp_key_pressed
-		Checks if a key is pressed.
-		
-	Arguments:
-		key - Index to the key to check
-		
-	Returns:
-		Returns 1 if the button is pressed, otherwise 0.
-	
-	Remarks:
-		Check keys.h for the keys.
-*/
-int inp_key_pressed(int key);
-
-/*
-	Group: Map
-*/
-
-/*
-	Function: map_is_loaded
-		Checks if a map is loaded.
-		
-	Returns:
-		Returns 1 if the button is pressed, otherwise 0.
-*/
-int map_is_loaded();
-
-/*
-	Function: map_num_items
-		Checks the number of items in the loaded map.
-		
-	Returns:
-		Returns the number of items. 0 if no map is loaded.
-*/
-int map_num_items();
-
-/*
-	Function: map_find_item
-		Searches the map for an item.
-	
-	Arguments:
-		type - Item type.
-		id - Item ID.
-	
-	Returns:
-		Returns a pointer to the item if it exists, otherwise it returns NULL.
-*/
-void *map_find_item(int type, int id);
-
-/*
-	Function: map_get_item
-		Gets an item from the loaded map from index.
-	
-	Arguments:
-		index - Item index.
-		type - Pointer that recives the item type (can be NULL).
-		id - Pointer that recives the item id (can be NULL).
-	
-	Returns:
-		Returns a pointer to the item if it exists, otherwise it returns NULL.
-*/
-void *map_get_item(int index, int *type, int *id);
-
-/*
-	Function: map_get_type
-		Gets the index range of an item type.
-	
-	Arguments:
-		type - Item type to search for.
-		start - Pointer that recives the starting index.
-		num - Pointer that recives the number of items.
-	
-	Returns:
-		If the item type is not in the map, start and num will be set to 0.
-*/
-void map_get_type(int type, int *start, int *num);
-
-/*
-	Function: map_get_data
-		Fetches a pointer to a raw data chunk in the map.
-	
-	Arguments:
-		index - Index to the data to fetch.
-	
-	Returns:
-		A pointer to the raw data, otherwise 0.
-*/
-void *map_get_data(int index);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void *map_get_data_swapped(int index);
-
-/*
-	Group: Network (Server)
-*/
-/*
-	Function: snap_new_item
-		Creates a new item that should be sent.
-	
-	Arguments:
-		type - Type of the item.
-		id - ID of the item.
-		size - Size of the item.
-	
-	Returns:
-		A pointer to the item data, otherwise 0.
-	
-	Remarks:
-		The item data should only consist pf 4 byte integers as
-		they are subject to byte swapping. This means that the size
-		argument should be dividable by 4.
-*/
-void *snap_new_item(int type, int id, int size);
-
-/*
-	Group: Network (Client)
-*/
-/*
-	Function: snap_num_items
-		Check the number of items in a snapshot.
-	
-	Arguments:
-		snapid - Snapshot ID to the data to fetch.
-			* SNAP_PREV for previous snapshot.
-			* SNAP_CUR for current snapshot.
-	
-	Returns:
-		The number of items in the snapshot.
-*/
-int snap_num_items(int snapid);
-
-/*
-	Function: snap_get_item
-		Gets an item from a snapshot.
-	
-	Arguments:
-		snapid - Snapshot ID to the data to fetch.
-			* SNAP_PREV for previous snapshot.
-			* SNAP_CUR for current snapshot.
-		index - Index of the item.
-		item - Pointer that recives the item info.
-	
-	Returns:
-		Returns a pointer to the item if it exists, otherwise NULL.
-*/
-const void *snap_get_item(int snapid, int index, SNAP_ITEM *item);
-
-/*
-	Function: snap_find_item
-		Searches a snapshot for an item.
-	
-	Arguments:
-		snapid - Snapshot ID to the data to fetch.
-			* SNAP_PREV for previous snapshot.
-			* SNAP_CUR for current snapshot.
-		type - Type of the item.
-		id - ID of the item.
-	
-	Returns:
-		Returns a pointer to the item if it exists, otherwise NULL.
-*/
-const void *snap_find_item(int snapid, int type, int id);
-
-/*
-	Function: snap_input
-		Sets the input data to send to the server.
-	
-	Arguments:
-		data - Pointer to the data.
-		size - Size of the data.
-
-	Remarks:
-		The data should only consist of 4 bytes integer as they are
-		subject to byte swapping.
-*/
-void snap_input(void *data, int size);
-
-/*
-	Group: Server Callbacks
-*/
-/*
-	Function: mods_init
-		Called when the server is started.
-	
-	Remarks:
-		It's called after the map is loaded so all map items are available.
-*/
-void mods_init();
-
-/*
-	Function: mods_shutdown
-		Called when the server quits.
-	
-	Remarks:
-		Should be used to clean up all resources used.
-*/
-void mods_shutdown();
-
-/*
-	Function: mods_client_enter
-		Called when a client has joined the game.
-		
-	Arguments:
-		cid - Client ID. Is 0 - MAX_CLIENTS.
-	
-	Remarks:
-		It's called when the client is finished loading and should enter gameplay.
-*/
-void mods_client_enter(int cid);
-
-/*
-	Function: mods_client_drop
-		Called when a client drops from the server.
-
-	Arguments:
-		cid - Client ID. Is 0 - MAX_CLIENTS
-*/
-void mods_client_drop(int cid);
-
-/*
-	Function: mods_client_input
-		Called when the server recives new input from a client.
-
-	Arguments:
-		cid - Client ID. Is 0 - MAX_CLIENTS.
-		input - Pointer to the input data.
-		size - Size of the data. (NOT IMPLEMENTED YET)
-*/
-void mods_client_input(int cid, void *input);
-
-/*
-	Function: mods_tick
-		Called with a regular interval to progress the gameplay.
-		
-	Remarks:
-		The SERVER_TICK_SPEED tells the number of ticks per second.
-*/
-void mods_tick();
-
-/*
-	Function: mods_presnap
-		Called before the server starts to construct snapshots for the clients.
-*/
-void mods_presnap();
-
-/*
-	Function: mods_snap
-		Called to create the snapshot for a client.
-	
-	Arguments:
-		cid - Client ID. Is 0 - MAX_CLIENTS.
-	
-	Remarks:
-		The game should make a series of calls to <snap_new_item> to construct
-		the snapshot for the client.
-*/
-void mods_snap(int cid);
-
-/*
-	Function: mods_postsnap
-		Called after the server is done sending the snapshots.
-*/
-void mods_postsnap();
-
-/*
-	Group: Client Callbacks
-*/
-
-/*
-	Function: modc_preinit
-		Called when the client starts, but before the engine is initialized.
-	
-	Remarks:
-*/
-void modc_preinit();
-
-/*
-	Function: modc_init
-		Called when the client starts.
-	
-	Remarks:
-		The game should load resources that are used during the entire
-		time of the game. No map is loaded.
-*/
-void modc_init();
-
-/*
-	Function: modc_newsnapshot
-		Called when the client progressed to a new snapshot.
-	
-	Remarks:
-		The client can check for items in the snapshot and perform one time
-		events like playing sounds, spawning client side effects etc.
-*/
-void modc_newsnapshot();
-
-/*
-	Function: modc_entergame
-		Called when the client has successfully connect to a server and
-		loaded a map.
-	
-	Remarks:
-		The client can check for items in the map and load them.
-*/
-void modc_entergame();
-
-/*
-	Function: modc_shutdown
-		Called when the client closes down.
-*/
-void modc_shutdown();
-
-/*
-	Function: modc_render
-		Called every frame to let the game render it self.
-*/
-void modc_render();
-
-/*
-	Function: modc_statechange
-		Called every time client changes state.
-*/
-void modc_statechange(int new_state, int old_state);
-
-/* undocumented callbacks */
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void modc_connected();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void modc_message(int msg);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void modc_predict();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int modc_snap_input(int *data);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void mods_message(int msg, int client_id);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void mods_connected(int client_id);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-const char *modc_net_version();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-const char *mods_net_version();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-const char *mods_version();
-
-/* server */
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int server_getclientinfo(int client_id, CLIENT_INFO *info);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-const char *server_clientname(int client_id);
-
-/* grabs the latest input for the client. not withholding anything */
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int *server_latestinput(int client_id, int *size);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void server_setclientname(int client_id, const char *name);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void server_setclientscore(int client_id, int score);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void server_setbrowseinfo(int game_type, int progression);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void server_kick(int client_id, const char *reason);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int server_tick();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int server_tickspeed();
-
-/* input */
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int inp_key_was_pressed(int key);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int inp_key_down(int key);
-
-
-
-typedef struct
-{
-	char ch;
-	int key;
-} INPUTEVENT;
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int inp_num_events();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-INPUTEVENT inp_get_event(int index);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void inp_clear_events();
-
-void inp_update();
-void inp_init();
-void inp_mouse_mode_absolute();
-void inp_mouse_mode_relative();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int inp_mouse_doubleclick();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void inp_clear_key_states();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int inp_key_presses(int key);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int inp_key_releases(int key);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int inp_key_state(int key);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-const char *inp_key_name(int k);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int inp_key_code(const char *key_name);
-
-/* message packing */
-enum
-{
-	MSGFLAG_VITAL=1
-};
-
-void msg_pack_start_system(int msg, int flags);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void msg_pack_start(int msg, int flags);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void msg_pack_int(int i);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void msg_pack_string(const char *p, int limit);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void msg_pack_raw(const void *data, int size);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void msg_pack_end();
-
-typedef struct
-{
-	int msg;
-	int flags;
-	const unsigned char *data;
-	int size;
-} MSG_INFO;
-
-const MSG_INFO *msg_get_info();
-
-/* message unpacking */
-int msg_unpack_start(const void *data, int data_size, int *system);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int msg_unpack_int();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-const char *msg_unpack_string();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-const unsigned char *msg_unpack_raw(int size);
-
-/* message sending */
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int server_send_msg(int client_id); /* client_id == -1 == broadcast */
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int client_send_msg();
-
-/* client */
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int client_tick();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int client_predtick();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-float client_intratick(); 
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-float client_ticktime();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-float client_intrapredtick();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int client_tickspeed();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-float client_frametime();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-float client_localtime();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void client_direct_input(int *input, int size);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int client_state();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-const char *client_error_string();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int *client_get_input(int tick);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int client_connection_problems();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void client_connect(const char *address);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void client_disconnect();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void client_quit();
-
-void client_entergame();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void client_rcon(const char *cmd);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void client_serverbrowse_refresh(int lan);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-SERVER_INFO *client_serverbrowse_sorted_get(int index);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int client_serverbrowse_sorted_num();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-SERVER_INFO *client_serverbrowse_get(int index);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int client_serverbrowse_num();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int client_serverbrowse_num_requests();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void client_serverbrowse_update();
-
-/* undocumented graphics stuff */
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void gfx_text(void *font, float x, float y, float size, const char *text, int max_width);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-float gfx_text_width(void *font, float size, const char *text, int length);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void gfx_text_color(float r, float g, float b, float a);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void gfx_text_set_default_font(void *font);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void gfx_getscreen(float *tl_x, float *tl_y, float *br_x, float *br_y);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int gfx_memory_usage();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void gfx_screenshot();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void gfx_lines_begin();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void gfx_lines_draw(float x0, float y0, float x1, float y1);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void gfx_lines_end();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void gfx_clip_enable(int x, int y, int w, int h);
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void gfx_clip_disable();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void gfx_quads_setsubset_free(
-	float x0, float y0,
-	float x1, float y1,
-	float x2, float y2,
-	float x3, float y3);
-
-/* server snap id */
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-int snap_new_id();
-
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void snap_free_id(int id);
-
-/* other */
-/*
-	Function: TODO
-	
-	Arguments:
-		arg1 - desc
-	
-	Returns:
-
-	See Also:
-		<other_func>
-*/
-void map_unload_data(int index);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/engine/e_msg.c b/src/engine/e_msg.c
index adfb1cd3..0bdaf856 100644
--- a/src/engine/e_msg.c
+++ b/src/engine/e_msg.c
@@ -1,5 +1,5 @@
 /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
-#include "e_interface.h"
+#include "e_common_interface.h"
 #include "e_packer.h"
 
 /* message packing */
diff --git a/src/engine/e_server_interface.h b/src/engine/e_server_interface.h
new file mode 100644
index 00000000..f1749fcd
--- /dev/null
+++ b/src/engine/e_server_interface.h
@@ -0,0 +1,18 @@
+/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
+#ifndef ENGINE_SERVER_INTERFACE_H
+#define ENGINE_SERVER_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "e_if_other.h"
+#include "e_if_server.h"
+#include "e_if_msg.h"
+#include "e_if_mods.h"
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/engine/e_snapshot.c b/src/engine/e_snapshot.c
index 2957f1db..6c908518 100644
--- a/src/engine/e_snapshot.c
+++ b/src/engine/e_snapshot.c
@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include "e_snapshot.h"
 #include "e_compression.h"
-#include "e_interface.h"
+#include "e_common_interface.h"
 
 
 int *snapitem_data(SNAPSHOT_ITEM *item) { return (int *)(item+1); }
diff --git a/src/engine/server/es_server.c b/src/engine/server/es_server.c
index fda4b5d5..5c1c67fb 100644
--- a/src/engine/server/es_server.c
+++ b/src/engine/server/es_server.c
@@ -6,7 +6,7 @@
 #include <engine/e_system.h>
 #include <engine/e_config.h>
 #include <engine/e_engine.h>
-#include <engine/e_interface.h>
+#include <engine/e_server_interface.h>
 
 #include <engine/e_protocol.h>
 #include <engine/e_snapshot.h>
diff --git a/src/game/client/gc_client.cpp b/src/game/client/gc_client.cpp
index bbb00c27..f4af5cc3 100644
--- a/src/game/client/gc_client.cpp
+++ b/src/game/client/gc_client.cpp
@@ -7,6 +7,7 @@
 extern "C" {
 	#include <engine/e_config.h>
 	#include <engine/client/ec_font.h>
+	#include <engine/e_client_interface.h>
 };
 
 #include "../g_game.h"
@@ -1140,7 +1141,7 @@ void render_game()
 			// don't use predicted
 		}
 		else
-			local_character_pos = mix(predicted_prev_player.pos, predicted_player.pos, client_intrapredtick());
+			local_character_pos = mix(predicted_prev_player.pos, predicted_player.pos, client_predintratick());
 	}
 	else if(local_character && local_prev_character)
 	{
@@ -1211,7 +1212,7 @@ void render_game()
 
 			for(int i = 0; i < inp_num_events(); i++)
 			{
-				INPUTEVENT e = inp_get_event(i);
+				INPUT_EVENT e = inp_get_event(i);
 
 				if (!(e.ch >= 0 && e.ch < 32))
 				{
diff --git a/src/game/client/gc_console.cpp b/src/game/client/gc_console.cpp
index ddfb4b48..9cf417e2 100644
--- a/src/game/client/gc_console.cpp
+++ b/src/game/client/gc_console.cpp
@@ -2,7 +2,7 @@
 
 extern "C" {
 	#include <engine/e_system.h>
-	#include <engine/e_interface.h>
+	#include <engine/e_client_interface.h>
 	#include <engine/e_config.h>
 	#include <engine/e_console.h>
 	#include <engine/client/ec_font.h>
@@ -71,7 +71,7 @@ void console_handle_input()
 
 	for(int i = 0; i < inp_num_events(); i++)
 	{
-		INPUTEVENT e = inp_get_event(i);
+		INPUT_EVENT e = inp_get_event(i);
 
 		if (e.key == KEY_F3)
 		{
diff --git a/src/game/client/gc_hooks.cpp b/src/game/client/gc_hooks.cpp
index 34196eaa..3f45251e 100644
--- a/src/game/client/gc_hooks.cpp
+++ b/src/game/client/gc_hooks.cpp
@@ -1,6 +1,6 @@
 #include <string.h>
 
-#include <engine/e_interface.h>
+#include <engine/e_client_interface.h>
 
 extern "C" {
 	#include <engine/e_config.h>
diff --git a/src/game/client/gc_map_image.cpp b/src/game/client/gc_map_image.cpp
index ab4d9aa7..c2c695ba 100644
--- a/src/game/client/gc_map_image.cpp
+++ b/src/game/client/gc_map_image.cpp
@@ -1,6 +1,6 @@
 /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
 #include <engine/e_system.h>
-#include <engine/e_interface.h>
+#include <engine/e_client_interface.h>
 #include <game/g_mapitems.h>
 #include "gc_map_image.h"
 
diff --git a/src/game/client/gc_menu.cpp b/src/game/client/gc_menu.cpp
index 09c55d9c..9b72d4b5 100644
--- a/src/game/client/gc_menu.cpp
+++ b/src/game/client/gc_menu.cpp
@@ -9,7 +9,7 @@
 
 extern "C" {
 	#include <engine/e_system.h>
-	#include <engine/e_interface.h>
+	#include <engine/e_client_interface.h>
 	#include <engine/e_config.h>
 	#include <engine/client/ec_font.h>
 }
@@ -206,7 +206,7 @@ int ui_do_edit_box(void *id, const RECT *rect, char *str, int str_size, float fo
 			
 		for(int i = 0; i < inp_num_events(); i++)
 		{
-			INPUTEVENT e = inp_get_event(i);
+			INPUT_EVENT e = inp_get_event(i);
 			char c = e.ch;
 			int k = e.key;
 
@@ -415,7 +415,7 @@ int ui_do_key_reader(void *id, const RECT *rect, int key)
 	{
 		for(int i = 0; i < inp_num_events(); i++)
 		{
-			INPUTEVENT e = inp_get_event(i);
+			INPUT_EVENT e = inp_get_event(i);
 			if(e.key && e.key != KEY_ESC)
 			{
 				new_key = e.key;
diff --git a/src/game/client/gc_render.cpp b/src/game/client/gc_render.cpp
index 1999cb0a..91ae5662 100644
--- a/src/game/client/gc_render.cpp
+++ b/src/game/client/gc_render.cpp
@@ -1,6 +1,6 @@
 /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
 #include <math.h>
-#include <engine/e_interface.h>
+#include <engine/e_client_interface.h>
 #include <engine/e_config.h>
 #include <game/generated/gc_data.h>
 #include <game/g_protocol.h>
diff --git a/src/game/client/gc_render_map.cpp b/src/game/client/gc_render_map.cpp
index 931fdd18..ec96f583 100644
--- a/src/game/client/gc_render_map.cpp
+++ b/src/game/client/gc_render_map.cpp
@@ -1,5 +1,5 @@
 /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
-#include <engine/e_interface.h>
+#include <engine/e_client_interface.h>
 #include "../g_math.h"
 #include "gc_client.h"
 
diff --git a/src/game/client/gc_render_obj.cpp b/src/game/client/gc_render_obj.cpp
index ba248907..bdb4cfac 100644
--- a/src/game/client/gc_render_obj.cpp
+++ b/src/game/client/gc_render_obj.cpp
@@ -1,6 +1,6 @@
 /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
 #include <math.h>
-#include <engine/e_interface.h>
+#include <engine/e_client_interface.h>
 #include <engine/e_config.h>
 #include "../generated/gc_data.h"
 #include "../g_protocol.h"
@@ -202,7 +202,7 @@ void render_player(
 			// apply predicted results
 			predicted_player.write(&player);
 			predicted_prev_player.write(&prev);
-			intratick = client_intrapredtick();
+			intratick = client_predintratick();
 		}
 	}
 
@@ -254,7 +254,7 @@ void render_player(
 			if(local_info && player_char->hooked_player == local_info->clientid)
 			{
 				hook_pos = mix(vec2(predicted_prev_player.pos.x, predicted_prev_player.pos.y),
-					vec2(predicted_player.pos.x, predicted_player.pos.y), client_intrapredtick());
+					vec2(predicted_player.pos.x, predicted_player.pos.y), client_predintratick());
 			}
 			else
 				hook_pos = mix(vec2(prev_char->hook_x, prev_char->hook_y), vec2(player_char->hook_x, player_char->hook_y), client_intratick());
diff --git a/src/game/client/gc_skin.cpp b/src/game/client/gc_skin.cpp
index ea215edd..6136f76f 100644
--- a/src/game/client/gc_skin.cpp
+++ b/src/game/client/gc_skin.cpp
@@ -2,7 +2,7 @@
 #include <string.h>
 #include <stdio.h>
 #include <engine/e_system.h>
-#include <engine/e_interface.h>
+#include <engine/e_client_interface.h>
 #include "gc_skin.h"
 #include "../g_math.h"
 
diff --git a/src/game/client/gc_ui.cpp b/src/game/client/gc_ui.cpp
index 25693d02..a7580d5d 100644
--- a/src/game/client/gc_ui.cpp
+++ b/src/game/client/gc_ui.cpp
@@ -1,6 +1,6 @@
 /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
 #include <engine/e_system.h>
-#include <engine/e_interface.h>
+#include <engine/e_client_interface.h>
 #include <engine/e_config.h>
 #include "gc_ui.h"
 
diff --git a/src/game/editor/ed_editor.cpp b/src/game/editor/ed_editor.cpp
index 6af991b9..15e3fc39 100644
--- a/src/game/editor/ed_editor.cpp
+++ b/src/game/editor/ed_editor.cpp
@@ -6,7 +6,7 @@
 
 extern "C" {
 	#include <engine/e_system.h>
-	#include <engine/e_interface.h>
+	#include <engine/e_common_interface.h>
 	#include <engine/e_datafile.h>
 	#include <engine/e_config.h>
 }
diff --git a/src/game/editor/ed_editor.hpp b/src/game/editor/ed_editor.hpp
index 2c391488..b4061587 100644
--- a/src/game/editor/ed_editor.hpp
+++ b/src/game/editor/ed_editor.hpp
@@ -8,7 +8,7 @@
 
 extern "C" {
 	#include <engine/e_system.h>
-	#include <engine/e_interface.h>
+	#include <engine/e_client_interface.h>
 	#include <engine/e_datafile.h>
 	#include <engine/e_config.h>
 }
diff --git a/src/game/g_collision.cpp b/src/game/g_collision.cpp
index ffccab05..b15af913 100644
--- a/src/game/g_collision.cpp
+++ b/src/game/g_collision.cpp
@@ -2,7 +2,7 @@
 #include <engine/e_system.h>
 #include <game/g_vmath.h>
 #include <math.h>
-#include <engine/e_interface.h>
+#include <engine/e_common_interface.h>
 #include <game/g_math.h>
 #include <game/g_mapitems.h>
 #include <game/g_layers.h>
diff --git a/src/game/g_game.cpp b/src/game/g_game.cpp
index ba70c31c..4befc33e 100644
--- a/src/game/g_game.cpp
+++ b/src/game/g_game.cpp
@@ -118,9 +118,9 @@ void player_core::tick()
 	triggered_events = 0;
 	
 	bool grounded = false;
-	if(col_is_solid((int)(pos.x+phys_size/2), (int)(pos.y+phys_size/2+5)))
+	if(col_check_point((int)(pos.x+phys_size/2), (int)(pos.y+phys_size/2+5)))
 		grounded = true;
-	if(col_is_solid((int)(pos.x-phys_size/2), (int)(pos.y+phys_size/2+5)))
+	if(col_check_point((int)(pos.x-phys_size/2), (int)(pos.y+phys_size/2+5)))
 		grounded = true;
 	
 	vec2 direction = normalize(vec2(input.target_x, input.target_y));
diff --git a/src/game/g_game.h b/src/game/g_game.h
index 005f315b..5cece9d9 100644
--- a/src/game/g_game.h
+++ b/src/game/g_game.h
@@ -3,9 +3,9 @@
 #define GAME_GAME_H
 
 #include <engine/e_system.h>
+#include <engine/e_common_interface.h>
 #include <game/g_math.h>
 #include <math.h>
-#include "../engine/e_interface.h"
 #include "g_collision.h"
 
 #include "g_protocol.h"
diff --git a/src/game/g_layers.cpp b/src/game/g_layers.cpp
index f60f13d7..1e46168c 100644
--- a/src/game/g_layers.cpp
+++ b/src/game/g_layers.cpp
@@ -1,4 +1,4 @@
-#include <engine/e_interface.h>
+#include <engine/e_common_interface.h>
 #include "g_layers.h"
 
 static MAPITEM_LAYER_TILEMAP *game_layer;
diff --git a/src/game/server/gs_game.cpp b/src/game/server/gs_game.cpp
index 2d44a499..14b5a2c7 100644
--- a/src/game/server/gs_game.cpp
+++ b/src/game/server/gs_game.cpp
@@ -1,6 +1,7 @@
 /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
 #include <string.h>
 #include <engine/e_config.h>
+#include <engine/e_server_interface.h>
 #include <game/g_mapitems.h>
 #include "gs_common.h"
 
@@ -190,7 +191,7 @@ int gameobject::on_player_death(class player *victim, class player *killer, int
 
 void gameobject::do_warmup(int seconds)
 {
-	warmup = seconds*SERVER_TICK_SPEED;
+	warmup = seconds*server_tickspeed();
 }
 
 bool gameobject::is_friendly_fire(int cid1, int cid2)
diff --git a/src/game/server/gs_game_ctf.cpp b/src/game/server/gs_game_ctf.cpp
index 7581f015..ee9dae08 100644
--- a/src/game/server/gs_game_ctf.cpp
+++ b/src/game/server/gs_game_ctf.cpp
@@ -1,4 +1,5 @@
 /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
+#include <engine/e_server_interface.h>
 #include <game/g_mapitems.h>
 #include "gs_common.h"
 #include "gs_game_ctf.h"
@@ -134,7 +135,7 @@ void gameobject_ctf::tick()
 			
 			if(!f->carrying_player && !f->at_stand)
 			{
-				if(server_tick() > f->drop_tick + SERVER_TICK_SPEED*30)
+				if(server_tick() > f->drop_tick + server_tickspeed()*30)
 				{
 					create_sound_global(SOUND_CTF_RETURN);
 					f->reset();
diff --git a/src/game/server/gs_server.cpp b/src/game/server/gs_server.cpp
index d4538ba1..31b1975e 100644
--- a/src/game/server/gs_server.cpp
+++ b/src/game/server/gs_server.cpp
@@ -3,6 +3,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <engine/e_config.h>
+#include <engine/e_server_interface.h>
 #include <game/g_version.h>
 #include <game/g_collision.h>
 #include <game/g_layers.h>
@@ -371,7 +372,7 @@ projectile::projectile(int type, int owner, vec2 pos, vec2 vel, int span, entity
 {
 	this->type = type;
 	this->pos = pos;
-	this->vel = vel * SERVER_TICK_SPEED; // TODO: remove this
+	this->vel = vel * server_tickspeed(); // TODO: remove this
 	this->lifespan = span;
 	this->owner = owner;
 	this->powner = powner;
@@ -398,8 +399,8 @@ void projectile::tick()
 	if(type == WEAPON_BOMB)
 		gravity = 0;
 	
-	float pt = (server_tick()-start_tick-1)/(float)SERVER_TICK_SPEED;
-	float ct = (server_tick()-start_tick)/(float)SERVER_TICK_SPEED;
+	float pt = (server_tick()-start_tick-1)/(float)server_tickspeed();
+	float ct = (server_tick()-start_tick)/(float)server_tickspeed();
 	vec2 prevpos = calc_pos(pos, vel, gravity, pt);
 	vec2 curpos = calc_pos(pos, vel, gravity, ct);
 
@@ -435,8 +436,8 @@ void projectile::tick()
 
 void projectile::snap(int snapping_client)
 {
-	float ct = (server_tick()-start_tick)/(float)SERVER_TICK_SPEED;
-	vec2 curpos = calc_pos(pos, vel, -7.5f*SERVER_TICK_SPEED, ct);
+	float ct = (server_tick()-start_tick)/(float)server_tickspeed();
+	vec2 curpos = calc_pos(pos, vel, -7.5f*server_tickspeed(), ct);
 
 	if(distance(players[snapping_client].pos, curpos) > 1000.0f)
 		return;