Skip to content

Commit

Permalink
BugFix #1
Browse files Browse the repository at this point in the history
BugFix #1

1.Fixed sound bug on loading level
2.Fixed  sound bug on game pause
3.Fixed level select font and palette
4.Fixed in-game menu font and palette
5.Fixed Load-game menu font
6.Renamed ESC key with MInus on all screens
7.minor bug fixes / and code clean

Todo: 
1.Fix Diamond level crash
2.fix few very minor glitches
3.finish code clean
4.hmmm?!
  • Loading branch information
KranKRival committed Sep 1, 2019
1 parent d898511 commit de1a864
Show file tree
Hide file tree
Showing 21 changed files with 188 additions and 106 deletions.
16 changes: 16 additions & 0 deletions .vscode/c_cpp_properties.json
@@ -0,0 +1,16 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Expand Up @@ -2,6 +2,7 @@
"files.associations": {
"hash_map": "cpp",
"chrono": "cpp",
"algorithm": "cpp"
"algorithm": "cpp",
"string": "cpp"
}
}
59 changes: 59 additions & 0 deletions Makefile
Expand Up @@ -68,6 +68,65 @@ CXXFLAGS := $(CFLAGS) -frtti -fexceptions
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)

SRCS = main.c \
conf_gfx.c \
conf_snd.c \
conf_mus.c \
conf_hlp.c \
init.c \
config.c \
events.c \
tools.c \
screens.c \
game.c \
editor.c \
files.c \
tape.c \
anim.c \
network.c \
netserv.c

OBJS = main.o \
conf_gfx.o \
conf_snd.o \
conf_mus.o \
conf_hlp.o \
init.o \
config.o \
events.o \
tools.o \
screens.o \
game.o \
editor.o \
files.o \
tape.o \
anim.o \
network.o \
netserv.o

CNFS = conf_gfx.h \
conf_snd.h \
conf_mus.h \
conf_chr.c \
conf_chr.h \
conf_cus.c \
conf_cus.h \
conf_grp.c \
conf_grp.h \
conf_e2g.c \
conf_esg.c \
conf_e2s.c \
conf_fnt.c \
conf_g2s.c \
conf_g2m.c \
conf_var.c \
conf_act.c

CNFS_CMD = ../build-scripts/create_element_defs.pl

TIMESTAMP_FILE = conftime.h
TIMESTAMP_FORMAT = %Y-%m-%d %H:%M

