Advertisement
ghoost82

Untitled

Jun 27th, 2012
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.74 KB | None | 0 0
  1. diff -rupN SeventhSense-1.12.7/Makefile SeventhSense-1.12.7-mod/Makefile
  2. --- SeventhSense-1.12.7/Makefile 2012-03-14 22:27:58.000000000 +0100
  3. +++ SeventhSense-1.12.7-mod/Makefile 2012-06-26 11:03:47.763493361 +0200
  4. @@ -1,4 +1,3 @@
  5. -
  6. # Used to build fat versions of the programe
  7. ifneq (,$(findstring gcc-fat.sh,$(wildcard $(HOME)/projects/*.sh)))
  8. CC := $(HOME)/projects/gcc-fat.sh
  9. @@ -7,13 +6,18 @@ ifneq (,$(findstring g++-fat.sh,$(wildca
  10. CXX := $(HOME)/projects/g++-fat.sh
  11. endif
  12.  
  13. +TARGET := LoneWolf
  14. +prefix := /usr/local
  15. +exec_prefix := $(prefix)
  16. +bindir = $(exec_prefix)/bin
  17. +datarootdir := $(prefix)/share
  18. +datadir := $(datarootdir)/seventhsense
  19. +
  20. OPTIMIZE := -O2
  21. -CFLAGS := $(OPTIMIZE) -I/usr/local/include $(shell sdl-config --cflags) -D__EXPORT__=extern
  22. +CFLAGS := $(OPTIMIZE) -I/usr/local/include $(shell sdl-config --cflags) -D__EXPORT__=extern -DDATADIR='"$(datadir)/"'
  23. CXXFLAGS := $(CFLAGS)
  24. LIBS := $(shell sdl-config --libs) -lSDL_image -lSDL_ttf -lphysfs -lcurl
  25.  
  26. -TARGET := LoneWolf
  27. -
  28. SOURCES := \
  29. src/action_chart.cpp \
  30. src/award.cpp \
  31. @@ -82,6 +86,16 @@ $(TARGET).dmg: $(TARGET).app
  32. hdiutil create -fs HFS+ -srcfolder tmp -volname "Seventh Sense" $@
  33. $(RM) -r tmp
  34.  
  35. +debug: CXXFLAGS += -D_DEBUG
  36. +debug: $(TARGET)
  37. +
  38. +EDITOR: CXXFLAGS += -DEDITOR
  39. +EDITOR: $(TARGET)
  40. +
  41. +STANDALONE: CXXFLAGS += -DSTANDALONE
  42. +STANDALONE: $(TARGET)
  43. + tar -czf $(TARGET).tar.gz $(TARGET) data
  44. +
  45. clean:
  46. $(RM) $(OBJECTS)
  47.  
  48. @@ -91,7 +105,20 @@ distclean: clean
  49. $(RM) data/books/*/covers/*
  50. $(RM) data/profiles/*.*
  51. $(RM) settings.txt
  52. - $(RM) -r LoneWolf.app
  53. - $(RM) LoneWolf.dmg
  54. + $(RM) -r $(TARGET).app
  55. + $(RM) $(TARGET).dmg
  56. + $(RM) $(TARGET).tar.gz
  57.  
  58. dist: distclean
  59. +
  60. +install:
  61. + install -m 0755 $(TARGET) $(bindir)
  62. + install -d $(datadir)
  63. + cp -r data $(datadir)
  64. + find $(datadir) -type d -exec chmod 755 {} \;
  65. + find $(datadir) -type f -exec chmod 644 {} \;
  66. +
  67. +
  68. +uninstall:
  69. + rm -rf $(bindir)/$(TARGET)
  70. + rm -rf $(datadir)
  71. diff -rupN SeventhSense-1.12.7/src/loader.cpp SeventhSense-1.12.7-mod/src/loader.cpp
  72. --- SeventhSense-1.12.7/src/loader.cpp 2012-01-20 22:07:48.000000000 +0100
  73. +++ SeventhSense-1.12.7-mod/src/loader.cpp 2012-06-26 11:05:36.383498674 +0200
  74. @@ -86,7 +86,16 @@ bool LOADER::start_PHYSFS(GAME * game, c
  75. basedir = basedir.substr(0, basedir.rfind("MacOS")) + "Resources/";
  76. } else
  77. #endif
  78. +#ifdef __linux__
  79. + basedir = DATADIR;
  80. +#else
  81. basedir = PHYSFS_getBaseDir();
  82. +#endif
  83. +
  84. +#ifdef STANDALONE
  85. + basedir = PHYSFS_getBaseDir(); //keep it local to install folder!
  86. +#endif
  87. +
  88. if (game->diag)
  89. printf("Base Directory: %s\n",basedir.c_str());
  90.  
  91. @@ -101,7 +110,11 @@ bool LOADER::start_PHYSFS(GAME * game, c
  92. return false;
  93. }
  94. writedir = PHYSFS_getUserDir();
  95. - writedir += "Documents/Seventh Sense/";
  96. +#ifdef __linux__
  97. + writedir += ".seventhsense/";
  98. +#else
  99. + writedir += "Documents/Seventh Sense/";
  100. +#endif
  101. {
  102. if (!PHYSFS_addToSearchPath(writedir.c_str(),1))
  103. printf("Unable to add write folder to PHYSFS search path.\n"
  104. @@ -114,12 +127,20 @@ bool LOADER::start_PHYSFS(GAME * game, c
  105. writedir = basedir; //keep it local to install folder!
  106. #else
  107. writedir = PHYSFS_getUserDir();
  108. +#ifdef __linux__
  109. + writedir += ".seventhsense/";
  110. +#else
  111. writedir += "Documents/Seventh Sense/";
  112. #endif
  113. +#endif
  114.  
  115. if (!PHYSFS_setWriteDir(writedir.c_str()) &&
  116. (!PHYSFS_setWriteDir(PHYSFS_getUserDir()) ||
  117. +#ifdef __linux__
  118. + !PHYSFS_mkdir(".seventhsense/") ||
  119. +#else
  120. !PHYSFS_mkdir("Documents/Seventh Sense/") ||
  121. +#endif
  122. !PHYSFS_setWriteDir(writedir.c_str())))
  123. {
  124. printf("Unable to establish writing privileges for the file system.\n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement