mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-22 01:27:12 +00:00
Entities: Removed Tag attribute; it is taken from the filename instead. Made entity XML files be loaded on demand. Probably stopped crash when maps contain non-existent entities. Fixed a few bugs in entity definitions.
Maps: Stored non-entity objects in XML instead of PMP, for easier manual editing. Updated existing maps to newest format, so that they can still work. Added undocumented _rewriteMaps() JS function. Also renamed _mem to vmem, and reclassified its undocumentedness as unintentional, since it's reasonably useful. Loader: added NonprogressiveLoad function, for ScEd/_rewriteMaps/etc which don't care about progressiveness. main.cpp: re-enabled vfs_display, since it doesn't crash now Vector3D: stopped warning This was SVN commit r2078.
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
#include "BaseEntityCollection.h"
|
||||
#include "Scheduler.h"
|
||||
#include "timer.h"
|
||||
#include "LightEnv.h"
|
||||
#include "MapWriter.h"
|
||||
|
||||
#include "Game.h"
|
||||
#include "Network/Server.h"
|
||||
@@ -72,8 +74,9 @@ JSFunctionSpec ScriptFunctionTable[] =
|
||||
{"exit", exitProgram, 0, 0, 0 },
|
||||
{"crash", crash, 0, 0, 0 },
|
||||
{"forceGC", forceGC, 0, 0, 0 },
|
||||
{"_mem", js_mem, 0, 0, 0 }, // Intentionally undocumented
|
||||
{0, 0, 0, 0, 0},
|
||||
{"vmem", vmem, 0, 0, 0 },
|
||||
{"_rewriteMaps", _rewriteMaps, 0, 0, 0 },
|
||||
{0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
enum ScriptGlobalTinyIDs
|
||||
@@ -486,7 +489,7 @@ JSBool crash(JSContext* UNUSEDPARAM(context), JSObject* UNUSEDPARAM(globalObject
|
||||
return *(JSBool*) ptr;
|
||||
}
|
||||
|
||||
JSBool js_mem(JSContext* UNUSEDPARAM(context), JSObject* UNUSEDPARAM(globalObject), unsigned int UNUSEDPARAM(argc), jsval* UNUSEDPARAM(argv), jsval* UNUSEDPARAM(rval))
|
||||
JSBool vmem(JSContext* UNUSEDPARAM(context), JSObject* UNUSEDPARAM(globalObject), unsigned int UNUSEDPARAM(argc), jsval* UNUSEDPARAM(argv), jsval* UNUSEDPARAM(rval))
|
||||
{
|
||||
#ifdef _WIN32
|
||||
int left, total;
|
||||
@@ -500,3 +503,10 @@ JSBool js_mem(JSContext* UNUSEDPARAM(context), JSObject* UNUSEDPARAM(globalObjec
|
||||
#endif
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
JSBool _rewriteMaps(JSContext* UNUSEDPARAM(context), JSObject* UNUSEDPARAM(globalObject), unsigned int UNUSEDPARAM(argc), jsval* UNUSEDPARAM(argv), jsval* UNUSEDPARAM(rval))
|
||||
{
|
||||
extern CLightEnv g_LightEnv;
|
||||
CMapWriter::RewriteAllMaps(g_Game->GetWorld()->GetTerrain(), g_Game->GetWorld()->GetUnitManager(), &g_LightEnv);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user