diff --git a/Makefile b/Makefile index fe84559..a05fcdd 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ CXXFLAGS ?= -O2 -Wall -g CXXFLAGS += `pkg-config --cflags sdl2 SDL2_image SDL2_mixer` LIBS = `pkg-config --libs sdl2 SDL2_image SDL2_mixer` -OBJS = alien.o audio.o bullet.o cargo.o collectable.o colors.o cutscene.o engine.o event.o explosion.o game.o gfx.o intermission.o loadSave.o messages.o misc.o missions.o player.o renderer.o resources.o screen.o ship.o shop.o Starfighter.o title.o weapons.o window.o +OBJS = alien.o audio.o bullet.o cargo.o collectable.o colors.o cutscene.o engine.o event.o explosion.o game.o gfx.o intermission.o messages.o misc.o missions.o player.o renderer.o resources.o save.o screen.o ship.o shop.o Starfighter.o title.o weapons.o window.o -VERSION = 1.6 +VERSION = 1.7-dev PROG = starfighter DOCS = docs/* DATA = data gfx sound music diff --git a/src/Starfighter.cpp b/src/Starfighter.cpp index 4e89219..e65daa6 100644 --- a/src/Starfighter.cpp +++ b/src/Starfighter.cpp @@ -2,7 +2,7 @@ Project: Starfighter Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/Starfighter.h b/src/Starfighter.h index 9bdbc83..dba2d90 100644 --- a/src/Starfighter.h +++ b/src/Starfighter.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -48,7 +48,7 @@ along with this program. If not, see . #include "game.h" #include "gfx.h" #include "intermission.h" -#include "loadSave.h" +#include "save.h" #include "messages.h" #include "misc.h" #include "missions.h" diff --git a/src/alien.cpp b/src/alien.cpp index 5a10c44..abc20c8 100644 --- a/src/alien.cpp +++ b/src/alien.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012 Guus Sliepen -Copyright (C) 2012, 2015, 2016 onpon4 +Copyright (C) 2012, 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/alien.h b/src/alien.h index 6039b1e..f9da27c 100644 --- a/src/alien.h +++ b/src/alien.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/audio.cpp b/src/audio.cpp index cfc4d15..13ce057 100644 --- a/src/audio.cpp +++ b/src/audio.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/audio.h b/src/audio.h index 68402ab..b0cc0f6 100644 --- a/src/audio.h +++ b/src/audio.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/bullet.cpp b/src/bullet.cpp index 6faeb37..21847c7 100644 --- a/src/bullet.cpp +++ b/src/bullet.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/bullet.h b/src/bullet.h index dac88cc..195eae0 100644 --- a/src/bullet.h +++ b/src/bullet.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/cargo.cpp b/src/cargo.cpp index 9dacc8e..3611e5a 100644 --- a/src/cargo.cpp +++ b/src/cargo.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/cargo.h b/src/cargo.h index d5ff5ec..86d8572 100644 --- a/src/cargo.h +++ b/src/cargo.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/collectable.cpp b/src/collectable.cpp index 83960f4..6be040f 100644 --- a/src/collectable.cpp +++ b/src/collectable.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/collectable.h b/src/collectable.h index 1579ffd..e2451d8 100644 --- a/src/collectable.h +++ b/src/collectable.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/colors.cpp b/src/colors.cpp index 78c7b2b..9f0b5ad 100644 --- a/src/colors.cpp +++ b/src/colors.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012, 2013 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/colors.h b/src/colors.h index 3cbf76d..0137e1d 100644 --- a/src/colors.h +++ b/src/colors.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/cutscene.cpp b/src/cutscene.cpp index 0d64a6d..c128c93 100644 --- a/src/cutscene.cpp +++ b/src/cutscene.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012, 2013 Guus Sliepen -Copyright (C) 2012, 2015, 2016 onpon4 +Copyright (C) 2012, 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/cutscene.h b/src/cutscene.h index 18f807c..c926827 100644 --- a/src/cutscene.h +++ b/src/cutscene.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/defs.h b/src/defs.h index 09f33ef..2c09e9a 100644 --- a/src/defs.h +++ b/src/defs.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012 Guus Sliepen -Copyright (C) 2012, 2015, 2016 onpon4 +Copyright (C) 2012, 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/engine.cpp b/src/engine.cpp index 42f6e21..d7cbc26 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012, 2013 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/engine.h b/src/engine.h index 52cc990..5dc1b6d 100644 --- a/src/engine.h +++ b/src/engine.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/event.cpp b/src/event.cpp index e4e5889..228c2d0 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012, 2013 Guus Sliepen -Copyright (C) 2012, 2015, 2016 onpon4 +Copyright (C) 2012, 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/event.h b/src/event.h index 01b44f5..9ddfb3a 100644 --- a/src/event.h +++ b/src/event.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/explosion.cpp b/src/explosion.cpp index 064cc09..07b66ca 100644 --- a/src/explosion.cpp +++ b/src/explosion.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/explosion.h b/src/explosion.h index c59799e..76fd7e5 100644 --- a/src/explosion.h +++ b/src/explosion.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/game.cpp b/src/game.cpp index ff3e10b..46bb7af 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012, 2013 Guus Sliepen -Copyright (C) 2012, 2014, 2015, 2016 onpon4 +Copyright (C) 2012, 2014, 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -2384,7 +2384,7 @@ int game_mainLoop() if (game.area < MISN_VENUS) { updateSystemStatus(); - saveGame(0); + save(0); } rtn = 1; diff --git a/src/game.h b/src/game.h index db3d4e4..bee586d 100644 --- a/src/game.h +++ b/src/game.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/gfx.cpp b/src/gfx.cpp index 50bf21d..e10ebe1 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012, 2013 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/gfx.h b/src/gfx.h index 25f6829..3c04ab8 100644 --- a/src/gfx.h +++ b/src/gfx.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/intermission.cpp b/src/intermission.cpp index 690ba01..c554cec 100644 --- a/src/intermission.cpp +++ b/src/intermission.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012, 2013 Guus Sliepen -Copyright (C) 2012, 2015, 2016 onpon4 +Copyright (C) 2012, 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -1110,7 +1110,7 @@ int intermission() renderer_update(); screen_clear(black); - initSaveSlots(); + save_initSlots(); loadBackground(systemBackground[game.system]); @@ -1179,7 +1179,7 @@ int intermission() SDL_Surface *optionsSurface = gfx_createSurface(320, 240); SDL_Surface *commsSurface = gfx_createSurface(450, 400); - createSavesSurface(savesSurface, -1); + save_createSurface(savesSurface, -1); intermission_createOptions(optionsSurface); intermission_createCommsSurface(commsSurface); @@ -1369,7 +1369,7 @@ int intermission() case 3: screen_blit(savesSurface, 200, 100); - saveSlot = showSaveSlots(savesSurface, saveSlot); + saveSlot = save_showSlots(savesSurface, saveSlot); break; case 4: @@ -1415,7 +1415,7 @@ int intermission() intermission_updateCommsSurface(commsSurface); section = 1; redrawBackground = true; - saveGame(0); + save(0); } else if (interceptionChance > 0) { diff --git a/src/intermission.h b/src/intermission.h index 4bf83b9..67833c6 100644 --- a/src/intermission.h +++ b/src/intermission.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/messages.cpp b/src/messages.cpp index e9fe6d0..602a8a0 100644 --- a/src/messages.cpp +++ b/src/messages.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/messages.h b/src/messages.h index 5c6591b..09bb999 100644 --- a/src/messages.h +++ b/src/messages.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/misc.cpp b/src/misc.cpp index eb454cb..2b26e83 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012, 2013 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/misc.h b/src/misc.h index 8dc4ea4..2d8206d 100644 --- a/src/misc.h +++ b/src/misc.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/missions.cpp b/src/missions.cpp index bca5830..acad228 100644 --- a/src/missions.cpp +++ b/src/missions.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012, 2013 Guus Sliepen -Copyright (C) 2012, 2015, 2016 onpon4 +Copyright (C) 2012, 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/missions.h b/src/missions.h index 7cb313b..602cf2f 100644 --- a/src/missions.h +++ b/src/missions.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/player.cpp b/src/player.cpp index 27ae2e3..62d1148 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012, 2013 Guus Sliepen -Copyright (C) 2012, 2015, 2016 onpon4 +Copyright (C) 2012, 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/player.h b/src/player.h index 5e55417..dd9e66c 100644 --- a/src/player.h +++ b/src/player.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/renderer.cpp b/src/renderer.cpp index cd46d81..34b674b 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012, 2013 Guus Sliepen -Copyright (C) 2015 onpon4 +Copyright (C) 2015 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/renderer.h b/src/renderer.h index 19de26e..1171e7d 100644 --- a/src/renderer.h +++ b/src/renderer.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015 onpon4 +Copyright (C) 2015 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/resources.cpp b/src/resources.cpp index 6ff1229..f34cc21 100644 --- a/src/resources.cpp +++ b/src/resources.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012, 2013 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/resources.h b/src/resources.h index b89d832..e4fb022 100644 --- a/src/resources.h +++ b/src/resources.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/loadSave.cpp b/src/save.cpp similarity index 95% rename from src/loadSave.cpp rename to src/save.cpp index 5027a20..f29989f 100644 --- a/src/loadSave.cpp +++ b/src/save.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012, 2013 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -28,7 +28,7 @@ data. It returns the slot number (1 - 10) of the most recently used file. On the title screen, this is used to determine whether a player can "Continue Current Game" and "Load Saved Game". */ -int initSaveSlots() +int save_initSlots() { char fileName[PATH_MAX]; int system; @@ -140,7 +140,7 @@ int initSaveSlots() /* Fill in later... */ -bool loadGame(int slot) +int save_load(int slot) { char filename[PATH_MAX]; FILE *fp; @@ -155,7 +155,7 @@ bool loadGame(int slot) { printf("Error: Could not determine the version of the save file.\n"); fclose(fp); - return false; + return 0; } switch (game.saveFormat) @@ -209,7 +209,7 @@ bool loadGame(int slot) default: printf("Error: Save format version not recognized.\n"); fclose(fp); - return false; + return 0; } fclose(fp); @@ -220,13 +220,13 @@ bool loadGame(int slot) fp = fopen(filename, "rb"); if (fp == NULL) - return false; + return 0; if (fread(&game, sizeof(Game), 1, fp) != 1) { printf("Save game error. The file was not of the expected format.\n"); fclose(fp); - return false; + return 0; } fclose(fp); @@ -248,10 +248,10 @@ bool loadGame(int slot) for (int i = 0 ; i < 10 ; i++) systemPlanet[i].missionCompleted = game.missionCompleted[i]; - return true; + return 1; } -void saveGame(int slot) +void save(int slot) { FILE *fp; char fileName[PATH_MAX]; @@ -342,11 +342,11 @@ void saveGame(int slot) } // Recall to update the save slots... (lazy, yes) - initSaveSlots(); + save_initSlots(); engine.keyState[KEY_FIRE] = 0; } -void createSavesSurface(SDL_Surface *savesSurface, int clickedSlot) +void save_createSurface(SDL_Surface *savesSurface, int clickedSlot) { int y = 10; @@ -407,7 +407,7 @@ Displays the save slot available. For use with an interface that has the cursor enabled. It returns the index number of the slot clicked so that the function invoking it can perform a load or save on that slot. */ -int showSaveSlots(SDL_Surface *savesSurface, int saveSlot) +int save_showSlots(SDL_Surface *savesSurface, int saveSlot) { int clickedSlot = -1; @@ -425,7 +425,7 @@ int showSaveSlots(SDL_Surface *savesSurface, int saveSlot) r.x, r.y, r.w, r.h)) { clickedSlot = i; - createSavesSurface(savesSurface, i); + save_createSurface(savesSurface, i); } r.y += 30; } @@ -433,13 +433,13 @@ int showSaveSlots(SDL_Surface *savesSurface, int saveSlot) if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 215, 365, 100, 25)) { - saveGame(saveSlot); - createSavesSurface(savesSurface, -10); + save(saveSlot); + save_createSurface(savesSurface, -10); } if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 335, 365, 100, 25)) - createSavesSurface(savesSurface, -1); + save_createSurface(savesSurface, -1); if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 453, 365, 100, 25)) @@ -448,8 +448,8 @@ int showSaveSlots(SDL_Surface *savesSurface, int saveSlot) sprintf(filename, "%ssave%.2d.dat", engine.configDirectory, saveSlot); remove(filename); - initSaveSlots(); - createSavesSurface(savesSurface, -11); + save_initSlots(); + save_createSurface(savesSurface, -11); } } diff --git a/src/loadSave.h b/src/save.h similarity index 68% rename from src/loadSave.h rename to src/save.h index 50e452a..0e292e9 100644 --- a/src/loadSave.h +++ b/src/save.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -17,13 +17,13 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef LOADSAVE_H -#define LOADSAVE_H +#ifndef SAVE_H +#define SAVE_H -extern int initSaveSlots(); -extern bool loadGame(int slot); -extern void saveGame(int slot); -extern void createSavesSurface(SDL_Surface *savesSurface, int clickedSlot); -extern int showSaveSlots(SDL_Surface *savesSurface, int saveSlot); +int save_initSlots(); +int save_load(int slot); +void save(int slot); +void save_createSurface(SDL_Surface *savesSurface, int clickedSlot); +int save_showSlots(SDL_Surface *savesSurface, int saveSlot); #endif diff --git a/src/screen.cpp b/src/screen.cpp index c0e44f2..27e571b 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012, 2013 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/screen.h b/src/screen.h index 42395a8..11b220e 100644 --- a/src/screen.h +++ b/src/screen.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/ship.cpp b/src/ship.cpp index 20c0c5d..fb9d8fd 100644 --- a/src/ship.cpp +++ b/src/ship.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/ship.h b/src/ship.h index 8109d06..568cb52 100644 --- a/src/ship.h +++ b/src/ship.h @@ -1,5 +1,5 @@ /* -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/shop.cpp b/src/shop.cpp index e372b08..b79b70b 100644 --- a/src/shop.cpp +++ b/src/shop.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012, 2013 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -784,7 +784,7 @@ static void buy(int i) if (!engine.cheatCash) game.cash -= shopItems[i].price; - saveGame(0); + save(0); } static void sell(int i) @@ -1007,7 +1007,7 @@ static void sell(int i) else game.cash += shopItems[i].price; - saveGame(0); + save(0); } void showShop() diff --git a/src/shop.h b/src/shop.h index 983657f..ab2d2e1 100644 --- a/src/shop.h +++ b/src/shop.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/structs.h b/src/structs.h index f860a58..2eded19 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012, 2013 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/title.cpp b/src/title.cpp index a236eed..be92e21 100644 --- a/src/title.cpp +++ b/src/title.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012, 2013 Guus Sliepen -Copyright (C) 2012, 2015, 2016 onpon4 +Copyright (C) 2012, 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -227,7 +227,7 @@ int doTitle() renderer_update(); screen_clear(black); - continueSaveSlot = initSaveSlots(); + continueSaveSlot = save_initSlots(); loadBackground("gfx/spirit.jpg"); @@ -406,7 +406,7 @@ int doTitle() 5, screen->h - 60, FONT_WHITE, 0, gfx_background); gfx_renderString("Copyright Guus Sliepen, Astrid S. de Wijn and others 2012", 5, screen->h - 40, FONT_WHITE, 0, gfx_background); - gfx_renderString("Copyright 2015, 2016 onpon4", + gfx_renderString("Copyright 2015, 2016 Julie Marchant", 5, screen->h - 20, FONT_WHITE, 0, gfx_background); gfx_renderString(buildVersion, screen->w - 6 - strlen(buildVersion) * 9, screen->h - 20, FONT_WHITE, 0, gfx_background); @@ -433,7 +433,7 @@ int doTitle() 5, screen->h - 60, FONT_WHITE, 0, gfx_background); gfx_renderString("Copyright Guus Sliepen, Astrid S. de Wijn and others 2012", 5, screen->h - 40, FONT_WHITE, 0, gfx_background); - gfx_renderString("Copyright 2015, 2016 onpon4", + gfx_renderString("Copyright 2015, 2016 Julie Marchant", 5, screen->h - 20, FONT_WHITE, 0, gfx_background); gfx_renderString(buildVersion, screen->w - 6 - strlen(buildVersion) * 9, screen->h - 20, FONT_WHITE, 0, gfx_background); @@ -589,7 +589,7 @@ int doTitle() if (selectedOption == 3) { game_init(); - selectedOption = loadGame(continueSaveSlot); + selectedOption = save_load(continueSaveSlot); } // Send back a negative number... diff --git a/src/title.h b/src/title.h index 804801d..6214029 100644 --- a/src/title.h +++ b/src/title.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/weapons.cpp b/src/weapons.cpp index cc6450d..4c8e027 100644 --- a/src/weapons.cpp +++ b/src/weapons.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2013 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/weapons.h b/src/weapons.h index 740ae16..701c03c 100644 --- a/src/weapons.h +++ b/src/weapons.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/window.cpp b/src/window.cpp index 2c6f17a..d52709c 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011, 2012, 2013 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/src/window.h b/src/window.h index 94041b8..435970c 100644 --- a/src/window.h +++ b/src/window.h @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Parallel Realities Copyright (C) 2011 Guus Sliepen -Copyright (C) 2015, 2016 onpon4 +Copyright (C) 2015, 2016 Julie Marchant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License