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

Enhance Vasudan Mainhall Cheats #6340

Open
wants to merge 5 commits into
base: master
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
7 changes: 6 additions & 1 deletion code/graphics/2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1896,7 +1896,7 @@ void gr_set_shader(shader *shade)
}

// new bitmap functions
void gr_bitmap(int _x, int _y, int resize_mode)
void gr_bitmap(int _x, int _y, int resize_mode, float scale_factor)
{
GR_DEBUG_SCOPE("2D Bitmap");

Expand All @@ -1910,6 +1910,11 @@ void gr_bitmap(int _x, int _y, int resize_mode)

bm_get_info(gr_screen.current_bitmap, &_w, &_h, NULL, NULL, NULL);

if (scale_factor != 1.0f) {
_w = static_cast<int>(_w * scale_factor);
_h = static_cast<int>(_h * scale_factor);
}

x = i2fl(_x);
y = i2fl(_y);
w = i2fl(_w);
Expand Down
2 changes: 1 addition & 1 deletion code/graphics/2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ void gr_create_shader(shader *shade, ubyte r, ubyte g, ubyte b, ubyte c);
void gr_set_shader(shader *shade);

// new bitmap functions
void gr_bitmap(int x, int y, int resize_mode = GR_RESIZE_FULL);
void gr_bitmap(int x, int y, int resize_mode = GR_RESIZE_FULL, float scale_factor = 1.0f);
void gr_bitmap_uv(int _x, int _y, int _w, int _h, float _u0, float _v0, float _u1, float _v1, int resize_mode = GR_RESIZE_FULL);

// special function for drawing polylines. this function is specifically intended for
Expand Down
6 changes: 3 additions & 3 deletions code/graphics/generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ void generic_anim_render_variable_frame_delay(generic_anim* ga, float frametime,
* @param [in] y 2D screen y co-ordinate to render at
* @param [in] menu select if this is rendered in menu screen, or fullscreen
*/
void generic_anim_render(generic_anim *ga, float frametime, int x, int y, bool menu, const generic_extras *ge)
void generic_anim_render(generic_anim *ga, float frametime, int x, int y, bool menu, const generic_extras *ge, float scale_factor)
{
if ((ge != nullptr) && (ga->use_hud_color == true)) {
Warning(LOCATION, "Monochrome generic anims can't use extra info (yet)");
Expand All @@ -719,11 +719,11 @@ void generic_anim_render(generic_anim *ga, float frametime, int x, int y, bool m
ga->previous_frame = ga->current_frame;

if(ga->use_hud_color) {
gr_aabitmap(x, y, (menu ? GR_RESIZE_MENU : GR_RESIZE_FULL));
gr_aabitmap(x, y, (menu ? GR_RESIZE_MENU : GR_RESIZE_FULL), false, scale_factor);
}
else {
if (ge == nullptr) {
gr_bitmap(x, y, (menu ? GR_RESIZE_MENU : GR_RESIZE_FULL));
gr_bitmap(x, y, (menu ? GR_RESIZE_MENU : GR_RESIZE_FULL), scale_factor);
}
else if (ge->draw == true) {
// currently only for lua streaminganim objects
Expand Down
2 changes: 1 addition & 1 deletion code/graphics/generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ int generic_anim_load(generic_anim *ga);
int generic_anim_stream(generic_anim *ga, const bool cache = true);
int generic_bitmap_load(generic_bitmap *gb);
void generic_anim_unload(generic_anim *ga);
void generic_anim_render(generic_anim *ga, float frametime, int x, int y, bool menu = false, const generic_extras *ge = nullptr);
void generic_anim_render(generic_anim *ga, float frametime, int x, int y, bool menu = false, const generic_extras *ge = nullptr, float scale_factor = 1.0f);
void generic_anim_bitmap_set(generic_anim* ga, float frametime, const generic_extras* ge = nullptr);
void generic_anim_reset(generic_anim *ga);
#endif
7 changes: 3 additions & 4 deletions code/io/keycontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1614,14 +1614,13 @@ void game_process_cheats(int k)
}
if(detectedCheatCode == CHEAT_CODE_FISH){
// only enable in the Vasudan main hall
if ((gameseq_get_state() == GS_STATE_MAIN_MENU) && main_hall_is_vasudan()) {
extern void fishtank_start();
fishtank_start();
if ((gameseq_get_state() == GS_STATE_MAIN_MENU) && (main_hall_is_retail_vasudan() || main_hall_allows_fish())) {
main_hall_start_fishies();
}
}
if(detectedCheatCode == CHEAT_CODE_HEADZ){
// only enable in the Vasudan main hall
if ((gameseq_get_state() == GS_STATE_MAIN_MENU) && main_hall_is_vasudan()) {
if ((gameseq_get_state() == GS_STATE_MAIN_MENU) && (main_hall_is_retail_vasudan() || main_hall_allows_headz())) {
main_hall_vasudan_funny();
}
}
Expand Down
Loading
Loading