mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
Compare commits
94 commits
main
...
v0.28.0-rc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
30b741f8ba | ||
|
|
2da2c3394f | ||
|
|
f578a5b34d | ||
|
|
8fee4dbb76 | ||
|
|
baa18fd57d | ||
|
|
231750edf1 | ||
|
|
0d1cdc0eaa | ||
|
|
63d4513ebf | ||
|
|
a1cb3055d9 | ||
|
|
7fd034a2c0 | ||
|
|
0f21853bd8 | ||
|
|
b7fe462045 | ||
|
|
bf0034f694 | ||
|
|
b228b611de | ||
|
|
72b56d9fe5 | ||
|
|
fb12d00c70 | ||
|
|
1690efeb72 | ||
|
|
5c8cf9a470 | ||
|
|
d9ae2f8503 | ||
|
|
b71cd96d12 | ||
|
|
d93722a023 | ||
|
|
7d2647d59a | ||
|
|
1dff943455 | ||
|
|
ce7a180e73 | ||
|
|
ca1ad508a4 | ||
|
|
6d531e0303 | ||
|
|
e6e5d61b22 | ||
|
|
7386a5d514 | ||
|
|
4140858066 | ||
|
|
cc56bafc66 | ||
|
|
10408b46c2 | ||
|
|
e2764dcee1 | ||
|
|
5c333770ee | ||
|
|
3cba40b5c8 | ||
|
|
2b85f5abf6 | ||
|
|
a6403f27d5 | ||
|
|
d90f4400ed | ||
|
|
7575a04305 | ||
|
|
3e8f296c72 | ||
|
|
1087e020d1 | ||
|
|
e961288e89 | ||
|
|
7ec2d3f0e0 | ||
|
|
97eca26d58 | ||
|
|
2e4caf5d19 | ||
|
|
490434948d | ||
|
|
6a55830f1f | ||
|
|
bf314cbb4c | ||
|
|
d3406f4509 | ||
|
|
adb6a05ae7 | ||
|
|
e590a7cd4e | ||
|
|
8420377789 | ||
|
|
fbc1b160e1 | ||
|
|
e07aba6d37 | ||
|
|
2de2084b5b | ||
|
|
526deb30f0 | ||
|
|
1e1db43854 | ||
|
|
b08f2d1d33 | ||
|
|
d4736962ab | ||
|
|
68a7d8a03a | ||
|
|
c0d569162b | ||
|
|
6043ab248b | ||
|
|
6958a5edd0 | ||
|
|
86bcb03f6e | ||
|
|
f6a6c19132 | ||
|
|
76337efe76 | ||
|
|
93fecf3720 | ||
|
|
df8b313a74 | ||
|
|
e65e031344 | ||
|
|
83832545ae | ||
|
|
0b7323c096 | ||
|
|
d503ae6da6 | ||
|
|
48b9be5bb6 | ||
|
|
a7f6171063 | ||
|
|
8f4750db15 | ||
|
|
39a5a680d2 | ||
|
|
61af0a0c26 | ||
|
|
53c806c0c4 | ||
|
|
b5bf9fd3e2 | ||
|
|
7a72578517 | ||
|
|
1db46eaf9b | ||
|
|
819a875fcc | ||
|
|
1b50d731fc | ||
|
|
621aa9d7a9 | ||
|
|
6a6712799c | ||
|
|
a7f0678dad | ||
|
|
4fca5ed21c | ||
|
|
abc83a7dfb | ||
|
|
52e6d08e79 | ||
|
|
46e9585bce | ||
|
|
8d05176032 | ||
|
|
41dac8bb20 | ||
|
|
9dee4e4617 | ||
|
|
981b3b898e | ||
|
|
d3239591b8 |
2314 changed files with 31553 additions and 26191 deletions
|
|
@ -28,9 +28,9 @@ source/tools/spirv/.* @vladislavbelov
|
|||
|
||||
## == Scripts
|
||||
## GUI
|
||||
binaries/data/mods/public/gui/.* @Vantha @wraitii
|
||||
binaries/data/mods/public/gui/.* @Phosit @wraitii
|
||||
## AI
|
||||
binaries/data/mods/public/simulation/ai/.* @Phosit
|
||||
#binaries/data/mods/public/simulation/ai/.*
|
||||
## Balancing
|
||||
binaries/data/mods/public/simulation/(data|templates)/.* @real_tabasco_sauce
|
||||
|
||||
|
|
|
|||
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -14,7 +14,6 @@ libraries/macos
|
|||
libraries/win32
|
||||
libraries/win64
|
||||
|
||||
libraries/source/cpp-httplib/*
|
||||
libraries/source/cxxtest-4.4/*
|
||||
libraries/source/fcollada/*
|
||||
libraries/source/nvtt/*
|
||||
|
|
@ -29,7 +28,7 @@ libraries/source/spirv-reflect/*
|
|||
appimage-build/
|
||||
archives/
|
||||
build/bin/
|
||||
source/tools/spirv/rules.json
|
||||
source/tools/spirv/rules.*.json
|
||||
|
||||
# Linting
|
||||
cppcheck-error.log
|
||||
|
|
|
|||
|
|
@ -83,12 +83,13 @@ repos:
|
|||
args:
|
||||
- --strict
|
||||
- repo: https://github.com/eslint/eslint
|
||||
rev: v9.39.2
|
||||
rev: v9.33.0
|
||||
hooks:
|
||||
- id: eslint
|
||||
language_version: 22.14.0
|
||||
additional_dependencies:
|
||||
- "@stylistic/eslint-plugin@5.6.1"
|
||||
- eslint-plugin-brace-rules@0.1.6
|
||||
- "@stylistic/eslint-plugin@4.4.0"
|
||||
args:
|
||||
- --max-warnings=0
|
||||
- --no-warn-ignored
|
||||
|
|
|
|||
|
|
@ -81,6 +81,9 @@ please inform Wildfire Games at webmaster at wildfiregames dot com.
|
|||
- source/third_party/mikktspace/
|
||||
- zlib
|
||||
|
||||
- source/third_party/mongoose/
|
||||
- MIT - see license_mit.txt
|
||||
|
||||
- source/third_party/tinygettext/
|
||||
- zlib
|
||||
|
||||
|
|
|
|||
|
|
@ -160,15 +160,6 @@ textures.maxanisotropy = 2
|
|||
; GPU skinning via compute shaders, requires up-to-date drivers
|
||||
gpuskinning = true
|
||||
|
||||
; Currently experimental feature to transit to PBR pipelines.
|
||||
pbr = false
|
||||
; We might want to render to different texture formats depending on quality and
|
||||
; performance we need. We support: r11g11b10, rgba16, rgba32.
|
||||
pbr.framebufferformat = "rgba16"
|
||||
|
||||
; Adjust exposure of the scene.
|
||||
pbr.brightness = "0.5"
|
||||
|
||||
; Use smooth LOS interpolation
|
||||
smoothlos = true
|
||||
|
||||
|
|
@ -225,19 +216,13 @@ togglefullscreen = "Alt+Return" ; Toggle fullscreen/windowed mode
|
|||
screenshot.watermark = "Alt+K" ; Toggle product/company watermark for official screenshots
|
||||
wireframe = "Alt+Shift+W" ; Toggle wireframe mode
|
||||
silhouettes = "Alt+Shift+S" ; Toggle unit silhouettes
|
||||
mousegrabtoggle = F3 ; Toggle mouse grabbing mode
|
||||
mousegrabtoggle = "Ctrl+Alt" ; Toggle mouse grabbing mode
|
||||
|
||||
; > DIALOG HOTKEYS
|
||||
summary = "Ctrl+Tab" ; Toggle in-game summary
|
||||
lobby = "Alt+L" ; Show the multiplayer lobby in a dialog window.
|
||||
structree = "Alt+Shift+T" ; Show structure tree
|
||||
civinfo = "Alt+Shift+H" ; Show civilization info
|
||||
catafalque = "Alt+Shift+F" ; Show catafalque overview
|
||||
mapbrowser = "Alt+Shift+M" ; Show map browser
|
||||
manual = "Alt+Shift+U" ; Show manual
|
||||
tips = "Alt+Shift+I" ; Show tips and tricks
|
||||
options = "Alt+Shift+O" ; Show options
|
||||
hotkeys = "Alt+Shift+Y" ; Show hotkeys
|
||||
|
||||
; > CLIPBOARD CONTROLS
|
||||
copy = "Ctrl+C" ; Copy to clipboard
|
||||
|
|
@ -245,7 +230,7 @@ paste = "Ctrl+V" ; Paste from clipboard
|
|||
cut = "Ctrl+X" ; Cut selected text and copy to the clipboard
|
||||
|
||||
; > CONSOLE SETTINGS
|
||||
console.toggle = F9 ; Open/close console
|
||||
console.toggle = BackQuote, F9 ; Open/close console
|
||||
|
||||
; > OVERLAY KEYS
|
||||
fps.toggle = "Alt+F" ; Toggle frame counter
|
||||
|
|
@ -266,8 +251,8 @@ quickload = "Shift+F8"
|
|||
reset = "R" ; Reset camera rotation to default.
|
||||
follow = "" ; Follow the first unit in the selection
|
||||
rallypointfocus = "" ; Focus the camera on the rally point of the selected building
|
||||
lastattackfocus = BackQuote ; Focus the camera on the last notified attack
|
||||
togglebirdseyeview = "Shift+Tab" ; Toggle bird's eye view
|
||||
lastattackfocus = "Space" ; Focus the camera on the last notified attack
|
||||
togglebirdseyeview = "" ; Toggle bird's eye view
|
||||
zoom.in = Plus, NumPlus ; Zoom camera in (continuous control)
|
||||
zoom.out = Minus, NumMinus ; Zoom camera out (continuous control)
|
||||
zoom.wheel.in = WheelUp ; Zoom camera in (stepped control)
|
||||
|
|
@ -283,12 +268,12 @@ left = A, LeftArrow ; Scroll or rotate left
|
|||
right = D, RightArrow ; Scroll or rotate right
|
||||
up = W, UpArrow ; Scroll or rotate up/forwards
|
||||
down = S, DownArrow ; Scroll or rotate down/backwards
|
||||
scroll.speed.increase = "Ctrl+Plus" ; Increase scroll speed
|
||||
scroll.speed.decrease = "Ctrl+Minus" ; Decrease scroll speed
|
||||
rotate.speed.increase = "Alt+Plus" ; Increase rotation speed
|
||||
rotate.speed.decrease = "Alt+Minus" ; Decrease rotation speed
|
||||
zoom.speed.increase = "Shift+Plus" ; Increase zoom speed
|
||||
zoom.speed.decrease = "Shift+Minus" ; Decrease zoom speed
|
||||
scroll.speed.increase = "Ctrl+Shift+S" ; Increase scroll speed
|
||||
scroll.speed.decrease = "Ctrl+Alt+S" ; Decrease scroll speed
|
||||
rotate.speed.increase = "Ctrl+Shift+R" ; Increase rotation speed
|
||||
rotate.speed.decrease = "Ctrl+Alt+R" ; Decrease rotation speed
|
||||
zoom.speed.increase = "Ctrl+Shift+Z" ; Increase zoom speed
|
||||
zoom.speed.decrease = "Ctrl+Alt+Z" ; Decrease zoom speed
|
||||
|
||||
[hotkey.camera.jump]
|
||||
1 = F5 ; Jump to position N
|
||||
|
|
@ -333,12 +318,6 @@ idlewarrior = Slash, NumDivide ; Select next idle warrior
|
|||
idleunit = BackSlash ; Select next idle unit
|
||||
offscreen = Alt ; Include offscreen units in selection
|
||||
singleselection = "" ; Modifier to select units individually, opposed to per formation.
|
||||
; Select all units of specific class
|
||||
[hotkey.selection.unit]
|
||||
cavalry = Alt+E
|
||||
infantry = Alt+X
|
||||
civilian = Alt+A
|
||||
hero = Alt+Z
|
||||
[hotkey.selection.group.add]
|
||||
1 = "Shift+1", "Shift+Num1"
|
||||
2 = "Shift+2", "Shift+Num2"
|
||||
|
|
@ -372,27 +351,9 @@ hero = Alt+Z
|
|||
8 = 8, Num8
|
||||
9 = 9, Num9
|
||||
10 = 0, Num0
|
||||
[hotkey.selection.structures]
|
||||
barracks = "Ctrl+X"
|
||||
stable = "Ctrl+Z"
|
||||
civil_centre = "Ctrl+C"
|
||||
|
||||
[hotkey.structures.place]
|
||||
house = "Space+H"
|
||||
storehouse = "Space+S"
|
||||
farmstead = "Space+G"
|
||||
field = "Space+F"
|
||||
corral = "Space+J"
|
||||
barracks = "Space+B"
|
||||
stable = "Space+V"
|
||||
temple = "Space+T"
|
||||
arsenal = "Space+A"
|
||||
fortress = "Space+F"
|
||||
forge = "Space+K"
|
||||
sentry_tower = "Space+Q"
|
||||
defense_tower = "Space+W"
|
||||
market = "Space+M"
|
||||
dock = "Space+D"
|
||||
[hotkey.gamesetup]
|
||||
mapbrowser.open = "M"
|
||||
|
||||
[hotkey.session]
|
||||
kill = Delete, Backspace ; Destroy selected units
|
||||
|
|
@ -431,14 +392,14 @@ flareactivate = "" ; Modifier to activate the mode to send a flare to
|
|||
calltoarms = "" ; Modifier to call the selected units to the arms.
|
||||
focusfire = "F" ; Modifier to control exclusively a building's arrows if it can attack
|
||||
; Overlays
|
||||
showstatusbars = "" ; Toggle display of status bars
|
||||
devcommands.toggle = "Shift+F9" ; Toggle developer commands panel
|
||||
highlightguarding = PageDown ; Toggle highlight of guarding units
|
||||
highlightguarded = PageUp ; Toggle highlight of guarded units
|
||||
diplomacycolors = "Alt+V" ; Toggle diplomacy colors
|
||||
toggleattackrange = "" ; Toggle display of attack range overlays of selected defensive structures
|
||||
toggleaurasrange = "" ; Toggle display of aura range overlays of selected units and structures
|
||||
togglehealrange = "" ; Toggle display of heal range overlays of selected units
|
||||
showstatusbars = Tab ; Toggle display of status bars
|
||||
devcommands.toggle = "Alt+D" ; Toggle developer commands panel
|
||||
highlightguarding = PageDown ; Toggle highlight of guarding units
|
||||
highlightguarded = PageUp ; Toggle highlight of guarded units
|
||||
diplomacycolors = "Alt+X" ; Toggle diplomacy colors
|
||||
toggleattackrange = "Alt+C" ; Toggle display of attack range overlays of selected defensive structures
|
||||
toggleaurasrange = "Alt+V" ; Toggle display of aura range overlays of selected units and structures
|
||||
togglehealrange = "Alt+B" ; Toggle display of heal range overlays of selected units
|
||||
|
||||
[hotkey.session.gui]
|
||||
toggle = "Alt+G" ; Toggle visibility of session GUI
|
||||
|
|
@ -555,7 +516,7 @@ extended = true ; Whether to display the chat history
|
|||
|
||||
[lobby]
|
||||
history = 0 ; Number of past messages to display on join
|
||||
room = "arena29" ; Default MUC room to join
|
||||
room = "arena28" ; Default MUC room to join
|
||||
server = "lobby.wildfiregames.com" ; Address of lobby server
|
||||
tls = true ; Whether to use TLS encryption when connecting to the server.
|
||||
verify_certificate = true ; Whether to reject connecting to the lobby if the TLS certificate is invalid
|
||||
|
|
@ -563,8 +524,8 @@ terms_url = "https://gitea.wildfiregames.com/0ad/0ad/src/branch/main/binaries/da
|
|||
terms_of_service = "0" ; Version (hash) of the Terms of Service that the user has accepted
|
||||
terms_of_use = "0" ; Version (hash) of the Terms of Use that the user has accepted
|
||||
privacy_policy = "0" ; Version (hash) of the Privacy Policy that the user has accepted
|
||||
xpartamupp = "wfgbot29" ; Name of the server-side XMPP-account that manage games
|
||||
echelon = "echelon29" ; Name of the server-side XMPP-account that manages ratings
|
||||
xpartamupp = "wfgbot28" ; Name of the server-side XMPP-account that manage games
|
||||
echelon = "echelon28" ; Name of the server-side XMPP-account that manages ratings
|
||||
buddies = "," ; Comma separated list of playernames that the current user has marked as buddies
|
||||
rememberpassword = true ; Whether to store the encrypted password in the user config
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<objects>
|
||||
<script file="gui/OpenRequest/Continuation/Script.js"/>
|
||||
</objects>
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<page>
|
||||
<include>OpenRequest/Continuation/Object.xml</include>
|
||||
</page>
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
async function init(arg)
|
||||
{
|
||||
return arg + " Continuation";
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<objects>
|
||||
<script file="gui/OpenRequest/Entry/Script.js"/>
|
||||
</objects>
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<page>
|
||||
<include>OpenRequest/Entry/Object.xml</include>
|
||||
</page>
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
async function init()
|
||||
{
|
||||
return { [Engine.openRequest]: {
|
||||
"page": "OpenRequest/Continuation/Page.xml",
|
||||
"argument": "Entry"
|
||||
} };
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<objects>
|
||||
<script file="gui/OpenRequest/Root/Script.js"/>
|
||||
</objects>
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<page>
|
||||
<include>OpenRequest/Root/Object.xml</include>
|
||||
</page>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
async function init()
|
||||
{
|
||||
const result = await Engine.OpenChildPage("OpenRequest/Entry/Page.xml");
|
||||
|
||||
await new Promise(closePageCallback =>
|
||||
{
|
||||
globalThis.closePageCallback = () =>
|
||||
{
|
||||
closePageCallback();
|
||||
return result;
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
@ -6,8 +6,7 @@ var obj1 = Engine.GetGUIObjectByName("obj1");
|
|||
var obj3 = Engine.GetGUIObjectByName("obj3");
|
||||
|
||||
obj1.onTick = () => { ++called1; };
|
||||
Engine.GetGUIObjectByName("obj2").onTick = () =>
|
||||
{
|
||||
Engine.GetGUIObjectByName("obj2").onTick = () => {
|
||||
++called2;
|
||||
delete obj1.onTick;
|
||||
delete obj3.onTick;
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
testObject.getComputedSize();
|
||||
|
|
@ -2,7 +2,7 @@ try
|
|||
{
|
||||
Engine.callback();
|
||||
}
|
||||
catch(e)
|
||||
catch (e)
|
||||
{
|
||||
log(e.message);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ async function waitAndIncrement(promise)
|
|||
|
||||
{
|
||||
let resolve;
|
||||
const promise = new Promise(res =>
|
||||
{
|
||||
const promise = new Promise(res => {
|
||||
incrementTest();
|
||||
resolve = res;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,13 +2,11 @@ function TestScript2A() {}
|
|||
|
||||
TestScript2A.prototype.Schema = "<ref name='anything'/>";
|
||||
|
||||
TestScript2A.prototype.Init = function()
|
||||
{
|
||||
TestScript2A.prototype.Init = function() {
|
||||
this.x = eval(this.template.y);
|
||||
};
|
||||
|
||||
TestScript2A.prototype.GetX = function()
|
||||
{
|
||||
TestScript2A.prototype.GetX = function() {
|
||||
return this.x;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,20 +1,15 @@
|
|||
function TestScript1A() {}
|
||||
|
||||
TestScript1A.prototype.GetX = function()
|
||||
{
|
||||
TestScript1A.prototype.GetX = function() {
|
||||
// Test that .entity is readonly
|
||||
try
|
||||
{
|
||||
try {
|
||||
delete this.entity;
|
||||
Engine.TS_FAIL("Missed exception");
|
||||
}
|
||||
catch(e) { /* noop */ }
|
||||
try
|
||||
{
|
||||
} catch (e) { /* noop */ }
|
||||
try {
|
||||
this.entity = -1;
|
||||
Engine.TS_FAIL("Missed exception");
|
||||
}
|
||||
catch(e) { /* noop */ }
|
||||
} catch (e) { /* noop */ }
|
||||
|
||||
// and return the value
|
||||
return this.entity;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
function TestScript1_Helper() {}
|
||||
|
||||
TestScript1_Helper.prototype.GetX = function()
|
||||
{
|
||||
TestScript1_Helper.prototype.GetX = function() {
|
||||
return AdditionHelper(1, 2);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,11 @@ function HotloadA() {}
|
|||
|
||||
HotloadA.prototype.Schema = "<ref name='anything'/>";
|
||||
|
||||
HotloadA.prototype.Init = function()
|
||||
{
|
||||
HotloadA.prototype.Init = function() {
|
||||
this.x = +this.template.x;
|
||||
};
|
||||
|
||||
HotloadA.prototype.GetX = function()
|
||||
{
|
||||
HotloadA.prototype.GetX = function() {
|
||||
return this.x;
|
||||
};
|
||||
|
||||
|
|
@ -17,13 +15,11 @@ Engine.RegisterComponentType(IID_Test1, "HotloadA", HotloadA);
|
|||
|
||||
function HotloadB() {}
|
||||
|
||||
HotloadB.prototype.Init = function()
|
||||
{
|
||||
HotloadB.prototype.Init = function() {
|
||||
this.x = +this.template.x;
|
||||
};
|
||||
|
||||
HotloadB.prototype.GetX = function()
|
||||
{
|
||||
HotloadB.prototype.GetX = function() {
|
||||
return this.x * 2;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,11 @@ function HotloadA() {}
|
|||
|
||||
HotloadA.prototype.Schema = "<ref name='anything'/>";
|
||||
|
||||
HotloadA.prototype.Init = function()
|
||||
{
|
||||
HotloadA.prototype.Init = function() {
|
||||
this.x = +this.template.x;
|
||||
};
|
||||
|
||||
HotloadA.prototype.GetX = function()
|
||||
{
|
||||
HotloadA.prototype.GetX = function() {
|
||||
return this.x*10;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,11 @@ function Modding() {}
|
|||
|
||||
Modding.prototype.Schema = "<ref name='anything'/>";
|
||||
|
||||
Modding.prototype.Init = function()
|
||||
{
|
||||
Modding.prototype.Init = function() {
|
||||
this.x = +this.template.x;
|
||||
};
|
||||
|
||||
Modding.prototype.GetX = function()
|
||||
{
|
||||
Modding.prototype.GetX = function() {
|
||||
return this.x;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
Modding.prototype.GetX = function()
|
||||
{
|
||||
Modding.prototype.GetX = function() {
|
||||
return this.x * 10;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,14 @@
|
|||
function TestScript1A() {}
|
||||
|
||||
TestScript1A.prototype.Init = function()
|
||||
{
|
||||
TestScript1A.prototype.Init = function() {
|
||||
this.x = 100;
|
||||
};
|
||||
|
||||
TestScript1A.prototype.GetX = function()
|
||||
{
|
||||
TestScript1A.prototype.GetX = function() {
|
||||
return this.x;
|
||||
};
|
||||
|
||||
TestScript1A.prototype.OnUpdate = function(msg)
|
||||
{
|
||||
TestScript1A.prototype.OnUpdate = function(msg) {
|
||||
this.x += msg.turnLength;
|
||||
};
|
||||
|
||||
|
|
@ -21,18 +18,15 @@ Engine.RegisterComponentType(IID_Test1, "TestScript1A", TestScript1A);
|
|||
|
||||
function TestScript1B() {}
|
||||
|
||||
TestScript1B.prototype.Init = function()
|
||||
{
|
||||
TestScript1B.prototype.Init = function() {
|
||||
this.x = 100;
|
||||
};
|
||||
|
||||
TestScript1B.prototype.GetX = function()
|
||||
{
|
||||
TestScript1B.prototype.GetX = function() {
|
||||
return this.x;
|
||||
};
|
||||
|
||||
TestScript1B.prototype.OnGlobalUpdate = function(msg)
|
||||
{
|
||||
TestScript1B.prototype.OnGlobalUpdate = function(msg) {
|
||||
this.x += msg.turnLength;
|
||||
};
|
||||
|
||||
|
|
@ -42,13 +36,11 @@ Engine.RegisterComponentType(IID_Test1, "TestScript1B", TestScript1B);
|
|||
|
||||
function TestScript2A() {}
|
||||
|
||||
TestScript2A.prototype.Init = function()
|
||||
{
|
||||
TestScript2A.prototype.Init = function() {
|
||||
this.x = 200;
|
||||
};
|
||||
|
||||
TestScript2A.prototype.GetX = function()
|
||||
{
|
||||
TestScript2A.prototype.GetX = function() {
|
||||
Engine.BroadcastMessage(MT_Update, { "turnLength": 50 });
|
||||
Engine.PostMessage(1, MT_Update, { "turnLength": 500 });
|
||||
Engine.PostMessage(2, MT_Update, { "turnLength": 5000 });
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
function TestScript1_Init() {}
|
||||
|
||||
TestScript1_Init.prototype.Init = function()
|
||||
{
|
||||
TestScript1_Init.prototype.Init = function() {
|
||||
var param = this.template;
|
||||
// print("# ",uneval(param),"\n");
|
||||
if (param)
|
||||
|
|
@ -10,8 +9,7 @@ TestScript1_Init.prototype.Init = function()
|
|||
this.x = 100;
|
||||
};
|
||||
|
||||
TestScript1_Init.prototype.GetX = function()
|
||||
{
|
||||
TestScript1_Init.prototype.GetX = function() {
|
||||
return this.x;
|
||||
};
|
||||
|
||||
|
|
@ -21,18 +19,12 @@ Engine.RegisterComponentType(IID_Test1, "TestScript1_Init", TestScript1_Init);
|
|||
|
||||
function TestScript1_readonly() {}
|
||||
|
||||
TestScript1_readonly.prototype.GetX = function()
|
||||
{
|
||||
try { this.template = null; }
|
||||
catch(e) { /* noop */ }
|
||||
try { delete this.template; }
|
||||
catch(e) { /* noop */ }
|
||||
try { this.template.x += 1000; }
|
||||
catch(e) { /* noop */ }
|
||||
try { delete this.template.x; }
|
||||
catch(e) { /* noop */ }
|
||||
try { this.template.y = 2000; }
|
||||
catch(e) { /* noop */ }
|
||||
TestScript1_readonly.prototype.GetX = function() {
|
||||
try { this.template = null; } catch (e) { /* noop */ }
|
||||
try { delete this.template; } catch (e) { /* noop */ }
|
||||
try { this.template.x += 1000; } catch (e) { /* noop */ }
|
||||
try { delete this.template.x; } catch (e) { /* noop */ }
|
||||
try { this.template.y = 2000; } catch (e) { /* noop */ }
|
||||
return +(this.template.x || 1) + +(this.template.y || 2);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,10 @@
|
|||
function TestScript1A() {}
|
||||
|
||||
TestScript1A.prototype.Init = function()
|
||||
{
|
||||
TestScript1A.prototype.Init = function() {
|
||||
this.x = 100;
|
||||
};
|
||||
|
||||
TestScript1A.prototype.GetX = function()
|
||||
{
|
||||
TestScript1A.prototype.GetX = function() {
|
||||
var test2 = Engine.QueryInterface(this.entity, IID_Test2);
|
||||
return test2.GetX() + (test2.x || 0);
|
||||
};
|
||||
|
|
@ -17,13 +15,11 @@ Engine.RegisterComponentType(IID_Test1, "TestScript1A", TestScript1A);
|
|||
|
||||
function TestScript2A() {}
|
||||
|
||||
TestScript2A.prototype.Init = function()
|
||||
{
|
||||
TestScript2A.prototype.Init = function() {
|
||||
this.x = 200;
|
||||
};
|
||||
|
||||
TestScript2A.prototype.GetX = function()
|
||||
{
|
||||
TestScript2A.prototype.GetX = function() {
|
||||
return this.x;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
function TestScript1_values() {}
|
||||
|
||||
TestScript1_values.prototype.Init = function()
|
||||
{
|
||||
TestScript1_values.prototype.Init = function() {
|
||||
this.x = +this.template.x;
|
||||
this.str = "this is a string";
|
||||
this.things = { "a": 1, "b": "2", "c": [3, "4", [5, []]] };
|
||||
};
|
||||
|
||||
TestScript1_values.prototype.GetX = function()
|
||||
{
|
||||
TestScript1_values.prototype.GetX = function() {
|
||||
// print(uneval(this));
|
||||
return this.x;
|
||||
};
|
||||
|
|
@ -19,21 +17,16 @@ Engine.RegisterComponentType(IID_Test1, "TestScript1_values", TestScript1_values
|
|||
|
||||
function TestScript1_entity() {}
|
||||
|
||||
TestScript1_entity.prototype.GetX = function()
|
||||
{
|
||||
TestScript1_entity.prototype.GetX = function() {
|
||||
// Test that .entity is readonly
|
||||
try
|
||||
{
|
||||
try {
|
||||
delete this.entity;
|
||||
Engine.TS_FAIL("Missed exception");
|
||||
}
|
||||
catch(e) { /* OK */ }
|
||||
try
|
||||
{
|
||||
} catch (e) { /* OK */ }
|
||||
try {
|
||||
this.entity = -1;
|
||||
Engine.TS_FAIL("Missed exception");
|
||||
}
|
||||
catch(e) { /* OK */ }
|
||||
} catch (e) { /* OK */ }
|
||||
|
||||
// and return the value
|
||||
return this.entity;
|
||||
|
|
@ -45,15 +38,13 @@ Engine.RegisterComponentType(IID_Test1, "TestScript1_entity", TestScript1_entity
|
|||
|
||||
function TestScript1_nontree() {}
|
||||
|
||||
TestScript1_nontree.prototype.Init = function()
|
||||
{
|
||||
TestScript1_nontree.prototype.Init = function() {
|
||||
var n = [1];
|
||||
this.x = [n, n, null, { "y": n }];
|
||||
this.x[2] = this.x;
|
||||
};
|
||||
|
||||
TestScript1_nontree.prototype.GetX = function()
|
||||
{
|
||||
TestScript1_nontree.prototype.GetX = function() {
|
||||
// print(uneval(this)+"\n");
|
||||
this.x[0][0] += 1;
|
||||
return this.x[0][0] + this.x[1][0] + this.x[2][0][0] + this.x[3].y[0];
|
||||
|
|
@ -65,18 +56,15 @@ Engine.RegisterComponentType(IID_Test1, "TestScript1_nontree", TestScript1_nontr
|
|||
|
||||
function TestScript1_custom() {}
|
||||
|
||||
TestScript1_custom.prototype.Init = function()
|
||||
{
|
||||
TestScript1_custom.prototype.Init = function() {
|
||||
this.y = 2;
|
||||
};
|
||||
|
||||
TestScript1_custom.prototype.Serialize = function()
|
||||
{
|
||||
TestScript1_custom.prototype.Serialize = function() {
|
||||
return { "c": 1 };
|
||||
};
|
||||
|
||||
TestScript1_custom.prototype.Deserialize = function(data)
|
||||
{
|
||||
TestScript1_custom.prototype.Deserialize = function(data) {
|
||||
this.c = data.c;
|
||||
};
|
||||
|
||||
|
|
@ -86,8 +74,7 @@ Engine.RegisterComponentType(IID_Test1, "TestScript1_custom", TestScript1_custom
|
|||
|
||||
function TestScript1_getter() {}
|
||||
|
||||
TestScript1_getter.prototype.Init = function()
|
||||
{
|
||||
TestScript1_getter.prototype.Init = function() {
|
||||
this.x = 100;
|
||||
this.__defineGetter__('x', function() { print("FAIL\n"); die(); return 200; });
|
||||
};
|
||||
|
|
@ -100,20 +87,17 @@ function TestScript1_consts() {}
|
|||
|
||||
TestScript1_consts.prototype.Schema = "<ref name='anything'/>";
|
||||
|
||||
TestScript1_consts.prototype.Init = function()
|
||||
{
|
||||
TestScript1_consts.prototype.Init = function() {
|
||||
this.cached = (+this.entity) + (+this.template.x);
|
||||
};
|
||||
|
||||
TestScript1_consts.prototype.Serialize = null;
|
||||
|
||||
TestScript1_consts.prototype.Deserialize = function(data)
|
||||
{
|
||||
TestScript1_consts.prototype.Deserialize = function(data) {
|
||||
this.Init();
|
||||
};
|
||||
|
||||
TestScript1_consts.prototype.GetX = function()
|
||||
{
|
||||
TestScript1_consts.prototype.GetX = function() {
|
||||
return this.cached;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,14 @@
|
|||
function TestScript1A() {}
|
||||
|
||||
TestScript1A.prototype.Init = function()
|
||||
{
|
||||
TestScript1A.prototype.Init = function() {
|
||||
this.x = 101000;
|
||||
};
|
||||
|
||||
TestScript1A.prototype.GetX = function()
|
||||
{
|
||||
TestScript1A.prototype.GetX = function() {
|
||||
return this.x;
|
||||
};
|
||||
|
||||
TestScript1A.prototype.OnTurnStart = function(msg)
|
||||
{
|
||||
TestScript1A.prototype.OnTurnStart = function(msg) {
|
||||
this.x += 1;
|
||||
};
|
||||
|
||||
|
|
@ -23,8 +20,7 @@ function TestScript1B() {}
|
|||
|
||||
TestScript1B.prototype = Object.create(TestScript1A.prototype);
|
||||
|
||||
TestScript1B.prototype.Init = function()
|
||||
{
|
||||
TestScript1B.prototype.Init = function() {
|
||||
this.x = 102000;
|
||||
};
|
||||
|
||||
|
|
@ -34,18 +30,15 @@ Engine.RegisterComponentType(IID_Test1, "TestScript1B", TestScript1B);
|
|||
|
||||
function TestScript2A() {}
|
||||
|
||||
TestScript2A.prototype.Init = function()
|
||||
{
|
||||
TestScript2A.prototype.Init = function() {
|
||||
this.x = 201000;
|
||||
};
|
||||
|
||||
TestScript2A.prototype.GetX = function()
|
||||
{
|
||||
TestScript2A.prototype.GetX = function() {
|
||||
return this.x;
|
||||
};
|
||||
|
||||
TestScript2A.prototype.OnUpdate = function(msg)
|
||||
{
|
||||
TestScript2A.prototype.OnUpdate = function(msg) {
|
||||
this.x += msg.turnLength;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<material>
|
||||
<required_texture name="baseTex"/>
|
||||
<shader pass="main" effect="dummy"/>
|
||||
<shader effect="dummy"/>
|
||||
</material>
|
||||
|
|
|
|||
|
|
@ -24,23 +24,9 @@
|
|||
<empty/>
|
||||
</element>
|
||||
</optional>
|
||||
<oneOrMore>
|
||||
<element name="shader">
|
||||
<attribute name="effect"/>
|
||||
<attribute name="pass">
|
||||
<choice>
|
||||
<value>main</value>
|
||||
<value>shadow_caster</value>
|
||||
<value>silhouette_occluder</value>
|
||||
<value>silhouette_caster</value>
|
||||
<value>wireframe</value>
|
||||
<value>wireframe_solid</value>
|
||||
<value>reflections</value>
|
||||
<value>refractions</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</element>
|
||||
</oneOrMore>
|
||||
<element name="shader">
|
||||
<attribute name="effect"/>
|
||||
</element>
|
||||
<zeroOrMore>
|
||||
<element name="define">
|
||||
<attribute name="name"/>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<material>
|
||||
<shader pass="main" effect="terrain_base"/>
|
||||
<shader pass="reflections" effect="terrain_base_reflections"/>
|
||||
<shader pass="refractions" effect="terrain_base"/>
|
||||
<shader pass="wireframe" effect="terrain_base_wireframe"/>
|
||||
<shader effect="terrain_base"/>
|
||||
<required_texture name="baseTex"/>
|
||||
</material>
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
<required_texture name="baseTex"/>
|
||||
<required_texture name="normTex" define="USE_NORMAL_MAP"/>
|
||||
<required_texture name="specTex" define="USE_SPECULAR_MAP"/>
|
||||
<shader pass="main" effect="terrain_base"/>
|
||||
<shader pass="reflections" effect="terrain_base_reflections"/>
|
||||
<shader pass="refractions" effect="terrain_base"/>
|
||||
<shader pass="wireframe" effect="terrain_base_wireframe"/>
|
||||
<shader effect="terrain_base"/>
|
||||
<uniform name="effectSettings" value="1.0 15.0 0.0"/>
|
||||
</material>
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
<required_texture name="baseTex"/>
|
||||
<required_texture name="normTex" define="USE_NORMAL_MAP"/>
|
||||
<required_texture name="specTex" define="USE_SPECULAR_MAP"/>
|
||||
<shader pass="main" effect="terrain_base"/>
|
||||
<shader pass="reflections" effect="terrain_base_reflections"/>
|
||||
<shader pass="refractions" effect="terrain_base"/>
|
||||
<shader pass="wireframe" effect="terrain_base_wireframe"/>
|
||||
<shader effect="terrain_base"/>
|
||||
<uniform name="effectSettings" value="1.2 15.0 0.0"/>
|
||||
</material>
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
<required_texture name="baseTex"/>
|
||||
<required_texture name="normTex" define="USE_NORMAL_MAP"/>
|
||||
<required_texture name="specTex" define="USE_SPECULAR_MAP"/>
|
||||
<shader pass="main" effect="terrain_base"/>
|
||||
<shader pass="reflections" effect="terrain_base_reflections"/>
|
||||
<shader pass="refractions" effect="terrain_base"/>
|
||||
<shader pass="wireframe" effect="terrain_base_wireframe"/>
|
||||
<shader effect="terrain_base"/>
|
||||
<uniform name="effectSettings" value="0.8 15.0 0.0"/>
|
||||
</material>
|
||||
|
|
|
|||
|
|
@ -3,9 +3,6 @@
|
|||
<alternative material="terrain_base.xml" quality="1"/>
|
||||
<define name="USE_TRIPLANAR" value="1"/>
|
||||
<required_texture name="baseTex"/>
|
||||
<shader pass="main" effect="terrain_base"/>
|
||||
<shader pass="reflections" effect="terrain_base_reflections"/>
|
||||
<shader pass="refractions" effect="terrain_base"/>
|
||||
<shader pass="wireframe" effect="terrain_base_wireframe"/>
|
||||
<shader effect="terrain_base"/>
|
||||
<uniform name="effectSettings" value="1.0 15.0 0.0"/>
|
||||
</material>
|
||||
|
|
|
|||
|
|
@ -5,9 +5,6 @@
|
|||
<required_texture name="baseTex"/>
|
||||
<required_texture name="normTex" define="USE_NORMAL_MAP"/>
|
||||
<required_texture name="specTex" define="USE_SPECULAR_MAP"/>
|
||||
<shader pass="main" effect="terrain_base"/>
|
||||
<shader pass="reflections" effect="terrain_base_reflections"/>
|
||||
<shader pass="refractions" effect="terrain_base"/>
|
||||
<shader pass="wireframe" effect="terrain_base_wireframe"/>
|
||||
<shader effect="terrain_base"/>
|
||||
<uniform name="effectSettings" value="1.0 15.0 0.0"/>
|
||||
</material>
|
||||
|
|
|
|||
|
|
@ -41,8 +41,7 @@ export async function init(initialColor)
|
|||
|
||||
const splitColor = initialColor.split(" ");
|
||||
|
||||
const chanels = labels.map((label, i) =>
|
||||
{
|
||||
const chanels = labels.map((label, i) => {
|
||||
Engine.GetGUIObjectByName("colorLabel[" + i + "]").caption = label;
|
||||
resizeChanel(i);
|
||||
|
||||
|
|
@ -71,10 +70,8 @@ export async function init(initialColor)
|
|||
while (true)
|
||||
{
|
||||
colorDisplay.sprite = "color:" + currentColor();
|
||||
const chanelPromises = chanels.map(chanel =>
|
||||
{
|
||||
return new Promise(resolve =>
|
||||
{
|
||||
const chanelPromises = chanels.map(chanel => {
|
||||
return new Promise(resolve => {
|
||||
chanel.slider.onValueChange = resolve.bind(undefined, { "value": chanel });
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@
|
|||
scrollbar_style="ModernScrollBar"
|
||||
textcolor="white"
|
||||
text_align="left"
|
||||
text_valign="top"
|
||||
text_valign="center"
|
||||
sprite="ModernDarkBox"
|
||||
sprite_overlay="ModernDarkBoxGoldBorder"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -23,10 +23,8 @@ function distributeButtonsHorizontally(button, captions)
|
|||
|
||||
function setButtonCaptionsAndVisibility(buttons, captions, cancelHotkey, name)
|
||||
{
|
||||
return new Promise(resolve =>
|
||||
{
|
||||
captions.forEach((caption, i) =>
|
||||
{
|
||||
return new Promise(resolve => {
|
||||
captions.forEach((caption, i) => {
|
||||
buttons[i] = Engine.GetGUIObjectByName(name + (i + 1));
|
||||
buttons[i].caption = caption;
|
||||
buttons[i].hidden = false;
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@
|
|||
</define>
|
||||
<define name="font">
|
||||
<data type="string">
|
||||
<param name="pattern">[a-z]+-(bold-|italic-)?(stroke-)?[0-9]{1,3}</param>
|
||||
<param name="pattern">(mono|sans)-(bold-|italic-)?(stroke-)?[0-9]{1,3}</param>
|
||||
</data>
|
||||
</define>
|
||||
<define name="size">
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@ var g_IncompatibleModsFile = "gui/incompatible_mods/incompatible_mods.txt";
|
|||
function init(data)
|
||||
{
|
||||
Engine.GetGUIObjectByName("mainText").caption = Engine.TranslateLines(Engine.ReadFile(g_IncompatibleModsFile));
|
||||
return new Promise(closePageCallback =>
|
||||
{
|
||||
return new Promise(closePageCallback => {
|
||||
Engine.GetGUIObjectByName("btnClose").onPress = closePageCallback;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,14 +27,12 @@ var g_ModIOState = {
|
|||
/**
|
||||
* Finished status indicators
|
||||
*/
|
||||
"ready": (progressData, closePageCallback) =>
|
||||
{
|
||||
"ready": (progressData, closePageCallback) => {
|
||||
// GameID acquired, ready to fetch mod list
|
||||
if (!g_RequestCancelled)
|
||||
updateModList(closePageCallback);
|
||||
},
|
||||
"listed": progressData =>
|
||||
{
|
||||
"listed": progressData => {
|
||||
// List of available mods acquired
|
||||
|
||||
// Only run this once (for each update).
|
||||
|
|
@ -46,8 +44,7 @@ var g_ModIOState = {
|
|||
g_ModsAvailableOnline = Engine.ModIoGetMods();
|
||||
displayMods();
|
||||
},
|
||||
"success": progressData =>
|
||||
{
|
||||
"success": progressData => {
|
||||
// Successfully acquired a mod file
|
||||
hideDialog();
|
||||
Engine.GetGUIObjectByName("downloadButton").enabled = true;
|
||||
|
|
@ -55,24 +52,20 @@ var g_ModIOState = {
|
|||
/**
|
||||
* In-progress status indicators.
|
||||
*/
|
||||
"gameid": progressData =>
|
||||
{
|
||||
"gameid": progressData => {
|
||||
// Acquiring GameID from mod.io
|
||||
},
|
||||
"listing": progressData =>
|
||||
{
|
||||
"listing": progressData => {
|
||||
// Acquiring list of available mods from mod.io
|
||||
},
|
||||
"downloading": progressData =>
|
||||
{
|
||||
"downloading": progressData => {
|
||||
// Downloading a mod file
|
||||
updateProgressBar(progressData.progress, g_ModsAvailableOnline[selectedModIndex()].filesize);
|
||||
},
|
||||
/**
|
||||
* Error/Failure status indicators.
|
||||
*/
|
||||
"failed_gameid": async(progressData, closePageCallback) =>
|
||||
{
|
||||
"failed_gameid": async(progressData, closePageCallback) => {
|
||||
// Game ID couldn't be retrieved
|
||||
const promise = showErrorMessageBox(
|
||||
sprintf(translateWithContext("mod.io error message", "Game ID could not be retrieved.\n\n%(technicalDetails)s"), {
|
||||
|
|
@ -87,8 +80,7 @@ var g_ModIOState = {
|
|||
else
|
||||
init();
|
||||
},
|
||||
"failed_listing": async(progressData, closePageCallback) =>
|
||||
{
|
||||
"failed_listing": async(progressData, closePageCallback) => {
|
||||
// Mod list couldn't be retrieved
|
||||
const promise = showErrorMessageBox(
|
||||
sprintf(translateWithContext("mod.io error message", "Mod List could not be retrieved.\n\n%(technicalDetails)s"), {
|
||||
|
|
@ -103,8 +95,7 @@ var g_ModIOState = {
|
|||
else
|
||||
updateModList(closePageCallback);
|
||||
},
|
||||
"failed_downloading": async(progressData) =>
|
||||
{
|
||||
"failed_downloading": async(progressData) => {
|
||||
// File couldn't be retrieved
|
||||
const promise = showErrorMessageBox(
|
||||
sprintf(translateWithContext("mod.io error message", "File download failed.\n\n%(technicalDetails)s"), {
|
||||
|
|
@ -119,8 +110,7 @@ var g_ModIOState = {
|
|||
else
|
||||
downloadMod();
|
||||
},
|
||||
"failed_filecheck": async(progressData) =>
|
||||
{
|
||||
"failed_filecheck": async(progressData) => {
|
||||
// The file is corrupted
|
||||
const promise = showErrorMessageBox(
|
||||
sprintf(translateWithContext("mod.io error message", "File verification error.\n\n%(technicalDetails)s"), {
|
||||
|
|
@ -136,8 +126,7 @@ var g_ModIOState = {
|
|||
/**
|
||||
* Default
|
||||
*/
|
||||
"none": progressData =>
|
||||
{
|
||||
"none": progressData => {
|
||||
// Nothing has happened yet.
|
||||
}
|
||||
};
|
||||
|
|
@ -155,8 +144,7 @@ function init(data)
|
|||
|
||||
return Promise.race([
|
||||
promise,
|
||||
new Promise(closePageCallback =>
|
||||
{
|
||||
new Promise(closePageCallback => {
|
||||
Engine.GetGUIObjectByName("backButton").onPress = closePageCallback;
|
||||
Engine.GetGUIObjectByName("modio").onTick = onTick.bind(null, closePageCallback);
|
||||
})
|
||||
|
|
@ -339,8 +327,7 @@ async function progressDialog(dialogCaption, dialogTitle, showProgressBar, butto
|
|||
|
||||
const downloadDialog_button = Engine.GetGUIObjectByName("downloadDialog_button");
|
||||
downloadDialog_button.caption = buttonCaption;
|
||||
await new Promise(resolve =>
|
||||
{
|
||||
await new Promise(resolve => {
|
||||
downloadDialog_button.onPress = resolve;
|
||||
});
|
||||
cancelRequest();
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
function init(data)
|
||||
{
|
||||
Engine.GetGUIObjectByName("mainText").caption = Engine.TranslateLines(Engine.ReadFile("gui/modmod/help/help.txt"));
|
||||
return new Promise(closePageCallback =>
|
||||
{
|
||||
return new Promise(closePageCallback => {
|
||||
Engine.GetGUIObjectByName("closeButton").onPress = closePageCallback;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,12 +68,8 @@ function init(data, hotloadData)
|
|||
if (g_HasIncompatibleMods)
|
||||
Engine.OpenChildPage("page_incompatible_mods.xml", {});
|
||||
|
||||
return new Promise(closePageCallback =>
|
||||
{
|
||||
return new Promise(closePageCallback => {
|
||||
Engine.GetGUIObjectByName("quitButton").onPress = closePageCallback;
|
||||
Engine.GetGUIObjectByName("cancelButton").onPress = closePageCallback.bind(undefined, {
|
||||
[Engine.openRequest]: { "page": "page_pregame.xml" }
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -296,6 +292,11 @@ function filterMod(folder)
|
|||
return !negateFilter;
|
||||
}
|
||||
|
||||
function closePage()
|
||||
{
|
||||
Engine.SwitchGuiPage("page_pregame.xml", {});
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves an item in the list up or down.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -194,6 +194,7 @@
|
|||
|
||||
<object name="cancelButton" type="button" style="ModernButtonRed" size="100%-932 100%-44 100%-752 100%-16" hotkey="cancel">
|
||||
<translatableAttribute id="caption">Cancel</translatableAttribute>
|
||||
<action on="Press">closePage();</action>
|
||||
</object>
|
||||
|
||||
<object type="button" style="ModernButtonRed" size="100%-748 100%-44 100%-568 100%-16">
|
||||
|
|
|
|||
|
|
@ -9,6 +9,6 @@
|
|||
scroll_bottom="true"
|
||||
textcolor="white"
|
||||
text_align="left"
|
||||
text_valign="top"
|
||||
text_valign="center"
|
||||
/>
|
||||
</styles>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ const g_ModProperties = {
|
|||
"type": "string",
|
||||
"validate": validateName
|
||||
},
|
||||
// example: "0.29.0"
|
||||
// example: "0.28.0"
|
||||
"version": {
|
||||
"required": true,
|
||||
"type": "string",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
async function init()
|
||||
function init()
|
||||
{
|
||||
return { [Engine.openRequest]: {
|
||||
"page": "page_modmod.xml",
|
||||
"argument": { "cancelbutton": false }
|
||||
} };
|
||||
Engine.SwitchGuiPage("page_modmod.xml", {
|
||||
"cancelbutton": false
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,8 +21,7 @@ async function init(data)
|
|||
initURLButtons(data.termsURL, data.urlButtons);
|
||||
initLanguageSelection();
|
||||
|
||||
const accepted = await new Promise(resolve =>
|
||||
{
|
||||
const accepted = await new Promise(resolve => {
|
||||
Engine.GetGUIObjectByName("cancelButton").onPress = resolve.bind(null, false);
|
||||
Engine.GetGUIObjectByName("connectButton").onPress = resolve.bind(null, true);
|
||||
});
|
||||
|
|
@ -41,16 +40,14 @@ function initURLButtons(termsURL, urlButtons)
|
|||
"url": termsURL
|
||||
});
|
||||
|
||||
urlButtons.forEach((urlButton, i) =>
|
||||
{
|
||||
urlButtons.forEach((urlButton, i) => {
|
||||
const button = Engine.GetGUIObjectByName("button[" + i + "]");
|
||||
button.caption = urlButton.caption;
|
||||
button.hidden = false;
|
||||
button.tooltip = sprintf(translate("Open %(url)s in the browser."), {
|
||||
"url": urlButton.url
|
||||
});
|
||||
button.onPress = () =>
|
||||
{
|
||||
button.onPress = () => {
|
||||
openURL(urlButton.url);
|
||||
};
|
||||
});
|
||||
|
|
@ -65,8 +62,7 @@ function initLanguageSelection()
|
|||
const languageDropdown = Engine.GetGUIObjectByName("languageDropdown");
|
||||
languageDropdown.size = (languageLabelWidth + 10) + " 4 100% 100%";
|
||||
|
||||
languageDropdown.list = (() =>
|
||||
{
|
||||
languageDropdown.list = (() => {
|
||||
const displayNames = Engine.GetSupportedLocaleDisplayNames();
|
||||
const baseNames = Engine.GetSupportedLocaleBaseNames();
|
||||
|
||||
|
|
@ -84,8 +80,7 @@ function initLanguageSelection()
|
|||
return list;
|
||||
})();
|
||||
|
||||
languageDropdown.onSelectionChange = () =>
|
||||
{
|
||||
languageDropdown.onSelectionChange = () => {
|
||||
Engine.GetGUIObjectByName("mainText").caption =
|
||||
sprintf(
|
||||
languageDropdown.selected == 1 ?
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2026 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
|
|
@ -182,6 +182,7 @@ function RunDetection(settings)
|
|||
var disable_shadowpcf;
|
||||
var disable_allwater;
|
||||
var disable_fancywater;
|
||||
var enable_glsl;
|
||||
var enable_postproc;
|
||||
var enable_smoothlos;
|
||||
var override_renderpath;
|
||||
|
|
@ -213,6 +214,16 @@ function RunDetection(settings)
|
|||
var GL_VERSION = settings.renderer_backend.GL_VERSION;
|
||||
var GL_EXTENSIONS = settings.renderer_backend.GL_EXTENSIONS.split(" ");
|
||||
|
||||
// Enable GLSL on OpenGL 3+, which should be able to properly
|
||||
// manage GLSL shaders, needed for effects like windy trees
|
||||
if (GL_VERSION.match(/^[3-9]/))
|
||||
enable_glsl = true;
|
||||
|
||||
// Enable GLSL on OpenGL ES 2.0+, which doesn’t support the fixed
|
||||
// function fallbacks
|
||||
if (GL_VERSION.match(/^OpenGL ES /))
|
||||
enable_glsl = true;
|
||||
|
||||
// Enable most graphics options on OpenGL 4+, which should be
|
||||
// able to properly manage them
|
||||
if (GL_VERSION.match(/^[4-9]/))
|
||||
|
|
@ -228,6 +239,7 @@ function RunDetection(settings)
|
|||
{
|
||||
warnings.push("You are using '" + GL_RENDERER + "' graphics driver, expect very poor performance!");
|
||||
warnings.push("If possible install a proper graphics driver for your hardware.");
|
||||
enable_glsl = false;
|
||||
enable_postproc = false;
|
||||
enable_smoothlos = false;
|
||||
// s3tc on software renderers halves fps and makes textures weird
|
||||
|
|
@ -303,6 +315,8 @@ function RunDetection(settings)
|
|||
|
||||
// https://gitea.wildfiregames.com/0ad/0ad/issues/964
|
||||
// SiS Mirage 3 drivers apparently crash with shaders, so fall back to non-shader
|
||||
// (The other known SiS cards don't advertise GL_ARB_fragment_program so we
|
||||
// don't need to do anything special for them)
|
||||
if (os_win && GL_RENDERER.match(/^Mirage Graphics3$/))
|
||||
{
|
||||
override_renderpath = "fixed";
|
||||
|
|
@ -317,6 +331,7 @@ function RunDetection(settings)
|
|||
"disable_shadowpcf": disable_shadowpcf,
|
||||
"disable_allwater": disable_allwater,
|
||||
"disable_fancywater": disable_fancywater,
|
||||
"enable_glsl": enable_glsl,
|
||||
"enable_postproc": enable_postproc,
|
||||
"enable_smoothlos": enable_smoothlos,
|
||||
"override_renderpath": override_renderpath,
|
||||
|
|
@ -325,8 +340,8 @@ function RunDetection(settings)
|
|||
|
||||
global.RunHardwareDetection = function(settings)
|
||||
{
|
||||
// Currently we don't have limitations for other backends than GL.
|
||||
if (settings.renderer_backend.name != 'gl')
|
||||
// Currently we don't have limitations for other backends than GL and GL ARB.
|
||||
if (settings.renderer_backend.name != 'gl' && settings.renderer_backend.name != 'glarb')
|
||||
return;
|
||||
|
||||
// print(JSON.stringify(settings, null, 1)+"\n");
|
||||
|
|
@ -370,6 +385,9 @@ global.RunHardwareDetection = function(settings)
|
|||
Engine.ConfigDB_CreateValue("hwdetect", "watershadows", (!output.disable_fancywater).toString());
|
||||
}
|
||||
|
||||
if (output.enable_glsl !== undefined)
|
||||
Engine.ConfigDB_CreateValue("hwdetect", "preferglsl", (output.enable_glsl).toString());
|
||||
|
||||
if (output.enable_postproc !== undefined)
|
||||
Engine.ConfigDB_CreateValue("hwdetect", "postproc", (output.enable_postproc).toString());
|
||||
|
||||
|
|
|
|||
|
|
@ -14,8 +14,7 @@ print("<th>GL_RENDERER");
|
|||
print("<th>Output");
|
||||
print("<th>Warnings");
|
||||
|
||||
hwdetectTestData.sort(function(a, b)
|
||||
{
|
||||
hwdetectTestData.sort(function(a, b) {
|
||||
if (a.renderer_backend.GL_RENDERER < b.renderer_backend.GL_RENDERER)
|
||||
return -1;
|
||||
if (b.renderer_backend.GL_RENDERER < a.renderer_backend.GL_RENDERER)
|
||||
|
|
|
|||
27
binaries/data/mods/mod/shaders/arb/canvas2d.fp
Normal file
27
binaries/data/mods/mod/shaders/arb/canvas2d.fp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
!!ARBfp1.0
|
||||
|
||||
TEMP colorTex;
|
||||
TEX colorTex, fragment.texcoord[0], texture[0], 2D;
|
||||
|
||||
TEMP grayscale;
|
||||
MOV grayscale.r, 0.3;
|
||||
MOV grayscale.g, 0.59;
|
||||
MOV grayscale.b, 0.11;
|
||||
MOV grayscale.a, 0.0;
|
||||
|
||||
PARAM colorAdd = program.local[1];
|
||||
PARAM colorMul = program.local[2];
|
||||
PARAM grayscaleFactor = program.local[3];
|
||||
|
||||
TEMP colorGray;
|
||||
DP3 colorGray.rgb, colorTex, grayscale;
|
||||
MOV colorGray.a, colorTex.a;
|
||||
|
||||
TEMP color;
|
||||
LRP color, grayscaleFactor.r, colorGray, colorTex;
|
||||
MUL color, color, colorMul;
|
||||
ADD color, color, colorAdd;
|
||||
|
||||
MOV result.color, color;
|
||||
|
||||
END
|
||||
19
binaries/data/mods/mod/shaders/arb/canvas2d.vp
Normal file
19
binaries/data/mods/mod/shaders/arb/canvas2d.vp
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
!!ARBvp1.0
|
||||
|
||||
PARAM transform = program.local[0];
|
||||
PARAM translation = program.local[1];
|
||||
|
||||
TEMP position;
|
||||
|
||||
MUL position, transform, vertex.position.xyxy;
|
||||
ADD position.x, position.x, position.y;
|
||||
ADD position.y, position.z, position.w;
|
||||
ADD position, position, translation;
|
||||
MOV position.z, 0.0;
|
||||
MOV position.w, 1.0;
|
||||
|
||||
MOV result.position, position;
|
||||
|
||||
MOV result.texcoord[0], vertex.texcoord[0];
|
||||
|
||||
END
|
||||
18
binaries/data/mods/mod/shaders/arb/canvas2d.xml
Normal file
18
binaries/data/mods/mod/shaders/arb/canvas2d.xml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<program type="arb">
|
||||
|
||||
<vertex file="arb/canvas2d.vp">
|
||||
<stream name="pos"/>
|
||||
<stream name="uv0"/>
|
||||
<uniform name="transform" loc="0" type="vec4"/>
|
||||
<uniform name="translation" loc="1" type="vec2"/>
|
||||
</vertex>
|
||||
|
||||
<fragment file="arb/canvas2d.fp">
|
||||
<uniform name="tex" loc="0" type="sampler2D"/>
|
||||
<uniform name="colorAdd" loc="1" type="vec4"/>
|
||||
<uniform name="colorMul" loc="2" type="vec4"/>
|
||||
<uniform name="grayscaleFactor" loc="3" type="float"/>
|
||||
</fragment>
|
||||
|
||||
</program>
|
||||
13
binaries/data/mods/mod/shaders/arb/debug_overlay.fp
Normal file
13
binaries/data/mods/mod/shaders/arb/debug_overlay.fp
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
!!ARBfp1.0
|
||||
|
||||
#if DEBUG_TEXTURED
|
||||
ATTRIB v_tex = fragment.texcoord[0];
|
||||
|
||||
TEX result.color, v_tex, texture[0], 2D;
|
||||
#else
|
||||
PARAM color = program.local[0];
|
||||
|
||||
MOV result.color, color;
|
||||
#endif
|
||||
|
||||
END
|
||||
25
binaries/data/mods/mod/shaders/arb/debug_overlay.vp
Normal file
25
binaries/data/mods/mod/shaders/arb/debug_overlay.vp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
!!ARBvp1.0
|
||||
|
||||
PARAM transform[4] = { program.local[0..3] };
|
||||
#if DEBUG_TEXTURED
|
||||
PARAM textureTransform = program.local[4];
|
||||
#endif
|
||||
|
||||
ATTRIB position = vertex.position;
|
||||
#if DEBUG_TEXTURED
|
||||
ATTRIB uv = vertex.texcoord[0];
|
||||
#endif
|
||||
|
||||
DP4 result.position.x, transform[0], position;
|
||||
DP4 result.position.y, transform[1], position;
|
||||
DP4 result.position.z, transform[2], position;
|
||||
DP4 result.position.w, transform[3], position;
|
||||
|
||||
#if DEBUG_TEXTURED
|
||||
OUTPUT v_tex = result.texcoord[0];
|
||||
|
||||
MUL v_tex.x, textureTransform.x, uv.x;
|
||||
MUL v_tex.y, textureTransform.y, uv.z;
|
||||
#endif
|
||||
|
||||
END
|
||||
16
binaries/data/mods/mod/shaders/arb/debug_overlay.xml
Normal file
16
binaries/data/mods/mod/shaders/arb/debug_overlay.xml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<program type="arb">
|
||||
|
||||
<vertex file="arb/debug_overlay.vp">
|
||||
<uniform name="transform" loc="0" type="mat4"/>
|
||||
<uniform name="textureTransform" loc="4" type="vec2" if="DEBUG_TEXTURED"/>
|
||||
<stream name="pos"/>
|
||||
<stream name="uv0" if="DEBUG_TEXTURED"/>
|
||||
</vertex>
|
||||
|
||||
<fragment file="arb/debug_overlay.fp">
|
||||
<uniform name="baseTex" loc="0" type="sampler2D" if="DEBUG_TEXTURED"/>
|
||||
<uniform name="color" loc="0" type="vec4" if="!DEBUG_TEXTURED"/>
|
||||
</fragment>
|
||||
|
||||
</program>
|
||||
3
binaries/data/mods/mod/shaders/arb/dummy.fp
Normal file
3
binaries/data/mods/mod/shaders/arb/dummy.fp
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
!!ARBfp1.0
|
||||
MOV result.color, program.local[0];
|
||||
END
|
||||
12
binaries/data/mods/mod/shaders/arb/dummy.vp
Normal file
12
binaries/data/mods/mod/shaders/arb/dummy.vp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
!!ARBvp1.0
|
||||
|
||||
ATTRIB position = vertex.position;
|
||||
|
||||
PARAM transform[4] = { program.local[0..3] };
|
||||
|
||||
DP4 result.position.x, transform[0], position;
|
||||
DP4 result.position.y, transform[1], position;
|
||||
DP4 result.position.z, transform[2], position;
|
||||
DP4 result.position.w, transform[3], position;
|
||||
|
||||
END
|
||||
13
binaries/data/mods/mod/shaders/arb/dummy.xml
Normal file
13
binaries/data/mods/mod/shaders/arb/dummy.xml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<program type="arb">
|
||||
|
||||
<vertex file="arb/dummy.vp">
|
||||
<stream name="pos"/>
|
||||
<uniform name="transform" loc="0" type="mat4"/>
|
||||
</vertex>
|
||||
|
||||
<fragment file="arb/dummy.fp">
|
||||
<uniform name="color" loc="0" type="vec4"/>
|
||||
</fragment>
|
||||
|
||||
</program>
|
||||
9
binaries/data/mods/mod/shaders/arb/foreground_overlay.fp
Normal file
9
binaries/data/mods/mod/shaders/arb/foreground_overlay.fp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
!!ARBfp1.0
|
||||
|
||||
PARAM colorMul = program.local[0];
|
||||
TEMP color;
|
||||
TEX color, fragment.texcoord[0], texture[0], 2D;
|
||||
MUL color, color, colorMul;
|
||||
MOV result.color, color;
|
||||
|
||||
END
|
||||
15
binaries/data/mods/mod/shaders/arb/foreground_overlay.vp
Normal file
15
binaries/data/mods/mod/shaders/arb/foreground_overlay.vp
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
!!ARBvp1.0
|
||||
|
||||
ATTRIB position = vertex.position;
|
||||
ATTRIB uv = vertex.texcoord[0];
|
||||
|
||||
PARAM transform[4] = { program.local[0..3] };
|
||||
|
||||
DP4 result.position.x, transform[0], position;
|
||||
DP4 result.position.y, transform[1], position;
|
||||
DP4 result.position.z, transform[2], position;
|
||||
DP4 result.position.w, transform[3], position;
|
||||
|
||||
MOV result.texcoord, uv;
|
||||
|
||||
END
|
||||
15
binaries/data/mods/mod/shaders/arb/foreground_overlay.xml
Normal file
15
binaries/data/mods/mod/shaders/arb/foreground_overlay.xml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<program type="arb">
|
||||
|
||||
<vertex file="arb/foreground_overlay.vp">
|
||||
<stream name="pos"/>
|
||||
<stream name="uv0"/>
|
||||
<uniform name="transform" loc="0" type="mat4"/>
|
||||
</vertex>
|
||||
|
||||
<fragment file="arb/foreground_overlay.fp">
|
||||
<uniform name="baseTex" loc="0" type="sampler2D"/>
|
||||
<uniform name="colorMul" loc="0" type="vec4"/>
|
||||
</fragment>
|
||||
|
||||
</program>
|
||||
17
binaries/data/mods/mod/shaders/arb/los_interp.fp
Normal file
17
binaries/data/mods/mod/shaders/arb/los_interp.fp
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
!!ARBfp1.0
|
||||
|
||||
ATTRIB v_los = fragment.texcoord[0];
|
||||
PARAM delta = program.local[0];
|
||||
|
||||
TEMP los1_tex;
|
||||
TEMP los2_tex;
|
||||
|
||||
TEX los1_tex, v_los, texture[0], 2D;
|
||||
TEX los2_tex, v_los, texture[1], 2D;
|
||||
|
||||
TEMP smoothing;
|
||||
MOV_SAT smoothing, delta.x;
|
||||
|
||||
LRP result.color, smoothing, los1_tex.rrrr, los2_tex.rrrr;
|
||||
|
||||
END
|
||||
6
binaries/data/mods/mod/shaders/arb/los_interp.vp
Normal file
6
binaries/data/mods/mod/shaders/arb/los_interp.vp
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
!!ARBvp1.0
|
||||
|
||||
MOV result.position, vertex.position;
|
||||
MOV result.texcoord, vertex.texcoord[0];
|
||||
|
||||
END
|
||||
12
binaries/data/mods/mod/shaders/arb/los_interp.xml
Normal file
12
binaries/data/mods/mod/shaders/arb/los_interp.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<program type="arb">
|
||||
<vertex file="arb/los_interp.vp">
|
||||
<stream name="pos"/>
|
||||
<stream name="uv0"/>
|
||||
</vertex>
|
||||
<fragment file="arb/los_interp.fp">
|
||||
<uniform name="delta" loc="0" type="float"/>
|
||||
<uniform name="losTex1" loc="0" type="sampler2D"/>
|
||||
<uniform name="losTex2" loc="1" type="sampler2D"/>
|
||||
</fragment>
|
||||
</program>
|
||||
23
binaries/data/mods/mod/shaders/arb/minimap.fp
Normal file
23
binaries/data/mods/mod/shaders/arb/minimap.fp
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
!!ARBfp1.0
|
||||
|
||||
#if MINIMAP_BASE
|
||||
TEX result.color, fragment.texcoord[0], texture[0], 2D;
|
||||
#endif
|
||||
|
||||
#if MINIMAP_LOS
|
||||
TEMP tex;
|
||||
|
||||
TEX tex, fragment.texcoord[0], texture[0], 2D;
|
||||
|
||||
MOV result.color.r, tex.r;
|
||||
MOV result.color.g, tex.r;
|
||||
MOV result.color.b, tex.r;
|
||||
MOV result.color.a, tex.r;
|
||||
#endif
|
||||
|
||||
#if MINIMAP_POINT
|
||||
MOV result.color, fragment.color;
|
||||
MOV result.color.a, 1.0;
|
||||
#endif
|
||||
|
||||
END
|
||||
32
binaries/data/mods/mod/shaders/arb/minimap.vp
Normal file
32
binaries/data/mods/mod/shaders/arb/minimap.vp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
!!ARBvp1.0
|
||||
|
||||
PARAM transform = program.local[0];
|
||||
PARAM translation = program.local[1];
|
||||
PARAM textureTransform = program.local[2];
|
||||
OUTPUT v_tex = result.texcoord[0];
|
||||
|
||||
TEMP position;
|
||||
MUL position, transform, vertex.position.xyxy;
|
||||
ADD position.x, position.x, position.y;
|
||||
ADD position.y, position.z, position.w;
|
||||
ADD position, position, translation.xyxy;
|
||||
MOV position.z, 0.0;
|
||||
MOV position.w, 1.0;
|
||||
MOV result.position, position;
|
||||
|
||||
#if MINIMAP_BASE || MINIMAP_LOS
|
||||
TEMP tex;
|
||||
MUL tex, textureTransform, vertex.texcoord.xyxy;
|
||||
ADD tex.x, tex.x, tex.y;
|
||||
ADD tex.y, tex.z, tex.w;
|
||||
ADD tex, tex, translation.zwzw;
|
||||
MOV tex.z, 0.0;
|
||||
MOV tex.w, 1.0;
|
||||
MOV v_tex, tex;
|
||||
#endif
|
||||
|
||||
#if MINIMAP_POINT
|
||||
MOV result.color, vertex.color;
|
||||
#endif
|
||||
|
||||
END
|
||||
17
binaries/data/mods/mod/shaders/arb/minimap.xml
Normal file
17
binaries/data/mods/mod/shaders/arb/minimap.xml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<program type="arb">
|
||||
|
||||
<vertex file="arb/minimap.vp">
|
||||
<stream name="pos"/>
|
||||
<stream name="uv0" if="MINIMAP_BASE || MINIMAP_LOS"/>
|
||||
<stream name="color" if="MINIMAP_POINT"/>
|
||||
<uniform name="transform" loc="0" type="vec4"/>
|
||||
<uniform name="translation" loc="1" type="vec4"/>
|
||||
<uniform name="textureTransform" loc="2" type="vec4"/>
|
||||
</vertex>
|
||||
|
||||
<fragment file="arb/minimap.fp">
|
||||
<uniform name="baseTex" loc="0" type="sampler2D" if="MINIMAP_BASE || MINIMAP_LOS"/>
|
||||
</fragment>
|
||||
|
||||
</program>
|
||||
7
binaries/data/mods/mod/shaders/arb/overlay_solid.fp
Normal file
7
binaries/data/mods/mod/shaders/arb/overlay_solid.fp
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
!!ARBfp1.0
|
||||
|
||||
PARAM color = program.local[0];
|
||||
|
||||
MOV result.color, color;
|
||||
|
||||
END
|
||||
18
binaries/data/mods/mod/shaders/arb/overlay_solid.vp
Normal file
18
binaries/data/mods/mod/shaders/arb/overlay_solid.vp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
!!ARBvp1.0
|
||||
|
||||
PARAM transform[4] = { program.local[0..3] };
|
||||
PARAM instancingTransform = program.local[4];
|
||||
|
||||
TEMP position;
|
||||
|
||||
MAD position.x, vertex.position.x, instancingTransform.w, instancingTransform.x;
|
||||
MAD position.y, vertex.position.y, instancingTransform.w, instancingTransform.y;
|
||||
MAD position.z, vertex.position.z, instancingTransform.w, instancingTransform.z;
|
||||
MOV position.w, 1.0;
|
||||
|
||||
DP4 result.position.x, transform[0], position;
|
||||
DP4 result.position.y, transform[1], position;
|
||||
DP4 result.position.z, transform[2], position;
|
||||
DP4 result.position.w, transform[3], position;
|
||||
|
||||
END
|
||||
14
binaries/data/mods/mod/shaders/arb/overlay_solid.xml
Normal file
14
binaries/data/mods/mod/shaders/arb/overlay_solid.xml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<program type="arb">
|
||||
|
||||
<vertex file="arb/overlay_solid.vp">
|
||||
<uniform name="transform" loc="0" type="mat4"/>
|
||||
<uniform name="instancingTransform" loc="4" type="vec4"/>
|
||||
<stream name="pos"/>
|
||||
</vertex>
|
||||
|
||||
<fragment file="arb/overlay_solid.fp">
|
||||
<uniform name="color" loc="0" type="vec4"/>
|
||||
</fragment>
|
||||
|
||||
</program>
|
||||
34
binaries/data/mods/mod/shaders/arb/overlayline.fp
Normal file
34
binaries/data/mods/mod/shaders/arb/overlayline.fp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
!!ARBfp1.0
|
||||
PARAM objectColor = program.local[0];
|
||||
TEMP base;
|
||||
TEMP mask;
|
||||
TEMP color;
|
||||
|
||||
// Combine base texture and color, using mask texture
|
||||
TEX base, fragment.texcoord[0], texture[0], 2D;
|
||||
TEX mask, fragment.texcoord[0], texture[1], 2D;
|
||||
#if USE_OBJECTCOLOR
|
||||
LRP color.rgb, mask, objectColor, base;
|
||||
#else
|
||||
LRP color.rgb, mask, fragment.color, base;
|
||||
#endif
|
||||
|
||||
#if IGNORE_LOS
|
||||
MOV result.color.rgb, color;
|
||||
#else
|
||||
// Multiply RGB by LOS texture (red channel)
|
||||
TEMP los;
|
||||
TEX los, fragment.texcoord[1], texture[2], 2D;
|
||||
SUB los.r, los.r, 0.03;
|
||||
MUL los.r, los.r, 0.97;
|
||||
MUL result.color.rgb, color, los.r;
|
||||
#endif
|
||||
|
||||
// Use alpha from base texture, combined with the object color/fragment alpha.
|
||||
#if USE_OBJECTCOLOR
|
||||
MUL result.color.a, objectColor.a, base.a;
|
||||
#else
|
||||
MUL result.color.a, fragment.color.a, base.a;
|
||||
#endif
|
||||
|
||||
END
|
||||
21
binaries/data/mods/mod/shaders/arb/overlayline.vp
Normal file
21
binaries/data/mods/mod/shaders/arb/overlayline.vp
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
!!ARBvp1.0
|
||||
|
||||
PARAM transform[4] = { program.local[0..3] };
|
||||
#if !IGNORE_LOS
|
||||
PARAM losTransform = program.local[4];
|
||||
#endif
|
||||
ATTRIB position = vertex.position;
|
||||
|
||||
DP4 result.position.x, transform[0], position;
|
||||
DP4 result.position.y, transform[1], position;
|
||||
DP4 result.position.z, transform[2], position;
|
||||
DP4 result.position.w, transform[3], position;
|
||||
|
||||
MOV result.texcoord[0], vertex.texcoord[0];
|
||||
#if !IGNORE_LOS
|
||||
MAD result.texcoord[1], position.xzzz, losTransform.x, losTransform.y;
|
||||
#endif
|
||||
|
||||
MOV result.color, vertex.color;
|
||||
|
||||
END
|
||||
25
binaries/data/mods/mod/shaders/arb/overlayline.xml
Normal file
25
binaries/data/mods/mod/shaders/arb/overlayline.xml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<program type="arb">
|
||||
|
||||
<!-- This shader is used for rendering overlay lines (e.g. territory boundaries), and also for
|
||||
rendering the unit selection ring quad overlays, since they are almost identical. The only
|
||||
difference is that in unit selection ring mode, the uniform objectColor is ignored and instead
|
||||
replaced by a color stream from the vertices. The USE_OBJECTCOLOR define is used to switch
|
||||
between either mode. -->
|
||||
|
||||
<vertex file="arb/overlayline.vp">
|
||||
<stream name="pos"/>
|
||||
<stream name="uv0"/>
|
||||
<stream name="color" if="!USE_OBJECTCOLOR"/>
|
||||
<uniform name="transform" loc="0" type="mat4"/>
|
||||
<uniform name="losTransform" loc="4" type="vec2" if="!IGNORE_LOS"/>
|
||||
</vertex>
|
||||
|
||||
<fragment file="arb/overlayline.fp">
|
||||
<uniform name="baseTex" loc="0" type="sampler2D"/>
|
||||
<uniform name="maskTex" loc="1" type="sampler2D"/>
|
||||
<uniform name="losTex" loc="2" type="sampler2D" if="!IGNORE_LOS"/>
|
||||
<uniform name="objectColor" loc="0" type="vec4" if="USE_OBJECTCOLOR"/>
|
||||
</fragment>
|
||||
|
||||
</program>
|
||||
25
binaries/data/mods/mod/shaders/arb/particle.fp
Normal file
25
binaries/data/mods/mod/shaders/arb/particle.fp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
!!ARBfp1.0
|
||||
|
||||
ATTRIB v_los = fragment.texcoord[1];
|
||||
PARAM sunColor = program.local[0];
|
||||
|
||||
TEMP tex, losTex, color;
|
||||
|
||||
TEX tex, fragment.texcoord[0], texture[0], 2D;
|
||||
|
||||
TEMP temp;
|
||||
MOV temp, 0.5;
|
||||
|
||||
ADD color.rgb, fragment.color, sunColor;
|
||||
MUL color.rgb, color, temp;
|
||||
|
||||
MUL color.rgb, color, tex;
|
||||
|
||||
// Multiply everything by the LOS texture
|
||||
TEX losTex, v_los, texture[1], 2D;
|
||||
SUB losTex.r, losTex.r, 0.03;
|
||||
MUL losTex.r, losTex.r, 0.97;
|
||||
MUL result.color.rgb, color, losTex.r;
|
||||
MUL result.color.a, tex, fragment.color;
|
||||
|
||||
END
|
||||
29
binaries/data/mods/mod/shaders/arb/particle.vp
Normal file
29
binaries/data/mods/mod/shaders/arb/particle.vp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
!!ARBvp1.0
|
||||
ATTRIB uv = vertex.texcoord[0];
|
||||
ATTRIB offset = vertex.texcoord[1];
|
||||
PARAM transform[4] = { program.local[0..3] };
|
||||
PARAM modelViewMatrix[4] = { program.local[4..7] };
|
||||
PARAM losTransform = program.local[8];
|
||||
TEMP axis1;
|
||||
MOV axis1, modelViewMatrix[0];
|
||||
TEMP axis2;
|
||||
MOV axis2, modelViewMatrix[1];
|
||||
|
||||
TEMP position;
|
||||
|
||||
MAD position.xyz, axis1, offset.x, vertex.position;
|
||||
MAD position.xyz, axis1, offset.y, position;
|
||||
MAD position.xyz, axis2, offset.x, position;
|
||||
MAD position.xyz, axis2, -offset.y, position;
|
||||
MOV position.w, vertex.position.w;
|
||||
|
||||
DP4 result.position.x, transform[0], position;
|
||||
DP4 result.position.y, transform[1], position;
|
||||
DP4 result.position.z, transform[2], position;
|
||||
DP4 result.position.w, transform[3], position;
|
||||
|
||||
MOV result.texcoord[0], uv;
|
||||
MOV result.color, vertex.color;
|
||||
MAD result.texcoord[1], vertex.position.xzzz, losTransform.x, losTransform.y;
|
||||
|
||||
END
|
||||
20
binaries/data/mods/mod/shaders/arb/particle.xml
Normal file
20
binaries/data/mods/mod/shaders/arb/particle.xml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<program type="arb">
|
||||
|
||||
<vertex file="arb/particle.vp">
|
||||
<stream name="pos"/>
|
||||
<stream name="color"/>
|
||||
<stream name="uv0"/>
|
||||
<stream name="uv1"/>
|
||||
<uniform name="transform" loc="0" type="mat4"/>
|
||||
<uniform name="modelViewMatrix" loc="4" type="mat4"/>
|
||||
<uniform name="losTransform" loc="8" type="vec2"/>
|
||||
</vertex>
|
||||
|
||||
<fragment file="arb/particle.fp">
|
||||
<uniform name="baseTex" loc="0" type="sampler2D"/>
|
||||
<uniform name="losTex" loc="1" type="sampler2D"/>
|
||||
<uniform name="sunColor" loc="0" type="vec3"/>
|
||||
</fragment>
|
||||
|
||||
</program>
|
||||
14
binaries/data/mods/mod/shaders/arb/particle_solid.xml
Normal file
14
binaries/data/mods/mod/shaders/arb/particle_solid.xml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<program type="arb">
|
||||
|
||||
<vertex file="arb/particle.vp">
|
||||
<stream name="pos"/>
|
||||
<stream name="uv0"/>
|
||||
<stream name="uv1"/>
|
||||
<uniform name="transform" loc="0" type="mat4"/>
|
||||
<uniform name="losTransform" loc="5" type="vec2"/>
|
||||
</vertex>
|
||||
|
||||
<fragment file="arb/solid.fp"/>
|
||||
|
||||
</program>
|
||||
27
binaries/data/mods/mod/shaders/arb/sky.fp
Normal file
27
binaries/data/mods/mod/shaders/arb/sky.fp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
!!ARBfp1.0
|
||||
# cgc version 3.1.0013, build date Apr 24 2012
|
||||
# command line args: -oglsl -profile arbfp1
|
||||
# source file: sky.fs
|
||||
#vendor NVIDIA Corporation
|
||||
#version 3.1.0.13
|
||||
#profile arbfp1
|
||||
#program main
|
||||
#semantic baseTex
|
||||
#var float4 gl_FragColor : $vout.COLOR : COL : -1 : 1
|
||||
#var samplerCUBE baseTex : : texunit 0 : -1 : 1
|
||||
#var float3 v_tex : $vin.TEX0 : TEX0 : -1 : 1
|
||||
#const c[0] = 0.25 0 1 4
|
||||
PARAM c[1] = { { 0.25, 0, 1, 4 } };
|
||||
TEMP R0;
|
||||
TEMP R1;
|
||||
TEMP R2;
|
||||
SLT R2.x, c[0].y, fragment.texcoord[0].y;
|
||||
ABS R2.x, R2;
|
||||
TEX R0, fragment.texcoord[0], texture[0], CUBE;
|
||||
ADD R1.x, -fragment.texcoord[0].y, c[0];
|
||||
MUL R1, R0, R1.x;
|
||||
MUL R1, R1, c[0].w;
|
||||
CMP R2.x, -R2, c[0].y, c[0].z;
|
||||
CMP result.color, -R2.x, R0, R1;
|
||||
END
|
||||
# 8 instructions, 3 R-regs
|
||||
15
binaries/data/mods/mod/shaders/arb/sky.vp
Normal file
15
binaries/data/mods/mod/shaders/arb/sky.vp
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
!!ARBvp1.0
|
||||
|
||||
ATTRIB position = vertex.position;
|
||||
ATTRIB uv = vertex.texcoord[0];
|
||||
|
||||
PARAM transform[4] = { program.local[0..3] };
|
||||
|
||||
DP4 result.position.x, transform[0], position;
|
||||
DP4 result.position.y, transform[1], position;
|
||||
DP4 result.position.z, transform[2], position;
|
||||
DP4 result.position.w, transform[3], position;
|
||||
|
||||
MOV result.texcoord, uv;
|
||||
|
||||
END
|
||||
14
binaries/data/mods/mod/shaders/arb/sky.xml
Normal file
14
binaries/data/mods/mod/shaders/arb/sky.xml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<program type="arb">
|
||||
|
||||
<vertex file="arb/sky.vp">
|
||||
<stream name="pos"/>
|
||||
<stream name="uv0"/>
|
||||
<uniform name="transform" loc="0" type="mat4"/>
|
||||
</vertex>
|
||||
|
||||
<fragment file="arb/sky.fp">
|
||||
<uniform name="baseTex" loc="0" type="samplerCube"/>
|
||||
</fragment>
|
||||
|
||||
</program>
|
||||
7
binaries/data/mods/mod/shaders/arb/solid.fp
Normal file
7
binaries/data/mods/mod/shaders/arb/solid.fp
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
!!ARBfp1.0
|
||||
|
||||
PARAM color = program.local[0];
|
||||
|
||||
MOV result.color, color;
|
||||
|
||||
END
|
||||
14
binaries/data/mods/mod/shaders/arb/solid.vp
Normal file
14
binaries/data/mods/mod/shaders/arb/solid.vp
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
!!ARBvp1.0
|
||||
|
||||
PARAM transform[4] = { program.local[0..3] };
|
||||
|
||||
TEMP position;
|
||||
|
||||
DP4 position.x, transform[0], vertex.position;
|
||||
DP4 position.y, transform[1], vertex.position;
|
||||
DP4 position.z, transform[2], vertex.position;
|
||||
MOV position.w, 1.0;
|
||||
|
||||
MOV result.position, position;
|
||||
|
||||
END
|
||||
13
binaries/data/mods/mod/shaders/arb/solid.xml
Normal file
13
binaries/data/mods/mod/shaders/arb/solid.xml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<program type="arb">
|
||||
|
||||
<vertex file="arb/solid.vp">
|
||||
<uniform name="transform" loc="0" type="mat4"/>
|
||||
<stream name="pos"/>
|
||||
</vertex>
|
||||
|
||||
<fragment file="arb/solid.fp">
|
||||
<uniform name="color" loc="0" type="vec4"/>
|
||||
</fragment>
|
||||
|
||||
</program>
|
||||
3
binaries/data/mods/mod/shaders/arb/solid_color.fp
Normal file
3
binaries/data/mods/mod/shaders/arb/solid_color.fp
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
!!ARBfp1.0
|
||||
MOV result.color, program.local[0];
|
||||
END
|
||||
12
binaries/data/mods/mod/shaders/arb/solid_tex.fp
Normal file
12
binaries/data/mods/mod/shaders/arb/solid_tex.fp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
!!ARBfp1.0
|
||||
#ifdef REQUIRE_ALPHA_GEQUAL
|
||||
TEMP tex;
|
||||
TEMP temp;
|
||||
TEX tex, fragment.texcoord[0], texture[0], 2D;
|
||||
SUB temp.x, tex.a, REQUIRE_ALPHA_GEQUAL;
|
||||
KIL temp.x; // discard if < 0.0
|
||||
MOV result.color, tex;
|
||||
#else
|
||||
TEX result.color, fragment.texcoord[0], texture[0], 2D;
|
||||
#endif
|
||||
END
|
||||
20
binaries/data/mods/mod/shaders/arb/solid_tex.vp
Normal file
20
binaries/data/mods/mod/shaders/arb/solid_tex.vp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
!!ARBvp1.0
|
||||
#ifdef USE_INSTANCING
|
||||
PARAM instancingTransform[4] = { program.local[0..3] };
|
||||
TEMP position;
|
||||
DP4 position.x, instancingTransform[0], vertex.position;
|
||||
DP4 position.y, instancingTransform[1], vertex.position;
|
||||
DP4 position.z, instancingTransform[2], vertex.position;
|
||||
MOV position.w, 1.0;
|
||||
#else
|
||||
ATTRIB position = vertex.position;
|
||||
#endif
|
||||
|
||||
PARAM transform[4] = { program.local[4..7] };
|
||||
|
||||
DP4 result.position.x, transform[0], position;
|
||||
DP4 result.position.y, transform[1], position;
|
||||
DP4 result.position.z, transform[2], position;
|
||||
DP4 result.position.w, transform[3], position;
|
||||
MOV result.texcoord[0], vertex.texcoord[0];
|
||||
END
|
||||
28
binaries/data/mods/mod/shaders/arb/terrain_base.xml
Normal file
28
binaries/data/mods/mod/shaders/arb/terrain_base.xml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<program type="arb">
|
||||
|
||||
<vertex file="arb/terrain_common.vp">
|
||||
<uniform name="sunColor" loc="0" type="vec3"/>
|
||||
<uniform name="textureTransform" loc="1" type="vec2"/>
|
||||
<uniform name="losTransform" loc="2" type="vec2"/>
|
||||
<uniform name="shadowTransform" loc="3" type="mat4"/>
|
||||
<uniform name="shadowScale" loc="7" type="vec4"/>
|
||||
<uniform name="sunDir" loc="8" type="vec3"/>
|
||||
<uniform name="transform" loc="9" type="mat4"/>
|
||||
<stream name="pos"/>
|
||||
<stream name="normal"/>
|
||||
<stream name="uv0"/>
|
||||
<stream name="uv1" if="BLEND"/>
|
||||
</vertex>
|
||||
|
||||
<fragment file="arb/terrain_common.fp">
|
||||
<uniform name="baseTex" loc="0" type="sampler2D"/>
|
||||
<uniform name="blendTex" loc="1" type="sampler2D" if="BLEND"/>
|
||||
<uniform name="shadowTex" loc="2" type="sampler2DShadow"/>
|
||||
<uniform name="losTex" loc="3" type="sampler2D"/>
|
||||
<uniform name="shadingColor" loc="1" type="vec3" if="DECAL"/>
|
||||
<uniform name="ambient" loc="0" type="vec3"/>
|
||||
<uniform name="shadowScale" loc="2" type="vec4"/>
|
||||
</fragment>
|
||||
|
||||
</program>
|
||||
30
binaries/data/mods/mod/shaders/arb/terrain_blend.xml
Normal file
30
binaries/data/mods/mod/shaders/arb/terrain_blend.xml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<program type="arb">
|
||||
|
||||
<define name="BLEND" value="1"/>
|
||||
|
||||
<vertex file="arb/terrain_common.vp">
|
||||
<uniform name="sunColor" loc="0" type="vec3"/>
|
||||
<uniform name="textureTransform" loc="1" type="vec2"/>
|
||||
<uniform name="losTransform" loc="2" type="vec2"/>
|
||||
<uniform name="shadowTransform" loc="3" type="mat4"/>
|
||||
<uniform name="shadowScale" loc="7" type="vec4"/>
|
||||
<uniform name="sunDir" loc="8" type="vec3"/>
|
||||
<uniform name="transform" loc="9" type="mat4"/>
|
||||
<stream name="pos"/>
|
||||
<stream name="normal"/>
|
||||
<stream name="uv0"/>
|
||||
<stream name="uv1"/>
|
||||
</vertex>
|
||||
|
||||
<fragment file="arb/terrain_common.fp">
|
||||
<uniform name="baseTex" loc="0" type="sampler2D"/>
|
||||
<uniform name="blendTex" loc="1" type="sampler2D"/>
|
||||
<uniform name="shadowTex" loc="2" type="sampler2DShadow"/>
|
||||
<uniform name="losTex" loc="3" type="sampler2D"/>
|
||||
|
||||
<uniform name="ambient" loc="0" type="vec3"/>
|
||||
<uniform name="shadowScale" loc="2" type="vec4"/>
|
||||
</fragment>
|
||||
|
||||
</program>
|
||||
101
binaries/data/mods/mod/shaders/arb/terrain_common.fp
Normal file
101
binaries/data/mods/mod/shaders/arb/terrain_common.fp
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
!!ARBfp1.0
|
||||
#if USE_FP_SHADOW
|
||||
OPTION ARB_fragment_program_shadow;
|
||||
#endif
|
||||
|
||||
PARAM ambient = program.local[0];
|
||||
|
||||
#if DECAL
|
||||
PARAM shadingColor = program.local[1];
|
||||
#endif
|
||||
|
||||
#if USE_FP_SHADOW && USE_SHADOW_PCF
|
||||
PARAM shadowScale = program.local[2];
|
||||
TEMP offset, size, weight, depthSample;
|
||||
#endif
|
||||
|
||||
TEMP tex;
|
||||
TEMP temp;
|
||||
TEMP diffuse;
|
||||
TEMP color;
|
||||
|
||||
#if BLEND
|
||||
// Use alpha from blend texture
|
||||
// TODO: maybe we should invert the texture instead of doing SUB here?
|
||||
TEX tex.a, fragment.texcoord[1], texture[1], 2D;
|
||||
SUB result.color.a, 1.0, tex.a;
|
||||
#endif
|
||||
|
||||
// Load diffuse color
|
||||
TEX color, fragment.texcoord[0], texture[0], 2D;
|
||||
|
||||
#if DECAL
|
||||
// Use alpha from main texture
|
||||
MOV result.color.a, color;
|
||||
#endif
|
||||
|
||||
// Compute color = texture * (ambient + diffuse*shadow)
|
||||
// (diffuse is 2*fragment.color due to clamp-avoidance in the vertex program)
|
||||
#if USE_SHADOW && !DISABLE_RECEIVE_SHADOWS
|
||||
TEMP shadowBias;
|
||||
TEMP biasedShdw;
|
||||
MOV shadowBias.x, 0.0005;
|
||||
MOV biasedShdw, fragment.texcoord[2];
|
||||
SUB biasedShdw.z, fragment.texcoord[2].z, shadowBias.x;
|
||||
#if USE_FP_SHADOW
|
||||
#if USE_SHADOW_PCF
|
||||
SUB offset.xy, fragment.texcoord[2], 0.5;
|
||||
FRC offset.xy, offset;
|
||||
ADD size.xy, offset, 1.0;
|
||||
SUB size.zw, 2.0, offset.xyxy;
|
||||
|
||||
MAD offset.xy, -0.5, offset, fragment.texcoord[2];
|
||||
MOV offset.z, biasedShdw.z;
|
||||
ADD weight, { 1.0, 1.0, -0.5, -0.5 }, offset.xyxy;
|
||||
MUL weight, weight, shadowScale.zwzw;
|
||||
|
||||
MOV offset.xy, weight.zwww;
|
||||
TEX depthSample.r, offset, texture[2], SHADOW2D;
|
||||
MOV temp.x, depthSample.r;
|
||||
MOV offset.x, weight.x;
|
||||
TEX depthSample.r, offset, texture[2], SHADOW2D;
|
||||
MOV temp.y, depthSample.r;
|
||||
MOV offset.xy, weight.zyyy;
|
||||
TEX depthSample.r, offset, texture[2], SHADOW2D;
|
||||
MOV temp.z, depthSample.r;
|
||||
MOV offset.x, weight.x;
|
||||
TEX depthSample.r, offset, texture[2], SHADOW2D;
|
||||
MOV temp.w, depthSample.r;
|
||||
|
||||
MUL size, size.zxzx, size.wwyy;
|
||||
DP4 temp.x, temp, size;
|
||||
MUL temp.x, temp.x, 0.111111;
|
||||
#else
|
||||
TEX temp.x, biasedShdw, texture[2], SHADOW2D;
|
||||
#endif
|
||||
#else
|
||||
TEX tex, fragment.texcoord[2], texture[2], 2D;
|
||||
MOV_SAT temp.z, biasedShdw.z;
|
||||
SGE temp.x, tex.x, temp.z;
|
||||
#endif
|
||||
MUL diffuse.rgb, fragment.color, 2.0;
|
||||
MAD temp.rgb, diffuse, temp.x, ambient;
|
||||
MUL color.rgb, color, temp;
|
||||
#else
|
||||
MAD temp.rgb, fragment.color, 2.0, ambient;
|
||||
MUL color.rgb, color, temp;
|
||||
#endif
|
||||
|
||||
// Multiply everything by the LOS texture
|
||||
TEX tex.r, fragment.texcoord[3], texture[3], 2D;
|
||||
SUB tex.r, tex.r, 0.03;
|
||||
MUL tex.r, tex.r, 0.97;
|
||||
MUL color.rgb, color, tex.r;
|
||||
|
||||
#if DECAL
|
||||
MUL result.color.rgb, color, shadingColor;
|
||||
#else
|
||||
MOV result.color.rgb, color;
|
||||
#endif
|
||||
|
||||
END
|
||||
74
binaries/data/mods/mod/shaders/arb/terrain_common.vp
Normal file
74
binaries/data/mods/mod/shaders/arb/terrain_common.vp
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
!!ARBvp1.0
|
||||
PARAM sunColor = program.local[0];
|
||||
PARAM textureTransform = program.local[1];
|
||||
PARAM losTransform = program.local[2];
|
||||
PARAM shadowTransform[4] = { program.local[3..6] };
|
||||
PARAM sunDir = program.local[8];
|
||||
PARAM transform[4] = { program.local[9..12] };
|
||||
|
||||
#if USE_FP_SHADOW && USE_SHADOW_PCF
|
||||
PARAM shadowScale = program.local[7];
|
||||
#endif
|
||||
|
||||
TEMP lighting;
|
||||
|
||||
TEMP terrainTextureTransform;
|
||||
MOV terrainTextureTransform, textureTransform;
|
||||
MOV terrainTextureTransform.z, -textureTransform.y;
|
||||
MOV terrainTextureTransform.w, 0;
|
||||
|
||||
//// Compute position and normal:
|
||||
|
||||
ATTRIB position = vertex.position;
|
||||
|
||||
DP4 result.position.x, transform[0], position;
|
||||
DP4 result.position.y, transform[1], position;
|
||||
DP4 result.position.z, transform[2], position;
|
||||
DP4 result.position.w, transform[3], position;
|
||||
|
||||
//// Compute lighting:
|
||||
|
||||
// Diffuse factor is precomputed in vertex attribute
|
||||
// Scale diffuse to allow overbrightness (since result.color will be clamped to [0, 1])
|
||||
//
|
||||
DP3 lighting, -sunDir, vertex.normal;
|
||||
MAX lighting, 0.0, lighting; // DP3_SAT isn't available here.
|
||||
MUL lighting, lighting, 0.5;
|
||||
// Apply light color
|
||||
MUL result.color, lighting, sunColor;
|
||||
|
||||
//// Texture coordinates:
|
||||
|
||||
#if DECAL
|
||||
MOV result.texcoord[0], vertex.texcoord[0];
|
||||
#else
|
||||
// Compute texcoords from position and terrain-texture-dependent transform.
|
||||
// textureTransform is stored as [c, -s, s, 0],
|
||||
// and we want texcoord = (x*c + z*-s, x*-s + z*-c, 0, 1)
|
||||
DP3 result.texcoord[0].x, terrainTextureTransform.xyww, position.xzww;
|
||||
DP3 result.texcoord[0].y, -terrainTextureTransform.zxww, position.xzww;
|
||||
MOV result.texcoord[0].z, 0;
|
||||
MOV result.texcoord[0].w, 1;
|
||||
#endif
|
||||
|
||||
#if BLEND
|
||||
MOV result.texcoord[1], vertex.texcoord[1];
|
||||
#endif
|
||||
|
||||
#if USE_SHADOW
|
||||
#if USE_FP_SHADOW && USE_SHADOW_PCF
|
||||
TEMP shadowtc;
|
||||
DP4 shadowtc.x, shadowTransform[0], position;
|
||||
DP4 shadowtc.y, shadowTransform[1], position;
|
||||
MUL result.texcoord[2].xy, shadowtc, shadowScale;
|
||||
#else
|
||||
DP4 result.texcoord[2].x, shadowTransform[0], position;
|
||||
DP4 result.texcoord[2].y, shadowTransform[1], position;
|
||||
#endif
|
||||
DP4 result.texcoord[2].z, shadowTransform[2], position;
|
||||
DP4 result.texcoord[2].w, shadowTransform[3], position;
|
||||
#endif
|
||||
|
||||
MAD result.texcoord[3], position.xzzz, losTransform.x, losTransform.y;
|
||||
|
||||
END
|
||||
29
binaries/data/mods/mod/shaders/arb/terrain_decal.xml
Normal file
29
binaries/data/mods/mod/shaders/arb/terrain_decal.xml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<program type="arb">
|
||||
|
||||
<define name="DECAL" value="1"/>
|
||||
|
||||
<vertex file="arb/terrain_common.vp">
|
||||
<uniform name="sunColor" loc="0" type="vec3"/>
|
||||
<uniform name="textureTransform" loc="1" type="vec2"/>
|
||||
<uniform name="losTransform" loc="2" type="vec2"/>
|
||||
<uniform name="shadowTransform" loc="3" type="mat4"/>
|
||||
<uniform name="shadowScale" loc="7" type="vec4"/>
|
||||
<uniform name="sunDir" loc="8" type="vec3"/>
|
||||
<uniform name="transform" loc="9" type="mat4"/>
|
||||
<stream name="pos"/>
|
||||
<stream name="normal"/>
|
||||
<stream name="uv0"/>
|
||||
</vertex>
|
||||
|
||||
<fragment file="arb/terrain_common.fp">
|
||||
<uniform name="baseTex" loc="0" type="sampler2D"/>
|
||||
<uniform name="shadowTex" loc="2" type="sampler2DShadow"/>
|
||||
<uniform name="losTex" loc="3" type="sampler2D"/>
|
||||
|
||||
<uniform name="ambient" loc="0" type="vec3"/>
|
||||
<uniform name="shadingColor" loc="1" type="vec3"/>
|
||||
<uniform name="shadowScale" loc="2" type="vec4"/>
|
||||
</fragment>
|
||||
|
||||
</program>
|
||||
19
binaries/data/mods/mod/shaders/arb/water_simple.fp
Normal file
19
binaries/data/mods/mod/shaders/arb/water_simple.fp
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
!!ARBfp1.0
|
||||
|
||||
PARAM color = program.local[2];
|
||||
|
||||
ATTRIB v_coords = fragment.texcoord[0];
|
||||
ATTRIB v_losCoords = fragment.texcoord[1];
|
||||
|
||||
TEMP diffuse;
|
||||
TEX diffuse, v_coords, texture[0], 2D;
|
||||
MUL diffuse, diffuse, color;
|
||||
|
||||
TEMP los;
|
||||
TEX los, v_losCoords, texture[1], 2D;
|
||||
SUB los.r, los.r, 0.03;
|
||||
MUL los.r, los.r, 0.97;
|
||||
MUL diffuse, diffuse, los.r;
|
||||
|
||||
MOV result.color, diffuse;
|
||||
END
|
||||
39
binaries/data/mods/mod/shaders/arb/water_simple.vp
Normal file
39
binaries/data/mods/mod/shaders/arb/water_simple.vp
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
!!ARBvp1.0
|
||||
|
||||
ATTRIB position = vertex.position;
|
||||
|
||||
PARAM transform[4] = { program.local[0..3] };
|
||||
PARAM losTransform = program.local[4];
|
||||
PARAM time = program.local[5];
|
||||
|
||||
OUTPUT v_coords = result.texcoord[0];
|
||||
OUTPUT v_losCoords = result.texcoord[1];
|
||||
|
||||
DP4 result.position.x, transform[0], position;
|
||||
DP4 result.position.y, transform[1], position;
|
||||
DP4 result.position.z, transform[2], position;
|
||||
DP4 result.position.w, transform[3], position;
|
||||
|
||||
TEMP tx;
|
||||
MUL tx, time, -0.01235; // 1.0 / 81.0
|
||||
FRC tx, tx;
|
||||
TEMP tz;
|
||||
MUL tz, time, -0.02941; // 1.0 / 34.0
|
||||
FRC tz, tz;
|
||||
TEMP offset;
|
||||
MOV offset.x, tx;
|
||||
MOV offset.z, tz;
|
||||
|
||||
TEMP coords;
|
||||
// Divide by period 16 and add offset.
|
||||
MAD coords, position, 0.0625, offset;
|
||||
ADD coords, coords, offset;
|
||||
MOV v_coords, coords.xzxz;
|
||||
|
||||
TEMP losCoords;
|
||||
MOV losCoords, position.xzxz;
|
||||
MUL losCoords, losCoords, losTransform.xxxx;
|
||||
ADD losCoords, losCoords, losTransform.yyyy;
|
||||
MOV v_losCoords, losCoords.xyxy;
|
||||
|
||||
END
|
||||
17
binaries/data/mods/mod/shaders/arb/water_simple.xml
Normal file
17
binaries/data/mods/mod/shaders/arb/water_simple.xml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<program type="arb">
|
||||
|
||||
<vertex file="arb/water_simple.vp">
|
||||
<stream name="pos"/>
|
||||
<uniform name="transform" loc="0" type="mat4"/>
|
||||
<uniform name="losTransform" loc="4" type="vec2"/>
|
||||
<uniform name="time" loc="5" type="float"/>
|
||||
</vertex>
|
||||
|
||||
<fragment file="arb/water_simple.fp">
|
||||
<uniform name="baseTex" loc="0" type="sampler2D"/>
|
||||
<uniform name="losTex" loc="1" type="sampler2D"/>
|
||||
<uniform name="color" loc="2" type="vec4"/>
|
||||
</fragment>
|
||||
|
||||
</program>
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<effect>
|
||||
<technique>
|
||||
<require shaders="arb"/>
|
||||
<require shaders="glsl"/>
|
||||
<require shaders="spirv"/>
|
||||
<pass shader="canvas2d">
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<effect>
|
||||
<technique>
|
||||
<require shaders="glsl"/>
|
||||
<require shaders="spirv"/>
|
||||
<compute shader="compute_resolve_pbr"/>
|
||||
</technique>
|
||||
</effect>
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue