Skip to content

Commit

Permalink
Merge pull request #12 from AlwinEsch/cleanup
Browse files Browse the repository at this point in the history
Cleanup Addon
  • Loading branch information
AlwinEsch authored Dec 1, 2018
2 parents a0b39a6 + 5c872cd commit 09a17de
Show file tree
Hide file tree
Showing 28 changed files with 238 additions and 231 deletions.
54 changes: 20 additions & 34 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,50 +1,36 @@
project(screensaver.asteroids)

cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.0)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR})

enable_language(CXX)

find_package(Kodi REQUIRED)
find_package(CXX11 REQUIRED)

if(NOT WIN32)
find_package(EMBEDDED)
if((APP_RENDER_SYSTEM STREQUAL "gl" OR NOT APP_RENDER_SYSTEM) AND NOT EMBEDDED_FOUND)
find_package(OpenGL)
if(APP_RENDER_SYSTEM STREQUAL "gl" OR NOT APP_RENDER_SYSTEM)
find_package(OpenGl REQUIRED)
set(DEPLIBS ${OPENGL_LIBRARIES})
set(includes ${OPENGL_INCLUDE_DIR})
add_definitions(${OPENGL_DEFINITIONS})
elseif(APP_RENDER_SYSTEM STREQUAL "gles")
find_package(OpenGLES REQUIRED)
set(DEPLIBS ${OPENGLES_LIBRARIES})
set(includes ${OPENGLES_INCLUDE_DIR})
add_definitions(${OPENGLES_DEFINITIONS})
endif()

if(OPENGL_FOUND)
set(APP_RENDER_SYSTEM gl)
set(INCLUDES ${OPENGL_INCLUDE_DIR})
set(DEPLIBS ${OPENGL_LIBRARIES})
set(ASTEROIDS_SOURCES src/shaders/GUIShader.cpp
src/shaders/Matrix.cpp
src/shaders/Shader.cpp)
set(ASTEROIDS_HEADERS src/shaders/GUIShader.h
src/shaders/Matrix.h
src/shaders/Shader.h)
add_definitions(-DHAS_GL)
message(STATUS "Asteroids screensaver via OpenGL")
else()
find_package(OpenGLES2)
if(OPENGLES2_FOUND)
set(APP_RENDER_SYSTEM gles)
set(ASTEROIDS_SOURCES src/shaders/GUIShader.cpp
src/shaders/Matrix.cpp
src/shaders/Shader.cpp)
set(ASTEROIDS_HEADERS src/shaders/GUIShader.h
src/shaders/Matrix.h
src/shaders/Shader.h)
add_definitions(-DHAS_GLES2)
set(INCLUDES ${OPENGLES2_INCLUDE_DIRS})
set(DEPLIBS ${OPENGLES2_LIBRARIES})
message(STATUS "Asteroids screensaver via OpenGLES")
else()
message(FATAL_ERROR "Asteroids screensaver OpenGL(ES) wasn't found")
endif()
if(NOT OPENGL_FOUND AND NOT OPENGLES_FOUND)
message(FATAL_ERROR "No rendering API found. Bailing")
endif()

set(ASTEROIDS_SOURCES src/shaders/GUIShader.cpp
src/shaders/Matrix.cpp
src/shaders/Shader.cpp)
set(ASTEROIDS_HEADERS src/shaders/GUIShader.h
src/shaders/Matrix.h
src/shaders/Shader.h)
endif()

include_directories(${KODI_INCLUDE_DIR}/..) # Hack way with "/..", need bigger Kodi cmake rework to match right include ways
Expand Down
18 changes: 0 additions & 18 deletions FindCXX11.cmake

This file was deleted.

12 changes: 0 additions & 12 deletions FindEMBEDDED.cmake

This file was deleted.

54 changes: 54 additions & 0 deletions FindOpenGLES.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#.rst:
# FindOpenGLES
# ------------
# Finds the OpenGLES2 library
#
# This will define the following variables::
#
# OPENGLES_FOUND - system has OpenGLES
# OPENGLES_INCLUDE_DIRS - the OpenGLES include directory
# OPENGLES_LIBRARIES - the OpenGLES libraries
# OPENGLES_DEFINITIONS - the OpenGLES definitions

if(CORE_PLATFORM_NAME_LC STREQUAL rbpi)
set(_brcmprefix brcm)
endif()

