map_vars.cc 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /********************************************************************** <BR>
  2. This file is part of Crack dot Com's free source code release of
  3. Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
  4. information about compiling & licensing issues visit this URL</a>
  5. <PRE> If that doesn't help, contact Jonathan Clark at
  6. golgotha_source@usa.net (Subject should have "GOLG" in it)
  7. ***********************************************************************/
  8. #include "map_vars.hh"
  9. #include "lisp/li_load.hh"
  10. #include "saver.hh"
  11. #include "map.hh"
  12. #include "lisp/lisp.hh"
  13. #include "lisp/li_init.hh"
  14. #include "lisp/li_dialog.hh"
  15. void g1_map_vars_class::load(g1_loader_class *fp, w32 sections)
  16. {
  17. if ((sections & G1_MAP_VARS) && fp)
  18. if (fp->goto_section("level vars"))
  19. var_ptr=li_load_typed_object("level_vars", fp, fp->li_remap,0);
  20. else var_ptr=li_new("level_vars");
  21. }
  22. void g1_map_vars_class::save(g1_saver_class *fp, w32 sections)
  23. {
  24. if (sections & G1_MAP_VARS)
  25. {
  26. fp->mark_section("level vars");
  27. li_save_object(fp, var_ptr.get(), 0);
  28. }
  29. }
  30. g1_map_vars_class g1_map_vars;
  31. li_object *g1_set_level_vars(li_object *o, li_environment *env)
  32. {
  33. g1_map_vars.var_ptr=li_car(o, env);
  34. return 0;
  35. }
  36. li_object *g1_edit_level_vars(li_object *o, li_environment *env)
  37. {
  38. li_create_dialog("Level Vars", g1_map_vars.var_ptr.get(), 0, g1_set_level_vars);
  39. return 0;
  40. }
  41. li_automatic_add_function(g1_edit_level_vars, "edit_level_vars");