Compare commits

..

No commits in common. "89886e6c520e22ff3e2c1e0207bb891ad8ee69d8" and "e9c62ea9a3451bfca3319c94bddeb493cba0c637" have entirely different histories.

11 changed files with 115 additions and 117 deletions

View File

@ -7,19 +7,30 @@ env:
SRC_DIR_PATH: desktop_version
jobs:
build-mac:
name: Build (macos-latest)
build:
name: Build
runs-on: macos-latest
runs-on: ${{ matrix.os }}
env:
CXXFLAGS: -I/usr/local/include/SDL2
LDFLAGS: -L/usr/local/lib
strategy:
matrix:
os: [ubuntu-18.04, macos-latest]
steps:
- uses: actions/checkout@v1
- name: Install dependencies
- name: Install dependencies (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y ninja-build libsdl2-dev libsdl2-mixer-dev
- name: Install dependencies (macOS)
if: startsWith(matrix.os, 'macos')
run: brew install ninja sdl2 sdl2_mixer
- name: CMake configure (default version)
@ -58,55 +69,6 @@ jobs:
- name: Build (no editor)
run: ninja -C ${SRC_DIR_PATH}/build
build-lin:
name: Build (CentOS 7)
runs-on: ubuntu-latest
container: ghcr.io/leo60228/vvvvvv-build@sha256:485448ad437653d47ceb068a0f2b910f4eb336107d340a1f0d828ca95c987985
env:
CXXFLAGS: -I/usr/local/include/SDL2
LDFLAGS: -L/usr/local/lib
steps:
- uses: actions/checkout@v1
- name: CMake configure (default version)
run: |
mkdir ${SRC_DIR_PATH}/build && cd ${SRC_DIR_PATH}/build
cmake ..
- name: Build (default version)
run: make -j $(nproc) -C ${SRC_DIR_PATH}/build
- name: CMake configure (official)
run: |
cd ${SRC_DIR_PATH}/build
cmake -DOFFICIAL_BUILD=ON ..
- name: Build (official)
run: |
make -j $(nproc) -C ${SRC_DIR_PATH}/build
- name: CMake configure (M&P)
run: |
cd ${SRC_DIR_PATH}/build
cmake -DOFFICIAL_BUILD=OFF -DMAKEANDPLAY=ON ..
- name: Build (M&P)
run: make -j $(nproc) -C ${SRC_DIR_PATH}/build
- name: CMake configure (no custom levels)
run: |
cd ${SRC_DIR_PATH}/build
cmake -DMAKEANDPLAY=OFF -DCUSTOM_LEVEL_SUPPORT=DISABLED ..
- name: Build (no custom levels)
run: make -j $(nproc) -C ${SRC_DIR_PATH}/build
- name: CMake configure (no editor)
run: |
cd ${SRC_DIR_PATH}/build
cmake -DCUSTOM_LEVEL_SUPPORT=NO_EDITOR ..
- name: Build (no editor)
run: make -j $(nproc) -C ${SRC_DIR_PATH}/build
build-win:
name: Build (windows-latest)

View File

@ -1,2 +0,0 @@
**
!Dockerfile

View File

@ -1,41 +0,0 @@
FROM centos:7
# run first to improve caching (other things update more often than SDL2)
WORKDIR /tmp
RUN curl -O https://www.libsdl.org/release/SDL2-2.0.14.tar.gz
RUN tar -xf SDL2-2.0.14.tar.gz
RUN mkdir SDL2-2.0.14/build
RUN curl -O https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.4.tar.gz
RUN tar -xf SDL2_mixer-2.0.4.tar.gz
RUN mkdir SDL2_mixer-2.0.4/build
# add EPEL (for SDL2)
RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# install dependencies
RUN yum -y install \
# used below
yum-utils \
# SDL2_mixer dependencies
libogg-devel libvorbis-devel \
# VVVVVV dependencies
gcc-c++ cmake make
RUN yum-builddep -y SDL2
RUN yum clean all
WORKDIR /tmp/SDL2-2.0.14/build
RUN ../configure
RUN make -j $(nproc)
RUN make install
WORKDIR /tmp/SDL2_mixer-2.0.4/build
RUN ../configure
RUN make -j $(nproc)
RUN make install
WORKDIR /tmp
RUN rm -rf SDL2-2.0.14.tar.gz SDL2-2.0.14/ SDL2_mixer-2.0.4.tar.gz SDL2_mixer-2.0.4/
WORKDIR /

View File

@ -130,6 +130,7 @@ void Game::init(void)
roomchange = false;
savemystats = false;
quickrestartkludge = false;
tapleft = 0;
@ -3228,6 +3229,8 @@ void Game::updatestate()
map.final_mapcol = 0;
map.final_colorframe = 0;
map.finalstretch = false;
map.finalx = 100;
map.finaly = 100;
graphics.cutscenebarspos = 320;
graphics.oldcutscenebarspos = 320;
@ -5286,7 +5289,15 @@ void Game::readmaingamesave(tinyxml2::XMLDocument& doc)
map.finalstretch = help.Int(pText);
}
if (pKey == "savex")
if (pKey == "finalx")
{
map.finalx = help.Int(pText);
}
else if (pKey == "finaly")
{
map.finaly = help.Int(pText);
}
else if (pKey == "savex")
{
savex = help.Int(pText);
}
@ -5481,7 +5492,15 @@ void Game::customloadquick(std::string savfile)
}
if (pKey == "savex")
if (pKey == "finalx")
{
map.finalx = help.Int(pText);
}
else if (pKey == "finaly")
{
map.finaly = help.Int(pText);
}
else if (pKey == "savex")
{
savex = help.Int(pText);
}
@ -5866,6 +5885,10 @@ std::string Game::writemaingamesave(tinyxml2::XMLDocument& doc)
//Position
xml::update_tag(msgs, "finalx", map.finalx);
xml::update_tag(msgs, "finaly", map.finaly);
xml::update_tag(msgs, "savex", savex);
xml::update_tag(msgs, "savey", savey);
@ -5993,6 +6016,10 @@ bool Game::customsavequick(std::string savfile)
//Position
xml::update_tag(msgs, "finalx", map.finalx);
xml::update_tag(msgs, "finaly", map.finaly);
xml::update_tag(msgs, "savex", savex);
xml::update_tag(msgs, "savey", savey);
@ -6622,12 +6649,12 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
if (temp == 1)
{
createmenu(Menu::unlocktimetrial, true);
savestatsandsettings();
savemystats = true;
}
else if (temp > 1)
{
createmenu(Menu::unlocktimetrials, true);
savestatsandsettings();
savemystats = true;
}
}
else
@ -6646,7 +6673,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
unlocknotify[17] = true;
unlock[17] = true;
createmenu(Menu::unlocknodeathmode, true);
savestatsandsettings();
savemystats = true;
}
//Alright then! Flip mode?
else if (unlock[5] && !unlocknotify[18])
@ -6654,7 +6681,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
unlock[18] = true;
unlocknotify[18] = true;
createmenu(Menu::unlockflipmode, true);
savestatsandsettings();
savemystats = true;
}
//What about the intermission levels?
else if (unlock[7] && !unlocknotify[16])
@ -6662,7 +6689,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
unlock[16] = true;
unlocknotify[16] = true;
createmenu(Menu::unlockintermission, true);
savestatsandsettings();
savemystats = true;
}
else
{

View File

@ -374,6 +374,8 @@ public:
std::string hardestroom;
int hardestroomdeaths, currentroomdeaths;
bool savemystats;
bool quickrestartkludge;

View File

@ -687,7 +687,7 @@ static void menuactionpress()
{
// toggle Flip Mode
graphics.setflipmode = !graphics.setflipmode;
game.savestatsandsettings();
game.savemystats = true;
if (graphics.setflipmode)
{
music.playef(18);
@ -1307,7 +1307,7 @@ static void menuactionpress()
{
// WARNING: Partially duplicated in Menu::options
graphics.setflipmode = !graphics.setflipmode;
game.savestatsandsettings();
game.savemystats = true;
if (graphics.setflipmode)
{
music.playef(18);

View File

@ -29,6 +29,8 @@ mapclass::mapclass()
finalmode = false;
finalstretch = false;
finalx = 50;
finaly = 50;
cursorstate = 0;
cursordelay = 0;
@ -46,6 +48,7 @@ mapclass::mapclass()
custommode=false;
custommodeforreal=false;
customx=0; customy=0;
customwidth=20; customheight=20;
custommmxoff=0; custommmyoff=0; custommmxsize=0; custommmysize=0;
customzoom=0;
@ -894,13 +897,18 @@ void mapclass::gotoroom(int rx, int ry)
if (finalmode)
{
//Ok, what way are we moving?
game.roomx = rx;
game.roomy = ry;
finalx = rx;
finaly = ry;
game.roomx = finalx;
game.roomy = finaly;
game.roomchange = true;
rx = finalx;
ry = finaly;
if (game.roomy < 10)
{
game.roomy = 11;
finaly = 11;
}
if(game.roomx>=41 && game.roomy>=48 && game.roomx<61 && game.roomy<68 )
@ -1369,7 +1377,7 @@ void mapclass::loadlevel(int rx, int ry)
}
case 6: //final level
{
const short* tmap = finallevel.loadlevel(rx, ry);
const short* tmap = finallevel.loadlevel(finalx, finaly);
SDL_memcpy(contents, tmap, sizeof(contents));
roomname = finallevel.roomname;
tileset = 1;
@ -1444,6 +1452,7 @@ void mapclass::loadlevel(int rx, int ry)
obj.entities[i].yp += (71 * 8);
}
game.roomy--;
finaly--;
ypos = (100-29) * 8;
oldypos = ypos;
@ -1488,6 +1497,7 @@ void mapclass::loadlevel(int rx, int ry)
obj.entities[i].yp += (71 * 8);
}
game.roomy--;
finaly--;
ypos = (100-29) * 8;
oldypos = ypos;

View File

@ -116,12 +116,15 @@ public:
int spikeleveltop, spikelevelbottom;
int oldspikeleveltop, oldspikelevelbottom;
//final level navigation
int finalx;
int finaly;
bool finalmode;
bool finalstretch;
//Variables for playing custom levels
bool custommode;
bool custommodeforreal;
int customx, customy;
int customwidth, customheight;
int custommmxoff, custommmyoff, custommmxsize, custommmysize;
int customzoom;

View File

@ -1584,7 +1584,11 @@ void scriptclass::run()
else if (words[0] == "finalmode")
{
map.finalmode = true;
map.gotoroom(ss_toi(words[1]), ss_toi(words[2]));
map.finalx = ss_toi(words[1]);
map.finaly = ss_toi(words[2]);
game.roomx = map.finalx;
game.roomy = map.finaly;
map.gotoroom(game.roomx, game.roomy);
}
else if (words[0] == "rescued")
{
@ -2052,6 +2056,8 @@ void scriptclass::run()
else if (words[0] == "startintermission2")
{
map.finalmode = true; //Enable final level mode
map.finalx = 46;
map.finaly = 54; //Current
game.savex = 228;
game.savey = 129;
@ -2885,6 +2891,8 @@ void scriptclass::startgamemode( int t )
music.fadeout();
map.finalmode = true; //Enable final level mode
map.finalx = 46;
map.finaly = 54; //Current
map.final_colormode = false;
map.final_mapcol = 0;
map.final_colorframe = 0;
@ -3009,6 +3017,8 @@ void scriptclass::startgamemode( int t )
game.supercrewmate = true;
game.scmprogress = 0;
map.finalmode = true;
map.finalx = 41;
map.finaly = 56;
map.final_colormode = false;
map.final_mapcol = 0;
map.final_colorframe = 0;
@ -3043,6 +3053,8 @@ void scriptclass::startgamemode( int t )
game.supercrewmate = true;
game.scmprogress = 0;
map.finalmode = true;
map.finalx = 41;
map.finaly = 56;
map.final_colormode = false;
map.final_mapcol = 0;
map.final_colorframe = 0;
@ -3077,6 +3089,8 @@ void scriptclass::startgamemode( int t )
game.supercrewmate = true;
game.scmprogress = 0;
map.finalmode = true;
map.finalx = 41;
map.finaly = 56;
map.final_colormode = false;
map.final_mapcol = 0;
map.final_colorframe = 0;
@ -3111,6 +3125,8 @@ void scriptclass::startgamemode( int t )
game.supercrewmate = true;
game.scmprogress = 0;
map.finalmode = true;
map.finalx = 41;
map.finaly = 56;
map.final_colormode = false;
map.final_mapcol = 0;
map.final_colorframe = 0;
@ -3142,6 +3158,8 @@ void scriptclass::startgamemode( int t )
game.crewstats[game.lastsaved] = true;
game.inintermission = true;
map.finalmode = true;
map.finalx = 41;
map.finaly = 56;
map.final_colormode = false;
map.final_mapcol = 0;
map.final_colorframe = 0;
@ -3173,6 +3191,8 @@ void scriptclass::startgamemode( int t )
game.crewstats[game.lastsaved] = true;
game.inintermission = true;
map.finalmode = true;
map.finalx = 41;
map.finaly = 56;
map.final_colormode = false;
map.final_mapcol = 0;
map.final_colorframe = 0;
@ -3204,6 +3224,8 @@ void scriptclass::startgamemode( int t )
game.crewstats[game.lastsaved] = true;
game.inintermission = true;
map.finalmode = true;
map.finalx = 41;
map.finaly = 56;
map.final_colormode = false;
map.final_mapcol = 0;
map.final_colorframe = 0;
@ -3235,6 +3257,8 @@ void scriptclass::startgamemode( int t )
game.crewstats[game.lastsaved] = true;
game.inintermission = true;
map.finalmode = true;
map.finalx = 41;
map.finaly = 56;
map.final_colormode = false;
map.final_mapcol = 0;
map.final_colorframe = 0;
@ -3297,6 +3321,8 @@ void scriptclass::startgamemode( int t )
ed.ghosts.clear();
map.custommode = true;
map.customx = 100;
map.customy = 100;
//set flipmode
if (graphics.setflipmode) graphics.flipmode = true;
@ -3333,6 +3359,8 @@ void scriptclass::startgamemode( int t )
map.custommodeforreal = true;
map.custommode = true;
map.customx = 100;
map.customy = 100;
//set flipmode
if (graphics.setflipmode) graphics.flipmode = true;
@ -3371,6 +3399,8 @@ void scriptclass::startgamemode( int t )
hardreset();
map.custommodeforreal = true;
map.custommode = true;
map.customx = 100;
map.customy = 100;
game.customstart();
game.customloadquick(ed.ListOfMetaData[game.playcustomlevel].filename);
@ -3660,6 +3690,8 @@ void scriptclass::hardreset()
map.showtrinkets = false;
map.finalmode = false;
map.finalstretch = false;
map.finalx = 50;
map.finaly = 50;
map.final_colormode = false;
map.final_colorframe = 0;
map.final_colorframedelay = 0;

View File

@ -3463,15 +3463,14 @@ void editorrender()
if(ed.shiftmenu)
{
fillboxabs(0, 117,171+8,140,graphics.getRGB(64,64,64));
FillRect(graphics.backBuffer, 0,118,170+8,140, graphics.getRGB(0,0,0));
graphics.Print(4, 120, "F1: Change Tileset",164,164,164,false);
graphics.Print(4, 130, "F2: Change Colour",164,164,164,false);
graphics.Print(4, 140, "F3: Change Enemies",164,164,164,false);
graphics.Print(4, 150, "F4: Enemy Bounds",164,164,164,false);
graphics.Print(4, 160, "F5: Platform Bounds",164,164,164,false);
fillboxabs(0, 127,161+8,140,graphics.getRGB(64,64,64));
FillRect(graphics.backBuffer, 0,128,160+8,140, graphics.getRGB(0,0,0));
graphics.Print(4, 130, "F1: Change Tileset",164,164,164,false);
graphics.Print(4, 140, "F2: Change Colour",164,164,164,false);
graphics.Print(4, 150, "F3: Change Enemies",164,164,164,false);
graphics.Print(4, 160, "F4: Enemy Bounds",164,164,164,false);
graphics.Print(4, 170, "F5: Platform Bounds",164,164,164,false);
graphics.Print(4, 180, "F9: Reload Resources",164,164,164,false);
graphics.Print(4, 190, "F10: Direct Mode",164,164,164,false);
graphics.Print(4, 210, "W: Change Warp Dir",164,164,164,false);

View File

@ -639,6 +639,12 @@ static void inline fixedloop()
//We did editorinput, now it's safe to turn this off
key.linealreadyemptykludge = false;
if (game.savemystats)
{
game.savemystats = false;
game.savestatsandsettings();
}
//Mute button
if (key.isDown(KEYBOARD_m) && game.mutebutton<=0 && !key.textentry())
{