if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_OPENGLES ${_brcmprefix}glesv2 QUIET)
endif()

if(NOT CORE_SYSTEM_NAME STREQUAL ios)
find_path(OPENGLES_INCLUDE_DIR GLES2/gl2.h
PATHS ${PC_OPENGLES_INCLUDEDIR})
find_library(OPENGLES_gl_LIBRARY NAMES ${_brcmprefix}GLESv2
PATHS ${PC_OPENGLES_LIBDIR})
else()
find_library(OPENGLES_gl_LIBRARY NAMES OpenGLES
PATHS ${CMAKE_OSX_SYSROOT}/System/Library
PATH_SUFFIXES Frameworks
NO_DEFAULT_PATH)
set(OPENGLES_INCLUDE_DIR ${OPENGLES_gl_LIBRARY}/Headers)
endif()

find_path(OPENGLES3_INCLUDE_DIR GLES3/gl3.h)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenGLES
REQUIRED_VARS OPENGLES_gl_LIBRARY OPENGLES_INCLUDE_DIR)

find_path(OPENGLES3_INCLUDE_DIR GLES3/gl3.h
PATHS ${PC_OPENGLES_INCLUDEDIR})

if(OPENGLES_FOUND)
set(OPENGLES_LIBRARIES ${OPENGLES_gl_LIBRARY})
if(OPENGLES3_INCLUDE_DIR)
set(OPENGLES_INCLUDE_DIRS ${OPENGLES_INCLUDE_DIR} ${OPENGLES3_INCLUDE_DIR})
set(OPENGLES_DEFINITIONS -DHAS_GLES=3)
mark_as_advanced(OPENGLES_INCLUDE_DIR OPENGLES3_INCLUDE_DIR OPENGLES_gl_LIBRARY)
else()
set(OPENGLES_INCLUDE_DIRS ${OPENGLES_INCLUDE_DIR})
set(OPENGLES_DEFINITIONS -DHAS_GLES=2)
mark_as_advanced(OPENGLES_INCLUDE_DIR OPENGLES_gl_LIBRARY)
endif()
endif()
38 changes: 0 additions & 38 deletions FindOpenGLES2.cmake

This file was deleted.

40 changes: 40 additions & 0 deletions FindOpenGl.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#.rst:
# FindOpenGl
# ----------
# Finds the FindOpenGl library
#
# This will define the following variables::
#
# OPENGL_FOUND - system has OpenGl
# OPENGL_INCLUDE_DIRS - the OpenGl include directory
# OPENGL_LIBRARIES - the OpenGl libraries
# OPENGL_DEFINITIONS - the OpenGl definitions

if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_OPENGL gl QUIET)
endif()

if(NOT CORE_SYSTEM_NAME STREQUAL osx)
find_path(OPENGL_INCLUDE_DIR GL/gl.h
PATHS ${PC_OPENGL_gl_INCLUDEDIR})
find_library(OPENGL_gl_LIBRARY NAMES GL
PATHS ${PC_OPENGL_gl_LIBDIR})
else()
find_library(OPENGL_gl_LIBRARY NAMES OpenGL
PATHS ${CMAKE_OSX_SYSROOT}/System/Library
PATH_SUFFIXES Frameworks
NO_DEFAULT_PATH)
set(OPENGL_INCLUDE_DIR ${OPENGL_gl_LIBRARY}/Headers)
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenGl
REQUIRED_VARS OPENGL_gl_LIBRARY OPENGL_INCLUDE_DIR)

if(OPENGL_FOUND)
set(OPENGL_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
set(OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY})
set(OPENGL_DEFINITIONS -DHAS_GL=1)
endif()

mark_as_advanced(OPENGL_INCLUDE_DIR OPENGL_gl_LIBRARY)
5 changes: 2 additions & 3 deletions debian/changelog.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
kodi-screensaver-asteroids (#PACKAGEVERSION#-#TAGREV#~#DIST#) #DIST#; urgency=low

[ xbmc ]
[ kodi ]
* autogenerated dummy changelog

-- Arne Morten Kvarving <[email protected]> Sat, 01 Jun 2013 00:59:22 +0200

-- Nobody <[email protected]> Sat, 01 Jun 2013 00:59:22 +0200
6 changes: 3 additions & 3 deletions debian/control
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Source: kodi-screensaver-asteroids
Priority: extra
Maintainer: Arne Morten Kvarving <[email protected]>
Build-Depends: debhelper (>= 8.0.0), cmake, kodi-addon-dev,
Maintainer: Nobody <[email protected]>
Build-Depends: debhelper (>= 9.0.0), cmake, kodi-addon-dev,
libgl1-mesa-dev
Standards-Version: 3.9.5
Section: libs
Homepage: http://xbmc.org
Homepage: http://kodi.tv

Package: kodi-screensaver-asteroids
Section: libs
Expand Down
25 changes: 3 additions & 22 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -1,28 +1,10 @@
Format: http://dep.debian.net/deps/dep5
Upstream-Name: screensaver.asteroids
Source: https://github.com/xbmc/screensaver.asteroids

Files: *
2005-2013 Team XBMC
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".


Files: debian/*
Copyright: 2013 Arne Morten Kvarving <[email protected]>
Copyright: 2005-2018 Team Kodi
2013 Arne Morten Kvarving <[email protected]>
2013 wsnipex <[email protected]>
License: GPL-2+
This package is free software; you can redistribute it and/or modify
Expand All @@ -40,4 +22,3 @@ License: GPL-2+
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".

Empty file removed debian/docs
Empty file.
2 changes: 2 additions & 0 deletions debian/kodi-screensaver-asteroids.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
usr/lib/*
usr/share/*
5 changes: 1 addition & 4 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ override_dh_auto_configure:
dh_auto_configure -- -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=1 -DUSE_LTO=1

override_dh_strip:
dh_strip --dbg-package=kodi-screensaver-asteroids-dbg

override_dh_auto_install:
dh_auto_install --destdir=debian/kodi-screensaver-asteroids
dh_strip -pkodi-screensaver-asteroids --dbg-package=kodi-screensaver-asteroids-dbg

override_dh_installdocs:
dh_installdocs --link-doc=kodi-screensaver-asteroids
Expand Down
13 changes: 10 additions & 3 deletions screensaver.asteroids/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="screensaver.asteroids"
version="2.1.0"
version="2.2.0"
name="Asteroids"
provider-name="spiff">
provider-name="Team Kodi">
<requires>@ADDON_DEPENDS@</requires>
<extension
point="xbmc.ui.screensaver"
library_@PLATFORM@="@LIBRARY_FILENAME@"/>
<extension point="xbmc.addon.metadata">
<summary>Asteroids screensaver</summary>
<description>Asteroids screensaver</description>
<description>An old-style screen saver where the asteroids are shot away.</description>
<platform>@PLATFORM@</platform>
<assets>
<icon>resources/icon.png</icon>
<fanart>resources/fanart.png</fanart>
<screenshot>resources/screenshot-01.png</screenshot>
<screenshot>resources/screenshot-02.png</screenshot>
<screenshot>resources/screenshot-03.png</screenshot>
</assets>
</extension>
</addon>
Binary file added screensaver.asteroids/resources/fanart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screensaver.asteroids/resources/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screensaver.asteroids/resources/screenshot-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screensaver.asteroids/resources/screenshot-02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screensaver.asteroids/resources/screenshot-03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 0 additions & 11 deletions screensaver.asteroids/resources/shaders/GL/1.5/vert.glsl

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ out vec4 FragColor;

void main()
{
FragColor = m_col;
FragColor = m_col;
}
17 changes: 17 additions & 0 deletions screensaver.asteroids/resources/shaders/GL/vert.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#version 150

in vec3 m_attrpos;
in vec4 m_attrcol;

out vec4 m_cord;
out vec4 m_col;

uniform mat4 m_proj;
uniform mat4 m_model;

void main ()
{
mat4 mvp = m_proj * m_model;
gl_Position = mvp * vec4(m_attrpos.x, m_attrpos.y, m_attrpos.z, 1.0);
m_col = m_attrcol;
}
3 changes: 2 additions & 1 deletion src/shaders/GUIShader.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#pragma once
/*
* Copyright (C) 2005-2018 Team Kodi
* This file is part of Kodi - https://kodi.tv
Expand All @@ -19,6 +18,8 @@
*
*/

#pragma once

#include "Shader.h"
#include "Matrix.h"

Expand Down
Loading

0 comments on commit 09a17de

Please sign in to comment.