Commit a63a71d7 authored by Martin Erik Werner's avatar Martin Erik Werner

Imported Upstream version 0.2

parent 8ac275e0
......@@ -6,11 +6,6 @@ configuration variables extracted from the original game are released under
the WTFPL license. Note that the old freeware license in data/LIERO(ENG).TXT
no longer applies.
One of the items included in the uthread module (and therefore the whole
module) is GPLv2+ however this module is not used in the gvl library.
The included copy of Zlib is licensed under the Zlib license.
The type_info header is licensed under the Boost Software License 1.0, and
is included in the gvl library.
......@@ -28,36 +23,36 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: https://gitorious.org/lierolibre
Upstream-Contact: Martin Erik Werner <martinerikwerner@gmail.com>
Files: *
Files: ./* src/boostTesting.cpp src/configHelper.* src/configInit.* src/dataPath.*
src/to_string.*
Copyright: 2012, Martin Erik Werner <martinerikwerner@gmail.com>
License: BSD-2-Clause
Comment: The full license texts in this document are separate entities with
separate licenses, and not covered under the BSD-2-Clause license
Files: src/*
Copyright: 2007-2010, Erik Lindroos <gliptic@gmail.com>
2010, Mario Carbajal "basro"
License: BSD-2-Clause
Files: console.* exactObjectList.hpp fastObjectList.hpp lfs.hpp rand.*
rect.hpp sdlmain.cpp sfx.* sobject.* sys.* text.* _build/*
Files: src/console.* src/exactObjectList.hpp src/fastObjectList.hpp src/lfs.hpp
src/rand.* src/rect.hpp src/sdlmain.cpp src/sfx.* src/sobject.* src/sys.*
src/text.* src/_build/*
Copyright: 2007-2010, Erik Lindroos <gliptic@gmail.com>
License: BSD-2-Clause
Files: binReader.* constants.* main.cpp math.* reader.*
Files: src/binReader.* src/constants.* src/main.cpp src/math.* src/reader.*
Copyright: 2007-2010, Erik Lindroos <gliptic@gmail.com>
2012, Martin Erik Werner <martinerikwerner@gmail.com>
License: BSD-2-Clause
Files: common.* controller/localController.cpp gfx.* gfx/font.* Jamfile
level.* menu/menu.* settings.* worm.*
Files: src/common.* src/controller/localController.cpp src/gfx.* src/gfx/font.*
src/Jamfile src/level.* src/menu/menu.* src/settings.* src/worm.*
Copyright: 2007-2010, Erik Lindroos <gliptic@gmail.com>
2010, Mario Carbajal "basro"
2012, Martin Erik Werner <martinerikwerner@gmail.com>
License: BSD-2-Clause
Files: boostTesting.cpp configHelper.* configInit.* dataPath.* to_string.*
AUTHORS autogen.sh ChangeLog configure.ac COPYING Makefile.am NEWS
README
Copyright: 2012, Martin Erik Werner <martinerikwerner@gmail.com>
License: BSD-2-Clause
Comment: The full license texts in this document are separate entities with
separate licenses, and not covered under the BSD-2-Clause license
Files: aclocal.m4 config.h.in configure Makefile.in build-aux/* m4/*
Copyright: 1992-2011, Free Software Foundation, Inc.
License: GPL-2+ or BSD-2-Clause
......@@ -74,7 +69,6 @@ License: WTFPL
Comment: Note that the old freeware license in data/LIERO(ENG).TXT no longer
applies.
Files: data/sounds/*.wav
Copyright: 2012, "sea"
License: WTFPL
......@@ -90,21 +84,11 @@ Files: scripts/lierolibre-extractsounds scripts/lierolibre-packsounds
Copyright: 2012, Martin Erik Werner <martinerikwerner@gmail.com>
License: BSD-2-Clause
Files: gvl/*
Files: src/gvl/*
Copyright: 2007-2010, Erik Lindroos <gliptic@gmail.com>
License: BSD-2-Clause
Files: gvl/zlib/*
Copyright: 1995-2005 Jean-loup Gailly
1995-2005 Mark Adler
License: Zlib
Files: gvl/uthread/uthread_config.hpp
Copyright: 2003 Davide Libenzi
License: GPL-2+
Comment: This file is not used in the the gvl library
Files: gvl/support/type_info.hpp
Files: src/gvl/support/type_info.hpp
Copyright: 2002 David Abrahams
License: BSL-1.0
......
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -2,15 +2,45 @@ lierolibre is an old-school earthworm action game. It is a direct fork of Liero
(OpenLiero).
Features:
* 2 worms, 40 weapons, great playability, two game modes: Kill'em All and Game
of Tag, plus AI-players without true intelligence!
* Dat nostalgia
* Extensions via a hidden F1 menu
+ Replays
+ Game controller support
+ Powerlevel palettes
* Ability to write game variables to plain text files
* Ability to load game variables from both EXE and plain text files
* New freely licensed audio
* Scripts to extract and repack graphics, sounds and levels
* 2 worms, 40 weapons, great playability, two game modes: Kill'em All
and Game of Tag, plus AI-players without true intelligence!
* Dat nostalgia
* Extensions via a hidden F1 menu
+ Replays
+ Game controller support
+ Powerlevel palettes
* Ability to write game variables to plain text files
* Ability to load game variables from both EXE and plain text files
* New freely licensed audio
* Scripts to extract and repack graphics, sounds and levels
To switch between different window sizes, use F6, F7 and F8, to switch to
fullscreen, use F5 or Alt+Enter.
The file 'data/liero.cfg' is a plain text file containing all the game
variables, this file is intented to be modified, go wild! Some things are
likely to not work (make the game refuse to start, or crash) though:
! Appending/Deleting elements
! Changing integers to strings, strings to integers, etc.
! Changing the sine and cosine tables
Compiling, running and installing:
Build-dependencies as named in Debian Wheezy:
build-essential libtool pkg-config libsdl1.2-dev libsdl-mixer1.2-dev zlib1g-dev libconfig++-dev sox imagemagick
To compile lierolibre use:
./configure
make
To run lierolibre from the source directory use:
./lierolibre
To install lierolibre use:
(sudo) make install
Please report bugs at https://bugs.launchpad.net/lierolibre/+filebug
For more information see the manual pages in the man/ direcory, and visit the
Launchpad page:
https://launchpad.net/lierolibre
......@@ -1164,9 +1164,9 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([m4/libtool.m4])
m4_include([m4/ltoptions.m4])
m4_include([m4/ltsugar.m4])
m4_include([m4/ltversion.m4])
m4_include([m4/lt~obsolete.m4])
m4_include([m4/sdl.m4])
m4_include([src/m4/libtool.m4])
m4_include([src/m4/ltoptions.m4])
m4_include([src/m4/ltsugar.m4])
m4_include([src/m4/ltversion.m4])
m4_include([src/m4/lt~obsolete.m4])
m4_include([src/m4/sdl.m4])
#!/bin/sh
autoreconf --force --install
if [ ! -f src/m4/sdl.m4 ]; then
cp /usr/share/aclocal/sdl.m4 src/m4/
fi
#include "bobject.hpp"
#include "gfx/color.hpp"
#include "game.hpp"
#include "constants.hpp"
void Game::createBObject(fixed x, fixed y, fixed velX, fixed velY)
{
BObject& obj = *bobjects.newObjectReuse();
obj.color = rand(common->C[NumBloodColours]) + common->C[FirstBloodColour];
obj.x = x;
obj.y = y;
obj.velX = velX;
obj.velY = velY;
}
bool BObject::process(Game& game)
{
Common& common = *game.common;
x += velX;
y += velY;
int ix = ftoi(x);
int iy = ftoi(y);
if(!game.level.inside(ix, iy))
{
return false;
}
else
{
PalIdx c = game.level.pixel(ix, iy);
Material m = common.materials[c];
if(m.background())
velY += common.C[BObjGravity];
if((c >= 1 && c <= 2)
|| (c >= 77 && c <= 79)) // TODO: Read from EXE
{
game.level.pixel(ix, iy) = 77 + game.rand(3);
return false;
}
/* This can't happen!
else if(iy >= game.level.height)
{
// Nothing
}*/
else if(m.anyDirt())
{
game.level.pixel(ix, iy) = 82 + game.rand(3);
return false;
}
else if(m.rock())
{
game.level.pixel(ix, iy) = 85 + game.rand(3);
return false;
}
}
return true;
}
#ifndef LIERO_BOBJECT_HPP
#define LIERO_BOBJECT_HPP
#include "math.hpp"
#include "objectList.hpp"
//#include "exactObjectList.hpp"
#include "fastObjectList.hpp"
struct Game;
struct BObject // : ExactObjectListBase
{
bool process(Game& game);
fixed x, y;
fixed velX, velY;
int color;
};
//void createBObject(fixed x, fixed y, fixed velX, fixed velY);
#endif // LIERO_BOBJECT_HPP
#include "bonus.hpp"
#include "game.hpp"
#include "constants.hpp"
#include <iostream>
#include <cstdlib>
void Bonus::process(Game& game)
{
Common& common = *game.common;
y += velY;
int ix = ftoi(x), iy = ftoi(y);
if(game.level.inside(ix, iy + 1)
&& common.materials[game.level.pixel(ix, iy + 1)].background())
{
velY += common.C[BonusGravity];
}
int inewY = ftoi(y + velY);
if(inewY < 0 || inewY >= game.level.height - 1
|| common.materials[game.level.pixel(ix, inewY)].dirtRock())
{
velY = -(velY * common.C[BonusBounceMul]) / common.C[BonusBounceDiv];
if(std::abs(velY) < 100) // TODO: Read from EXE
velY = 0;
}
if(--timer <= 0)
{
common.sobjectTypes[common.bonusSObjects[frame]].create(game, ix, iy, 0);
if(used)
game.bonuses.free(this);
}
}
#ifndef LIERO_BONUS_HPP
#define LIERO_BONUS_HPP
#include "math.hpp"
#include "objectList.hpp"
#include "exactObjectList.hpp"
struct Game;
struct Bonus : ExactObjectListBase
{
Bonus()
: frame(-1)
{
}
fixed x;
fixed y;
fixed velY;
int frame;
int timer;
int weapon;
void process(Game& game);
};
#endif // LIERO_BONUS_HPP
#include "configInit.hpp"
#include <string>
#include <fstream>
#include <exception>
#include "filesystem.hpp"
#include "gfx.hpp"
#include "common.hpp"
#include "console.hpp"
#include "reader.hpp"
using namespace std;
ConfigInit::ConfigInit(string filePath, gvl::shared_ptr<Common> a_common)
{
common = a_common;
if(getExtension(filePath) == "EXE" || getExtension(filePath) == "exe") {
setLieroEXE(filePath);
loadFromEXE(filePath);
} else {
setLieroPath(filePath);
loadFromCFG(lieroCFG);
}
}
void ConfigInit::consoleBlurb()
{
Console::clear();
Console::writeTextBar(common->texts.copyright1, common->texts.copyrightBarFormat);
Console::setAttributes(0x07);
Console::writeLine("");
Console::write(common->S[LoadingAndThinking]);
}
void ConfigInit::loadFromEXE(string filePath)
{
// Need to get grab the path to the exe from somewheres
// setLieroEXE(filePath);
common->texts.loadFromEXE();
initKeys();
common->loadConstantsFromEXE();
loadTablesFromEXE();
consoleBlurb();
common->font.loadFromEXE();
common->loadPalette();
gfx.loadPalette(); // This gets the palette from common
gfx.loadMenus();
common->loadGfx();
common->loadMaterials();
common->loadWeapons();
common->loadTextures();
common->loadOthers();
}
void ConfigInit::loadFromCFG(string filePath)
{
common->texts.loadFromCFG(filePath);
initKeys();
common->loadConstantsFromCFG(filePath);
loadTablesFromCFG(filePath);
consoleBlurb();
common->font.loadFromCFG(filePath);
common->loadPaletteFromCFG(filePath);
gfx.loadPalette(); // This gets the palette from common
gfx.loadMenusFromCFG(filePath);
common->loadGfxFromCFG(filePath);
common->loadMaterialsFromCFG(filePath);
common->loadWeaponsFromCFG(filePath);
common->loadTexturesFromCFG(filePath);
common->loadOthersFromCFG(filePath);
}
void ConfigInit::write(string filePath)
{
Console::writeLine("");
Console::writeLine("Saving variables to file '" + filePath +"'");
// Create empty if nonexistant
if(!fileExists(filePath)) {
ofstream f(filePath.c_str());
f << flush;
f.close();
}
common->texts.writeToCFG(filePath);
common->writeConstantsToCFG(filePath);
writeTablesToCFG(filePath);
common->font.writeToCFG(filePath);
common->writePaletteToCFG(filePath);
gfx.writeMenusToCFG(filePath);
common->writeGfxToCFG(filePath);
common->writeMaterialsToCFG(filePath);
common->writeWeaponsToCFG(filePath);
common->writeTexturesToCFG(filePath);
common->writeOthersToCFG(filePath);
}
This diff is collapsed.
AC_PREREQ([2.59])
AC_INIT([lierolibre C++], [0.1], [martinerikwerner@gmail.com], [lierolibre], [https://gitorious.org/lierolibre])
AC_CONFIG_SRCDIR([worm.cpp])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
AC_INIT([lierolibre C++], [0.2], [martinerikwerner@gmail.com], [lierolibre], [https://gitorious.org/lierolibre])
AC_CONFIG_SRCDIR([src/worm.cpp])
AC_CONFIG_MACRO_DIR([src/m4])
AC_CONFIG_AUX_DIR([src/build-aux])
AC_CONFIG_HEADERS([src/config.h])
LT_INIT
AM_INIT_AUTOMAKE([1.10 -Wall subdir-objects])
AC_DEFINE_UNQUOTED([PACKAGE_CAPTION],
["$PACKAGE_TARNAME $PACKAGE_VERSION"],
[Caption for SDL window])
# Checks for programs.
AC_PROG_CPP
AC_PROG_CC
......@@ -16,7 +20,6 @@ AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_CHECK_PROG(HAS_SOX, sox, yes)
if test x"$HAS_SOX" != x"yes" ; then
......@@ -29,6 +32,14 @@ if test x"$HAS_IM" != x"yes" ; then
fi
# Checks for libraries.
BOOST_PO_LIBS=""
AC_LANG_PUSH([C++])
AC_CHECK_HEADER([boost/program_options.hpp],
[BOOST_PO_LIBS="-lboost_program_options"],
[AC_MSG_WARN(boost_program_options header not found, you will need this to compile lierolibre!)])
AC_LANG_POP([C++])
AC_SUBST(BOOST_PO_LIBS)
LIBRT=""
AC_CHECK_LIB(rt, clock_gettime, [LIBRT="-lrt"])
AC_SUBST(LIBRT)
......@@ -37,26 +48,49 @@ SDL_VERSION=1.2.0
AM_PATH_SDL($SDL_VERSION, :, \
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))
PKG_CHECK_MODULES([DEPS], [libconfig++ SDL_mixer])
PKG_CHECK_MODULES([GVL_DEPS], [zlib])
PKG_CHECK_MODULES([LIBCONFIGXX], [libconfig++])
PKG_CHECK_MODULES([SDL_MIXER], [SDL_mixer],
[SDL_MIXER_CFLAGS=`pkg-config --cflags SDL_mixer` \
SDL_MIXER_LIBS=`pkg-config --libs SDL_mixer`],
[pkgcSDLM="no"])
dnl Get libgvl library and include locations
# Fall back on a quite stupid header check if pkg-config doesn't work
# (pkg-config for SDL_mixer is relatively new)
AS_IF([test "x$pkgcSDLM" = "xno"], [
AC_CHECK_HEADERS([SDL/SDL_mixer.h],
[SDL_MIXER_CFLAGS="-D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL"],
[AC_MSG_WARN(SDL_mixer headers not found, you will need this to compile lierolibre!)])
AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio,
[SDL_MIXER_LIBS="-lSDL_mixer -lSDL"],
[AC_MSG_WARN(SDL_mixer library not found, you will need this to link lierolibre!)])
])
PKG_CHECK_MODULES([ZLIB], [zlib])
# Get libgvl library and include locations
AC_ARG_WITH([gvl-include-path],
[AS_HELP_STRING([--with-gvl-include-path],
[location of the gvl headers, defaults to ./glv/])],
[location of the gvl headers, defaults to ./src/glv/])],
[GVL_CPPFLAGS="-I$withval"],
[GVL_CPPFLAGS='-I./gvl/'])
[GVL_CPPFLAGS='-I./src/gvl/'])
AC_SUBST([GVL_CFLAGS])
AC_ARG_WITH([gvl-lib-path],
[AS_HELP_STRING([--with-gvl-lib-path],
[location of the gvl libraries, defaults to ./gvl/])],
[location of the gvl libraries, defaults to ./src/gvl/])],
[GVL_LIBS="-L$withval -lgvl"],
[GVL_LIBS='-L./gvl/ -lgvl'])
[GVL_LIBS='-L./src/gvl/ -lgvl'])
AC_SUBST([GVL_LIBS])
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h fenv.h float.h limits.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/socket.h unistd.h])
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS([tut/tut.hpp tut/tut_reporter.hpp tut/tut_restartable.hpp],
[],
[AC_MSG_NOTICE(libtut headers not found, you will need these to compile gvltest)])
AC_LANG_POP([C++])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
......
#ifndef LIERO_CONSOLE_HPP
#define LIERO_CONSOLE_HPP
#include <string>
namespace Console
{
void init();
void test();
void waitForAnyKey();
void setAttributes(int attr);
int getAttributes();
void write(std::string const& str);
void writeLine(std::string const& str);