LIBS := -lstdc++fs -lfreetype -lSDL2_ttf -lSDL2_gfx -lSDL2_image -lSDL2 -lEGL -lGLESv2 -lglapi -ldrm_nouveau -lpng -ljpeg `sdl2-config --libs` `freetype-config --libs` -lwebp -lnx -logg -lmpg123 -lmodplug -lopusfile `aarch64-none-elf-pkg-config --libs SDL2_mixer`
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
Expand Down
4 changes: 2 additions & 2 deletions src/jj1bonuslevel/jj1bonuslevel.cpp
Expand Up @@ -721,7 +721,7 @@ void JJ1BonusLevel::draw () {
font->showNumber(bonusPlayer->getGems() % 10, 68, 0);
font->showString("/", 65, 0);
font->showNumber(items, 124, 0);
font->setPalette(canvas->format->palette->colors);
font->setPalette(palette);


// Show time remaining
Expand Down Expand Up @@ -815,7 +815,7 @@ int JJ1BonusLevel::play () {
if (pmessage && !pmenu)
{
font->showString("pause", (canvasW >> 1) - 44, 32);
font->setPalette(canvas->format->palette->colors);
font->setPalette(palette);
}


Expand Down
2 changes: 1 addition & 1 deletion src/jj1level/jj1demolevel.cpp
Expand Up @@ -198,7 +198,7 @@ int JJ1DemoLevel::play () {


font->showString("demo", (canvasW >> 1) - 36, 32);
font->setPalette(canvas->format->palette->colors);
font->setPalette(palette);


}
Expand Down
14 changes: 11 additions & 3 deletions src/jj1level/jj1level.cpp
Expand Up @@ -833,12 +833,20 @@ int JJ1Level::play () {
if (pmessage && !pmenu)
{
font->showString("pause", (canvasW >> 1) - 44, 32);
font->setPalette(canvas->format->palette->colors);
font->setPalette(palette);
setMusicVolume(0);
setSoundVolume(0);
}
else
{
setSoundVolume(64);
setMusicVolume(128);
}


// If paused, silence music
pauseMusic(pmessage && !pmenu);
//pauseMusic(pmessage && !pmenu);


if (stage == LS_END) {

Expand Down Expand Up @@ -908,7 +916,7 @@ int JJ1Level::play () {
font->showString("score", (canvasW >> 1) - 152, (canvasH >> 1) + 40);
font->showNumber(localPlayer->getScore(), (canvasW >> 1) + 124, (canvasH >> 1) + 40);

font->setPalette(canvas->format->palette->colors);
font->setPalette(palette);

}

Expand Down
4 changes: 2 additions & 2 deletions src/jj1level/jj1levelframe.cpp
Expand Up @@ -423,7 +423,7 @@ void JJ1Level::draw () {
// Show panel data

// Show score
panelSmallFont->setPalette(canvas->format->palette->colors);
panelSmallFont->setPalette(palette);
panelSmallFont->showNumber(localPlayer->getScore(), 84, canvasH - 27);

// Show time remaining
Expand Down Expand Up @@ -458,7 +458,7 @@ void JJ1Level::draw () {

panelSmallFont->showString(":", 225, canvasH - 13);
panelSmallFont->showString(";", 233, canvasH - 13);
panelSmallFont->setPalette(canvas->format->palette->colors);
panelSmallFont->setPalette(palette);

} else {

Expand Down
2 changes: 1 addition & 1 deletion src/jj1level/jj1levelload.cpp
Expand Up @@ -527,7 +527,7 @@ int JJ1Level::load (char* fileName, bool checkpoint) {
x = fontmn2->showString("LOADING ", x - 60, (canvasH >> 1) - 16);
x = fontmn2->showString(string, x, (canvasH >> 1) - 16);
fontmn2->showString(ext, x, (canvasH >> 1) - 16);
fontmn2->setPalette(canvas->format->palette->colors);
fontmn2->setPalette(palette);

delete[] string;

Expand Down
2 changes: 1 addition & 1 deletion src/jj1level/jj1levelplayer/jj1levelplayerframe.cpp
Expand Up @@ -1054,7 +1054,7 @@ void JJ1LevelPlayer::draw (unsigned int ticks, int change) {
panelBigFont->showString(player->name,
FTOI(drawX + PXO_MID) - (panelBigFont->getStringWidth(player->name) >> 1),
FTOI(drawY - F32 - F16));
panelBigFont->setPalette(canvas->format->palette->colors);
panelBigFont->setPalette(palette);

return;

Expand Down
6 changes: 3 additions & 3 deletions src/jj1planet/jj1planet.cpp
Expand Up @@ -131,10 +131,10 @@ int JJ1Planet::play () {

tickOffset = globalTicks;

stopMusic();
//stopMusic();

video.setPalette(palette);
video.setPalette(canvas->format->palette->colors);
//video.setPalette(palette);


while (true) {
Expand All @@ -157,7 +157,7 @@ int JJ1Planet::play () {

fontmn1->showString("now approaching", (canvasW - 288) >> 1, 0);
fontmn1->showString(name, (canvasW - fontmn1->getStringWidth(name)) >> 1, canvasH - 24);
fontmn1->setPalette(canvas->format->palette->colors);
fontmn1->setPalette(palette);

}

Expand Down
8 changes: 4 additions & 4 deletions src/jj2level/jj2level.cpp
Expand Up @@ -103,8 +103,8 @@ JJ2Level::~JJ2Level () {
delete font;

// Restore panel font palette
panelBigFont->setPalette(canvas->format->palette->colors);
panelSmallFont->setPalette(canvas->format->palette->colors);
panelBigFont->setPalette(palette);
panelSmallFont->setPalette(palette);

return;

Expand Down Expand Up @@ -497,7 +497,7 @@ int JJ2Level::play () {
if (pmessage && !pmenu)
{
font->showString("pause", (canvasW >> 1) - 44, 32);
font->setPalette(canvas->format->palette->colors);
font->setPalette(palette);
}


Expand Down Expand Up @@ -526,7 +526,7 @@ int JJ2Level::play () {
font->showString("blue gems", (canvasW >> 1) - 152, (canvasH >> 1) - 20);
font->showNumber(jj2LevelPlayer->getGems(2), (canvasW >> 1) + 124, (canvasH >> 1) - 20);

font->setPalette(canvas->format->palette->colors);
font->setPalette(palette);

}

Expand Down
2 changes: 1 addition & 1 deletion src/jj2level/jj2levelframe.cpp
Expand Up @@ -183,7 +183,7 @@ void JJ2Level::draw () {

panelSmallFont->showString(":", canvasW - 24, canvasH - 16);
panelSmallFont->showString(";", canvasW - 16, canvasH - 16);
panelSmallFont->setPalette(canvas->format->palette->colors);
panelSmallFont->setPalette(palette);

} else panelSmallFont->showNumber(localPlayer->getAmmo(), canvasW - 8, canvasH - 16);

Expand Down
2 changes: 1 addition & 1 deletion src/jj2level/jj2levelload.cpp
Expand Up @@ -608,7 +608,7 @@ int JJ2Level::load (char *fileName, bool checkpoint) {
x = (canvasW >> 1) - ((strlen(string) + 6) << 2);
x = fontmn2->showString("LOADING ", x - 60, (canvasH >> 1) - 16);
fontmn2->showString(string, x, (canvasH >> 1) - 16);
fontmn2->setPalette(canvas->format->palette->colors);
fontmn2->setPalette(palette);

delete[] string;

Expand Down
2 changes: 1 addition & 1 deletion src/jj2level/jj2levelplayer/jj2levelplayerframe.cpp
Expand Up @@ -970,7 +970,7 @@ void JJ2LevelPlayer::draw (unsigned int ticks, int change) {
panelBigFont->showString(player->name,
FTOI(drawX + JJ2PXO_MID) - (panelBigFont->getStringWidth(player->name) >> 1),
FTOI(drawY - F32 - F16));
panelBigFont->setPalette(canvas->format->palette->colors);
panelBigFont->setPalette(palette);

//panelBigFont->showNumber(mod->properties, FTOI(drawX) + 24, FTOI(drawY) + 12);

Expand Down

0 comments on commit de1a864

Please sign in to comment.