Skip to content

Commit

Permalink
refactor more and deal with problem of getting game stuff
Browse files Browse the repository at this point in the history
... when game lives in PATH and user runs it just by its name #22
yeah, that PathToGame is gone since yet

change gui.Font & GuiManager to read the file with picture of letters once

update Magyar ( hu_HU ) translation with help from Attila Kiss

IN PROGRESS ~~ add more support for c++11 like nullptr and such

change build scripts for osx

add extras/headoverheels.desktop by Atilla Kiss
  • Loading branch information
dougmencken committed Mar 3, 2018
1 parent b896595 commit eb4c481
Show file tree
Hide file tree
Showing 36 changed files with 515 additions and 476 deletions.
4 changes: 2 additions & 2 deletions build-osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ pathToCompiler="/Developer/GCC/${gccVersion}/PowerPC/32bit" # ="/usr"
if [ ! -f src/Makefile ]
then
LDFLAGS="-L/opt/xerces-c-3.2.0/lib -L/opt/ogg-vorbis/lib -L/opt/libpng-1.6.34/lib -L/opt/zlib-1.2.8/lib -L${pathToCompiler}/lib" \
CPPFLAGS="-I/opt/xerces-c-3.2.0/include" \
CC="${pathToCompiler}/bin/gcc" CXX="${pathToCompiler}/bin/g++ -std=c++03" \
CPPFLAGS="-I/opt/libpng-1.6.34/include -I/opt/xerces-c-3.2.0/include -I/opt/allegro-4.4.2/include" \
CC="${pathToCompiler}/bin/gcc" CXX="${pathToCompiler}/bin/g++" \
./configure --prefix=${installPrefix} --enable-debug
fi

Expand Down
128 changes: 91 additions & 37 deletions external/buildexternal-osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,45 @@ echo " zlib"
echo " a Massively Spiffy Yet Delicately Unobtrusive Compression Library"
echo

zlib_version="1.2.8"

cd "${pathToExternal}"/zlib
tar xzf zlib-1.2.8.tar.gz
cd zlib-1.2.8

./configure --prefix=/opt/zlib-1.2.8 --libdir=/opt/zlib-1.2.8/lib --archs="" && make
make install DESTDIR=`pwd`/root32dir
CC="/usr/bin/gcc-4.2 -arch ppc64" CXX="/usr/bin/g++-4.2 -arch ppc64" ./configure --prefix=/opt/zlib-1.2.8 --libdir=/opt/zlib-1.2.8/lib --archs="" && make
make install DESTDIR=`pwd`/root64dir
lipo -create root32dir/opt/zlib-1.2.8/lib/libz.1.2.8.dylib root64dir/opt/zlib-1.2.8/lib/libz.1.2.8.dylib -output ./libz.1.2.8.dylib
[ -d "zlib-$zlib_version" ] || tar xzf zlib-"$zlib_version".tar.gz
cd zlib-"$zlib_version"

if [ ! -f ./okay ]; then

./configure --prefix=/opt/zlib-"$zlib_version" --libdir=/opt/zlib-"$zlib_version"/lib --archs="" && make
make install

./configure --prefix=/opt/zlib-1.2.8 --libdir=/opt/zlib-1.2.8/lib --archs="" --static && make
make install DESTDIR=`pwd`/root32dir
CC="/usr/bin/gcc-4.2 -arch ppc64" CXX="/usr/bin/g++-4.2 -arch ppc64" ./configure --prefix=/opt/zlib-1.2.8 --libdir=/opt/zlib-1.2.8/lib --archs="" --static && make
make install DESTDIR=`pwd`/root64dir
lipo -create root32dir/opt/zlib-1.2.8/lib/libz.a root64dir/opt/zlib-1.2.8/lib/libz.a -output ./libz.a
./configure --prefix=/opt/zlib-"$zlib_version" --libdir=/opt/zlib-"$zlib_version"/lib --archs="" --static && make
make install

file -h /opt/zlib-1.2.8/lib/libz*
file -h /opt/zlib-"$zlib_version"/lib/libz*
echo "okay" > ./okay

fi

echo
echo " libpng"
echo " a Portable Network Graphics reference library which supports almost all PNG features"
echo

libpng_version="1.6.34"

cd "${pathToExternal}"/libpng
tar xzf libpng-1.6.34.tar.gz
cd libpng-1.6.34
[ -d libpng-"$libpng_version" ] || tar xzf libpng-"$libpng_version".tar.gz
cd libpng-"$libpng_version"

if [ ! -f ./okay ]; then

LDFLAGS="-L/opt/zlib-1.2.8/lib" ./configure --prefix=/opt/libpng-1.6.34 --enable-static --enable-shared --with-zlib-prefix=/opt/zlib-1.2.8
LDFLAGS="-L/opt/zlib-$zlib_version/lib" ./configure --prefix=/opt/libpng-"$libpng_version" --enable-static --enable-shared --with-zlib-prefix=/opt/zlib-"$zlib_version"
make
make install

