Commit ada7abcf63dc4d701e81f4f6855c11fea89c3ef9

Authored by DarkGod
1 parent 2d971436

Added ingame credits

... ... @@ -20,6 +20,7 @@ General:
20 20 - Hachem Muche for many patches and scaling issues
21 21 - Dekar for artifacts, debug help (slave? ;> ), icons, ...
22 22 - Shibari for artifacts and talents balancing
  23 +- Sage Acrin
23 24
24 25 Lore:
25 26 - Darren Grey
... ...
... ... @@ -68,3 +68,10 @@ tombstone = {
68 68 frame_oy1 = -16,
69 69 frame_oy2 = 16,
70 70 }
  71 +
  72 +invisible = {
  73 + frame_ox1 = 0,
  74 + frame_ox2 = 0,
  75 + frame_oy1 = 0,
  76 + frame_oy2 = 0,
  77 +}
... ...
... ... @@ -155,8 +155,10 @@ function _M:display(nb_keyframes)
155 155 self.flyers:display(nb_keyframes)
156 156 end
157 157
158   - if not self.suppressDialogs then
159   - for i, d in ipairs(self.dialogs) do
  158 + if not self.suppressDialogs and #self.dialogs then
  159 + local last = self.dialogs[#self.dialogs]
  160 + for i = last and last.__show_only and #self.dialogs or 1, #self.dialogs do
  161 + local d = self.dialogs[i]
160 162 d:display()
161 163 d:toScreen(d.display_x, d.display_y, nb_keyframes)
162 164 end
... ...
... ... @@ -372,8 +372,10 @@ function _M:display(nb_keyframes)
372 372 end
373 373 self.background:toScreenFull(x, y, w, h, w * self.background_tw / self.background_w, h * self.background_th / self.background_h)
374 374 end
375   - self.tooltip:display()
376   - self.tooltip:toScreen(5, 5)
  375 + if #self.dialogs == 0 or not self.dialogs[#self.dialogs].__show_only then
  376 + self.tooltip:display()
  377 + self.tooltip:toScreen(5, 5)
  378 + end
377 379 self.logdisplay:toScreen()
378 380 engine.GameEnergyBased.display(self, nb_keyframes)
379 381 if self.full_fbo then self.full_fbo:use(false) self.full_fbo:toScreen(0, 0, self.w, self.h, self.full_fbo_shader.shad) end
... ... @@ -410,8 +412,10 @@ function _M:display(nb_keyframes)
410 412 -- core.display.drawQuad(0, 0, game.w, game.h, 128, 128, 128, 128)
411 413 end
412 414
413   - self.tooltip:display()
414   - self.tooltip:toScreen(5, 5)
  415 + if #self.dialogs == 0 or not self.dialogs[#self.dialogs].__show_only then
  416 + self.tooltip:display()
  417 + self.tooltip:toScreen(5, 5)
  418 + end
415 419
416 420 self.logdisplay:toScreen()
417 421
... ...
  1 +uniform sampler2D tex;
  2 +uniform sampler2D flames;
  3 +
  4 +uniform float alpha;
  5 +uniform float tick;
  6 +uniform float time_factor;
  7 +uniform float flameScale;
  8 +
  9 +vec4 permute( vec4 x ) {
  10 +
  11 + return mod( ( ( x * 34.0 ) + 1.0 ) * x, 289.0 );
  12 +
  13 +}
  14 +
  15 +vec4 taylorInvSqrt( vec4 r ) {
  16 +
  17 + return 1.79284291400159 - 0.85373472095314 * r;
  18 +
  19 +}
  20 +
  21 +float snoise( vec3 v ) {
  22 +
  23 + const vec2 C = vec2( 1.0 / 6.0, 1.0 / 3.0 );
  24 + const vec4 D = vec4( 0.0, 0.5, 1.0, 2.0 );
  25 +
  26 + // First corner
  27 +
  28 + vec3 i = floor( v + dot( v, C.yyy ) );
  29 + vec3 x0 = v - i + dot( i, C.xxx );
  30 +
  31 + // Other corners
  32 +
  33 + vec3 g = step( x0.yzx, x0.xyz );
  34 + vec3 l = 1.0 - g;
  35 + vec3 i1 = min( g.xyz, l.zxy );
  36 + vec3 i2 = max( g.xyz, l.zxy );
  37 +
  38 + vec3 x1 = x0 - i1 + 1.0 * C.xxx;
  39 + vec3 x2 = x0 - i2 + 2.0 * C.xxx;
  40 + vec3 x3 = x0 - 1. + 3.0 * C.xxx;
  41 +
  42 + // Permutations
  43 +
  44 + i = mod( i, 289.0 );
  45 + vec4 p = permute( permute( permute(
  46 + i.z + vec4( 0.0, i1.z, i2.z, 1.0 ) )
  47 + + i.y + vec4( 0.0, i1.y, i2.y, 1.0 ) )
  48 + + i.x + vec4( 0.0, i1.x, i2.x, 1.0 ) );
  49 +
  50 + // Gradients
  51 + // ( N*N points uniformly over a square, mapped onto an octahedron.)
  52 +
  53 + float n_ = 1.0 / 7.0; // N=7
  54 +
  55 + vec3 ns = n_ * D.wyz - D.xzx;
  56 +
  57 + vec4 j = p - 49.0 * floor( p * ns.z *ns.z ); // mod(p,N*N)
  58 +
  59 + vec4 x_ = floor( j * ns.z );
  60 + vec4 y_ = floor( j - 7.0 * x_ ); // mod(j,N)
  61 +
  62 + vec4 x = x_ *ns.x + ns.yyyy;
  63 + vec4 y = y_ *ns.x + ns.yyyy;
  64 + vec4 h = 1.0 - abs( x ) - abs( y );
  65 +
  66 + vec4 b0 = vec4( x.xy, y.xy );
  67 + vec4 b1 = vec4( x.zw, y.zw );
  68 +
  69 +
  70 + vec4 s0 = floor( b0 ) * 2.0 + 1.0;
  71 + vec4 s1 = floor( b1 ) * 2.0 + 1.0;
  72 + vec4 sh = -step( h, vec4( 0.0 ) );
  73 +
  74 + vec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;
  75 + vec4 a1 = b1.xzyw + s1.xzyw * sh.zzww;
  76 +
  77 + vec3 p0 = vec3( a0.xy, h.x );
  78 + vec3 p1 = vec3( a0.zw, h.y );
  79 + vec3 p2 = vec3( a1.xy, h.z );
  80 + vec3 p3 = vec3( a1.zw, h.w );
  81 +
  82 + // Normalise gradients
  83 +
  84 + vec4 norm = taylorInvSqrt( vec4( dot( p0, p0 ), dot( p1, p1 ), dot( p2, p2 ), dot( p3, p3 ) ) );
  85 + p0 *= norm.x;
  86 + p1 *= norm.y;
  87 + p2 *= norm.z;
  88 + p3 *= norm.w;
  89 +
  90 + // Mix final noise value
  91 +
  92 + vec4 m = max( 0.6 - vec4( dot( x0, x0 ), dot( x1, x1 ), dot( x2, x2 ), dot( x3, x3 ) ), 0.0 );
  93 + m = m * m;
  94 + return 42.0 * dot( m*m, vec4( dot( p0, x0 ), dot( p1, x1 ),
  95 + dot( p2, x2 ), dot( p3, x3 ) ) );
  96 +
  97 +}
  98 +
  99 +vec2 snoise2(vec3 pos)
  100 +{
  101 + return vec2(snoise(pos), snoise(pos + vec3(0.0, 0.0, 1.0)));
  102 +}
  103 +
  104 +float GetFireDelta(float currTime, vec2 pos, float freqMult, float stretchMult, float scrollSpeed, float evolutionSpeed)
  105 +{
  106 + //firewall
  107 + float delta = 0.0;
  108 +// pos.y += (1.0 - pos.y) * 0.5;
  109 + //pos.y += 0.5;
  110 + pos.y /= stretchMult;
  111 + pos *= freqMult;
  112 + pos.y -= currTime * scrollSpeed;
  113 +// pos.y -= currTime * 3.0;
  114 +
  115 +
  116 + delta += snoise(vec3(pos * 1.0, currTime * 1.0 * evolutionSpeed)) * 1.5;
  117 + delta += snoise(vec3(pos * 2.0, currTime * 2.0 * evolutionSpeed)) * 1.5;
  118 + delta += snoise(vec3(pos * 4.0, currTime * 4.0 * evolutionSpeed)) * 1.5;
  119 + delta += snoise(vec3(pos * 8.0, currTime * 8.0 * evolutionSpeed)) * 1.5;
  120 + delta += snoise(vec3(pos * 16.0, currTime * 16.0 * evolutionSpeed)) * 0.5;
  121 +
  122 + return delta;
  123 +}
  124 +
  125 +vec4 GetFireAuraColor(float currTime, vec2 planarPos, float freqMult, float stretchMult, float ampMult, float power, float scrollSpeed, float paletteCoord)
  126 +{
  127 + float delta =
  128 + GetFireDelta(currTime, planarPos + vec2(currTime * scrollSpeed * 0.0, 0.0), freqMult, stretchMult, 2.5, 0.5) * (1.0 - planarPos.x) +
  129 + GetFireDelta(currTime, vec2(planarPos.x + currTime * scrollSpeed * 0.0 - 1.0, planarPos.y), freqMult, stretchMult, 2.5, 0.5) * planarPos.x;
  130 +
  131 + delta *= min(1.0, max(0.0, 1.0 * (1.0 - planarPos.y)));
  132 + delta *= min(1.0, max(0.0, 1.0 * (0.0 + planarPos.y)));
  133 +
  134 + float verticalPos = 1.0 - planarPos.y + delta * ampMult;
  135 + verticalPos = min(0.99, verticalPos);
  136 + verticalPos = max(0.01, verticalPos);
  137 +
  138 + return texture2D(flames, vec2(paletteCoord, verticalPos));
  139 +}
  140 +
  141 +
  142 +vec4 Uberblend(vec4 col0, vec4 col1)
  143 +{
  144 +// return vec4((1.0 - col0.a) * (col1.rgb) + col0.a * (col1.rgb * col1.a + col0.rgb * (1.0 - col1.a)), min(1.0, col0.a + col1.a));
  145 +// return vec4((1.0 - col1.a) * (col0.rgb) + col1.a * (col1.rgb * col1.a + col0.rgb * (1.0 - col1.a)), min(1.0, col0.a + col1.a));
  146 + return vec4(
  147 + (1.0 - col0.a) * (1.0 - col1.a) * (col0.rgb * col0.a + col1.rgb * col1.a) / (col0.a + col1.a + 1e-1) +
  148 + (1.0 - col0.a) * (0.0 + col1.a) * (col1.rgb) +
  149 + (0.0 + col0.a) * (1.0 - col1.a) * (col0.rgb * (1.0 - col1.a) + col1.rgb * col1.a) +
  150 + (0.0 + col0.a) * (0.0 + col1.a) * (col1.rgb),
  151 + min(1.0, col0.a + col1.a));
  152 +}
  153 +
  154 +
  155 +void main(void)
  156 +{
  157 + vec2 radius = gl_TexCoord[0].xy - vec2(0.5, 0.5);
  158 + float innerRadius = 0.25;
  159 + float outerRadius = 0.5;
  160 +
  161 + vec2 planarPos;
  162 + vec4 displacement = texture2D(tex, gl_TexCoord[0].xy);
  163 + planarPos.x = displacement.b;
  164 + planarPos.y = displacement.a * 3.0 * (1.0 + 10.0 * pow((planarPos.x) * (1.0 - planarPos.x) * 4.0, 1.0)) / max(flameScale, 1e-3);
  165 +
  166 + vec4 resultColor = vec4(0.0, 0.0, 0.0, 0.0);
  167 +
  168 + resultColor = GetFireAuraColor(tick / time_factor, planarPos, 6.0, 15.0 * max(flameScale, 1e-3), 1.0, 1.0, 1.0, 0.75);//texture2D(tex, gl_TexCoord[0].xy) * texture2D(flames, gl_TexCoord[0].xy) + 0.2;
  169 +
  170 + gl_FragColor = resultColor;
  171 + gl_FragColor.a *= alpha;
  172 +}
\ No newline at end of file
... ...
  1 +-- ToME - Tales of Maj'Eyal
  2 +-- Copyright (C) 2009 - 2014 Nicolas Casalini
  3 +--
  4 +-- This program is free software: you can redistribute it and/or modify
  5 +-- it under the terms of the GNU General Public License as published by
  6 +-- the Free Software Foundation, either version 3 of the License, or
  7 +-- (at your option) any later version.
  8 +--
  9 +-- This program is distributed in the hope that it will be useful,
  10 +-- but WITHOUT ANY WARRANTY; without even the implied warranty of
  11 +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12 +-- GNU General Public License for more details.
  13 +--
  14 +-- You should have received a copy of the GNU General Public License
  15 +-- along with this program. If not, see <http://www.gnu.org/licenses/>.
  16 +--
  17 +-- Nicolas Casalini "DarkGod"
  18 +-- darkgod@te4.org
  19 +
  20 +return {
  21 + frag = "awesomeaura",
  22 + vert = nil,
  23 + args = {
  24 + tex = { texture = 0 },
  25 + flames = { texture = 1 },
  26 + alpha = alpha or 1,
  27 + time_factor = time_factor or 4000,
  28 + flameScale = flame_scale or 1,
  29 + },
  30 + clone = false,
  31 +}
... ...
  1 +uniform sampler2D displMapTex;
  2 +uniform sampler2D normalMapTex;
  3 +
  4 +uniform float spikeLength;
  5 +uniform float spikeWidth;
  6 +uniform float spikeOffset;
  7 +
  8 +uniform float growthSpeed;
  9 +
  10 +uniform float tick;
  11 +uniform float tick_start;
  12 +uniform float time_factor;
  13 +
  14 +uniform vec3 color;
  15 +
  16 +void main(void)
  17 +{
  18 + vec2 radius = gl_TexCoord[0].xy - vec2(0.5, 0.5);
  19 + float innerRadius = 0.25;
  20 + float outerRadius = 0.5;
  21 +
  22 + vec2 planarPos;
  23 + vec4 displacement = texture2D(displMapTex, gl_TexCoord[0].xy);
  24 +
  25 + vec2 point = gl_TexCoord[0].xy;
  26 + float eps = 0.05;
  27 + vec2 basisY = vec2(
  28 + texture2D(displMapTex, point + vec2(eps, 0.0)).a - texture2D(displMapTex, point + vec2(-eps, 0.0)).a,
  29 + -texture2D(displMapTex, point + vec2(0.0, eps)).a + texture2D(displMapTex, point + vec2(0.0, -eps)).a);
  30 + basisY /= length(basisY) + 0.001;
  31 + vec2 basisX = vec2(basisY.y, -basisY.x);
  32 +
  33 + planarPos.x = displacement.b * 6.0 / spikeWidth + spikeOffset;
  34 + planarPos.y = displacement.a * 20.0 / (spikeLength * clamp((tick - tick_start) / time_factor * growthSpeed, 0.0, 1.0) + 0.001);
  35 +
  36 + vec4 normalMap = texture2D(normalMapTex, vec2(planarPos.x, clamp(1.0 - planarPos.y, 0.01, 0.99)));
  37 + vec3 localNormal = normalMap.rgb;
  38 + localNormal -= vec3(0.5, 0.5, 0.5);
  39 + localNormal.x = -localNormal.x;
  40 + localNormal.z = -localNormal.z;
  41 + localNormal /= length(localNormal);
  42 +
  43 + vec3 globalNormal;
  44 + globalNormal.xy = basisX * localNormal.x + basisY * localNormal.y;
  45 + globalNormal.z = localNormal.z;
  46 +
  47 + vec2 lightDir2 = vec2(cos(tick / time_factor), sin(tick / time_factor));
  48 + float ang = 3.1415 * 0.2;
  49 + vec3 lightDir3 = vec3(lightDir2 * sin(ang), cos(ang));
  50 +
  51 + float diffuse = clamp(-dot(lightDir3, globalNormal), 0.0, 1.0);
  52 + float specular = 0.0;
  53 + if(dot(lightDir3, globalNormal) < 0.0)
  54 + {
  55 + vec3 reflectedLight = lightDir3 - globalNormal * dot(lightDir3, globalNormal) * 2.0;
  56 + specular += pow(clamp(-dot(reflectedLight, vec3(0.0, 0.0, 1.0)), 0.0, 1.0), 30.0);
  57 + }
  58 + //vec3(0.624, 0.820, 0.933);
  59 + vec4 resultColor = vec4(color * diffuse + vec3(1.0, 1.0, 1.0) * specular, normalMap.a * gl_Color.a);
  60 +
  61 + gl_FragColor = resultColor;///
  62 +}
\ No newline at end of file
... ...
  1 +-- ToME - Tales of Maj'Eyal
  2 +-- Copyright (C) 2009, 2010, 2011, 2012, 2013 Nicolas Casalini
  3 +--
  4 +-- This program is free software: you can redistribute it and/or modify
  5 +-- it under the terms of the GNU General Public License as published by
  6 +-- the Free Software Foundation, either version 3 of the License, or
  7 +-- (at your option) any later version.
  8 +--
  9 +-- This program is distributed in the hope that it will be useful,
  10 +-- but WITHOUT ANY WARRANTY; without even the implied warranty of
  11 +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12 +-- GNU General Public License for more details.
  13 +--
  14 +-- You should have received a copy of the GNU General Public License
  15 +-- along with this program. If not, see <http://www.gnu.org/licenses/>.
  16 +--
  17 +-- Nicolas Casalini "DarkGod"
  18 +-- darkgod@te4.org
  19 +
  20 +return {
  21 + frag = "crystalineaura",
  22 + vert = nil,
  23 + args = {
  24 + displMapTex = { texture = 0 },
  25 + normalMapTex = { texture = 1 },
  26 +
  27 + spikeLength = spikeLength or 1.0, -- 1.0 means normal length, 0.5 is half-sized spikes, 2.0 is double-sized, etc
  28 + spikeWidth = spikeWidth or 1.0, -- use different values for different effects. 1.0 is normal width
  29 + spikeOffset = spikeOffset or 0.0, -- use different values for different effects. such as offset = 0.0 for ice spikes and 0.123123 for rock spikes
  30 +
  31 + growthSpeed = growthSpeed or 1.0, -- 1.0 is normal growth speed
  32 +
  33 + time_factor = time_factor or 500,
  34 +
  35 + color = color or {0.624, 0.820, 0.933},
  36 + },
  37 + resetargs = {
  38 + tick_start = function() return core.game.getTime() end,
  39 + },
  40 + clone = false,
  41 +}
... ...
  1 +uniform sampler2D tex;
  2 +uniform vec2 textSize;
  3 +uniform float intensity;
  4 +uniform vec2 outlineSize;
  5 +uniform vec4 outlineColor;
  6 +
  7 +void main(void)
  8 +{
  9 + float xOffset = outlineSize.x / textSize.x;
  10 + float yOffset = outlineSize.y / textSize.y;
  11 +
  12 + gl_FragColor = texture2D(tex, gl_TexCoord[0].xy); //default text color
  13 +
  14 + //sobel distance to glyph base line approximation
  15 + vec4 col02 = texture2D(tex, gl_TexCoord[0].xy + vec2(xOffset, -yOffset));
  16 + vec4 col12 = texture2D(tex, gl_TexCoord[0].xy + vec2(xOffset, 0.0 ));
  17 + vec4 col22 = texture2D(tex, gl_TexCoord[0].xy + vec2(xOffset, yOffset));
  18 + vec4 col01 = texture2D(tex, gl_TexCoord[0].xy + vec2(0.0, -yOffset));
  19 + vec4 col21 = texture2D(tex, gl_TexCoord[0].xy + vec2(0.0, yOffset));
  20 + vec4 col00 = texture2D(tex, gl_TexCoord[0].xy + vec2(-xOffset, -yOffset));
  21 + vec4 col10 = texture2D(tex, gl_TexCoord[0].xy + vec2(-xOffset, 0.0 ));
  22 + vec4 col20 = texture2D(tex, gl_TexCoord[0].xy + vec2(-xOffset, yOffset));
  23 +
  24 +
  25 + float xDist = 0.0 - col00.a - col01.a * 2.0 - col02.a + col20.a + col21.a * 2.0 + col22.a;
  26 + float yDist = 0.0 - col00.a + col02.a - col10.a * 2.0 + col12.a * 2.0 - col20.a + col22.a;
  27 +
  28 + //transperency of current outline pixel
  29 + float alpha = min(1.0, sqrt(xDist * xDist + yDist * yDist) * intensity);
  30 +
  31 + //outlineColor = vec4(0, 0, 0, 1);
  32 + //blending character glyph over its outline
  33 + gl_FragColor = (gl_FragColor * gl_FragColor.a + outlineColor * alpha * (1.0 - gl_FragColor.a)) * gl_Color;
  34 +}
... ...
  1 +-- ToME - Tales of Maj'Eyal
  2 +-- Copyright (C) 2009 - 2014 Nicolas Casalini
  3 +--
  4 +-- This program is free software: you can redistribute it and/or modify
  5 +-- it under the terms of the GNU General Public License as published by
  6 +-- the Free Software Foundation, either version 3 of the License, or
  7 +-- (at your option) any later version.
  8 +--
  9 +-- This program is distributed in the hope that it will be useful,
  10 +-- but WITHOUT ANY WARRANTY; without even the implied warranty of
  11 +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12 +-- GNU General Public License for more details.
  13 +--
  14 +-- You should have received a copy of the GNU General Public License
  15 +-- along with this program. If not, see <http://www.gnu.org/licenses/>.
  16 +--
  17 +-- Nicolas Casalini "DarkGod"
  18 +-- darkgod@te4.org
  19 +
  20 +return {
  21 + frag = "textoutline",
  22 + vert = nil,
  23 + args = {
  24 + tex = { texture = 0 },
  25 + textSize = textSize or {1, 1},
  26 + intensity = intensity or 0.5,
  27 + outlineSize = outlineSize or {1, 1},
  28 + outlineColor = outlineColor or {0, 0, 0, 1},
  29 + },
  30 + clone = false,
  31 + permanent = true,
  32 +}
... ...
  1 +-- TE4 - T-Engine 4
  2 +-- Copyright (C) 2009 - 2014 Nicolas Casalini
  3 +--
  4 +-- This program is free software: you can redistribute it and/or modify
  5 +-- it under the terms of the GNU General Public License as published by
  6 +-- the Free Software Foundation, either version 3 of the License, or
  7 +-- (at your option) any later version.
  8 +--
  9 +-- This program is distributed in the hope that it will be useful,
  10 +-- but WITHOUT ANY WARRANTY; without even the implied warranty of
  11 +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12 +-- GNU General Public License for more details.
  13 +--
  14 +-- You should have received a copy of the GNU General Public License
  15 +-- along with this program. If not, see <http://www.gnu.org/licenses/>.
  16 +--
  17 +-- Nicolas Casalini "DarkGod"
  18 +-- darkgod@te4.org
  19 +
  20 +require "engine.class"
  21 +local Dialog = require "engine.ui.Dialog"
  22 +local Shader = require "engine.Shader"
  23 +
  24 +module(..., package.seeall, class.inherit(Dialog))
  25 +
  26 +__show_only = true
  27 +
  28 +local title_font = core.display.newFont("/data/font/DroidSans-Bold.ttf", 32)
  29 +local aura = {
  30 + Shader.new("awesomeaura", {flameScale=0.6, time_factor=8000}),
  31 + Shader.new("crystalineaura", {time_factor=8000}),
  32 +}
  33 +local aura_texture = {
  34 + core.display.loadImage("/data/gfx/flame_credits.png"):glTexture(),
  35 + core.display.loadImage("/data/gfx/spikes_credits.png"):glTexture(),
  36 +}
  37 +local fallback_colors = {
  38 + colors.GOLD,
  39 + colors.FIREBRICK,
  40 +}
  41 +local outline = Shader.new("textoutline", {})
  42 +
  43 +local credits = {
  44 + {img="/data/gfx/background/tome-logo.png"},
  45 + false,
  46 + {"Project Lead", title=1},
  47 + {"Nicolas 'DarkGod' Casalini"},
  48 + false,
  49 + false,
  50 +
  51 + {"Lead Coder", title=2},
  52 + {"Nicolas 'DarkGod' Casalini"},
  53 + false,
  54 + false,
  55 +
  56 + {"World Builders", title=1},
  57 + {"Aaron 'Sage Acrin' Vandegrift"},
  58 + {"Chris 'Shibari' Davidson"},
  59 + {"Em 'Susramanian' Jay"},
  60 + {"Eric 'Edge2054' Wykoff"},
  61 + {"Hetdegon"},
  62 + {"John 'Benli' Truchard"},
  63 + {"Shoob"},
  64 + {"Taylor 'PureQuestion' Miller"},
  65 + false,
  66 + false,
  67 +
  68 + {"Graphic Artists", title=2},
  69 + {"Assen 'Rexorcorum' Kanev"},
  70 + {"Raymond 'Shockbolt' Gaustadnes"},
  71 + false,
  72 + false,
  73 +
  74 + {"Expert Shaders Design", title=1},
  75 + {"Alex 'Suslik' Sannikov"},
  76 + false,
  77 + false,
  78 +
  79 + {"Musics", title=2},
  80 + {"Anne van Schothorst"},
  81 + {"Carlos Saura"},
  82 + {"Matti Paalanen - 'Celestial Aeon Project'"},
  83 + false,
  84 + false,
  85 +
  86 + {"Sound Designer", title=1},
  87 + {"Ryan Sim"},
  88 + false,
  89 + false,
  90 +
  91 + {"Lore Creation and Writing", title=2},
  92 + {"Burb Lulls"},
  93 + {"Darren Grey"},
  94 + {"Gwai"},
  95 + {"Nicolas 'DarkGod' Casalini"},
  96 + {"Ron Billingsley"},
  97 + false,
  98 + false,
  99 +
  100 + {"Code Helpers", title=1},
  101 + {"Antagonist"},
  102 + {"Graziel"},
  103 + {"Hachem Muche"},
  104 + {"Jules Bean"},
  105 + {"Madmonk"},
  106 + {"Neil Stevens"},
  107 + {"Reenen Laurie"},
  108 + {"Shani"},
  109 + {"Tiger Eye"},
  110 + {"Yufra"},
  111 + false,
  112 + false,
  113 +
  114 + {"Community Manager", title=2},
  115 + {"Aura of the Dawn"},
  116 + {"Michael 'Dekar' Olscher"},
  117 + false,
  118 + false,
  119 +
  120 +
  121 + {"Text Editors", title=1},
  122 + {"Brian Jeffears"},
  123 + {"Greg Wooledge"},
  124 + {"Ralph Versteegen"},
  125 + false,
  126 + false,
  127 +
  128 + {"Others", title=2},
  129 + {"J.R.R Tolkien - making the world an interresting place"},
  130 + false,
  131 + {"Lua Creators - making the world a better place"},
  132 + {"Lua - http://lua.org/"},
  133 + {"LibSDL - http://libsdl.org/"},
  134 + {"OpenGL - http://www.opengl.org/"},
  135 + {"OpenAL - http://kcat.strangesoft.net/openal.html"},
  136 + {"zlib - http://www.zlib.net/"},
  137 + {"LuaJIT - http://luajit.org/"},
  138 + {"lpeg - http://www.inf.puc-rio.br/~roberto/lpeg/"},
  139 + {"LuaSocket - http://w3.impa.br/~diego/software/luasocket/"},
  140 + {"Physfs - https://icculus.org/physfs/"},
  141 + {"Font: Droid - http://www.droidfonts.com/"},
  142 + {"Font: Vera - http://www.gnome.org/fonts/"},
  143 + {"Font: INSULA, USENET: http://www.dafont.com/fr/apostrophic-labs.d128"},
  144 + {"Font: SVBasicManual: http://www.dafont.com/fr/johan-winge.d757"},
  145 + {"Font FSEX300: http://www.fixedsysexcelsior.com/"},
  146 + {"Font: square: http://strlen.com/square"},
  147 +}
  148 +
  149 +function _M:init()
  150 + self.ui = "invisible"
  151 + Dialog.init(self, "", game.w, game.h)
  152 +
  153 + self:loadUI{}
  154 + self:setupUI(false, false)
  155 +
  156 + self.key:addBinds{
  157 + EXIT = function() game:unregisterDialog(self) end,
  158 + }
  159 +
  160 + self.list = { self:makeEntry(credits[1]) }
  161 + self.next_credit = 2
  162 +end
  163 +
  164 +function _M:makeLogo(img)
  165 + local txt = {y=game.h}
  166 + local i, w, h = core.display.loadImage(img)
  167 + txt._tex, txt._tex_w, txt._tex_h = i:glTexture()
  168 + txt.w, txt.h = w, h
  169 + txt.step_h = h
  170 + txt.offset_y = 0
  171 + txt.img = true
  172 + return txt
  173 +end
  174 +
  175 +function _M:makeEntry(credit)
  176 + if not credit then return {none=true, y=game.h, h=32, step_h=32, offset_y=0} end
  177 +
  178 + if credit.img then return self:makeLogo(credit.img) end
  179 +
  180 + local txt
  181 + if credit.title then
  182 + local w, h = title_font:size(credit[1]) + 20, 32 * 2
  183 + local s = core.display.newSurface(w, h)
  184 + s:alpha(0)
  185 + s:drawStringBlended(title_font, credit[1], 10, 16, 255, 255, 255, false)
  186 + txt = {title=credit.title}
  187 + txt.w, txt.h = w, h
  188 + txt._tex, txt._tex_w, txt._tex_h = s:glTexture()
  189 + txt._texf = txt._tex:generateSDM(false)
  190 + txt.step_h = txt.h
  191 + txt.offset_y = 0
  192 + else
  193 + local w, h = title_font:size(credit[1]) + 20, 36
  194 + local s = core.display.newSurface(w, h)
  195 + s:alpha(0)
  196 + s:drawStringBlended(title_font, credit[1], 10, 0, 255, 255, 255, false)
  197 + txt = {}
  198 + txt.w, txt.h = w, h
  199 + txt._tex, txt._tex_w, txt._tex_h = s:glTexture()
  200 + txt.step_h = 32
  201 + txt.offset_y = 0
  202 + end
  203 + txt.y = game.h
  204 + return txt
  205 +end
  206 +
  207 +function _M:displayCredit(txt, x, y)
  208 + if txt.none then return end
  209 + local x, y = x + (game.w - txt.w) / 2, y + txt.y - txt.offset_y
  210 + if aura[1].shad and aura[2].shad then
  211 + if txt.title then
  212 + aura_texture[txt.title]:bind(1)
  213 + aura[txt.title].shad:use(true)
  214 + txt._texf:toScreenPrecise(x, y, txt.w, txt.h, 0, txt.w/txt._tex_w, 0, txt.h/txt._tex_h)
  215 + aura[txt.title].shad:use(false)
  216 +
  217 + outline.shad:use(true)
  218 + outline.shad:uniOutlineSize(0.7, 0.7)
  219 + outline.shad:uniTextSize(txt._tex_w, txt._tex_h)
  220 + txt._tex:toScreenFull(x, y, txt.w, txt.h, txt._tex_w, txt._tex_h)
  221 + outline.shad:use(false)
  222 + else
  223 + outline.shad:use(true)
  224 + outline.shad:uniOutlineSize(0.7, 0.7)
  225 + outline.shad:uniTextSize(txt._tex_w, txt._tex_h)
  226 + txt._tex:toScreenFull(x, y, txt.w, txt.h, txt._tex_w, txt._tex_h)
  227 + outline.shad:use(false)
  228 + end
  229 + else
  230 + if not txt.img then txt._tex:toScreenFull(x + 3, y + 3, txt.w, txt.h, txt._tex_w, txt._tex_h, 0, 0, 0, 1) end
  231 + if txt.title and not txt.img then
  232 + local c = fallback_colors[txt.title]
  233 + txt._tex:toScreenFull(x, y, txt.w, txt.h, txt._tex_w, txt._tex_h, c.r/255, c.g/255, c.b/255, 1)
  234 + else
  235 + txt._tex:toScreenFull(x, y, txt.w, txt.h, txt._tex_w, txt._tex_h)
  236 + end
  237 + end
  238 +end
  239 +
  240 +function _M:innerDisplay(x, y, nb_keyframes)
  241 + for i = #self.list, 1, -1 do
  242 + local txt = self.list[i]
  243 + self:displayCredit(txt, x, y)
  244 +
  245 + txt.y = txt.y - nb_keyframes * 1.5
  246 + if i == #self.list and txt.y < game.h then
  247 + if credits[self.next_credit] ~= nil then
  248 + local t = self:makeEntry(credits[self.next_credit])
  249 + self.next_credit = self.next_credit + 1
  250 + t.y = txt.y + txt.step_h
  251 + table.insert(self.list, t)
  252 + end
  253 + if #self.list == 1 and credits[self.next_credit] == nil then
  254 + game:unregisterDialog(self)
  255 + end
  256 + elseif i == 1 and txt.y + txt.h < 0 then
  257 + table.remove(self.list, 1)
  258 + end
  259 + end
  260 +end
... ...
... ... @@ -54,6 +54,7 @@ function _M:init()
54 54 local menu = require("engine.dialogs.GameMenu").new(list)
55 55 game:registerDialog(menu)
56 56 end}
  57 + l[#l+1] = {name="Credits", fct=function() game:registerDialog(require("mod.dialogs.Credits").new()) end}
57 58 l[#l+1] = {name="Exit", fct=function() game:onQuit() end}
58 59 if config.settings.cheat then l[#l+1] = {name="Reboot", fct=function() util.showMainMenu() end} end
59 60
... ...