Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 854567 | Differences between
and this patch

Collapse All | Expand All

(-)a/CMakeLists.txt (-1 / +1 lines)
Lines 961-967 Link Here
961
    ${ADDITIONAL_ENGINE_SRCS}
961
    ${ADDITIONAL_ENGINE_SRCS}
962
    ${ZLIB_SRCS}
962
    ${ZLIB_SRCS}
963
)
963
)
964
set(ENGINELIB "Engine${DEBUGSUFFIX}")
964
set(ENGINELIB "Engine${MP}${DEBUGSUFFIX}")
965
add_library(${ENGINELIB} SHARED
965
add_library(${ENGINELIB} SHARED
966
     ${ENGINE_SRCS}
966
     ${ENGINE_SRCS}
967
)
967
)
(-)a/Engine/Base/Stream.cpp (+5 lines)
Lines 1619-1624 Link Here
1619
    }
1619
    }
1620
  }
1620
  }
1621
1621
1622
  if( _pShell->GetINDEX("sys_iSysPath") == 1 && fnmFileAbsolute.FileExt()==".so" ) {
1623
    _fnmApplicationPathTMP = _fnmModLibPath;
1624
    fnmFileAbsolute = fnmFileAbsolute.FileName() + fnmFileAbsolute.FileExt();
1625
  }
1626
1622
//#######################################################################################################################
1627
//#######################################################################################################################
1623
1628
1624
  // if writing
1629
  // if writing
(-)a/Engine/Base/Unix/UnixDynamicLoader.cpp (-1 / +8 lines)
Lines 67-73 Link Here
67
    #ifdef PLATFORM_FREEBSD
67
    #ifdef PLATFORM_FREEBSD
68
    dlerror(); // need for clean Undefined symbol "_nss_cache_cycle_prevention_function" message
68
    dlerror(); // need for clean Undefined symbol "_nss_cache_cycle_prevention_function" message
69
    #endif
69
    #endif
70
    module = ::dlopen(lib, RTLD_LAZY | RTLD_GLOBAL);
70
71
    CTFileName fnmLib = CTString(lib);
72
    CTFileName fnmLibname = fnmLib.FileName();
73
    int _libvorbisfile   = strncmp((const char *)fnmLibname, (const char *) "libvorbisfile", (size_t) 13 ); // skip
74
    if( _pShell->GetINDEX("sys_iSysPath") == 1 && _libvorbisfile !=0 ) {
75
        fnmLib = _fnmModLibPath + _fnmMod + fnmLib.FileName() + fnmLib.FileExt();
76
    }
77
    module = ::dlopen((const char *)fnmLib, RTLD_LAZY | RTLD_GLOBAL);
71
    SetError();
78
    SetError();
72
}
79
}
73
80
(-)a/Engine/Engine.cpp (-2 / +41 lines)
Lines 47-52 Link Here
47
47
48
#if PLATFORM_UNIX
48
#if PLATFORM_UNIX
49
#include "SDL.h"
49
#include "SDL.h"
50
#include <limits.h>
50
#endif
51
#endif
51
52
52
// this version string can be referenced from outside the engine
53
// this version string can be referenced from outside the engine
Lines 57-62 Link Here
57
ENGINE_API BOOL _bDedicatedServer = FALSE;
58
ENGINE_API BOOL _bDedicatedServer = FALSE;
58
ENGINE_API BOOL _bWorldEditorApp  = FALSE;
59
ENGINE_API BOOL _bWorldEditorApp  = FALSE;
59
ENGINE_API CTString _strLogFile = "";
60
ENGINE_API CTString _strLogFile = "";
61
ENGINE_API CTFileName _fnmModLibPath;
60
62
61
// global handle for application windows
63
// global handle for application windows
62
// !!! FIXME rcg10072001 this needs to be abstracted.
64
// !!! FIXME rcg10072001 this needs to be abstracted.
Lines 103-108 Link Here
103
static CTString sys_strModName = "";
105
static CTString sys_strModName = "";
104
static CTString sys_strModExt  = "";
106
static CTString sys_strModExt  = "";
105
107
108
// Path vars
109
static INDEX sys_iGameBits = 0;
110
ENGINE_API INDEX sys_iSysPath = 0;
111
106
// enables paranoia checks for allocation array
112
// enables paranoia checks for allocation array
107
BOOL _bAllocationArrayParanoiaCheck = FALSE;
113
BOOL _bAllocationArrayParanoiaCheck = FALSE;
108
114
Lines 594-602 Link Here
594
  CPrintF(TRANSV("--- Serious Engine Startup ---\n"));
600
  CPrintF(TRANSV("--- Serious Engine Startup ---\n"));
595
  CPrintF("  %s\n\n", (const char *) _strEngineBuild);
601
  CPrintF("  %s\n\n", (const char *) _strEngineBuild);
596
602
603
  // Path vars
604
  sys_iGameBits  = (int)(CHAR_BIT * sizeof(void *));
605
  CPrintF(TRANSV("Running %d version\n"), sys_iGameBits);
606
607
  int _isystempath = strncmp((const char *)strExePath, (const char *) "/usr/bin/", (size_t) 9 );
608
  if( _isystempath == 0 ) {
609
       sys_iSysPath = 1; // using system path
610
  } else {
611
       sys_iSysPath = 0; // using standarted path
612
  }
613
614
  // get library path for mods
615
  _fnmModLibPath = "";
616
  if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/x86_64-linux-gnu")) {
617
    _fnmModLibPath = "/usr/lib/x86_64-linux-gnu/" + strGameID + "/"; 
618
  } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/usr/lib/i386-linux-gnu")) {
