Skip to content

Commit

Permalink
Merge pull request #473 from ToolMan2k/master
Browse files Browse the repository at this point in the history
Maniacs Feature: Add separate Width/Height parameters for scaling pictures
  • Loading branch information
Ghabry authored Mar 26, 2024
2 parents 75ed941 + a389165 commit 41f537e
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 @@ -11,6 +11,8 @@ SaveEventExecFrame,maniac_loop_info,f,Vector<Int32>,0x12,,0,0,"One group of (Cur
SavePicture,easyrpg_flip,f,Enum<EasyRpgFlip>,0xC8,0,0,1,How to flip the picture
SavePicture,easyrpg_blend_mode,f,Int32,0xC9,0,0,1,Blend mode to use for blit. See Bitmap::BlendMode
SavePicture,easyrpg_type,f,Enum<EasyRpgPictureType>,0xCA,0,0,1,Type of this picture
SavePicture,maniac_current_magnify_height,f,Double,0x0A,100.0,0,1,Current zoom level of picture (y direction).
SavePicture,maniac_finish_magnify_height,f,Int32,0x24,100,0,1,Final zoom level to animate picture to (y direction).
SaveEasyRpgWindow,texts,f,Array<SaveEasyRpgText>,0x01,,0,0,Texts to render
SaveEasyRpgWindow,width,f,Int32,0x02,0,0,0,Window width (px)
SaveEasyRpgWindow,height,f,Int32,0x03,0,0,0,Window height (px)
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 @@ -321,7 +321,11 @@ namespace LSD_Reader {
/** Blend mode to use for blit. See Bitmap::BlendMode */
easyrpg_blend_mode = 0xC9,
/** Type of this picture */
easyrpg_type = 0xCA
easyrpg_type = 0xCA,
/** Current zoom level of picture (y direction). */
maniac_current_magnify_height = 0x0A,
/** Final zoom level to animate picture to (y direction). */
maniac_finish_magnify_height = 0x24
};
};
struct ChunkSavePartyLocation {
Expand Down
6 changes: 5 additions & 1 deletion src/generated/lcf/rpg/savepicture.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ namespace rpg {
int32_t easyrpg_flip = 0;
int32_t easyrpg_blend_mode = 0;
int32_t easyrpg_type = 0;
double maniac_current_magnify_height = 100.0;
int32_t maniac_finish_magnify_height = 100;
};
inline std::ostream& operator<<(std::ostream& os, SavePicture::Effect code) {
os << static_cast<std::underlying_type_t<decltype(code)>>(code);
Expand Down Expand Up @@ -233,7 +235,9 @@ namespace rpg {
&& l.current_waver == r.current_waver
&& l.easyrpg_flip == r.easyrpg_flip
&& l.easyrpg_blend_mode == r.easyrpg_blend_mode
&& l.easyrpg_type == r.easyrpg_type;
&& l.easyrpg_type == r.easyrpg_type
&& l.maniac_current_magnify_height == r.maniac_current_magnify_height
&& l.maniac_finish_magnify_height == r.maniac_finish_magnify_height;
}

inline bool operator!=(const SavePicture& l, const SavePicture& r) {
Expand Down
16 changes: 16 additions & 0 deletions src/generated/lsd_savepicture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,20 @@ static TypedField<rpg::SavePicture, int32_t> static_easyrpg_type(
0,
1
);
static TypedField<rpg::SavePicture, double> static_maniac_current_magnify_height(
&rpg::SavePicture::maniac_current_magnify_height,
LSD_Reader::ChunkSavePicture::maniac_current_magnify_height,
"maniac_current_magnify_height",
0,
1
);
static TypedField<rpg::SavePicture, int32_t> static_maniac_finish_magnify_height(
&rpg::SavePicture::maniac_finish_magnify_height,
LSD_Reader::ChunkSavePicture::maniac_finish_magnify_height,
"maniac_finish_magnify_height",
0,
1
);


template <>
Expand Down Expand Up @@ -352,6 +366,8 @@ Field<rpg::SavePicture> const* Struct<rpg::SavePicture>::fields[] = {
&static_easyrpg_flip,
&static_easyrpg_blend_mode,
&static_easyrpg_type,
&static_maniac_current_magnify_height,
&static_maniac_finish_magnify_height,
NULL
};

Expand Down
2 changes: 2 additions & 0 deletions src/generated/rpg_savepicture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ std::ostream& operator<<(std::ostream& os, const SavePicture& obj) {
os << ", easyrpg_flip="<< obj.easyrpg_flip;
os << ", easyrpg_blend_mode="<< obj.easyrpg_blend_mode;
os << ", easyrpg_type="<< obj.easyrpg_type;
os << ", maniac_current_magnify_height="<< obj.maniac_current_magnify_height;
os << ", maniac_finish_magnify_height="<< obj.maniac_finish_magnify_height;
os << "}";
return os;
}
Expand Down

0 comments on commit 41f537e

Please sign in to comment.