cd "${pathToExternal}"
echo "okay" > ./okay

fi

echo
echo " ogg-vorbis ( libogg, libvorbis, vorbis-tools )"
Expand All @@ -57,71 +62,120 @@ echo
echo " libogg"
echo

libogg_version="1.3.3"

cd "${pathToExternal}"/ogg-vorbis
tar xzf libogg-1.3.3.tar.gz
cd libogg-1.3.3
[ -d libogg-"$libogg_version" ] || tar xzf libogg-"$libogg_version".tar.gz
cd libogg-"$libogg_version"

if [ ! -f ./okay ]; then

./configure --prefix=/opt/ogg-vorbis && make
make install

rm -r -f /usr/include/ogg
ln -s /opt/ogg-vorbis/include/ogg /usr/include/ogg

echo "okay" > ./okay

fi

echo
echo " libvorbis"
echo

libvorbis_version="1.3.5"

cd "${pathToExternal}"/ogg-vorbis
tar xzf libvorbis-1.3.5.tar.gz
cd libvorbis-1.3.5
[ -d libvorbis-"$libvorbis_version" ] || tar xzf libvorbis-"$libvorbis_version".tar.gz
cd libvorbis-"$libvorbis_version"

if [ ! -f ./okay ]; then

./configure --prefix=/opt/ogg-vorbis --with-ogg=/opt/ogg-vorbis && make
make install

rm -f -r /usr/include/vorbis
ln -s /opt/ogg-vorbis/include/vorbis /usr/include/vorbis

echo "okay" > ./okay

fi

echo
echo " vorbis-tools"
echo

vorbistools_version="1.4.0"

cd "${pathToExternal}"/ogg-vorbis
tar xzf vorbis-tools-1.4.0.tar.gz
cd vorbis-tools-1.4.0
[ -d vorbis-tools-"$vorbistools_version" ] || tar xzf vorbis-tools-"$vorbistools_version".tar.gz
cd vorbis-tools-"$vorbistools_version"

if [ ! -f ./okay ]; then

./configure --prefix=/opt/ogg-vorbis --with-ogg=/opt/ogg-vorbis --with-vorbis=/opt/ogg-vorbis && make
make install

echo "okay" > ./okay

fi

echo
echo " xerces-c"
echo " a validating XML parser written in a portable subset of C++"
echo

xercesc_version="3.2.0"

cd "${pathToExternal}"/xerces-c
tar xjf xerces-c-3.2.0.tar.bz2
cd xerces-c-3.2.0
[ -d xerces-c-"$xercesc_version" ] || tar xjf xerces-c-"$xercesc_version".tar.bz2
cd xerces-c-"$xercesc_version"

CC="/usr/bin/gcc-4.2" CXX="/usr/bin/g++-4.2" ./configure --prefix=/opt/xerces-c-3.2.0
if [ ! -f ./okay ]; then

./configure --prefix=/opt/xerces-c-"$xercesc_version"
make
make install

echo "okay" > ./okay

fi

echo
echo " allegro 4"
echo " a cross-platform library for video game and multimedia programming"
echo

cd "${pathToExternal}"/allegro
tar xzf allegro-4.4.2.tar.gz
cd allegro-4.4.2
allegro4_version="4.4.2"

