Commit bd49c705 authored by Jonathan Carter's avatar Jonathan Carter

Add debian/.gitignore

parent f6529c6a
2.1.4
-----
* FIXED: Automatic high DPI support.
* FIXED: Unsigned integer conversion warnings in graphics layer.
* FIXED: Could not add images with Qt 5.12
* FIXED: Window icon didn't work in Wayland.
* Added support for OpenGL ES.
* Improved loading locales.
* Require Qt 5.9
* Translation updates: Polish.
2.1.3
-----
* Replaced jhead with image auto-rotation in Qt 5.5.
......
......@@ -3,26 +3,19 @@
<file>bumpmap.png</file>
<file>shadow.png</file>
<file>shaders/120/textures0.frag</file>
<file>shaders/120/textures0.vert</file>
<file>shaders/120/textures1.frag</file>
<file>shaders/120/textures1.vert</file>
<file>shaders/120/textures2.frag</file>
<file>shaders/120/textures2.vert</file>
<file>shaders/gl2/textures0.frag</file>
<file>shaders/gl2/textures0.vert</file>
<file>shaders/gl2/textures1.frag</file>
<file>shaders/gl2/textures1.vert</file>
<file>shaders/gl2/textures2.frag</file>
<file>shaders/gl2/textures2.vert</file>
<file>shaders/130/textures0.frag</file>
<file>shaders/130/textures0.vert</file>
<file>shaders/130/textures1.frag</file>
<file>shaders/130/textures1.vert</file>
<file>shaders/130/textures2.frag</file>
<file>shaders/130/textures2.vert</file>
<file>shaders/330/textures0.frag</file>
<file>shaders/330/textures0.vert</file>
<file>shaders/330/textures1.frag</file>
<file>shaders/330/textures1.vert</file>
<file>shaders/330/textures2.frag</file>
<file>shaders/330/textures2.vert</file>
<file>shaders/gl3/textures0.frag</file>
<file>shaders/gl3/textures0.vert</file>
<file>shaders/gl3/textures1.frag</file>
<file>shaders/gl3/textures1.vert</file>
<file>shaders/gl3/textures2.frag</file>
<file>shaders/gl3/textures2.vert</file>
<file>tango/16x16/image-x-generic.png</file>
<file>tango/16x16/list-add.png</file>
......
#version 330
uniform vec4 color;
layout(location = 0) out vec4 out_color;
void main()
{
out_color = color;
}
#version 330
uniform mat4 matrix;
layout(location = 0) in vec3 position;
void main()
{
gl_Position = matrix * vec4(position, 1.0);
}
#version 330
uniform sampler2D texture0;
uniform vec4 color;
in vec2 frag_texcoord0;
layout(location = 0) out vec4 out_color;
void main()
{
out_color = texture(texture0, frag_texcoord0) * color;
}
#version 330
uniform mat4 matrix;
layout(location = 0) in vec3 position;
layout(location = 1) in vec2 texcoord0;
out vec2 frag_texcoord0;
void main()
{
gl_Position = matrix * vec4(position, 1.0);
frag_texcoord0 = texcoord0;
}
#version 330
uniform sampler2D texture0;
uniform sampler2D texture1;
in vec2 frag_texcoord0;
in vec2 frag_texcoord1;
layout(location = 0) out vec4 out_color;
void main()
{
out_color = texture(texture0, frag_texcoord0) + texture(texture1, frag_texcoord1) - vec4(0.5, 0.5, 0.5, 0.5);
}
#version 330
uniform mat4 matrix;
layout(location = 0) in vec3 position;
layout(location = 1) in vec2 texcoord0;
layout(location = 2) in vec2 texcoord1;
out vec2 frag_texcoord0;
out vec2 frag_texcoord1;
void main()
{
gl_Position = matrix * vec4(position, 1.0);
frag_texcoord0 = texcoord0;
frag_texcoord1 = texcoord1;
}
#version 120
uniform vec4 color;
uniform highp vec4 color;
void main()
{
......
#version 120
uniform mat4 matrix;
attribute vec3 position;
......
#version 120
uniform sampler2D texture0;
uniform vec4 color;
uniform highp vec4 color;
varying vec2 frag_texcoord0;
varying highp vec2 frag_texcoord0;
void main()
{
......
#version 120
uniform mat4 matrix;
attribute vec2 texcoord0;
......
#version 120
uniform sampler2D texture0;
uniform sampler2D texture1;
varying vec2 frag_texcoord0;
varying vec2 frag_texcoord1;
varying highp vec2 frag_texcoord0;
varying highp vec2 frag_texcoord1;
void main()
{
......
#version 120
uniform mat4 matrix;
attribute vec2 texcoord1;
......
#version 130
uniform highp vec4 color;
uniform vec4 color;
out vec4 out_color;
out highp vec4 out_color;
void main()
{
......
#version 130
uniform sampler2D texture0;
uniform vec4 color;
uniform highp vec4 color;
in vec2 frag_texcoord0;
in highp vec2 frag_texcoord0;
out vec4 out_color;
out highp vec4 out_color;
void main()
{
......
#version 130
uniform sampler2D texture0;
uniform sampler2D texture1;
in vec2 frag_texcoord0;
in vec2 frag_texcoord1;
in highp vec2 frag_texcoord0;
in highp vec2 frag_texcoord1;
out vec4 out_color;
out highp vec4 out_color;
void main()
{
......
data/tango/24x24/image-x-generic.png

1.33 KB | W: | H:

data/tango/24x24/image-x-generic.png

1.33 KB | W: | H:

data/tango/24x24/image-x-generic.png
data/tango/24x24/image-x-generic.png
data/tango/24x24/image-x-generic.png
data/tango/24x24/image-x-generic.png
  • 2-up
  • Swipe
  • Onion skin
data/tango/24x24/list-add.png

528 Bytes | W: | H:

data/tango/24x24/list-add.png

528 Bytes | W: | H:

data/tango/24x24/list-add.png
data/tango/24x24/list-add.png
data/tango/24x24/list-add.png
data/tango/24x24/list-add.png
  • 2-up
  • Swipe
  • Onion skin
data/tango/24x24/list-remove.png

412 Bytes | W: | H:

data/tango/24x24/list-remove.png

412 Bytes | W: | H:

data/tango/24x24/list-remove.png
data/tango/24x24/list-remove.png
data/tango/24x24/list-remove.png
data/tango/24x24/list-remove.png
  • 2-up
  • Swipe
  • Onion skin
data/tango/32x32/image-x-generic.png

1.33 KB | W: | H:

data/tango/32x32/image-x-generic.png

1.14 KB | W: | H:

data/tango/32x32/image-x-generic.png
data/tango/32x32/image-x-generic.png
data/tango/32x32/image-x-generic.png
data/tango/32x32/image-x-generic.png
  • 2-up
  • Swipe
  • Onion skin
data/tango/48x48/image-x-generic.png

2.35 KB | W: | H:

data/tango/48x48/image-x-generic.png

8.59 KB | W: | H:

data/tango/48x48/image-x-generic.png
data/tango/48x48/image-x-generic.png
data/tango/48x48/image-x-generic.png
data/tango/48x48/image-x-generic.png
  • 2-up
  • Swipe
  • Onion skin
data/tango/48x48/list-add.png

1.6 KB | W: | H:

data/tango/48x48/list-add.png

1.6 KB | W: | H:

data/tango/48x48/list-add.png
data/tango/48x48/list-add.png
data/tango/48x48/list-add.png
data/tango/48x48/list-add.png
  • 2-up
  • Swipe
  • Onion skin
data/tango/48x48/list-remove.png

1.24 KB | W: | H:

data/tango/48x48/list-remove.png

1.24 KB | W: | H:

data/tango/48x48/list-remove.png
data/tango/48x48/list-remove.png
data/tango/48x48/list-remove.png
data/tango/48x48/list-remove.png
  • 2-up
  • Swipe
  • Onion skin
data/tango/64x64/image-x-generic.png

3.97 KB | W: | H:

data/tango/64x64/image-x-generic.png

9.97 KB | W: | H:

data/tango/64x64/image-x-generic.png
data/tango/64x64/image-x-generic.png
data/tango/64x64/image-x-generic.png
data/tango/64x64/image-x-generic.png
  • 2-up
  • Swipe
  • Onion skin
data/tango/64x64/list-add.png

2.31 KB | W: | H:

data/tango/64x64/list-add.png

2.31 KB | W: | H:

data/tango/64x64/list-add.png
data/tango/64x64/list-add.png
data/tango/64x64/list-add.png
data/tango/64x64/list-add.png
  • 2-up
  • Swipe
  • Onion skin
data/tango/64x64/list-remove.png

1.46 KB | W: | H:

data/tango/64x64/list-remove.png

1.46 KB | W: | H:

data/tango/64x64/list-remove.png
data/tango/64x64/list-remove.png
data/tango/64x64/list-remove.png
data/tango/64x64/list-remove.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -98,6 +98,20 @@
</content_rating>
<releases>
<release version="2.1.4" date="2019-03-25">
<description>
<ul>
<li>FIXED: Automatic high DPI support</li>
<li>FIXED: Unsigned integer conversion warnings in graphics layer</li>
<li>FIXED: Could not add images with Qt 5.12</li>
<li>FIXED: Window icon didn't work in Wayland</li>
<li>Added support for OpenGL ES</li>
<li>Improved loading locales</li>
<li>Require Qt 5.9</li>
<li>Translation updates: Polish</li>
</ul>
</description>
</release>
<release version="2.1.3" date="2018-05-29">
<description>
<ul>
......
......@@ -4,12 +4,16 @@ and mac_deploy.sh and repacking sources withe this script:
#! /bin/bash
#! /bin/bash
tar -xvf tetzle-2.1.3.tar.gz
mv tetzle-2.1.3 tetzle-2.1.3+dfsg1
rm -f tetzle-2.1.3+dfsg1/mac_deploy.sh
rm -r tetzle-2.1.3+dfsg1/tools
rm -r tetzle-2.1.3+dfsg1/windows
tar -zcvf tetzle_2.1.3+dfsg1.orig.tar.gz tetzle-2.1.3+dfsg1
tar -xvf tetzle-2.1.4.tar.gz
mv tetzle-2.1.4 tetzle-2.1.4+dfsg1
rm -f tetzle-2.1.4+dfsg1/mac_deploy.sh
rm -r tetzle-2.1.4+dfsg1/tools
rm -r tetzle-2.1.4+dfsg1/windows
tar -zcvf tetzle_2.1.4+dfsg1.orig.tar.gz tetzle-2.1.4+dfsg1
-- Innocent De Marchi <tangram.peces@gmail.com> Mon, 11 Jun 2018 18:24:12 +0100
Updated version numbers above
-- Jonathan Carter <jcc@debian.org> Thu Apr 4 14:00:08 SAST 2019 +0200
tetzle (2.1.4+dfsg1-1) unstable; urgency=medium
* New upstream release
* Update metadata license information
* Remove no longer needed debian/docs
-- Jonathan Carter <jcc@debian.org> Thu, 04 Apr 2019 13:57:56 +0200
tetzle (2.1.3+dfsg1-2) unstable; urgency=medium
* Adopting package (Closes: #922886)
......
......@@ -7,7 +7,7 @@ Files-excluded: mac_deploy.sh
/windows
Files: *
Copyright: 2008-2018 Graeme Gott
Copyright: 2008-2019 Graeme Gott
License: GPL-3
Files: debian/*
......@@ -19,6 +19,10 @@ Copyright: 2009, 2011-2013 Bart Martens <bartm@debian.org>
2017-2018 Innocent De Marchi <tangram.peces@gmail.com>
License: GPL-3
Files: data/unix/tetzle.appdata.xml
Copyright: 2018 Graeme Gott
License: GPL-3+
License: GPL-3
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
......@@ -2,8 +2,8 @@
<!-- Copyright 2008-2017 Graeme Gott <graeme@gottcode.org> -->
<component type="desktop">
<id>gnome-power-statistics.desktop</id>
<metadata_license>GPL-3.0+</metadata_license>
<project_license>GPL-3.0+</project_license>
<metadata_license>GPL-3.0</metadata_license>
<project_license>GPL-3.0</project_license>
<name>Peces</name>
<summary>Jigsaw puzzle game</summary>
<description>
......
IDI_ICON1 ICON DISCARDABLE "tetzle.ico"
......@@ -83,7 +83,7 @@ namespace
//-----------------------------------------------------------------------------
Board::Board(QWidget* parent) :
GLWidget(parent),
QOpenGLWidget(parent),
m_id(0),
m_load_bevels(true),
m_has_bevels(true),
......@@ -776,7 +776,7 @@ void Board::keyPressEvent(QKeyEvent* event)
m_action_key = event->key();
}
}
GLWidget::keyPressEvent(event);
QOpenGLWidget::keyPressEvent(event);
}
//-----------------------------------------------------------------------------
......@@ -786,7 +786,7 @@ void Board::keyReleaseEvent(QKeyEvent* event)
if (!event->isAutoRepeat()) {
m_action_key = 0;
}
GLWidget::keyReleaseEvent(event);
QOpenGLWidget::keyReleaseEvent(event);
}
//-----------------------------------------------------------------------------
......@@ -804,7 +804,7 @@ void Board::mousePressEvent(QMouseEvent* event)
m_select_pos = event->pos();
}
GLWidget::mousePressEvent(event);
QOpenGLWidget::mousePressEvent(event);
}
//-----------------------------------------------------------------------------
......@@ -833,7 +833,7 @@ void Board::mouseReleaseEvent(QMouseEvent* event)
}
m_action_button = Qt::NoButton;
GLWidget::mouseReleaseEvent(event);
QOpenGLWidget::mouseReleaseEvent(event);
}
//-----------------------------------------------------------------------------
......@@ -912,7 +912,7 @@ void Board::wheelEvent(QWheelEvent* event)
zoomOut();
}
GLWidget::wheelEvent(event);
QOpenGLWidget::wheelEvent(event);
}
//-----------------------------------------------------------------------------
......
......@@ -28,18 +28,12 @@ class Piece;
class Tile;
#include <QHash>
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
#include <QOpenGLWidget>
typedef QOpenGLWidget GLWidget;
#else
#include <QGLWidget>
typedef QGLWidget GLWidget;
#endif
class QOpenGLTexture;
#include <random>
class Board : public GLWidget
class Board : public QOpenGLWidget
{
Q_OBJECT
......@@ -123,10 +117,6 @@ private:
void finishGame();
void cleanup();
#if (QT_VERSION < QT_VERSION_CHECK(5,6,0))
qreal devicePixelRatioF() const { return devicePixelRatio(); }
#endif
private:
int m_id;
bool m_load_bevels;
......
/***********************************************************************
*
* Copyright (C) 2011, 2012, 2014, 2016, 2017 Graeme Gott <graeme@gottcode.org>
* Copyright (C) 2011, 2012, 2014, 2016, 2017, 2018 Graeme Gott <graeme@gottcode.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -23,9 +23,6 @@
#include <QCoreApplication>
#include <QFile>
#if (QT_VERSION < QT_VERSION_CHECK(5,4,0))
#include <QGLFormat>
#endif
#include <QOpenGLBuffer>
#include <QOpenGLShaderProgram>
#include <QOpenGLVertexArrayObject>
......@@ -36,9 +33,6 @@ GraphicsLayer* graphics_layer = 0;
//-----------------------------------------------------------------------------
static QString glsl_version;
static QString shader_version;
template <typename T>
static inline void convertMatrix(const T* in, GLfloat* out)
{
......@@ -49,40 +43,59 @@ static inline void convertMatrix(const T* in, GLfloat* out)
void GraphicsLayer::init()
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
const auto requested = QSurfaceFormat::defaultFormat();
#else
const auto requested = QGLFormat::toSurfaceFormat(QGLFormat::defaultFormat());
#endif
const auto context = QOpenGLContext::currentContext()->format();
const auto version = std::min((context.profile() == QSurfaceFormat::CoreProfile) ? qMakePair(4,5) : requested.version(), context.version());
if (!QOpenGLContext::currentContext()->isOpenGLES()) {
const auto version = std::min((context.profile() == QSurfaceFormat::CoreProfile) ? qMakePair(4,6) : requested.version(), context.version());
if (version >= qMakePair(3,0)) {
const QString shader = "gl3";
QByteArray glsl = "130";
if (version >= qMakePair(3,3)) {
glsl_version = QByteArray::number((version.first * 100) + (version.second * 10));
shader_version = "330";
glsl = QByteArray::number((version.first * 100) + (version.second * 10));
} else if (version == qMakePair(3,2)) {
glsl_version = "150";
shader_version = "130";
glsl = "150";
} else if (version == qMakePair(3,1)) {
glsl_version = "140";
shader_version = "130";
} else {
glsl_version = shader_version = "130";
glsl = "140";
}
auto vertex_array = new QOpenGLVertexArrayObject;
vertex_array->create();
vertex_array->bind();
graphics_layer = new GraphicsLayer21(vertex_array);
graphics_layer = new GraphicsLayer21(vertex_array, glsl, shader);
} else if (version >= qMakePair(2,1)) {
glsl_version = shader_version = "120";
graphics_layer = new GraphicsLayer21;
const QString shader = "gl2";
const QByteArray glsl = "120";
graphics_layer = new GraphicsLayer21(nullptr, glsl, shader);
#ifndef QT_OPENGL_ES_2
} else if (version >= qMakePair(1,5)) {
graphics_layer = new GraphicsLayer15;
} else if (version >= qMakePair(1,3)) {
graphics_layer = new GraphicsLayer13;
} else {
graphics_layer = new GraphicsLayer11;
#endif
}
} else {
const auto version = std::min(requested.version(), context.version());
if (version >= qMakePair(3,0)) {
const QString shader = "gl3";
const QByteArray glsl = "300 es";
auto vertex_array = new QOpenGLVertexArrayObject;
vertex_array->create();
vertex_array->bind();
graphics_layer = new GraphicsLayer21(vertex_array, glsl, shader);
} else {
const QString shader = "gl2";
graphics_layer = new GraphicsLayer21(nullptr, QByteArray(), shader);
}
}
graphics_layer->setTextureUnits(1);
......@@ -93,7 +106,9 @@ void GraphicsLayer::init()
void GraphicsLayer::setVersion(int version)
{
QSurfaceFormat f;
if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) {
switch (version) {
#ifndef QT_OPENGL_ES_2
case 11:
case 12:
f.setVersion(1,1);
......@@ -106,6 +121,7 @@ void GraphicsLayer::setVersion(int version)
case 20:
f.setVersion(1,5);
break;
#endif
case 21:
f.setVersion(2,1);
break;
......@@ -119,16 +135,26 @@ void GraphicsLayer::setVersion(int version)
case 43:
case 44:
case 45:
case 46:
default:
f.setVersion(4,5);
f.setVersion(4,6);
f.setProfile(QSurfaceFormat::CoreProfile);
break;
}
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
} else {
switch (version) {
case 30:
case 31:
case 32:
f.setVersion(3,0);
break;
case 20:
default:
f.setVersion(2,0);
break;
}
}
QSurfaceFormat::setDefaultFormat(f);
#else
QGLFormat::setDefaultFormat(QGLFormat::fromSurfaceFormat(f));
#endif
}
//-----------------------------------------------------------------------------
......@@ -240,13 +266,14 @@ void GraphicsLayer::clearChanged()
void GraphicsLayer::uploadChanged(QOpenGLBuffer* vertex_buffer)
{
const int vertex_size = sizeof(Vertex);
if (!m_changed_regions.isEmpty()) {
for (const VertexArray& region : m_changed_regions) {
vertex_buffer->write(region.start * sizeof(Vertex), m_data.constBegin() + region.start, region.length() * sizeof(Vertex));
vertex_buffer->write(region.start * vertex_size, m_data.constBegin() + region.start, region.length() * vertex_size);
}
m_changed_regions.clear();
} else if (m_changed) {
GLsizeiptr size = m_data.count() * sizeof(Vertex);
const int size = m_data.count() * vertex_size;
vertex_buffer->allocate(size);
vertex_buffer->write(0, m_data.constData(), size);
m_changed = false;
......@@ -255,7 +282,7 @@ void GraphicsLayer::uploadChanged(QOpenGLBuffer* vertex_buffer)
//-----------------------------------------------------------------------------
GraphicsLayer21::GraphicsLayer21(QOpenGLVertexArrayObject* vertex_array) :
GraphicsLayer21::GraphicsLayer21(QOpenGLVertexArrayObject* vertex_array, const QByteArray& glsl, const QString& shader) :
m_program(nullptr),
m_vertex_array(vertex_array)
{
......@@ -281,17 +308,17 @@ GraphicsLayer21::GraphicsLayer21(QOpenGLVertexArrayObject* vertex_array) :
m_vertex_buffer->bind();
// Load shaders
QOpenGLShaderProgram* program = loadProgram(0);
QOpenGLShaderProgram* program = loadProgram(0, glsl, shader);
program->setAttributeBuffer(Position, GL_FLOAT, offsetof(Vertex, x), 3, sizeof(Vertex));
program->enableAttributeArray(Position);
program = loadProgram(1);
program = loadProgram(1, glsl, shader);
program->setAttributeBuffer(TexCoord0, GL_FLOAT, offsetof(Vertex, s), 2, sizeof(Vertex));
program->setAttributeBuffer(Position, GL_FLOAT, offsetof(Vertex, x), 3, sizeof(Vertex));
program->enableAttributeArray(Position);
program->setUniformValue("texture0", GLuint(0));
program = loadProgram(2);
program = loadProgram(2, glsl, shader);
program->setAttributeBuffer(TexCoord1, GL_FLOAT, offsetof(Vertex, s2), 2, sizeof(Vertex));
program->setAttributeBuffer(TexCoord0, GL_FLOAT, offsetof(Vertex, s), 2, sizeof(Vertex));
program->setAttributeBuffer(Position, GL_FLOAT, offsetof(Vertex, x), 3, sizeof(Vertex));
......@@ -437,28 +464,28 @@ void GraphicsLayer21::uploadData()
//-----------------------------------------------------------------------------
QOpenGLShaderProgram* GraphicsLayer21::loadProgram(unsigned int index)
QOpenGLShaderProgram* GraphicsLayer21::loadProgram(unsigned int index, const QByteArray& glsl, const QString& shader)
{
// Load vertex shader code
QString vertex;
QFile file(QString(":/shaders/%1/textures%2.vert").arg(shader_version).arg(index));
QByteArray vertex;
QFile file(QString(":/shaders/%1/textures%2.vert").arg(shader).arg(index));
if (file.open(QFile::ReadOnly)) {
vertex = file.readAll();
file.close();
}
// Load fragment shader code
QString frag;
file.setFileName(QString(":/shaders/%1/textures%2.frag").arg(shader_version).arg(index));
QByteArray frag;
file.setFileName(QString(":/shaders/%1/textures%2.frag").arg(shader).arg(index));
if (file.open(QFile::ReadOnly)) {
frag = file.readAll();
file.close();
}
// Update GLSL version
if (glsl_version > shader_version) {
vertex.replace("#version " + shader_version + "\n", "#version " + glsl_version + "\n");
frag.replace("#version " + shader_version + "\n", "#version " + glsl_version + "\n");
// Add GLSL version
if (!glsl.isEmpty()) {
vertex.prepend("#version " + glsl + "\n");
frag.prepend("#version " + glsl + "\n");
}
// Create program
......@@ -467,7 +494,6 @@ QOpenGLShaderProgram* GraphicsLayer21::loadProgram(unsigned int index)
m_programs[index]->addShaderFromSourceCode(QOpenGLShader::Fragment, frag);
// Set attribute locations
if (shader_version < "330") {
m_programs[index]->bindAttributeLocation("position", Position);
if (index > 0) {
m_programs[index]->bindAttributeLocation("texcoord0", TexCoord0);
......@@ -475,7 +501,6 @@ QOpenGLShaderProgram* GraphicsLayer21::loadProgram(unsigned int index)
if (index > 1) {