]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - include/imodel.h
Remove leading . in CMAKE_EXECUTABLE_SUFFIX if it has one
[xonotic/netradiant.git] / include / imodel.h
index de5964a80b3debfd26f6a35f331002a9a83b15cc..d047e90abbdad80e16297aa085a904e61234c618 100644 (file)
-/*\r
-Copyright (C) 1999-2007 id Software, Inc. and contributors.\r
-For a list of contributors, see the accompanying CONTRIBUTORS file.\r
-\r
-This file is part of GtkRadiant.\r
-\r
-GtkRadiant is free software; you can redistribute it and/or modify\r
-it under the terms of the GNU General Public License as published by\r
-the Free Software Foundation; either version 2 of the License, or\r
-(at your option) any later version.\r
-\r
-GtkRadiant is distributed in the hope that it will be useful,\r
-but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-GNU General Public License for more details.\r
-\r
-You should have received a copy of the GNU General Public License\r
-along with GtkRadiant; if not, write to the Free Software\r
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
-*/\r
-\r
-#ifndef _IMODEL_H_\r
-#define _IMODEL_H_\r
-\r
-#define MODEL_MAJOR "model"\r
-\r
-/*!\r
-loads model from model file name specified,\r
-fills model struct with pointers to model interfaces\r
-\r
-name is a relative path, we'll use VFS to extract a basepath to add to get the absolute path.\r
-*/\r
-typedef void (* PFN_LOADMODEL) (entity_interfaces_t *model, const char *name);\r
-\r
-struct _QERPlugModelTable\r
-{\r
-  int          m_nSize;\r
-  PFN_LOADMODEL       m_pfnLoadModel;\r
-};\r
-\r
-\r
-//forward declare entity_t\r
-struct entity_s;\r
-typedef struct entity_s entity_t;\r
-\r
-// any module relying on imodel will need to link against the mathlib\r
-#include "mathlib.h"\r
-\r
-// state flags\r
-#define DRAW_GL_FILL          0x0001\r
-#define DRAW_GL_LIGHTING      0x0010\r
-#define DRAW_GL_TEXTURE_2D    0x0100\r
-#define DRAW_GL_BLEND         0x1000\r
-\r
-// predefined state combinations\r
-#define DRAW_GL_WIRE                                   0x0000\r
-#define DRAW_GL_FLAT                                   0x0001\r
-#define DRAW_GL_SOLID                                  0x0011\r
-#define DRAW_GL_TEXTURED                       0x0111\r
-\r
-// mode\r
-#define DRAW_WIRE                                                      0\r
-#define DRAW_SOLID                                             1\r
-#define DRAW_TEXTURED                                  2\r
-\r
-// render flags\r
-#define DRAW_RF_NONE          0x0000\r
-#define DRAW_RF_SEL_OUTLINE   0x0001\r
-#define DRAW_RF_SEL_FILL      0x0010\r
-#define DRAW_RF_XY            0x0011\r
-#define DRAW_RF_CAM           0x0100\r
-\r
-class IRender\r
-{\r
-public:\r
-  virtual ~IRender() { }\r
-  virtual void IncRef() = 0; // increments the reference counter for this object\r
-  virtual void DecRef() = 0; // decrements the reference counter for this object, deletes the object if reference count is zero\r
-  virtual void Draw(int state, int rflags) const = 0; // render the object - state = the opengl state\r
-  virtual const aabb_t *GetAABB() const = 0;\r
-};\r
-\r
-class ISelect\r
-{\r
-public:\r
-  virtual ~ISelect() { }\r
-       virtual void IncRef() = 0; // increments the reference counter for this object\r
-       virtual void DecRef() = 0; // decrements the reference counter for this object, deletes the object if reference count is zero\r
-  virtual bool TestRay(const ray_t *ray, vec_t *dist) const = 0; // test ray intersection, return bool true if intersects, and store distance to closest point of intersection\r
-  //virtual bool TestBox(const aabb_t *aabb) const = 0; // test aabb intersection, return bool true if touching or intersecting\r
-};\r
-\r
-class IEdit\r
-{\r
-public:\r
-  virtual ~IEdit() { }\r
-       virtual void IncRef() = 0; // increments the reference counter for this object\r
-       virtual void DecRef() = 0; // decrements the reference counter for this object, deletes the object if reference count is zero\r
-  virtual void Translate(const vec3_t translation) = 0;\r
-  virtual void Rotate(const vec3_t pivot, const vec3_t rotation) = 0;\r
-  virtual const vec_t *GetTranslation() const = 0;\r
-  virtual const vec_t *GetRotation() const = 0;\r
-  virtual void OnKeyValueChanged(entity_t *e, const char *key, const char* value) = 0;\r
-};\r
-\r
-#endif /* _IMODEL_H_ */\r
+/*
+   Copyright (C) 2001-2006, William Joseph.
+   All Rights Reserved.
+
+   This file is part of GtkRadiant.
+
+   GtkRadiant is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   GtkRadiant is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GtkRadiant; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#if !defined( INCLUDED_IMODEL_H )
+#define INCLUDED_IMODEL_H
+
+#include "generic/constant.h"
+
+namespace scene
+{
+class Node;
+}
+
+class ArchiveFile;
+
+class ModelLoader
+{
+public:
+INTEGER_CONSTANT( Version, 1 );
+STRING_CONSTANT( Name, "model" );
+virtual scene::Node& loadModel( ArchiveFile& file ) = 0;
+};
+
+template<typename Type>
+class Modules;
+typedef Modules<ModelLoader> ModelModules;
+
+template<typename Type>
+class ModulesRef;
+typedef ModulesRef<ModelLoader> ModelModulesRef;
+
+#endif /* _IMODEL_H_ */