summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2005-04-15 00:53:56 +0000
committerIan C <ianc@noddybox.co.uk>2005-04-15 00:53:56 +0000
commit71c1ae31007891ecfd59236ba8564bc4b5deb1e4 (patch)
tree5d307457e7bfa2bb544267826a37366c51215901 /test
parentede67ff31c69f56094a1248cd0bdb7f529dba0f3 (diff)
Initial import
Diffstat (limited to 'test')
-rw-r--r--test/.cvsignore1
-rw-r--r--test/GNUmakefile57
-rw-r--r--test/mstest.cpp36
3 files changed, 94 insertions, 0 deletions
diff --git a/test/.cvsignore b/test/.cvsignore
new file mode 100644
index 0000000..140a633
--- /dev/null
+++ b/test/.cvsignore
@@ -0,0 +1 @@
+mstest.dll \ No newline at end of file
diff --git a/test/GNUmakefile b/test/GNUmakefile
new file mode 100644
index 0000000..58e7b44
--- /dev/null
+++ b/test/GNUmakefile
@@ -0,0 +1,57 @@
+# MSPlugins - test Milkshape plugin
+#
+# Copyright (C) 2005 Ian Cowburn (ianc@noddybox.demon.co.uk)
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# -------------------------------------------------------------------------
+#
+# $Id: GNUmakefile,v 1.1 2005-04-15 00:53:56 ianc Exp $
+#
+
+include ../make.conf
+
+TARGET = mstest
+
+SOURCES = mstest.cpp
+
+HEADERS =
+
+OBJECTS = $(SOURCES:.cpp=.o)
+
+OUTDLL = $(TARGET).dll
+
+WRAPPER = ../wrapper
+
+DLLLIBS = $(WRAPPER)/mingwms.lib $(MILKSHAPE)/lib/msModelLib.lib \
+ `w32dlib-config --libs`
+ #`w32dlib-config --archive`
+
+FLAGS = -I$(WRAPPER) -I$(MILKSHAPE) `w32dlib-config --cflags`
+
+
+$(OUTDLL): $(OBJECTS)
+ dllwrap --dllname=$(OUTDLL) --driver-name=c++ $(OBJECTS) $(DLLLIBS)
+
+%.o: %.cpp
+ $(CXX) -c $(FLAGS) $< -o $@
+
+mstest.o: mstest.cpp
+
+clean:
+ -rm -f $(OUTDLL) *.o
+
+
+# END OF FILE
diff --git a/test/mstest.cpp b/test/mstest.cpp
new file mode 100644
index 0000000..1a63d6d
--- /dev/null
+++ b/test/mstest.cpp
@@ -0,0 +1,36 @@
+#include <w32dlib/w32dlib.h>
+
+#include "mingwms.h"
+#include "msLib.h"
+
+static const char* GetTitle()
+{
+ return "Mingw test plugin";
+}
+
+static int Execute(msModel* model)
+{
+ if (!model)
+ return -1;
+
+ if (msModel_GetMeshCount(model)<1)
+ {
+ W32DLib::Common::Error(NULL, "No meshes in the model!");
+ return 0;
+ }
+
+ for(int i = 0; i < msModel_GetMeshCount(model); ++i)
+ {
+ msMesh* mesh = msModel_GetMeshAt(model, i);
+ char buf[256];
+ msMesh_GetName(mesh, buf, 255);
+ W32DLib::Common::Message(NULL, buf);
+ }
+
+ return 0;
+}
+
+PLUGIN_SPEC void* CreatePlugIn()
+{
+ return CreateMINGWPlugin(MS_TYPE_TOOL, GetTitle, Execute);
+}