Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 9 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,19 @@ install(TARGETS ${LIRI_EXECUTABLE_NAME}

install(FILES io.github.petitlapin.Li-ri.appdata.xml DESTINATION "${CMAKE_INSTALL_DATADIR}/appdata/")
install(FILES io.github.petitlapin.Li-ri.desktop DESTINATION "${CMAKE_INSTALL_DATADIR}/applications/")
install(FILES data/Li-ri-icon-16x16.png DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/16x16/apps/" RENAME io.github.petitlapin.Li-ri.png)
install(FILES data/Li-ri-icon-32x32.png DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/apps/" RENAME io.github.petitlapin.Li-ri.png)
install(FILES data/Li-ri-icon-48x48.png DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/48x48/apps/" RENAME io.github.petitlapin.Li-ri.png)
install(FILES data/Li-ri-icon-64x64.png DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/64x64/apps/" RENAME io.github.petitlapin.Li-ri.png)
install(FILES data/Li-ri-icon-128x128.png DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/128x128/apps/" RENAME io.github.petitlapin.Li-ri.png)
install(FILES Icons/Li-ri-icon-16x16.png DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/16x16/apps/" RENAME io.github.petitlapin.Li-ri.png)
install(FILES Icons/Li-ri-icon-32x32.png DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/apps/" RENAME io.github.petitlapin.Li-ri.png)
install(FILES Icons/Li-ri-icon-48x48.png DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/48x48/apps/" RENAME io.github.petitlapin.Li-ri.png)
install(FILES Icons/Li-ri-icon-64x64.png DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/64x64/apps/" RENAME io.github.petitlapin.Li-ri.png)
install(FILES Icons/Li-ri-icon-128x128.png DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/128x128/apps/" RENAME io.github.petitlapin.Li-ri.png)

if(WIN32)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/data/ DESTINATION bin)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/Assets DESTINATION bin)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/Icons DESTINATION bin)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/Sounds DESTINATION bin)
else()
install(DIRECTORY ${CMAKE_SOURCE_DIR}/data/ DESTINATION "${CMAKE_INSTALL_DATADIR}/Li-ri")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/Assets DESTINATION "${CMAKE_INSTALL_DATADIR}/Li-ri")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/Icons DESTINATION "${CMAKE_INSTALL_DATADIR}/Li-ri")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/Sounds DESTINATION "${CMAKE_INSTALL_DATADIR}/Li-ri")
endif()
option(RILI_ENABLE_IPO
Expand Down
4 changes: 2 additions & 2 deletions CPackLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if(WIN32)
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${LIRI_EXECUTABLE_NAME}")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${LIRI_EXECUTABLE_NAME}")
#set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/installer\\\\gcompris-header.bmp")
set(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/data\\\\li-ri.ico")
set(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/Icons\\\\li-ri.ico")
#set(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/installer\\\\Liri-uninstall.ico")
#set(CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP "${PROJECT_SOURCE_DIR}/installer\\\\welcome-page.bmp")
#set(CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP "${PROJECT_SOURCE_DIR}/installer\\\\welcome-page.bmp")
Expand All @@ -31,7 +31,7 @@ if(WIN32)
set(CPACK_NSIS_MUI_FINISHPAGE_RUN "${LIRI_EXECUTABLE_NAME}")
set(CPACK_PACKAGE_VENDOR "Li-Ri team")
else()
set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/data/Li-ri-icon-48x48.png")
set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/Icons/Li-ri-icon-48x48.png")
endif()

if(UNIX)
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Copyright (c) 2006
Dominique Roux-Serret: design & programming & graphics & website.
Maf464: musics

Copyright (c) 2006 (for "menu.mod", "jeu1.xm", "jeu2.xm") MAF464 (email charcosset.b@free.fr; website http://maf464.free.fr). This music licensed under GPL license. See COPYING for details
Copyright (c) 2006 (for "menu.mod", "ingame1.xm", "ingame2.xm") MAF464 (email charcosset.b@free.fr; website http://maf464.free.fr). This music licensed under GPL license. See COPYING for details

[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
alt="Get it on F-Droid"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions src/audio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ bool Audio::Init()
Utils::GetPath(PathFile);
Sound[sExpand] = Mix_LoadWAV(PathFile);

strcpy(PathFile, "Sounds/car.wav");
strcpy(PathFile, "Sounds/wagon.wav");
Utils::GetPath(PathFile);
Sound[sCar] = Mix_LoadWAV(PathFile);
Sound[sWagon] = Mix_LoadWAV(PathFile);

strcpy(PathFile, "Sounds/shrink.wav");
Utils::GetPath(PathFile);
Expand All @@ -108,7 +108,7 @@ bool Audio::Init()
/*********************************************************************/
void Audio::LoadMusic(int Num)
{
char Provi[512] = "Sounds/jeu1.xm";
char Provi[512] = "Sounds/ingame1.xm";

if (!N) {
return;
Expand All @@ -129,7 +129,7 @@ void Audio::LoadMusic(int Num)
Music = Mix_LoadMUS(Provi);
}
else {
Provi[10] = (char)(Num) + '0';
Provi[13] = (char)(Num) + '0';
Utils::GetPath(Provi);
Music = Mix_LoadMUS(Provi);
}
Expand Down
2 changes: 1 addition & 1 deletion src/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ enum eSound {
sEnd,
sLose,
sExpand,
sCar,
sWagon,
sShrink,
sLive,
sSize
Expand Down
12 changes: 6 additions & 6 deletions src/editor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ eMenu Editor::SDLMain(int LevelNumber)
}
m_level.T[NumN].T[cy * LT + cx] = TypeB;
break;
case car:
m_level.T[NumN].T[cy * LT + cx] = C_Car;
case wagon:
m_level.T[NumN].T[cy * LT + cx] = C_Wagon;
break;
case expander:
m_level.T[NumN].T[cy * LT + cx] = C_Expand;
Expand Down Expand Up @@ -249,8 +249,8 @@ void Editor::Draw() const
// Display possible sprites
for (i = 0; i < LT * HT; i++) {
switch (T[i]) {
case C_Car: // Car sprite
Sprites[car].Draw(i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2, 25);
case C_Wagon: // Wagon sprite
Sprites[wagon].Draw(i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2, 25);
break;
case C_Expand: // Expand sprite
Sprites[expander].Draw(i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2, 25);
Expand Down Expand Up @@ -286,7 +286,7 @@ void Editor::Draw() const
// Displays selected option in the menu
switch (Option) {
case rail:
case car:
case wagon:
case expander:
case shrinker:
case speed:
Expand Down Expand Up @@ -411,7 +411,7 @@ void Editor::GetKeyPress(int Key)
Option = rail;
break;
case 'z':
Option = car;
Option = wagon;
break;
case 'e':
Option = expander;
Expand Down
4 changes: 2 additions & 2 deletions src/game.cc
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,8 @@ void Game::DisplayScreen()
// Display options
for (i = 0; i < LT * HT; i++) {
switch (T[i]) {
case C_Car: // if car sprite
m_screen.PrintSprite(car, (GameClock * 40 / 1000 + i * 7) % 50, i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2);
case C_Wagon: // if wagon sprite
m_screen.PrintSprite(wagon, (GameClock * 40 / 1000 + i * 7) % 50, i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2);
break;
case C_Expand: // if expander sprite
m_screen.PrintSprite(expander, (GameClock * 40 / 1000 + i * 7) % 50, i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2);
Expand Down
4 changes: 2 additions & 2 deletions src/level.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ bool Level::Load()
unsigned char *Buf;
long L, P = 2;
int i, j;
char NameLevelFile[512] = "levels.dat";
char NameLevelFile[512] = "Assets/levels.dat";

Utils::GetPath(NameLevelFile);
L = Utils::LoadFile(NameLevelFile, Buf);
Expand Down Expand Up @@ -80,7 +80,7 @@ bool Level::Save()
unsigned char *Buf;
long P = 2;
int i, j;
char NameLevelFile[512] = "levels.dat";
char NameLevelFile[512] = "Assets/levels.dat";

// Allocate memory
Buf = new unsigned char[sizeof(s_Level) * N + sizeof(int) + 1];
Expand Down
20 changes: 10 additions & 10 deletions src/loco.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void Loco::Display(Screen &screen)
int cdx, cdy, cfx = 0, cfy = 0; // Attachment point for cables
float lv;

// Display all wagon/(cars)
// Display all wagon
for (i = 0; i < NWagon; i++) {
// Search wagon points
switch (Wagon[i]) {
Expand All @@ -135,7 +135,7 @@ void Loco::Display(Screen &screen)
lv = 20;
}

// Calculate cars point's position
// Calculate wagons point's position
FindPoint(D - p1, x1, y1);
FindPoint(D - p2, x2, y2);

Expand Down Expand Up @@ -186,7 +186,7 @@ void Loco::Display(Screen &screen)
// Displays the cable
screen.PrintCable(cdx, cdy, cfx, cfy);
}
// Calculate the attachment point for the next Wagon/car
// Calculate the attachment point for the next Wagon
cfx = x1 - (int)(sin(ar + M_PI) * lv);
cfy = y1 - (int)(cos(ar + M_PI) * lv);

Expand Down Expand Up @@ -222,7 +222,7 @@ void Loco::Display(Screen &screen)
}
}

// Add gap between the wagons/cars
// Add gap between the wagons
ltrain += Pref.WagonGap;
}
}
Expand All @@ -240,15 +240,15 @@ void Loco::TestTile(float Dist, long GameDuration, int *Level)
if (D <= DMoy && D + Dist >= DMoy) {
// Check if on an item
switch (Level[T[LocoPos].P]) {
case C_Car: // New wagon/car
m_audio.Play(sCar);
case C_Wagon: // New wagon
m_audio.Play(sWagon);
Level[T[LocoPos].P] = 1; // Remove item from level
Pref.Score += 5;
AddLoco(); // Add a random wagon

Win = true; // Check if it was the last wagon for win condition
for (i = 0; i < LT * HT; i++) {
if (Level[i] == C_Car) {
if (Level[i] == C_Wagon) {
Win = false;
}
}
Expand Down Expand Up @@ -291,7 +291,7 @@ void Loco::TestTile(float Dist, long GameDuration, int *Level)
break;
}

// Collision check with another wagon/car
// Collision check with another wagon
for (i = 1; i < NWagon; i++) {
vx = (float)(PosWagon[i].dx - PosWagon[0].dx);
vy = (float)(PosWagon[i].dy - PosWagon[0].dy);
Expand Down Expand Up @@ -663,9 +663,9 @@ void Loco::FindPoint(float Dist, int &x, int &y)
/*********************************************/
void Loco::AddLoco()
{
Wagon[NWagon] = (e_Sprite)(rand() % (car - logs_wagon) + logs_wagon);
Wagon[NWagon] = (e_Sprite)(rand() % (wagon - logs_wagon) + logs_wagon);
if (Wagon[NWagon] == Wagon[NWagon - 1]) { // Avoids adding the same sprite twice
if (Wagon[NWagon] + 1 == car) {
if (Wagon[NWagon] + 1 == wagon) {
Wagon[NWagon] = logs_wagon;
}
else {
Expand Down
2 changes: 1 addition & 1 deletion src/loco.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Loco
void MoveForward(int Duration, long GameDuration, int *Key, int *Level); // Makes locomotive move forward for Duration in ms
void FindArrow(int *Level, int *Key); // Search the position of the next intersection
bool TestDir(int FDir, int *Level); // Check if a direction/turn is possible
void AddLoco(); // Adds a random car to the locomotive
void AddLoco(); // Adds a random wagon to the locomotive

inline bool Go(int FutureDirection); // Move the locomotive
inline void FindPoint(float Dist, int &x, int &y); // Searching a point on the map
Expand Down
2 changes: 1 addition & 1 deletion src/preference.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
/*** Possible pieces on the level ***/
#define C_None 0
#define C_Rail 1
#define C_Car 2
#define C_Wagon 2
#define C_Expand 3
#define C_Shrink 4
#define C_Speed 5
Expand Down
13 changes: 6 additions & 7 deletions src/sprite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ bool LoadLanguage()
long L, P;
int i;
unsigned char *Buf;
char PathFile[512];

strcpy(PathFile, Languages[Pref.Language]);
char PathFile[512] = "Assets/";
strcat(PathFile, Languages[Pref.Language]);
Utils::GetPath(PathFile);
if (Utils::FileExists(PathFile) == false) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to find '%s'", Languages[Pref.Language]);
Expand Down Expand Up @@ -108,7 +107,7 @@ bool LoadSprites()
unsigned char *Buf;
int NSp;

char PathFile[512] = "language.dat";
char PathFile[512] = "Assets/language.dat";
Utils::GetPath(PathFile);

// Initialize characters table for texts
Expand All @@ -129,7 +128,7 @@ bool LoadSprites()
// *** Loads the languages file ***
// ********************************
if (Utils::FileExists(PathFile) == false) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to find 'language.dat'");
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to find 'Assets/language.dat'");
return false;
}
L = Utils::LoadFile(PathFile, Buf);
Expand Down Expand Up @@ -166,10 +165,10 @@ bool LoadSprites()

// *** loads sprites file ***
// **************************
strcpy(PathFile, "sprites.dat");
strcpy(PathFile, "Assets/sprites.dat");
Utils::GetPath(PathFile);
if (Utils::FileExists(PathFile) == false) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to find 'sprites.dat'");
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to find 'Assets/sprites.dat'");
return false;
}
L = Utils::LoadFile(PathFile, Buf);
Expand Down
2 changes: 1 addition & 1 deletion src/sprite.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ enum e_Sprite {
cargo_wagon,
engine_wagon,
cistern_wagon,
car,
wagon,
expander,
shrinker,
speed,
Expand Down
Loading