Skip to content

Commit

Permalink
bw compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando-A-Rocha committed Aug 1, 2024
1 parent 385725b commit dc6ca3f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
4 changes: 2 additions & 2 deletions newmodels_reborn/models/vehicle/490/-1.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
disableAutoFree
disableTextureFiltering
enableAlphaTransparency
disableTXDTextureFiltering
enableDFFAlphaTransparency
8 changes: 4 additions & 4 deletions newmodels_reborn/scripts/core/client_logic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ local function loadCustomModel(customModel, elementToApply)

local colPath, txdPath, dffPath = customInfo.col, customInfo.txd, customInfo.dff

local disableTextureFiltering = customInfo.settings.disableTextureFiltering
local disableTXDTextureFiltering = customInfo.settings.disableTXDTextureFiltering

local col, txd, dff
if colPath then
col = reusableModelElements[colPath] or engineLoadCOL(colPath)
end
if txdPath then
txd = reusableModelElements[txdPath] or engineLoadTXD(txdPath, disableTextureFiltering and false or nil)
txd = reusableModelElements[txdPath] or engineLoadTXD(txdPath, disableTXDTextureFiltering and false or nil)
end
if dffPath then
dff = reusableModelElements[dffPath] or engineLoadDFF(dffPath)
Expand All @@ -85,11 +85,11 @@ local function loadCustomModel(customModel, elementToApply)
return
end

local enableAlphaTransparency = customInfo.settings.enableAlphaTransparency
local enableDFFAlphaTransparency = customInfo.settings.enableDFFAlphaTransparency

if (col and not engineReplaceCOL(col, allocatedModel))
or (txd and not engineImportTXD(txd, allocatedModel))
or (dff and not engineReplaceModel(dff, allocatedModel, enableAlphaTransparency or nil)) then
or (dff and not engineReplaceModel(dff, allocatedModel, enableDFFAlphaTransparency or nil)) then
if col and isElement(col) then destroyElement(col) end
if txd and isElement(txd) then destroyElement(txd) end
if dff and isElement(dff) then destroyElement(dff) end
Expand Down
4 changes: 2 additions & 2 deletions newmodels_reborn/scripts/core/server_logic.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local CUSTOM_MODEL_SETTINGS = {
["disableAutoFree"] = true,
["disableTextureFiltering"] = true,
["enableAlphaTransparency"] = true,
["disableTXDTextureFiltering"] = true,
["enableDFFAlphaTransparency"] = true,
}

local function loadModels()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,22 @@ local function sendModListAllPlayers()
local id = mod.id
local baseModel = mod.base_id
local paths = mod.paths
local disableAutoFree = mod.disableAutoFree
local filteringEnabled = mod.filteringEnabled
local alphaTransparency = mod.alphaTransparency
local customSettings = {
disableAutoFree = disableAutoFree,
disableTXDTextureFiltering = filteringEnabled == false,
enableDFFAlphaTransparency = alphaTransparency == true,
}
customModels[id] = {
type = elementType,
baseModel = baseModel,
col = paths.col or nil,
txd = paths.txd or nil,
dff = paths.dff or nil,
name = mod.name,
settings = customSettings,
srcResourceName = mod.srcResourceName,
}
table.remove(modList[elementType],i)
Expand Down

0 comments on commit dc6ca3f

Please sign in to comment.