Permalink
Browse files

Move the PRS compression library into a separate application

  • Loading branch information...
1 parent 6579c26 commit 9adab0ea874213d321c481d2d3a296d38a5aa280 Loïc Hoguin committed Jan 4, 2012
View
Binary file not shown.
@@ -506,7 +506,7 @@ nbl_pack_files([], {AccH, AccD, AccP, _FilePos, _PtrIndex}) ->
{BinD3, CompressedDataSize} = if BinDSize < 16#800 ->
{BinD, 0};
true ->
- BinD2 = egs_prs:compress(BinD),
+ BinD2 = prs:compress(BinD),
BinD2Size = byte_size(BinD2),
{BinD2, BinD2Size}
end,
@@ -106,7 +106,7 @@ handle_call({zone_nbl, QuestID, ZoneID}, _From, State=#state{quests=QuestsCache,
{Set0, SetPtrs} = egs_files:load_set_rel(ZoneDir ++ io_lib:format("set_r~b.conf", [0]), AreaID, Maps, FilePos),
ScriptBin = egs_files:load_script_bin(ZoneDir ++ "script.es"),
ScriptBinSize = byte_size(ScriptBin),
- ScriptBin2 = egs_prs:compress(ScriptBin),
+ ScriptBin2 = prs:compress(ScriptBin),
ScriptBinSize2 = byte_size(ScriptBin2),
ScriptBin3 = << ScriptBinSize:32/little, ScriptBinSize2:32/little, 0:32, 1:32/little, 0:96, ScriptBin2/binary >>,
TextBin = egs_files:load_text_bin(ZoneDir ++ "text.bin.en_US.txt"),
File renamed without changes.
@@ -71,4 +71,4 @@ static ErlNifFunc nif_funcs[] = {
{"compress", 1, compress_nif}
};
-ERL_NIF_INIT(egs_prs, nif_funcs, load, reload, upgrade, unload)
+ERL_NIF_INIT(prs, nif_funcs, load, reload, upgrade, unload)
View
@@ -0,0 +1,11 @@
+%%-*- mode: erlang -*-
+{application, prs, [
+ {description, "PRS compression library."},
+ {vsn, "0.1.0"},
+ {modules, []},
+ {registered, []},
+ {applications, [
+ kernel,
+ stdlib
+ ]}
+]}.
@@ -17,12 +17,13 @@
%% You should have received a copy of the GNU Affero General Public License
%% along with EGS. If not, see <http://www.gnu.org/licenses/>.
--module(egs_prs).
+-module(prs).
-export([init/0, compress/1]).
-on_load(init/0).
init() ->
- erlang:load_nif("priv/egs_drv", 0).
+ PrivDir = code:priv_dir(prs),
+ erlang:load_nif(PrivDir ++ "/prs_drv", 0).
compress(_SrcBin) ->
erlang:nif_error(not_loaded).
View
@@ -1,6 +1,7 @@
{sub_dirs, [
"apps/egs",
- "apps/egs_patch"
+ "apps/egs_patch",
+ "apps/prs"
]}.
{dialyzer_opts, [src, {warnings, [
behaviours,

0 comments on commit 9adab0e

Please sign in to comment.