619
    _fnmModLibPath = "/usr/lib/i386-linux-gnu/" + strGameID + "/";
620
  } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib64")) {
621
    _fnmModLibPath = "/usr/lib64/" + strGameID + "/";
622
  } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/usr/lib")) {
623
    _fnmModLibPath = "/usr/lib/" + strGameID + "/";
624
  } else {
625
    _fnmModLibPath = _fnmApplicationPath;
626
  }
627
628
  if( sys_iSysPath == 1 ) {
629
    _fnmApplicationPath = "/usr/share/" + strGameID + "/"; // all game data
630
  }
631
597
  // print info on the started application
632
  // print info on the started application
598
  CPrintF(TRANSV("Executable: %s\n"), strExePath);
633
  CPrintF(TRANSV("Executable: %s\n"), (const char *) strExePath);
599
  CPrintF(TRANSV("Assumed engine directory: %s\n"), (const char *) _fnmApplicationPath);
634
  CPrintF(TRANSV("Assumed engine data directory: %s\n"), (const char *) _fnmApplicationPath);
635
  CPrintF(TRANSV("Assumed mods library directory: %s\n"), (const char *) _fnmModLibPath);
600
636
601
  CPrintF("\n");
637
  CPrintF("\n");
602
638
Lines 661-666 Link Here
661
  // MOD info
697
  // MOD info
662
  _pShell->DeclareSymbol("user const CTString sys_strModName;", (void *) &sys_strModName);
698
  _pShell->DeclareSymbol("user const CTString sys_strModName;", (void *) &sys_strModName);
663
  _pShell->DeclareSymbol("user const CTString sys_strModExt;",  (void *) &sys_strModExt);
699
  _pShell->DeclareSymbol("user const CTString sys_strModExt;",  (void *) &sys_strModExt);
700
  // Path vars
701
  _pShell->DeclareSymbol("user const INDEX sys_iGameBits    ;", (void *) &sys_iGameBits);
702
  _pShell->DeclareSymbol("user const INDEX sys_iSysPath    ;", (void *) &sys_iSysPath);
664
703
665
  // Stock clearing
704
  // Stock clearing
666
  extern void FreeUnusedStock(void);
705
  extern void FreeUnusedStock(void);
(-)a/Engine/Engine.h (+2 lines)
Lines 168-173 Link Here
168
ENGINE_API extern BOOL _bDedicatedServer;
168
ENGINE_API extern BOOL _bDedicatedServer;
169
ENGINE_API extern BOOL _bWorldEditorApp; // is this world editor app
169
ENGINE_API extern BOOL _bWorldEditorApp; // is this world editor app
170
ENGINE_API extern CTString _strLogFile;
170
ENGINE_API extern CTString _strLogFile;
171
ENGINE_API extern CTFileName _fnmModLibPath;
172
ENGINE_API extern INDEX sys_iSysPath;
171
173
172
// temporary vars for adjustments
174
// temporary vars for adjustments
173
ENGINE_API extern FLOAT tmp_af[10];
175
ENGINE_API extern FLOAT tmp_af[10];
(-)a/SeriousSam/SeriousSam.cpp (-3 / +12 lines)
Lines 138-144 Link Here
138
extern CTFileName _fnmModToLoad = CTString("");
138
extern CTFileName _fnmModToLoad = CTString("");
139
extern CTString _strModServerJoin = CTString("");
139
extern CTString _strModServerJoin = CTString("");
140
extern CTString _strURLToVisit = CTString("");
140
extern CTString _strURLToVisit = CTString("");
141
141
static char _strExePath[MAX_PATH] = "";
142
ENGINE_API extern INDEX sys_iSysPath;
142
143
143
// state variables fo addon execution
144
// state variables fo addon execution
144
// 0 - nothing
145
// 0 - nothing
Lines 489-494 Link Here
489
  }
490
  }
490
  // init game - this will load persistent symbols
491
  // init game - this will load persistent symbols
491
  _pGame->Initialize(CTString("Data\\SeriousSam.gms"));
492
  _pGame->Initialize(CTString("Data\\SeriousSam.gms"));
493
  // save executable path and sys var.
494
  _pFileSystem->GetExecutablePath(_strExePath, sizeof (_strExePath)-1);
495
  _pFileSystem->GetExecutablePath(_strExePath, sizeof (_strExePath)-1);
492
}
496
}
493
497
494
#ifdef PLATFORM_UNIX
498
#ifdef PLATFORM_UNIX
Lines 1475-1482 Link Here
1475
    CTString strCommand = "SeriousSam.exe"
1479
    CTString strCommand = "SeriousSam.exe"
1476
    CTString strPatch = _fnmApplicationPath+"Bin\\"+strDebug+strCommand;
1480
    CTString strPatch = _fnmApplicationPath+"Bin\\"+strDebug+strCommand;
1477
#else
1481
#else
1478
    CTString strCommand = "SeriousSam";
1482
    CTString strCommand;
1479
    CTString strPatch = _fnmApplicationPath+"Bin/"+strDebug+strCommand;
1483
    if (sys_iSysPath == 1) {
1484
      strCommand = sam_strGameName;
1485
    } else {
1486
      strCommand = "SeriousSam";
1487
    }
1488
    CTString strPatch = CTString(_strExePath) + strDebug + strCommand;
1480
#endif
1489
#endif
1481
    //+mod "+_fnmModToLoad.FileName()+"\"";
1490
    //+mod "+_fnmModToLoad.FileName()+"\"";
1482
    CTString strMod = _fnmModToLoad.FileName();
1491
    CTString strMod = _fnmModToLoad.FileName();

Return to bug 854567