1. 04 Mar, 2019 1 commit
    • fluzz's avatar
      When saving an item, write the itemspec's id rather than the item index · 30db0002
      fluzz authored
      in ItemMap.
      
      If an item is added in the middle of the item_specs file, the index is
      indeed no more the right one.
      In the best case, a wrong item will be loaded.
      In the worst case, an item of a wrong type (source book instead of weapon,
      for instance) is loaded, and the game can crash when using it.
      
      Add a savegame converter, which apply the conversion on old savegames.
      -> new savegame revision is 001601-08
      30db0002
  2. 14 Mar, 2018 1 commit
    • Gregory's avatar
      Nulling pointers to widgets after free. · f0de7ea6
      Gregory authored and fluzz's avatar fluzz committed
      In the event that one day we make the resolution being changeable in
      game, we have to delete all the gui widgets to recreate them later with
      the new screen's size.
      
      In order for the GUIs to be automatically recreated at will, the
      pointers to those widgets have to be set to NULL.
      f0de7ea6
  3. 03 Jul, 2017 1 commit
    • Xenux's avatar
      Add 'event timers'. · 1ae5bcc4
      Xenux authored and fluzz's avatar fluzz committed
      An 'event timer' is an event scheduled to be executed at a later time.
      
      Like any event, it is defined in events.dat. It has no specific type,
      and only defines the Lua code to be executed (if the trigger is
      enabled).
      
      A Lua function can be used, in a dialog or an other event, to schedule
      the delayed event: dispatch_event("<event_name>", <delay_in_seconds>)
      
      Event timers still to be executed are saved in the savegame.
      1ae5bcc4
  4. 28 Apr, 2017 1 commit
  5. 11 Mar, 2017 1 commit
  6. 18 Feb, 2017 1 commit
    • fluzz's avatar
      Add a string identifier in the game_act struct. · e9e603d1
      fluzz authored
      The name of a game act can possibly be changed in the future.
      A unique and 'immuable' identifier is added for future proofing.
      
      Add a savegame converter to replace the game act name stored in
      savegames by the identifier.
      e9e603d1
  7. 17 Feb, 2017 1 commit
  8. 22 Jan, 2017 1 commit
  9. 24 Oct, 2016 1 commit
    • fluzz's avatar
      Explicitly implement sparse_dynarray and its related functions. · e1cab478
      fluzz authored
      Rendering the combat screen intensively uses dynarrays (for blitting
      lists storage). Any optimization of the dynarray functions can thus
      bring a framerate improvement.
      
      Currently, the dynarray functions internally use if-blocks to manage
      sparse dynarrays, slowing down the execution time on non-sparse
      dynarrays.
      
      This patch extracts the sparse_dynarray specific code, and explicity
      define sparse_dynarray_XXXX() functions.
      
      Framerate improvement : 2.1GHz i7-3687U (HD 4000), level 0, max
      zoom-out: from 54fps to 58fps (~9%)
      e1cab478
  10. 16 Oct, 2016 1 commit
    • fluzz's avatar
      Fix a 'heap use after free' when resizing a level (issue819). · 4f5b2903
      fluzz authored
      The 'map' member of the level struct is an array of buffers containing
      a row of map_tile structs.
      The map_tile struct contains a list_head member to hold a list of
      volatile obstacles.
      When a list is empty, list_head.next and list_head.prev points
      to the list_head.
      
      When removing the western column of a level, all rows in level->map
      are shifted left by using memmove() and realloc().
      After the memory shift and (possible) memory reallocation, the
      list_head.next and list_head.prev pointers no more point to the right
      memory slot.
      
      The solve the problem, this patch replaces the
      map_tile.volatile_obstacles member by a pointer to a list_head, that
      do not suffer any issue due to memory shifting or reallocation of
      the map_tiles.
      
      This patch also free the memory used by removed rows or columns.
      4f5b2903
  11. 28 Aug, 2016 2 commits
  12. 08 Aug, 2016 2 commits
  13. 03 Aug, 2016 1 commit
  14. 02 Aug, 2016 1 commit
  15. 06 Mar, 2016 1 commit
    • fluzz's avatar
      Introduction of a framework for savegame converters, and use it to · a9c5044c
      fluzz authored
      fix a savegame bug in the 0.16 version..
      
      Those converters, composed of piped filter functions, can be
      used to fix bugs in savegames, or to convert from an old version
      to a new one, provided that the changes are not too complex.
      Do not expect this framework to be able to easily resolve our
      well known 'savegame incompatibility' issue...
      
      This framework is used, in this commit, to fix a bug in savegames
      from the 0.16 version, when German language is used (Lua error
      when parsing the .sav file). See savegame/filters_0_16.c for
      more information about that bug.
      a9c5044c
  16. 21 Jan, 2016 1 commit
  17. 14 Jul, 2015 1 commit
  18. 26 Jun, 2015 1 commit
  19. 25 Apr, 2015 1 commit
    • fluzz's avatar
      Add 'volatile obstacle' concept, and functions to handle them. · 772cc972
      fluzz authored
      Blood spread ion floor when a bot is hit or killed is an example of a
      volatile obstacle.
      
      Volatile obstacles are stored in a linked list associated to each map's
      tiles. They have a vanish time, after which they disappear.
      
      A new 'vanish_delay' attribute is added to obstacle's spec
      (obstacle_specs.lua). It defaults to 10 seconds. A volatile
      obstacle has to have a IS_VOLATILE flag.
      
      The volatile obstacles of a level are immediately removed when the
      level is respawned.
      
      Note: an obstacle flagged as IS_VOLATILE but placed on floor by the
      level editor is not considered as a 'volatile' one, and so it will
      not be removed after some times or when the level is re-spawned.
      772cc972
  20. 09 Mar, 2015 1 commit
    • Matthias Krüger's avatar
      clang: fix -Wformat warning · 92755baa
      Matthias Krüger authored
      savestruct_internal.c:80:1: warning: format specifies type 'unsigned short' but the argument has type 'uint8_t' (aka 'unsigned char') [-Wformat]
      define_write_xxx(uint8_t, "%hu");
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                 %hhu
      savestruct_internal.c:58:28: note: expanded from macro 'define_write_xxx'
              autostr_append(strout, Y, *(data));\
                                        ^~~~~~~
      92755baa
  21. 16 Jan, 2015 1 commit
    • fluzz's avatar
      Save bot list in the order they were loaded. · 9433d54f
      fluzz authored
      When starting the lvleditor, playtesting, returning to lvleditor and
      then saving levels.dat, the lists of the special force bots are
      reversed in ReturnOfTux.droids.
      That's due to those lists being not saved in the right order in the
      savegames.
      9433d54f
  22. 11 Nov, 2014 1 commit
  23. 18 Jan, 2014 1 commit
  24. 04 Feb, 2013 1 commit
    • fluzz's avatar
      Upgrade the embedded lua to 5.2. · 4814c206
      fluzz authored
      Change lua.m4 so that 'configure' now uses the embedded version if the
      system-wide lua is < 5.2.
      Adapt to changes introduced in the C API.
      Adapt some scripts to the removal of some deprecated features.
      4814c206
  25. 20 Nov, 2011 1 commit
  26. 07 Nov, 2011 1 commit
  27. 18 Aug, 2011 1 commit
  28. 07 Aug, 2011 1 commit