Skip to content

Commit b730f9f

Browse files
committed
Fix HSP3Dish system
viewcalc命令による座標変換時は、mes,celput等の表示座標チェックを除外するように修正
1 parent 56aca4c commit b730f9f

File tree

5 files changed

+56
-40
lines changed

5 files changed

+56
-40
lines changed

src/hsp3dish/emscripten/hgiox.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2010,7 +2010,9 @@ int hgio_mes(BMSCR* bm, char* msg)
20102010
if (drawflag == 0) hgio_render_start();
20112011

20122012
// print per line
2013-
if (bm->cy >= bm->sy) return -1;
2013+
if (bm->vp_flag == BMSCR_VPFLAG_NOUSE) {
2014+
if (bm->cy >= bm->sy) return -1;
2015+
}
20142016

20152017
if (*msg == 0) {
20162018
ysize = tmes._fontsize;

src/hsp3dish/hspwnd_dish.cpp

Lines changed: 45 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -888,15 +888,18 @@ int Bmscr::Copy( Bmscr *src, int xx, int yy, int s_psx, int s_psy )
888888
psy = s_psy;
889889
texpx = xx + s_psx;
890890
texpy = yy + s_psy;
891-
if ( texpx < 0 ) return -1;
892-
if ( texpx >= src->sx ) {
893-
if ( xx >= src->sx ) return -1;
894-
psx = src->sx - xx;
895-
}
896-
if ( texpy < 0 ) return -1;
897-
if ( texpy >= src->sy ) {
898-
if ( yy >= src->sy ) return -1;
899-
psy = src->sy - yy;
891+
892+
if (vp_flag == BMSCR_VPFLAG_NOUSE) {
893+
if (texpx < 0) return -1;
894+
if (texpx >= src->sx) {
895+
if (xx >= src->sx) return -1;
896+
psx = src->sx - xx;
897+
}
898+
if (texpy < 0) return -1;
899+
if (texpy >= src->sy) {
900+
if (yy >= src->sy) return -1;
901+
psy = src->sy - yy;
902+
}
900903
}
901904
hgio_copy( (BMSCR *)this, xx, yy, psx, psy, (BMSCR *)src, (float)psx, (float)psy );
902905
return 0;
@@ -913,15 +916,17 @@ int Bmscr::Zoom( int dx, int dy, Bmscr *src, int xx, int yy, int s_psx, int s_ps
913916
psy = s_psy;
914917
texpx = xx + s_psx;
915918
texpy = yy + s_psy;
916-
if ( texpx < 0 ) return -1;
917-
if ( texpx >= src->sx ) {
918-
if ( xx >= src->sx ) return -1;
919-
psx = src->sx - xx;
920-
}
921-
if ( texpy < 0 ) return -1;
922-
if ( texpy >= src->sy ) {
923-
if ( yy >= src->sy ) return -1;
924-
psy = src->sy - yy;
919+
if (vp_flag == BMSCR_VPFLAG_NOUSE) {
920+
if (texpx < 0) return -1;
921+
if (texpx >= src->sx) {
922+
if (xx >= src->sx) return -1;
923+
psx = src->sx - xx;
924+
}
925+
if (texpy < 0) return -1;
926+
if (texpy >= src->sy) {
927+
if (yy >= src->sy) return -1;
928+
psy = src->sy - yy;
929+
}
925930
}
926931
hgio_copy( (BMSCR *)this, xx, yy, psx, psy, (BMSCR *)src, (float)dx, (float)dy );
927932
return 0;
@@ -1057,15 +1062,17 @@ int Bmscr::CelPut( Bmscr *src, int id, float destx, float desty, float ang )
10571062
yy = ( id / src->divx ) * psy;
10581063
texpx = xx + psx;
10591064
texpy = yy + psy;
1060-
if ( texpx < 0 ) return -1;
1061-
if ( texpx >= src->sx ) {
1062-
if ( xx >= src->sx ) return -1;
1063-
psx = src->sx - xx;
1064-
}
1065-
if ( texpy < 0 ) return -1;
1066-
if ( texpy >= src->sy ) {
1067-
if ( yy >= src->sy ) return -1;
1068-
psy = src->sy - yy;
1065+
if (vp_flag == BMSCR_VPFLAG_NOUSE) {
1066+
if (texpx < 0) return -1;
1067+
if (texpx >= src->sx) {
1068+
if (xx >= src->sx) return -1;
1069+
psx = src->sx - xx;
1070+
}
1071+
if (texpy < 0) return -1;
1072+
if (texpy >= src->sy) {
1073+
if (yy >= src->sy) return -1;
1074+
psy = src->sy - yy;
1075+
}
10691076
}
10701077

10711078
dsx = (float)psx * destx;
@@ -1094,15 +1101,17 @@ int Bmscr::CelPut( Bmscr *src, int id )
10941101
texpx = xx + psx;
10951102
texpy = yy + psy;
10961103

1097-
if ( texpx < 0 ) return -1;
1098-
if ( texpx >= src->sx ) {
1099-
if ( xx >= src->sx ) return -1;
1100-
psx = src->sx - xx;
1101-
}
1102-
if ( texpy < 0 ) return -1;
1103-
if ( texpy >= src->sy ) {
1104-
if ( yy >= src->sy ) return -1;
1105-
psy = src->sy - yy;
1104+
if (vp_flag == BMSCR_VPFLAG_NOUSE) {
1105+
if (texpx < 0) return -1;
1106+
if (texpx >= src->sx) {
1107+
if (xx >= src->sx) return -1;
1108+
psx = src->sx - xx;
1109+
}
1110+
if (texpy < 0) return -1;
1111+
if (texpy >= src->sy) {
1112+
if (yy >= src->sy) return -1;
1113+
psy = src->sy - yy;
1114+
}
11061115
}
11071116
bak_cx = cx + psx;
11081117
bak_cy = cy;

src/hsp3dish/win32/hgiox.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1753,6 +1753,7 @@ void hgio_square_tex( BMSCR *bm, int *posx, int *posy, BMSCR *bmsrc, int *uvx, i
17531753
texid = bmsrc->texid;
17541754
ChangeTex( texid );
17551755
tex = GetTex( texid );
1756+
if (tex==NULL) throw HSPERR_ILLEGAL_FUNCTION;
17561757
sx = tex->ratex;
17571758
sy = tex->ratey;
17581759

@@ -2146,7 +2147,9 @@ int hgio_mes(BMSCR* bm, char* msg)
21462147
if (drawflag == 0) hgio_render_start();
21472148

21482149
// print per line
2149-
if (bm->cy >= bm->sy) return -1;
2150+
if (bm->vp_flag == BMSCR_VPFLAG_NOUSE) {
2151+
if (bm->cy >= bm->sy) return -1;
2152+
}
21502153

21512154
if (*msg == 0) {
21522155
ysize = tmes._fontsize;

src/hsp3dish/win32/hgtex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ void ChangeTex( int id )
716716

717717
TEXINF *GetTex( int id )
718718
{
719-
if (id >= (int)texinf.size()) return NULL;
719+
if ((id<0)||(id >= (int)texinf.size())) return NULL;
720720
return &texinf[id];
721721
}
722722

src/hsp3dish/win32gp/hgiox.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,9 @@ int hgio_mes(BMSCR* bm, char* msg)
11171117
texmesManager *tmes = game->getTexmesManager();
11181118

11191119
// print per line
1120-
if (bm->cy >= bm->sy) return -1;
1120+
if (bm->vp_flag == BMSCR_VPFLAG_NOUSE) {
1121+
if (bm->cy >= bm->sy) return -1;
1122+
}
11211123

11221124
if (*msg == 0) {
11231125
ysize = tmes->_fontsize;

0 commit comments

Comments
 (0)