fix outfit glitches, init combobox, move shaders, remove unused particles files, create timer utility
parent
11bb365dce
commit
400afa9981
@ -1 +1,10 @@
|
||||
-- place any code for testing purposes here
|
||||
-- place any code for testing purposes here
|
||||
|
||||
function init()
|
||||
local box = UIComboBox.create()
|
||||
box:setStyle('ComboBox')
|
||||
box:moveTo({x=100, y=8})
|
||||
UI.display(box)
|
||||
end
|
||||
|
||||
addEvent(init)
|
Before Width: | Height: | Size: 845 B |
After Width: | Height: | Size: 291 B |
@ -0,0 +1,9 @@
|
||||
ComboBox < UIComboBox
|
||||
font: verdana-11px-antialised
|
||||
color: #aaaaaa
|
||||
size: 86 20
|
||||
text-margin: 3
|
||||
border-image:
|
||||
source: /core_styles/images/combobox.png
|
||||
border: 1
|
||||
border.right: 17
|
@ -0,0 +1 @@
|
||||
UIComboBox = extends(UIWidget)
|
@ -0,0 +1,10 @@
|
||||
uniform float opacity; // painter opacity
|
||||
uniform vec4 color; // painter color
|
||||
uniform float time; // time in seconds since shader linkage
|
||||
uniform sampler2D texture; // map texture
|
||||
varying vec2 textureCoords; // map texture coords
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture2D(texture, textureCoords) * color * opacity;
|
||||
}
|
@ -1,102 +0,0 @@
|
||||
ParticleSystem
|
||||
|
||||
AttractionAffector
|
||||
position: 320 180
|
||||
acceleration: 500
|
||||
repelish: true
|
||||
delay: 0.5
|
||||
|
||||
// Fire
|
||||
Emitter
|
||||
position: 295 180
|
||||
duration: 0.5
|
||||
burstRate: 0.0166
|
||||
burstCount: 3
|
||||
delay: 0
|
||||
|
||||
particle-min-duration: 0.3
|
||||
particle-max-duration: 0.5
|
||||
|
||||
particle-position-radius: 0
|
||||
|
||||
particle-min-velocity: 200
|
||||
particle-max-velocity: 240
|
||||
particle-min-velocity-angle: -10
|
||||
particle-max-velocity-angle: 10
|
||||
|
||||
particle-acceleration: 0
|
||||
|
||||
particle-start-size: 16 16
|
||||
particle-final-size: 64 64
|
||||
|
||||
particle-colors: #ffcc0050 #ffff0025 #ff000000
|
||||
particle-colors-stops: 0 0.15 0.3
|
||||
|
||||
particle-composition-mode: addition
|
||||
particle-texture: circle2.png
|
||||
|
||||
|
||||
// Fire ball
|
||||
Emitter
|
||||
position: 295 180
|
||||
duration: 0
|
||||
burstRate: 0.0166
|
||||
burstCount: 3
|
||||
delay: 0
|
||||
|
||||
particle-min-duration: 0.5
|
||||
particle-max-duration: 0.9
|
||||
|
||||
particle-position-radius: 0
|
||||
|
||||
particle-min-velocity: 80
|
||||
particle-max-velocity: 110
|
||||
particle-min-velocity-angle: -30
|
||||
particle-max-velocity-angle: 30
|
||||
|
||||
particle-acceleration: 0
|
||||
|
||||
particle-start-size: 16 16
|
||||
particle-final-size: 32 32
|
||||
|
||||
particle-composition-mode: addition
|
||||
particle-colors: #19191980 #0f0f0f80 #00000000
|
||||
particle-colors-stops: 0 0.45 0.9
|
||||
|
||||
particle-texture: circle2.png
|
||||
|
||||
ParticleSystem
|
||||
|
||||
AttractionAffector
|
||||
position: 320 180
|
||||
acceleration: 30
|
||||
repelish: true
|
||||
|
||||
// Smoke
|
||||
Emitter
|
||||
position: 295 180
|
||||
duration: 0.7
|
||||
burstRate: 0.0166
|
||||
burstCount: 3
|
||||
delay: 0.4
|
||||
|
||||
particle-min-duration: 0.9
|
||||
particle-max-duration: 0.9
|
||||
|
||||
particle-position-radius: 0
|
||||
|
||||
particle-min-velocity: 60
|
||||
particle-max-velocity: 85
|
||||
particle-min-velocity-angle: -20
|
||||
particle-max-velocity-angle: 20
|
||||
|
||||
particle-acceleration: 0
|
||||
|
||||
particle-start-size: 8 8
|
||||
particle-final-size: 64 64
|
||||
|
||||
particle-colors: #66666610 #00000000
|
||||
particle-colors-stops: 0 0.9
|
||||
|
||||
particle-texture: circle2.png
|
||||
|
@ -1,123 +0,0 @@
|
||||
varying vec2 textureCoords;
|
||||
uniform float opacity;
|
||||
uniform vec4 color;
|
||||
uniform float ticks;
|
||||
uniform sampler2D texture;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture2D(texture, textureCoords) * color * opacity;
|
||||
}
|
||||
|
||||
/*
|
||||
varying vec2 textureCoords;
|
||||
uniform vec4 color;
|
||||
uniform float ticks;
|
||||
uniform sampler2D texture;
|
||||
|
||||
void main()
|
||||
{
|
||||
int num = 4;
|
||||
vec4 sum = vec4(0);
|
||||
int i, j;
|
||||
for(i=-num/2;i<num/2;++i) {
|
||||
for(j=-num/2;j<num/2;++j) {
|
||||
sum += texture2D(texture, textureCoords + vec2(i+1, j+1)*0.001) * 1.0/(num*num);
|
||||
}
|
||||
}
|
||||
|
||||
float period = ticks/1000.0;
|
||||
float a = (sin(period)+1.0)/2.0;
|
||||
sum.a = 0;
|
||||
gl_FragColor = vec4(1,1,1,2) - texture2D(texture, textureCoords);
|
||||
}
|
||||
*/
|
||||
/*
|
||||
uniform sampler2D texture;
|
||||
varying vec2 textureCoords;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 sum = vec4(0);
|
||||
vec2 texcoord = textureCoords;
|
||||
int j;
|
||||
int i;
|
||||
|
||||
for( i= -4 ;i < 4; i++)
|
||||
{
|
||||
for (j = -3; j < 3; j++)
|
||||
{
|
||||
sum += texture2D(texture, texcoord + vec2(j, i)*0.004) * 0.25;
|
||||
}
|
||||
}
|
||||
if (texture2D(texture, texcoord).r < 0.3)
|
||||
{
|
||||
gl_FragColor = sum*sum*0.012 + texture2D(texture, texcoord);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (texture2D(texture, texcoord).r < 0.5)
|
||||
{
|
||||
gl_FragColor = sum*sum*0.009 + texture2D(texture, texcoord);
|
||||
}
|
||||
else
|
||||
{
|
||||
gl_FragColor = sum*sum*0.0075 + texture2D(texture, texcoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
/*
|
||||
uniform sampler2D texture;
|
||||
varying vec2 textureCoords;
|
||||
uniform vec4 color;
|
||||
uniform float opacity;
|
||||
|
||||
uniform float ticks;
|
||||
uniform float rt_w = 18*32;
|
||||
uniform float rt_h = 14*32;
|
||||
|
||||
uniform float radius = 300.0;
|
||||
uniform float angle = 0.2;
|
||||
uniform vec2 center = vec2(8*32, 5*32);
|
||||
|
||||
vec4 PostFX(sampler2D tex, vec2 uv, float time)
|
||||
{
|
||||
vec2 texSize = vec2(rt_w, rt_h);
|
||||
vec2 tc = uv * texSize;
|
||||
tc -= center;
|
||||
float dist = length(tc);
|
||||
if (dist < radius)
|
||||
{
|
||||
float percent = (radius - dist) / radius;
|
||||
float theta = percent * percent * ((int)ticks % 1000)/1000.0 * 8.0;
|
||||
float s = sin(theta);
|
||||
float c = cos(theta);
|
||||
tc = vec2(dot(tc, vec2(c, -s)), dot(tc, vec2(s, c)));
|
||||
}
|
||||
tc += center;
|
||||
vec3 color = texture2D(texture, tc / texSize).rgb;
|
||||
return vec4(color, 1.0);
|
||||
}
|
||||
|
||||
void main (void)
|
||||
{
|
||||
vec2 uv = textureCoords.st;
|
||||
gl_FragColor = PostFX(texture, uv, ticks) * opacity;
|
||||
}
|
||||
*/
|
||||
/*
|
||||
uniform float opacity;
|
||||
vec4 calculatePixel();
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = calculatePixel() * opacity;
|
||||
}
|
||||
|
||||
varying vec2 textureCoords;
|
||||
uniform vec4 color;
|
||||
uniform sampler2D texture;
|
||||
vec4 calculatePixel() {
|
||||
return texture2D(texture, textureCoords) * color;
|
||||
}
|
||||
*/
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) 2010-2011 OTClient <https://github.com/edubart/otclient>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#include "timer.h"
|
||||
#include "clock.h"
|
||||
|
||||
void Timer::restart()
|
||||
{
|
||||
m_startTicks = g_clock.ticks();
|
||||
}
|
||||
|
||||
ticks_t Timer::ticksElapsed()
|
||||
{
|
||||
return g_clock.ticks() - m_startTicks;
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright (c) 2010-2011 OTClient <https://github.com/edubart/otclient>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef TIMER_H
|
||||
#define TIMER_H
|
||||
|
||||
#include <framework/util/types.h>
|
||||
|
||||
class Timer
|
||||
{
|
||||
public:
|
||||
Timer() { restart(); }
|
||||
|
||||
void restart();
|
||||
|
||||
ticks_t startTicks() { return m_startTicks; }
|
||||
ticks_t ticksElapsed();
|
||||
double timeElapsed() { return ticksElapsed()/1000.0; }
|
||||
|
||||
private:
|
||||
ticks_t m_startTicks;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (c) 2010-2011 OTClient <https://github.com/edubart/otclient>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#include "hardwarebuffer.h"
|
||||
|
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2010-2011 OTClient <https://github.com/edubart/otclient>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef HARDWAREBUFFER_H
|
||||
#define HARDWAREBUFFER_H
|
||||
|
||||
class HardwareBuffer
|
||||
{
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (c) 2010-2011 OTClient <https://github.com/edubart/otclient>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "gameshadermanager.h"
|
||||
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) 2010-2011 OTClient <https://github.com/edubart/otclient>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef GAMESHADERMANAGER_H
|
||||
#define GAMESHADERMANAGER_H
|
||||
|
||||
class GameShaderManager
|
||||
{
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in new issue