glob2-devel
[Top][All Lists]
Advanced

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

[glob2-devel] Fixed multi-language scripting


From: Stéphane Magnenat
Subject: [glob2-devel] Fixed multi-language scripting
Date: Sat, 13 Feb 2010 14:51:24 +0100
User-agent: KMail/1.13.0 (Linux/2.6.31-20-generic; KDE/4.4.0; x86_64; ; )

Hello,

I have added the command line switch to choose the scripting provided in the 
map editor. I have reverted the default mode to SGSL, and USL can be selected 
using -usl switch (and sgsl forced using the -sgsl switch).

I have also fixed the execution of the tutorial, which was broken because 
someone switch the keyword detection of SGSL to case-sensitive. Please, do not 
change something as fundamental as this without knowing and without testing.

I have also cleaned the naming of Mapscript/MapScript, now the SGSL version is 
called MapScriptSGSL, and the USL version is called MapScript.

I have noticed that USL integration is broken now (but was probably broken 
then as well), as trying to execute a USL script leads Glob2 into an infinite 
loop, perhaps because of non-initalized variables, see show below as annex 1.

I have committed these changes to hg.globulation2.org in master, maybe we one 
should backport them for beta5, as it resurrects SGSL.

While running in valgrind, I have also noted uninitialised variables in Unit, 
which might be bad, see Annex 2 at the end of this mail.

Well, hopefully this contributes to the liveliness of Glob2, and allows time 
for proper integration of USL.

Have a nice week-end everyone,

Steph


Annex 1:

==8335== Use of uninitialised value of size 8
==8335==    at 0x7F93B3: Value::dump(std::ostream&) const (types.cpp:16)
==8335==    by 0x7FBC4F: print(Value*) (usl.cpp:97)
==8335==    by 0x7FE457: boost::detail::function::void_function_invoker1<void 
(*)(Value*), void, Value*>::invoke(boost::detail::function::function_buffer&, 
Value*) (function_template.hpp:111)
==8335==    by 0x7FEE00: boost::function1<void, Value*>::operator()(Value*) 
const (function_template.hpp:989)
==8335==    by 0x7FED03: void execute<Value*>(boost::function<void ()(Value*)> 
const&, Thread*) (native.h:152)
==8335==    by 0x7FE994: NativeFunction<void ()(Value*)>::execute(Thread*) 
(native.h:291)
==8335==    by 0x7FEEAA: Thread::step() (interpreter.cpp:29)
==8335==    by 0x7FEF99: Thread::run(unsigned long) (interpreter.cpp:65)
==8335==    by 0x7FCD60: Usl::run(unsigned long) (usl.cpp:234)
==8335==    by 0x6014CA: MapScriptUSL::syncStep(GameGUI*) 
(MapScriptUSL.cpp:237)
==8335==    by 0x600316: MapScript::syncStep(GameGUI*) (MapScript.cpp:118)
==8335==    by 0x4F5D7F: Game::scriptSyncStep() (Game.cpp:1250)
==8335==
==8335== Use of uninitialised value of size 8
==8335==    at 0x7F93C7: Value::dump(std::ostream&) const (types.cpp:16)
==8335==    by 0x7FBC4F: print(Value*) (usl.cpp:97)
==8335==    by 0x7FE457: boost::detail::function::void_function_invoker1<void 
(*)(Value*), void, Value*>::invoke(boost::detail::function::function_buffer&, 
Value*) (function_template.hpp:111)
==8335==    by 0x7FEE00: boost::function1<void, Value*>::operator()(Value*) 
const (function_template.hpp:989)
==8335==    by 0x7FED03: void execute<Value*>(boost::function<void ()(Value*)> 
const&, Thread*) (native.h:152)
==8335==    by 0x7FE994: NativeFunction<void ()(Value*)>::execute(Thread*) 
(native.h:291)
==8335==    by 0x7FEEAA: Thread::step() (interpreter.cpp:29)
==8335==    by 0x7FEF99: Thread::run(unsigned long) (interpreter.cpp:65)
==8335==    by 0x7FCD60: Usl::run(unsigned long) (usl.cpp:234)
==8335==    by 0x6014CA: MapScriptUSL::syncStep(GameGUI*) 
(MapScriptUSL.cpp:237)
==8335==    by 0x600316: MapScript::syncStep(GameGUI*) (MapScript.cpp:118)
==8335==    by 0x4F5D7F: Game::scriptSyncStep() (Game.cpp:1250)


Annex 2:

==8335== Conditional jump or move depends on uninitialised value(s)             
                               
==8335==    at 0x6EFFED: Unit::init(int, int, unsigned short, int, Team*, int) 
(Unit.cpp:109)                  
==8335==    by 0x6EFB5F: Unit::Unit(GAGCore::InputStream*, Team*, int) 
(Unit.cpp:39)
==8335==    by 0x6DBA17: Team::load(GAGCore::InputStream*, BuildingsTypes*, 
int) (Team.cpp:147)
==8335==    by 0x6DA61E: Team::Team(GAGCore::InputStream*, Game*, int) 
(Team.cpp:59)
==8335==    by 0x4F3A99: Game::load(GAGCore::InputStream*) (Game.cpp:922)
==8335==    by 0x52A531: GameGUI::load(GAGCore::InputStream*, bool) 
(GameGUI.cpp:4639)
==8335==    by 0x52A470: GameGUI::loadFromHeaders(MapHeader&, GameHeader&, 
bool, bool, bool) (GameGUI.cpp:4621)
==8335==    by 0x4E285F: Engine::initGame(MapHeader&, GameHeader&, bool, bool, 
bool) (Engine.cpp:718)
==8335==    by 0x4DF46B: Engine::initCustom() (Engine.cpp:126)
==8335==    by 0x55FE65: Glob2::run(int, char**) (Glob2.cpp:331)
==8335==    by 0x5601C2: main (Glob2.cpp:426)
==8335==
==8335== Conditional jump or move depends on uninitialised value(s)
==8335==    at 0x6F003F: Unit::init(int, int, unsigned short, int, Team*, int) 
(Unit.cpp:117)
==8335==    by 0x6EFB5F: Unit::Unit(GAGCore::InputStream*, Team*, int) 
(Unit.cpp:39)
==8335==    by 0x6DBA17: Team::load(GAGCore::InputStream*, BuildingsTypes*, 
int) (Team.cpp:147)
==8335==    by 0x6DA61E: Team::Team(GAGCore::InputStream*, Game*, int) 
(Team.cpp:59)
==8335==    by 0x4F3A99: Game::load(GAGCore::InputStream*) (Game.cpp:922)
==8335==    by 0x52A531: GameGUI::load(GAGCore::InputStream*, bool) 
(GameGUI.cpp:4639)
==8335==    by 0x52A470: GameGUI::loadFromHeaders(MapHeader&, GameHeader&, 
bool, bool, bool) (GameGUI.cpp:4621)
==8335==    by 0x4E285F: Engine::initGame(MapHeader&, GameHeader&, bool, bool, 
bool) (Engine.cpp:718)
==8335==    by 0x4DF46B: Engine::initCustom() (Engine.cpp:126)
==8335==    by 0x55FE65: Glob2::run(int, char**) (Glob2.cpp:331)
==8335==    by 0x5601C2: main (Glob2.cpp:426)

-- 
http://stephane.magnenat.net




reply via email to

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