fc0702c16c
Unlike most planetarium software, Celestia doesn't confine you to the surface of the Earth. You can travel throughout the solar system, to any of over 100,000 stars, or even beyond the galaxy. All movement in Celestia is seamless; the exponential zoom feature lets you explore space across a huge range of scales, from galaxy clusters down to spacecraft only a few meters across. A 'point-and-goto' interface makes it simple to navigate through the universe to the object you want to visit. Celestia is expandable. It comes with a large catalog of stars, galaxies, planets, moons, asteroids, comets, and spacecraft. If that's not enough, you can download dozens of easy to install add-ons with more objects. Available flavors: lua - add Lua scripting engine (extension language support) ok jasper@
56 lines
1.7 KiB
Plaintext
56 lines
1.7 KiB
Plaintext
$OpenBSD: patch-src_celestia_celx_cpp,v 1.1.1.1 2007/07/16 17:39:21 ajacoutot Exp $
|
|
$NetBSD: patch-ai,v 1.3 2006/08/14 22:43:08 wiz Exp $
|
|
--- src/celestia/celx.cpp.orig Thu Jul 12 12:02:16 2007
|
|
+++ src/celestia/celx.cpp Thu Jul 12 12:09:51 2007
|
|
@@ -368,6 +368,17 @@ static CelestiaCore* getAppCore(lua_State* l, FatalErr
|
|
return appCore;
|
|
}
|
|
|
|
+static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
|
|
+ (void)ud; /* not used */
|
|
+ (void)osize; /* not used */
|
|
+ if (nsize == 0) {
|
|
+ free(ptr); /* ANSI requires that free(NULL) has no effect */
|
|
+ return NULL;
|
|
+ }
|
|
+ else
|
|
+ /* ANSI requires that realloc(NULL, size) == malloc(size) */
|
|
+ return realloc(ptr, nsize);
|
|
+}
|
|
|
|
LuaState::LuaState() :
|
|
timeout(MaxTimeslice),
|
|
@@ -378,7 +389,7 @@ LuaState::LuaState() :
|
|
scriptAwakenTime(0.1),
|
|
ioMode(NoIO)
|
|
{
|
|
- state = lua_open();
|
|
+ state = lua_newstate(l_alloc, NULL);
|
|
timer = CreateTimer();
|
|
screenshotCount = 0;
|
|
}
|
|
@@ -598,7 +609,7 @@ bool LuaState::charEntered(const char* c_p)
|
|
int stackTop = lua_gettop(costate);
|
|
if (strcmp(c_p, "y") == 0)
|
|
{
|
|
- lua_iolibopen(costate);
|
|
+ luaopen_io(costate);
|
|
ioMode = IOAllowed;
|
|
}
|
|
else
|
|
@@ -4577,10 +4588,10 @@ bool LuaState::init(CelestiaCore* appCore)
|
|
initMaps();
|
|
|
|
// Import the base and math libraries
|
|
- lua_baselibopen(state);
|
|
- lua_mathlibopen(state);
|
|
- lua_tablibopen(state);
|
|
- lua_strlibopen(state);
|
|
+ luaopen_base(state);
|
|
+ luaopen_math(state);
|
|
+ luaopen_table(state);
|
|
+ luaopen_string(state);
|
|
|
|
// Add an easy to use wait function, so that script writers can
|
|
// live in ignorance of coroutines. There will probably be a significant
|