|
@@ -7,8 +7,6 @@ import PictureModel 1.0
|
|
|
Item {
|
|
|
id: root
|
|
|
|
|
|
- property var imageArray: []
|
|
|
-
|
|
|
function animationStep() {
|
|
|
var fullyLoaded = true
|
|
|
for (var i = globalSettings.columnCount - 1; i >= 0; i--) {
|
|
@@ -23,16 +21,17 @@ Item {
|
|
|
if ((!d.initialized && !fullCanvas) || (i == 0) && !overloadedCanvas && (globalSettings.itemLimit < 0 || (globalUtil.itemCount < globalSettings.itemLimit))) {
|
|
|
globalUtil.itemCount++
|
|
|
tailItem = d.pictureDelegate.createObject(root)
|
|
|
+ tailItem.loaded.connect(function() { d.loadedImageCount += 1 } )
|
|
|
tailItem.columnIndex = i
|
|
|
col.push(tailItem)
|
|
|
}
|
|
|
|
|
|
if (!d.initialized) {
|
|
|
- fullyLoaded = fullyLoaded && !fullCanvas
|
|
|
+ fullyLoaded = fullyLoaded && fullCanvas
|
|
|
continue
|
|
|
}
|
|
|
|
|
|
- if (overloadedCanvas || d.animating[i]) {
|
|
|
+ if (d.imagesLoaded && (overloadedCanvas || d.animating[i])) {
|
|
|
feedTimer.restart()
|
|
|
d.animating[i] = true
|
|
|
for (var j = 0; j < col.length; j++) {
|
|
@@ -43,35 +42,34 @@ Item {
|
|
|
if (globalSettings.columnCount - i > 1) {
|
|
|
item.columnIndex = i + 1
|
|
|
d.imageArray[i + 1].push(item)
|
|
|
+ d.grainsOfSand = 0
|
|
|
+ d.velocity = 0
|
|
|
} else {
|
|
|
item.destroy();
|
|
|
globalUtil.itemCount--
|
|
|
}
|
|
|
} else {
|
|
|
- item.y += 1
|
|
|
+ item.y += d.velocity
|
|
|
}
|
|
|
}
|
|
|
+ d.grainsOfSand += 0.05
|
|
|
+ d.velocity = Math.pow(d.grainsOfSand, 2)
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if (!d.initialized && fullyLoaded) {
|
|
|
- settleTimer.start()
|
|
|
+ d.initialized = true
|
|
|
+ background.color = "black"
|
|
|
}
|
|
|
}
|
|
|
|
|
|
Rectangle {
|
|
|
+ id: background
|
|
|
color: "white"
|
|
|
anchors.fill: parent
|
|
|
}
|
|
|
|
|
|
- Timer {
|
|
|
- id: settleTimer
|
|
|
- interval: 5000
|
|
|
- onTriggered: {
|
|
|
- d.initialized = true
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
Timer {
|
|
|
id: feedTimer
|
|
|
interval: globalSettings.interval*100
|
|
@@ -84,6 +82,13 @@ Item {
|
|
|
|
|
|
QtObject {
|
|
|
id: d
|
|
|
+
|
|
|
+ property real velocity: 0
|
|
|
+ property real grainsOfSand: 0
|
|
|
+
|
|
|
+ property int loadedImageCount: 0
|
|
|
+ property bool imagesLoaded: loadedImageCount > 0 && (loadedImageCount >= globalUtil.itemCount)
|
|
|
+
|
|
|
property bool incoming: false
|
|
|
property bool initialized: globalSettings.itemLimit > -1 ? true : false
|
|
|
property real t: 0
|
|
@@ -109,6 +114,32 @@ Item {
|
|
|
onHeightChanged: {
|
|
|
considerY()
|
|
|
}
|
|
|
+
|
|
|
+ /*
|
|
|
+ ShaderEffect {
|
|
|
+ z: 1
|
|
|
+ width: src.width; height: src.height
|
|
|
+ property variant src: artwork
|
|
|
+ vertexShader: "
|
|
|
+ uniform highp mat4 qt_Matrix;
|
|
|
+ attribute highp vec4 qt_Vertex;
|
|
|
+ attribute highp vec2 qt_MultiTexCoord0;
|
|
|
+ varying highp vec2 coord;
|
|
|
+ void main() {
|
|
|
+ coord = qt_MultiTexCoord0;
|
|
|
+ gl_Position = qt_Matrix * qt_Vertex;
|
|
|
+ }"
|
|
|
+ fragmentShader: "
|
|
|
+ varying highp vec2 coord;
|
|
|
+ uniform sampler2D src;
|
|
|
+ uniform lowp float qt_Opacity;
|
|
|
+ void main() {
|
|
|
+ lowp vec4 tex = texture2D(src, coord);
|
|
|
+ gl_FragColor = vec4(vec3(dot(tex.rgb,
|
|
|
+ vec3(0.344, 0.5, 0.156))),
|
|
|
+ tex.a) * qt_Opacity;
|
|
|
+ }"
|
|
|
+ }*/
|
|
|
}
|
|
|
}
|
|
|
|