asciiquarium: Add cmake build support, app is renamed tdeasciiquarium.

Signed-off-by: gregory guy <gregory-tde@laposte.net>
pull/16/head
gregory guy 3 years ago
parent b0ef1b76e6
commit 749694a3f2
No known key found for this signature in database
GPG Key ID: 2CC84A1CC6823AF8

@ -1,18 +1,18 @@
#################################################
#
# (C) 2011 Golubev Alexander
# fatzer2 (AT) gmail.com
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################
###########################################
# #
# (C) 2011 Golubev Alexander #
# fatzer2 (AT) gmail.com #
# #
# Improvements and feedback are welcome #
# #
# This file is released under GPL >= 2 #
# #
###########################################
cmake_minimum_required( VERSION 2.8.12 )
##### general package setup #####################
##### general package setup
project( tdeartwork )
@ -20,7 +20,7 @@ set( PACKAGE tdeartwork )
set( VERSION R14.1.0 )
##### include essential cmake modules ###########
##### include essential cmake modules
include( FindPkgConfig )
include( CheckIncludeFile )
@ -29,79 +29,84 @@ include( CheckCXXSourceCompiles )
include( CheckSymbolExists )
##### include our cmake modules #################
##### include our cmake modules
set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
include( TDEMacros )
##### setup install paths #######################
##### setup install paths
include( TDESetupPaths )
tde_setup_paths( )
##### optional stuff ############################
##### optional stuff
option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
option( WITH_XSCREENSAVER "Enable xscreensavers support" ${WITH_ALL_OPTIONS} )
option( WITH_ALL_INCLUDED_XSCREENSAVERS "Install all included desktop files" OFF ) #regardless of the presence of XML
option( WITH_LIBART "Enable libart support" ${WITH_ALL_OPTIONS} )
option( WITH_OPENGL "Enable 3D GL modes" ${WITH_ALL_OPTIONS} )
option( WITH_ARTS "Enable aRts support" OFF )
option( WITH_XSCREENSAVER "Enable xscreensavers support" ${WITH_ALL_OPTIONS} )
option( WITH_ALL_INCLUDED_XSCREENSAVERS
"Install all included desktop files regardless of the presence of XML" OFF )
option( WITH_LIBART "Enable libart support" ${WITH_ALL_OPTIONS} )
option( WITH_OPENGL "Enable 3D GL modes" ${WITH_ALL_OPTIONS} )
option( WITH_ARTS "Enable aRts support" OFF )
########### options comments ##############
# #
# affects tdescreensaver build: #
# #
# WITH_XSCREENSAVER #
# WITH_ALL_INCLUDED_XSCREENSAVERS #
# WITH_LIBART #
# WITH_OPENGL #
# WITH_ARTS #
# #
##############################################
##### options comments ##########################
# WITH_XSCREENSAVER affects tdescreensaver
# WITH_ALL_INCLUDED_XSCREENSAVERS affects tdescreensaver
# WITH_LIBART affects tdescreensaver
# WITH_OPENGL affects tdescreensaver
# WITH_ARTS affects tdescreensaver
# NOTE: These flags control which screensavers are compiled/installed.
##### user requested modules ####################
##### user requested modules
option( BUILD_ALL "Build all" ON )
option( BUILD_EMOTICONS "Build emoticons" ${BUILD_ALL} )
option( BUILD_ICEWM_THEMES "Build icewm-themes" ${BUILD_ALL} )
option( BUILD_ICON_THEMES "Build icon themes" ${BUILD_ALL} )
option( BUILD_TDESCREENSAVER "Build tdescreensaver" ${BUILD_ALL} )
option( BUILD_TWIN_STYLES "Build twin styles" ${BUILD_ALL} )
option( BUILD_KWORLDCLOCK "Build kworldclock" ${BUILD_ALL} )
option( BUILD_SOUNDS "Build sounds" ${BUILD_ALL} )
option( BUILD_STYLES "Build styles" ${BUILD_ALL} )
option( BUILD_WALLPAPERS "Build wallpapers" ${BUILD_ALL} )
option( BUILD_TDEASCIIQUARIUM "Build tdeasciiquarium screen saver" ${BUILD_ALL} )
option( BUILD_ALL "Build all" OFF )
option( BUILD_EMOTICONS "Build emoticons" ${BUILD_ALL} )
option( BUILD_ICEWM_THEMES "Build icewm-themes" ${BUILD_ALL} )
option( BUILD_ICON_THEMES "Build icon themes" ${BUILD_ALL} )
option( BUILD_TDESCREENSAVER "Build tdescreensaver" ${BUILD_ALL} )
option( BUILD_TWIN_STYLES "Build twin styles" ${BUILD_ALL} )
option( BUILD_KWORLDCLOCK "Build kworldclock" ${BUILD_ALL} )
option( BUILD_SOUNDS "Build sounds" ${BUILD_ALL} )
option( BUILD_STYLES "Build styles" ${BUILD_ALL} )
option( BUILD_WALLPAPERS "Build wallpapers" ${BUILD_ALL} )
##### configure checks ##########################
##### configure checks
include( ConfigureChecks.cmake )
###### global compiler settings #################
add_definitions(
-DHAVE_CONFIG_H
)
###### global compiler settings
add_definitions( -DHAVE_CONFIG_H )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" )
##### tdenetwork directories ####################
##### tdenetwork directories
tde_conditional_add_subdirectory( BUILD_EMOTICONS emoticons )
tde_conditional_add_subdirectory( BUILD_ICEWM_THEMES icewm-themes )
tde_conditional_add_subdirectory( BUILD_ICON_THEMES IconThemes )
tde_conditional_add_subdirectory( BUILD_TDESCREENSAVER tdescreensaver )
tde_conditional_add_subdirectory( BUILD_TWIN_STYLES twin-styles )
tde_conditional_add_subdirectory( BUILD_KWORLDCLOCK kworldclock )
tde_conditional_add_subdirectory( BUILD_SOUNDS sounds )
tde_conditional_add_subdirectory( BUILD_STYLES styles )
tde_conditional_add_subdirectory( BUILD_WALLPAPERS wallpapers )
tde_conditional_add_subdirectory( BUILD_EMOTICONS emoticons )
tde_conditional_add_subdirectory( BUILD_ICEWM_THEMES icewm-themes )
tde_conditional_add_subdirectory( BUILD_ICON_THEMES IconThemes )
tde_conditional_add_subdirectory( BUILD_TDESCREENSAVER tdescreensaver )
tde_conditional_add_subdirectory( BUILD_TWIN_STYLES twin-styles )
tde_conditional_add_subdirectory( BUILD_KWORLDCLOCK kworldclock )
tde_conditional_add_subdirectory( BUILD_SOUNDS sounds )
tde_conditional_add_subdirectory( BUILD_STYLES styles )
tde_conditional_add_subdirectory( BUILD_WALLPAPERS wallpapers )
##### write configure files #####################
##### write configure files
configure_file( config.h.cmake config.h @ONLY )

