flat.diff 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. Simple mod that makes floors and ceilings the same height (similarly to the
  2. GOOBERS cheat in Doom), making it a kind of wolf3d shooter.
  3. diff --git a/levels.h b/levels.h
  4. index 01be6ac..25b18e2 100644
  5. --- a/levels.h
  6. +++ b/levels.h
  7. @@ -37,9 +37,8 @@ typedef SFG_TileDefinition SFG_TileDictionary[SFG_TILE_DICTIONARY_SIZE];
  8. /// helper macros for SFG_TileDefinition
  9. #define SFG_TD(floorH, ceilH, floorT, ceilT)\
  10. - ((floorH & 0x001f) |\
  11. - ((floorT & 0x0007) << 5) |\
  12. - ((ceilH & 0x001f) << 8) |\
  13. + (((floorT & 0x0007) << 5) |\
  14. + (ceilH > 2 ? 0x0500 : 0) |\
  15. ((ceilT & 0x0007) << 13))
  16. #define SFG_TILE_FLOOR_HEIGHT(tile) (tile & 0x1f)
  17. @@ -160,7 +159,12 @@ static inline SFG_TileDefinition SFG_getMapTile
  18. uint8_t tile = level->mapArray[y * SFG_MAP_SIZE + x];
  19. *properties = tile & 0xc0;
  20. - return level->tileDictionary[tile & 0x3f];
  21. +
  22. + if (*properties == SFG_TILE_PROPERTY_ELEVATOR)
  23. + *properties = SFG_TILE_PROPERTY_NORMAL;
  24. +
  25. + return level->tileDictionary[tile & 0x3f] |
  26. + (*properties == SFG_TILE_PROPERTY_DOOR ? 0x0004 : 0);
  27. }
  28. *properties = SFG_TILE_PROPERTY_NORMAL;