Skip to content

Commit

Permalink
Adding separate camera pan speeds from Maniac Patch
Browse files Browse the repository at this point in the history
Maniac Patch has a was for scrolling screen with pixel precision.

It uses two doubles, stored inside SavePartyLocation at 0x8D and 0x8E respectively.
  • Loading branch information
ToolMan2k committed Jul 6, 2024
1 parent 54dff22 commit 9dc943b
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 2 deletions.
2 changes: 2 additions & 0 deletions generator/csv/fields_easyrpg.csv
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ SaveEasyRpgText,font_size,f,Int32,0x05,12,0,0,Font size
SaveEasyRpgText,letter_spacing,f,Int32,0x06,0,0,0,Additional spacing between letters
SaveEasyRpgText,line_spacing,f,Int32,0x07,4,0,0,Additional spacing between lines
SaveEasyRpgText,flags,f,SaveEasyRpgText_Flags,0x08,3,0,0,Various text settings
SavePartyLocation,maniac_horizontal_pan_speed,f,Double,0x8D,0,0,0,horizontal speed in the scrolls of the screen.
SavePartyLocation,maniac_vertical_pan_speed,f,Double,0x8E,0,0,0,vertical speed in the scrolls of the screen.
SaveSystem,maniac_strings,f,Vector<DBString>,0x24,,0,0,rpg::Strings
SaveSystem,maniac_frameskip,,Int32,0x88,0,0,0,"FatalMix Frameskip (0=None, 1=1/5, 2=1/3, 3=1/2)"
SaveSystem,maniac_picture_limit,,Int32,0x89,0,0,0,FatalMix Picture Limit
Expand Down
6 changes: 5 additions & 1 deletion src/generated/lcf/lsd/chunks.h
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,11 @@ namespace LSD_Reader {
/** Mirrors save_count of current map. On mismatch events are not continued after load. */
map_save_count = 0x83,
/** ? */
database_save_count = 0x84
database_save_count = 0x84,
/** horizontal speed in the scrolls of the screen. */
maniac_horizontal_pan_speed = 0x8D,
/** vertical speed in the scrolls of the screen. */
maniac_vertical_pan_speed = 0x8E
};
};
struct ChunkSaveVehicleLocation {
Expand Down
6 changes: 5 additions & 1 deletion src/generated/lcf/rpg/savepartylocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ namespace rpg {
bool encounter_calling = false;
int32_t map_save_count = 0;
int32_t database_save_count = 0;
double maniac_horizontal_pan_speed = 0.0;
double maniac_vertical_pan_speed = 0.0;
};
inline std::ostream& operator<<(std::ostream& os, SavePartyLocation::VehicleType code) {
os << static_cast<std::underlying_type_t<decltype(code)>>(code);
Expand All @@ -97,7 +99,9 @@ namespace rpg {
&& l.total_encounter_rate == r.total_encounter_rate
&& l.encounter_calling == r.encounter_calling
&& l.map_save_count == r.map_save_count
&& l.database_save_count == r.database_save_count;
&& l.database_save_count == r.database_save_count
&& l.maniac_horizontal_pan_speed == r.maniac_horizontal_pan_speed
&& l.maniac_vertical_pan_speed == r.maniac_vertical_pan_speed;
}

inline bool operator!=(const SavePartyLocation& l, const SavePartyLocation& r) {
Expand Down
16 changes: 16 additions & 0 deletions src/generated/lsd_savepartylocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,20 @@ static TypedField<rpg::SavePartyLocation, int32_t> static_database_save_count(
0,
0
);
static TypedField<rpg::SavePartyLocation, double> static_maniac_horizontal_pan_speed(
&rpg::SavePartyLocation::maniac_horizontal_pan_speed,
LSD_Reader::ChunkSavePartyLocation::maniac_horizontal_pan_speed,
"maniac_horizontal_pan_speed",
0,
0
);
static TypedField<rpg::SavePartyLocation, double> static_maniac_vertical_pan_speed(
&rpg::SavePartyLocation::maniac_vertical_pan_speed,
LSD_Reader::ChunkSavePartyLocation::maniac_vertical_pan_speed,
"maniac_vertical_pan_speed",
0,
0
);


template <>
Expand Down Expand Up @@ -464,6 +478,8 @@ Field<rpg::SavePartyLocation> const* Struct<rpg::SavePartyLocation>::fields[] =
&static_encounter_calling,
&static_map_save_count,
&static_database_save_count,
&static_maniac_horizontal_pan_speed,
&static_maniac_vertical_pan_speed,
NULL
};

Expand Down
2 changes: 2 additions & 0 deletions src/generated/rpg_savepartylocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ std::ostream& operator<<(std::ostream& os, const SavePartyLocation& obj) {
os << ", encounter_calling="<< obj.encounter_calling;
os << ", map_save_count="<< obj.map_save_count;
os << ", database_save_count="<< obj.database_save_count;
os << ", maniac_horizontal_pan_speed="<< obj.maniac_horizontal_pan_speed;
os << ", maniac_vertical_pan_speed="<< obj.maniac_vertical_pan_speed;
os << "}";
return os;
}
Expand Down

0 comments on commit 9dc943b

Please sign in to comment.