@ -95,3 +95,7 @@ if( BUILD_TDESCREENSAVER )
endif( )
endif( WITH_XSCREENSAVER )
endif( BUILD_TDESCREENSAVER )
if( BUILD_TDEASCIIQUARIUM AND (NOT BUILD_TDESCREENSAVER) )
tde_message_fatal( "tdescreensaver build is mandatory for tdeasciiquarium" )
endif()

@ -1,94 +0,0 @@
/*
* Asciiquarium - Native KDE Screensaver based on the Asciiquarium program
* (c) Kirk Baucom <kbaucom@schizoid.com>, which you can find at
* http://www.robobunny.com/projects/asciiquarium/
*
* Ported to KDE by Maksim Orlovich <maksim@kde.org> and
* Michael Pyne <michael.pyne@kdemail.net>.
*
* Copyright (c) 2003 Kirk Baucom <kbaucom@schizoid.com>
* Copyright (c) 2005 Maksim Orlovich <maksim@kde.org>
* Copyright (c) 2005 Michael Pyne <michael.pyne@kdemail.net>
*
* 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 the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "sprite.h"
Sprite::Sprite(Screen* screen, int x, int y, int z, int frameDelay):
m_screen(screen), m_currentFrame(0), m_x(x), m_y(y), m_z(z),
m_isKilled(false), m_killAfterLastFrame(false),
m_ticksSinceFrameChange(0), m_frameDelay(frameDelay)
{
}
void Sprite::addFrame(const Frame& frame)
{
m_frames.append(frame);
}
void Sprite::erase()
{
m_frames[m_currentFrame].erase(m_screen, m_x, m_y);
}
void Sprite::paint()
{
m_frames[m_currentFrame].paint(m_screen, m_x, m_y);
}
bool Sprite::timerTick()
{
++m_ticksSinceFrameChange;
if (m_ticksSinceFrameChange * m_screen->msPerTick() < m_frameDelay)
return false;
//Ring! Ring!
m_ticksSinceFrameChange = 0;
return true;
}
bool Sprite::tickUpdate()
{
if (m_frames.size() == 1)
return false;
if (!timerTick())
return false;
erase();
++m_currentFrame;
if (m_currentFrame == m_frames.size())
{
m_currentFrame = 0;
if(m_killAfterLastFrame)
{
erase();
kill();
}
}
return true;
}
TQRect Sprite::geom() const
{
return TQRect(m_x, m_y, m_frames[0].width(), m_frames[0].height());
}
// vim: set et ts=8 sw=4:

@ -9,6 +9,11 @@
#
#################################################
if( BUILD_TDEASCIIQUARIUM AND BUILD_TDESCREENSAVER )
add_subdirectory( tdeasciiquarium )
endif()
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}

@ -0,0 +1,42 @@
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
)
link_directories(
${TQT_LIBRARY_DIRS}
${TDE_LIB_DIR}
)
##### tdeasciiquarium (executable)
tde_add_executable( tdeasciiquarium.kss AUTOMOC
SOURCES
aasaver.cpp
screen.cpp
frame.cpp
sprite.cpp
AASaverConfig.kcfgc
settingswidget.ui
LINK
tdecore-shared
tdeui-shared
tdescreensaver-shared
DESTINATION ${BIN_INSTALL_DIR}
)
set_source_files_properties( aasaver.cpp PROPERTIES COMPILE_FLAGS -Wno-trigraphs )
##### other data
tde_create_translated_desktop(
SOURCE tdeasciiquarium.desktop
DESTINATION ${APPS_INSTALL_DIR}/System/ScreenSavers
PO_DIR tdescreensaver-desktops
)

@ -0,0 +1,26 @@
/*
* Asciiquarium - Native KDE Screensaver based on the Asciiquarium program
* (c) Kirk Baucom <kbaucom@schizoid.com>, which you can find at
* http://www.robobunny.com/projects/asciiquarium/
*
* Ported to KDE by Maksim Orlovich <maksim@kde.org> and
* Michael Pyne <michael.pyne@kdemail.net>.
*
* Copyright (c) 2003 Kirk Baucom <kbaucom@schizoid.com>
* Copyright (c) 2005 Maksim Orlovich <maksim@kde.org>
* Copyright (c) 2005 Michael Pyne <michael.pyne@kdemail.net>
*
* 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 the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

@ -0,0 +1 @@
TDEAsciiquarium gets registered as Miscellaneous from the Trinity Control Center - Screen Saver option

@ -1,36 +1,3 @@
/*
* Asciiquarium - Native KDE Screensaver based on the Asciiquarium program
* (c) Kirk Baucom <kbaucom@schizoid.com>, which you can find at
* http://www.robobunny.com/projects/asciiquarium/
*
* Ported to KDE by Maksim Orlovich <maksim@kde.org> and
* Michael Pyne <michael.pyne@kdemail.net>.
*
* Copyright (c) 2003 Kirk Baucom <kbaucom@schizoid.com>
* Copyright (c) 2005 Maksim Orlovich <maksim@kde.org>
* Copyright (c) 2005 Michael Pyne <michael.pyne@kdemail.net>
*
* ASCII Art was mostly created by Joan Stark:
* http://www.geocities.com/SoHo/7373/
*
* the rest was crafted by Kirk Baucom, and all of it was edited by
* Maksim Orlovich and Michael Pyne to adopt to C++ formatting.
*
* 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 the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
//Stub stolen from:
// klines 0.1.1 - Basic screen saver for KDE
// by Dirk Staneker 1997
@ -39,9 +6,9 @@
#include <tdelocale.h>
#include <tdeconfigdialog.h>
#include <ntqdesktopwidget.h>
#include <ntqpainter.h>
#include <ntqbrush.h>
#include <tqdesktopwidget.h>
#include <tqpainter.h>
#include <tqbrush.h>
#include "screen.h"
#include "frame.h"
@ -1228,8 +1195,8 @@ void AASaver::paintEvent(TQPaintEvent* pe)
// libkscreensaver interface
extern "C"
{
KDE_EXPORT const char *kss_applicationName = "asciiquarium.kss";
KDE_EXPORT const char *kss_description = I18N_NOOP( "Asciiquarium" );
KDE_EXPORT const char *kss_applicationName = "tdeasciiquarium.kss";
KDE_EXPORT const char *kss_description = I18N_NOOP( "TDEAsciiquarium" );
KDE_EXPORT const char *kss_version = "0.3.2";
KDE_EXPORT KScreenSaver *kss_create( WId id )
@ -1246,11 +1213,8 @@ extern "C"
dialog = new TDEConfigDialog(0, "settings", AASaverConfig::self());
SettingsWidget *settings = new SettingsWidget(0, "settings_widget");
dialog->addPage(settings, i18n("Asciiquarium Settings"), "tdescreensaver");
dialog->addPage(settings, i18n("TDEAsciiquarium Settings"), "tdescreensaver");
return dialog;
}
}
// vim: set et ts=8 sw=4:

@ -1,30 +1,3 @@
/*
* Asciiquarium - Native KDE Screensaver based on the Asciiquarium program
* (c) Kirk Baucom <kbaucom@schizoid.com>, which you can find at
* http://www.robobunny.com/projects/asciiquarium/
*
* Ported to KDE by Maksim Orlovich <maksim@kde.org> and
* Michael Pyne <michael.pyne@kdemail.net>.
*
* Copyright (c) 2003 Kirk Baucom <kbaucom@schizoid.com>
* Copyright (c) 2005 Maksim Orlovich <maksim@kde.org>
* Copyright (c) 2005 Michael Pyne <michael.pyne@kdemail.net>
*
* 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 the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef AA_AASAVER_H
#define AA_AASAVER_H
@ -195,5 +168,3 @@ public:
};
#endif /* AA_AASAVER_H */
// vim: set et ts=8 sw=4:

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
<kcfg>
<kcfgfile name="asciiquariumrc"/>
<kcfgfile name="tdeasciiquariumrc"/>
<group name="Settings">
<entry name="fishCount" type="Int">
<label>Amount of fish to have in the sea.</label>

