Skip to content

Commit

Permalink
Switch: merge v1.19 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
usineur committed Mar 31, 2019
2 parents 9c6cf0a + 17b104d commit 0ddfa85
Show file tree
Hide file tree
Showing 30 changed files with 264 additions and 85 deletions.
3 changes: 3 additions & 0 deletions SDLPoP.ini
Expand Up @@ -218,6 +218,9 @@ fix_hidden_floors_during_flashing = true
; By jumping towards one of the bottom corners of the room and grabbing a ledge, you can teleport to the room above.
fix_hang_on_teleport = true

; You can enter closed exit doors after you met the shadow or Jaffar died, or after you opened one of multiple exits.
fix_exit_door = true


[CustomGameplay]
; Turn on customization options.
Expand Down
10 changes: 8 additions & 2 deletions doc/ChangeLog.txt
Expand Up @@ -508,13 +508,19 @@ FIXED: Fixed the bug with the level 3 checkpoint.
FIXED: Fixed the bug in "Fix hang on teleport bug".
FIXED: Fixed the removed loose floor on level 3.

(no release date yet)
2019 March 31
=================
(upcoming version)
(version 1.19)

FIXED: Fix looping "sword moving" sound if the player leaves a room exactly when a guard attacks.
FIXED: Support 8-bpp images in DAT files. For example the Pyramid mod contains some of these.
FIXED: Improved map-making on levels with broken room links: If a room is mapped to an already used place, then put it to the bottom of the map.
DONE: Load custom options from DOS PRINCE.EXE files.
DONE: Added a hotkey to display SDL versions. (Ctrl-C)
FIXED: Better support for high-DPI (Retina) displays.
FIXED: Disable integer scaling menu item if SDL version is too old.
DONE: Save screenshots and maps into a separate folder and add numbers to the filenames.
FIXED: Made the exit door fix configurable.
DONE: Added support for PC speaker sounds. Use command-line parameter "stdsnd".
DONE: Added support for colored torch flames.
FIXED: Torches appearing in the leftmost column are now animated. (They are actually in the rightmost column of the left-side room.)
2 changes: 1 addition & 1 deletion doc/Map_Symbols.txt
Expand Up @@ -65,6 +65,6 @@ Items marked with [!] can't be found on the original levels.
* Broken room links: White number on red background on the corresponding edge of the room. [!]
Note that such levels usually appear incorrectly. Consider yourself lucky if they don't fall apart on the map. :)
In the worst cases you get errors on the console: "Warning: room XX was mapped to the same place as room YY!"
SDLPoP puts such rooms to the bottom of the map since version [upcoming].
SDLPoP puts such rooms to the bottom of the map since version 1.19.
Sometimes you can get a better map if you make the map manually from some room other than the starting room.
* Room numbers: White number on grey background in the top-left corner.
5 changes: 3 additions & 2 deletions doc/Readme.txt
Expand Up @@ -107,6 +107,7 @@ A:
* --screenshot-level -- Similar to the above, except the whole level is screenshotted, thus creating a level map.
* --screenshot-level-extras -- Similar to the above, except lots of additional info is displayed on the picture.
You can find the meaning of each symbol in Map_Symbols.txt.
* stdsnd -- Use PC speaker sounds.

Q: What keys can I use?
A:
Expand Down Expand Up @@ -219,7 +220,7 @@ This is useful if you want to compare the behavior of this port and the original
/!\ Note that as of 1.03, the data/font folder and its contents must exist in the current directory!
Since 1.11, the data/font folder is no longer required.

Since version [upcoming], SDLPoP can recognize most changes made with CusPoP in a DOS mod's PRINCE.EXE.
Since version 1.19, SDLPoP can recognize most changes made with CusPoP in a DOS mod's PRINCE.EXE.
Since version 1.16, you can configure some options in SDLPoP.ini: starting time, level types, etc.
In addition, since version 1.17, mods in the "mods/" folder can use a custom configuration file "mod.ini".
Options in this file can override (most of) the gameplay-related options in SDLPoP.ini.
Expand All @@ -239,7 +240,7 @@ Description and download: http://forum.princed.org/viewtopic.php?f=73&t=3664
Alternate link: https://www.popot.org/custom_levels.php?mod=0000153

