mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-09-22 22:48:08 +03:00
Add a hack to fix Daiakuji's magenta battle background issue
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include "ags.h"
|
||||
#include "music.h"
|
||||
#include "sdl_core.h"
|
||||
#include "hacks.h"
|
||||
|
||||
#define SLOT 40
|
||||
|
||||
@@ -182,6 +183,9 @@ static void ChangeNotColor() {
|
||||
break;
|
||||
}
|
||||
}
|
||||
// The CX command after ChangeNotColor (in FIGHT.ADV) must use a precise
|
||||
// calculation.
|
||||
daiakuji_cx_hack = true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+12
-1
@@ -27,6 +27,7 @@
|
||||
#include "xsystem35.h"
|
||||
#include "scenario.h"
|
||||
#include "ags.h"
|
||||
#include "hacks.h"
|
||||
|
||||
void commandCC() {
|
||||
int src_x = getCaliValue();
|
||||
@@ -69,7 +70,16 @@ void commandCX() {
|
||||
|
||||
switch(mode) {
|
||||
case 0:
|
||||
ags_copyArea_shadow(src_x, src_y, width, height, dst_x, dst_y);
|
||||
// In Daiakuji, the image after the blending is used as a source image
|
||||
// for sprite copy (CX 1). SDL's SIMD blending implementation has some
|
||||
// error (blending #ff00ff and #ff00ff results in #fd00fd), so the
|
||||
// resulting color may not match the colorkey of CX 1. To workaround
|
||||
// this, specify a small alpha mod so that SDL will use a "slow path"
|
||||
// that does accurate calculation.
|
||||
if (daiakuji_cx_hack)
|
||||
ags_copyArea_shadow_withrate(src_x, src_y, width, height, dst_x, dst_y, 254);
|
||||
else
|
||||
ags_copyArea_shadow(src_x, src_y, width, height, dst_x, dst_y);
|
||||
ags_updateArea(dst_x, dst_y, width, height);
|
||||
break;
|
||||
case 1:
|
||||
@@ -94,6 +104,7 @@ void commandCX() {
|
||||
DEBUG_COMMAND_YET("CX %d,%d,%d,%d,%d,%d,%d,%d:", mode, src_x, src_y, width, height, dst_x, dst_y, col);
|
||||
break;
|
||||
}
|
||||
daiakuji_cx_hack = false;
|
||||
|
||||
DEBUG_COMMAND("CX %d,%d,%d,%d,%d,%d,%d,%d:", mode, src_x, src_y, width, height, dst_x, dst_y, col);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
/* defined by cmdy.c */
|
||||
extern boolean Y3waitFlags;
|
||||
|
||||
bool daiakuji_cx_hack;
|
||||
|
||||
void enable_hack_by_gameid(const char *gameid) {
|
||||
if (!strcmp(gameid, "toushin2"))
|
||||
nact->game = GAME_TT2;
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#ifndef __HACKS_H_
|
||||
#define __HACKS_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
enum gameId {
|
||||
GAME_UNKNOWN = 0,
|
||||
GAME_TT2,
|
||||
@@ -31,4 +33,6 @@ enum gameId {
|
||||
void enable_hack_by_gameid(const char *gameid);
|
||||
void enable_hack_by_title(const char *game_title_utf8);
|
||||
|
||||
extern bool daiakuji_cx_hack;
|
||||
|
||||
#endif // __HACKS_H_
|
||||
|
||||
Reference in New Issue
Block a user