Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes and changes #102

Open
wants to merge 4 commits into
base: release/2.0
Choose a base branch
from
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
4,427 changes: 2,214 additions & 2,213 deletions src/SonicTimeTwisted.resource_order

Large diffs are not rendered by default.

5,363 changes: 2,682 additions & 2,681 deletions src/SonicTimeTwisted.yyp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/objects/objInputHelp/Draw_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if(duration mod 2)
draw_set_font(objResources.fontHud);
if (in3d)
{
d3d_set_projection_ortho(0, 0, __view_get( e__VW.WPort, 0 ), __view_get( e__VW.HPort, 0 ), 0);
d3d_set_projection_ortho(0, 0, view_get_wport(0), view_get_hport(0), 0);
draw_text_colour(
objScreen.width div 2,
objScreen.height div 2,
Expand Down
2 changes: 1 addition & 1 deletion src/objects/objSSCamera/Draw_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ d3d_set_projection_ortho(0, 0, objScreen.width, objScreen.height, 0);
/*gpu_set_ztestenable(false);
draw_rectangle_color(0, 0, 320, 120, c_black, c_black, c_navy, c_navy, false);
gpu_set_ztestenable(true);*/
d3d_set_projection_ext(x, y, z, xto, yto, zto, 0, 0, 1, fov, __view_get( e__VW.WPort, 0 ) / __view_get( e__VW.HPort, 0 ), 1, 24000);
d3d_set_projection_ext(x, y, z, xto, yto, zto, 0, 0, 1, fov, view_get_wport(0) / view_get_hport(0), 1, 24000);
draw_set_color(c_white);
d3d_draw_cylinder(x - 2000, y + 2000, 1600, x + 2000, y - 2000, -1000, sprite_get_texture(background, 0), bgxrepeat, 1, false, 16);

Expand Down
2 changes: 1 addition & 1 deletion src/objects/objSSController/Draw_0.gml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

if state >= 3 {
draw_set_alpha(flashAlpha);
draw_rectangle(camera_get_view_x(view_camera[0]),camera_get_view_y(view_camera[0]),camera_get_view_x(view_camera[0])+__view_get( e__VW.WPort, 0 ),camera_get_view_y(view_camera[0])+__view_get( e__VW.HPort, 0 ),false);
draw_rectangle(camera_get_view_x(view_camera[0]),camera_get_view_y(view_camera[0]),camera_get_view_x(view_camera[0])+view_get_wport(0),camera_get_view_y(view_camera[0])+view_get_hport(0),false);

}

4 changes: 2 additions & 2 deletions src/objects/objSSController/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ switch state{
timeline_speed = 1/max(5-abs(xspeed), 1);
image_angle = 0;

__view_set( e__VW.XView, 0, x - __view_get( e__VW.WPort, 0 )*.5 );
__view_set( e__VW.YView, 0, y - __view_get( e__VW.HPort, 0 )*.5 );
__view_set( e__VW.XView, 0, x - view_get_wport(0)*.5 );
__view_set( e__VW.YView, 0, y - view_get_hport(0)*.5 );

}

Expand Down
2 changes: 1 addition & 1 deletion src/objects/objSSHud/Draw_0.gml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// @description Draw Hud
//if objScreen.paused exit;
d3d_set_projection_ortho(0, 0, __view_get( e__VW.WPort, 0 ), __view_get( e__VW.HPort, 0 ), 0);
d3d_set_projection_ortho(0, 0, view_get_wport(0), view_get_hport(0), 0);
// score / time / rings string
draw_set_font(objResources.fontHud);
if !objProgram.paused {
Expand Down
6 changes: 4 additions & 2 deletions src/objects/objScoreCard/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if(instance_exists(objLevel))
{
// time bonus
var total_time = objLevel.timer div 60;
if total_time >= 540 time_bonus = 100000; else // this would make it consistent between this game and S3K/Mania
if total_time > 480 time_bonus = 50000; else
if total_time > 465 time_bonus = 10000; else
if total_time > 450 time_bonus = 5000; else
Expand All @@ -34,7 +35,7 @@ if(instance_exists(objLevel))
if total_time > 330 time_bonus = 2000; else
if total_time > 270 time_bonus = 1000; else
if total_time > 210 time_bonus = 500; else
if total_time == 1 time_bonus = 100000; else
//if total_time == 1 time_bonus = 100000; else // No idea why?
time_bonus = 0;

// perfect bonus
Expand All @@ -48,7 +49,8 @@ if(instance_exists(objLevel))
line1 = string_replace(tr("_scorecard_line1"), "%c", name_tag);
line2 = string_replace(tr("_scorecard_line2"), "%a", string(act));
// ring bonus
rings_bonus = objGameData.rings[0]*10;
rings_bonus = objGameData.rings[0]*100; // this was originally the player's ring total times 10...
// so it has been changed to be more accurate to the classic games.
// screen positions
draw_set_font(objResources.fontTitleSmallest);
title_ox1 = (objScreen.width * 0.5) - (string_width(string_hash_to_newline(line1)) * 0.5);
Expand Down
6 changes: 3 additions & 3 deletions src/objects/objScoreCard/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ case 3: // apply scores
// time bonus
if time_bonus
{
change = min(time_bonus, max_change);
change = (objScreen.score_tally_mode < 2) ? min(time_bonus, max_change) : max_change;
time_bonus -= change;
total_bonus += change;
player_add_score(change);
}
// rings bonus
if rings_bonus
{
change = min(rings_bonus, max_change);
change = (objScreen.score_tally_mode < 2) ? min(rings_bonus, max_change) : max_change;
rings_bonus -= change;
total_bonus += change;
player_add_score(change);
}
// perfect bonus
if perfect_bonus
{
change = min(perfect_bonus, max_change);
change = (objScreen.score_tally_mode < 2) ? min(perfect_bonus, max_change) : max_change;
perfect_bonus -= change;
total_bonus += change;
player_add_score(change);
Expand Down
15 changes: 6 additions & 9 deletions src/objects/objScreen/Draw_0.gml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
/// @description Screenshot and scanlines
/// @description Screenshot
//if(aspect_mode == aspect_mode)
//{
if !instance_exists(objSSHud)
//if !instance_exists(objSSHud)
if screenshot > -1
{
gpu_set_blendenable(false);
if sprite_exists(screenshot) {
draw_sprite_stretched_ext(screenshot, 0, camera_get_view_x(view_camera[view_current]), camera_get_view_y(view_camera[view_current]), width, height, c_white, 1);
}
//if sprite_exists(screenshot) {
draw_sprite_stretched_ext(screenshot, 0, camera_get_view_x(view_camera[view_current]), camera_get_view_y(view_camera[view_current]), width, height, c_white, 1);
//}
gpu_set_blendenable(true);
}
else if scanlines
{
// draw the screenshot with a scanline shader?
}
//}
8 changes: 8 additions & 0 deletions src/objects/objScreen/Draw_64.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// @description Draw Scanlines

if scanlines
{
// draw the game with a scanline filter.
// (NOTE: This was a remnant of the game's original framework, if need be, it can be added back. Like this code below.)
draw_sprite_ext(sprScanlines, 0, camera_get_view_x(view_camera[view_current]), camera_get_view_y(view_camera[view_current]), width, height, 0, c_white, 1);
}
2 changes: 2 additions & 0 deletions src/objects/objScreen/Other_14.gml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// @description Detect alt-enter or enter-alt presses.

#region macOS-specific changes.
// macOS special begin, this does nothing on any target that's not macOS!
if (objProgram.device_info & DEVICE_OS_MACOS) {
var _iswindowfs = window_get_fullscreen();
Expand Down Expand Up @@ -30,6 +31,7 @@ if (objProgram.device_info & DEVICE_OS_MACOS) {
exit;
}
// macOS special end
#endregion

// Since we can never trust GameMaker, let's handle Alt-Enter manually.
// oh and Alt-Enter can be pressed in various ways, Alt-Enter, Enter-Alt, weird!
Expand Down
1 change: 1 addition & 0 deletions src/objects/objScreen/objScreen.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions src/options/html5/options_html5.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/options/ios/options_ios.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/options/main/options_main.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/options/operagx/options_operagx.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/options/tvos/options_tvos.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/scripts/apply_video_settings/apply_video_settings.gml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ function apply_video_settings() {
window_set_fullscreen(false);
window_set_size(width * window_scale, height * window_scale);
}

//Set aspect ratios.
if(aspect_mode) event_user(10) else event_user(11);

/* reset GUI and app surface */
display_set_gui_size(width, height);
Expand Down Expand Up @@ -60,6 +63,7 @@ function apply_video_settings() {
}
}
}

/* alarm for centering the window and applying blur */
alarm[0] = center_delay;
}
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/game_pause/game_pause.gml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ function game_pause(argument0) {
{
with (objScreen)
{
if (sprite_exists(screenshot)) sprite_delete(screenshot);
screenshot = sprite_create_from_surface(application_surface, 0, 0, surface_get_width(application_surface), surface_get_height(application_surface), false, false, 0, 0);
if (sprite_exists(screenshot)) sprite_delete(screenshot);
screenshot = sprite_create_from_surface(application_surface, 0, 0, surface_get_width(application_surface), surface_get_height(application_surface), false, false, 0, 0);
}
instance_deactivate_object(objSceneObject);
audio_pause_all();
Expand Down
5 changes: 4 additions & 1 deletion src/scripts/load_options/load_options.gml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ function load_options() {
vsync = ini_read_real("video_options", "vsync", true);
timer_mode = ini_read_real("video_options", "timer_mode", 0);
show_shield = ini_read_real("video_options", "show_shield", 1);
aspect_mode = ini_read_real("video_options", "aspect_ratio", 0);
aspect_mode = ini_read_real("video_options", "aspect_ratio", false);
scanlines = ini_read_real("video_options", "scanlines", false);
var this_fmt = ini_read_real("video_options", "format_version", options_format_none);
if (this_fmt == options_format_none) {
/* need to convert videomode */
Expand Down Expand Up @@ -92,6 +93,8 @@ function load_options() {
vsync = true;
timer_mode = 0;
show_shield = 1;
aspect_mode = false;
scanlines = false;

// apply settings
apply_video_settings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ function load_options_platform_dependant() {
else
{
load_options();
with(objScreen)
{
if(aspect_mode) event_user(10) else event_user(11);
}
event_user(1);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ function menu_part_videooptions_actions(argument0) {
objScreen.aspect_mode = !objScreen.aspect_mode;
menu_fn_reopen(menu_part_videooptions_items, 8);
break;
case 10:
objScreen.scanlines = !objScreen.scanlines;
break;
case -2:
// left key
switch(items[cursor, 1])
Expand Down Expand Up @@ -86,6 +89,9 @@ function menu_part_videooptions_actions(argument0) {
objScreen.aspect_mode = !objScreen.aspect_mode;
menu_fn_reopen(menu_part_videooptions_items, 8);
break;
case 10:
objScreen.scanlines = !objScreen.scanlines;
break;
}
break;
case -3:
Expand Down Expand Up @@ -127,6 +133,9 @@ function menu_part_videooptions_actions(argument0) {
objScreen.aspect_mode = !objScreen.aspect_mode;
menu_fn_reopen(menu_part_videooptions_items, 8);
break;
case 10:
objScreen.scanlines = !objScreen.scanlines;
break;
}
break;
}
Expand Down Expand Up @@ -238,11 +247,21 @@ function menu_part_videooptions_actions(argument0) {
menu_fn_calculate_width_add(8, false, retroAspectlabel, widescreenAspectlabel);
}

if(objScreen.scanlines)
{
menu_fn_refresh_displayed_value(10, onLabel);
}
else
{
menu_fn_refresh_displayed_value(10, offLabel);
}

menu_fn_calculate_width_add(1, false, tallyLabel1, tallyLabel2, tallyLabel3);
menu_fn_calculate_width_add(2, false, onLabel, offLabel);
menu_fn_calculate_width_add(4, false, timerLabel1, timerLabel2);
menu_fn_calculate_width_add(6, false, onLabel, offLabel, onlyGUIlabel);
menu_fn_calculate_width_add(7, false, onLabel, offLabel);
menu_fn_calculate_width_add(10, false, onLabel, offLabel);

menu_fn_calculate_width_finish();
// preserve the cursor value - usually false for the sake of touchscreen controls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function menu_part_videooptions_items() {
menu_fn_add_option(tr("_menu_gfx_ScreenSize"), 0, 1, "");
}
menu_fn_add_option(tr("_menu_gfx_Blur"), 6, 1, "");
menu_fn_add_option(tr("_menu_gfx_Scanlines"), 10, 1, "");
menu_fn_add_option(tr("_menu_gfx_Tally"), 1, 1, "");
menu_fn_add_option(tr("_menu_gfx_Fr"), 2, 1, "");
if (objProgram.device_info & DEVICE_TYPE_COMPUTER)
Expand Down
3 changes: 2 additions & 1 deletion src/scripts/save_options/save_options.gml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ function save_options() {
ini_write_real("video_options", "vsync", objScreen.vsync);
ini_write_real("video_options", "timer_mode", objScreen.timer_mode);
ini_write_real("video_options", "show_shield", objScreen.show_shield);
ini_write_real("video_options", "aspect_ratio", objScreen.aspect_mode)
ini_write_real("video_options", "aspect_ratio", objScreen.aspect_mode);
ini_write_real("video_options", "scanlines", objScreen.scanlines);
ini_write_real("video_options", "format_version", objScreen.options_format);
}
if(instance_exists(objProgram.inputManager))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function special_level_go_to_score() {
objProgram.ss_perfect_bonus = 50000;
else
objProgram.ss_perfect_bonus = -1;
objProgram.ss_rings_bonus = objSSPlayer.rings*10;
objProgram.ss_rings_bonus = objSSPlayer.rings*100; // check objScoreCard to know this change

var time_bonus;
var total_time = objSSLevel.timer div 60;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading