Skip to content

Commit

Permalink
Merge pull request #123 from NovaRain/bgforge-upu
Browse files Browse the repository at this point in the history
Reduce logging from two FRM speed global scripts
  • Loading branch information
burner1024 authored Aug 30, 2023
2 parents 5b3a2c4 + 5090e6d commit fb6021a
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 53 deletions.
58 changes: 29 additions & 29 deletions scripts_src/global/gl_k_goris_derobing.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,36 @@ procedure start begin
if speed < min_speed then speed = min_speed;
if speed > max_speed then speed = max_speed;

variable fs_override = check_filesystem_override;
if not fs_override then begin
ndebug("fs override disabled, aborting");
return false;
end

variable frm, file, path;
variable fps_offset = 0x4;
variable fps = speed;
variable frms = [
"madethag",
"marobeag"
];
ndebug("initialized");

foreach frm in frms begin
variable cur_frame_count;
path = "art\\critters\\" + frm + ".frm";
file = fs_copy(path, path);

fs_seek(file, frame_count_offset);
cur_frame_count = fs_read_short(file);
if cur_frame_count >= min_frame_count then begin
fs_seek(file, fps_offset);
fs_write_short(file, fps);
ndebug("set fps to " + fps + " in " + path);
end else begin
ndebug("low frame count detected in " + path + ", not boosting fps");
end
variable fs_override = check_filesystem_override;
if not fs_override then begin
ndebug("fs override disabled, aborting");
return;
end

variable frm, file, path;
variable fps_offset = 0x4;
variable fps = speed;
variable frms = [
"madethag",
"marobeag"
];

foreach frm in frms begin
variable cur_frame_count;
path = "art\\critters\\" + frm + ".frm";
file = fs_copy(path, path);

fs_seek(file, frame_count_offset);
cur_frame_count = fs_read_short(file);
if cur_frame_count >= min_frame_count then begin
fs_seek(file, fps_offset);
fs_write_short(file, fps);
//ndebug("set fps to " + fps + " in " + path);
end else begin
ndebug("low frame count detected in " + path + ", not boosting fps");
end
end
ndebug("initialized");

end
end
47 changes: 23 additions & 24 deletions scripts_src/global/gl_k_walking_speed.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -65,39 +65,38 @@ procedure get_slow_frms begin
"nmrgngh",
"nmrgngi",
"nmrgngj",
"nmrgngk"
"nmrgngk"
];
return slow_walk_frms;
end

procedure start begin
if game_loaded then begin
enabled = upu_msetting(set_walking_speed);
if enabled != 0 then begin
variable fs_override = check_filesystem_override;
if not fs_override then begin
ndebug("fs override disabled, aborting");
return false;
end
if enabled == 0 then return;

variable frm, frms, file, path, cur_frame_count;
frms = get_slow_frms;
ndebug("initializing");
foreach frm in frms begin
path = "art\\critters\\" + frm + "b.frm";
file = fs_copy(path, path);
fs_seek(file, frame_count_offset);
cur_frame_count = fs_read_short(file);
if cur_frame_count > 8 then begin
fs_seek(file, fps_offset);
fs_write_short(file, cur_frame_count); // 1 step per second
ndebug("set fps to " + cur_frame_count + " in " + path);
end else begin
ndebug("low frame count detected in " + path + ", not boosting fps");
end
end
ndebug("initialized");
variable fs_override = check_filesystem_override;
if not fs_override then begin
ndebug("fs override disabled, aborting");
return;
end

variable frm, frms, file, path, cur_frame_count;
frms = get_slow_frms;
foreach frm in frms begin
path = "art\\critters\\" + frm + "b.frm";
file = fs_copy(path, path);
fs_seek(file, frame_count_offset);
cur_frame_count = fs_read_short(file);
if cur_frame_count > 8 then begin
fs_seek(file, fps_offset);
fs_write_short(file, cur_frame_count); // 1 step per second
//ndebug("set fps to " + cur_frame_count + " in " + path);
end else begin
ndebug("low frame count detected in " + path + ", not boosting fps");
end
end
ndebug("initialized");

end
end

0 comments on commit fb6021a

Please sign in to comment.