@ -1,39 +1,12 @@
/*
* Asciiquarium - Native KDE Screensaver based on the Asciiquarium program
* (c) Kirk Baucom <kbaucom@schizoid.com>, which you can find at
* http://www.robobunny.com/projects/asciiquarium/
*
* Ported to KDE by Maksim Orlovich <maksim@kde.org> and
* Michael Pyne <michael.pyne@kdemail.net>.
*
* Copyright (c) 2003 Kirk Baucom <kbaucom@schizoid.com>
* Copyright (c) 2005 Maksim Orlovich <maksim@kde.org>
* Copyright (c) 2005 Michael Pyne <michael.pyne@kdemail.net>
*
* 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 the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <tdeglobalsettings.h>
#include <kdebug.h>
#include <ntqvaluevector.h>
#include <ntqstringlist.h>
#include <ntqimage.h>
#include <ntqfontmetrics.h>
#include <ntqpainter.h>
#include <ntqbitmap.h>
#include <tqvaluevector.h>
#include <tqstringlist.h>
#include <tqimage.h>
#include <tqfontmetrics.h>
#include <tqpainter.h>
#include <tqbitmap.h>
#include "frame.h"
@ -200,5 +173,3 @@ void Frame::erase(Screen* scr, int x, int y)
scr->clearSpan(x, y, m_erasePixmap);
}
// vim: set et ts=8 sw=4:

@ -1,36 +1,9 @@
/*
* Asciiquarium - Native KDE Screensaver based on the Asciiquarium program
* (c) Kirk Baucom <kbaucom@schizoid.com>, which you can find at
* http://www.robobunny.com/projects/asciiquarium/
*
* Ported to KDE by Maksim Orlovich <maksim@kde.org> and
* Michael Pyne <michael.pyne@kdemail.net>.
*
* Copyright (c) 2003 Kirk Baucom <kbaucom@schizoid.com>
* Copyright (c) 2005 Maksim Orlovich <maksim@kde.org>
* Copyright (c) 2005 Michael Pyne <michael.pyne@kdemail.net>
*
* 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 the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef AA_FRAME_H
#define AA_FRAME_H
#include <ntqstring.h>
#include <ntqvaluevector.h>
#include <ntqpixmap.h>
#include <tqstring.h>
#include <tqvaluevector.h>
#include <tqpixmap.h>
#include "screen.h"
/**
@ -146,5 +119,3 @@ protected:
};
#endif
// vim: set et ts=8 sw=4:

@ -1,36 +1,9 @@
/*
* Asciiquarium - Native KDE Screensaver based on the Asciiquarium program
* (c) Kirk Baucom <kbaucom@schizoid.com>, which you can find at
* http://www.robobunny.com/projects/asciiquarium/
*
* Ported to KDE by Maksim Orlovich <maksim@kde.org> and
* Michael Pyne <michael.pyne@kdemail.net>.
*
* Copyright (c) 2003 Kirk Baucom <kbaucom@schizoid.com>
* Copyright (c) 2005 Maksim Orlovich <maksim@kde.org>
* Copyright (c) 2005 Michael Pyne <michael.pyne@kdemail.net>
*
* 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 the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <ntqcolor.h>
#include <ntqfontmetrics.h>
#include <ntqpainter.h>
#include <ntqpixmap.h>
#include <ntqtimer.h>
#include <ntqwidget.h>
#include <tqcolor.h>
#include <tqfontmetrics.h>
#include <tqpainter.h>
#include <tqpixmap.h>
#include <tqtimer.h>
#include <tqwidget.h>
#include <tdeglobalsettings.h>
@ -247,5 +220,3 @@ void Screen::doAnimate()
}
#include "screen.moc"
// vim: set et ts=8 sw=4:

@ -1,38 +1,11 @@
/*
* Asciiquarium - Native KDE Screensaver based on the Asciiquarium program
* (c) Kirk Baucom <kbaucom@schizoid.com>, which you can find at
* http://www.robobunny.com/projects/asciiquarium/
*
* Ported to KDE by Maksim Orlovich <maksim@kde.org> and
* Michael Pyne <michael.pyne@kdemail.net>.
*
* Copyright (c) 2003 Kirk Baucom <kbaucom@schizoid.com>
* Copyright (c) 2005 Maksim Orlovich <maksim@kde.org>
* Copyright (c) 2005 Michael Pyne <michael.pyne@kdemail.net>
*
* 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 the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef AA_SCREEN_H
#define AA_SCREEN_H
#include <ntqcolor.h>
#include <ntqfont.h>
#include <ntqobject.h>
#include <ntqvaluevector.h>
#include <ntqpixmap.h>
#include <tqcolor.h>
#include <tqfont.h>
#include <tqobject.h>
#include <tqvaluevector.h>
#include <tqpixmap.h>
class Sprite;
class AASaver;
@ -167,5 +140,3 @@ public:
};
#endif
// vim: set et ts=8 sw=4:

@ -0,0 +1,64 @@
#include "sprite.h"
Sprite::Sprite(Screen* screen, int x, int y, int z, int frameDelay):
m_screen(screen), m_currentFrame(0), m_x(x), m_y(y), m_z(z),
m_isKilled(false), m_killAfterLastFrame(false),
m_ticksSinceFrameChange(0), m_frameDelay(frameDelay)
{
}
void Sprite::addFrame(const Frame& frame)
{
m_frames.append(frame);
}
void Sprite::erase()
{
m_frames[m_currentFrame].erase(m_screen, m_x, m_y);
}
void Sprite::paint()
{
m_frames[m_currentFrame].paint(m_screen, m_x, m_y);
}
bool Sprite::timerTick()
{
++m_ticksSinceFrameChange;
if (m_ticksSinceFrameChange * m_screen->msPerTick() < m_frameDelay)
return false;
//Ring! Ring!
m_ticksSinceFrameChange = 0;
return true;
}
bool Sprite::tickUpdate()
{
if (m_frames.size() == 1)
return false;
if (!timerTick())
return false;
erase();
++m_currentFrame;
if (m_currentFrame == m_frames.size())
{
m_currentFrame = 0;
if(m_killAfterLastFrame)
{
erase();
kill();
}
}
return true;
}
TQRect Sprite::geom() const
{
return TQRect(m_x, m_y, m_frames[0].width(), m_frames[0].height());
}

@ -1,34 +1,7 @@
/*
* Asciiquarium - Native KDE Screensaver based on the Asciiquarium program
* (c) Kirk Baucom <kbaucom@schizoid.com>, which you can find at
* http://www.robobunny.com/projects/asciiquarium/
*
* Ported to KDE by Maksim Orlovich <maksim@kde.org> and
* Michael Pyne <michael.pyne@kdemail.net>.
*
* Copyright (c) 2003 Kirk Baucom <kbaucom@schizoid.com>
* Copyright (c) 2005 Maksim Orlovich <maksim@kde.org>
* Copyright (c) 2005 Michael Pyne <michael.pyne@kdemail.net>
*
* 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 the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef AA_SPRITE_H
#define AA_SPRITE_H
#include <ntqvaluevector.h>
#include <tqvaluevector.h>
#include "frame.h"
/**
@ -203,5 +176,3 @@ public:
};
#endif
// vim: set et ts=8 sw=4:

@ -1,23 +1,23 @@
[Desktop Entry]
Encoding=UTF-8
Exec=asciiquarium.kss
Exec=tdeasciiquarium.kss
Icon=tdescreensaver
Type=Application
Actions=InWindow;Root;Setup
Name=Asciiquarium
Name=TDEAsciiquarium
X-TDE-Category=Miscellaneous
[Desktop Action InWindow]
Exec=asciiquarium.kss -window-id %w
Exec=tdeasciiquarium.kss -window-id %w
Name=Display in specified window
NoDisplay=true
[Desktop Action Root]
Exec=asciiquarium.kss -root
Exec=tdeasciiquarium.kss -root
Name=Display in root window
NoDisplay=true
[Desktop Action Setup]
Exec=asciiquarium.kss -setup
Exec=tdeasciiquarium.kss -setup
Name=Display setup dialog
NoDisplay=true
Loading…
Cancel
Save