stratagus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Stratagus-CVS] stratagus/src/pathfinder ccl_pathfinder.c


From: Jimmy Salmon
Subject: [Stratagus-CVS] stratagus/src/pathfinder ccl_pathfinder.c
Date: Tue, 02 Dec 2003 19:32:33 -0500

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Jimmy Salmon <address@hidden>   03/12/02 19:32:33

Modified files:
        src/pathfinder : ccl_pathfinder.c 

Log message:
        Added lua functions

Patches:
Index: stratagus/src/pathfinder/ccl_pathfinder.c
diff -u stratagus/src/pathfinder/ccl_pathfinder.c:1.25 
stratagus/src/pathfinder/ccl_pathfinder.c:1.26
--- stratagus/src/pathfinder/ccl_pathfinder.c:1.25      Thu Nov 20 15:04:55 2003
+++ stratagus/src/pathfinder/ccl_pathfinder.c   Tue Dec  2 19:32:33 2003
@@ -10,7 +10,7 @@
 //
 /address@hidden ccl_pathfinder.c       -       pathfinder ccl functions. */
 //
-//     (c) Copyright 2000-2002 by Lutz Sammer, Fabrice Rossi, Latimerius.
+//     (c) Copyright 2000-2003 by Lutz Sammer, Fabrice Rossi, Latimerius.
 //
 //      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
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: ccl_pathfinder.c,v 1.25 2003/11/20 20:04:55 jsalmon3 Exp $
+//     $Id: ccl_pathfinder.c,v 1.26 2003/12/03 00:32:33 jsalmon3 Exp $
 
 //@{
 
@@ -157,41 +157,84 @@
 #endif
 
 #ifdef HIERARCHIC_PATHFINDER
-local SCM CclPfHierShowRegIds (SCM flag)
+#if defined(USE_GUILE) || defined(USE_SIOD)
+local SCM CclPfHierShowRegIds(SCM flag)
 {
-    PfHierShowRegIds = gh_scm2bool (flag);
+    PfHierShowRegIds = gh_scm2bool(flag);
     return SCM_UNSPECIFIED;
 }
+#elif defined(USE_LUA)
+local int CclPfHierShowRegIds(lua_State* l)
+{
+    if (lua_gettop(l) != 1) {
+       lua_pushstring(l, "incorrect argument");
+       lua_error(l);
+    }
+    PfHierShowRegIds = LuaToBoolean(l, 1);
+    return 0;
+}
+#endif
 
-local SCM CclPfHierShowGroupIds (SCM flag)
+#if defined(USE_GUILE) || defined(USE_SIOD)
+local SCM CclPfHierShowGroupIds(SCM flag)
 {
-    PfHierShowGroupIds = gh_scm2bool (flag);
+    PfHierShowGroupIds = gh_scm2bool(flag);
     return SCM_UNSPECIFIED;
 }
+#elif defined(USE_LUA)
+local int CclPfHierShowGroupIds(lua_State* l)
+{
+    if (lua_gettop(l) != 1) {
+       lua_pushstring(l, "incorrect argument");
+       lua_error(l);
+    }
+    PfHierShowGroupIds = LuaToBoolean(l, 1);
+    return 0;
+}
+#endif
 #else
 #if defined(USE_GUILE) || defined(USE_SIOD)
-local SCM CclPfHierShowRegIds (SCM flag __attribute__((unused)))
+local SCM CclPfHierShowRegIds(SCM flag __attribute__((unused)))
 {
     return SCM_UNSPECIFIED;
 }
+#elif defined(USE_LUA)
+local int CclPfHierShowRegIds(lua_State* l)
+{
+    return 0;
+}
+#endif
 
-local SCM CclPfHierShowGroupIds (SCM flag __attribute__((unused)))
+#if defined(USE_GUILE) || defined(USE_SIOD)
+local SCM CclPfHierShowGroupIds(SCM flag __attribute__((unused)))
 {
     return SCM_UNSPECIFIED;
 }
+#elif defined(USE_LUA)
+local int CclPfHierShowGroupIds(lua_State* l)
+{
+    return 0;
+}
+#endif
 
 #ifdef MAP_REGIONS
 global void MapSplitterDebug(void);
 
-local SCM CclDebugRegions(SCM flag __attribute__((unused)))
+#if defined(USE_GUILE) || defined(USE_SIOD)
+local SCM CclDebugRegions(void)
 {
     MapSplitterDebug();
     return SCM_UNSPECIFIED;
 }
-#endif // MAP_REGIONS
-
 #elif defined(USE_LUA)
+local int CclDebugRegions(lua_State* l)
+{
+    MapSplitterDebug();
+    return 0;
+}
 #endif
+#endif // MAP_REGIONS
+
 #endif
 
 
@@ -203,14 +246,17 @@
 #if defined(USE_GUILE) || defined(USE_SIOD)
     gh_new_procedureN("a-star",CclAStar);
 #ifdef MAP_REGIONS
-    gh_new_procedureN("debug-regions",CclDebugRegions);
+    gh_new_procedure0_0("debug-regions",CclDebugRegions);
 #endif // MAP_REGIONS
     gh_new_procedure1_0 ("pf-show-regids!", CclPfHierShowRegIds);
     gh_new_procedure1_0 ("pf-show-groupids!", CclPfHierShowGroupIds);
 #elif defined(USE_LUA)
     lua_register(Lua, "AStar",CclAStar);
-//    lua_register(Lua, "PfShowRegids", CclPfHierShowRegIds);
-//    lua_register(Lua, "PfShowGroupids", CclPfHierShowGroupIds);
+#ifdef MAP_REGIONS
+    lua_register(Lua, "DebugRegions",CclDebugRegions);
+#endif // MAP_REGIONS
+    lua_register(Lua, "PfShowRegids", CclPfHierShowRegIds);
+    lua_register(Lua, "PfShowGroupids", CclPfHierShowGroupIds);
 #endif
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]