Since version 1.16, there is support for fake tiles, for example walls that the prince can go through.
The Apoplexy level editor supports these additional tiles since v3.0: https://www.popot.org/level_editors.php?editor=apoplexy
The Apoplexy level editor supports these additional tiles since v3.0: https://www.apoplexy.org/
(Just don't overuse them, please!)

REPLAYS
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Expand Up @@ -97,7 +97,7 @@ else()
# NOTE: Currently, the SDL2 and SDL2_image frameworks are not being correctly included/linked in the bundle!
# As long as this isn't fixed, these bundles will only work if SDL2 and SDL2_image are installed.

set (SDLPoP_VERSION "1.18")
set (SDLPoP_VERSION "1.19")
set (MACOSX_BUNDLE_INFO_STRING ${PROJECT_NAME})
set (MACOSX_BUNDLE_ICON_FILE "icon.icns")
set_source_files_properties(${MACOSX_BUNDLE_ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
Expand Down
2 changes: 1 addition & 1 deletion src/GPLv3.h
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion src/common.h
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
6 changes: 4 additions & 2 deletions src/config.h
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -30,7 +30,7 @@ The authors of this program may be contacted at http://forum.princed.org
#define POP_MAX_PATH 256
#define POP_MAX_OPTIONS_SIZE 256

#define SDLPOP_VERSION "1.18.1"
#define SDLPOP_VERSION "1.19"
#define WINDOW_TITLE "Prince of Persia (SDLPoP) v" SDLPOP_VERSION

// Enable or disable fading.
Expand Down Expand Up @@ -223,6 +223,8 @@ The authors of this program may be contacted at http://forum.princed.org
// Display the in-game menu.
#define USE_MENU

#define USE_COLORED_TORCHES

// Default SDL_Joystick button values
#define SDL_JOYSTICK_BUTTON_Y 2
#define SDL_JOYSTICK_BUTTON_X 3
Expand Down
2 changes: 1 addition & 1 deletion src/data.c
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion src/data.h
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion src/lighting.c
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion src/main.c
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
7 changes: 6 additions & 1 deletion src/menu.c
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -192,6 +192,7 @@ enum setting_ids {
SETTING_FIX_MOVE_AFTER_SHEATHE,
SETTING_FIX_HIDDEN_FLOORS_DURING_FLASHING,
SETTING_FIX_HANG_ON_TELEPORT,
SETTING_FIX_EXIT_DOOR,
SETTING_USE_CUSTOM_OPTIONS,
SETTING_START_MINUTES_LEFT,
SETTING_START_TICKS_LEFT,
Expand Down Expand Up @@ -523,6 +524,10 @@ setting_type gameplay_settings[] = {
.linked = &fixes_saved.fix_hang_on_teleport, .required = &use_fixes_and_enhancements,
.text = "Fix hang on teleport bug",
.explanation = "By jumping towards one of the bottom corners of the room and grabbing a ledge, you can teleport to the room above."},
{.id = SETTING_FIX_EXIT_DOOR, .style = SETTING_STYLE_TOGGLE,
.linked = &fixes_saved.fix_exit_door, .required = &use_fixes_and_enhancements,
.text = "Fix exit doors",
.explanation = "You can enter closed exit doors after you met the shadow or Jaffar died, or after you opened one of multiple exits."},
};

NAMES_LIST(tile_type_setting_names, {
Expand Down
2 changes: 1 addition & 1 deletion src/midi.c
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
3 changes: 2 additions & 1 deletion src/options.c
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -260,6 +260,7 @@ static int global_ini_callback(const char *section, const char *name, const char
process_boolean("fix_move_after_sheathe", &fixes_saved.fix_move_after_sheathe);
process_boolean("fix_hidden_floors_during_flashing", &fixes_saved.fix_hidden_floors_during_flashing);
process_boolean("fix_hang_on_teleport", &fixes_saved.fix_hang_on_teleport);
process_boolean("fix_exit_door", &fixes_saved.fix_exit_door);
}

if (check_ini_section("CustomGameplay")) {
Expand Down
8 changes: 4 additions & 4 deletions src/proto.h
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -457,9 +457,9 @@ void __pascal far draw_tile_base();
void __pascal far draw_tile_anim();
void __pascal far draw_tile_fore();
int __pascal far get_loose_frame(byte modifier);
int __pascal far add_backtable(short chtab_id, int id, sbyte xh, sbyte xl, int ybottom, byte blit, byte peel);
int __pascal far add_foretable(short chtab_id, int id, sbyte xh, sbyte xl, int ybottom, byte blit, byte peel);
int __pascal far add_midtable(short chtab_id, int id, sbyte xh, sbyte xl, int ybottom, byte blit, byte peel);
int __pascal far add_backtable(short chtab_id, int id, sbyte xh, sbyte xl, int ybottom, int blit, byte peel);
int __pascal far add_foretable(short chtab_id, int id, sbyte xh, sbyte xl, int ybottom, int blit, byte peel);
int __pascal far add_midtable(short chtab_id, int id, sbyte xh, sbyte xl, int ybottom, int blit, byte peel);
void __pascal far add_peel(int left,int right,int top,int height);
void __pascal far add_wipetable(sbyte layer,short left,short bottom,sbyte height,short width,sbyte color);
void __pascal far draw_table(int which_table);
Expand Down
3 changes: 2 additions & 1 deletion src/replay.c
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -358,6 +358,7 @@ void options_process_fixes(SDL_RWops* rw, rw_process_func_type process_func) {
process(fixes_options_replay.fix_move_after_sheathe);
process(fixes_options_replay.fix_hidden_floors_during_flashing);
process(fixes_options_replay.fix_hang_on_teleport);
process(fixes_options_replay.fix_exit_door);
}

void options_process_custom_general(SDL_RWops* rw, rw_process_func_type process_func) {
Expand Down
2 changes: 1 addition & 1 deletion src/screenshot.c
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
22 changes: 19 additions & 3 deletions src/seg000.c
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -939,6 +939,16 @@ void __pascal far anim_tile_modif() {
break;
}
}

// Animate torches in the rightmost column of the left-side room as well, because they are visible in the current room.
for (int row = 0; row <= 2; row++) {
switch (get_tile(room_L, 9, row)) {
case tiles_19_torch:
case tiles_30_torch_with_debris:
start_anim_torch(room_L, row * 10 + 9);
break;
}
}
}

// seg000:0B72
Expand Down Expand Up @@ -1926,8 +1936,14 @@ void __pascal far clear_screen_and_sounds() {
// seg000:1F7B
void __pascal far parse_cmdline_sound() {
// stub
sound_flags |= sfDigi;
sound_flags |= sfMidi;
if (check_param("stdsnd")) {
// Use PC Speaker sounds and music.
} else {
// Use digi (wave) sounds and MIDI music.
sound_flags |= sfDigi;
sound_flags |= sfMidi;
sound_mode = smSblast;
}
}

// seg000:226D
Expand Down
2 changes: 1 addition & 1 deletion src/seg001.c
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion src/seg002.c
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion src/seg003.c
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion src/seg004.c
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
8 changes: 6 additions & 2 deletions src/seg005.c
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -389,7 +389,11 @@ void __pascal far up_pressed() {
else if (get_tile_infrontof_char() == tiles_16_level_door_left) leveldoor_tilepos = curr_tilepos;
if ((leveldoor_tilepos != -1) &&
level.start_room != drawn_room &&
curr_room_modif[leveldoor_tilepos] >= 42 // this door must be fully open
(
fixes->fix_exit_door
? curr_room_modif[leveldoor_tilepos] >= 42 // this door must be fully open
: leveldoor_open
)
){
go_up_leveldoor();
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/seg006.c
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
8 changes: 6 additions & 2 deletions src/seg007.c
@@ -1,6 +1,6 @@
/*
SDLPoP, a port/conversion of the DOS game Prince of Persia.
Copyright (C) 2013-2018 Dávid Nagy
Copyright (C) 2013-2019 Dávid Nagy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -246,9 +246,13 @@ short __pascal far get_trob_right_above_pos_in_drawn_room() {

// seg007:03CF
void __pascal far animate_torch() {
if (is_trob_in_drawn_room()) {
//if (is_trob_in_drawn_room()) {
// Keep animating torches in the rightmost column of the left-side room as well, because they are visible in the current room.
if (trob.room == drawn_room || (trob.room == room_L && (trob.tilepos % 10) == 9) ) {
curr_modifier = get_torch_frame(curr_modifier);
set_redraw_anim_right();
} else {
trob.type = -1;
}
}

Expand Down

0 comments on commit 0ddfa85

Please sign in to comment.