mkdir TheBuild && cd TheBuild
export CC="/usr/bin/gcc-4.2" CXX="/usr/bin/g++-4.2"
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=/opt/allegro-4.4.2 ..
make
mkdir -p docs/txt ; cp ./docs/build/* ./docs/txt/ && make install
if [ -x "$( command -v cmake )" ]; then

rm -f /usr/bin/allegro-config
ln -s /opt/allegro-4.4.2/bin/allegro-config /usr/bin/allegro-config
cd "${pathToExternal}"/allegro
[ -d allegro-"$allegro4_version" ] || tar xzf allegro-"$allegro4_version".tar.gz
cd allegro-"$allegro4_version"

if [ ! -f ./okay ]; then

mkdir TheBuild && cd TheBuild
# export CC=`command -v gcc` CXX=`command -v g++`
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=/opt/allegro-"$allegro4_version" -DCMAKE_C_FLAGS:STRING="-fno-common" ..
make
mkdir -p docs/txt ; cp ./docs/build/* ./docs/txt/ && make install
cd ..

rm -f /usr/bin/allegro-config
ln -s /opt/allegro-"$allegro4_version"/bin/allegro-config /usr/bin/allegro-config

echo "okay" > ./okay

fi

else

echo "can’t build allegro 4, it needs cmake to build"

fi

echo
echo " the end"
10 changes: 10 additions & 0 deletions extras/headoverheels.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Name=headoverheels
GenericName=Head over Heels
Comment=Solid 3d Game
Comment[hu]=Klasszikus szobás játék
Exec=headoverheels
Icon=headoverheels
StartupNotify=false
Type=Application
Categories=Game;ActionGame;PuzzleGame
6 changes: 6 additions & 0 deletions gamedata/text/hu_HU.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,12 @@
</properties>
</text>

<text id="play-room-melodies">
<properties>
<ustring>helyiség hangok</ustring>
</properties>
</text>

<text id="show-credits">
<properties>
<ustring>alkotók</ustring>
Expand Down
7 changes: 4 additions & 3 deletions src/BonusManager.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

#include "BonusManager.hpp"
#include "Ism.hpp"


namespace isomot
Expand All @@ -15,11 +16,11 @@ BonusManager::~BonusManager( )
bonusRooms.clear();
}

BonusManager * BonusManager::instance = 0 ;
BonusManager * BonusManager::instance = nilPointer ;

BonusManager* BonusManager::getInstance ()
{
if ( instance == 0 )
if ( instance == nilPointer )
{
instance = new BonusManager();
}
Expand Down Expand Up @@ -101,7 +102,7 @@ bool BonusRoom::isPresent ( const std::string& label )

bool BonusRoom::operator== ( const std::string& fileName )
{
return ( this->nameOfFile.compare( fileName ) == 0 ) ;
return ( this->nameOfFile == fileName ) ;
}

}
5 changes: 3 additions & 2 deletions src/Color.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

#include "Color.hpp"
#include "Ism.hpp"

#include <cmath> // for sqrt

Expand All @@ -22,7 +23,7 @@ BITMAP* Color::colorizePicture( BITMAP* picture, Color* color )
/* private static */
BITMAP* Color::colorizePicture( BITMAP* picture, unsigned char red, unsigned char green, unsigned char blue )
{
if ( picture == 0 ) return 0 ;
if ( picture == nilPointer ) return nilPointer ;

for ( int x = 0; x < picture->w; x++ )
{
Expand All @@ -41,7 +42,7 @@ BITMAP* Color::colorizePicture( BITMAP* picture, unsigned char red, unsigned cha
/* public static */
BITMAP * Color::pictureToGrayscale ( BITMAP * picture )
{
if ( picture == 0 ) return 0 ;
if ( picture == nilPointer ) return nilPointer ;

for ( int y = 0; y < picture->h; y++ )
{
Expand Down
18 changes: 9 additions & 9 deletions src/Door.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Door::Door( ItemDataManager * itemData, const std::string& label, int cx, int cy
, cy( cy )
, z( z )
, positionOfDoor( way )
, leftJamb( 0 )
, rightJamb( 0 )
, lintel( 0 )
, leftJamb( nilPointer )
, rightJamb( nilPointer )
, lintel( nilPointer )
{
/* std::cout << "creation of door \"" << labelOfDoor << "\"" << std::endl ; */
}
Expand All @@ -29,14 +29,14 @@ Door::~Door()

FreeItem* Door::getLeftJamb()
{
if ( leftJamb == 0 )
if ( leftJamb == nilPointer )
{
int x( 0 ), y( 0 );
int tileSize = mediator->getRoom()->getSizeOfOneTile();

ItemData* leftJambData = itemDataManager->findItemByLabel( labelOfDoor + "~leftjamb" );

if ( leftJambData != 0 )
if ( leftJambData != nilPointer )
{
switch ( getWhereIsDoor().getIntegerOfWay() )
{
Expand Down Expand Up @@ -85,14 +85,14 @@ FreeItem* Door::getLeftJamb()

FreeItem* Door::getRightJamb()
{
if ( rightJamb == 0 )
if ( rightJamb == nilPointer )
{
int x( 0 ), y( 0 );
int tileSize = mediator->getRoom()->getSizeOfOneTile();

ItemData* rightJambData = itemDataManager->findItemByLabel( labelOfDoor + "~rightjamb" );

if ( rightJambData != 0 )
if ( rightJambData != nilPointer )
{
switch ( getWhereIsDoor().getIntegerOfWay() )
{
Expand Down Expand Up @@ -141,14 +141,14 @@ FreeItem* Door::getRightJamb()

FreeItem* Door::getLintel()
{
if ( lintel == 0 )
if ( lintel == nilPointer )
{
int x( 0 ), y( 0 );
int tileSize = mediator->getRoom()->getSizeOfOneTile();

ItemData* lintelData = itemDataManager->findItemByLabel( labelOfDoor + "~lintel" );

if ( lintelData != 0 )
if ( lintelData != nilPointer )
{
switch ( getWhereIsDoor().getIntegerOfWay() )
{
Expand Down
Loading

0 comments on commit eb4c481

Please sign in to comment.