patch-src_seg009_c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. $OpenBSD: patch-src_seg009_c,v 1.1.1.1 2016/11/03 17:30:32 robert Exp $
  2. --- src/seg009.c.orig Thu Nov 3 18:07:22 2016
  3. +++ src/seg009.c Thu Nov 3 18:14:31 2016
  4. @@ -152,7 +152,7 @@ static FILE* open_dat_from_root_or_data_dir(const char
  5. // if failed, try if the DAT file can be opened in the data/ directory, instead of the main folder
  6. if (fp == NULL) {
  7. char data_path[POP_MAX_PATH];
  8. - snprintf(data_path, sizeof(data_path), "data/%s", filename);
  9. + snprintf(data_path, sizeof(data_path), "${PREFIX}/share/sdlpop/data/%s", filename);
  10. // verify that this is a regular file and not a directory (otherwise, don't open)
  11. struct stat path_stat;
  12. @@ -1634,7 +1634,7 @@ const int max_sound_id = 58;
  13. char** sound_names = NULL;
  14. void load_sound_names() {
  15. - const char* names_path = "data/music/names.txt";
  16. + const char* names_path = "${PREFIX}/share/sdlpop/data/music/names.txt";
  17. if (sound_names != NULL) return;
  18. FILE* fp = fopen(names_path,"rt");
  19. if (fp==NULL) return;
  20. @@ -1682,7 +1682,7 @@ sound_buffer_type* load_sound(int index) {
  21. const char* ext=exts[i];
  22. struct stat info;
  23. - snprintf(filename, sizeof(filename), "data/music/%s.%s", sound_name(index), ext);
  24. + snprintf(filename, sizeof(filename), "${PREFIX}/share/sdlpop/data/music/%s.%s", sound_name(index), ext);
  25. // Skip nonexistent files:
  26. if (stat(filename, &info))
  27. continue;
  28. @@ -2079,7 +2079,7 @@ void load_from_opendats_metadata(int resource_id, cons
  29. if (len >= 5 && filename_no_ext[len-4] == '.') {
  30. filename_no_ext[len-4] = '\0'; // terminate, so ".DAT" is deleted from the filename
  31. }
  32. - snprintf(image_filename,sizeof(image_filename),"data/%s/res%d.%s",filename_no_ext, resource_id, extension);
  33. + snprintf(image_filename,sizeof(image_filename),"${PREFIX}/share/sdlpop/data/%s/res%d.%s",filename_no_ext, resource_id, extension);
  34. if (!use_custom_levelset) {
  35. //printf("loading (binary) %s",image_filename);
  36. fp = fopen(image_filename, "rb");