mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-09-22 22:48:08 +03:00
Convert EUC to utf-8
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
# 20世紀アリス これDPS? Install infomation
|
||||
# 20世紀アリス これDPS? Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*SA.ald, 20cDPS_sa.ald
|
||||
GraphicsA, gamedata/*GA.ald, 20cDPS_ga.ald
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# 20世紀アリス かえるにょ国にょアリス Install infomation
|
||||
# 20世紀アリス かえるにょ国にょアリス Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*SA.ald, 20cKaeru_sa.ald
|
||||
GraphicsA, gamedata/*GA.ald, 20cKaeru_ga.ald
|
||||
|
||||
+83
-83
@@ -1,115 +1,115 @@
|
||||
$B%2!<%`%G!<%?%$%s%9%H!<%kMQ%9%/%j%W%H(B instgame $B$N;H$$J}$K$D$$$F(B
|
||||
ゲームデータインストール用スクリプト instgame の使い方について
|
||||
|
||||
$B%9%/%j%W%H:n@.(B $BF`NILZ(B $B$5$s(B
|
||||
$B%I%-%e%a%s%H:n@.(B $B6a4V(B@NAIST
|
||||
0. $BL\<!(B
|
||||
スクリプト作成 奈良木 さん
|
||||
ドキュメント作成 近間@NAIST
|
||||
0. 目次
|
||||
|
||||
1. $B%U%!%$%k$N@bL@(B
|
||||
2. $B;H$$J}(B
|
||||
3. $B$=$NB>$N>pJs(B
|
||||
4. $BCx:n8"$J$I(B
|
||||
5. $BO"Mm@h(B
|
||||
1. ファイルの説明
|
||||
2. 使い方
|
||||
3. その他の情報
|
||||
4. 著作権など
|
||||
5. 連絡先
|
||||
|
||||
|
||||
1. $B%U%!%$%k$N@bL@(B
|
||||
1. ファイルの説明
|
||||
|
||||
instgame $B%9%/%j%W%HK\BN(B
|
||||
456atlach.inf ATLACH-NACHA $BMQ@_Dj%U%!%$%k(B ($B%"%j%9$N4[(B456$B<}O?(B)
|
||||
456ningen.inf $B?M4V<m$j(B $BMQ@_Dj%U%!%$%k(B ($B%"%j%9$N4[(B456$B<}O?(B
|
||||
456zero.inf $BNm<0(B $BMQ@_Dj%U%!%$%k(B ($B%"%j%9$N4[(B456$B<}O?(B)
|
||||
ambi.inf AmbivalenZ for WIN95 $BMQ@_Dj%U%!%$%k(B
|
||||
atlach_new.inf ATLACH-NACHA ($BNw2AHG(B) $BMQ@_Dj%U%!%$%k(B
|
||||
darcrows.inf DARCROWS $BMQ@_Dj%U%!%$%k(B
|
||||
diabo.inf DiaboLiQue $BMQ@_Dj%U%!%$%k(B
|
||||
diabo_new.inf DiaboLiQue ($BNw2AHG(B) $BMQ@_Dj%U%!%$%k(B
|
||||
hushaby.inf HushaBy Baby $BMQ@_Dj%U%!%$%k(B
|
||||
katsumi.inf $B$$$1$J$$$+$D$_@h@8(B $BMQ@_Dj%U%!%$%k(B
|
||||
kichiku.inf $B54C\2&%i%s%9(B $BMQ@_Dj%U%!%$%k(B
|
||||
mamatoto.inf $B%^%^%H%H(B $BMQ@_Dj%U%!%$%k(B
|
||||
mamori.inf $B<i$j?@MM(B $BMQ@_Dj%U%!%$%k(B
|
||||
miko.inf $B@oV`=w(B $BMQ@_Dj%U%!%$%k(B
|
||||
mugen.inf $BL588K"1F(B for WIN95 $BMQ@_Dj%U%!%$%k(B
|
||||
oudou.inf $B2&F;M&<T(B $BMQ@_Dj%U%!%$%k(B
|
||||
panyo.inf $B$+$($k$K$g$Q$K$g!A$s(B $BMQ@_Dj%U%!%$%k(B
|
||||
panyo_new.inf $B$+$($k$K$g$Q$K$g!A$s(B($BNw2AHG(B) $BMQ@_Dj%U%!%$%k(B
|
||||
pascha.inf $B$Q$9$F$k%A%c%$%`(B $BMQ@_Dj%U%!%$%k(B
|
||||
persiom.inf PERSIOM $BMQ@_Dj%U%!%$%k(B
|
||||
progood.inf $B$W$m$9$A$e!<$G$s$H(BGOOD $BMQ@_Dj%U%!%$%k(B
|
||||
rance4.inf $B%i%s%9#4(B forWIN $BMQ@_Dj%U%!%$%k(B
|
||||
seeinao.inf SeeIn$B@D(B $BMQ@_Dj%U%!%$%k(B
|
||||
toushin2.inf $BF.?@ET;T(BII forWIN $BMQ@_Dj%U%!%$%k(B
|
||||
dalk.inf DALK $BMQ@_Dj%U%!%$%k(B ($B%"%j%9$N4[(B456$B<}O?(B)
|
||||
drstop.inf Dr.Stop! $BMQ@_Dj%U%!%$%k(B ($B%"%j%9$N4[(B456$B<}O?(B)
|
||||
rance1.inf Rance1 $BMQ@_Dj%U%!%$%k(B ($B%"%j%9$N4[(B456$B<}O?(B)
|
||||
rance2.inf Rance2 $BMQ@_Dj%U%!%$%k(B ($B%"%j%9$N4[(B456$B<}O?(B)
|
||||
rance3.inf Rance3 $BMQ@_Dj%U%!%$%k(B ($B%"%j%9$N4[(B456$B<}O?(B)
|
||||
toushin.inf $BF.?@ET;T(B $BMQ@_Dj%U%!%$%k(B ($B%"%j%9$N4[(B456$B<}O?(B)
|
||||
zero_new.inf $BNm<0(B ($BNw2AHG(B) $BMQ@_Dj%U%!%$%k(B
|
||||
20cKaeru.inf 20$B@$5*%"%j%9(B $B$+$($k$K$g9q$K$g%"%j%9(B $BMQ@_Dj%U%!%$%k(B
|
||||
20cDPS.inf 20$B@$5*%"%j%9(B $B$3$l(BDPS$B!)(B $BMQ@_Dj%U%!%$%k(B
|
||||
onlyyou_r.inf Only You $B%j%/%k%9(B $BMQ@_Dj%U%!%$%k(B
|
||||
daiakuji.inf $BBg0-;J(B $BMQ@_Dj%U%!%$%k(B
|
||||
tsuma.inf $B:J$_$0$$(B $BMQ@_Dj%U%!%$%k(B
|
||||
instgame スクリプト本体
|
||||
456atlach.inf ATLACH-NACHA 用設定ファイル (アリスの館456収録)
|
||||
456ningen.inf 人間狩り 用設定ファイル (アリスの館456収録
|
||||
456zero.inf 零式 用設定ファイル (アリスの館456収録)
|
||||
ambi.inf AmbivalenZ for WIN95 用設定ファイル
|
||||
atlach_new.inf ATLACH-NACHA (廉価版) 用設定ファイル
|
||||
darcrows.inf DARCROWS 用設定ファイル
|
||||
diabo.inf DiaboLiQue 用設定ファイル
|
||||
diabo_new.inf DiaboLiQue (廉価版) 用設定ファイル
|
||||
hushaby.inf HushaBy Baby 用設定ファイル
|
||||
katsumi.inf いけないかつみ先生 用設定ファイル
|
||||
kichiku.inf 鬼畜王ランス 用設定ファイル
|
||||
mamatoto.inf ママトト 用設定ファイル
|
||||
mamori.inf 守り神様 用設定ファイル
|
||||
miko.inf 戦巫女 用設定ファイル
|
||||
mugen.inf 無幻泡影 for WIN95 用設定ファイル
|
||||
oudou.inf 王道勇者 用設定ファイル
|
||||
panyo.inf かえるにょぱにょ〜ん 用設定ファイル
|
||||
panyo_new.inf かえるにょぱにょ〜ん(廉価版) 用設定ファイル
|
||||
pascha.inf ぱすてるチャイム 用設定ファイル
|
||||
persiom.inf PERSIOM 用設定ファイル
|
||||
progood.inf ぷろすちゅーでんとGOOD 用設定ファイル
|
||||
rance4.inf ランス4 forWIN 用設定ファイル
|
||||
seeinao.inf SeeIn青 用設定ファイル
|
||||
toushin2.inf 闘神都市II forWIN 用設定ファイル
|
||||
dalk.inf DALK 用設定ファイル (アリスの館456収録)
|
||||
drstop.inf Dr.Stop! 用設定ファイル (アリスの館456収録)
|
||||
rance1.inf Rance1 用設定ファイル (アリスの館456収録)
|
||||
rance2.inf Rance2 用設定ファイル (アリスの館456収録)
|
||||
rance3.inf Rance3 用設定ファイル (アリスの館456収録)
|
||||
toushin.inf 闘神都市 用設定ファイル (アリスの館456収録)
|
||||
zero_new.inf 零式 (廉価版) 用設定ファイル
|
||||
20cKaeru.inf 20世紀アリス かえるにょ国にょアリス 用設定ファイル
|
||||
20cDPS.inf 20世紀アリス これDPS? 用設定ファイル
|
||||
onlyyou_r.inf Only You リクルス 用設定ファイル
|
||||
daiakuji.inf 大悪司 用設定ファイル
|
||||
tsuma.inf 妻みぐい 用設定ファイル
|
||||
|
||||
2. $B;H$$J}(B
|
||||
2. 使い方
|
||||
|
||||
$B%2!<%`$N(BCD-ROM$B$r%I%i%$%V$KF~$l$F%^%&%s%H$7!"(B
|
||||
ゲームのCD-ROMをドライブに入れてマウントし、
|
||||
% ./instgame kichiku.inf
|
||||
$B$N$h$&$K<B9T$7$^$9!#(B
|
||||
のように実行します。
|
||||
|
||||
$B%G%U%)%k%H$G$O(BCDROM$B$O(B/cdrom$B$K%^%&%s%H$5$l$F$$$k$b$N$H$7$F$$$^$9!#(B
|
||||
$B$^$?!"%G!<%?$N%$%s%9%H!<%k@h$O(B ~/game/kichiku/ $B$N2<$K$J$j$^$9!#(B
|
||||
デフォルトではCDROMは/cdromにマウントされているものとしています。
|
||||
また、データのインストール先は ~/game/kichiku/ の下になります。
|
||||
|
||||
$B%G%U%)%k%H$G$O@_DjMQ%U%!%$%k$N%U%!%$%kL>$,(B~/game/$B$N2<$N%G%#%l%/%H%jL>$K(B
|
||||
$B$J$j$^$9!#(B
|
||||
デフォルトでは設定用ファイルのファイル名が~/game/の下のディレクトリ名に
|
||||
なります。
|
||||
|
||||
$B$3$l$i$N%G%U%)%k%H$N>r7o$rJQ$($k$K$O0J2<$N%*%W%7%g%s$r;H$$$^$9!#(B
|
||||
これらのデフォルトの条件を変えるには以下のオプションを使います。
|
||||
|
||||
-c : CD-ROM$B$N%^%&%s%H$5$l$F$$$k0LCV$r;XDj$7$^$9(B(default: -c /cdrom)
|
||||
-d : $B%2!<%`%G!<%?$N%$%s%9%H!<%k@h$r;XDj$7$^$9(B (default: -d ~/game/target>)
|
||||
-c : CD-ROMのマウントされている位置を指定します(default: -c /cdrom)
|
||||
-d : ゲームデータのインストール先を指定します (default: -d ~/game/target>)
|
||||
|
||||
$B%G!<%?$,@5>o$K%3%T!<$5$l$k$H!"(B~/game/$B$N2<$K(Bkichiku.gr$B$H8@$&%U%!%$%k$,:n@.(B
|
||||
$B$5$l$^$9!#$3$l$O%2!<%`%G!<%?$N>l=j$r%W%m%0%i%`(B(xsystem35)$B$KCN$i$;$k$?$a$N$b(B
|
||||
$B$N$G!"(B
|
||||
データが正常にコピーされると、~/game/の下にkichiku.grと言うファイルが作成
|
||||
されます。これはゲームデータの場所をプログラム(xsystem35)に知らせるためのも
|
||||
ので、
|
||||
% xsystem35 -gamefile ~/game/kichiku.gr
|
||||
$B$N$h$&$K;XDj$9$k$N$K;H$$$^$9!#(B($B!V%2!<%`%j%=!<%9%U%!%$%k!W$H$G$b8F$s$G2<$5$$(B)
|
||||
のように指定するのに使います。(「ゲームリソースファイル」とでも呼んで下さい)
|
||||
|
||||
$B%G%U%)%k%H$G$O!"(B*.gr$B$H$$$&%U%!%$%k$b@_DjMQ%U%!%$%k$N%U%!%$%kL>$HF1$8L>A0$K(B
|
||||
$B$J$j$^$9$,!"0J2<$N%*%W%7%g%s$GJQ992DG=$G$9!#(B
|
||||
デフォルトでは、*.grというファイルも設定用ファイルのファイル名と同じ名前に
|
||||
なりますが、以下のオプションで変更可能です。
|
||||
|
||||
-g : $B%2!<%`%j%=!<%9%U%!%$%k$N%U%!%$%kL>$r;XDj$7$^$9(B
|
||||
-g : ゲームリソースファイルのファイル名を指定します
|
||||
(default: -g ~/game/<target>.inf)
|
||||
|
||||
|
||||
3. $B$=$NB>$N>pJs(B
|
||||
3. その他の情報
|
||||
|
||||
$B$=$NB>$N%*%W%7%g%s$K!";XDj$N%U%!%$%k$O(BCD-ROM$B$+$i%3%T!<$;$:$K%j%s%/$rD%$k!"(B
|
||||
$B$H$$$&;XDj$,=PMh$^$9!#(B
|
||||
その他のオプションに、指定のファイルはCD-ROMからコピーせずにリンクを張る、
|
||||
という指定が出来ます。
|
||||
|
||||
% ./instgame -k Graphics kichiku.inf
|
||||
|
||||
$B$H$9$k$H!"(Bkichiku_ga.ald $B$H(B kichiku_gb.ald $B$N%U%!%$%k$O%3%T!<$5$l$:$K!"(B
|
||||
CD-ROM$B>e$N%G!<%?$X$N%7%s%\%j%C%/%j%s%/$K$J$j$^$9!#$?$@$7!"$=$&$9$k$H%2!<%`Cf(B
|
||||
$B$O(BCD-ROM$B$r%^%&%s%H$7$F$*$+$J$1$l$P$J$i$J$$$N$G!"(BCD-ROM$B$r%^%&%s%H$7$?$^$^(B
|
||||
CD-DA$B$N1iAU2DG=$J0lIt$N%7%9%F%`$G$N$_2DG=$G$9!#(B
|
||||
とすると、kichiku_ga.ald と kichiku_gb.ald のファイルはコピーされずに、
|
||||
CD-ROM上のデータへのシンボリックリンクになります。ただし、そうするとゲーム中
|
||||
はCD-ROMをマウントしておかなければならないので、CD-ROMをマウントしたまま
|
||||
CD-DAの演奏可能な一部のシステムでのみ可能です。
|
||||
|
||||
|
||||
$B$3$N%*%W%7%g%s$O%2!<%`%G!<%?$N%$%s%9%H!<%k;~$NF0:n$r5,Dj$9$k$b$N$J$N$G!"(B
|
||||
$B<+J,$G(BCD-ROM$B$+$i%U%!%$%k$r%3%T!<$7$F!"%2!<%`%j%=!<%9%U%!%$%k$r%(%G%#%?$G(B
|
||||
$BJT=8$9$l$P!"A4$/<+M3$K%G!<%?$NG[CV$r9T$J$&;v$,=PMh$^$9!#$b$A$m$s!"%2!<%`(B
|
||||
$B%j%=!<%9%U%!%$%k$N%U%!%$%kL>$dCV$->l=j$b<+M3$K$7$F=PMh$^$9!#(B
|
||||
$B%2!<%`%j%=!<%9%U%!%$%k$N=q<0$K$D$$$F$O(B doc/GRFMT.TXT $B$r8fMw2<$5$$!#(B
|
||||
このオプションはゲームデータのインストール時の動作を規定するものなので、
|
||||
自分でCD-ROMからファイルをコピーして、ゲームリソースファイルをエディタで
|
||||
編集すれば、全く自由にデータの配置を行なう事が出来ます。もちろん、ゲーム
|
||||
リソースファイルのファイル名や置き場所も自由にして出来ます。
|
||||
ゲームリソースファイルの書式については doc/GRFMT.TXT を御覧下さい。
|
||||
|
||||
|
||||
4. $BCx:n8"$J$I(B
|
||||
4. 著作権など
|
||||
|
||||
instgame$B$O(B $BF`NILZ(B $B$5$s$,$D$/$i$l$?$b$N$G$9$N$G!"Cx:n8"$OF`NILZ$5$s$K(B
|
||||
$BB0$7$^$9!#F`NILZ$5$s$N0U8~$K$h$j!"(BGPL$B$K4p$E$$$F:FG[I[2DG=$G$9!#(B
|
||||
instgameは 奈良木 さんがつくられたものですので、著作権は奈良木さんに
|
||||
属します。奈良木さんの意向により、GPLに基づいて再配布可能です。
|
||||
|
||||
$B%I%-%e%a%s%H$NITHw$O;d(B($B6a4V(B)$B$^$G$I$&$>!#(B
|
||||
ドキュメントの不備は私(近間)までどうぞ。
|
||||
|
||||
|
||||
5. $BO"Mm@h(B
|
||||
5. 連絡先
|
||||
|
||||
$BF`NILZ$5$s(B <naraki@debian.or.jp>
|
||||
$B6a4V(B@NAIST <masaki-c@is.aist-nara.ac.jp>
|
||||
奈良木さん <naraki@debian.or.jp>
|
||||
近間@NAIST <masaki-c@is.aist-nara.ac.jp>
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# ¥·¥§¥ë¡¦¥¯¥ì¥¤¥ë Install infomation
|
||||
# シェル・クレイル Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, GAMEDATA/*SA.ALD, chairs_sa.ald
|
||||
GraphicsA, GAMEDATA/*GA.ald, chairs_ga.ald
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Âç°»Ê Install infomation
|
||||
# 大悪司 Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, GAMEDATA/*SA.ALD, daiakuji_sa.ald
|
||||
GraphicsA, GAMEDATA/*GA.ALD, daiakuji_ga.ald
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# ¥¨¥¹¥«¥ì¥¤¥ä¡¼ Install infomation
|
||||
# エスカレイヤー Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, GAMEDATA/*SA.ALD, esuka_sa.ald
|
||||
GraphicsA, GAMEDATA/*GA.ALD, esuka_ga.ald
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Only You ¥ê¥¯¥ë¥¹ Install infomation
|
||||
# Only You リクルス Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*SA.ald, onlyyou_r_sa.ald
|
||||
GraphicsA, gamedata/*GA.ald, onlyyou_r_ga.ald
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# ºÊ¤ß¤°¤¤ Install infomation
|
||||
# 妻みぐい Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*SA.ald, tsuma_sa.ald
|
||||
GraphicsA, gamedata/*GA.ald, tsuma_ga.ald
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# ºÊ¤ß¤°¤¤£² Install infomation
|
||||
# 妻みぐい2 Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, GAMEDATA/*SA.ALD, tsuma2_sa.ald
|
||||
GraphicsA, GAMEDATA/*GA.ALD, tsuma2_ga.ald
|
||||
|
||||
+172
-172
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* Gpx.c Graphics 汎用関数
|
||||
* Gpx.c Graphics 汎用関数
|
||||
*
|
||||
* OnlyYou -リ・クスル
|
||||
* system3.9化 鬼畜王ランス
|
||||
* 大悪司
|
||||
* OnlyYou -リ・クスル
|
||||
* system3.9化 鬼畜王ランス
|
||||
* 大悪司
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
|
||||
|
||||
static int pre_freesurfno; /* 直前に開放した surface no */
|
||||
static int pre_freesurfno; /* 直前に開放した surface no */
|
||||
static surface_t *suf[MAX_SURFACE];
|
||||
|
||||
static int find_null_surface() {
|
||||
@@ -127,14 +127,14 @@ static int load_cg_main(int no) {
|
||||
|
||||
void Init() {
|
||||
/*
|
||||
Gpx.Init(): Gpx モジュールの初期化
|
||||
Gpx.Init(): Gpx モジュールの初期化
|
||||
*/
|
||||
int p1 = getCaliValue(); /* ISys3x */
|
||||
|
||||
suf[0] = NULL;
|
||||
gr_init();
|
||||
|
||||
// surface0 を pre_freesurfno として返さないように。
|
||||
// surface0 を pre_freesurfno として返さないように。
|
||||
pre_freesurfno = 1;
|
||||
|
||||
DEBUG_COMMAND("Gpx.Init %d:\n", p1);
|
||||
@@ -142,14 +142,14 @@ void Init() {
|
||||
|
||||
void Create() {
|
||||
/*
|
||||
Gpx.Create(): 新規 surface の作成(PixelとAlphaマップの両方)
|
||||
Gpx.Create(): 新規 surface の作成(PixelとAlphaマップの両方)
|
||||
|
||||
var : 作成した surface の番号を返す変数
|
||||
作成に失敗した場合は 0 を返す
|
||||
width : surface の幅
|
||||
height: surface の高さ
|
||||
bpp : surface の深さ(オリジナルでは24bppのみサポート,
|
||||
xsystem35 では display の depth と同じ)
|
||||
var : 作成した surface の番号を返す変数
|
||||
作成に失敗した場合は 0 を返す
|
||||
width : surface の幅
|
||||
height: surface の高さ
|
||||
bpp : surface の深さ(オリジナルでは24bppのみサポート,
|
||||
xsystem35 では display の depth と同じ)
|
||||
*/
|
||||
int *var = getCaliVariable();
|
||||
int width = getCaliValue();
|
||||
@@ -173,12 +173,12 @@ void Create() {
|
||||
|
||||
void CreatePixelOnly() {
|
||||
/*
|
||||
Gpx.CreatePixelOnly(): 新規 surface の作成(Pixelのみ)
|
||||
Gpx.CreatePixelOnly(): 新規 surface の作成(Pixelのみ)
|
||||
|
||||
var : 作成した surface の番号を返す変数
|
||||
width : surface の幅
|
||||
height: surface の高さ
|
||||
bpp : surface の深さ(24bpp only)
|
||||
var : 作成した surface の番号を返す変数
|
||||
width : surface の幅
|
||||
height: surface の高さ
|
||||
bpp : surface の深さ(24bpp only)
|
||||
*/
|
||||
int *var = getCaliVariable();
|
||||
int width = getCaliValue();
|
||||
@@ -201,11 +201,11 @@ void CreatePixelOnly() {
|
||||
|
||||
void CreateAMapOnly() {
|
||||
/*
|
||||
Gpx.CreateAMapOnly(): 新規 surface の作成(AlphaMapのみ)
|
||||
Gpx.CreateAMapOnly(): 新規 surface の作成(AlphaMapのみ)
|
||||
|
||||
var : 作成した surface の番号を返す変数
|
||||
width : surface の幅
|
||||
height: surface の高さ
|
||||
var : 作成した surface の番号を返す変数
|
||||
width : surface の幅
|
||||
height: surface の高さ
|
||||
*/
|
||||
int *var = getCaliVariable();
|
||||
int width = getCaliValue();
|
||||
@@ -227,11 +227,11 @@ void CreateAMapOnly() {
|
||||
|
||||
void IsSurface() {
|
||||
/*
|
||||
Gpx.IsSurface(): 指定の番号の surface が surface かどうか
|
||||
(pixel と alpha の両方のデータを持つ)を調べる
|
||||
Gpx.IsSurface(): 指定の番号の surface が surface かどうか
|
||||
(pixel と alpha の両方のデータを持つ)を調べる
|
||||
|
||||
p1 : surface 番号
|
||||
var : 結果を返す変数。surface ならば 1, !surface ならば 0
|
||||
p1 : surface 番号
|
||||
var : 結果を返す変数。surface ならば 1, !surface ならば 0
|
||||
*/
|
||||
int p1 = getCaliValue();
|
||||
int *var = getCaliVariable();
|
||||
@@ -250,10 +250,10 @@ void IsSurface() {
|
||||
|
||||
void IsPixel() {
|
||||
/*
|
||||
Gpx.IsPixel(): 指定の番号の surface が pixelデータかどうかを調べる
|
||||
Gpx.IsPixel(): 指定の番号の surface が pixelデータかどうかを調べる
|
||||
|
||||
p1 : surface 番号
|
||||
var : 結果を返す変数。pixel ならば 1, !pixel ならば 0
|
||||
p1 : surface 番号
|
||||
var : 結果を返す変数。pixel ならば 1, !pixel ならば 0
|
||||
*/
|
||||
int p1 = getCaliValue();
|
||||
int *var = getCaliVariable();
|
||||
@@ -272,10 +272,10 @@ void IsPixel() {
|
||||
|
||||
void IsAlpha() {
|
||||
/*
|
||||
Gpx.IsAlpha(): 指定の番号の surface が alpha mapかどうかを調べる
|
||||
Gpx.IsAlpha(): 指定の番号の surface が alpha mapかどうかを調べる
|
||||
|
||||
p1 : surface 番号
|
||||
var : 結果を返す変数。alpha ならば 1, !alpha ならば 0
|
||||
p1 : surface 番号
|
||||
var : 結果を返す変数。alpha ならば 1, !alpha ならば 0
|
||||
*/
|
||||
int p1 = getCaliValue();
|
||||
int *var = getCaliVariable();
|
||||
@@ -294,10 +294,10 @@ void IsAlpha() {
|
||||
|
||||
void GetWidth() {
|
||||
/*
|
||||
Gpx.GetWidth(): 指定の番号の surface の幅を取得する
|
||||
Gpx.GetWidth(): 指定の番号の surface の幅を取得する
|
||||
|
||||
p1 : surface 番号
|
||||
var : 結果を返す変数。
|
||||
p1 : surface 番号
|
||||
var : 結果を返す変数。
|
||||
*/
|
||||
int p1 = getCaliValue();
|
||||
int *var = getCaliVariable();
|
||||
@@ -316,10 +316,10 @@ void GetWidth() {
|
||||
|
||||
void GetHeight() {
|
||||
/*
|
||||
Gpx.GetWidth(): 指定の番号の surface の高さを取得する
|
||||
Gpx.GetWidth(): 指定の番号の surface の高さを取得する
|
||||
|
||||
p1 : surface 番号
|
||||
var : 結果を返す変数。
|
||||
p1 : surface 番号
|
||||
var : 結果を返す変数。
|
||||
*/
|
||||
int p1 = getCaliValue();
|
||||
int *var = getCaliVariable();
|
||||
@@ -344,10 +344,10 @@ void GetCreatedSurface() { /* not used ? */
|
||||
|
||||
void LoadCG() {
|
||||
/*
|
||||
Gpx.LoadCG(): 新規 surface を作成してその上に CG を load
|
||||
Gpx.LoadCG(): 新規 surface を作成してその上に CG を load
|
||||
|
||||
var : 作成した surface の番号を返す変数
|
||||
p1 : 読み込む CG の番号
|
||||
var : 作成した surface の番号を返す変数
|
||||
p1 : 読み込む CG の番号
|
||||
*/
|
||||
int *var = getCaliVariable();
|
||||
int p1 = getCaliValue();
|
||||
@@ -373,9 +373,9 @@ void GetCGPosY() { /* not useed ? */
|
||||
|
||||
void Free() {
|
||||
/*
|
||||
Gpx.Free(): 指定の surface を開放する
|
||||
Gpx.Free(): 指定の surface を開放する
|
||||
|
||||
p1: 開放する surface の番号
|
||||
p1: 開放する surface の番号
|
||||
*/
|
||||
int p1 = getCaliValue();
|
||||
|
||||
@@ -388,7 +388,7 @@ void Free() {
|
||||
|
||||
void FreeAll() {
|
||||
/*
|
||||
Gpx.FreeAll(): 全ての surface を開放する
|
||||
Gpx.FreeAll(): 全ての surface を開放する
|
||||
*/
|
||||
sf_free_all();
|
||||
|
||||
@@ -397,16 +397,16 @@ void FreeAll() {
|
||||
|
||||
void Copy() {
|
||||
/*
|
||||
Gpx.Copy(): 指定 surface 領域のコピー
|
||||
Gpx.Copy(): 指定 surface 領域のコピー
|
||||
|
||||
ds: 転送先 surface 番号
|
||||
dx: 転送先 x 座標
|
||||
dy: 転送先 y 座標
|
||||
ss: 転送元 surface 番号
|
||||
sx: 転送元 x 座標
|
||||
sy: 転送元 y 座標
|
||||
sw: 転送元 幅
|
||||
sh: 転送元 高さ
|
||||
ds: 転送先 surface 番号
|
||||
dx: 転送先 x 座標
|
||||
dy: 転送先 y 座標
|
||||
ss: 転送元 surface 番号
|
||||
sx: 転送元 x 座標
|
||||
sy: 転送元 y 座標
|
||||
sw: 転送元 幅
|
||||
sh: 転送元 高さ
|
||||
*/
|
||||
int ds = getCaliValue();
|
||||
int dx = getCaliValue();
|
||||
@@ -442,16 +442,16 @@ void CopyBright() { /* not used ? */
|
||||
|
||||
void CopyAMap() {
|
||||
/*
|
||||
Gpx.CopyAMap(): 指定 surface の alpha map 領域のコピー
|
||||
Gpx.CopyAMap(): 指定 surface の alpha map 領域のコピー
|
||||
|
||||
da: 転送先 surface(alpha map) 番号
|
||||
dx: 転送先 x 座標
|
||||
dy: 転送先 y 座標
|
||||
sa: 転送元 surface(alpha map) 番号
|
||||
sx: 転送元 x 座標
|
||||
sy: 転送元 y 座標
|
||||
sw: 転送元 幅
|
||||
sh: 転送元 高さ
|
||||
da: 転送先 surface(alpha map) 番号
|
||||
dx: 転送先 x 座標
|
||||
dy: 転送先 y 座標
|
||||
sa: 転送元 surface(alpha map) 番号
|
||||
sx: 転送元 x 座標
|
||||
sy: 転送元 y 座標
|
||||
sw: 転送元 幅
|
||||
sh: 転送元 高さ
|
||||
*/
|
||||
int da = getCaliValue();
|
||||
int dx = getCaliValue();
|
||||
@@ -515,16 +515,16 @@ void BlendAddSatur() { /* not used ? */
|
||||
|
||||
void BlendAMap() {
|
||||
/*
|
||||
Gpx.BlendAMap(): 転送元の alpha map を参照して 指定領域を alpha blend
|
||||
Gpx.BlendAMap(): 転送元の alpha map を参照して 指定領域を alpha blend
|
||||
|
||||
ds: 転送先 surface 番号
|
||||
dx: 転送先 x 座標
|
||||
dy: 転送先 y 座標
|
||||
ss: 転送元 surface 番号
|
||||
sx: 転送元 x 座標
|
||||
sy: 転送元 y 座標
|
||||
sw: 転送元 幅
|
||||
sh: 転送元 高さ
|
||||
ds: 転送先 surface 番号
|
||||
dx: 転送先 x 座標
|
||||
dy: 転送先 y 座標
|
||||
ss: 転送元 surface 番号
|
||||
sx: 転送元 x 座標
|
||||
sy: 転送元 y 座標
|
||||
sw: 転送元 幅
|
||||
sh: 転送元 高さ
|
||||
*/
|
||||
int ds = getCaliValue();
|
||||
int dx = getCaliValue();
|
||||
@@ -692,16 +692,16 @@ void BlendScreenAlpha() { /* not used ? */
|
||||
|
||||
void Fill() {
|
||||
/*
|
||||
Gpx.Fill(): 指定領域の塗りつぶし
|
||||
Gpx.Fill(): 指定領域の塗りつぶし
|
||||
|
||||
ds: 塗りつぶし surface 番号
|
||||
dx: 領域 x 座標
|
||||
dy: 領域 y 座標
|
||||
dw: 領域 幅
|
||||
dh: 領域 高さ
|
||||
r : 塗りつぶし色 赤
|
||||
g : 塗りつぶし色 緑
|
||||
b : 塗りつぶし色 青
|
||||
ds: 塗りつぶし surface 番号
|
||||
dx: 領域 x 座標
|
||||
dy: 領域 y 座標
|
||||
dw: 領域 幅
|
||||
dh: 領域 高さ
|
||||
r : 塗りつぶし色 赤
|
||||
g : 塗りつぶし色 緑
|
||||
b : 塗りつぶし色 青
|
||||
*/
|
||||
int ds = getCaliValue();
|
||||
int dx = getCaliValue();
|
||||
@@ -752,16 +752,16 @@ void FillAMap() { /* not used ? */
|
||||
|
||||
void FillAMapOverBorder() {
|
||||
/*
|
||||
Gpx.FillAMapOverBorder(): 矩形領域中の 閾値以上の alpha 値を持つ
|
||||
ものを指定の alpha 値に置き換え。
|
||||
Gpx.FillAMapOverBorder(): 矩形領域中の 閾値以上の alpha 値を持つ
|
||||
ものを指定の alpha 値に置き換え。
|
||||
|
||||
ds: 塗りつぶし surface 番号
|
||||
dx: 領域 x 座標
|
||||
dy: 領域 y 座標
|
||||
dw: 領域 幅
|
||||
dh: 領域 高さ
|
||||
s : 閾値
|
||||
d : 閾値を超えた場合の設定値
|
||||
ds: 塗りつぶし surface 番号
|
||||
dx: 領域 x 座標
|
||||
dy: 領域 y 座標
|
||||
dw: 領域 幅
|
||||
dh: 領域 高さ
|
||||
s : 閾値
|
||||
d : 閾値を超えた場合の設定値
|
||||
*/
|
||||
int ds = getCaliValue();
|
||||
int dx = getCaliValue();
|
||||
@@ -831,17 +831,17 @@ void AddDA_DAxSA() { /* not used ? */
|
||||
|
||||
void SpriteCopyAMap() {
|
||||
/*
|
||||
Gpx.SpriteCopyAMap(): 指定の alpha 値以外の領域の alpha map コピー
|
||||
Gpx.SpriteCopyAMap(): 指定の alpha 値以外の領域の alpha map コピー
|
||||
|
||||
da: 転送先 surface(alpha map) 番号
|
||||
dx: 転送先 x 座標
|
||||
dy: 転送先 y 座標
|
||||
ss: 転送元 surface(alpha map) 番号
|
||||
sx: 転送元 x 座標
|
||||
sy: 転送元 y 座標
|
||||
sw: 転送元 幅
|
||||
sh: 転送元 高さ
|
||||
cl: 転送しない alpha 値
|
||||
da: 転送先 surface(alpha map) 番号
|
||||
dx: 転送先 x 座標
|
||||
dy: 転送先 y 座標
|
||||
ss: 転送元 surface(alpha map) 番号
|
||||
sx: 転送元 x 座標
|
||||
sy: 転送元 y 座標
|
||||
sw: 転送元 幅
|
||||
sh: 転送元 高さ
|
||||
cl: 転送しない alpha 値
|
||||
*/
|
||||
int da = getCaliValue();
|
||||
int dx = getCaliValue();
|
||||
@@ -865,14 +865,14 @@ void SpriteCopyAMap() {
|
||||
|
||||
void BrightDestOnly() {
|
||||
/*
|
||||
Gpx.BrightDestOnly(): 指定領域の明るさを設定
|
||||
Gpx.BrightDestOnly(): 指定領域の明るさを設定
|
||||
|
||||
ds: 明るさを設定する surface 番号
|
||||
dx: 領域 x 座標
|
||||
dy: 領域 y 座標
|
||||
dw: 領域 幅
|
||||
dh: 領域 高さ
|
||||
r : 指定明るさ (255: 明るさ 100%, pixel値そのもの)
|
||||
ds: 明るさを設定する surface 番号
|
||||
dx: 領域 x 座標
|
||||
dy: 領域 y 座標
|
||||
dw: 領域 幅
|
||||
dh: 領域 高さ
|
||||
r : 指定明るさ (255: 明るさ 100%, pixel値そのもの)
|
||||
*/
|
||||
int ds = getCaliValue();
|
||||
int dx = getCaliValue();
|
||||
@@ -927,18 +927,18 @@ void CopyTextureWrapAlpha() { /* not used ? */
|
||||
|
||||
void CopyStretch() {
|
||||
/*
|
||||
Gpx.CopyStretch(): 拡大・縮小
|
||||
Gpx.CopyStretch(): 拡大・縮小
|
||||
|
||||
ds: 転送先 surface 番号
|
||||
dx: 転送先 x 座標
|
||||
dy: 転送先 y 座標
|
||||
dw: 転送先 幅
|
||||
dh: 転送先 高さ
|
||||
ss: 転送元 surface 番号
|
||||
sx: 転送元 x 座標
|
||||
sy: 転送元 y 座標
|
||||
sw: 転送元 幅
|
||||
sh: 転送元 高さ
|
||||
ds: 転送先 surface 番号
|
||||
dx: 転送先 x 座標
|
||||
dy: 転送先 y 座標
|
||||
dw: 転送先 幅
|
||||
dh: 転送先 高さ
|
||||
ss: 転送元 surface 番号
|
||||
sx: 転送元 x 座標
|
||||
sy: 転送元 y 座標
|
||||
sw: 転送元 幅
|
||||
sh: 転送元 高さ
|
||||
*/
|
||||
int ds = getCaliValue();
|
||||
int dx = getCaliValue();
|
||||
@@ -977,18 +977,18 @@ void CopyStretchBlend() { /* not used ? */
|
||||
|
||||
void CopyStretchBlendAMap() {
|
||||
/*
|
||||
Gpx.CopyStretchBlendAMap(): 拡大・縮小しながら alpha blend
|
||||
Gpx.CopyStretchBlendAMap(): 拡大・縮小しながら alpha blend
|
||||
|
||||
ds: 転送先 surface 番号
|
||||
dx: 転送先 x 座標
|
||||
dy: 転送先 y 座標
|
||||
dw: 転送先 幅
|
||||
dh: 転送先 高さ
|
||||
ss: 転送元 surface 番号
|
||||
sx: 転送元 x 座標
|
||||
sy: 転送元 y 座標
|
||||
sw: 転送元 幅
|
||||
sh: 転送元 高さ
|
||||
ds: 転送先 surface 番号
|
||||
dx: 転送先 x 座標
|
||||
dy: 転送先 y 座標
|
||||
dw: 転送先 幅
|
||||
dh: 転送先 高さ
|
||||
ss: 転送元 surface 番号
|
||||
sx: 転送元 x 座標
|
||||
sy: 転送元 y 座標
|
||||
sw: 転送元 幅
|
||||
sh: 転送元 高さ
|
||||
*/
|
||||
int ds = getCaliValue();
|
||||
int dx = getCaliValue();
|
||||
@@ -1026,20 +1026,20 @@ void StretchBlendScreen2x2() { /* not used ? */
|
||||
|
||||
void StretchBlendScreen2x2WDS() {
|
||||
/*
|
||||
Gpx.StretchBlenfScreen2x2WDS(): 2枚の surface を縦横2倍に拡大しつつ
|
||||
alpha blend (飽和加算)する
|
||||
Gpx.StretchBlenfScreen2x2WDS(): 2枚の surface を縦横2倍に拡大しつつ
|
||||
alpha blend (飽和加算)する
|
||||
|
||||
ds: 転送先 surface 番号
|
||||
dx: 転送先 x 座標
|
||||
dy: 転送先 y 座標
|
||||
ss1: 転送元 surface 番号 (拡大元 surface) ss1の方が小さい
|
||||
sx1: 転送元 x 座標
|
||||
sy1: 転送元 y 座標
|
||||
ss2: 転送元 surface 番号 (重ね先の surface)
|
||||
sx2: 転送元 x 座標
|
||||
sy2: 転送元 y 座標
|
||||
sw: 転送元 幅 (sw*2, sh*2)の大きさに拡大
|
||||
sh: 転送元 高さ
|
||||
ds: 転送先 surface 番号
|
||||
dx: 転送先 x 座標
|
||||
dy: 転送先 y 座標
|
||||
ss1: 転送元 surface 番号 (拡大元 surface) ss1の方が小さい
|
||||
sx1: 転送元 x 座標
|
||||
sy1: 転送元 y 座標
|
||||
ss2: 転送元 surface 番号 (重ね先の surface)
|
||||
sx2: 転送元 x 座標
|
||||
sy2: 転送元 y 座標
|
||||
sw: 転送元 幅 (sw*2, sh*2)の大きさに拡大
|
||||
sh: 転送元 高さ
|
||||
*/
|
||||
int ds = getCaliValue();
|
||||
int dx = getCaliValue();
|
||||
@@ -1065,19 +1065,19 @@ void StretchBlendScreen2x2WDS() {
|
||||
|
||||
void BlendScreenWDS() {
|
||||
/*
|
||||
Gpx.BlendScreenWDS(): 飽和加算 alpha blend
|
||||
Gpx.BlendScreenWDS(): 飽和加算 alpha blend
|
||||
|
||||
ds : 転送先 surface 番号
|
||||
dx : 転送先 x 座標
|
||||
dy : 転送先 y 座標
|
||||
ss1: 転送元 surface 番号 (重ね元の surface)
|
||||
sx1: 転送元 x 座標
|
||||
sy1: 転送元 y 座標
|
||||
ss2: 転送元 surface 番号 (重ね先の surface)
|
||||
sx2: 転送元 x 座標
|
||||
sy2: 転送元 y 座標
|
||||
sw : 転送元 幅
|
||||
sh : 転送元 高さ
|
||||
ds : 転送先 surface 番号
|
||||
dx : 転送先 x 座標
|
||||
dy : 転送先 y 座標
|
||||
ss1: 転送元 surface 番号 (重ね元の surface)
|
||||
sx1: 転送元 x 座標
|
||||
sy1: 転送元 y 座標
|
||||
ss2: 転送元 surface 番号 (重ね先の surface)
|
||||
sx2: 転送元 x 座標
|
||||
sy2: 転送元 y 座標
|
||||
sw : 転送元 幅
|
||||
sh : 転送元 高さ
|
||||
*/
|
||||
int ds = getCaliValue();
|
||||
int dx = getCaliValue();
|
||||
@@ -1103,21 +1103,21 @@ void BlendScreenWDS() {
|
||||
|
||||
void EffectCopy() {
|
||||
/*
|
||||
Gpx.EffectCopy(): 効果つき領域コピー
|
||||
Gpx.EffectCopy(): 効果つき領域コピー
|
||||
|
||||
no: 効果番号
|
||||
dx: 転送先 x 座標
|
||||
dy: 転送先 y 座標
|
||||
ss1: 転送元 surface 番号 (重ね元の surface)
|
||||
sx1: 転送元 x 座標
|
||||
sy1: 転送元 y 座標
|
||||
ss2: 転送元 surface 番号 (重ね先の surface)
|
||||
sx2: 転送元 x 座標
|
||||
sy2: 転送元 y 座標
|
||||
sw: 転送元 幅
|
||||
sh: 転送元 高さ
|
||||
time: 実行時間(ms) (0の場合はそれぞのれ効果毎のデフォルト値)
|
||||
var: キー入力があったかないか?(?????)
|
||||
no: 効果番号
|
||||
dx: 転送先 x 座標
|
||||
dy: 転送先 y 座標
|
||||
ss1: 転送元 surface 番号 (重ね元の surface)
|
||||
sx1: 転送元 x 座標
|
||||
sy1: 転送元 y 座標
|
||||
ss2: 転送元 surface 番号 (重ね先の surface)
|
||||
sx2: 転送元 x 座標
|
||||
sy2: 転送元 y 座標
|
||||
sw: 転送元 幅
|
||||
sh: 転送元 高さ
|
||||
time: 実行時間(ms) (0の場合はそれぞのれ効果毎のデフォルト値)
|
||||
var: キー入力があったかないか?(?????)
|
||||
|
||||
|
||||
effect no:
|
||||
@@ -1126,10 +1126,10 @@ void EffectCopy() {
|
||||
3: CE27 (fade in)
|
||||
4: CE30 (white out)
|
||||
5: CE28 (white in)
|
||||
7: CE11 (すだれ落ち)
|
||||
11: CE53 (線形ぼかし)
|
||||
12: CE35 (上->下クロスフェード)
|
||||
13: CE36 (下->上クロスフェード)
|
||||
7: CE11 (すだれ落ち)
|
||||
11: CE53 (線形ぼかし)
|
||||
12: CE35 (上->下クロスフェード)
|
||||
13: CE36 (下->上クロスフェード)
|
||||
*/
|
||||
int no = getCaliValue();
|
||||
int dx = getCaliValue();
|
||||
|
||||
+10
-10
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Math.c 汎用数学関数? OnlyYou -リ・クスル他
|
||||
* Math.c 汎用数学関数? OnlyYou -リ・クスル他
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -35,9 +35,9 @@ static int numtblmax;
|
||||
|
||||
void RandMTInit() {
|
||||
/*
|
||||
(おそらく Mersenne Twister使用の) 乱数初期化
|
||||
(おそらく Mersenne Twister使用の) 乱数初期化
|
||||
|
||||
p1: 初期化用 seed
|
||||
p1: 初期化用 seed
|
||||
*/
|
||||
int p1 = getCaliValue(); /* ITimer */
|
||||
|
||||
@@ -46,10 +46,10 @@ void RandMTInit() {
|
||||
|
||||
void RandMTGet() {
|
||||
/*
|
||||
1 から num までの乱数を生成
|
||||
1 から num までの乱数を生成
|
||||
|
||||
num: 最大値
|
||||
var: 結果を返す変数
|
||||
num: 最大値
|
||||
var: 結果を返す変数
|
||||
*/
|
||||
int num = getCaliValue();
|
||||
int *var = getCaliVariable();
|
||||
@@ -65,9 +65,9 @@ void RandMTGet() {
|
||||
|
||||
void RandMTMakeNumTable() {
|
||||
/*
|
||||
乱数テーブルの最大値を設定
|
||||
乱数テーブルの最大値を設定
|
||||
|
||||
p1: 最大値
|
||||
p1: 最大値
|
||||
*/
|
||||
int p1 = getCaliValue();
|
||||
|
||||
@@ -78,9 +78,9 @@ void RandMTMakeNumTable() {
|
||||
|
||||
void RandMTGetNumTable() {
|
||||
/*
|
||||
乱数テーブルから値を取得
|
||||
乱数テーブルから値を取得
|
||||
|
||||
var: 乱数を格納する変数
|
||||
var: 乱数を格納する変数
|
||||
*/
|
||||
int *var = getCaliVariable();
|
||||
|
||||
|
||||
+66
-66
@@ -16,7 +16,7 @@
|
||||
|
||||
#include "sactstring.h"
|
||||
|
||||
// NIGHTDLL用データ
|
||||
// NIGHTDLL用データ
|
||||
night_t nightprv;
|
||||
|
||||
|
||||
@@ -53,190 +53,190 @@ void InitGame() { /* 1 */
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.InitGame:\n");
|
||||
}
|
||||
|
||||
// メッセージの枠の表示
|
||||
// メッセージの枠の表示
|
||||
void SetMsgFrame() { /* 2 */
|
||||
int p1 = getCaliValue(); // 0=枠消去, 1=枠あり, 2=中央
|
||||
int p1 = getCaliValue(); // 0=枠消去, 1=枠あり, 2=中央
|
||||
|
||||
ntmsg_set_frame(p1);
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SetMsgFram %d:\n", p1);
|
||||
}
|
||||
|
||||
// メッセージの表示位置の設定
|
||||
// メッセージの表示位置の設定
|
||||
void SetMsgPlaceMethod(void) { /* 3 */
|
||||
int p1 = getCaliValue(); // 0=メッセージ枠内, 1=中央,
|
||||
// 2=メッセージ枠+顔つき
|
||||
int p1 = getCaliValue(); // 0=メッセージ枠内, 1=中央,
|
||||
// 2=メッセージ枠+顔つき
|
||||
ntmsg_set_place(p1);
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SetMsgPlaceMethod %d:\n", p1);
|
||||
}
|
||||
|
||||
// 未実装?
|
||||
// 未実装?
|
||||
void SetMsgDrawEffect(void) { /* 4 */
|
||||
int p1 = getCaliValue(); // 0, 1, 2, 3 (実際にはどれも機能しない?)
|
||||
int p1 = getCaliValue(); // 0, 1, 2, 3 (実際にはどれも機能しない?)
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SetMsgDrawEffect %d:\n", p1);
|
||||
}
|
||||
|
||||
// 未実装?
|
||||
// 未実装?
|
||||
void SetMsgClearEffect(void) { /* 5 */
|
||||
int p1 = getCaliValue(); // 0, 1, 2, 4 (実際にはどれも機能しない?)
|
||||
int p1 = getCaliValue(); // 0, 1, 2, 4 (実際にはどれも機能しない?)
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SetMsgClearEffect %d:\n", p1);
|
||||
}
|
||||
|
||||
// 壁紙CGの設定
|
||||
// 壁紙CGの設定
|
||||
void SetWallPaper(void) { /* 6 */
|
||||
int p1 = getCaliValue(); // 壁紙CG番号
|
||||
int p1 = getCaliValue(); // 壁紙CG番号
|
||||
|
||||
nt_gr_set_wallpaper(p1);
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SetWallPaper %d:\n", p1);
|
||||
}
|
||||
|
||||
// 背景CGの設定
|
||||
// 背景CGの設定
|
||||
void SetScenery(void) { /* 7 */
|
||||
int p1 = getCaliValue(); // 背景GC番号
|
||||
int p1 = getCaliValue(); // 背景GC番号
|
||||
|
||||
nt_gr_set_scenery(p1);
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SetScenery %d:\n", p1);
|
||||
}
|
||||
|
||||
// 顔CGの設定
|
||||
// 顔CGの設定
|
||||
void SetFace(void) { /* 8 */
|
||||
int p1 = getCaliValue(); // 顔CG番号
|
||||
int p1 = getCaliValue(); // 顔CG番号
|
||||
|
||||
nt_gr_set_face(p1);
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SetFace %d:\n", p1);
|
||||
}
|
||||
|
||||
// 立ち絵左の設定
|
||||
// 立ち絵左の設定
|
||||
void SetSpriteL(void) { /* 9 */
|
||||
int p1 = getCaliValue(); // 左人物スプライト番号
|
||||
int p1 = getCaliValue(); // 左人物スプライト番号
|
||||
|
||||
nt_gr_set_spL(p1);
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteL %d:\n", p1);
|
||||
}
|
||||
|
||||
// 立ち絵中央の設定
|
||||
// 立ち絵中央の設定
|
||||
void SetSpriteM(void) { /* 10 */
|
||||
int p1 = getCaliValue(); // 中央人物スプライト番号
|
||||
int p1 = getCaliValue(); // 中央人物スプライト番号
|
||||
|
||||
nt_gr_set_spM(p1);
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteM %d:\n", p1);
|
||||
}
|
||||
|
||||
// 立ち絵右の設定
|
||||
// 立ち絵右の設定
|
||||
void SetSpriteR(void) { /* 11 */
|
||||
int p1 = getCaliValue(); // 右人物スプライト番号
|
||||
int p1 = getCaliValue(); // 右人物スプライト番号
|
||||
|
||||
nt_gr_set_spR(p1);
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteR %d:\n", p1);
|
||||
}
|
||||
|
||||
// 立ち絵左の設定(季節違い?)
|
||||
// 立ち絵左の設定(季節違い?)
|
||||
void SetSpriteSeasonL(void) { /* 12 */
|
||||
int p1 = getCaliValue(); // 左人物スプライト番号
|
||||
int p1 = getCaliValue(); // 左人物スプライト番号
|
||||
|
||||
nt_gr_set_spsL(p1);
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteSeasonL %d:\n", p1);
|
||||
}
|
||||
|
||||
// 立ち絵中央の設定(季節違い?)
|
||||
// 立ち絵中央の設定(季節違い?)
|
||||
void SetSpriteSeasonM(void) { /* 13 */
|
||||
int p1 = getCaliValue(); // 中央人物スプライト番号
|
||||
int p1 = getCaliValue(); // 中央人物スプライト番号
|
||||
|
||||
nt_gr_set_spM(p1);
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteSeasonM %d:\n", p1);
|
||||
}
|
||||
|
||||
// 立ち絵右の設定(季節違い?)
|
||||
// 立ち絵右の設定(季節違い?)
|
||||
void SetSpriteSeasonR(void) { /* 14 */
|
||||
int p1 = getCaliValue(); // 右人物スプライト番号
|
||||
int p1 = getCaliValue(); // 右人物スプライト番号
|
||||
|
||||
nt_gr_set_spsR(p1);
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteSeasonR %d:\n", p1);
|
||||
}
|
||||
|
||||
// 改行
|
||||
// 改行
|
||||
void StartNewLine(void) { /* 15 */
|
||||
ntmsg_newline();
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.StartNewLine:\n");
|
||||
}
|
||||
|
||||
// メッセージフォントサイズの設定
|
||||
// メッセージフォントサイズの設定
|
||||
void SetFontSize(void) { /* 16 */
|
||||
int p1 = getCaliValue(); // メッセージフォントサイズ
|
||||
int p1 = getCaliValue(); // メッセージフォントサイズ
|
||||
|
||||
night.fontsize = p1;
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SetFontSize %d:\n", p1);
|
||||
}
|
||||
|
||||
// フォントの種類の設定
|
||||
// フォントの種類の設定
|
||||
void SetFont(void) { /* 17 */
|
||||
int p1 = getCaliValue(); // 0: ゴシック, 1: 明朝
|
||||
int p1 = getCaliValue(); // 0: ゴシック, 1: 明朝
|
||||
|
||||
night.fonttype = p1;
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SetFont %d:\n", p1);
|
||||
}
|
||||
|
||||
// 選択肢モード ON
|
||||
// 選択肢モード ON
|
||||
void SetSelMode(void) { /* 18 */
|
||||
int p1 = getCaliValue(); // 0, 1(ほとんど0)
|
||||
int p1 = getCaliValue(); // 0, 1(ほとんど0)
|
||||
|
||||
night.selmode = p1;
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SetSelMode %d:\n", p1);
|
||||
}
|
||||
|
||||
// キー入力待ち後、改ページ
|
||||
// キー入力待ち後、改ページ
|
||||
void AnalyzeMessage(void) { /* 19 */
|
||||
int *var = getCaliVariable(); // 入力されたキー
|
||||
int *var = getCaliVariable(); // 入力されたキー
|
||||
|
||||
*var = ntmsg_ana();
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.AnalyzeMessage %p:\n", var);
|
||||
}
|
||||
|
||||
// ~DRAWの効果時間
|
||||
// ~DRAWの効果時間
|
||||
void SetDrawTime(void) { /* 20 */
|
||||
int p1 = getCaliValue(); // 効果時間 (未使用?)
|
||||
int p1 = getCaliValue(); // 効果時間 (未使用?)
|
||||
|
||||
nt_gr_set_drawtime(p1);
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SetDrawTime %d:\n", p1);
|
||||
}
|
||||
|
||||
// 効果つき画面更新
|
||||
// 効果つき画面更新
|
||||
void Draw(void) { /* 21 */
|
||||
int p1 = getCaliValue(); // 効果番号
|
||||
int p1 = getCaliValue(); // 効果番号
|
||||
|
||||
nt_gr_draw(p1);
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.Draw %d:\n", p1);
|
||||
}
|
||||
|
||||
// 音声データを再生
|
||||
// 音声データを再生
|
||||
void SetVoice(void) { /* 22 */
|
||||
int p1 = getCaliValue(); // ファイル番号
|
||||
int p1 = getCaliValue(); // ファイル番号
|
||||
|
||||
nt_voice_set(p1);
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SetVoice %d:\n", p1);
|
||||
}
|
||||
|
||||
// 未使用
|
||||
// 未使用
|
||||
void WaitKey(void) { /* 23 */
|
||||
int p1 = getCaliValue(); //
|
||||
|
||||
@@ -244,7 +244,7 @@ void WaitKey(void) { /* 23 */
|
||||
}
|
||||
|
||||
void AddFeeling(void) { /* 24 */
|
||||
int p1 = getCaliValue(); // person(1:新開,2:星川,3:百瀬,4:いずみ,5:鏡花,6:真言美,7:マコト
|
||||
int p1 = getCaliValue(); // person(1:新開,2:星川,3:百瀬,4:いずみ,5:鏡花,6:真言美,7:マコト
|
||||
int p2 = getCaliValue(); // val
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.AddFeeling %d:\n", p1);
|
||||
@@ -268,11 +268,11 @@ void CallEvent(void) { /* 26 */
|
||||
|
||||
void ScreenCG(void) { /* 27 */
|
||||
/*
|
||||
CG を読み込んで、surface0 と BlendScreen で重ね合わせ
|
||||
CG を読み込んで、surface0 と BlendScreen で重ね合わせ
|
||||
|
||||
x : 表示位置 X
|
||||
y : 表示位置 Y
|
||||
no: 読み込むCG番号
|
||||
x : 表示位置 X
|
||||
y : 表示位置 Y
|
||||
no: 読み込むCG番号
|
||||
*/
|
||||
int p1 = getCaliValue(); /* ISys3xDIB */
|
||||
int p2 = getCaliValue(); /* ISys3xCG */
|
||||
@@ -290,7 +290,7 @@ void RunGameMain(void) { /* 28 */
|
||||
int p2 = getCaliValue(); // month
|
||||
int p3 = getCaliValue(); // day
|
||||
int p4 = getCaliValue(); // day of week
|
||||
int p5 = getCaliValue(); // 0=はじめから,1=途中から
|
||||
int p5 = getCaliValue(); // 0=はじめから,1=途中から
|
||||
|
||||
night.Month = p2;
|
||||
night.Day = p3;
|
||||
@@ -361,12 +361,12 @@ void RunEventDungeon(void) { /* 36 */
|
||||
}
|
||||
|
||||
void RunEventBattle(void) { /* 37 */
|
||||
int p1 = getCaliValue(); // 実際には機能しない?
|
||||
int p1 = getCaliValue(); // 実際には機能しない?
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.RunEventBattle %d:\n", p1);
|
||||
}
|
||||
|
||||
// CD再生開始
|
||||
// CD再生開始
|
||||
void CDPlay(void) { /* 38 */
|
||||
int p1 = getCaliValue(); // no
|
||||
|
||||
@@ -375,7 +375,7 @@ void CDPlay(void) { /* 38 */
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.CDPlay %d:\n", p1);
|
||||
}
|
||||
|
||||
// CD再生停止
|
||||
// CD再生停止
|
||||
void CDStop(void) { /* 39 */
|
||||
int p1 = getCaliValue(); // time(msec)
|
||||
|
||||
@@ -384,7 +384,7 @@ void CDStop(void) { /* 39 */
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.CDStop %d:\n", p1);
|
||||
}
|
||||
|
||||
// CDのmute
|
||||
// CDのmute
|
||||
void CDMute(void) { /* 40 */
|
||||
int p1 = getCaliValue(); // 0: mute off, 1: mute on
|
||||
|
||||
@@ -393,7 +393,7 @@ void CDMute(void) { /* 40 */
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.CDMute %d:\n", p1);
|
||||
}
|
||||
|
||||
// ch に効果音番号をセット
|
||||
// ch に効果音番号をセット
|
||||
void SoundEffectSetWave(void) { /* 41 */
|
||||
int p1 = getCaliValue(); // ch
|
||||
int p2 = getCaliValue(); // linkno
|
||||
@@ -403,7 +403,7 @@ void SoundEffectSetWave(void) { /* 41 */
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectSetWave %d,%d:\n", p1, p2);
|
||||
}
|
||||
|
||||
// ch にくり返し数をセット
|
||||
// ch にくり返し数をセット
|
||||
void SoundEffectSetLoop(void) { /* 42 */
|
||||
int p1 = getCaliValue(); // ch
|
||||
int p2 = getCaliValue(); // numloop
|
||||
@@ -413,7 +413,7 @@ void SoundEffectSetLoop(void) { /* 42 */
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectSetLoop %d,%d:\n", p1, p2);
|
||||
}
|
||||
|
||||
// ch に音量をセット
|
||||
// ch に音量をセット
|
||||
void SoundEffectSetVolume(void) { /* 43 */
|
||||
int p1 = getCaliValue(); // ch
|
||||
int p2 = getCaliValue(); // vol
|
||||
@@ -423,17 +423,17 @@ void SoundEffectSetVolume(void) { /* 43 */
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectSetVolue %d,%d:\n", p1, p2);
|
||||
}
|
||||
|
||||
// 効果音の再生を終るまで待つか待たないか?
|
||||
// 効果音の再生を終るまで待つか待たないか?
|
||||
void SoundEffectSetSyncFlag(void) { /* 44 */
|
||||
int p1 = getCaliValue(); // ch
|
||||
int p2 = getCaliValue(); // 0: 終るまで待たない, 1: 待つ
|
||||
int p2 = getCaliValue(); // 0: 終るまで待たない, 1: 待つ
|
||||
|
||||
nt_snd_waitend(p1, p2 == 0 ? FALSE : TRUE);
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectSetSyncFlag %d,%d:\n", p1, p2);
|
||||
}
|
||||
|
||||
// ch の効果音を再生
|
||||
// ch の効果音を再生
|
||||
void SoundEffectPlay(void) { /* 45 */
|
||||
int p1 = getCaliValue(); // ch
|
||||
|
||||
@@ -442,19 +442,19 @@ void SoundEffectPlay(void) { /* 45 */
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectPlay %d:\n", p1);
|
||||
}
|
||||
|
||||
// ch の効果音を停止
|
||||
// ch の効果音を停止
|
||||
void SoundEffectStop(void) { /* 46 */
|
||||
int p1 = getCaliValue(); // ch
|
||||
int p2 = getCaliValue(); // time (止まるまでの時間)
|
||||
int p2 = getCaliValue(); // time (止まるまでの時間)
|
||||
|
||||
nt_snd_stop(p1, p2);
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectStop %d,%d:\n", p1,p2);
|
||||
}
|
||||
|
||||
// 全てのチャンネルの再生を停止
|
||||
// 全てのチャンネルの再生を停止
|
||||
void SoundEffectStopAll(void) { /* 47 */
|
||||
int p1 = getCaliValue(); // time (止まるまでの時間)
|
||||
int p1 = getCaliValue(); // time (止まるまでの時間)
|
||||
|
||||
nt_snd_stopall(p1);
|
||||
|
||||
@@ -491,8 +491,8 @@ void GetLocalCountCG(void) { /* 52 */
|
||||
}
|
||||
|
||||
void PlayMemory(void) { /* 53 */
|
||||
int *p1 = getCaliVariable(); // 回想ページ
|
||||
int *p2 = getCaliVariable(); // 回想RESULT
|
||||
int *p1 = getCaliVariable(); // 回想ページ
|
||||
int *p2 = getCaliVariable(); // 回想RESULT
|
||||
|
||||
DEBUG_COMMAND_YET("NIGHTDLL.PlayMemory %p,%p:\n", p1, p2);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
|
||||
|
||||
// キーウェイトの種類
|
||||
// キーウェイトの種類
|
||||
#define KEYWAIT_NONE 0
|
||||
#define KEYWAIT_SIMPLE 1
|
||||
#define KEYWAIT_SPRITE 2
|
||||
@@ -22,10 +22,10 @@
|
||||
#define MSGBUFMAX 512
|
||||
|
||||
#if 0
|
||||
// 文字列置換用
|
||||
// 文字列置換用
|
||||
typedef struct {
|
||||
char *src; // 置き換え元文字列
|
||||
char *dst; // 置き換え文字列
|
||||
char *src; // 置き換え元文字列
|
||||
char *dst; // 置き換え文字列
|
||||
} strexchange_t;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "sprite.h"
|
||||
|
||||
/*
|
||||
Messageキー入力待ち時の
|
||||
Messageキー入力待ち時の
|
||||
*/
|
||||
static void cb_waitkey_message(agsevent_t *e) {
|
||||
switch (e->type) {
|
||||
@@ -29,7 +29,7 @@ static void cb_waitkey_message(agsevent_t *e) {
|
||||
}
|
||||
|
||||
/*
|
||||
WaitKeySimpleのcallback
|
||||
WaitKeySimpleのcallback
|
||||
*/
|
||||
static void cb_waitkey_simple(agsevent_t *e) {
|
||||
switch (e->type) {
|
||||
@@ -41,7 +41,7 @@ static void cb_waitkey_simple(agsevent_t *e) {
|
||||
}
|
||||
|
||||
/*
|
||||
選択肢 Window Open 時の callback
|
||||
選択肢 Window Open 時の callback
|
||||
*/
|
||||
static void cb_waitkey_selection(agsevent_t *e) {
|
||||
switch (e->type) {
|
||||
@@ -56,7 +56,7 @@ static void cb_waitkey_selection(agsevent_t *e) {
|
||||
}
|
||||
|
||||
void ntev_callback(agsevent_t *e) {
|
||||
// menu open中は無視
|
||||
// menu open中は無視
|
||||
if (nact->popupmenu_opened) {
|
||||
return;
|
||||
}
|
||||
@@ -97,10 +97,10 @@ void ntev_callback(agsevent_t *e) {
|
||||
}
|
||||
|
||||
/*
|
||||
system35のメインループからで呼ばれるコールバック
|
||||
system35のメインループからで呼ばれるコールバック
|
||||
*/
|
||||
void ntev_main() {
|
||||
// デフォルトのコールバックのうち、ここで必要なものだけ処理。
|
||||
// デフォルトのコールバックのうち、ここで必要なものだけ処理。
|
||||
if (nact->popupmenu_opened) {
|
||||
menu_gtkmainiteration();
|
||||
if (nact->is_quit) sys_exit(0);
|
||||
|
||||
@@ -11,22 +11,22 @@
|
||||
#include "nt_scenario.h"
|
||||
#include "sactcg.h"
|
||||
|
||||
// 壁紙スプライト表示位置
|
||||
// 壁紙スプライト表示位置
|
||||
#define WALL_LOC_X 0
|
||||
#define WALL_LOC_Y 0
|
||||
// 風景スプライト表示位置
|
||||
// 風景スプライト表示位置
|
||||
#define SCENERY_LOC_X 0
|
||||
#define SCENERY_LOC_Y 64
|
||||
// 顔スプライト表示位置
|
||||
// 顔スプライト表示位置
|
||||
#define FACE_LOC_X 6
|
||||
#define FACE_LOC_Y 272
|
||||
// 立ち絵左スプライト表示位置
|
||||
// 立ち絵左スプライト表示位置
|
||||
#define TACHI_L_LOC_X 0
|
||||
#define TACHI_L_LOC_Y 0
|
||||
// 立ち絵中央スプライト位置
|
||||
// 立ち絵中央スプライト位置
|
||||
#define TACHI_M_LOC_X 160
|
||||
#define TACHI_M_LOC_Y 0
|
||||
// 立ち絵右スプライト位置
|
||||
// 立ち絵右スプライト位置
|
||||
#define TACHI_R_LOC_X 360
|
||||
#define TACHI_R_LOC_Y 0
|
||||
|
||||
@@ -175,7 +175,7 @@ void nt_gr_set_drawtime(int msec) {
|
||||
void nt_gr_draw(int effectno) {
|
||||
switch(effectno) {
|
||||
case 0:
|
||||
// 全消し
|
||||
// 全消し
|
||||
break;
|
||||
case 1:
|
||||
sp_update_all(TRUE);
|
||||
|
||||
+34
-34
@@ -22,31 +22,31 @@
|
||||
|
||||
extern int ntsel_dosel(void);
|
||||
|
||||
// 通常メッセージ表示位置と大きさ
|
||||
// 通常メッセージ表示位置と大きさ
|
||||
#define MSGFRAME_0_X 6
|
||||
#define MSGFRAME_0_Y 347
|
||||
#define MSGFRAME_0_WIDTH 628
|
||||
#define MSGFRAME_0_HEIGHT 125
|
||||
|
||||
// 画面全体メッセージ表示位置と大きさ
|
||||
// 画面全体メッセージ表示位置と大きさ
|
||||
#define MSGFRAME_1_X 0
|
||||
#define MSGFRAME_1_Y 0
|
||||
#define MSGFRAME_1_WIDTH 640
|
||||
#define MSGFRAME_1_HEIGHT 480
|
||||
|
||||
// 通常メッセージ(顔つき)表示位置と大きさ
|
||||
// 通常メッセージ(顔つき)表示位置と大きさ
|
||||
#define MSGFRAME_2_X (6+160)
|
||||
#define MSGFRAME_2_Y 347
|
||||
#define MSGFRAME_2_WIDTH (628-160)
|
||||
#define MSGFRAME_2_HEIGHT 125
|
||||
|
||||
// キー入力アニメーション位置
|
||||
// キー入力アニメーション位置
|
||||
#define HAKANIM_LOC_X 620
|
||||
#define HAKANIM_LOC_Y 450
|
||||
// キー入力アニメーション間隔
|
||||
// キー入力アニメーション間隔
|
||||
#define HAKANIM_INTERVAL 250
|
||||
|
||||
// デフォルトメッセージフォントサイズ
|
||||
// デフォルトメッセージフォントサイズ
|
||||
#define MSG_DEFFONTSIZE 24
|
||||
|
||||
|
||||
@@ -61,29 +61,29 @@ static int ntmsg_keywait();
|
||||
static void ntmsg_clear(int wNum);
|
||||
|
||||
|
||||
// 初期化
|
||||
// 初期化
|
||||
void ntmsg_init() {
|
||||
sprite_t *sp;
|
||||
|
||||
// メッセージスプライト
|
||||
// メッセージスプライト
|
||||
sp = night.sp[SPNO_MSGFRAME_FG] = sp_msg_new(SPNO_MSGFRAME_FG, 0, 0, sf0->width, sf0->height);
|
||||
sp_add_updatelist(sp);
|
||||
|
||||
// メッセージ背景用CG
|
||||
// メッセージ背景用CG
|
||||
sp = night.sp[SPNO_MSGFRAME_BG] = sp_new(SPNO_MSGFRAME_BG, CGNO_MSGFRAME_LCG, 0, 0, SPRITE_NORMAL);
|
||||
sp_add_updatelist(sp);
|
||||
|
||||
// 文字背景CG作成
|
||||
// 文字背景CG作成
|
||||
scg_create(CGNO_MSGFR_BG,
|
||||
sf0->width, sf0->height,
|
||||
0, 0, 0, 255);
|
||||
// night.cg[CGNO_MSGFR_BG]->refcnt++;
|
||||
|
||||
// 文字背景CGのためのsprite
|
||||
// 文字背景CGのためのsprite
|
||||
sp = night.sp[SPNO_MSGBG] = sp_new(SPNO_MSGBG, CGNO_MSGFR_BG, 0, 0, SPRITE_NORMAL);
|
||||
sp_add_updatelist(sp);
|
||||
|
||||
// キー入力アニメーションCG作成
|
||||
// キー入力アニメーションCG作成
|
||||
scg_cut(CGNO_MSGHAK_1, CGNO_MSGHAK_LCG, 0, 0, 9, 9);
|
||||
//night.cg[CGNO_MSGHAK_1]->refcnt++;
|
||||
scg_cut(CGNO_MSGHAK_2, CGNO_MSGHAK_LCG, 0, 9, 9, 9);
|
||||
@@ -100,7 +100,7 @@ void ntmsg_init() {
|
||||
|
||||
|
||||
|
||||
// 主人公名前
|
||||
// 主人公名前
|
||||
sstr_regist_replace(SNAME_RYO, SNAME_RYO_DEF);
|
||||
|
||||
night.msg.cbmove = cb_mousemove;
|
||||
@@ -113,10 +113,10 @@ void ntmsg_init() {
|
||||
|
||||
}
|
||||
|
||||
// メッセージ枠の種類
|
||||
// type=0 消去
|
||||
// type=1 枠あり
|
||||
// type=2 中央
|
||||
// メッセージ枠の種類
|
||||
// type=0 消去
|
||||
// type=1 枠あり
|
||||
// type=2 中央
|
||||
void ntmsg_set_frame(int type) {
|
||||
surface_t *sf;
|
||||
|
||||
@@ -163,7 +163,7 @@ void ntmsg_set_frame(int type) {
|
||||
}
|
||||
|
||||
/*
|
||||
メッセージ領域の設定
|
||||
メッセージ領域の設定
|
||||
type=0: 628x125+6+347
|
||||
type=1: 640x480+0+0
|
||||
type=2: (628-120)x125+(6+120)+347
|
||||
@@ -235,7 +235,7 @@ static void ntmsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB
|
||||
|
||||
msg = sstr_replacestr(night.msgbuf);
|
||||
|
||||
// 文字アラインメントの調整
|
||||
// 文字アラインメントの調整
|
||||
set_align(msg, sp, wSize);
|
||||
savex = sp->u.msg.dspcur.x;
|
||||
|
||||
@@ -293,10 +293,10 @@ static void ntmsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB
|
||||
sp->u.msg.dspcur.x += cw;
|
||||
}
|
||||
|
||||
// バッファリング中の文字のクリア
|
||||
// バッファリング中の文字のクリア
|
||||
night.msgbuf[0] = '\0';
|
||||
|
||||
// Waitなしの出力は最後にupdate
|
||||
// Waitなしの出力は最後にupdate
|
||||
if (needupdate) {
|
||||
uparea.width = sp->cursize.width;
|
||||
uparea.height = min(sp->cursize.height, uparea.y - sp->u.msg.dspcur.y + wLineSpace + wLineSpace);
|
||||
@@ -306,16 +306,16 @@ static void ntmsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB
|
||||
}
|
||||
|
||||
/*
|
||||
メッセージキー入力待ち
|
||||
メッセージキー入力待ち
|
||||
@param: none
|
||||
@return: 入力されたキー
|
||||
@return: 入力されたキー
|
||||
*/
|
||||
static int ntmsg_keywait() {
|
||||
int i = 0;
|
||||
|
||||
if (night.waitskiplv > 0) return 0;
|
||||
|
||||
// アニメパターンの初期化
|
||||
// アニメパターンの初期化
|
||||
setup_hakanim();
|
||||
|
||||
night.waittype = KEYWAIT_MESSAGE;
|
||||
@@ -348,8 +348,8 @@ static void set_align(char *msg, sprite_t *sp, int wSize) {
|
||||
break;
|
||||
|
||||
case 1:
|
||||
// もっとも長い行が中心にくるようにし、
|
||||
// 他の行はその行の先頭に先頭をあわせる
|
||||
// もっとも長い行が中心にくるようにし、
|
||||
// 他の行はその行の先頭に先頭をあわせる
|
||||
line = 0; maxchar = 0;
|
||||
|
||||
c = 0;
|
||||
@@ -380,7 +380,7 @@ static void set_align(char *msg, sprite_t *sp, int wSize) {
|
||||
static BYTE *get_char(BYTE *msg, char *mbuf, int bufmax) {
|
||||
int c1;
|
||||
|
||||
// 改行
|
||||
// 改行
|
||||
if (msg[0] == '\n') {
|
||||
mbuf[0] = '\n';
|
||||
mbuf[1] = '\0';
|
||||
@@ -430,17 +430,17 @@ static void cb_keyrelease(agsevent_t *e) {
|
||||
static void cb_mousemove(agsevent_t *e) {
|
||||
int x = e->d1, y = e->d2;
|
||||
|
||||
// 音声mute/メッセージスキップ/メッセージ枠消去の領域に
|
||||
// マウスが移動したら、その部分のアイコンを変化させる
|
||||
// 音声mute/メッセージスキップ/メッセージ枠消去の領域に
|
||||
// マウスが移動したら、その部分のアイコンを変化させる
|
||||
|
||||
|
||||
}
|
||||
|
||||
// メッセージ表示時に、キー入力を促すアニメーションの設定
|
||||
// メッセージ表示時に、キー入力を促すアニメーションの設定
|
||||
static void setup_hakanim() {
|
||||
}
|
||||
|
||||
// メッセージ表示時のキー入力を促すアニメーション
|
||||
// メッセージ表示時のキー入力を促すアニメーション
|
||||
static void hakanim(int i) {
|
||||
sprite_t *sp;
|
||||
boolean show;
|
||||
@@ -464,8 +464,8 @@ int ntmsg_update(sprite_t *sp, MyRectangle *r) {
|
||||
int sx, sy, w, h, dx, dy;
|
||||
surface_t update;
|
||||
|
||||
// canvas が clean のときはなにもしない
|
||||
// -> 説明スプライトのように、SetShowされたときに対応できないからだめ
|
||||
// canvas が clean のときはなにもしない
|
||||
// -> 説明スプライトのように、SetShowされたときに対応できないからだめ
|
||||
//if (sact.msgbufempty) return OK;
|
||||
|
||||
update.width = r->width;
|
||||
@@ -503,7 +503,7 @@ static void ntmsg_clear(int wNum) {
|
||||
|
||||
night.msgbuf[0] = '\0';
|
||||
|
||||
// キャンバスのクリア
|
||||
// キャンバスのクリア
|
||||
sf = sp->u.msg.canvas;
|
||||
memset(sf->pixel, 0, sf->bytes_per_line * sf->height);
|
||||
memset(sf->alpha, 0, sf->width * sf->height);
|
||||
|
||||
@@ -61,7 +61,7 @@ static void ntmain(struct _scoadr inadr) {
|
||||
check_command(sl_getc());
|
||||
if (sl_getPage() == inadr.page &&
|
||||
sl_getIndex() == inadr.index) {
|
||||
// ~E%05dからの戻り
|
||||
// ~E%05dからの戻り
|
||||
if (nact->fnc_return_value == 0) {
|
||||
break;
|
||||
} else {
|
||||
@@ -88,8 +88,8 @@ static void ntmain(struct _scoadr inadr) {
|
||||
}
|
||||
|
||||
/*
|
||||
mode = 0: はじめから
|
||||
1: 途中から
|
||||
mode = 0: はじめから
|
||||
1: 途中から
|
||||
*/
|
||||
int nt_sco_main(int mode) {
|
||||
int scono = 1, cnt = 0;
|
||||
@@ -103,11 +103,11 @@ int nt_sco_main(int mode) {
|
||||
void nt_sco_callevent(int ev) {
|
||||
struct _scoadr stadr, curadr;
|
||||
|
||||
// InitGameMainが呼ばれたときのアドレス=関数終了時の戻りアドレス
|
||||
// InitGameMainが呼ばれたときのアドレス=関数終了時の戻りアドレス
|
||||
stadr.page = sl_getPage();
|
||||
stadr.index = sl_getIndex();
|
||||
|
||||
// シーン1
|
||||
// シーン1
|
||||
curadr = scene2adr(ev);
|
||||
sl_callFar2(curadr.page -1, curadr.index);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
int ntsel_dosel(int mode) {
|
||||
// 選択肢を描画
|
||||
// 選択肢を描画
|
||||
//
|
||||
return 0;
|
||||
}
|
||||
|
||||
+49
-49
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sactcg.c: CG作成
|
||||
* sactcg.c: CG作成
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -51,15 +51,15 @@ static cginfo_t *cgs[CGMAX];
|
||||
|
||||
|
||||
/*
|
||||
cgの読み込み
|
||||
cgの読み込み
|
||||
|
||||
指定の番号のCGをリンクファイルから読み込んだり、
|
||||
CG_xxxで作成したCGを参照する
|
||||
指定の番号のCGをリンクファイルから読み込んだり、
|
||||
CG_xxxで作成したCGを参照する
|
||||
|
||||
@param no: 読み込むCG番号
|
||||
@param refinc: 参照カウンタを増やすかどうか。
|
||||
spriteから参照されるときは増やし、CG_xxxを作る時に
|
||||
参照されるときは増やさない。
|
||||
@param no: 読み込むCG番号
|
||||
@param refinc: 参照カウンタを増やすかどうか。
|
||||
spriteから参照されるときは増やし、CG_xxxを作る時に
|
||||
参照されるときは増やさない。
|
||||
*/
|
||||
cginfo_t *scg_loadcg_no(int no, boolean refinc) {
|
||||
cginfo_t *i;
|
||||
@@ -69,8 +69,8 @@ cginfo_t *scg_loadcg_no(int no, boolean refinc) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// すでに ロードされているか、CG_xxx で作成ずみの場合は
|
||||
// 参照カウンタを増やす
|
||||
// すでに ロードされているか、CG_xxx で作成ずみの場合は
|
||||
// 参照カウンタを増やす
|
||||
if (cgs[no] != NULL) {
|
||||
if (refinc) {
|
||||
cgs[no]->refcnt++;
|
||||
@@ -94,7 +94,7 @@ cginfo_t *scg_loadcg_no(int no, boolean refinc) {
|
||||
return i;
|
||||
}
|
||||
|
||||
// 指定の大きさ、色の矩形の CG を作成
|
||||
// 指定の大きさ、色の矩形の CG を作成
|
||||
int scg_create(int wNumCG, int wWidth, int wHeight, int wR, int wG, int wB, int wBlendRate) {
|
||||
cginfo_t *i;
|
||||
|
||||
@@ -108,7 +108,7 @@ int scg_create(int wNumCG, int wWidth, int wHeight, int wR, int wG, int wB, int
|
||||
gr_fill(i->sf, 0, 0, wWidth, wHeight, wR, wG, wB);
|
||||
gr_fill_alpha_map(i->sf, 0, 0, wWidth, wHeight, wBlendRate);
|
||||
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
scg_free(wNumCG);
|
||||
|
||||
cgs[wNumCG] = i;
|
||||
@@ -116,7 +116,7 @@ int scg_create(int wNumCG, int wWidth, int wHeight, int wR, int wG, int wB, int
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 指定のCGを反転させたCGを作成
|
||||
// 指定のCGを反転させたCGを作成
|
||||
int scg_create_reverse(int wNumCG, int wNumSrcCG, int wReverseX, int wReverseY) {
|
||||
cginfo_t *i, *srccg;
|
||||
surface_t *src;
|
||||
@@ -124,7 +124,7 @@ int scg_create_reverse(int wNumCG, int wNumSrcCG, int wReverseX, int wReverseY)
|
||||
spcg_assert_no(wNumCG);
|
||||
spcg_assert_no(wNumSrcCG);
|
||||
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) {
|
||||
return NG;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ int scg_create_reverse(int wNumCG, int wNumSrcCG, int wReverseX, int wReverseY)
|
||||
|
||||
src = srccg->sf;
|
||||
i->sf = stretch(src, src->width, src->height, (wReverseX << 1) | wReverseY);
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
scg_free(wNumCG);
|
||||
|
||||
cgs[wNumCG] = i;
|
||||
@@ -144,7 +144,7 @@ int scg_create_reverse(int wNumCG, int wNumSrcCG, int wReverseX, int wReverseY)
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 指定のCGを拡大/縮小したCGを作成
|
||||
// 指定のCGを拡大/縮小したCGを作成
|
||||
int scg_create_stretch(int wNumCG, int wWidth, int wHeight, int wNumSrcCG) {
|
||||
cginfo_t *i, *srccg;
|
||||
surface_t *src;
|
||||
@@ -152,7 +152,7 @@ int scg_create_stretch(int wNumCG, int wWidth, int wHeight, int wNumSrcCG) {
|
||||
spcg_assert_no(wNumCG);
|
||||
spcg_assert_no(wNumSrcCG);
|
||||
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) {
|
||||
return NG;
|
||||
}
|
||||
@@ -165,7 +165,7 @@ int scg_create_stretch(int wNumCG, int wWidth, int wHeight, int wNumSrcCG) {
|
||||
src = srccg->sf;
|
||||
i->sf = stretch(src, wWidth, wHeight, 0);
|
||||
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
scg_free(wNumCG);
|
||||
|
||||
cgs[wNumCG] = i;
|
||||
@@ -173,7 +173,7 @@ int scg_create_stretch(int wNumCG, int wWidth, int wHeight, int wNumSrcCG) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// ベースCGの上にブレンドCGを重ねた CG を作成
|
||||
// ベースCGの上にブレンドCGを重ねた CG を作成
|
||||
int scg_create_blend(int wNumDstCG, int wNumBaseCG, int wX, int wY, int wNumBlendCG, int wAlphaMapMode) {
|
||||
cginfo_t *i, *basecg, *blendcg;
|
||||
|
||||
@@ -181,7 +181,7 @@ int scg_create_blend(int wNumDstCG, int wNumBaseCG, int wX, int wY, int wNumBlen
|
||||
spcg_assert_no(wNumBaseCG);
|
||||
spcg_assert_no(wNumBlendCG);
|
||||
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
basecg = scg_loadcg_no(wNumBaseCG, FALSE);
|
||||
blendcg = scg_loadcg_no(wNumBlendCG, FALSE);
|
||||
if (basecg == NULL || blendcg == NULL) return NG;
|
||||
@@ -193,7 +193,7 @@ int scg_create_blend(int wNumDstCG, int wNumBaseCG, int wX, int wY, int wNumBlen
|
||||
|
||||
i->sf = blend(basecg->sf, wX , wY, blendcg->sf, wAlphaMapMode);
|
||||
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
scg_free(wNumDstCG);
|
||||
|
||||
cgs[wNumDstCG] = i;
|
||||
@@ -201,7 +201,7 @@ int scg_create_blend(int wNumDstCG, int wNumBaseCG, int wX, int wY, int wNumBlen
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 指定の文字列のCGを作成
|
||||
// 指定の文字列のCGを作成
|
||||
int scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, char *cText) {
|
||||
cginfo_t *i;
|
||||
agsurface_t *glyph;
|
||||
@@ -215,7 +215,7 @@ int scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, char *cText)
|
||||
|
||||
spcg_assert_no(wNumCG);
|
||||
|
||||
// 勝手に出ていいのかな?
|
||||
// 勝手に出ていいのかな?
|
||||
if (strlen(cText) == 0) return OK;
|
||||
|
||||
font = nact->ags.font;
|
||||
@@ -231,7 +231,7 @@ int scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, char *cText)
|
||||
gr_fill(i->sf, 0, 0, glyph->width, wSize, wR, wG, wB);
|
||||
gr_draw_amap(i->sf, 0, 0, glyph->pixel, glyph->width, wSize, glyph->bytes_per_line);
|
||||
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
scg_free(wNumCG);
|
||||
|
||||
cgs[wNumCG] = i;
|
||||
@@ -239,7 +239,7 @@ int scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, char *cText)
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 数字文字列のCGを作成
|
||||
// 数字文字列のCGを作成
|
||||
int scg_create_textnum(int wNumCG, int wSize, int wR, int wG, int wB, int wFigs, int wZeroPadding, int wValue) {
|
||||
cginfo_t *i;
|
||||
agsurface_t *glyph;
|
||||
@@ -269,7 +269,7 @@ int scg_create_textnum(int wNumCG, int wSize, int wR, int wG, int wB, int wFigs,
|
||||
gr_fill(i->sf, 0, 0, glyph->width, wSize, wR, wG, wB);
|
||||
gr_draw_amap(i->sf, 0, 0, glyph->pixel, glyph->width, wSize, glyph->bytes_per_line);
|
||||
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
scg_free(wNumCG);
|
||||
|
||||
cgs[wNumCG] = i;
|
||||
@@ -277,14 +277,14 @@ int scg_create_textnum(int wNumCG, int wSize, int wR, int wG, int wB, int wFigs,
|
||||
return OK;
|
||||
}
|
||||
|
||||
// CGを複製
|
||||
// CGを複製
|
||||
int scg_copy(int wNumDstCG, int wNumSrcCG) {
|
||||
cginfo_t *i, *srccg;
|
||||
|
||||
spcg_assert_no(wNumDstCG);
|
||||
spcg_assert_no(wNumSrcCG);
|
||||
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) {
|
||||
return NG;
|
||||
}
|
||||
@@ -295,7 +295,7 @@ int scg_copy(int wNumDstCG, int wNumSrcCG) {
|
||||
i->refcnt = 0;
|
||||
i->sf = sf_dup(srccg->sf);
|
||||
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
scg_free(wNumDstCG);
|
||||
|
||||
cgs[wNumDstCG] = i;
|
||||
@@ -303,7 +303,7 @@ int scg_copy(int wNumDstCG, int wNumSrcCG) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// CGの一部を切りぬいたCGを作成
|
||||
// CGの一部を切りぬいたCGを作成
|
||||
int scg_cut(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeight) {
|
||||
cginfo_t *i, *srccg;
|
||||
surface_t *dst, *src;
|
||||
@@ -311,7 +311,7 @@ int scg_cut(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeigh
|
||||
spcg_assert_no(wNumDstCG);
|
||||
spcg_assert_no(wNumSrcCG);
|
||||
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) {
|
||||
return NG;
|
||||
}
|
||||
@@ -336,7 +336,7 @@ int scg_cut(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeigh
|
||||
|
||||
i->sf = dst;
|
||||
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
scg_free(wNumDstCG);
|
||||
|
||||
cgs[wNumDstCG] = i;
|
||||
@@ -344,7 +344,7 @@ int scg_cut(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeigh
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 元のCGの一部を切りぬいたCGを作成
|
||||
// 元のCGの一部を切りぬいたCGを作成
|
||||
int scg_partcopy(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeight) {
|
||||
cginfo_t *i, *srccg;
|
||||
surface_t *dst, *src;
|
||||
@@ -352,7 +352,7 @@ int scg_partcopy(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int w
|
||||
spcg_assert_no(wNumDstCG);
|
||||
spcg_assert_no(wNumSrcCG);
|
||||
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) {
|
||||
return NG;
|
||||
}
|
||||
@@ -379,7 +379,7 @@ int scg_partcopy(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int w
|
||||
|
||||
i->sf = dst;
|
||||
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
scg_free(wNumDstCG);
|
||||
|
||||
cgs[wNumDstCG] = i;
|
||||
@@ -387,7 +387,7 @@ int scg_partcopy(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int w
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 全てのCGの開放
|
||||
// 全てのCGの開放
|
||||
int scg_freeall() {
|
||||
int i;
|
||||
|
||||
@@ -398,8 +398,8 @@ int scg_freeall() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定の番号の CG をオブジェクトリストから消し、オブジェクトがどこからも参照
|
||||
* されていない(参照数が0の)場合のみ、オブジェクトを削除
|
||||
* 指定の番号の CG をオブジェクトリストから消し、オブジェクトがどこからも参照
|
||||
* されていない(参照数が0の)場合のみ、オブジェクトを削除
|
||||
*/
|
||||
int scg_free(int no) {
|
||||
cginfo_t *cg;
|
||||
@@ -408,36 +408,36 @@ int scg_free(int no) {
|
||||
|
||||
if (NULL == (cg = cgs[no])) return NG;
|
||||
|
||||
// 参照数が0の時のみオブジェクトを開放
|
||||
// 参照数が0の時のみオブジェクトを開放
|
||||
if (cg->refcnt == 0) {
|
||||
scg_free_cgobj(cg);
|
||||
}
|
||||
|
||||
// 番号で消したときはオブジェクトが開放されなくても
|
||||
// オブジェクトリストから削除
|
||||
// 番号で消したときはオブジェクトが開放されなくても
|
||||
// オブジェクトリストから削除
|
||||
cgs[no] = NULL;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* CG オブジェクトの開放
|
||||
* CG オブジェクトの開放
|
||||
*/
|
||||
int scg_free_cgobj(cginfo_t *cg) {
|
||||
if (cg == NULL) return NG;
|
||||
|
||||
(cg->refcnt)--;
|
||||
// 他でまだ参照していれば開放しない
|
||||
// 他でまだ参照していれば開放しない
|
||||
if (cg->refcnt > 0) {
|
||||
return NG;
|
||||
}
|
||||
|
||||
// CG本体の開放
|
||||
// CG本体の開放
|
||||
if (cg->sf) {
|
||||
sf_free(cg->sf);
|
||||
}
|
||||
|
||||
// 削除するオブジェクトを参照しているオブジェクトリストも削除
|
||||
// 削除するオブジェクトを参照しているオブジェクトリストも削除
|
||||
if (cg == cgs[cg->no]) {
|
||||
cgs[cg->no] = NULL;
|
||||
}
|
||||
@@ -447,7 +447,7 @@ int scg_free_cgobj(cginfo_t *cg) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// CGの種類を取得
|
||||
// CGの種類を取得
|
||||
int scg_querytype(int wNumCG, int *ret) {
|
||||
if (wNumCG >= (CGMAX -1)) goto errexit;
|
||||
if (cgs[wNumCG] == NULL) goto errexit;
|
||||
@@ -461,7 +461,7 @@ int scg_querytype(int wNumCG, int *ret) {
|
||||
return NG;
|
||||
}
|
||||
|
||||
// CGの大きさを取得
|
||||
// CGの大きさを取得
|
||||
int scg_querysize(int wNumCG, int *w, int *h) {
|
||||
if (wNumCG >= (CGMAX -1)) goto errexit;
|
||||
if (cgs[wNumCG] == NULL) goto errexit;
|
||||
@@ -477,7 +477,7 @@ int scg_querysize(int wNumCG, int *w, int *h) {
|
||||
return NG;
|
||||
}
|
||||
|
||||
// CGのBPPを取得
|
||||
// CGのBPPを取得
|
||||
int scg_querybpp(int wNumCG, int *ret) {
|
||||
if (wNumCG >= (CGMAX -1)) goto errexit;
|
||||
if (cgs[wNumCG] == NULL) goto errexit;
|
||||
@@ -492,7 +492,7 @@ int scg_querybpp(int wNumCG, int *ret) {
|
||||
return NG;
|
||||
}
|
||||
|
||||
// CGの alphamap が存在するかを取得
|
||||
// CGの alphamap が存在するかを取得
|
||||
int scg_existalphamap(int wNumCG, int *ret) {
|
||||
if (wNumCG >= (CGMAX -1)) goto errexit;
|
||||
if (cgs[wNumCG] == NULL) goto errexit;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sactcg.h: CGºîÀ®
|
||||
* sactcg.h: CG作成
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
|
||||
@@ -5,22 +5,22 @@ static surface_t *blend(surface_t *base, int x, int y, surface_t *blend, int mod
|
||||
gr_copy(dst, 0, 0, base, 0, 0, base->width, base->height);
|
||||
|
||||
if (base->has_alpha) {
|
||||
// ベースに alpha map がある場合はそれをコピー
|
||||
// ベースに alpha map がある場合はそれをコピー
|
||||
gr_copy_alpha_map(dst, 0, 0, base, 0, 0, base->width, base->height);
|
||||
} else {
|
||||
// 無い場合は全て 255 の map を作成
|
||||
// 無い場合は全て 255 の map を作成
|
||||
gr_fill_alpha_map(dst, 0, 0, base->width, base->height, 255);
|
||||
}
|
||||
|
||||
if (blend->has_alpha) {
|
||||
// 重ね合わせ先の alpha map があるときはそれを使う
|
||||
// 重ね合わせ先の alpha map があるときはそれを使う
|
||||
gre_BlendUseAMap(dst, x, y, base, x, y, blend, 0, 0, blend->width, blend->height, blend, 0, 0, 255);
|
||||
} else {
|
||||
// 無いときは dst の alpha map を使う
|
||||
// 無いときは dst の alpha map を使う
|
||||
gre_BlendUseAMap(dst, x, y, base, x, y, blend, 0, 0, blend->width, blend->height, dst, x, y, 255);
|
||||
}
|
||||
|
||||
// alpha 作成モードが dst + blend の時は飽和加算
|
||||
// alpha 作成モードが dst + blend の時は飽和加算
|
||||
if (mode == 1) {
|
||||
gr_saturadd_alpha_map(dst, x, y, blend, 0, 0, blend->width, blend->height);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// 拡大縮小
|
||||
// 拡大縮小
|
||||
static surface_t *stretch(surface_t *src, int dw, int dh, int mirror) {
|
||||
surface_t *dst = g_new0(surface_t, 1);
|
||||
float a1, a2, xd, yd;
|
||||
@@ -31,12 +31,12 @@ static surface_t *stretch(surface_t *src, int dw, int dh, int mirror) {
|
||||
a1 = (float)sw / (float)dw;
|
||||
a2 = (float)sh / (float)dh;
|
||||
row = g_new(int, dw);
|
||||
// 1おおきくして初期化しないと col[dw-1]とcol[dw]が同じになる
|
||||
// 可能性がある。
|
||||
// 1おおきくして初期化しないと col[dw-1]とcol[dw]が同じになる
|
||||
// 可能性がある。
|
||||
col = g_new0(int, dh +1);
|
||||
|
||||
if (mirror & 1) {
|
||||
/* 上下反転 added by tajiri@wizard */
|
||||
/* 上下反転 added by tajiri@wizard */
|
||||
for (yd = sh - a2, y = 0; y < dh; y++) {
|
||||
col[y] = yd; yd -= a2;
|
||||
}
|
||||
@@ -46,7 +46,7 @@ static surface_t *stretch(surface_t *src, int dw, int dh, int mirror) {
|
||||
}
|
||||
}
|
||||
if (mirror & 2) {
|
||||
/* 左右反転 added by tajiri@wizard */
|
||||
/* 左右反転 added by tajiri@wizard */
|
||||
for (xd = sw - a1, x = 0; x < dw; x++) {
|
||||
row[x] = xd; xd -= a1;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sactstring.c: SACTの文字列操作関連
|
||||
* sactstring.c: SACTの文字列操作関連
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -29,18 +29,18 @@
|
||||
#include "system.h"
|
||||
#include "variable.h"
|
||||
|
||||
// 文字列置換用
|
||||
// 文字列置換用
|
||||
typedef struct {
|
||||
char *src; // 置き換え元文字列
|
||||
char *dst; // 置き換え文字列
|
||||
char *src; // 置き換え元文字列
|
||||
char *dst; // 置き換え文字列
|
||||
} strexchange_t;
|
||||
|
||||
#define DEFSTACKSIZE 100
|
||||
static char **stack; // stack本体
|
||||
static char **stack; // stack本体
|
||||
static int idx; // stack pointer
|
||||
static int idxmax; // stack pointerの最大
|
||||
static int idxmax; // stack pointerの最大
|
||||
|
||||
// 文字列置き換え用 (表示時にon-the-flyで変換して表示)
|
||||
// 文字列置き換え用 (表示時にon-the-flyで変換して表示)
|
||||
#define REPLACEBUFSIZE 3000
|
||||
static char repbuf[2][REPLACEBUFSIZE];
|
||||
static GSList *strreplace;
|
||||
@@ -48,7 +48,7 @@ static char *replacesrc;
|
||||
static char *replacedst;
|
||||
|
||||
/**
|
||||
* 文字列変数スタックの初期化
|
||||
* 文字列変数スタックの初期化
|
||||
*/
|
||||
int sstr_init() {
|
||||
stack = g_new(char *, DEFSTACKSIZE);
|
||||
@@ -58,8 +58,8 @@ int sstr_init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 文字列変数スタックに文字列を積む
|
||||
* @param strno: シナリオ上での文字列変数番号
|
||||
* 文字列変数スタックに文字列を積む
|
||||
* @param strno: シナリオ上での文字列変数番号
|
||||
*/
|
||||
int sstr_push(char *str) {
|
||||
if (idx >= idxmax) {
|
||||
@@ -73,8 +73,8 @@ int sstr_push(char *str) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 文字列変数スタックから文字列を取り出す
|
||||
* @param strno: スタックから戻した文字列を格納する文字列変数番号
|
||||
* 文字列変数スタックから文字列を取り出す
|
||||
* @param strno: スタックから戻した文字列を格納する文字列変数番号
|
||||
*/
|
||||
int sstr_pop(char *str, int maxlen) {
|
||||
if (idx == 0) return NG;
|
||||
@@ -86,9 +86,9 @@ int sstr_pop(char *str, int maxlen) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 文字列の置き換え
|
||||
* @param sstrno: 変換元文字列変数番号
|
||||
* @param dstrno: 変換先文字列変数番号
|
||||
* 文字列の置き換え
|
||||
* @param sstrno: 変換元文字列変数番号
|
||||
* @param dstrno: 変換先文字列変数番号
|
||||
*/
|
||||
int sstr_regist_replace(char *sstr, char *dstr) {
|
||||
strexchange_t *ex;
|
||||
@@ -103,7 +103,7 @@ int sstr_regist_replace(char *sstr, char *dstr) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 数値 -> 文字列化
|
||||
* 数値 -> 文字列化
|
||||
*/
|
||||
int sstr_num2str(int strno, int fig, int nzeropad, int num) {
|
||||
char s[256], ss[256];
|
||||
@@ -122,7 +122,7 @@ int sstr_num2str(int strno, int fig, int nzeropad, int num) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 文字列の置き換え処理
|
||||
// 文字列の置き換え処理
|
||||
static void replacestr_cb(gpointer data, gpointer userdata) {
|
||||
strexchange_t *ex = (strexchange_t *)data;
|
||||
char *start, *next, *out;
|
||||
@@ -146,7 +146,7 @@ static void replacestr_cb(gpointer data, gpointer userdata) {
|
||||
replacedst[0] = '\0';
|
||||
}
|
||||
|
||||
// 文字列の置き換え
|
||||
// 文字列の置き換え
|
||||
char *sstr_replacestr(char *msg) {
|
||||
if (strreplace == NULL) return msg;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sactstring.h: SACT¤Îʸ»úÎóÁàºî´ØÏ¢
|
||||
* sactstring.h: SACTの文字列操作関連
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
|
||||
+24
-24
@@ -12,38 +12,38 @@
|
||||
|
||||
|
||||
#define SPRITEMAX 20
|
||||
#define SPNO_WALL 0 // 壁紙
|
||||
#define SPNO_SCENERY 1 // 背景
|
||||
#define SPNO_TACHI_L 2 // 立ち絵左
|
||||
#define SPNO_TACHI_M 3 // 立ち絵中央
|
||||
#define SPNO_TACHI_R 4 // 立ち絵右
|
||||
#define SPNO_MSGBG 5 // 文字下地
|
||||
#define SPNO_MSGFRAME_BG 6 // メッセージウィンド枠
|
||||
#define SPNO_MSGFRAME_FG 7 // メッセージ文字描画キャンバス
|
||||
#define SPNO_FACE 11 // 人物顔CG
|
||||
#define SPNO_MSG_KEYANIM 12 // メッセージキー入力アニメーション
|
||||
#define SPNO_MSG_ICON_MUTE 13 // メッセージウィンドアイコン
|
||||
#define SPNO_WALL 0 // 壁紙
|
||||
#define SPNO_SCENERY 1 // 背景
|
||||
#define SPNO_TACHI_L 2 // 立ち絵左
|
||||
#define SPNO_TACHI_M 3 // 立ち絵中央
|
||||
#define SPNO_TACHI_R 4 // 立ち絵右
|
||||
#define SPNO_MSGBG 5 // 文字下地
|
||||
#define SPNO_MSGFRAME_BG 6 // メッセージウィンド枠
|
||||
#define SPNO_MSGFRAME_FG 7 // メッセージ文字描画キャンバス
|
||||
#define SPNO_FACE 11 // 人物顔CG
|
||||
#define SPNO_MSG_KEYANIM 12 // メッセージキー入力アニメーション
|
||||
#define SPNO_MSG_ICON_MUTE 13 // メッセージウィンドアイコン
|
||||
|
||||
#define CGMAX 65536
|
||||
// 0-9999: reserve for Link CG
|
||||
// 2051: メッセージウィンド枠CG
|
||||
// 2051: メッセージウィンド枠CG
|
||||
#define CGNO_MSGFRAME_LCG 2051
|
||||
// 4017: メッセージウィンドで声をmuteにするCG
|
||||
// 4017: メッセージウィンドで声をmuteにするCG
|
||||
#define CGNO_MSGFRAME_NOVICE_LCG 4017
|
||||
// 4018: メッセージウィンドのアイコンにマウスが重なったときのCG
|
||||
// 4018: メッセージウィンドのアイコンにマウスが重なったときのCG
|
||||
#define CGNO_MSGFRAME_ICONREV_LCG 4018
|
||||
// 4034: キー入力を促すアニメーションCG
|
||||
// 4034: キー入力を促すアニメーションCG
|
||||
#define CGNO_MSGHAK_LCG 4034
|
||||
|
||||
// 10000: メッセージウィンドでのキー待ちアニメ その1
|
||||
// 10000: メッセージウィンドでのキー待ちアニメ その1
|
||||
#define CGNO_MSGHAK_1 10000
|
||||
// 10001: メッセージウィンドでのキー待ちアニメ その2
|
||||
// 10001: メッセージウィンドでのキー待ちアニメ その2
|
||||
#define CGNO_MSGHAK_2 10001
|
||||
// 10002: 文字下地CG
|
||||
// 10002: 文字下地CG
|
||||
#define CGNO_MSGFR_BG 10002
|
||||
|
||||
|
||||
// CG_XX で作るCGの種類
|
||||
// CG_XX で作るCGの種類
|
||||
enum cgtype {
|
||||
CG_NOTUSED = 0,
|
||||
CG_LINKED = 1,
|
||||
@@ -52,12 +52,12 @@ enum cgtype {
|
||||
CG_STRETCH = 4
|
||||
};
|
||||
|
||||
// cgに関する情報
|
||||
// cgに関する情報
|
||||
struct _cginfo {
|
||||
enum cgtype type; // CGの種類, 0: 未使用, 1:リンクされている, ...
|
||||
int no; // CGの番号
|
||||
surface_t *sf; // CG本体
|
||||
int refcnt; // 参照カウンタ。0になったら開放してもよい。
|
||||
enum cgtype type; // CGの種類, 0: 未使用, 1:リンクされている, ...
|
||||
int no; // CGの番号
|
||||
surface_t *sf; // CG本体
|
||||
int refcnt; // 参照カウンタ。0になったら開放してもよい。
|
||||
};
|
||||
typedef struct _cginfo cginfo_t;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sprite_draw.c: スプライト再描画各種
|
||||
* sprite_draw.c: スプライト再描画各種
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -35,9 +35,9 @@
|
||||
#include "sprite.h"
|
||||
|
||||
/*
|
||||
指定の sprite (の現在のCG)を surface0 に書く
|
||||
@param sp: 描画するスプライト
|
||||
@param r : 再描画する領域
|
||||
指定の sprite (の現在のCG)を surface0 に書く
|
||||
@param sp: 描画するスプライト
|
||||
@param r : 再描画する領域
|
||||
*/
|
||||
int sp_draw(sprite_t *sp, MyRectangle *r) {
|
||||
if (sp == NULL) return NG;
|
||||
@@ -46,12 +46,12 @@ int sp_draw(sprite_t *sp, MyRectangle *r) {
|
||||
}
|
||||
|
||||
/*
|
||||
指定の spriteの指定のCGを surface0 に書く
|
||||
(このインターフェイスはもう不要?)
|
||||
指定の spriteの指定のCGを surface0 に書く
|
||||
(このインターフェイスはもう不要?)
|
||||
|
||||
@param sp: 描画するスプライト
|
||||
@param cg: 描画するCG
|
||||
@param r : 再描画する領域
|
||||
@param sp: 描画するスプライト
|
||||
@param cg: 描画するCG
|
||||
@param r : 再描画する領域
|
||||
*/
|
||||
int sp_draw2(sprite_t *sp, cginfo_t *cg, MyRectangle *r) {
|
||||
surface_t update;
|
||||
@@ -60,7 +60,7 @@ int sp_draw2(sprite_t *sp, cginfo_t *cg, MyRectangle *r) {
|
||||
if (cg == NULL) return NG;
|
||||
if (cg->sf == NULL) return NG;
|
||||
|
||||
// 更新領域の確定
|
||||
// 更新領域の確定
|
||||
update.width = r->width;
|
||||
update.height = r->height;
|
||||
sx = 0;
|
||||
@@ -78,7 +78,7 @@ int sp_draw2(sprite_t *sp, cginfo_t *cg, MyRectangle *r) {
|
||||
dy += r->y;
|
||||
|
||||
if (cg->sf->has_alpha) {
|
||||
// alpha map がある場合
|
||||
// alpha map がある場合
|
||||
gre_BlendUseAMap(sf0, dx, dy,
|
||||
sf0, dx, dy,
|
||||
cg->sf, sx, sy, w, h,
|
||||
@@ -86,10 +86,10 @@ int sp_draw2(sprite_t *sp, cginfo_t *cg, MyRectangle *r) {
|
||||
sp->blendrate);
|
||||
} else {
|
||||
if (sp->blendrate == 255) {
|
||||
// alpha値指定が無い場合
|
||||
// alpha値指定が無い場合
|
||||
gr_copy(sf0, dx, dy, cg->sf, sx, sy, w, h);
|
||||
} else if (sp->blendrate > 0) {
|
||||
// alpha値指定がある場合
|
||||
// alpha値指定がある場合
|
||||
gre_Blend(sf0, dx, dy,
|
||||
sf0, dx, dy,
|
||||
cg->sf, sx, sy, w, h,
|
||||
@@ -103,7 +103,7 @@ int sp_draw2(sprite_t *sp, cginfo_t *cg, MyRectangle *r) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// BlendScreenによる描画
|
||||
// BlendScreenによる描画
|
||||
int sp_draw_scg(sprite_t *sp, MyRectangle *r) {
|
||||
surface_t update;
|
||||
cginfo_t *cg;
|
||||
@@ -116,7 +116,7 @@ int sp_draw_scg(sprite_t *sp, MyRectangle *r) {
|
||||
if (cg == NULL) return NG;
|
||||
if (cg->sf == NULL) return NG;
|
||||
|
||||
// 更新領域の確定
|
||||
// 更新領域の確定
|
||||
update.width = r->width;
|
||||
update.height = r->height;
|
||||
sx = 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sprite_eupdate.c: 効果つき更新
|
||||
* sprite_eupdate.c: 効果つき更新
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -78,7 +78,7 @@ static void ec_dummy_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
WARNING("NOT IMPLEMENTED\n");
|
||||
}
|
||||
|
||||
// クロスフェード
|
||||
// クロスフェード
|
||||
static void ec1_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
int curstep;
|
||||
|
||||
@@ -95,7 +95,7 @@ static void ec1_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ecp.oldstep = curstep;
|
||||
}
|
||||
|
||||
// すだれ落ち
|
||||
// すだれ落ち
|
||||
static void ec7_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
#define EC7DELTA 16
|
||||
int curstep, maxstep = sfsrc->height / EC7DELTA + EC7DELTA;
|
||||
@@ -123,7 +123,7 @@ static void ec7_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ags_updateFull();
|
||||
}
|
||||
|
||||
// すだれ左->右
|
||||
// すだれ左->右
|
||||
static void ec8_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
#define EC8DELTA 16
|
||||
int curstep, maxstep = sfsrc->width / EC8DELTA + EC8DELTA;
|
||||
@@ -151,7 +151,7 @@ static void ec8_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ags_updateFull();
|
||||
}
|
||||
|
||||
// すだれ落ち&左->右
|
||||
// すだれ落ち&左->右
|
||||
static void ec9_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
#define EC9DELTA 16
|
||||
int curstep, maxstep;
|
||||
@@ -188,7 +188,7 @@ static void ec9_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ags_updateFull();
|
||||
}
|
||||
|
||||
// 上->下クロスフェード
|
||||
// 上->下クロスフェード
|
||||
static void ec12_cb(surface_t *src, surface_t *dst) {
|
||||
#define EC12DELTA 256
|
||||
int curstep, maxstep = src->height + EC12DELTA;
|
||||
@@ -216,7 +216,7 @@ static void ec12_cb(surface_t *src, surface_t *dst) {
|
||||
ecp.oldstep = st_i;
|
||||
}
|
||||
|
||||
// 下->上クロスフェード
|
||||
// 下->上クロスフェード
|
||||
static void ec13_cb(surface_t *src, surface_t *dst) {
|
||||
#define EC13DELTA 256
|
||||
int curstep, maxstep = src->height + EC12DELTA;
|
||||
@@ -247,7 +247,7 @@ static void ec13_cb(surface_t *src, surface_t *dst) {
|
||||
ecp.oldstep = st_i;
|
||||
}
|
||||
|
||||
// 五芒星 (内->外)
|
||||
// 五芒星 (内->外)
|
||||
static void ec14_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
int curstep, maxstep;
|
||||
maxstep = 256;
|
||||
@@ -260,7 +260,7 @@ static void ec14_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ecp.oldstep = curstep;
|
||||
}
|
||||
|
||||
// 五芒星 (外->内)
|
||||
// 五芒星 (外->内)
|
||||
static void ec15_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
int curstep, maxstep;
|
||||
maxstep = 256;
|
||||
@@ -273,7 +273,7 @@ static void ec15_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ecp.oldstep = curstep;
|
||||
}
|
||||
|
||||
// 六芒星 (内->外)
|
||||
// 六芒星 (内->外)
|
||||
static void ec16_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
int curstep, maxstep;
|
||||
maxstep = 256;
|
||||
@@ -286,7 +286,7 @@ static void ec16_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ecp.oldstep = curstep;
|
||||
}
|
||||
|
||||
// 六芒星 (外->内)
|
||||
// 六芒星 (外->内)
|
||||
static void ec17_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
int curstep, maxstep;
|
||||
maxstep = 256;
|
||||
@@ -299,7 +299,7 @@ static void ec17_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ecp.oldstep = curstep;
|
||||
}
|
||||
|
||||
// フェードイン
|
||||
// フェードイン
|
||||
static void ec_fadein_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
int curstep;
|
||||
|
||||
@@ -328,7 +328,7 @@ static void ec_fadeout_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ecp.oldstep = curstep;
|
||||
}
|
||||
|
||||
// ホワイトイン
|
||||
// ホワイトイン
|
||||
static void ec_whitein_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
int curstep;
|
||||
|
||||
@@ -360,24 +360,24 @@ static void ec_whiteout_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
|
||||
|
||||
/*
|
||||
効果つき画面更新
|
||||
@param type: 効果の種類
|
||||
@param time: 実行時間(msec)
|
||||
@param cancel: キー抜け(0:なし, 1:あり)
|
||||
効果つき画面更新
|
||||
@param type: 効果の種類
|
||||
@param time: 実行時間(msec)
|
||||
@param cancel: キー抜け(0:なし, 1:あり)
|
||||
*/
|
||||
int sp_eupdate(int type, int time, int cancel) {
|
||||
surface_t *sfsrc, *sfdst;
|
||||
int key;
|
||||
entrypoint *cb;
|
||||
|
||||
// 現在の sf0 をセーブ
|
||||
// 現在の sf0 をセーブ
|
||||
sfsrc = sf_dup(sf0);
|
||||
|
||||
sp_update_all(FALSE);
|
||||
|
||||
sfdst = sf_dup(sf0);
|
||||
|
||||
sf_copyall(sf0, sfsrc); // 全部の効果タイプにこの処理は要らないんだけど
|
||||
sf_copyall(sf0, sfsrc); // 全部の効果タイプにこの処理は要らないんだけど
|
||||
|
||||
ecp.sttime = ecp.curtime = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
ecp.edtime = ecp.curtime + time;
|
||||
@@ -387,28 +387,28 @@ int sp_eupdate(int type, int time, int cancel) {
|
||||
case 10:
|
||||
cb = ec_dummy_cb;
|
||||
break;
|
||||
case 101: // クロスフェード
|
||||
case 101: // クロスフェード
|
||||
cb = ec1_cb;
|
||||
break;
|
||||
case 102: // フェードアウト
|
||||
case 102: // フェードアウト
|
||||
cb = ec_fadeout_cb;
|
||||
break;
|
||||
case 103: // フェードイン
|
||||
case 103: // フェードイン
|
||||
cb = ec_fadein_cb;
|
||||
break;
|
||||
case 104: // ホワイトアウト
|
||||
case 104: // ホワイトアウト
|
||||
cb = ec_whiteout_cb;
|
||||
break;
|
||||
case 105: // ホワイトイン
|
||||
case 105: // ホワイトイン
|
||||
cb = ec_whitein_cb;
|
||||
break;
|
||||
case 107: // 簾落ち
|
||||
case 107: // 簾落ち
|
||||
cb = ec7_cb;
|
||||
break;
|
||||
case 108: // 左->右すだれ
|
||||
case 108: // 左->右すだれ
|
||||
cb = ec8_cb;
|
||||
break;
|
||||
case 111: // 線形ぼかし
|
||||
case 111: // 線形ぼかし
|
||||
ec11_prepare(sfsrc, sfdst);
|
||||
cb = ec11_cb;
|
||||
break;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// 11 と 19 で共有
|
||||
// 11 と 19 で共有
|
||||
static surface_t *ec11_ss[6];
|
||||
static surface_t *ec11_sd[6];
|
||||
|
||||
// 線形ブラー
|
||||
// 線形ブラー
|
||||
static void ec11_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
int curstep, maxstep = 6;
|
||||
curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime);
|
||||
@@ -36,7 +36,7 @@ static void ec11_drain(surface_t *src, surface_t *dst) {
|
||||
}
|
||||
}
|
||||
|
||||
// 縦線形ブラー
|
||||
// 縦線形ブラー
|
||||
static void ec19_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ec11_cb(sfsrc, sfdst);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sprite_update.c: spriteの通常更新いろいろ
|
||||
* sprite_update.c: spriteの通常更新いろいろ
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -36,10 +36,10 @@
|
||||
#include "ngraph.h"
|
||||
#include "sprite.h"
|
||||
|
||||
// スプライト再描画間の間に変更のあったスプライトの領域の和
|
||||
// スプライト再描画間の間に変更のあったスプライトの領域の和
|
||||
static GSList *updatearea;
|
||||
|
||||
// 再描画するスプライトのリスト
|
||||
// 再描画するスプライトのリスト
|
||||
static GSList *updatelist;
|
||||
|
||||
static void intersection(MyRectangle *r1, MyRectangle *r2, MyRectangle *rst);
|
||||
@@ -47,7 +47,7 @@ static void disjunction(gpointer region, gpointer data);
|
||||
static MyRectangle get_updatearea();
|
||||
static void do_update_each(gpointer data, gpointer userdata);
|
||||
|
||||
// 領域1と領域2の積を計算
|
||||
// 領域1と領域2の積を計算
|
||||
static void intersection(MyRectangle *r1, MyRectangle *r2, MyRectangle *rst) {
|
||||
int x1 = max(r1->x, r2->x);
|
||||
int x2 = min(r1->x + r1->width, r2->x + r2->width);
|
||||
@@ -60,7 +60,7 @@ static void intersection(MyRectangle *r1, MyRectangle *r2, MyRectangle *rst) {
|
||||
rst->height = y2 - y1;
|
||||
}
|
||||
|
||||
// 領域1と領域2をすべて含む矩形領域を計算
|
||||
// 領域1と領域2をすべて含む矩形領域を計算
|
||||
static void disjunction(gpointer region, gpointer data) {
|
||||
MyRectangle *r1 = (MyRectangle *)region;
|
||||
MyRectangle *r2 = (MyRectangle *)data;
|
||||
@@ -90,7 +90,7 @@ static void disjunction(gpointer region, gpointer data) {
|
||||
//WARNING("res:r2x=%d,r2y=%d,r2w=%d,r2h=%d\n", r2->x, r2->y, r2->width, r2->height);
|
||||
}
|
||||
|
||||
// 更新の必要なスプライトの領域の和をとってクリッピングする
|
||||
// 更新の必要なスプライトの領域の和をとってクリッピングする
|
||||
static MyRectangle get_updatearea() {
|
||||
MyRectangle clip = {0, 0, 0, 0};
|
||||
MyRectangle rsf0 = {0, 0, sf0->width, sf0->height};
|
||||
@@ -101,7 +101,7 @@ static MyRectangle get_updatearea() {
|
||||
g_slist_free(updatearea);
|
||||
updatearea = NULL;
|
||||
|
||||
// surface0との領域の積をとる
|
||||
// surface0との領域の積をとる
|
||||
intersection(&rsf0, &clip, &result);
|
||||
|
||||
WARNING("clipped area x=%d y=%d w=%d h=%d\n",
|
||||
@@ -111,35 +111,35 @@ static MyRectangle get_updatearea() {
|
||||
return result;
|
||||
}
|
||||
|
||||
// updatelist に登録してあるすべてのスプライトを更新
|
||||
// updatelist に登録してあるすべてのスプライトを更新
|
||||
static void do_update_each(gpointer data, gpointer userdata) {
|
||||
sprite_t *sp = (sprite_t *)data;
|
||||
MyRectangle *r = (MyRectangle *)userdata;
|
||||
|
||||
// 非表示の場合はなにもしない
|
||||
// 非表示の場合はなにもしない
|
||||
if (!sp->show) return;
|
||||
|
||||
// スプライト毎のupdateルーチンの呼び出し
|
||||
// スプライト毎のupdateルーチンの呼び出し
|
||||
if (sp->update) {
|
||||
sp->update(sp, r);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
画面全体の更新
|
||||
@param syncscreen: surface0 に描画したものを Screen に反映させるかどうか
|
||||
画面全体の更新
|
||||
@param syncscreen: surface0 に描画したものを Screen に反映させるかどうか
|
||||
*/
|
||||
int sp_update_all(boolean syncscreen) {
|
||||
// 画面全体を更新領域に
|
||||
// 画面全体を更新領域に
|
||||
MyRectangle r = {0, 0, sf0->width, sf0->height };
|
||||
|
||||
// updatelistに登録してあるスプライトを再描画
|
||||
// updatelistはスプライトの番号順に並んでいる
|
||||
// updatelistに登録してあるスプライトを再描画
|
||||
// updatelistはスプライトの番号順に並んでいる
|
||||
g_slist_foreach(updatelist, do_update_each, &r);
|
||||
|
||||
// このルーチンが呼ばれるときはスプライトはドラッグ中ではない
|
||||
// このルーチンが呼ばれるときはスプライトはドラッグ中ではない
|
||||
|
||||
// screenと同期は必要なときは画面全体をWindowへ転送
|
||||
// screenと同期は必要なときは画面全体をWindowへ転送
|
||||
if (syncscreen) {
|
||||
ags_updateFull();
|
||||
}
|
||||
@@ -148,32 +148,32 @@ int sp_update_all(boolean syncscreen) {
|
||||
}
|
||||
|
||||
/*
|
||||
画面の一部を更新
|
||||
updateme(_part)で登録した更新が必要なspriteの和の領域をupdate
|
||||
画面の一部を更新
|
||||
updateme(_part)で登録した更新が必要なspriteの和の領域をupdate
|
||||
*/
|
||||
int sp_update_clipped() {
|
||||
MyRectangle r;
|
||||
|
||||
// 更新領域の確定
|
||||
// 更新領域の確定
|
||||
r = get_updatearea();
|
||||
|
||||
// 幅または高さが 0 の時はなにもしない
|
||||
// 幅または高さが 0 の時はなにもしない
|
||||
if (r.width == 0 || r.height == 0) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 更新領域に入っているスプライトの再描画
|
||||
// 更新領域に入っているスプライトの再描画
|
||||
g_slist_foreach(updatelist, do_update_each, &r);
|
||||
|
||||
// 更新領域を Window に転送
|
||||
// 更新領域を Window に転送
|
||||
ags_updateArea(r.x, r.y, r.width, r.height);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
sprite全体の更新を登録
|
||||
@param sp: 更新するスプライト
|
||||
sprite全体の更新を登録
|
||||
@param sp: 更新するスプライト
|
||||
*/
|
||||
int sp_updateme(sprite_t *sp) {
|
||||
MyRectangle *r;
|
||||
@@ -196,12 +196,12 @@ int sp_updateme(sprite_t *sp) {
|
||||
}
|
||||
|
||||
/*
|
||||
spriteの一部更新を登録
|
||||
@param sp: 更新するスプライト
|
||||
@param x: 更新領域X座標
|
||||
@param y: 更新領域Y座標
|
||||
@param w: 更新領域幅
|
||||
@param h: 更新領域高さ
|
||||
spriteの一部更新を登録
|
||||
@param sp: 更新するスプライト
|
||||
@param x: 更新領域X座標
|
||||
@param y: 更新領域Y座標
|
||||
@param w: 更新領域幅
|
||||
@param h: 更新領域高さ
|
||||
*/
|
||||
int sp_updateme_part(sprite_t *sp, int x, int y, int w, int h) {
|
||||
MyRectangle *r;
|
||||
@@ -223,7 +223,7 @@ int sp_updateme_part(sprite_t *sp, int x, int y, int w, int h) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// スプライトの番号順に更新するためにリストに順番に要れるためのcallbck
|
||||
// スプライトの番号順に更新するためにリストに順番に要れるためのcallbck
|
||||
static gint compare_spriteno_smallfirst(gconstpointer a, gconstpointer b) {
|
||||
sprite_t *sp1 = (sprite_t *)a;
|
||||
sprite_t *sp2 = (sprite_t *)b;
|
||||
@@ -245,7 +245,7 @@ void sp_remove_updatelist(sprite_t *sp) {
|
||||
updatelist = g_slist_remove(updatelist, sp);
|
||||
}
|
||||
|
||||
// デフォルトの壁紙update
|
||||
// デフォルトの壁紙update
|
||||
int sp_draw_wall(sprite_t *sp, MyRectangle *area) {
|
||||
int sx, sy, w, h;
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ void Init() {
|
||||
}
|
||||
|
||||
void Run() {
|
||||
int p1 = getCaliValue(); // ¥Ç¥âÈÖ¹æ 0,1,2
|
||||
int p1 = getCaliValue(); // デモ番号 0,1,2
|
||||
int p2 = getCaliValue();
|
||||
|
||||
ndd_run(p1);
|
||||
|
||||
@@ -67,7 +67,7 @@ static void ppm2surface(surface_t *sf, int curscanline, unsigned char *src, int
|
||||
}}
|
||||
}
|
||||
|
||||
// sf0 に直接描く(それでも遅いけど)
|
||||
// sf0 に直接描く(それでも遅いけど)
|
||||
surface_t *jpeg2surface(FILE *fp, int offset) {
|
||||
struct jpeg_decompress_struct cinfo;
|
||||
struct jpeg_error_mgr jerr;
|
||||
|
||||
@@ -51,7 +51,7 @@ static int ndemo_nums[3] = {150, 603, 467};
|
||||
|
||||
extern surface_t *jpeg2surface(FILE *fp, int offset);
|
||||
|
||||
// ALKファイルの登録
|
||||
// ALKファイルの登録
|
||||
void ndd_init(char *files[], int n) {
|
||||
int i;
|
||||
ndd.fn = g_new(char *, n);
|
||||
@@ -61,17 +61,17 @@ void ndd_init(char *files[], int n) {
|
||||
}
|
||||
}
|
||||
|
||||
// デモ本体
|
||||
// デモ本体
|
||||
void ndd_run(int demonum) {
|
||||
FILE *fp;
|
||||
alk_t *alk;
|
||||
int i, start, ct;
|
||||
|
||||
// ファイルオフセットだけ alk からもらう
|
||||
// ファイルオフセットだけ alk からもらう
|
||||
alk = alk_new(ndd.fn[ndemo_alk[demonum]]);
|
||||
if (alk == NULL) return;
|
||||
|
||||
// libjpeg には FILE* を渡す
|
||||
// libjpeg には FILE* を渡す
|
||||
if (NULL == (fp = fopen(ndd.fn[ndemo_alk[demonum]], "rb"))) {
|
||||
WARNING("%s not found\n", ndd.fn[ndemo_alk[demonum]]);
|
||||
return;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* RandMT.c 王子さま Lv1: (おそらく Mersenne Twister使用の)乱数生成
|
||||
* RandMT.c 王子さま Lv1: (おそらく Mersenne Twister使用の)乱数生成
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -33,9 +33,9 @@
|
||||
|
||||
void Init() {
|
||||
/*
|
||||
乱数初期化
|
||||
乱数初期化
|
||||
|
||||
p1: 初期化用 seed
|
||||
p1: 初期化用 seed
|
||||
*/
|
||||
int p1 = getCaliValue(); /* ITimer */
|
||||
|
||||
@@ -44,10 +44,10 @@ void Init() {
|
||||
|
||||
void Get() {
|
||||
/*
|
||||
1 から num までの乱数を生成
|
||||
1 から num までの乱数を生成
|
||||
|
||||
num: 最大値
|
||||
var: 結果を返す変数
|
||||
num: 最大値
|
||||
var: 結果を返す変数
|
||||
*/
|
||||
int num = getCaliValue();
|
||||
int *var = getCaliVariable();
|
||||
|
||||
+429
-429
File diff suppressed because it is too large
Load Diff
+96
-96
@@ -34,20 +34,20 @@
|
||||
#include "variable.h"
|
||||
|
||||
|
||||
// スプライトの最大数
|
||||
// スプライトの最大数
|
||||
#define SPRITEMAX 21845
|
||||
|
||||
// CGの最大数
|
||||
// CGの最大数
|
||||
#define CGMAX 63336
|
||||
|
||||
// メッセージの最大長さ
|
||||
// メッセージの最大長さ
|
||||
#define MSGBUFMAX 257*10
|
||||
|
||||
// 選択肢の最大要素数
|
||||
// 選択肢の最大要素数
|
||||
#define SEL_ELEMENT_MAX 20
|
||||
|
||||
|
||||
// キーウェイトの種類
|
||||
// キーウェイトの種類
|
||||
#define KEYWAIT_NONE 0
|
||||
#define KEYWAIT_SIMPLE 1
|
||||
#define KEYWAIT_SPRITE 2
|
||||
@@ -55,24 +55,24 @@
|
||||
#define KEYWAIT_SELECT 4
|
||||
#define KEYWAIT_BACKLOG 5
|
||||
|
||||
// 文字列置換用
|
||||
// 文字列置換用
|
||||
typedef struct {
|
||||
char *src; // 置き換え元文字列
|
||||
char *dst; // 置き換え文字列
|
||||
char *src; // 置き換え元文字列
|
||||
char *dst; // 置き換え文字列
|
||||
} strexchange_t;
|
||||
|
||||
// SACTEFAM を使ったマスク
|
||||
// SACTEFAM を使ったマスク
|
||||
typedef struct {
|
||||
int fd; // SACTEFAM.KLD のファイルディスクプリタ
|
||||
char *mapadr; // mmap された最初のアドレス
|
||||
off_t size; // mmap した大きさ
|
||||
int datanum; // SACTEFAM.KLD 中のマスクファイルの数
|
||||
int *no; // シナリオ側での番号
|
||||
int *offset; // データへのオフセット
|
||||
int fd; // SACTEFAM.KLD のファイルディスクプリタ
|
||||
char *mapadr; // mmap された最初のアドレス
|
||||
off_t size; // mmap した大きさ
|
||||
int datanum; // SACTEFAM.KLD 中のマスクファイルの数
|
||||
int *no; // シナリオ側での番号
|
||||
int *offset; // データへのオフセット
|
||||
} SACTEFAM_t;
|
||||
|
||||
|
||||
// CG_XX で作るCGの種類
|
||||
// CG_XX で作るCGの種類
|
||||
enum cgtype {
|
||||
CG_NOTUSED = 0,
|
||||
CG_LINKED = 1,
|
||||
@@ -81,16 +81,16 @@ enum cgtype {
|
||||
CG_STRETCH = 4
|
||||
};
|
||||
|
||||
// cgに関する情報
|
||||
// cgに関する情報
|
||||
struct _cginfo {
|
||||
enum cgtype type; // CGの種類, 0: 未使用, 1:リンクされている, ...
|
||||
int no; // CGの番号
|
||||
surface_t *sf; // CG本体
|
||||
int refcnt; // 参照カウンタ。0になったら開放してもよい。
|
||||
enum cgtype type; // CGの種類, 0: 未使用, 1:リンクされている, ...
|
||||
int no; // CGの番号
|
||||
surface_t *sf; // CG本体
|
||||
int refcnt; // 参照カウンタ。0になったら開放してもよい。
|
||||
};
|
||||
typedef struct _cginfo cginfo_t;
|
||||
|
||||
// スプライトのタイプ
|
||||
// スプライトのタイプ
|
||||
enum spritetype {
|
||||
SPRITE_NORMAL = 0,
|
||||
SPRITE_SWITCH = 1,
|
||||
@@ -104,149 +104,149 @@ enum spritetype {
|
||||
SPRITE_NONE =-1
|
||||
};
|
||||
|
||||
// (前方参照用)
|
||||
// (前方参照用)
|
||||
struct _sprite;
|
||||
|
||||
// スプライトに関する各種情報
|
||||
// スプライトに関する各種情報
|
||||
struct _sprite {
|
||||
// スプライトのタイプ
|
||||
// スプライトのタイプ
|
||||
enum spritetype type;
|
||||
|
||||
// スプライト番号
|
||||
// スプライト番号
|
||||
int no;
|
||||
|
||||
// それぞれの状態の時に鳴らすサウンド番号
|
||||
// それぞれの状態の時に鳴らすサウンド番号
|
||||
int numsound1, numsound2, numsound3;
|
||||
|
||||
// 初期 sprite の大きさ(cg1の大きさ)
|
||||
// 初期 sprite の大きさ(cg1の大きさ)
|
||||
MyDimension cursize;
|
||||
|
||||
// それぞれの状態で表示する CG
|
||||
// それぞれの状態で表示する CG
|
||||
cginfo_t *cg1, *cg2, *cg3;
|
||||
|
||||
// update するときに表示するcg
|
||||
// update するときに表示するcg
|
||||
cginfo_t *curcg;
|
||||
|
||||
// スプライトを表示するか
|
||||
// スプライトを表示するか
|
||||
boolean show;
|
||||
boolean show_save; // Zkey hide save用
|
||||
boolean show_save; // Zkey hide save用
|
||||
|
||||
// 表示する際のブレンド率 0:全く見えない, 255: 通常表示
|
||||
// 表示する際のブレンド率 0:全く見えない, 255: 通常表示
|
||||
int blendrate;
|
||||
|
||||
// スプライトが Freeze されているか(0:No 1-3: その番号)
|
||||
// スプライトが Freeze されているか(0:No 1-3: その番号)
|
||||
int freezed_state;
|
||||
|
||||
// 表示位置 (SetPos)
|
||||
// 表示位置 (SetPos)
|
||||
MyPoint loc;
|
||||
|
||||
// 現在のスプライトの表示位置
|
||||
// 現在のスプライトの表示位置
|
||||
MyPoint cur;
|
||||
|
||||
// event callback
|
||||
int (* eventcb)(struct _sprite *sp, agsevent_t *e); // for key/mouse
|
||||
int (* teventcb)(struct _sprite *sp, agsevent_t *e); // for timer
|
||||
// sprite削除時の callback
|
||||
// sprite削除時の callback
|
||||
void (* remove)(struct _sprite *sp);
|
||||
// spriteを再描画するときの callback
|
||||
// spriteを再描画するときの callback
|
||||
int (* update)(struct _sprite *sp);
|
||||
|
||||
boolean focused; // forcusを得ているか
|
||||
boolean pressed; // このsprite上でマウスが押されているか
|
||||
boolean focused; // forcusを得ているか
|
||||
boolean pressed; // このsprite上でマウスが押されているか
|
||||
|
||||
GSList *expsp; // 説明スプライトのリスト
|
||||
GSList *expsp; // 説明スプライトのリスト
|
||||
|
||||
// move command 用パラメータ
|
||||
// move command 用パラメータ
|
||||
struct {
|
||||
MyPoint to; // 移動先
|
||||
int time; // 移動完了時間
|
||||
int speed; // 移動速度
|
||||
int starttime; // 移動開始時刻
|
||||
int endtime; // 移動終了予定時刻
|
||||
boolean moving; // 移動中かどうか
|
||||
MyPoint to; // 移動先
|
||||
int time; // 移動完了時間
|
||||
int speed; // 移動速度
|
||||
int starttime; // 移動開始時刻
|
||||
int endtime; // 移動終了予定時刻
|
||||
boolean moving; // 移動中かどうか
|
||||
} move;
|
||||
|
||||
// SACT.Numeral用パラメータ
|
||||
// SACT.Numeral用パラメータ
|
||||
struct {
|
||||
int cg[10];
|
||||
MyPoint pos;
|
||||
int span;
|
||||
} numeral;
|
||||
|
||||
// スプライトの種類毎の情報
|
||||
// スプライトの種類毎の情報
|
||||
union {
|
||||
// スイッチスプライト
|
||||
// スイッチスプライト
|
||||
struct {
|
||||
|
||||
} sw;
|
||||
|
||||
// ゲットスプライト
|
||||
// ゲットスプライト
|
||||
struct {
|
||||
boolean dragging; // ドラッグ中
|
||||
MyPoint dragstart; // ドラッグ開始位置
|
||||
boolean dragging; // ドラッグ中
|
||||
MyPoint dragstart; // ドラッグ開始位置
|
||||
} get;
|
||||
|
||||
// プットスプライト
|
||||
// プットスプライト
|
||||
struct {
|
||||
|
||||
} put;
|
||||
|
||||
// アニメーションスプライト
|
||||
// アニメーションスプライト
|
||||
struct {
|
||||
int interval; // 1コマの間隔(10msec)
|
||||
int starttime; // 開始時刻
|
||||
int npat; // アニメコマ数(1/2/3)
|
||||
unsigned int tick; // カウンタ
|
||||
int interval; // 1コマの間隔(10msec)
|
||||
int starttime; // 開始時刻
|
||||
int npat; // アニメコマ数(1/2/3)
|
||||
unsigned int tick; // カウンタ
|
||||
} anime;
|
||||
|
||||
// メッセージスプライト
|
||||
// メッセージスプライト
|
||||
struct {
|
||||
GSList *buf; // 表示する文字のリスト
|
||||
surface_t *canvas; // 文字を描画するsurface
|
||||
MyPoint dspcur; // 現在の表示位置
|
||||
GSList *buf; // 表示する文字のリスト
|
||||
surface_t *canvas; // 文字を描画するsurface
|
||||
MyPoint dspcur; // 現在の表示位置
|
||||
} msg;
|
||||
} u;
|
||||
};
|
||||
typedef struct _sprite sprite_t;
|
||||
|
||||
// SACT全体の情報
|
||||
// SACT全体の情報
|
||||
struct _sact {
|
||||
// SACTのバージョン
|
||||
// SACTのバージョン
|
||||
int version;
|
||||
|
||||
// スプライト全体
|
||||
// スプライト全体
|
||||
sprite_t *sp[SPRITEMAX];
|
||||
|
||||
GSList *sp_zhide; // Zキーで消すスプライトのリスト
|
||||
GSList *sp_quake; // Quakeで揺らすスプライトのリスト
|
||||
GSList *sp_zhide; // Zキーで消すスプライトのリスト
|
||||
GSList *sp_quake; // Quakeで揺らすスプライトのリスト
|
||||
|
||||
GSList *updatelist; // 再描画するスプライトのリスト
|
||||
GSList *updatelist; // 再描画するスプライトのリスト
|
||||
|
||||
cginfo_t *cg[CGMAX]; // cgまたはCG_xxで作った CG
|
||||
cginfo_t *cg[CGMAX]; // cgまたはCG_xxで作った CG
|
||||
|
||||
// 座標系の原点
|
||||
// 座標系の原点
|
||||
MyPoint origin;
|
||||
|
||||
// 文字列 push/pop/replce 用
|
||||
// 文字列 push/pop/replce 用
|
||||
GSList *strstack;
|
||||
GSList *strreplace;
|
||||
char *strreplacesrc;
|
||||
char *strreplacedst;
|
||||
|
||||
// メッセージスプライト用メッセージバッファ
|
||||
// メッセージスプライト用メッセージバッファ
|
||||
char msgbuf[MSGBUFMAX];
|
||||
char msgbuf2[MSGBUFMAX];
|
||||
|
||||
// 選択ウィンド
|
||||
// 選択ウィンド
|
||||
struct {
|
||||
char *elem[SEL_ELEMENT_MAX]; // 選択肢文字列
|
||||
int spno; // 背景スプライト番号
|
||||
int font_size; // 選択肢文字サイズ
|
||||
int font_type; // 選択肢フォント
|
||||
int frame_dot; // 枠スプライトの外側からのピクセル数
|
||||
int linespace; // 選択肢の行間
|
||||
int movecursor; // 初期選択
|
||||
int align; // 行そろえ
|
||||
char *elem[SEL_ELEMENT_MAX]; // 選択肢文字列
|
||||
int spno; // 背景スプライト番号
|
||||
int font_size; // 選択肢文字サイズ
|
||||
int font_type; // 選択肢フォント
|
||||
int frame_dot; // 枠スプライトの外側からのピクセル数
|
||||
int linespace; // 選択肢の行間
|
||||
int movecursor; // 初期選択
|
||||
int align; // 行そろえ
|
||||
void (* cbmove)(agsevent_t *);
|
||||
void (* cbrelease)(agsevent_t *);
|
||||
surface_t *charcanvas;
|
||||
@@ -257,21 +257,21 @@ struct _sact {
|
||||
GSList *teventlisteners;
|
||||
GSList *teventremovelist;
|
||||
|
||||
// MOVEするスプライトのリスト
|
||||
// MOVEするスプライトのリスト
|
||||
GSList *movelist;
|
||||
int movestarttime; // 一斉に移動を開始するための開始時間
|
||||
int movestarttime; // 一斉に移動を開始するための開始時間
|
||||
int movecurtime;
|
||||
|
||||
MyRectangle updaterect; // 更新が必要なspriteの領域の和
|
||||
MyRectangle updaterect; // 更新が必要なspriteの領域の和
|
||||
|
||||
// sact timer
|
||||
stimer_t timer[65536];
|
||||
|
||||
// DnDに関するもの
|
||||
sprite_t *draggedsp; // drag中のスプライト
|
||||
boolean dropped; // スプライトがドロップされたかどうか
|
||||
// DnDに関するもの
|
||||
sprite_t *draggedsp; // drag中のスプライト
|
||||
boolean dropped; // スプライトがドロップされたかどうか
|
||||
|
||||
// keywaitの種類
|
||||
// keywaitの種類
|
||||
int waittype;
|
||||
int waitkey;
|
||||
int sp_result_sw;
|
||||
@@ -279,12 +279,12 @@ struct _sact {
|
||||
int sp_result_put;
|
||||
|
||||
// wait skip level
|
||||
// 0 通常キー待ち
|
||||
// 1 既読のみスキップ
|
||||
// 2 未読もスキップ
|
||||
// 0 通常キー待ち
|
||||
// 1 既読のみスキップ
|
||||
// 2 未読もスキップ
|
||||
int waitskiplv;
|
||||
|
||||
// 範囲外をクリックしたときの音
|
||||
// 範囲外をクリックしたときの音
|
||||
int numsoundob;
|
||||
|
||||
// depth map
|
||||
@@ -293,11 +293,11 @@ struct _sact {
|
||||
// SACTEFAM.KLD
|
||||
SACTEFAM_t am;
|
||||
|
||||
boolean zhiding; // Zkeyによる隠し中
|
||||
boolean zhiding; // Zkeyによる隠し中
|
||||
int zofftime;
|
||||
boolean zdooff;
|
||||
|
||||
// バックログ
|
||||
// バックログ
|
||||
boolean logging;
|
||||
GList *log;
|
||||
};
|
||||
|
||||
+11
-11
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sactamask.c: SACTEFAM.KLD 展開
|
||||
* sactamask.c: SACTEFAM.KLD 展開
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -58,7 +58,7 @@ struct ecopyparam {
|
||||
typedef struct ecopyparam ecopyparam_t;
|
||||
static ecopyparam_t ecp;
|
||||
|
||||
// SACTEFAM.KLD の読み込み
|
||||
// SACTEFAM.KLD の読み込み
|
||||
int smask_init(char *path) {
|
||||
struct stat sbuf;
|
||||
int i, fd;
|
||||
@@ -99,7 +99,7 @@ int smask_init(char *path) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 指定番号の alphamask ファイルをよみだす
|
||||
// 指定番号の alphamask ファイルをよみだす
|
||||
static surface_t *smask_get(int no) {
|
||||
int i;
|
||||
SACTEFAM_t *am = &sact.am;
|
||||
@@ -113,7 +113,7 @@ static surface_t *smask_get(int no) {
|
||||
return sf_getcg(am->mapadr + am->offset[i]);
|
||||
}
|
||||
|
||||
// ベースになるマスクの alpha 値を拡大して取り出す
|
||||
// ベースになるマスクの alpha 値を拡大して取り出す
|
||||
static surface_t *smask_mul(surface_t *sf, int val) {
|
||||
surface_t *out = sf_create_alpha(sf->width, sf->height);
|
||||
BYTE *src = sf->alpha;
|
||||
@@ -122,9 +122,9 @@ static surface_t *smask_mul(surface_t *sf, int val) {
|
||||
|
||||
while(pix--) {
|
||||
int i = (*src - val) * 16;
|
||||
if (i < 0) *dst = 255; // 指定値よりも大きいのはコピー
|
||||
else if (i > 255) *dst = 0; // 指定値よりも小さいのは無視
|
||||
else *dst = 255-i; // それ以外は値を16倍
|
||||
if (i < 0) *dst = 255; // 指定値よりも大きいのはコピー
|
||||
else if (i > 255) *dst = 0; // 指定値よりも小さいのは無視
|
||||
else *dst = 255-i; // それ以外は値を16倍
|
||||
src++; dst++;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ static surface_t *smask_mul(surface_t *sf, int val) {
|
||||
}
|
||||
|
||||
/**
|
||||
* マスクつき画面更新
|
||||
* マスクつき画面更新
|
||||
*/
|
||||
int sp_eupdate_amap(int index, int time, int cancel) {
|
||||
surface_t *mask, *mask2;
|
||||
@@ -145,7 +145,7 @@ int sp_eupdate_amap(int index, int time, int cancel) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 現在の sf0 をセーブ
|
||||
// 現在の sf0 をセーブ
|
||||
sfsrc = sf_dup(sf0);
|
||||
sp_update_all(FALSE);
|
||||
sfdst = sf_dup(sf0);
|
||||
@@ -157,7 +157,7 @@ int sp_eupdate_amap(int index, int time, int cancel) {
|
||||
|
||||
while ((ecp.curtime = get_high_counter(SYSTEMCOUNTER_MSEC)) < ecp.edtime) {
|
||||
int curstep = 255 * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime);
|
||||
// 元になるマスクのalpha値を16倍して欲しいところだけ取り出す
|
||||
// 元になるマスクのalpha値を16倍して欲しいところだけ取り出す
|
||||
mask2 = smask_mul(mask, curstep);
|
||||
|
||||
gre_BlendUseAMap(sf0, 0, 0, sfsrc, 0, 0, sfdst, 0, 0, sfsrc->width, sfsrc->height, mask2, 0, 0, 255);
|
||||
@@ -166,7 +166,7 @@ int sp_eupdate_amap(int index, int time, int cancel) {
|
||||
key = sys_keywait(10, cancel);
|
||||
if (cancel && key) break;
|
||||
|
||||
// 一時マスクを削除
|
||||
// 一時マスクを削除
|
||||
sf_free(mask2);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sactamask.h: SACTEFAM.KLD Ÿ³«
|
||||
* sactamask.h: SACTEFAM.KLD 展開
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
|
||||
+10
-10
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sactbgm.c: SACT Music 関連
|
||||
* sactbgm.c: SACT Music 関連
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "ald_manager.h"
|
||||
#include "music_client.h"
|
||||
|
||||
// 指定の番号の音楽が存在するかチェック
|
||||
// 指定の番号の音楽が存在するかチェック
|
||||
int smus_check(int no) {
|
||||
dridata *dfile = ald_getdata(DRIFILE_BGM, no -1);
|
||||
int st = 0;
|
||||
@@ -46,47 +46,47 @@ int smus_check(int no) {
|
||||
return st;
|
||||
}
|
||||
|
||||
// 指定の番号の音楽の長さを取得
|
||||
// 指定の番号の音楽の長さを取得
|
||||
int smus_getlength(int no) {
|
||||
return mus_bgm_getlength(no);
|
||||
}
|
||||
|
||||
// 指定の番号の音楽の再生位置を取得
|
||||
// 指定の番号の音楽の再生位置を取得
|
||||
int smus_getpos(int no) {
|
||||
return mus_bgm_getpos(no);
|
||||
}
|
||||
|
||||
// 指定の番号の音楽の再生開始
|
||||
// 指定の番号の音楽の再生開始
|
||||
int smus_play(int no, int time, int vol) {
|
||||
mus_bgm_play(no, time, vol);
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 指定の番号の音楽の再生停止
|
||||
// 指定の番号の音楽の再生停止
|
||||
int smus_stop(int no, int fadetime) {
|
||||
mus_bgm_stop(no, fadetime);
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 指定の番号の音楽のボリュームフェード
|
||||
// 指定の番号の音楽のボリュームフェード
|
||||
int smus_fade(int no, int time, int vol) {
|
||||
mus_bgm_fade(no, time, vol);
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 指定の番号の音楽が終了するのを待つ
|
||||
// 指定の番号の音楽が終了するのを待つ
|
||||
int smus_wait(int no, int timeout) {
|
||||
mus_bgm_wait(no, timeout);
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 指定の番号の音楽が指定の位置まで再生されるのを待つ
|
||||
// 指定の番号の音楽が指定の位置まで再生されるのを待つ
|
||||
int smus_waitpos(int no, int index) {
|
||||
mus_bgm_waitpos(no, index);
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 全ての音楽の再生を停止
|
||||
// 全ての音楽の再生を停止
|
||||
int smus_stopall(int time) {
|
||||
mus_bgm_stopall(time);
|
||||
return OK;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sactbgm.h: SACT Music ´ØÏ¢
|
||||
* sactbgm.h: SACT Music 関連
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
|
||||
+49
-49
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sactcg.c: CG作成
|
||||
* sactcg.c: CG作成
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -49,15 +49,15 @@
|
||||
|
||||
|
||||
/*
|
||||
cgの読み込み
|
||||
cgの読み込み
|
||||
|
||||
指定の番号のCGをリンクファイルから読み込んだり、
|
||||
CG_xxxで作成したCGを参照する
|
||||
指定の番号のCGをリンクファイルから読み込んだり、
|
||||
CG_xxxで作成したCGを参照する
|
||||
|
||||
@param no: 読み込むCG番号
|
||||
@param refinc: 参照カウンタを増やすかどうか。
|
||||
spriteから参照されるときは増やし、CG_xxxを作る時に
|
||||
参照されるときは増やさない。
|
||||
@param no: 読み込むCG番号
|
||||
@param refinc: 参照カウンタを増やすかどうか。
|
||||
spriteから参照されるときは増やし、CG_xxxを作る時に
|
||||
参照されるときは増やさない。
|
||||
*/
|
||||
cginfo_t *scg_loadcg_no(int no, boolean refinc) {
|
||||
cginfo_t *i;
|
||||
@@ -67,8 +67,8 @@ cginfo_t *scg_loadcg_no(int no, boolean refinc) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// すでに ロードされているか、CG_xxx で作成ずみの場合は
|
||||
// 参照カウンタを増やす
|
||||
// すでに ロードされているか、CG_xxx で作成ずみの場合は
|
||||
// 参照カウンタを増やす
|
||||
if (sact.cg[no] != NULL) {
|
||||
if (refinc) {
|
||||
sact.cg[no]->refcnt++;
|
||||
@@ -93,7 +93,7 @@ cginfo_t *scg_loadcg_no(int no, boolean refinc) {
|
||||
}
|
||||
|
||||
|
||||
// 指定の大きさ、色の矩形の CG を作成
|
||||
// 指定の大きさ、色の矩形の CG を作成
|
||||
int scg_create(int wNumCG, int wWidth, int wHeight, int wR, int wG, int wB, int wBlendRate) {
|
||||
cginfo_t *i;
|
||||
|
||||
@@ -107,7 +107,7 @@ int scg_create(int wNumCG, int wWidth, int wHeight, int wR, int wG, int wB, int
|
||||
gr_fill(i->sf, 0, 0, wWidth, wHeight, wR, wG, wB);
|
||||
gr_fill_alpha_map(i->sf, 0, 0, wWidth, wHeight, wBlendRate);
|
||||
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
scg_free(wNumCG);
|
||||
|
||||
sact.cg[wNumCG] = i;
|
||||
@@ -115,7 +115,7 @@ int scg_create(int wNumCG, int wWidth, int wHeight, int wR, int wG, int wB, int
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 指定のCGを反転させたCGを作成
|
||||
// 指定のCGを反転させたCGを作成
|
||||
int scg_create_reverse(int wNumCG, int wNumSrcCG, int wReverseX, int wReverseY) {
|
||||
cginfo_t *i, *srccg;
|
||||
surface_t *src;
|
||||
@@ -123,7 +123,7 @@ int scg_create_reverse(int wNumCG, int wNumSrcCG, int wReverseX, int wReverseY)
|
||||
spcg_assert_no(wNumCG);
|
||||
spcg_assert_no(wNumSrcCG);
|
||||
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) {
|
||||
return NG;
|
||||
}
|
||||
@@ -135,7 +135,7 @@ int scg_create_reverse(int wNumCG, int wNumSrcCG, int wReverseX, int wReverseY)
|
||||
|
||||
src = srccg->sf;
|
||||
i->sf = stretch(src, src->width, src->height, (wReverseX << 1) | wReverseY);
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
scg_free(wNumCG);
|
||||
|
||||
sact.cg[wNumCG] = i;
|
||||
@@ -143,7 +143,7 @@ int scg_create_reverse(int wNumCG, int wNumSrcCG, int wReverseX, int wReverseY)
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 指定のCGを拡大/縮小したCGを作成
|
||||
// 指定のCGを拡大/縮小したCGを作成
|
||||
int scg_create_stretch(int wNumCG, int wWidth, int wHeight, int wNumSrcCG) {
|
||||
cginfo_t *i, *srccg;
|
||||
surface_t *src;
|
||||
@@ -151,7 +151,7 @@ int scg_create_stretch(int wNumCG, int wWidth, int wHeight, int wNumSrcCG) {
|
||||
spcg_assert_no(wNumCG);
|
||||
spcg_assert_no(wNumSrcCG);
|
||||
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) {
|
||||
return NG;
|
||||
}
|
||||
@@ -164,7 +164,7 @@ int scg_create_stretch(int wNumCG, int wWidth, int wHeight, int wNumSrcCG) {
|
||||
src = srccg->sf;
|
||||
i->sf = stretch(src, wWidth, wHeight, 0);
|
||||
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
scg_free(wNumCG);
|
||||
|
||||
sact.cg[wNumCG] = i;
|
||||
@@ -172,7 +172,7 @@ int scg_create_stretch(int wNumCG, int wWidth, int wHeight, int wNumSrcCG) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// ベースCGの上にブレンドCGを重ねた CG を作成
|
||||
// ベースCGの上にブレンドCGを重ねた CG を作成
|
||||
int scg_create_blend(int wNumDstCG, int wNumBaseCG, int wX, int wY, int wNumBlendCG, int wAlphaMapMode) {
|
||||
cginfo_t *i, *basecg, *blendcg;
|
||||
|
||||
@@ -180,7 +180,7 @@ int scg_create_blend(int wNumDstCG, int wNumBaseCG, int wX, int wY, int wNumBlen
|
||||
spcg_assert_no(wNumBaseCG);
|
||||
spcg_assert_no(wNumBlendCG);
|
||||
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
basecg = scg_loadcg_no(wNumBaseCG, FALSE);
|
||||
blendcg = scg_loadcg_no(wNumBlendCG, FALSE);
|
||||
if (basecg == NULL || blendcg == NULL) return NG;
|
||||
@@ -192,7 +192,7 @@ int scg_create_blend(int wNumDstCG, int wNumBaseCG, int wX, int wY, int wNumBlen
|
||||
|
||||
i->sf = blend(basecg->sf, wX , wY, blendcg->sf, wAlphaMapMode);
|
||||
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
scg_free(wNumDstCG);
|
||||
|
||||
sact.cg[wNumDstCG] = i;
|
||||
@@ -200,7 +200,7 @@ int scg_create_blend(int wNumDstCG, int wNumBaseCG, int wX, int wY, int wNumBlen
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 指定の文字列のCGを作成
|
||||
// 指定の文字列のCGを作成
|
||||
int scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, int wText) {
|
||||
cginfo_t *i;
|
||||
agsurface_t *glyph;
|
||||
@@ -214,7 +214,7 @@ int scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, int wText) {
|
||||
|
||||
spcg_assert_no(wNumCG);
|
||||
|
||||
// 勝手に出ていいのかな?
|
||||
// 勝手に出ていいのかな?
|
||||
if (v_strlen(wText -1) == 0) return OK;
|
||||
|
||||
font = nact->ags.font;
|
||||
@@ -230,7 +230,7 @@ int scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, int wText) {
|
||||
gr_fill(i->sf, 0, 0, glyph->width, wSize, wR, wG, wB);
|
||||
gr_draw_amap(i->sf, 0, 0, glyph->pixel, glyph->width, wSize, glyph->bytes_per_line);
|
||||
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
scg_free(wNumCG);
|
||||
|
||||
sact.cg[wNumCG] = i;
|
||||
@@ -238,7 +238,7 @@ int scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, int wText) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 数字文字列のCGを作成
|
||||
// 数字文字列のCGを作成
|
||||
int scg_create_textnum(int wNumCG, int wSize, int wR, int wG, int wB, int wFigs, int wZeroPadding, int wValue) {
|
||||
cginfo_t *i;
|
||||
agsurface_t *glyph;
|
||||
@@ -268,7 +268,7 @@ int scg_create_textnum(int wNumCG, int wSize, int wR, int wG, int wB, int wFigs,
|
||||
gr_fill(i->sf, 0, 0, glyph->width, wSize, wR, wG, wB);
|
||||
gr_draw_amap(i->sf, 0, 0, glyph->pixel, glyph->width, wSize, glyph->bytes_per_line);
|
||||
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
scg_free(wNumCG);
|
||||
|
||||
sact.cg[wNumCG] = i;
|
||||
@@ -276,14 +276,14 @@ int scg_create_textnum(int wNumCG, int wSize, int wR, int wG, int wB, int wFigs,
|
||||
return OK;
|
||||
}
|
||||
|
||||
// CGを複製
|
||||
// CGを複製
|
||||
int scg_copy(int wNumDstCG, int wNumSrcCG) {
|
||||
cginfo_t *i, *srccg;
|
||||
|
||||
spcg_assert_no(wNumDstCG);
|
||||
spcg_assert_no(wNumSrcCG);
|
||||
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) {
|
||||
return NG;
|
||||
}
|
||||
@@ -294,7 +294,7 @@ int scg_copy(int wNumDstCG, int wNumSrcCG) {
|
||||
i->refcnt = 0;
|
||||
i->sf = sf_dup(srccg->sf);
|
||||
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
scg_free(wNumDstCG);
|
||||
|
||||
sact.cg[wNumDstCG] = i;
|
||||
@@ -302,7 +302,7 @@ int scg_copy(int wNumDstCG, int wNumSrcCG) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// CGの一部を切りぬいたCGを作成
|
||||
// CGの一部を切りぬいたCGを作成
|
||||
int scg_cut(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeight) {
|
||||
cginfo_t *i, *srccg;
|
||||
surface_t *dst, *src;
|
||||
@@ -310,7 +310,7 @@ int scg_cut(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeigh
|
||||
spcg_assert_no(wNumDstCG);
|
||||
spcg_assert_no(wNumSrcCG);
|
||||
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) {
|
||||
return NG;
|
||||
}
|
||||
@@ -335,7 +335,7 @@ int scg_cut(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeigh
|
||||
|
||||
i->sf = dst;
|
||||
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
scg_free(wNumDstCG);
|
||||
|
||||
sact.cg[wNumDstCG] = i;
|
||||
@@ -343,7 +343,7 @@ int scg_cut(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeigh
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 元のCGの一部を切りぬいたCGを作成
|
||||
// 元のCGの一部を切りぬいたCGを作成
|
||||
int scg_partcopy(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeight) {
|
||||
cginfo_t *i, *srccg;
|
||||
surface_t *dst, *src;
|
||||
@@ -351,7 +351,7 @@ int scg_partcopy(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int w
|
||||
spcg_assert_no(wNumDstCG);
|
||||
spcg_assert_no(wNumSrcCG);
|
||||
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
// 元にするCGを参照 (LINKCGなら読み込み)
|
||||
if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) {
|
||||
return NG;
|
||||
}
|
||||
@@ -378,7 +378,7 @@ int scg_partcopy(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int w
|
||||
|
||||
i->sf = dst;
|
||||
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
// もし前に作成したものがあり、未開放の場合は開放
|
||||
scg_free(wNumDstCG);
|
||||
|
||||
sact.cg[wNumDstCG] = i;
|
||||
@@ -386,7 +386,7 @@ int scg_partcopy(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int w
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 全てのCGの開放
|
||||
// 全てのCGの開放
|
||||
int scg_freeall() {
|
||||
int i;
|
||||
|
||||
@@ -397,8 +397,8 @@ int scg_freeall() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定の番号の CG をオブジェクトリストから消し、オブジェクトがどこからも参照
|
||||
* されていない(参照数が0の)場合のみ、オブジェクトを削除
|
||||
* 指定の番号の CG をオブジェクトリストから消し、オブジェクトがどこからも参照
|
||||
* されていない(参照数が0の)場合のみ、オブジェクトを削除
|
||||
*/
|
||||
int scg_free(int no) {
|
||||
cginfo_t *cg;
|
||||
@@ -407,36 +407,36 @@ int scg_free(int no) {
|
||||
|
||||
if (NULL == (cg = sact.cg[no])) return NG;
|
||||
|
||||
// 参照数が0の時のみオブジェクトを開放
|
||||
// 参照数が0の時のみオブジェクトを開放
|
||||
if (cg->refcnt == 0) {
|
||||
scg_free_cgobj(cg);
|
||||
}
|
||||
|
||||
// 番号で消したときはオブジェクトが開放されなくても
|
||||
// オブジェクトリストから削除
|
||||
// 番号で消したときはオブジェクトが開放されなくても
|
||||
// オブジェクトリストから削除
|
||||
sact.cg[no] = NULL;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* CG オブジェクトの開放
|
||||
* CG オブジェクトの開放
|
||||
*/
|
||||
int scg_free_cgobj(cginfo_t *cg) {
|
||||
if (cg == NULL) return NG;
|
||||
|
||||
(cg->refcnt)--;
|
||||
// 他でまだ参照していれば開放しない
|
||||
// 他でまだ参照していれば開放しない
|
||||
if (cg->refcnt > 0) {
|
||||
return NG;
|
||||
}
|
||||
|
||||
// CG本体の開放
|
||||
// CG本体の開放
|
||||
if (cg->sf) {
|
||||
sf_free(cg->sf);
|
||||
}
|
||||
|
||||
// 削除するオブジェクトを参照しているオブジェクトリストも削除
|
||||
// 削除するオブジェクトを参照しているオブジェクトリストも削除
|
||||
if (cg == sact.cg[cg->no]) {
|
||||
sact.cg[cg->no] = NULL;
|
||||
}
|
||||
@@ -446,7 +446,7 @@ int scg_free_cgobj(cginfo_t *cg) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// CGの種類を取得
|
||||
// CGの種類を取得
|
||||
int scg_querytype(int wNumCG, int *ret) {
|
||||
if (wNumCG >= (CGMAX -1)) goto errexit;
|
||||
if (sact.cg[wNumCG] == NULL) goto errexit;
|
||||
@@ -460,7 +460,7 @@ int scg_querytype(int wNumCG, int *ret) {
|
||||
return NG;
|
||||
}
|
||||
|
||||
// CGの大きさを取得
|
||||
// CGの大きさを取得
|
||||
int scg_querysize(int wNumCG, int *w, int *h) {
|
||||
if (wNumCG >= (CGMAX -1)) goto errexit;
|
||||
if (sact.cg[wNumCG] == NULL) goto errexit;
|
||||
@@ -476,7 +476,7 @@ int scg_querysize(int wNumCG, int *w, int *h) {
|
||||
return NG;
|
||||
}
|
||||
|
||||
// CGのBPPを取得
|
||||
// CGのBPPを取得
|
||||
int scg_querybpp(int wNumCG, int *ret) {
|
||||
if (wNumCG >= (CGMAX -1)) goto errexit;
|
||||
if (sact.cg[wNumCG] == NULL) goto errexit;
|
||||
@@ -491,7 +491,7 @@ int scg_querybpp(int wNumCG, int *ret) {
|
||||
return NG;
|
||||
}
|
||||
|
||||
// CGの alphamap が存在するかを取得
|
||||
// CGの alphamap が存在するかを取得
|
||||
int scg_existalphamap(int wNumCG, int *ret) {
|
||||
if (wNumCG >= (CGMAX -1)) goto errexit;
|
||||
if (sact.cg[wNumCG] == NULL) goto errexit;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sactcg.h: CGºîÀ®
|
||||
* sactcg.h: CG作成
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
|
||||
@@ -5,22 +5,22 @@ static surface_t *blend(surface_t *base, int x, int y, surface_t *blend, int mod
|
||||
gr_copy(dst, 0, 0, base, 0, 0, base->width, base->height);
|
||||
|
||||
if (base->has_alpha) {
|
||||
// ベースに alpha map がある場合はそれをコピー
|
||||
// ベースに alpha map がある場合はそれをコピー
|
||||
gr_copy_alpha_map(dst, 0, 0, base, 0, 0, base->width, base->height);
|
||||
} else {
|
||||
// 無い場合は全て 255 の map を作成
|
||||
// 無い場合は全て 255 の map を作成
|
||||
gr_fill_alpha_map(dst, 0, 0, base->width, base->height, 255);
|
||||
}
|
||||
|
||||
if (blend->has_alpha) {
|
||||
// 重ね合わせ先の alpha map があるときはそれを使う
|
||||
// 重ね合わせ先の alpha map があるときはそれを使う
|
||||
gre_BlendUseAMap(dst, x, y, base, x, y, blend, 0, 0, blend->width, blend->height, blend, 0, 0, 255);
|
||||
} else {
|
||||
// 無いときは dst の alpha map を使う
|
||||
// 無いときは dst の alpha map を使う
|
||||
gre_BlendUseAMap(dst, x, y, base, x, y, blend, 0, 0, blend->width, blend->height, dst, x, y, 255);
|
||||
}
|
||||
|
||||
// alpha 作成モードが dst + blend の時は飽和加算
|
||||
// alpha 作成モードが dst + blend の時は飽和加算
|
||||
if (mode == 1) {
|
||||
gr_saturadd_alpha_map(dst, x, y, blend, 0, 0, blend->width, blend->height);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// 拡大縮小
|
||||
// 拡大縮小
|
||||
static surface_t *stretch(surface_t *src, int dw, int dh, int mirror) {
|
||||
surface_t *dst = g_new0(surface_t, 1);
|
||||
float a1, a2, xd, yd;
|
||||
@@ -31,12 +31,12 @@ static surface_t *stretch(surface_t *src, int dw, int dh, int mirror) {
|
||||
a1 = (float)sw / (float)dw;
|
||||
a2 = (float)sh / (float)dh;
|
||||
row = g_new(int, dw);
|
||||
// 1おおきくして初期化しないと col[dw-1]とcol[dw]が同じになる
|
||||
// 可能性がある。
|
||||
// 1おおきくして初期化しないと col[dw-1]とcol[dw]が同じになる
|
||||
// 可能性がある。
|
||||
col = g_new0(int, dh +1);
|
||||
|
||||
if (mirror & 1) {
|
||||
/* 上下反転 added by tajiri@wizard */
|
||||
/* 上下反転 added by tajiri@wizard */
|
||||
for (yd = sh - a2, y = 0; y < dh; y++) {
|
||||
col[y] = yd; yd -= a2;
|
||||
}
|
||||
@@ -46,7 +46,7 @@ static surface_t *stretch(surface_t *src, int dw, int dh, int mirror) {
|
||||
}
|
||||
}
|
||||
if (mirror & 2) {
|
||||
/* 左右反転 added by tajiri@wizard */
|
||||
/* 左右反転 added by tajiri@wizard */
|
||||
for (xd = sw - a1, x = 0; x < dw; x++) {
|
||||
row[x] = xd; xd -= a1;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sactchart.c: SACT.ChartPos 処理
|
||||
* sactchart.c: SACT.ChartPos 処理
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <stdio.h>
|
||||
#include "portab.h"
|
||||
|
||||
// グラフ用チャート作成
|
||||
// グラフ用チャート作成
|
||||
int schart_pos(int *pos, int pos1, int pos2, int val1, int val2, int val) {
|
||||
if (val1 == val2) {
|
||||
*pos = 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sactchart.h: SACT.ChartPos ½èÍý
|
||||
* sactchart.h: SACT.ChartPos 処理
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sactcrypt.c: SACTの暗号化関連
|
||||
* sactcrypt.c: SACTの暗号化関連
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -28,8 +28,8 @@
|
||||
#include "variable.h"
|
||||
|
||||
/*
|
||||
多分、セーブ時に暗号化して、ロード時に復号化するので
|
||||
適当でいいとおもう
|
||||
多分、セーブ時に暗号化して、ロード時に復号化するので
|
||||
適当でいいとおもう
|
||||
*/
|
||||
|
||||
int scryp_encrypt_word(int *array, int num, int key) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sactcrypt.h: SACT¤Î°Å¹æ²½´ØÏ¢
|
||||
* sactcrypt.h: SACTの暗号化関連
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sactlog.c: バックログ
|
||||
* sactlog.c: バックログ
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -43,9 +43,9 @@
|
||||
#include "sactlog_sjismsg.c"
|
||||
|
||||
/*
|
||||
ホイールで上下スクロール
|
||||
ESCキーで終了
|
||||
PageUP/Downで1ページ送り
|
||||
ホイールで上下スクロール
|
||||
ESCキーで終了
|
||||
PageUP/Downで1ページ送り
|
||||
*/
|
||||
|
||||
#define FONTSIZEINDEX 10
|
||||
@@ -64,13 +64,13 @@ static void draw_log() {
|
||||
// canvas clear
|
||||
memset(chr->pixel, 0, chr->bytes_per_line * chr->height);
|
||||
|
||||
// ページ位置情報
|
||||
// ページ位置情報
|
||||
len = g_snprintf(pinfo, sizeof(pinfo) -1, "%d/%d", curline, g_list_length(sact.log));
|
||||
|
||||
dt_setfont(FONT_GOTHIC, FONTSIZEINDEX);
|
||||
dt_drawtext(chr, sf0->width - FONTSIZEINDEX *len /2, 0, pinfo);
|
||||
|
||||
// 表示始め位置
|
||||
// 表示始め位置
|
||||
node = g_list_nth(sact.log, g_list_length(sact.log) - curline);
|
||||
for (i = 0; i < LOGLINENUM; i++) {
|
||||
char *str, *streuc;
|
||||
@@ -103,7 +103,7 @@ static void draw_log() {
|
||||
|
||||
|
||||
int sblog_start(void) {
|
||||
// 説明文章を追加
|
||||
// 説明文章を追加
|
||||
sact.log = g_list_append(sact.log, "\n");
|
||||
sact.log = g_list_append(sact.log, LOGMSG1);
|
||||
sact.log = g_list_append(sact.log, LOGMSG2);
|
||||
@@ -128,7 +128,7 @@ int sblog_end(void) {
|
||||
sf_free(back);
|
||||
sf_free(chr);
|
||||
|
||||
// 説明文章を削除
|
||||
// 説明文章を削除
|
||||
for (i = 0; i < 6; i++) {
|
||||
node = g_list_last(sact.log);
|
||||
sact.log = g_list_remove(sact.log, node->data);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sactlog.h: ¥Ð¥Ã¥¯¥í¥°
|
||||
* sactlog.h: バックログ
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
|
||||
+16
-16
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sactsound.c: SACTの効果音関連
|
||||
* sactsound.c: SACTの効果音関連
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -35,13 +35,13 @@
|
||||
#include "music_client.h"
|
||||
#include "sact.h"
|
||||
|
||||
// slot番号の 1から 20を SACT用に使用
|
||||
// slot番号の 1から 20を SACT用に使用
|
||||
#define CACHEMAX 20
|
||||
#define SLOTOFFSET 1
|
||||
static int cache[CACHEMAX];
|
||||
static int cachei;
|
||||
|
||||
// 再生する効果音用の空いているスロットを探す
|
||||
// 再生する効果音用の空いているスロットを探す
|
||||
static int slt_getnext(int no) {
|
||||
int indx;
|
||||
|
||||
@@ -52,7 +52,7 @@ static int slt_getnext(int no) {
|
||||
return indx + SLOTOFFSET;
|
||||
}
|
||||
|
||||
// 指定の番号の効果音が入っているスロットを探す
|
||||
// 指定の番号の効果音が入っているスロットを探す
|
||||
static int slt_find(int no) {
|
||||
int i;
|
||||
|
||||
@@ -63,15 +63,15 @@ static int slt_find(int no) {
|
||||
}
|
||||
|
||||
/*
|
||||
SACT 効果音 subsystem 初期化
|
||||
SACT 効果音 subsystem 初期化
|
||||
*/
|
||||
int ssnd_init() {
|
||||
// ch 1-8 をキャッシュとして使おう
|
||||
// ch 1-8 をキャッシュとして使おう
|
||||
cachei = 0;
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 指定の番号の効果音をメモリに読み込み
|
||||
// 指定の番号の効果音をメモリに読み込み
|
||||
int ssnd_prepare(int no) {
|
||||
int slot = slt_find(no);
|
||||
|
||||
@@ -83,7 +83,7 @@ int ssnd_prepare(int no) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 指定の番号の効果音を再生
|
||||
// 指定の番号の効果音を再生
|
||||
int ssnd_play(int no) {
|
||||
int slot = slt_find(no);
|
||||
|
||||
@@ -96,7 +96,7 @@ int ssnd_play(int no) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 指定の番号の効果音を再生停止
|
||||
// 指定の番号の効果音を再生停止
|
||||
int ssnd_stop(int no, int fadetime) {
|
||||
int slot = slt_find(no);
|
||||
|
||||
@@ -108,7 +108,7 @@ int ssnd_stop(int no, int fadetime) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 指定の番号の効果音が再生終了するのを待つ
|
||||
// 指定の番号の効果音が再生終了するのを待つ
|
||||
int ssnd_wait(int no) {
|
||||
int slot = slt_find(no);
|
||||
|
||||
@@ -119,7 +119,7 @@ int ssnd_wait(int no) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 指定の効果音が終了するか、キーが押されるまで待つ
|
||||
// 指定の効果音が終了するか、キーが押されるまで待つ
|
||||
int ssnd_waitkey(int no, int *res) {
|
||||
int slot = slt_find(no);
|
||||
|
||||
@@ -152,13 +152,13 @@ int ssnd_waitkey(int no, int *res) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 左右チャンネルの反転した効果音をメモリに読み込む
|
||||
// 左右チャンネルの反転した効果音をメモリに読み込む
|
||||
int ssnd_prepareLRrev(int no) {
|
||||
mus_wav_load_lrsw(30, no); // slot は 30固定でいい?
|
||||
mus_wav_load_lrsw(30, no); // slot は 30固定でいい?
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 左右チャンネルの反転した効果音を再生
|
||||
// 左右チャンネルの反転した効果音を再生
|
||||
int ssnd_playLRrev(int no) {
|
||||
mus_wav_load_lrsw(30, no);
|
||||
mus_wav_play(30, 1);
|
||||
@@ -166,13 +166,13 @@ int ssnd_playLRrev(int no) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 指定の番号の効果音が存在するかどうかをチェック
|
||||
// 指定の番号の効果音が存在するかどうかをチェック
|
||||
int ssnd_getlinknum(int no) {
|
||||
WARNING("NOT IMPLEMENTED\n");
|
||||
return OK;
|
||||
}
|
||||
|
||||
// すべての再生中の効果音が再生を終了するのを待つ
|
||||
// すべての再生中の効果音が再生を終了するのを待つ
|
||||
int ssnd_stopall(int time) {
|
||||
int i;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sactsound.h: SACT¤Î¸ú²Ì²»´ØÏ¢
|
||||
* sactsound.h: SACTの効果音関連
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
|
||||
+12
-12
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sactstring.c: SACTの文字列操作関連
|
||||
* sactstring.c: SACTの文字列操作関連
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -31,12 +31,12 @@
|
||||
#include "sact.h"
|
||||
|
||||
#define DEFSTACKSIZE 100
|
||||
static char **stack; // stack本体
|
||||
static char **stack; // stack本体
|
||||
static int idx; // stack pointer
|
||||
static int idxmax; // stack pointerの最大
|
||||
static int idxmax; // stack pointerの最大
|
||||
|
||||
/**
|
||||
* 文字列変数スタックの初期化
|
||||
* 文字列変数スタックの初期化
|
||||
*/
|
||||
int sstr_init() {
|
||||
stack = g_new(char *, DEFSTACKSIZE);
|
||||
@@ -46,8 +46,8 @@ int sstr_init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 文字列変数スタックに文字列を積む
|
||||
* @param strno: シナリオ上での文字列変数番号
|
||||
* 文字列変数スタックに文字列を積む
|
||||
* @param strno: シナリオ上での文字列変数番号
|
||||
*/
|
||||
int sstr_push(int strno) {
|
||||
if (idx >= idxmax) {
|
||||
@@ -61,8 +61,8 @@ int sstr_push(int strno) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 文字列変数スタックから文字列を取り出す
|
||||
* @param strno: スタックから戻した文字列を格納する文字列変数番号
|
||||
* 文字列変数スタックから文字列を取り出す
|
||||
* @param strno: スタックから戻した文字列を格納する文字列変数番号
|
||||
*/
|
||||
int sstr_pop(int strno) {
|
||||
if (idx == 0) return NG;
|
||||
@@ -74,9 +74,9 @@ int sstr_pop(int strno) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 文字列の置き換え
|
||||
* @param sstrno: 変換元文字列変数番号
|
||||
* @param dstrno: 変換先文字列変数番号
|
||||
* 文字列の置き換え
|
||||
* @param sstrno: 変換元文字列変数番号
|
||||
* @param dstrno: 変換先文字列変数番号
|
||||
*/
|
||||
int sstr_regist_replace(int sstrno, int dstrno) {
|
||||
strexchange_t *ex;
|
||||
@@ -91,7 +91,7 @@ int sstr_regist_replace(int sstrno, int dstrno) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 数値 -> 文字列化
|
||||
* 数値 -> 文字列化
|
||||
*/
|
||||
int sstr_num2str(int strno, int fig, int nzeropad, int num) {
|
||||
char s[256], ss[256];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sactstring.h: SACT¤Îʸ»úÎóÁàºî´ØÏ¢
|
||||
* sactstring.h: SACTの文字列操作関連
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sacttimer.c: SACTのタイマ関連
|
||||
* sacttimer.c: SACTのタイマ関連
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -30,21 +30,21 @@
|
||||
#include "sacttimer.h"
|
||||
|
||||
/*
|
||||
sact timer subsystem 初期化
|
||||
sact timer subsystem 初期化
|
||||
*/
|
||||
int stimer_init() {
|
||||
stimer_reset(0, 0);
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 指定IDのタイマーのリセット
|
||||
// 指定IDのタイマーのリセット
|
||||
int stimer_reset(int id, int val) {
|
||||
gettimeofday(&(sact.timer[id].tv_base), NULL);
|
||||
sact.timer[id].val = val;
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 指定IDのタイマーの取得
|
||||
// 指定IDのタイマーの取得
|
||||
int stimer_get(int id) {
|
||||
long sec, usec, usec2;
|
||||
struct timeval tv;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sacttimer.h: SACT¤Î¥¿¥¤¥Þ´ØÏ¢
|
||||
* sacttimer.h: SACTのタイマ関連
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
|
||||
+11
-11
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* screen_quake.c: スクリーン全体を揺らす
|
||||
* screen_quake.c: スクリーン全体を揺らす
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
typedef void entrypoint (double step, int p1, int p2, int *retx, int *rety);
|
||||
|
||||
// 上下左右方向の揺らし
|
||||
// 上下左右方向の揺らし
|
||||
static void quake0(double step, int ampx, int ampy, int *adjx, int *adjy) {
|
||||
static int i = 0;
|
||||
|
||||
@@ -53,7 +53,7 @@ static void quake0(double step, int ampx, int ampy, int *adjx, int *adjy) {
|
||||
i++;
|
||||
}
|
||||
|
||||
// 回転の揺らし
|
||||
// 回転の揺らし
|
||||
static void quake1(double curstep, int diam, int round, int *adjx, int *adjy) {
|
||||
double R = (1 - curstep) * diam / 2;
|
||||
double th = curstep * 2 * M_PI * round;
|
||||
@@ -63,14 +63,14 @@ static void quake1(double curstep, int diam, int round, int *adjx, int *adjy) {
|
||||
}
|
||||
|
||||
/*
|
||||
画面揺らし
|
||||
@param wType: 0=縦横, 1:回転
|
||||
@param wParam1: wType=0のときx方向の振幅
|
||||
wType=1のとき振幅
|
||||
@param wParam2: wType=0のときy方向の振幅
|
||||
wType=1のとき回転数
|
||||
@param wCount: 時間(1/100秒)
|
||||
@param nfKeyEnable: キー抜け (1で有効)
|
||||
画面揺らし
|
||||
@param wType: 0=縦横, 1:回転
|
||||
@param wParam1: wType=0のときx方向の振幅
|
||||
wType=1のとき振幅
|
||||
@param wParam2: wType=0のときy方向の振幅
|
||||
wType=1のとき回転数
|
||||
@param wCount: 時間(1/100秒)
|
||||
@param nfKeyEnable: キー抜け (1で有効)
|
||||
*/
|
||||
int sp_quake_screen(int type, int p1, int p2, int time, int cancel) {
|
||||
int sttime, edtime, curtime;
|
||||
|
||||
+85
-85
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sprite.c: スプライト基本各種処理
|
||||
* sprite.c: スプライト基本各種処理
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -56,7 +56,7 @@ static gint compare_spriteno_smallfirst(gconstpointer a, gconstpointer b);
|
||||
}G_STMT_END
|
||||
|
||||
|
||||
// スプライトの番号順に更新するためにリストに順番に要れるためのcallbck
|
||||
// スプライトの番号順に更新するためにリストに順番に要れるためのcallbck
|
||||
static gint compare_spriteno_smallfirst(gconstpointer a, gconstpointer b) {
|
||||
sprite_t *sp1 = (sprite_t *)a;
|
||||
sprite_t *sp2 = (sprite_t *)b;
|
||||
@@ -70,7 +70,7 @@ static gint compare_spriteno_smallfirst(gconstpointer a, gconstpointer b) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// デフォルトの壁紙update
|
||||
// デフォルトの壁紙update
|
||||
static int sp_draw_wall(sprite_t *sp) {
|
||||
int sx, sy, w, h;
|
||||
|
||||
@@ -87,14 +87,14 @@ static int sp_draw_wall(sprite_t *sp) {
|
||||
}
|
||||
|
||||
/**
|
||||
* sprite 関連の初期化
|
||||
* sprite 関連の初期化
|
||||
* @param none
|
||||
* @return OK:成功, NG:失敗
|
||||
* @return OK:成功, NG:失敗
|
||||
*/
|
||||
int sp_init() {
|
||||
int i;
|
||||
|
||||
// DLL用メッセージ表示
|
||||
// DLL用メッセージ表示
|
||||
nact->msgout = smsg_add;
|
||||
|
||||
// mouse/key event handler
|
||||
@@ -103,7 +103,7 @@ int sp_init() {
|
||||
// main callback
|
||||
nact->callback = spev_main;
|
||||
|
||||
// いろいろな理由から全てのスプライトをあらかじめ作成しておく
|
||||
// いろいろな理由から全てのスプライトをあらかじめ作成しておく
|
||||
for (i = 0; i < SPRITEMAX; i++) {
|
||||
sact.sp[i] = g_new0(sprite_t, 1);
|
||||
sact.sp[i]->no = i;
|
||||
@@ -111,22 +111,22 @@ int sp_init() {
|
||||
sact.sp[i]->show = FALSE;
|
||||
}
|
||||
|
||||
// 壁紙(スプライト番号0)はデフォルトへ
|
||||
// 壁紙(スプライト番号0)はデフォルトへ
|
||||
sp_set_wall_paper(0);
|
||||
|
||||
// 壁紙を updateリストに追加
|
||||
// 壁紙を updateリストに追加
|
||||
sact.updatelist = g_slist_append(sact.updatelist, sact.sp[0]);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新規スプライトの作成
|
||||
* @param no: スプライト番号
|
||||
* @param cg1: 1枚目のCG
|
||||
* @param cg2: 2枚目のCG (ない場合は0)
|
||||
* @param cg3: 3枚目のCG (ない場合は0)
|
||||
* @param type: スプライトの種類
|
||||
* 新規スプライトの作成
|
||||
* @param no: スプライト番号
|
||||
* @param cg1: 1枚目のCG
|
||||
* @param cg2: 2枚目のCG (ない場合は0)
|
||||
* @param cg3: 3枚目のCG (ない場合は0)
|
||||
* @param type: スプライトの種類
|
||||
*/
|
||||
int sp_new(int no, int cg1, int cg2, int cg3, int type) {
|
||||
sprite_t *sp;
|
||||
@@ -139,27 +139,27 @@ int sp_new(int no, int cg1, int cg2, int cg3, int type) {
|
||||
sp_free(no);
|
||||
}
|
||||
|
||||
// 更新リストに登録
|
||||
// 更新リストに登録
|
||||
sact.updatelist = g_slist_insert_sorted(sact.updatelist, sp, compare_spriteno_smallfirst);
|
||||
|
||||
sp->type = type;
|
||||
sp->no = no;
|
||||
|
||||
// set時点でのcgが使用される(draw時ではない)
|
||||
// set時点でのcgが使用される(draw時ではない)
|
||||
if (cg1) sp->cg1 = scg_loadcg_no(cg1, TRUE); else sp->cg1 = NULL;
|
||||
if (cg2) sp->cg2 = scg_loadcg_no(cg2, TRUE); else sp->cg2 = NULL;
|
||||
if (cg3) sp->cg3 = scg_loadcg_no(cg3, TRUE); else sp->cg3 = NULL;
|
||||
|
||||
//初期のcurcgはcg1
|
||||
//初期のcurcgはcg1
|
||||
sp->curcg = sp->cg1;
|
||||
|
||||
sp->show = TRUE; // 初期状態は表示
|
||||
sp->blendrate = 255; // ブレンド無し
|
||||
sp->loc.x = 0; // 初期表示位置は(0,0)
|
||||
sp->show = TRUE; // 初期状態は表示
|
||||
sp->blendrate = 255; // ブレンド無し
|
||||
sp->loc.x = 0; // 初期表示位置は(0,0)
|
||||
sp->loc.y = 0;
|
||||
sp->cur = sp->loc;
|
||||
|
||||
// cg1の大きさをスプライトの大きさとする
|
||||
// cg1の大きさをスプライトの大きさとする
|
||||
if (sp->curcg == NULL) {
|
||||
sp->cursize.width = 0;
|
||||
sp->cursize.height = 0;
|
||||
@@ -168,10 +168,10 @@ int sp_new(int no, int cg1, int cg2, int cg3, int type) {
|
||||
sp->cursize.height = sp->curcg->sf->height;
|
||||
}
|
||||
|
||||
sp->freezed_state = 0; // 状態固定は無し
|
||||
sp->update = DEFAULT_UPDATE; // default の updateルーチン
|
||||
sp->freezed_state = 0; // 状態固定は無し
|
||||
sp->update = DEFAULT_UPDATE; // default の updateルーチン
|
||||
|
||||
// 各スプライトタイプ毎の初期化
|
||||
// 各スプライトタイプ毎の初期化
|
||||
switch(type) {
|
||||
case SPRITE_SWITCH:
|
||||
sp_sw_setup(sp);
|
||||
@@ -195,7 +195,7 @@ int sp_new(int no, int cg1, int cg2, int cg3, int type) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// メッセージスプライトの作成
|
||||
// メッセージスプライトの作成
|
||||
int sp_new_msg(int no, int x, int y, int width, int height) {
|
||||
sprite_t *sp;
|
||||
|
||||
@@ -206,34 +206,34 @@ int sp_new_msg(int no, int x, int y, int width, int height) {
|
||||
if (sp->type != SPRITE_NONE) {
|
||||
sp_free(no);
|
||||
}
|
||||
// 更新リストに登録
|
||||
// 更新リストに登録
|
||||
sact.updatelist = g_slist_insert_sorted(sact.updatelist, sp, compare_spriteno_smallfirst);
|
||||
|
||||
|
||||
sp->type = SPRITE_MSG;
|
||||
sp->no = no;
|
||||
sp->show = TRUE; // 初期状態は表示
|
||||
sp->blendrate = 255; // ブレンド無し
|
||||
sp->freezed_state = 0; // 状態固定無し
|
||||
sp->loc.x = x - sact.origin.x; // 初期表示位置
|
||||
sp->show = TRUE; // 初期状態は表示
|
||||
sp->blendrate = 255; // ブレンド無し
|
||||
sp->freezed_state = 0; // 状態固定無し
|
||||
sp->loc.x = x - sact.origin.x; // 初期表示位置
|
||||
sp->loc.y = y - sact.origin.y;
|
||||
sp->u.msg.dspcur.x = 0; // 文字描画開始位置
|
||||
sp->u.msg.dspcur.x = 0; // 文字描画開始位置
|
||||
sp->u.msg.dspcur.y = 0;
|
||||
sp->cursize.width = width; // スプライトの大きさ
|
||||
sp->cursize.width = width; // スプライトの大きさ
|
||||
sp->cursize.height = height;
|
||||
sp->cur = sp->loc;
|
||||
sp->u.msg.buf = NULL;
|
||||
|
||||
// 文字描画用キャンバス
|
||||
// 文字描画用キャンバス
|
||||
sp->u.msg.canvas = sf_create_surface(width, height, sf0->depth);
|
||||
|
||||
// スプライト再描画用コールバック
|
||||
// スプライト再描画用コールバック
|
||||
sp->update = smsg_update;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 壁紙の設定
|
||||
// 壁紙の設定
|
||||
int sp_set_wall_paper(int no) {
|
||||
sprite_t *sp = sact.sp[0];
|
||||
|
||||
@@ -241,12 +241,12 @@ int sp_set_wall_paper(int no) {
|
||||
scg_free_cgobj(sp->curcg);
|
||||
}
|
||||
|
||||
if (no) { // 指定のCGを表示
|
||||
if (no) { // 指定のCGを表示
|
||||
sp->curcg = scg_loadcg_no(no, TRUE);
|
||||
sp->update = DEFAULT_UPDATE;
|
||||
sp->cursize.width = sp->curcg->sf->width;
|
||||
sp->cursize.height = sp->curcg->sf->height;
|
||||
} else { // 真黒
|
||||
} else { // 真黒
|
||||
sp->cursize.width = sf0->width;
|
||||
sp->cursize.height = sf0->height;
|
||||
sp->curcg = NULL;
|
||||
@@ -262,7 +262,7 @@ int sp_set_wall_paper(int no) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 全ての sprite を消去
|
||||
// 全ての sprite を消去
|
||||
int sp_free_all() {
|
||||
int i;
|
||||
|
||||
@@ -272,7 +272,7 @@ int sp_free_all() {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 指定のsprite を消去
|
||||
// 指定のsprite を消去
|
||||
int sp_free(int no) {
|
||||
sprite_t *sp;
|
||||
|
||||
@@ -280,23 +280,23 @@ int sp_free(int no) {
|
||||
|
||||
sp = sact.sp[no];
|
||||
|
||||
// 移動開始していない場合はリストから削除
|
||||
// 移動開始していない場合はリストから削除
|
||||
if (!sp->move.moving) {
|
||||
sact.movelist = g_slist_remove(sact.movelist, sp);
|
||||
}
|
||||
|
||||
// CGオブジェクトの削除
|
||||
// CGオブジェクトの削除
|
||||
if (sp->cg1) scg_free_cgobj(sp->cg1);
|
||||
if (sp->cg2) scg_free_cgobj(sp->cg2);
|
||||
if (sp->cg3) scg_free_cgobj(sp->cg3);
|
||||
|
||||
// remove時の処理があれば実行
|
||||
// remove時の処理があれば実行
|
||||
if (sp->remove) {
|
||||
sp->remove(sp);
|
||||
}
|
||||
|
||||
// 説明スプライトの削除
|
||||
// ここで消しちゃまずいかも
|
||||
// 説明スプライトの削除
|
||||
// ここで消しちゃまずいかも
|
||||
g_slist_free(sp->expsp);
|
||||
sp->expsp = NULL;
|
||||
|
||||
@@ -306,7 +306,7 @@ int sp_free(int no) {
|
||||
}
|
||||
sact.updatelist = g_slist_remove(sact.updatelist, sp);
|
||||
|
||||
// SACT.Numeral_XXX は残しておく
|
||||
// SACT.Numeral_XXX は残しておく
|
||||
{
|
||||
sprite_t back;
|
||||
memcpy(&(back.numeral), &(sp->numeral), sizeof(sp->numeral));
|
||||
@@ -319,7 +319,7 @@ int sp_free(int no) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 表示状態の変更
|
||||
// 表示状態の変更
|
||||
int sp_set_show(int wNum, int wCount, int sShow) {
|
||||
int i;
|
||||
boolean oldstate;
|
||||
@@ -337,7 +337,7 @@ int sp_set_show(int wNum, int wCount, int sShow) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 表示位置の設定
|
||||
// 表示位置の設定
|
||||
int sp_set_pos(int wNum, int wX, int wY) {
|
||||
sprite_t *sp;
|
||||
|
||||
@@ -352,7 +352,7 @@ int sp_set_pos(int wNum, int wX, int wY) {
|
||||
|
||||
}
|
||||
|
||||
// スプライトの移動
|
||||
// スプライトの移動
|
||||
int sp_set_move(int wNum, int wX, int wY) {
|
||||
sprite_t *sp;
|
||||
|
||||
@@ -369,14 +369,14 @@ int sp_set_move(int wNum, int wX, int wY) {
|
||||
|
||||
sp->cur = sp->loc;
|
||||
|
||||
// moveするスプライトリストに登録
|
||||
// 実際に move を開始するのは ~SP_DRAW(sp_update_all)が呼ばれたとき
|
||||
// moveするスプライトリストに登録
|
||||
// 実際に move を開始するのは ~SP_DRAW(sp_update_all)が呼ばれたとき
|
||||
sact.movelist = g_slist_append(sact.movelist, sp);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
// スプライト移動時間の設定
|
||||
// スプライト移動時間の設定
|
||||
int sp_set_movetime(int wNum, int wTime) {
|
||||
sp_assert_no(wNum);
|
||||
|
||||
@@ -384,7 +384,7 @@ int sp_set_movetime(int wNum, int wTime) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// スプライト移動速度の設定
|
||||
// スプライト移動速度の設定
|
||||
int sp_set_movespeed(int wNum, int wTime) {
|
||||
sp_assert_no(wNum);
|
||||
|
||||
@@ -396,29 +396,29 @@ int sp_set_movespeed(int wNum, int wTime) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// Zキーを押したときに隠すスプライトの登録
|
||||
// Zキーを押したときに隠すスプライトの登録
|
||||
int sp_add_zkey_hidesprite(int wNum) {
|
||||
sprite_t *sp;
|
||||
|
||||
sp_assert_no(wNum);
|
||||
sp = sact.sp[wNum];
|
||||
|
||||
// 登録時点でまだ生成していないスプライトは隠さない
|
||||
// シェルクレイルでまずいのがあったので中止
|
||||
// 登録時点でまだ生成していないスプライトは隠さない
|
||||
// シェルクレイルでまずいのがあったので中止
|
||||
// if (sp->type == SPRITE_NONE) return NG;
|
||||
|
||||
sact.sp_zhide = g_slist_append(sact.sp_zhide, sp);
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 上で登録したスプライトの削除
|
||||
// 上で登録したスプライトの削除
|
||||
int sp_clear_zkey_hidesprite_all() {
|
||||
g_slist_free(sact.sp_zhide);
|
||||
sact.sp_zhide = NULL;
|
||||
return OK;
|
||||
}
|
||||
|
||||
// スプライト状態の固化
|
||||
// スプライト状態の固化
|
||||
int sp_freeze_sprite(int wNum, int wIndex) {
|
||||
sprite_t *sp;
|
||||
void *oldstate;
|
||||
@@ -440,7 +440,7 @@ int sp_freeze_sprite(int wNum, int wIndex) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 上で固化した状態の解除
|
||||
// 上で固化した状態の解除
|
||||
int sp_thaw_sprite(int wNum) {
|
||||
sp_assert_no(wNum);
|
||||
|
||||
@@ -448,7 +448,7 @@ int sp_thaw_sprite(int wNum) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// SP_QUAKEで揺らすスプライトの登録
|
||||
// SP_QUAKEで揺らすスプライトの登録
|
||||
int sp_add_quakesprite(int wNum) {
|
||||
sp_assert_no(wNum);
|
||||
|
||||
@@ -456,14 +456,14 @@ int sp_add_quakesprite(int wNum) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 上で登録したスプライトの削除
|
||||
// 上で登録したスプライトの削除
|
||||
int sp_clear_quakesprite_all() {
|
||||
g_slist_free(sact.sp_quake);
|
||||
sact.sp_quake = NULL;
|
||||
return OK;
|
||||
}
|
||||
|
||||
// アニメーションスプライトの間隔の設定
|
||||
// アニメーションスプライトの間隔の設定
|
||||
int sp_set_animeinterval(int wNum, int wTime) {
|
||||
sp_assert_no(wNum);
|
||||
|
||||
@@ -474,7 +474,7 @@ int sp_set_animeinterval(int wNum, int wTime) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// スプライトのブレンド率の設定
|
||||
// スプライトのブレンド率の設定
|
||||
int sp_set_blendrate(int wNum, int wCount, int rate) {
|
||||
int i;
|
||||
sprite_t *sp;
|
||||
@@ -490,7 +490,7 @@ int sp_set_blendrate(int wNum, int wCount, int rate) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// スプライトが create されているかどうかの取得
|
||||
// スプライトが create されているかどうかの取得
|
||||
int sp_query_isexist(int wNum, int *ret) {
|
||||
if (wNum >= SPRITEMAX) goto errexit;
|
||||
if (sact.sp[wNum]->type == SPRITE_NONE) goto errexit;
|
||||
@@ -503,7 +503,7 @@ int sp_query_isexist(int wNum, int *ret) {
|
||||
return NG;
|
||||
}
|
||||
|
||||
// スプライトのタイプと何番のCGがセットされているかの取得
|
||||
// スプライトのタイプと何番のCGがセットされているかの取得
|
||||
int sp_query_info(int wNum, int *vtype, int *vcg1, int *vcg2, int *vcg3) {
|
||||
sprite_t *sp;
|
||||
|
||||
@@ -527,7 +527,7 @@ int sp_query_info(int wNum, int *vtype, int *vcg1, int *vcg2, int *vcg3) {
|
||||
return NG;
|
||||
}
|
||||
|
||||
// スプライトの表示状態の取得
|
||||
// スプライトの表示状態の取得
|
||||
int sp_query_show(int wNum, int *vShow) {
|
||||
if (wNum >= SPRITEMAX) goto errexit;
|
||||
if (sact.sp[wNum]->type == SPRITE_NONE) goto errexit;
|
||||
@@ -540,7 +540,7 @@ int sp_query_show(int wNum, int *vShow) {
|
||||
return NG;
|
||||
}
|
||||
|
||||
// スプライトの表示位置の取得
|
||||
// スプライトの表示位置の取得
|
||||
int sp_query_pos(int wNum, int *vx, int *vy) {
|
||||
if (wNum >= SPRITEMAX) goto errexit;
|
||||
if (sact.sp[wNum]->type == SPRITE_NONE) goto errexit;
|
||||
@@ -555,7 +555,7 @@ int sp_query_pos(int wNum, int *vx, int *vy) {
|
||||
return NG;
|
||||
}
|
||||
|
||||
// スプライトの大きさの取得
|
||||
// スプライトの大きさの取得
|
||||
int sp_query_size(int wNum, int *vw, int *vh) {
|
||||
sprite_t *sp;
|
||||
|
||||
@@ -576,7 +576,7 @@ int sp_query_size(int wNum, int *vw, int *vh) {
|
||||
return NG;
|
||||
}
|
||||
|
||||
// テキストスプライトの現在の文字表示位置の取得
|
||||
// テキストスプライトの現在の文字表示位置の取得
|
||||
int sp_query_textpos(int wNum, int *vx, int *vy) {
|
||||
if (wNum >= SPRITEMAX) goto errexit;
|
||||
if (sact.sp[wNum]->type != SPRITE_MSG) goto errexit;
|
||||
@@ -591,7 +591,7 @@ int sp_query_textpos(int wNum, int *vx, int *vy) {
|
||||
return NG;
|
||||
}
|
||||
|
||||
// NumeralXXXのCGのセット
|
||||
// NumeralXXXのCGのセット
|
||||
int sp_num_setcg(int nNum, int nIndex, int nCG) {
|
||||
sp_assert_no(nNum);
|
||||
|
||||
@@ -600,7 +600,7 @@ int sp_num_setcg(int nNum, int nIndex, int nCG) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// NumeralXXXのCGの取得
|
||||
// NumeralXXXのCGの取得
|
||||
int sp_num_getcg(int nNum, int nIndex, int *vCG) {
|
||||
sp_assert_no(nNum);
|
||||
|
||||
@@ -609,7 +609,7 @@ int sp_num_getcg(int nNum, int nIndex, int *vCG) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// NumeralXXXの位置のセット
|
||||
// NumeralXXXの位置のセット
|
||||
int sp_num_setpos(int nNum, int nX, int nY) {
|
||||
sp_assert_no(nNum);
|
||||
|
||||
@@ -619,7 +619,7 @@ int sp_num_setpos(int nNum, int nX, int nY) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// NumeralXXXの位置の取得
|
||||
// NumeralXXXの位置の取得
|
||||
int sp_num_getpos(int nNum, int *vX, int *vY) {
|
||||
sp_assert_no(nNum);
|
||||
|
||||
@@ -629,7 +629,7 @@ int sp_num_getpos(int nNum, int *vX, int *vY) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// NumeralXXXのスパンのセット
|
||||
// NumeralXXXのスパンのセット
|
||||
int sp_num_setspan(int nNum, int nSpan) {
|
||||
sp_assert_no(nNum);
|
||||
|
||||
@@ -638,7 +638,7 @@ int sp_num_setspan(int nNum, int nSpan) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// NumeralXXXのスパンの取得
|
||||
// NumeralXXXのスパンの取得
|
||||
int sp_num_getspan(int nNum, int *vSpan) {
|
||||
sp_assert_no(nNum);
|
||||
|
||||
@@ -647,7 +647,7 @@ int sp_num_getspan(int nNum, int *vSpan) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// すべての説明スプライトの削除
|
||||
// すべての説明スプライトの削除
|
||||
int sp_exp_clear() {
|
||||
GSList *node;
|
||||
|
||||
@@ -660,7 +660,7 @@ int sp_exp_clear() {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 説明スプライトの登録
|
||||
// 説明スプライトの登録
|
||||
int sp_exp_add(int nNumSP1, int nNumSP2) {
|
||||
sprite_t *swsp, *expsp;
|
||||
sp_assert_no(nNumSP1);
|
||||
@@ -674,7 +674,7 @@ int sp_exp_add(int nNumSP1, int nNumSP2) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 説明スプライトの削除
|
||||
// 説明スプライトの削除
|
||||
int sp_exp_del(int nNum) {
|
||||
sprite_t *sp;
|
||||
|
||||
@@ -688,7 +688,7 @@ int sp_exp_del(int nNum) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// スプライトサウンドのセット
|
||||
// スプライトサウンドのセット
|
||||
int sp_sound_set(int wNumSP, int wNumWave1, int wNumWave2, int wNumWave3) {
|
||||
sprite_t *sp;
|
||||
|
||||
@@ -702,23 +702,23 @@ int sp_sound_set(int wNumSP, int wNumWave1, int wNumWave2, int wNumWave3) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// すべてのスプライトサウンドの終了を待つ
|
||||
// すべてのスプライトサウンドの終了を待つ
|
||||
int sp_sound_wait() {
|
||||
WARNING("NOT IMPLEMENTED\n");
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 範囲外をクリックしたときのサウンドの設定
|
||||
// 範囲外をクリックしたときのサウンドの設定
|
||||
int sp_sound_ob(int wNumWave) {
|
||||
sact.numsoundob = wNumWave;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定の座標が現在のスプライトの位置の範囲に入っているか?
|
||||
* @param sp: 調べる対象のスプライト
|
||||
* @param x,y: 座標
|
||||
* @return: TRUE:入っている, FALSE: 入っていない
|
||||
* 指定の座標が現在のスプライトの位置の範囲に入っているか?
|
||||
* @param sp: 調べる対象のスプライト
|
||||
* @param x,y: 座標
|
||||
* @return: TRUE:入っている, FALSE: 入っていない
|
||||
*/
|
||||
boolean sp_is_insprite(sprite_t *sp, int x, int y) {
|
||||
BYTE *dp;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sprite.h: スプライト基本各種処理
|
||||
* sprite.h: スプライト基本各種処理
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
|
||||
+15
-15
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sprite_anime.c: アニメーションスプライト特有の処理
|
||||
* sprite_anime.c: アニメーションスプライト特有の処理
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -37,23 +37,23 @@ static int eventCB_ANIM(sprite_t *sp, agsevent_t *e);
|
||||
static void cb_remove(sprite_t *sp);
|
||||
|
||||
|
||||
// アニメーションスプライト
|
||||
// アニメーションスプライト
|
||||
static int eventCB_ANIM(sprite_t *sp, agsevent_t *e) {
|
||||
int now;
|
||||
|
||||
// コールバックがタイマイベントかどうか
|
||||
// コールバックがタイマイベントかどうか
|
||||
if (e->type != AGSEVENT_TIMER) return 0;
|
||||
|
||||
// 現在時刻の取得
|
||||
// 現在時刻の取得
|
||||
now = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
|
||||
// 指定時間までスキップ
|
||||
// 指定時間までスキップ
|
||||
if ((now - sp->u.anime.starttime) < sp->u.anime.interval) return 0;
|
||||
|
||||
// 新しい時間を保存
|
||||
// 新しい時間を保存
|
||||
sp->u.anime.starttime = now;
|
||||
|
||||
// 次に表示するCGをセット
|
||||
// 次に表示するCGをセット
|
||||
switch(sp->u.anime.tick % sp->u.anime.npat) {
|
||||
case 0:
|
||||
sp->curcg = sp->cg1; break;
|
||||
@@ -65,7 +65,7 @@ static int eventCB_ANIM(sprite_t *sp, agsevent_t *e) {
|
||||
|
||||
// WARNING("anime update\n");
|
||||
|
||||
// カウントアップ
|
||||
// カウントアップ
|
||||
sp->u.anime.tick++;
|
||||
|
||||
sp_updateme(sp);
|
||||
@@ -73,23 +73,23 @@ static int eventCB_ANIM(sprite_t *sp, agsevent_t *e) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// スプライト削除時の処理
|
||||
// スプライト削除時の処理
|
||||
static void cb_remove(sprite_t *sp) {
|
||||
spev_remove_teventlistener(sp);
|
||||
}
|
||||
|
||||
/*
|
||||
sp_new の時にスプライトの種類毎の初期化
|
||||
@param sp: 初期化するスプライト
|
||||
sp_new の時にスプライトの種類毎の初期化
|
||||
@param sp: 初期化するスプライト
|
||||
*/
|
||||
int sp_anime_setup(sprite_t *sp) {
|
||||
int n = 0;
|
||||
|
||||
sp->u.anime.interval = 500; // デフォルトの間隔 0.5秒
|
||||
sp->u.anime.starttime = get_high_counter(SYSTEMCOUNTER_MSEC); // 開始時刻
|
||||
sp->u.anime.tick = 0; // カウンタ初期化
|
||||
sp->u.anime.interval = 500; // デフォルトの間隔 0.5秒
|
||||
sp->u.anime.starttime = get_high_counter(SYSTEMCOUNTER_MSEC); // 開始時刻
|
||||
sp->u.anime.tick = 0; // カウンタ初期化
|
||||
|
||||
// アニメパターンはいくつあるか
|
||||
// アニメパターンはいくつあるか
|
||||
if (sp->cg1) n++;
|
||||
if (sp->cg2) n++;
|
||||
if (sp->cg3) n++;
|
||||
|
||||
+17
-17
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sprite_draw.c: スプライト再描画各種
|
||||
* sprite_draw.c: スプライト再描画各種
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -41,7 +41,7 @@ static void fill_dmap_mask(surface_t *src, int sx, int sy, int dx ,int dy, int w
|
||||
|
||||
|
||||
|
||||
// 矩形の depthmap を描画
|
||||
// 矩形の depthmap を描画
|
||||
static void fill_dmap(int dx ,int dy, int w, int h, WORD val) {
|
||||
BYTE *dp, *dp_;
|
||||
int x, y;
|
||||
@@ -59,7 +59,7 @@ static void fill_dmap(int dx ,int dy, int w, int h, WORD val) {
|
||||
}
|
||||
}
|
||||
|
||||
// alphamapにしたがって、alpha値が0より大きいところを指定のdepthとする
|
||||
// alphamapにしたがって、alpha値が0より大きいところを指定のdepthとする
|
||||
static void fill_dmap_mask(surface_t *src, int sx, int sy, int dx ,int dy, int w, int h, WORD val) {
|
||||
BYTE *sp, *dp;
|
||||
int x, y;
|
||||
@@ -78,8 +78,8 @@ static void fill_dmap_mask(surface_t *src, int sx, int sy, int dx ,int dy, int w
|
||||
}
|
||||
|
||||
/*
|
||||
指定の sprite (の現在のCG)を surface0 に書く
|
||||
@param sp: 描画するスプライト
|
||||
指定の sprite (の現在のCG)を surface0 に書く
|
||||
@param sp: 描画するスプライト
|
||||
*/
|
||||
int sp_draw(sprite_t *sp) {
|
||||
if (sp == NULL) return NG;
|
||||
@@ -88,11 +88,11 @@ int sp_draw(sprite_t *sp) {
|
||||
}
|
||||
|
||||
/*
|
||||
指定の spriteの指定のCGを surface0 に書く
|
||||
(このインターフェイスはもう不要?)
|
||||
指定の spriteの指定のCGを surface0 に書く
|
||||
(このインターフェイスはもう不要?)
|
||||
|
||||
@param sp: 描画するスプライト
|
||||
@param cg: 描画するCG
|
||||
@param sp: 描画するスプライト
|
||||
@param cg: 描画するCG
|
||||
*/
|
||||
int sp_draw2(sprite_t *sp, cginfo_t *cg) {
|
||||
surface_t update;
|
||||
@@ -101,7 +101,7 @@ int sp_draw2(sprite_t *sp, cginfo_t *cg) {
|
||||
if (cg == NULL) return NG;
|
||||
if (cg->sf == NULL) return NG;
|
||||
|
||||
// 更新領域の確定
|
||||
// 更新領域の確定
|
||||
update.width = sact.updaterect.width;
|
||||
update.height = sact.updaterect.height;
|
||||
sx = 0;
|
||||
@@ -119,7 +119,7 @@ int sp_draw2(sprite_t *sp, cginfo_t *cg) {
|
||||
dy += sact.updaterect.y;
|
||||
|
||||
if (cg->sf->has_alpha) {
|
||||
// alpha map がある場合
|
||||
// alpha map がある場合
|
||||
gre_BlendUseAMap(sf0, dx, dy,
|
||||
sf0, dx, dy,
|
||||
cg->sf, sx, sy, w, h,
|
||||
@@ -127,10 +127,10 @@ int sp_draw2(sprite_t *sp, cginfo_t *cg) {
|
||||
sp->blendrate);
|
||||
} else {
|
||||
if (sp->blendrate == 255) {
|
||||
// alpha値指定が無い場合
|
||||
// alpha値指定が無い場合
|
||||
gr_copy(sf0, dx, dy, cg->sf, sx, sy, w, h);
|
||||
} else if (sp->blendrate > 0) {
|
||||
// alpha値指定がある場合
|
||||
// alpha値指定がある場合
|
||||
gre_Blend(sf0, dx, dy,
|
||||
sf0, dx, dy,
|
||||
cg->sf, sx, sy, w, h,
|
||||
@@ -144,7 +144,7 @@ int sp_draw2(sprite_t *sp, cginfo_t *cg) {
|
||||
}
|
||||
|
||||
/*
|
||||
スプライトキー待ち用のdepthmap を更新
|
||||
スプライトキー待ち用のdepthmap を更新
|
||||
*/
|
||||
void sp_draw_dmap(gpointer data, gpointer userdata) {
|
||||
sprite_t *sp = (sprite_t *)data;
|
||||
@@ -152,17 +152,17 @@ void sp_draw_dmap(gpointer data, gpointer userdata) {
|
||||
surface_t update;
|
||||
int sx, sy, w, h, dx, dy;
|
||||
|
||||
// 非表示状態の時は無視
|
||||
// 非表示状態の時は無視
|
||||
if (!sp->show) return;
|
||||
|
||||
// ドラッグ中のスプライトは無視
|
||||
// ドラッグ中のスプライトは無視
|
||||
if (sp == sact.draggedsp) return;
|
||||
|
||||
cg = sp->curcg;
|
||||
if (cg == NULL) return;
|
||||
if (cg->sf == NULL) return;
|
||||
|
||||
// depth map を書く領域を確定
|
||||
// depth map を書く領域を確定
|
||||
update.width = sf0->width;
|
||||
update.height = sf0->height;
|
||||
sx = 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sprite_eupdate.c: 効果つき更新
|
||||
* sprite_eupdate.c: 効果つき更新
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -76,10 +76,10 @@ typedef void entrypoint (surface_t *, surface_t *);
|
||||
|
||||
static entrypoint *cb[39] = {
|
||||
ec1_cb,
|
||||
ec_dummy_cb, // 欠番
|
||||
ec_dummy_cb, // 欠番
|
||||
ec_dummy_cb, // 欠番
|
||||
ec_dummy_cb, // 欠番
|
||||
ec_dummy_cb, // 欠番
|
||||
ec_dummy_cb, // 欠番
|
||||
ec_dummy_cb, // 欠番
|
||||
ec_dummy_cb, // 欠番
|
||||
ec6_cb,
|
||||
ec7_cb,
|
||||
ec8_cb,
|
||||
@@ -92,7 +92,7 @@ static entrypoint *cb[39] = {
|
||||
ec15_cb,
|
||||
ec16_cb,
|
||||
ec17_cb,
|
||||
ec_dummy_cb, // 欠番
|
||||
ec_dummy_cb, // 欠番
|
||||
ec19_cb,
|
||||
ec20_cb,
|
||||
ec21_cb,
|
||||
@@ -120,7 +120,7 @@ static void ec_dummy_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
WARNING("NOT IMPLEMENTED\n");
|
||||
}
|
||||
|
||||
// クロスフェード
|
||||
// クロスフェード
|
||||
static void ec1_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
int curstep;
|
||||
|
||||
@@ -137,7 +137,7 @@ static void ec1_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ecp.oldstep = curstep;
|
||||
}
|
||||
|
||||
// すだれ落ち
|
||||
// すだれ落ち
|
||||
static void ec7_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
#define EC7DELTA 16
|
||||
int curstep, maxstep = sfsrc->height / EC7DELTA + EC7DELTA;
|
||||
@@ -165,7 +165,7 @@ static void ec7_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ags_updateFull();
|
||||
}
|
||||
|
||||
// すだれ左->右
|
||||
// すだれ左->右
|
||||
static void ec8_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
#define EC8DELTA 16
|
||||
int curstep, maxstep = sfsrc->width / EC8DELTA + EC8DELTA;
|
||||
@@ -193,7 +193,7 @@ static void ec8_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ags_updateFull();
|
||||
}
|
||||
|
||||
// すだれ落ち&左->右
|
||||
// すだれ落ち&左->右
|
||||
static void ec9_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
#define EC9DELTA 16
|
||||
int curstep, maxstep;
|
||||
@@ -230,7 +230,7 @@ static void ec9_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ags_updateFull();
|
||||
}
|
||||
|
||||
// 上->下クロスフェード
|
||||
// 上->下クロスフェード
|
||||
static void ec12_cb(surface_t *src, surface_t *dst) {
|
||||
#define EC12DELTA 256
|
||||
int curstep, maxstep = src->height + EC12DELTA;
|
||||
@@ -258,7 +258,7 @@ static void ec12_cb(surface_t *src, surface_t *dst) {
|
||||
ecp.oldstep = st_i;
|
||||
}
|
||||
|
||||
// 下->上クロスフェード
|
||||
// 下->上クロスフェード
|
||||
static void ec13_cb(surface_t *src, surface_t *dst) {
|
||||
#define EC13DELTA 256
|
||||
int curstep, maxstep = src->height + EC12DELTA;
|
||||
@@ -289,7 +289,7 @@ static void ec13_cb(surface_t *src, surface_t *dst) {
|
||||
ecp.oldstep = st_i;
|
||||
}
|
||||
|
||||
// 五芒星 (内->外)
|
||||
// 五芒星 (内->外)
|
||||
static void ec14_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
int curstep, maxstep;
|
||||
maxstep = 256;
|
||||
@@ -302,7 +302,7 @@ static void ec14_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ecp.oldstep = curstep;
|
||||
}
|
||||
|
||||
// 五芒星 (外->内)
|
||||
// 五芒星 (外->内)
|
||||
static void ec15_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
int curstep, maxstep;
|
||||
maxstep = 256;
|
||||
@@ -315,7 +315,7 @@ static void ec15_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ecp.oldstep = curstep;
|
||||
}
|
||||
|
||||
// 六芒星 (内->外)
|
||||
// 六芒星 (内->外)
|
||||
static void ec16_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
int curstep, maxstep;
|
||||
maxstep = 256;
|
||||
@@ -328,7 +328,7 @@ static void ec16_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ecp.oldstep = curstep;
|
||||
}
|
||||
|
||||
// 六芒星 (外->内)
|
||||
// 六芒星 (外->内)
|
||||
static void ec17_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
int curstep, maxstep;
|
||||
maxstep = 256;
|
||||
@@ -343,56 +343,56 @@ static void ec17_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
|
||||
|
||||
|
||||
//ブロックディゾルブ
|
||||
//ブロックディゾルブ
|
||||
static void ec24_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
}
|
||||
|
||||
// 振動
|
||||
// 振動
|
||||
static void ec27_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
}
|
||||
|
||||
// 回転ズームブレンドブラー(SRCのみ参照
|
||||
// 回転ズームブレンドブラー(SRCのみ参照
|
||||
static void ec30_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
}
|
||||
|
||||
// TVスイッチオフ(Destのみ参照)
|
||||
// TVスイッチオフ(Destのみ参照)
|
||||
static void ec32_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
}
|
||||
|
||||
// TVスイッチオン(Srcのみ参照)
|
||||
// TVスイッチオン(Srcのみ参照)
|
||||
static void ec33_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
}
|
||||
|
||||
// ポリゴン爆発
|
||||
// ポリゴン爆発
|
||||
static void ec34_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
}
|
||||
|
||||
// ノイズクロスフェード
|
||||
// ノイズクロスフェード
|
||||
static void ec35_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
}
|
||||
|
||||
// ページめくり
|
||||
// ページめくり
|
||||
static void ec36_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
}
|
||||
|
||||
// セピアノイズクロスフェード
|
||||
// セピアノイズクロスフェード
|
||||
static void ec37_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
}
|
||||
|
||||
// ぐしゃぐしゃ紙右下ひっぱり
|
||||
// ぐしゃぐしゃ紙右下ひっぱり
|
||||
static void ec38_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
}
|
||||
|
||||
// 横うねうね
|
||||
// 横うねうね
|
||||
static void ec39_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
効果つき画面更新
|
||||
@param type: 効果の種類
|
||||
@param time: 実行時間
|
||||
@param cancel: キー抜け(0:なし, 1:あり)
|
||||
効果つき画面更新
|
||||
@param type: 効果の種類
|
||||
@param time: 実行時間
|
||||
@param cancel: キー抜け(0:なし, 1:あり)
|
||||
*/
|
||||
int sp_eupdate(int type, int time, int cancel) {
|
||||
surface_t *sfsrc, *sfdst;
|
||||
@@ -403,15 +403,15 @@ int sp_eupdate(int type, int time, int cancel) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 現在の sf0 をセーブ
|
||||
// 現在の sf0 をセーブ
|
||||
sfsrc = sf_dup(sf0);
|
||||
|
||||
sp_update_all(FALSE);
|
||||
|
||||
sfdst = sf_dup(sf0);
|
||||
|
||||
sf_copyall(sf0, sfsrc); // 全部の効果タイプにこの処理は要らないんだけど
|
||||
// 5つを越えたら別の方法を考えよう
|
||||
sf_copyall(sf0, sfsrc); // 全部の効果タイプにこの処理は要らないんだけど
|
||||
// 5つを越えたら別の方法を考えよう
|
||||
if (type == 10) {
|
||||
ec10_prepare(sfsrc, sfdst);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// アフィン変換 (回転)
|
||||
// アフィン変換 (回転)
|
||||
|
||||
static void do_aff(surface_t *in, surface_t *out, int deg, double zx, double zy) {
|
||||
int xs = in->width / 2;
|
||||
@@ -56,9 +56,9 @@ static void do_aff(surface_t *in, surface_t *out, int deg, double zx, double zy)
|
||||
|
||||
|
||||
|
||||
//回転アウト
|
||||
//回転アウト
|
||||
static void ec20_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
//1回転だけ
|
||||
//1回転だけ
|
||||
int maxstep, curstep;
|
||||
maxstep = 360;
|
||||
curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime);
|
||||
@@ -68,7 +68,7 @@ static void ec20_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ecp.oldstep = curstep;
|
||||
}
|
||||
|
||||
//回転イン
|
||||
//回転イン
|
||||
static void ec21_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
int maxstep, curstep;
|
||||
maxstep = 360;
|
||||
@@ -79,7 +79,7 @@ static void ec21_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ecp.oldstep = curstep;
|
||||
}
|
||||
|
||||
//回転アウト(時計回り)
|
||||
//回転アウト(時計回り)
|
||||
static void ec22_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
int maxstep, curstep;
|
||||
maxstep = 360;
|
||||
@@ -90,7 +90,7 @@ static void ec22_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ecp.oldstep = curstep;
|
||||
}
|
||||
|
||||
//回転イン(時計回り)
|
||||
//回転イン(時計回り)
|
||||
static void ec23_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
int maxstep, curstep;
|
||||
maxstep = 360;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// 11 と 19 で共有
|
||||
// 11 と 19 で共有
|
||||
static surface_t *ec11_ss[6];
|
||||
static surface_t *ec11_sd[6];
|
||||
|
||||
// 線形ブラー
|
||||
// 線形ブラー
|
||||
static void ec11_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
int curstep, maxstep = 6;
|
||||
curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime);
|
||||
@@ -36,7 +36,7 @@ static void ec11_drain(surface_t *src, surface_t *dst) {
|
||||
}
|
||||
}
|
||||
|
||||
// 縦線形ブラー
|
||||
// 縦線形ブラー
|
||||
static void ec19_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
ec11_cb(sfsrc, sfdst);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
|
||||
|
||||
// クロスフェードモザイク
|
||||
// クロスフェードモザイク
|
||||
static void ec6_cb(surface_t *src, surface_t *dst) {
|
||||
int curstep, maxstep = 32;
|
||||
surface_t *st, *dt;
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
// 透視投影変換のうち、X軸とY軸周りの回転のみを考慮
|
||||
// 透視投影変換のうち、X軸とY軸周りの回転のみを考慮
|
||||
/*
|
||||
X軸回転行列 1 0 0 0
|
||||
X軸回転行列 1 0 0 0
|
||||
0 cos sin 0
|
||||
0 -sin cos 0
|
||||
0 0 0 1
|
||||
|
||||
Y軸回転行列 cos 0 sin 0
|
||||
Y軸回転行列 cos 0 sin 0
|
||||
0 1 0 0
|
||||
-sin 0 cos 0
|
||||
0 0 0 1
|
||||
|
||||
視点座標変換行列 (G)
|
||||
視点座標変換行列 (G)
|
||||
1 0 0 0
|
||||
0 1 0 0
|
||||
0 0 -1 0
|
||||
0 0 t 1 , t = 1
|
||||
|
||||
透視変換行列 (H)
|
||||
透視変換行列 (H)
|
||||
1 0 0 0
|
||||
0 1 0 0
|
||||
0 0 1/s 1/s
|
||||
0 0 -1 0 , s = 1
|
||||
|
||||
X軸回転 (ys = height/2)
|
||||
X軸回転 (ys = height/2)
|
||||
k[1] = -sin(rx* M_PI / 180) / (float)ys;
|
||||
k[2] = cos(rx* M_PI / 180);
|
||||
k[3] = cos(rx* M_PI / 180);
|
||||
k[7] = 1;
|
||||
Y軸回転 (xs = width/2)
|
||||
Y軸回転 (xs = width/2)
|
||||
k[0] = sin(ry * M_PI / 180) / (float)xs;
|
||||
k[2] = cos(ry * M_PI / 180);
|
||||
k[3] = 1;
|
||||
@@ -124,7 +124,7 @@ static void perspect_rotatey(surface_t *in, surface_t *out, double ry) {
|
||||
do_per(in, out, k);
|
||||
}
|
||||
|
||||
// ポリゴン回転(Y軸・半計回り)
|
||||
// ポリゴン回転(Y軸・半計回り)
|
||||
static void ec25_cb(surface_t *src, surface_t *dst) {
|
||||
int curstep, maxstep;
|
||||
maxstep = 180;
|
||||
@@ -137,7 +137,7 @@ static void ec25_cb(surface_t *src, surface_t *dst) {
|
||||
ags_updateFull();
|
||||
}
|
||||
|
||||
// ポリゴン回転(Y軸・計回り)
|
||||
// ポリゴン回転(Y軸・計回り)
|
||||
static void ec26_cb(surface_t *src, surface_t *dst) {
|
||||
int curstep, maxstep;
|
||||
maxstep = 180;
|
||||
@@ -150,7 +150,7 @@ static void ec26_cb(surface_t *src, surface_t *dst) {
|
||||
ags_updateFull();
|
||||
}
|
||||
|
||||
// ポリゴン回転(X軸・時計回り)
|
||||
// ポリゴン回転(X軸・時計回り)
|
||||
static void ec28_cb(surface_t *src, surface_t *dst) {
|
||||
int curstep, maxstep;
|
||||
maxstep = 180;
|
||||
@@ -163,7 +163,7 @@ static void ec28_cb(surface_t *src, surface_t *dst) {
|
||||
ags_updateFull();
|
||||
}
|
||||
|
||||
// ポリゴン回転(X軸)
|
||||
// ポリゴン回転(X軸)
|
||||
static void ec29_cb(surface_t *src, surface_t *dst) {
|
||||
int curstep, maxstep;
|
||||
maxstep = 180;
|
||||
|
||||
@@ -42,7 +42,7 @@ static void uneune(surface_t *in, surface_t *out, int st) {
|
||||
|
||||
|
||||
|
||||
// うねうねクロスフェード
|
||||
// うねうねクロスフェード
|
||||
static void ec31_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
int curstep, maxstep;
|
||||
surface_t *st, *dt;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
static surface_t *ec10_sf[6];
|
||||
|
||||
|
||||
// ズームブレンドブラー
|
||||
// ズームブレンドブラー
|
||||
static void ec10_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
int curstep, maxstep, turstep;
|
||||
surface_t *sf;
|
||||
@@ -18,13 +18,13 @@ static void ec10_cb(surface_t *sfsrc, surface_t *sfdst) {
|
||||
WARNING("step = %d/%d\n", curstep, maxstep);
|
||||
|
||||
if (curstep > turstep) {
|
||||
// 帰り
|
||||
// 帰り
|
||||
sx = (maxstep - curstep) * (sfsrc->width - sfsrc->width/10) / maxstep;
|
||||
sy = (maxstep - curstep) * (sfsrc->height - sfsrc->height/10) / maxstep;
|
||||
sw = sfsrc->width - sx*2;
|
||||
sh = sfsrc->height - sy*2;
|
||||
} else {
|
||||
// 行き
|
||||
// 行き
|
||||
sx = curstep * (sfsrc->width - sfsrc->width/10) / maxstep;
|
||||
sy = curstep * (sfsrc->height - sfsrc->height/10) / maxstep;
|
||||
sw = sfsrc->width - sx*2;
|
||||
|
||||
+70
-70
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sprite_event.c: SACT内の mouse/key イベントのハンドラ
|
||||
* sprite_event.c: SACT内の mouse/key イベントのハンドラ
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -39,40 +39,40 @@
|
||||
#include "sactlog.h"
|
||||
|
||||
/*
|
||||
SACT内のSpriteKey待ちやメッセージKey待ちなどを実現するため、X|SDL から
|
||||
Key/Mouse イベントがあったときに、nact->ags.eventcb()によって他のモジュール
|
||||
にイベントを送出できるようにした。
|
||||
SACT内のSpriteKey待ちやメッセージKey待ちなどを実現するため、X|SDL から
|
||||
Key/Mouse イベントがあったときに、nact->ags.eventcb()によって他のモジュール
|
||||
にイベントを送出できるようにした。
|
||||
|
||||
SACTでは最初に spev_callback でイベントを受け取るようにし、現在のキー待ちの
|
||||
状態(sact.waittype)によってそれぞれのイベントハンドラを呼び出している。
|
||||
SACTでは最初に spev_callback でイベントを受け取るようにし、現在のキー待ちの
|
||||
状態(sact.waittype)によってそれぞれのイベントハンドラを呼び出している。
|
||||
|
||||
現在のところ、1) メッセージキー待ち、2) 単純キー待ち、3) メニューキー待ち、
|
||||
4) スプライトキー 5) バックログキー待ちの5つがある。
|
||||
現在のところ、1) メッセージキー待ち、2) 単純キー待ち、3) メニューキー待ち、
|
||||
4) スプライトキー 5) バックログキー待ちの5つがある。
|
||||
|
||||
1)メッセージキー待ち
|
||||
何かキーが押されるまで待つ。Zキースプライトの消去ができる。
|
||||
1)メッセージキー待ち
|
||||
何かキーが押されるまで待つ。Zキースプライトの消去ができる。
|
||||
|
||||
2)単純キー待ち
|
||||
1)と同じ
|
||||
2)単純キー待ち
|
||||
1)と同じ
|
||||
|
||||
3)メニューキー待ち
|
||||
メニューオープン時の処理。マウスが動いた時と、キー(orボタン)が離れたときに
|
||||
いくつかの処理を行う。
|
||||
3)メニューキー待ち
|
||||
メニューオープン時の処理。マウスが動いた時と、キー(orボタン)が離れたときに
|
||||
いくつかの処理を行う。
|
||||
|
||||
4)スプライト待ち
|
||||
SW/GETA/GETB/PUT/SWPUTスプライトの各処理を行う。
|
||||
スプライトは番号の小さいものから順に上に重ねて表示し、下になっている
|
||||
スプライトにイベントが伝わらないようにする
|
||||
-> SpriteKey待ちの直前にスプライトの番号による depth map を作成し、
|
||||
マウスの位置にあるスプライトの番号をで取り出す。
|
||||
AlphaマスクつきのSpriteの場合、それを反映し、表示している場所のみに
|
||||
depthmapを反映。
|
||||
4)スプライト待ち
|
||||
SW/GETA/GETB/PUT/SWPUTスプライトの各処理を行う。
|
||||
スプライトは番号の小さいものから順に上に重ねて表示し、下になっている
|
||||
スプライトにイベントが伝わらないようにする
|
||||
-> SpriteKey待ちの直前にスプライトの番号による depth map を作成し、
|
||||
マウスの位置にあるスプライトの番号をで取り出す。
|
||||
AlphaマスクつきのSpriteの場合、それを反映し、表示している場所のみに
|
||||
depthmapを反映。
|
||||
|
||||
drag中のスプライトは常に最上位にくるように表示し、マウス移動等のイベント
|
||||
は最初に処理する。
|
||||
drag中のスプライトは常に最上位にくるように表示し、マウス移動等のイベント
|
||||
は最初に処理する。
|
||||
|
||||
5)バックログ表示中のキー待ち
|
||||
オリジナルと同じキー操作のはず
|
||||
5)バックログ表示中のキー待ち
|
||||
オリジナルと同じキー操作のはず
|
||||
*/
|
||||
|
||||
|
||||
@@ -85,8 +85,8 @@ static void cb_waitkey_sprite(agsevent_t *e);
|
||||
static void cb_waitkey_selection(agsevent_t *e);
|
||||
|
||||
/*
|
||||
フォーカスを得たスプライトに説明スプライトが登録されていた場合の
|
||||
説明スプライトの表示ON
|
||||
フォーカスを得たスプライトに説明スプライトが登録されていた場合の
|
||||
説明スプライトの表示ON
|
||||
*/
|
||||
static void cb_focused_swsp(gpointer s, gpointer data) {
|
||||
sprite_t *sp = (sprite_t *)s;
|
||||
@@ -103,8 +103,8 @@ static void cb_focused_swsp(gpointer s, gpointer data) {
|
||||
}
|
||||
|
||||
/*
|
||||
フォーカスを得たスプライトに説明スプライトが登録されていた場合の
|
||||
説明スプライトの表示OFF
|
||||
フォーカスを得たスプライトに説明スプライトが登録されていた場合の
|
||||
説明スプライトの表示OFF
|
||||
*/
|
||||
static void cb_defocused_swsp(gpointer s, gpointer data) {
|
||||
sprite_t *sp = (sprite_t *)s;
|
||||
@@ -148,13 +148,13 @@ static void cb_defocused_zkey(gpointer s, gpointer data) {
|
||||
}
|
||||
|
||||
/*
|
||||
フォーカスを得たスプライトの処理
|
||||
cg2があればcurcgをcg2に設定
|
||||
フォーカスを得たスプライトの処理
|
||||
cg2があればcurcgをcg2に設定
|
||||
|
||||
drag中のスプライトがある場合
|
||||
-> PUT/SWPUTスプライトのみ反応
|
||||
drag中のスプライトがない場合
|
||||
-> GETA/GETB/SWPUTスプライトのみ反応
|
||||
drag中のスプライトがある場合
|
||||
-> PUT/SWPUTスプライトのみ反応
|
||||
drag中のスプライトがない場合
|
||||
-> GETA/GETB/SWPUTスプライトのみ反応
|
||||
*/
|
||||
static int cb_focused(sprite_t *sp) {
|
||||
int update = 0;
|
||||
@@ -185,8 +185,8 @@ static int cb_focused(sprite_t *sp) {
|
||||
}
|
||||
|
||||
/*
|
||||
フォーカスを失ったスプライトの処理
|
||||
curcg を cg1 にセット
|
||||
フォーカスを失ったスプライトの処理
|
||||
curcg を cg1 にセット
|
||||
*/
|
||||
static int cb_defocused(sprite_t *sp) {
|
||||
int update = 0;
|
||||
@@ -205,7 +205,7 @@ static int cb_defocused(sprite_t *sp) {
|
||||
}
|
||||
|
||||
/*
|
||||
WaitKeySimpleのcallback
|
||||
WaitKeySimpleのcallback
|
||||
*/
|
||||
static void cb_waitkey_simple(agsevent_t *e) {
|
||||
int cur, update = 0;
|
||||
@@ -226,10 +226,10 @@ static void cb_waitkey_simple(agsevent_t *e) {
|
||||
break;
|
||||
|
||||
case AGSEVENT_BUTTON_RELEASE:
|
||||
// back log view mode に移行
|
||||
// back log view mode に移行
|
||||
if (e->d3 == AGSEVENT_WHEEL_UP ||
|
||||
e->d3 == AGSEVENT_WHEEL_DN) {
|
||||
// MessageKey 待ちのときのみ
|
||||
// MessageKey 待ちのときのみ
|
||||
if (sact.waittype != KEYWAIT_MESSAGE) break;
|
||||
sblog_start();
|
||||
sact.waittype = KEYWAIT_BACKLOG;
|
||||
@@ -252,7 +252,7 @@ static void cb_waitkey_simple(agsevent_t *e) {
|
||||
break;
|
||||
case KEY_PAGEUP:
|
||||
case KEY_PAGEDOWN:
|
||||
// MessageKey 待ちのときのみ
|
||||
// MessageKey 待ちのときのみ
|
||||
if (sact.waittype != KEYWAIT_MESSAGE) break;
|
||||
sblog_start();
|
||||
sact.waittype = KEYWAIT_BACKLOG;
|
||||
@@ -269,15 +269,15 @@ static void cb_waitkey_simple(agsevent_t *e) {
|
||||
}
|
||||
|
||||
/*
|
||||
WaitKeySpriteのcallback
|
||||
WaitKeySpriteのcallback
|
||||
*/
|
||||
static void cb_waitkey_sprite(agsevent_t *e) {
|
||||
GSList *node;
|
||||
sprite_t *focused_sp = NULL; // focus を得ている sprite
|
||||
sprite_t *defocused_sp = NULL; // focus を失った sprite
|
||||
sprite_t *focused_sp = NULL; // focus を得ている sprite
|
||||
sprite_t *defocused_sp = NULL; // focus を失った sprite
|
||||
int update = 0;
|
||||
|
||||
// キーイベントは無視
|
||||
// キーイベントは無視
|
||||
switch(e->type) {
|
||||
case AGSEVENT_KEY_RELEASE:
|
||||
case AGSEVENT_KEY_PRESS:
|
||||
@@ -285,11 +285,11 @@ static void cb_waitkey_sprite(agsevent_t *e) {
|
||||
}
|
||||
|
||||
if (sact.draggedsp) {
|
||||
// 先に drag中のspriteにイベントを送る
|
||||
// 先に drag中のspriteにイベントを送る
|
||||
update = sact.draggedsp->eventcb(sact.draggedsp, e);
|
||||
} else {
|
||||
// 右クリックキャンセル
|
||||
// drag中でない時のみ、キャンセルを受け付ける
|
||||
// 右クリックキャンセル
|
||||
// drag中でない時のみ、キャンセルを受け付ける
|
||||
if (e->type == AGSEVENT_BUTTON_RELEASE &&
|
||||
e->d3 == AGSEVENT_BUTTON_RIGHT) {
|
||||
sact.waitkey = 0;
|
||||
@@ -297,31 +297,31 @@ static void cb_waitkey_sprite(agsevent_t *e) {
|
||||
}
|
||||
}
|
||||
|
||||
// forcusを得ている sprite と focusを失った sprite を探す
|
||||
// forcusを得ている sprite と focusを失った sprite を探す
|
||||
for (node = sact.eventlisteners; node; node = node->next) {
|
||||
sprite_t *sp = (sprite_t *)node->data;
|
||||
|
||||
if (sp == NULL) continue;
|
||||
if (!sp->show) continue;
|
||||
|
||||
// freeze状態ではCGは変化しない
|
||||
// freeze状態ではCGは変化しない
|
||||
if (sp->freezed_state != 0) continue;
|
||||
|
||||
// dragg中の sprite は無視する
|
||||
// dragg中の sprite は無視する
|
||||
if (sp == sact.draggedsp) continue;
|
||||
|
||||
if (focused_sp == NULL && sp_is_insprite(sp, e->d1, e->d2)) {
|
||||
/*
|
||||
focusを得ている sprite
|
||||
focusを得ている sprite
|
||||
*/
|
||||
update += cb_focused(sp);
|
||||
focused_sp = sp;
|
||||
} else {
|
||||
/*
|
||||
現在のカーソル位置にはいま処理している番号のsprite
|
||||
は存在しないので、defocus の処理を行う。
|
||||
今回のマウス移動イベントによりfocusを失ったので
|
||||
あれば、cb_decocused(sp)は 1 を返す
|
||||
現在のカーソル位置にはいま処理している番号のsprite
|
||||
は存在しないので、defocus の処理を行う。
|
||||
今回のマウス移動イベントによりfocusを失ったので
|
||||
あれば、cb_decocused(sp)は 1 を返す
|
||||
*/
|
||||
int ret = cb_defocused(sp);
|
||||
if (ret > 0) defocused_sp = sp;
|
||||
@@ -329,21 +329,21 @@ static void cb_waitkey_sprite(agsevent_t *e) {
|
||||
}
|
||||
}
|
||||
|
||||
// focusを得た sprite に BUTTONイベントのみを送る
|
||||
// focusを得た sprite に BUTTONイベントのみを送る
|
||||
if (focused_sp && e->type != AGSEVENT_MOUSE_MOTION) {
|
||||
update += focused_sp->eventcb(focused_sp, e);
|
||||
}
|
||||
|
||||
// 範囲外(focusを得ているspriteがない場合)をクリックしたときの音
|
||||
// 範囲外(focusを得ているspriteがない場合)をクリックしたときの音
|
||||
if (!focused_sp &&
|
||||
e->type != AGSEVENT_MOUSE_MOTION &&
|
||||
sact.numsoundob) {
|
||||
ssnd_play(sact.numsoundob);
|
||||
}
|
||||
|
||||
// drag中でない場合は、説明スプライトの表示、消去を行う
|
||||
// drag中でない場合は、説明スプライトの表示、消去を行う
|
||||
if (sact.draggedsp == NULL && e->type == AGSEVENT_MOUSE_MOTION) {
|
||||
// focus を失った sprite の 説明 sprite の消去
|
||||
// focus を失った sprite の 説明 sprite の消去
|
||||
if (defocused_sp) {
|
||||
sprite_t *sp = defocused_sp;
|
||||
if (sp->expsp) {
|
||||
@@ -351,7 +351,7 @@ static void cb_waitkey_sprite(agsevent_t *e) {
|
||||
}
|
||||
}
|
||||
|
||||
// focus を得た sprite の 説明 sprite の表示
|
||||
// focus を得た sprite の 説明 sprite の表示
|
||||
if (focused_sp) {
|
||||
sprite_t *sp = focused_sp;
|
||||
if (sp->expsp) {
|
||||
@@ -360,14 +360,14 @@ static void cb_waitkey_sprite(agsevent_t *e) {
|
||||
}
|
||||
}
|
||||
|
||||
// 表示状態に変更があればその領域を更新
|
||||
// 表示状態に変更があればその領域を更新
|
||||
if (update) {
|
||||
sp_update_clipped();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
選択肢 Window Open 時の callback
|
||||
選択肢 Window Open 時の callback
|
||||
*/
|
||||
static void cb_waitkey_selection(agsevent_t *e) {
|
||||
switch (e->type) {
|
||||
@@ -382,7 +382,7 @@ static void cb_waitkey_selection(agsevent_t *e) {
|
||||
}
|
||||
|
||||
/*
|
||||
バックログ参照時
|
||||
バックログ参照時
|
||||
*/
|
||||
static void cb_waitkey_backlog(agsevent_t *e) {
|
||||
switch (e->type) {
|
||||
@@ -425,10 +425,10 @@ static void cb_waitkey_backlog(agsevent_t *e) {
|
||||
}
|
||||
|
||||
/*
|
||||
X|SDL のイベントディスパッチャからくる最初の場所
|
||||
X|SDL のイベントディスパッチャからくる最初の場所
|
||||
*/
|
||||
void spev_callback(agsevent_t *e) {
|
||||
// menu open中は無視
|
||||
// menu open中は無視
|
||||
if (nact->popupmenu_opened) {
|
||||
return;
|
||||
}
|
||||
@@ -471,7 +471,7 @@ void spev_callback(agsevent_t *e) {
|
||||
}
|
||||
|
||||
/*
|
||||
各スプライト毎のイベント callback の登録
|
||||
各スプライト毎のイベント callback の登録
|
||||
*/
|
||||
void spev_add_eventlistener(sprite_t *sp, int (*cb)(sprite_t *, agsevent_t *)) {
|
||||
sp->eventcb = cb;
|
||||
@@ -479,7 +479,7 @@ void spev_add_eventlistener(sprite_t *sp, int (*cb)(sprite_t *, agsevent_t *)) {
|
||||
}
|
||||
|
||||
/*
|
||||
上で登録した callback の削除
|
||||
上で登録した callback の削除
|
||||
*/
|
||||
void spev_remove_eventlistener(sprite_t *sp) {
|
||||
sact.eventlisteners = g_slist_remove(sact.eventlisteners, sp);
|
||||
|
||||
+15
-15
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sprite_get.c: ゲットA/Bスプライト特有の処理
|
||||
* sprite_get.c: ゲットA/Bスプライト特有の処理
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -37,8 +37,8 @@ static int eventCB_GET(sprite_t *sp, agsevent_t *e);
|
||||
static void cb_remove(sprite_t *sp);
|
||||
|
||||
/*
|
||||
説明スプライトの消去
|
||||
dragが始まったら説明スプライトは消去する
|
||||
説明スプライトの消去
|
||||
dragが始まったら説明スプライトは消去する
|
||||
*/
|
||||
static void cb_defocused_swsp(gpointer s, gpointer data) {
|
||||
sprite_t *sp = (sprite_t *)s;
|
||||
@@ -53,7 +53,7 @@ static void cb_defocused_swsp(gpointer s, gpointer data) {
|
||||
}
|
||||
|
||||
|
||||
//ゲットスプライトのイベント処理
|
||||
//ゲットスプライトのイベント処理
|
||||
static int eventCB_GET(sprite_t *sp, agsevent_t *e) {
|
||||
int update = 0;
|
||||
|
||||
@@ -61,7 +61,7 @@ static int eventCB_GET(sprite_t *sp, agsevent_t *e) {
|
||||
case AGSEVENT_BUTTON_PRESS:
|
||||
if (e->d3 != AGSEVENT_BUTTON_LEFT) break;
|
||||
|
||||
// drag開始時のマウスの位置記録
|
||||
// drag開始時のマウスの位置記録
|
||||
sp->u.get.dragging = TRUE;
|
||||
sp->u.get.dragstart.x = e->d1;
|
||||
sp->u.get.dragstart.y = e->d2;
|
||||
@@ -72,16 +72,16 @@ static int eventCB_GET(sprite_t *sp, agsevent_t *e) {
|
||||
sp_updateme(sp);
|
||||
}
|
||||
|
||||
// スプライトの表示を一番前に持って来る
|
||||
// スプライトの表示を一番前に持って来る
|
||||
sact.draggedsp = sp;
|
||||
sact.dropped = FALSE;
|
||||
|
||||
// 説明スプライトがある場合は、それを非表示にする
|
||||
// 説明スプライトがある場合は、それを非表示にする
|
||||
if (sp->expsp) {
|
||||
g_slist_foreach(sp->expsp, cb_defocused_swsp, &update);
|
||||
}
|
||||
|
||||
// SpriteSoundがあれば、それを鳴らす
|
||||
// SpriteSoundがあれば、それを鳴らす
|
||||
if (sp->numsound2) {
|
||||
ssnd_play(sp->numsound2);
|
||||
}
|
||||
@@ -89,7 +89,7 @@ static int eventCB_GET(sprite_t *sp, agsevent_t *e) {
|
||||
break;
|
||||
|
||||
case AGSEVENT_BUTTON_RELEASE:
|
||||
// どのボタンでもドラッグ中止|終了
|
||||
// どのボタンでもドラッグ中止|終了
|
||||
|
||||
if (!sp->u.get.dragging) break;
|
||||
|
||||
@@ -100,11 +100,11 @@ static int eventCB_GET(sprite_t *sp, agsevent_t *e) {
|
||||
{
|
||||
int newx, newy;
|
||||
|
||||
// MOUSE MOTION は dragg中にしか呼ばれないから
|
||||
// これは不要
|
||||
// MOUSE MOTION は dragg中にしか呼ばれないから
|
||||
// これは不要
|
||||
// if (!sp->u.get.dragging) break;
|
||||
|
||||
// マウスの現在位置により新しい場所を計算
|
||||
// マウスの現在位置により新しい場所を計算
|
||||
newx = sp->loc.x + (e->d1 - sp->u.get.dragstart.x);
|
||||
newy = sp->loc.y + (e->d2 - sp->u.get.dragstart.y);
|
||||
if (newx != sp->cur.x || newy != sp->cur.y) {
|
||||
@@ -120,14 +120,14 @@ static int eventCB_GET(sprite_t *sp, agsevent_t *e) {
|
||||
return update;
|
||||
}
|
||||
|
||||
// スプライト削除時の処理
|
||||
// スプライト削除時の処理
|
||||
static void cb_remove(sprite_t *sp) {
|
||||
spev_remove_eventlistener(sp);
|
||||
}
|
||||
|
||||
/*
|
||||
sp_new の時にスプライトの種類毎の初期化
|
||||
@param sp: 初期化するスプライト
|
||||
sp_new の時にスプライトの種類毎の初期化
|
||||
@param sp: 初期化するスプライト
|
||||
*/
|
||||
int sp_get_setup(sprite_t *sp) {
|
||||
spev_add_eventlistener(sp, eventCB_GET);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sprite_keywait.c: スプライトキー待ち
|
||||
* sprite_keywait.c: スプライトキー待ち
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -44,7 +44,7 @@ static boolean waitcond(int endtime);
|
||||
|
||||
|
||||
|
||||
// じわじわ消す
|
||||
// じわじわ消す
|
||||
static void hidesprite(sprite_t *sp) {
|
||||
int i;
|
||||
|
||||
@@ -61,11 +61,11 @@ static void hidesprite(sprite_t *sp) {
|
||||
}
|
||||
|
||||
/*
|
||||
キー待ち終了の条件チェック
|
||||
@param endtime: 終了時間
|
||||
@return: 終了なら TRUE、継続なら FALSE
|
||||
キー待ち終了の条件チェック
|
||||
@param endtime: 終了時間
|
||||
@return: 終了なら TRUE、継続なら FALSE
|
||||
|
||||
スプライトがドロップされた時の各種処理を含む
|
||||
スプライトがドロップされた時の各種処理を含む
|
||||
*/
|
||||
static boolean waitcond(int endtime) {
|
||||
int curtime = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
@@ -74,7 +74,7 @@ static boolean waitcond(int endtime) {
|
||||
if (sact.dropped) {
|
||||
sact.draggedsp->u.get.dragging = FALSE;
|
||||
if (sact.waitkey != -1) {
|
||||
// dropしたスプライトをじわじわ消す
|
||||
// dropしたスプライトをじわじわ消す
|
||||
hidesprite(sact.draggedsp);
|
||||
sact.sp_result_get = sact.draggedsp->no;
|
||||
sact.sp_result_put = sact.waitkey;
|
||||
@@ -83,17 +83,17 @@ static boolean waitcond(int endtime) {
|
||||
sact.dropped = FALSE;
|
||||
return TRUE;
|
||||
} else {
|
||||
// PUT/SWPUTスプライト以外のところにdropした場合
|
||||
// PUT/SWPUTスプライト以外のところにdropした場合
|
||||
sprite_t *sp = sact.draggedsp;
|
||||
if (sact.draggedsp->type == SPRITE_GETA) {
|
||||
// もとの場所にゆっくり戻す
|
||||
// もとの場所にゆっくり戻す
|
||||
spev_move_waitend(sp, sp->loc.x, sp->loc.y, 150);
|
||||
} else {
|
||||
// その場所に留まる
|
||||
// その場所に留まる
|
||||
sp->loc = sp->cur;
|
||||
}
|
||||
|
||||
// drop音があれば、鳴らす
|
||||
// drop音があれば、鳴らす
|
||||
if (sact.draggedsp->numsound3) {
|
||||
ssnd_play(sact.draggedsp->numsound3);
|
||||
}
|
||||
@@ -102,26 +102,26 @@ static boolean waitcond(int endtime) {
|
||||
}
|
||||
}
|
||||
|
||||
// その他キー入力があれば終了
|
||||
// その他キー入力があれば終了
|
||||
return sact.waitkey == -1 ? FALSE : TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
スプライトキー待ち
|
||||
@param vOK: 0ならば右クリック
|
||||
@param vRND: スイッチスプライトの番号
|
||||
@param vD01: ゲットスプライトの番号
|
||||
@param vD02: プットスプライトの番号
|
||||
@param vD03: タイムアウトした場合=1, しない場合=0
|
||||
@param wTime: タイムアウト時間 (1/100sec)
|
||||
スプライトキー待ち
|
||||
@param vOK: 0ならば右クリック
|
||||
@param vRND: スイッチスプライトの番号
|
||||
@param vD01: ゲットスプライトの番号
|
||||
@param vD02: プットスプライトの番号
|
||||
@param vD03: タイムアウトした場合=1, しない場合=0
|
||||
@param wTime: タイムアウト時間 (1/100sec)
|
||||
*/
|
||||
int sp_keywait(int *vOK, int *vRND, int *vD01, int *vD02, int *vD03, int timeout) {
|
||||
int curtime, endtime;
|
||||
|
||||
// とりあえず全更新
|
||||
// とりあえず全更新
|
||||
sp_update_all(TRUE);
|
||||
|
||||
// depthmap を準備
|
||||
// depthmap を準備
|
||||
g_slist_foreach(sact.updatelist, sp_draw_dmap, NULL);
|
||||
|
||||
sact.waittype = KEYWAIT_SPRITE;
|
||||
@@ -132,8 +132,8 @@ int sp_keywait(int *vOK, int *vRND, int *vD01, int *vD02, int *vD03, int timeout
|
||||
sact.draggedsp = NULL;
|
||||
|
||||
{
|
||||
// とりあえず、現在のマウス位置を送って、switch sprite の
|
||||
// 状態を更新しておく
|
||||
// とりあえず、現在のマウス位置を送って、switch sprite の
|
||||
// 状態を更新しておく
|
||||
agsevent_t agse;
|
||||
MyPoint p;
|
||||
sys_getMouseInfo(&p, FALSE);
|
||||
@@ -144,17 +144,17 @@ int sp_keywait(int *vOK, int *vRND, int *vD01, int *vD02, int *vD03, int timeout
|
||||
nact->ags.eventcb(&agse);
|
||||
}
|
||||
|
||||
// 終了時間の計算
|
||||
// 終了時間の計算
|
||||
curtime = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
endtime = timeout < 0 ? G_MAXINT: (curtime + timeout * 10);
|
||||
|
||||
// スプライトキー待ちメイン
|
||||
// スプライトキー待ちメイン
|
||||
while (!waitcond(endtime)) {
|
||||
sys_keywait(25, TRUE);
|
||||
}
|
||||
|
||||
if (sact.waitkey == 0) {
|
||||
// 右クリックキャンセル
|
||||
// 右クリックキャンセル
|
||||
*vOK = 0;
|
||||
if (vD03) *vD03 = 0;
|
||||
} else if (sact.waitkey == -1) {
|
||||
|
||||
+34
-34
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sprite_move.c: スプライトの移動に関する各種処理
|
||||
* sprite_move.c: スプライトの移動に関する各種処理
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -37,11 +37,11 @@
|
||||
|
||||
/*
|
||||
|
||||
SP_MOVE によるスプライトの移動は、SACT.Drawが発行されると同時に
|
||||
移動を開始し、全ての移動が終了するまで待つ。
|
||||
SP_MOVE によるスプライトの移動は、SACT.Drawが発行されると同時に
|
||||
移動を開始し、全ての移動が終了するまで待つ。
|
||||
|
||||
移動が開始されるまでに削除、または新規に作成されたスプライトは
|
||||
移動しないので注意
|
||||
移動が開始されるまでに削除、または新規に作成されたスプライトは
|
||||
移動しないので注意
|
||||
|
||||
*/
|
||||
|
||||
@@ -49,54 +49,54 @@
|
||||
static void move_drain(sprite_t *sp);
|
||||
static int move_cb(sprite_t *sp, agsevent_t *e);
|
||||
|
||||
// SP_MOVEコマンドの後始末
|
||||
// SP_MOVEコマンドの後始末
|
||||
static void move_drain(sprite_t *sp) {
|
||||
// 古い場所のupdate
|
||||
// 古い場所のupdate
|
||||
sp_updateme(sp);
|
||||
|
||||
// 最終移動場所にスプライト位置をセット
|
||||
// 最終移動場所にスプライト位置をセット
|
||||
sp->cur = sp->loc = sp->move.to;
|
||||
|
||||
// あたらしい場所のupdate
|
||||
// あたらしい場所のupdate
|
||||
sp_updateme(sp);
|
||||
|
||||
// 後で、movelist から外してもらうための処理
|
||||
// 後で、movelist から外してもらうための処理
|
||||
sact.teventremovelist = g_slist_append(sact.teventremovelist, sp);
|
||||
|
||||
sp->move.moving = FALSE;
|
||||
sp->move.time = 0; // 移動時間の初期化
|
||||
sp->move.time = 0; // 移動時間の初期化
|
||||
}
|
||||
|
||||
// SP_MOVE の timer event callback
|
||||
// SP_MOVE の timer event callback
|
||||
static int move_cb(sprite_t *sp, agsevent_t *e) {
|
||||
int t, update = 0;
|
||||
int now, newx, newy;
|
||||
|
||||
// 現在時刻の取得
|
||||
// 現在時刻の取得
|
||||
now = sact.movecurtime;
|
||||
|
||||
WARNING("no = %d now = %d st = %d, ed = %d\n",
|
||||
sp->no, now, sp->move.starttime, sp->move.endtime);
|
||||
|
||||
if (now >= sp->move.endtime) {
|
||||
// 時間オーバーなら、最終位置に移動してMOVE終了
|
||||
// 時間オーバーなら、最終位置に移動してMOVE終了
|
||||
move_drain(sp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// 経過時間
|
||||
// 経過時間
|
||||
t = now - sp->move.starttime;
|
||||
|
||||
newx = sp->loc.x + t * (sp->move.to.x - sp->loc.x) / sp->move.time;
|
||||
newy = sp->loc.y + t * (sp->move.to.y - sp->loc.y) / sp->move.time;
|
||||
|
||||
// 移動していたら新しい位置を記録して書き換えを指示
|
||||
// 移動していたら新しい位置を記録して書き換えを指示
|
||||
if (newx != sp->cur.x || newy != sp->cur.y) {
|
||||
// 古い場所のupdate
|
||||
// 古い場所のupdate
|
||||
sp_updateme(sp);
|
||||
sp->cur.x = newx;
|
||||
sp->cur.y = newy;
|
||||
// 新しい場所のupdate
|
||||
// 新しい場所のupdate
|
||||
sp_updateme(sp);
|
||||
update++;
|
||||
} else {
|
||||
@@ -107,33 +107,33 @@ static int move_cb(sprite_t *sp, agsevent_t *e) {
|
||||
}
|
||||
|
||||
/*
|
||||
SP_MOVEコマンド、移動の準備
|
||||
SP_MOVEコマンド、移動の準備
|
||||
@param data: sprite
|
||||
@param userdata: 未使用
|
||||
@param userdata: 未使用
|
||||
*/
|
||||
void spev_move_setup(gpointer data, gpointer userdata) {
|
||||
sprite_t *sp = (sprite_t *)data;
|
||||
|
||||
// 非表示のものは移動しない(いいのかな)
|
||||
// 非表示のものは移動しない(いいのかな)
|
||||
if (!sp->show) return;
|
||||
|
||||
// move 開始時刻の記録
|
||||
// move 開始時刻の記録
|
||||
sp->move.starttime = sact.movestarttime;
|
||||
sp->move.moving = TRUE;
|
||||
|
||||
// MOVE_SPEED で設定した場合は、移動量を考慮して移動時間を決定
|
||||
// MOVE_SPEED で設定した場合は、移動量を考慮して移動時間を決定
|
||||
if (sp->move.time == -1) {
|
||||
// speed から timeへ
|
||||
// speed から timeへ
|
||||
int dx = sp->move.to.x - sp->loc.x;
|
||||
int dy = sp->move.to.y - sp->loc.y;
|
||||
int d = (int)sqrt(dx*dx+dy*dy);
|
||||
sp->move.time = d * 100 / sp->move.speed;
|
||||
}
|
||||
|
||||
// move 終了予定時刻
|
||||
// move 終了予定時刻
|
||||
sp->move.endtime = sp->move.starttime + sp->move.time;
|
||||
|
||||
// タイマコールバック登録
|
||||
// タイマコールバック登録
|
||||
spev_add_teventlistener(sp, move_cb);
|
||||
|
||||
WARNING("no=%d,from(%d,%d@%d)to(%d,%d@%d),time=%d\n", sp->no,
|
||||
@@ -144,11 +144,11 @@ void spev_move_setup(gpointer data, gpointer userdata) {
|
||||
}
|
||||
|
||||
/*
|
||||
スプライトの移動先を指定し、移動先にくるまで待つ
|
||||
@param sp: 対象スプライト
|
||||
@param dx: 移動先X座標
|
||||
@param dy: 移動先Y座標
|
||||
@param time: 移動速度
|
||||
スプライトの移動先を指定し、移動先にくるまで待つ
|
||||
@param sp: 対象スプライト
|
||||
@param dx: 移動先X座標
|
||||
@param dy: 移動先Y座標
|
||||
@param time: 移動速度
|
||||
*/
|
||||
void spev_move_waitend(sprite_t *sp, int dx, int dy, int time) {
|
||||
sp->loc = sp->cur;
|
||||
@@ -169,13 +169,13 @@ void spev_move_waitend(sprite_t *sp, int dx, int dy, int time) {
|
||||
}
|
||||
|
||||
/*
|
||||
全ての移動中のスプライトが移動完了するのを待つ
|
||||
全ての移動中のスプライトが移動完了するのを待つ
|
||||
*/
|
||||
void spev_wait4moving_sp() {
|
||||
GSList *node;
|
||||
|
||||
// 移動中のスプライトは sact.updatelist にあるはずだから
|
||||
// そのなかのスプライトについて、移動中かどうかのフラグをチェック
|
||||
// 移動中のスプライトは sact.updatelist にあるはずだから
|
||||
// そのなかのスプライトについて、移動中かどうかのフラグをチェック
|
||||
for (node = sact.updatelist; node; node = node->next) {
|
||||
sprite_t *sp = (sprite_t *)node->data;
|
||||
if (sp == NULL) continue;
|
||||
|
||||
+65
-65
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sprite_msg.c: メッセージスプライトの処理
|
||||
* sprite_msg.c: メッセージスプライトの処理
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -41,7 +41,7 @@
|
||||
#include "sactlog.h"
|
||||
#include "eucsjis.h"
|
||||
|
||||
// メッセージキー待ちの時、表示するアニメーションに関する情報
|
||||
// メッセージキー待ちの時、表示するアニメーションに関する情報
|
||||
struct markinfo {
|
||||
sprite_t *sp;
|
||||
cginfo_t *cg;
|
||||
@@ -60,13 +60,13 @@ static void sactlog_newline();
|
||||
static void set_align(char *msg, sprite_t *sp, int wSize, int wAlign);
|
||||
|
||||
|
||||
// 文字列置き換え用 (表示時にon-the-flyで変換して表示)
|
||||
// 文字列置き換え用 (表示時にon-the-flyで変換して表示)
|
||||
#define REPLACEBUFSIZE MSGBUFMAX+100
|
||||
static char repbuf[2][REPLACEBUFSIZE];
|
||||
static char *replacesrc;
|
||||
static char *replacedst;
|
||||
|
||||
// 指定の番号のスプライトがメッセージスプライトかどうかをチェック
|
||||
// 指定の番号のスプライトがメッセージスプライトかどうかをチェック
|
||||
static boolean is_messagesprite(int wNum) {
|
||||
// check sprite number is sane
|
||||
if (wNum >= (SPRITEMAX -1) || wNum <= 0) return FALSE;
|
||||
@@ -80,7 +80,7 @@ static boolean is_messagesprite(int wNum) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// 文字列の置き換え処理
|
||||
// 文字列の置き換え処理
|
||||
static void replacestr_cb(gpointer data, gpointer userdata) {
|
||||
strexchange_t *ex = (strexchange_t *)data;
|
||||
char *start, *next, *out;
|
||||
@@ -104,7 +104,7 @@ static void replacestr_cb(gpointer data, gpointer userdata) {
|
||||
replacedst[0] = '\0';
|
||||
}
|
||||
|
||||
// 文字列の置き換え
|
||||
// 文字列の置き換え
|
||||
static char *replacestr(char *msg) {
|
||||
if (sact.strreplace == NULL) return msg;
|
||||
|
||||
@@ -118,7 +118,7 @@ static char *replacestr(char *msg) {
|
||||
return (repbuf[0][0] == '\0') ? repbuf[1] : repbuf[0];
|
||||
}
|
||||
|
||||
// アニメパターンの描画
|
||||
// アニメパターンの描画
|
||||
static void update_mark(sprite_t *sp, cginfo_t *cg) {
|
||||
boolean show = sp->show;
|
||||
cginfo_t *curcg = sp->curcg;
|
||||
@@ -133,7 +133,7 @@ static void update_mark(sprite_t *sp, cginfo_t *cg) {
|
||||
sp->curcg = curcg;
|
||||
}
|
||||
|
||||
// アニメパターンの初期化
|
||||
// アニメパターンの初期化
|
||||
static int setupmark(int wNum1, int wNum2, struct markinfo *minfo) {
|
||||
sprite_t *sp1, *sp2;
|
||||
int i = 0;
|
||||
@@ -184,10 +184,10 @@ static int setupmark(int wNum1, int wNum2, struct markinfo *minfo) {
|
||||
}
|
||||
|
||||
/*
|
||||
メッセージをバッファに追加
|
||||
nact.cのメッセージ・コマンド解析ルーチンから呼ばれる
|
||||
メッセージをバッファに追加
|
||||
nact.cのメッセージ・コマンド解析ルーチンから呼ばれる
|
||||
|
||||
@param msg: 追加する文字列
|
||||
@param msg: 追加する文字列
|
||||
*/
|
||||
void smsg_add(char *msg) {
|
||||
int len;
|
||||
@@ -211,11 +211,11 @@ void smsg_add(char *msg) {
|
||||
}
|
||||
|
||||
/*
|
||||
改行
|
||||
改行はメッセージ情報内につっこみ、出力時に改行幅を取り出して改行
|
||||
改行
|
||||
改行はメッセージ情報内につっこみ、出力時に改行幅を取り出して改行
|
||||
|
||||
@param wNum: 改行するスプライト番号
|
||||
@param size: 改行幅
|
||||
@param wNum: 改行するスプライト番号
|
||||
@param size: 改行幅
|
||||
*/
|
||||
void smsg_newline(int wNum, int size) {
|
||||
BYTE buf[3];
|
||||
@@ -229,48 +229,48 @@ void smsg_newline(int wNum, int size) {
|
||||
}
|
||||
|
||||
/*
|
||||
(ルビつき)メッセージの出力
|
||||
(ルビつき)メッセージの出力
|
||||
|
||||
@param wSpriteNumber: メッセージを表示するメッセージスプライト番号
|
||||
@param wSize: フォントの大きさ
|
||||
@param wColorR: メッセージの色(Red)
|
||||
@param wColorG: メッセージの色(Green)
|
||||
@param wColorB: メッセージの色(Blue)
|
||||
@param wFont: メッセージのフォント(0:ゴシック, 1:明朝)
|
||||
@param wSpeed: メッセージの表示速度 (msec)
|
||||
@param wLineSpace: 行間スペース
|
||||
@param wAlign: 行そろえ
|
||||
@param wRSize: ルビフォントサイズ
|
||||
@param wRFont: ルビフォント
|
||||
@param wRLineSpace: ルビと本文の文字間隔
|
||||
@param wSpriteNumber: メッセージを表示するメッセージスプライト番号
|
||||
@param wSize: フォントの大きさ
|
||||
@param wColorR: メッセージの色(Red)
|
||||
@param wColorG: メッセージの色(Green)
|
||||
@param wColorB: メッセージの色(Blue)
|
||||
@param wFont: メッセージのフォント(0:ゴシック, 1:明朝)
|
||||
@param wSpeed: メッセージの表示速度 (msec)
|
||||
@param wLineSpace: 行間スペース
|
||||
@param wAlign: 行そろえ
|
||||
@param wRSize: ルビフォントサイズ
|
||||
@param wRFont: ルビフォント
|
||||
@param wRLineSpace: ルビと本文の文字間隔
|
||||
@param vLength: ???
|
||||
*/
|
||||
void smsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wFont, int wSpeed, int wLineSpace, int wAlign, int wRSize, int wRFont, int wRLineSpace, int *wLength) {
|
||||
char *msg;
|
||||
sprite_t *sp;
|
||||
int len = 0; // 処理した文字数?
|
||||
int len = 0; // 処理した文字数?
|
||||
boolean needupdate = FALSE;
|
||||
MyRectangle uparea = {0,0,0,0};
|
||||
|
||||
// wRSize == 0 -> ルビ無し(SACT.MessageOutputからの呼出)
|
||||
// wRSize == 0 -> ルビ無し(SACT.MessageOutputからの呼出)
|
||||
|
||||
if (sact.msgbuf[0] == '\0') return;
|
||||
|
||||
if (!is_messagesprite(wNum)) return;
|
||||
|
||||
// MessageSkip中は文字送り速度を最大に
|
||||
// MessageSkip中は文字送り速度を最大に
|
||||
if (sact.waitskiplv > 1) wSpeed = 0;
|
||||
|
||||
// shortcut
|
||||
sp = sact.sp[wNum];
|
||||
|
||||
// update開始Y座標 (X座標は0固定)
|
||||
// update開始Y座標 (X座標は0固定)
|
||||
uparea.y = sp->u.msg.dspcur.y;
|
||||
|
||||
// 文字列置換
|
||||
// 文字列置換
|
||||
msg = replacestr(sact.msgbuf);
|
||||
|
||||
// 文字アラインメントの調整
|
||||
// 文字アラインメントの調整
|
||||
set_align(msg, sp, wSize, wAlign);
|
||||
|
||||
while (*msg) {
|
||||
@@ -345,10 +345,10 @@ void smsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wF
|
||||
|
||||
sactlog_newline();
|
||||
|
||||
// バッファリング中の文字のクリア
|
||||
// バッファリング中の文字のクリア
|
||||
sact.msgbuf[0] = '\0';
|
||||
|
||||
// Waitなしの出力は最後にupdate
|
||||
// Waitなしの出力は最後にupdate
|
||||
if (needupdate) {
|
||||
uparea.width = sp->cursize.width;
|
||||
uparea.height = min(sp->cursize.height, uparea.y - sp->u.msg.dspcur.y + wLineSpace + wLineSpace + wRSize);
|
||||
@@ -362,8 +362,8 @@ void smsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wF
|
||||
}
|
||||
|
||||
/*
|
||||
メッセージ領域のクリア
|
||||
@param wNum: クリアするスプライト番号
|
||||
メッセージ領域のクリア
|
||||
@param wNum: クリアするスプライト番号
|
||||
*/
|
||||
void smsg_clear(int wNum) {
|
||||
sprite_t *sp;
|
||||
@@ -371,7 +371,7 @@ void smsg_clear(int wNum) {
|
||||
|
||||
if (!is_messagesprite(wNum)) return;
|
||||
|
||||
// 表示位置の初期化
|
||||
// 表示位置の初期化
|
||||
sp = sact.sp[wNum];
|
||||
sp->u.msg.dspcur.x = 0;
|
||||
sp->u.msg.dspcur.y = 0;
|
||||
@@ -379,7 +379,7 @@ void smsg_clear(int wNum) {
|
||||
sact.msgbuf[0] = '\0';
|
||||
sact.msgbuf2[0] = '\0';
|
||||
|
||||
// キャンバスのクリア
|
||||
// キャンバスのクリア
|
||||
sf = sp->u.msg.canvas;
|
||||
memset(sf->pixel, 0, sf->bytes_per_line * sf->height);
|
||||
memset(sf->alpha, 0, sf->width * sf->height);
|
||||
@@ -392,17 +392,17 @@ void smsg_clear(int wNum) {
|
||||
}
|
||||
|
||||
/*
|
||||
出力中の文字列があるかチェック
|
||||
@return: なし(0) , あり(1)
|
||||
出力中の文字列があるかチェック
|
||||
@return: なし(0) , あり(1)
|
||||
*/
|
||||
int smsg_is_empty() {
|
||||
return (sact.msgbuf[0] != '\0');
|
||||
}
|
||||
|
||||
/*
|
||||
メッセージキー入力待ち
|
||||
@param wNum1: スプライト番号1(アニメーションスプライト)
|
||||
@param wNum2: スプライト番号2(アニメーションスプライト)
|
||||
メッセージキー入力待ち
|
||||
@param wNum1: スプライト番号1(アニメーションスプライト)
|
||||
@param wNum2: スプライト番号2(アニメーションスプライト)
|
||||
@param msglen: ?
|
||||
*/
|
||||
int smsg_keywait(int wNum1, int wNum2, int msglen) {
|
||||
@@ -411,7 +411,7 @@ int smsg_keywait(int wNum1, int wNum2, int msglen) {
|
||||
|
||||
if (sact.waitskiplv > 0) return 0;
|
||||
|
||||
// アニメパターンの初期化
|
||||
// アニメパターンの初期化
|
||||
maxstep = setupmark(wNum1, wNum2, minfo);
|
||||
|
||||
sact.waittype = KEYWAIT_MESSAGE;
|
||||
@@ -421,9 +421,9 @@ int smsg_keywait(int wNum1, int wNum2, int msglen) {
|
||||
int st = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
int interval = 25;
|
||||
|
||||
// アニメパターンがある場合、その更新
|
||||
// Zキーで隠されているとは表示しない
|
||||
// (アニメパターンが隠す対象でない時はどうしよう...)
|
||||
// アニメパターンがある場合、その更新
|
||||
// Zキーで隠されているとは表示しない
|
||||
// (アニメパターンが隠す対象でない時はどうしよう...)
|
||||
if (maxstep &&
|
||||
!sact.zhiding &&
|
||||
sact.waittype != KEYWAIT_BACKLOG) {
|
||||
@@ -441,15 +441,15 @@ int smsg_keywait(int wNum1, int wNum2, int msglen) {
|
||||
}
|
||||
|
||||
/*
|
||||
スプライト再描画のコールバック
|
||||
@param sp: 再描画するスプライト
|
||||
スプライト再描画のコールバック
|
||||
@param sp: 再描画するスプライト
|
||||
*/
|
||||
int smsg_update(sprite_t *sp) {
|
||||
int sx, sy, w, h, dx, dy;
|
||||
surface_t update;
|
||||
|
||||
// canvas が clean のときはなにもしない
|
||||
// -> 説明スプライトのように、SetShowされたときに対応できないからだめ
|
||||
// canvas が clean のときはなにもしない
|
||||
// -> 説明スプライトのように、SetShowされたときに対応できないからだめ
|
||||
//if (sact.msgbufempty) return OK;
|
||||
|
||||
update.width = sact.updaterect.width;
|
||||
@@ -478,7 +478,7 @@ int smsg_update(sprite_t *sp) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 改行を含む文字列バッファ中から、改行までの文字列の長さを取り出す
|
||||
// 改行を含む文字列バッファ中から、改行までの文字列の長さを取り出す
|
||||
static int get_linelen(BYTE *msg) {
|
||||
int c = 0;
|
||||
|
||||
@@ -501,14 +501,14 @@ static int get_linelen(BYTE *msg) {
|
||||
return c;
|
||||
}
|
||||
|
||||
// 改行やルビを含む文字列バッファからそれらを取り出す
|
||||
// 改行の場合 : 改行幅もいっしょに
|
||||
// ルビつき文字の場合: メッセージ本体と対応するルビ文字列
|
||||
// それ以外 : 全角|半角文字1文字
|
||||
// 改行やルビを含む文字列バッファからそれらを取り出す
|
||||
// 改行の場合 : 改行幅もいっしょに
|
||||
// ルビつき文字の場合: メッセージ本体と対応するルビ文字列
|
||||
// それ以外 : 全角|半角文字1文字
|
||||
static BYTE *get_char(BYTE *msg, char *mbuf, char *rbuf, int bufmax) {
|
||||
int c1, i;
|
||||
|
||||
// 改行
|
||||
// 改行
|
||||
if (msg[0] == '\n') {
|
||||
mbuf[0] = '\n';
|
||||
mbuf[1] = msg[1];
|
||||
@@ -516,7 +516,7 @@ static BYTE *get_char(BYTE *msg, char *mbuf, char *rbuf, int bufmax) {
|
||||
return msg +2;
|
||||
}
|
||||
|
||||
// ルビつき文字
|
||||
// ルビつき文字
|
||||
if (0 == strncmp("|RB|", msg, 4)) {
|
||||
msg += 4;
|
||||
for (i = 0; *msg != '|' && i < bufmax; i++) {
|
||||
@@ -540,7 +540,7 @@ static BYTE *get_char(BYTE *msg, char *mbuf, char *rbuf, int bufmax) {
|
||||
return msg;
|
||||
}
|
||||
|
||||
// バックログ用バッファに追加
|
||||
// バックログ用バッファに追加
|
||||
static void append_to_log(char *msg) {
|
||||
if (sact.logging) {
|
||||
int len = MSGBUFMAX - (int)strlen(sact.msgbuf2);
|
||||
@@ -549,7 +549,7 @@ static void append_to_log(char *msg) {
|
||||
}
|
||||
}
|
||||
|
||||
// バックログを保存するリストに追加
|
||||
// バックログを保存するリストに追加
|
||||
static void sactlog_newline() {
|
||||
if (sact.logging) {
|
||||
if (sact.msgbuf2[0] == '\0') return;
|
||||
@@ -558,17 +558,17 @@ static void sactlog_newline() {
|
||||
}
|
||||
}
|
||||
|
||||
// 書き出し位置がx=0の時のみアラインメントの調整を行う
|
||||
// 書き出し位置がx=0の時のみアラインメントの調整を行う
|
||||
static void set_align(char *msg, sprite_t *sp, int wSize, int wAlign) {
|
||||
if (sp->u.msg.dspcur.x == 0) {
|
||||
int mlen = get_linelen(msg) * wSize/2;
|
||||
int adjx = 0;
|
||||
|
||||
switch (wAlign) {
|
||||
case 1: // センタリング
|
||||
case 1: // センタリング
|
||||
adjx = (sp->cursize.width - mlen) / 2;
|
||||
break;
|
||||
case 2: // 右寄せ
|
||||
case 2: // 右寄せ
|
||||
adjx = (sp->cursize.width - mlen);
|
||||
break;
|
||||
}
|
||||
|
||||
+10
-10
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sprite_put.c: プット・スイッチプットスプライト特有の処理
|
||||
* sprite_put.c: プット・スイッチプットスプライト特有の処理
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -35,7 +35,7 @@
|
||||
static int eventCB_PUT(sprite_t *sp, agsevent_t *e);
|
||||
static void cb_remove(sprite_t *sp);
|
||||
|
||||
// プットスプライトのイベント処理
|
||||
// プットスプライトのイベント処理
|
||||
static int eventCB_PUT(sprite_t *sp, agsevent_t *e) {
|
||||
int update = 0;
|
||||
|
||||
@@ -43,7 +43,7 @@ static int eventCB_PUT(sprite_t *sp, agsevent_t *e) {
|
||||
case AGSEVENT_BUTTON_PRESS:
|
||||
if (e->d3 != AGSEVENT_BUTTON_LEFT) return 0;
|
||||
|
||||
// ボタン押下時のスプライトがあれば、それを表示
|
||||
// ボタン押下時のスプライトがあれば、それを表示
|
||||
if (sp->cg3) {
|
||||
sp->curcg = sp->cg3;
|
||||
update++;
|
||||
@@ -62,14 +62,14 @@ static int eventCB_PUT(sprite_t *sp, agsevent_t *e) {
|
||||
ssnd_play(sp->numsound3);
|
||||
}
|
||||
} else {
|
||||
// スイッチプットスプライトの決定の処理
|
||||
// スイッチプットスプライトの決定の処理
|
||||
if (sp->cg2) {
|
||||
sp->curcg = sp->cg2;
|
||||
update++;
|
||||
}
|
||||
|
||||
// pressされたスプライトとreleaseされたスプライト
|
||||
// が同じ場合のみ、そのスプライトが押されたと判断
|
||||
// pressされたスプライトとreleaseされたスプライト
|
||||
// が同じ場合のみ、そのスプライトが押されたと判断
|
||||
if (sp->pressed) {
|
||||
sact.sp_result_sw = sp->no;
|
||||
sact.waitkey = sp->no;
|
||||
@@ -89,15 +89,15 @@ static int eventCB_PUT(sprite_t *sp, agsevent_t *e) {
|
||||
return update;
|
||||
}
|
||||
|
||||
// スプライト削除時の処理
|
||||
// スプライト削除時の処理
|
||||
static void cb_remove(sprite_t *sp) {
|
||||
// event listener の削除
|
||||
// event listener の削除
|
||||
spev_remove_eventlistener(sp);
|
||||
}
|
||||
|
||||
/*
|
||||
sp_new の時にスプライトの種類毎の初期化
|
||||
@param sp: 初期化するスプライト
|
||||
sp_new の時にスプライトの種類毎の初期化
|
||||
@param sp: 初期化するスプライト
|
||||
*/
|
||||
int sp_put_setup(sprite_t *sp) {
|
||||
spev_add_eventlistener(sp, eventCB_PUT);
|
||||
|
||||
+12
-12
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sprite_quake.c: スプライトを揺らす
|
||||
* sprite_quake.c: スプライトを揺らす
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -37,14 +37,14 @@
|
||||
#include "randMT.h"
|
||||
|
||||
/*
|
||||
QuakeSpriteAddで設定したスプライトを揺らす
|
||||
QuakeSpriteAddで設定したスプライトを揺らす
|
||||
|
||||
@param wType: 0:縦横(全てのスプライトを同じように揺らす)
|
||||
1:縦横(全てのスプライトをバラバラに揺らす)
|
||||
@param wAmplitudeX: X方向の振幅
|
||||
@param wAmplitudeY: Y方向の振幅
|
||||
@param wCount: 時間(1/100秒)
|
||||
@param cancel: キーキャンセルあり(=1)
|
||||
@param wType: 0:縦横(全てのスプライトを同じように揺らす)
|
||||
1:縦横(全てのスプライトをバラバラに揺らす)
|
||||
@param wAmplitudeX: X方向の振幅
|
||||
@param wAmplitudeY: Y方向の振幅
|
||||
@param wCount: 時間(1/100秒)
|
||||
@param cancel: キーキャンセルあり(=1)
|
||||
*/
|
||||
int sp_quake_sprite(int wType, int wAmplitudeX, int wAmplitudeY, int wCount, int cancel) {
|
||||
int edtime, curtime;
|
||||
@@ -54,7 +54,7 @@ int sp_quake_sprite(int wType, int wAmplitudeX, int wAmplitudeY, int wCount, int
|
||||
edtime = wCount * 10 + get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
|
||||
while ((curtime = get_high_counter(SYSTEMCOUNTER_MSEC)) < edtime) {
|
||||
if (wType == 0) { // 全てのスプライトを同じように動かす
|
||||
if (wType == 0) { // 全てのスプライトを同じように動かす
|
||||
int adjx = (int)(genrand() * wAmplitudeX/2);
|
||||
int adjy = (int)(genrand() * wAmplitudeY/2);
|
||||
adjx *= ((-1)*(i%2) + ((i+1)%2));
|
||||
@@ -67,7 +67,7 @@ int sp_quake_sprite(int wType, int wAmplitudeX, int wAmplitudeY, int wCount, int
|
||||
sp->cur.y = sp->loc.y + adjy;
|
||||
sp_updateme(sp);
|
||||
}
|
||||
} else { // 全てのスプライトを別々に動かす
|
||||
} else { // 全てのスプライトを別々に動かす
|
||||
for (node = sact.sp_quake; node; node = node->next) {
|
||||
sprite_t *sp = (sprite_t *)node->data;
|
||||
int adjx = (int)(genrand() * wAmplitudeX/2);
|
||||
@@ -84,12 +84,12 @@ int sp_quake_sprite(int wType, int wAmplitudeX, int wAmplitudeY, int wCount, int
|
||||
sp_update_clipped();
|
||||
i++;
|
||||
|
||||
// ウェイトとキャンセルチェック
|
||||
// ウェイトとキャンセルチェック
|
||||
key = sys_keywait(10, cancel);
|
||||
if (cancel && key != 0) break;
|
||||
}
|
||||
|
||||
// 元のあった場所に戻す
|
||||
// 元のあった場所に戻す
|
||||
for (node = sact.sp_quake; node; node = node->next) {
|
||||
sprite_t *sp = (sprite_t *)node->data;
|
||||
if (sp == NULL) continue;
|
||||
|
||||
+53
-53
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sprite_sel.c: 選択肢処理
|
||||
* sprite_sel.c: 選択肢処理
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -36,16 +36,16 @@
|
||||
#include "ngraph.h"
|
||||
#include "drawtext.h"
|
||||
|
||||
// 選択された要素(1~) キャンセルの場合は0、初期状態は -1
|
||||
// 選択された要素(1~) キャンセルの場合は0、初期状態は -1
|
||||
static int selected_item;
|
||||
static int selected_item_cur;
|
||||
|
||||
// 選択肢を描画するsurface
|
||||
// 選択肢を描画するsurface
|
||||
static surface_t *selcanvas;
|
||||
|
||||
// 前のカーソルの状態
|
||||
static boolean oldstate; // spriteの中か外か
|
||||
static int oldindex; // 何番目の要素か(0~)
|
||||
// 前のカーソルの状態
|
||||
static boolean oldstate; // spriteの中か外か
|
||||
static int oldindex; // 何番目の要素か(0~)
|
||||
|
||||
|
||||
static boolean sp_is_insprite2(sprite_t *sp, int x, int y, int margin);
|
||||
@@ -60,8 +60,8 @@ static int sel_main();
|
||||
|
||||
|
||||
/**
|
||||
* 内側にマージンを含む sprite内領域チェック
|
||||
* マージン内はsprite内部とは判断しない
|
||||
* 内側にマージンを含む sprite内領域チェック
|
||||
* マージン内はsprite内部とは判断しない
|
||||
*/
|
||||
static boolean sp_is_insprite2(sprite_t *sp, int x, int y, int margin) {
|
||||
MyRectangle r;
|
||||
@@ -74,32 +74,32 @@ static boolean sp_is_insprite2(sprite_t *sp, int x, int y, int margin) {
|
||||
return ags_regionContains(&r, x, y);
|
||||
}
|
||||
|
||||
// マウスが移動したときの callback
|
||||
// マウスが移動したときの callback
|
||||
static void cb_select_move(agsevent_t *e) {
|
||||
int x = e->d1, y = e->d2;
|
||||
sprite_t *sp = sact.sp[sact.sel.spno];
|
||||
boolean newstate;
|
||||
int newindex;
|
||||
|
||||
// sprite内か?
|
||||
// sprite内か?
|
||||
newstate = sp_is_insprite2(sp, x, y, sact.sel.frame_dot);
|
||||
newindex = (y - (sp->cur.y + sact.sel.frame_dot)) / (sact.sel.font_size + sact.sel.linespace);
|
||||
|
||||
if (newstate == oldstate) {
|
||||
if ((newstate == FALSE) || (newindex == oldindex)) {
|
||||
// 前と状態が同じでかつ、新しい状態がspriteの外か、
|
||||
// indexが変わらない場合はなにもしない。
|
||||
// 前と状態が同じでかつ、新しい状態がspriteの外か、
|
||||
// indexが変わらない場合はなにもしない。
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (newstate) {
|
||||
// spriteの内部
|
||||
// spriteの内部
|
||||
// fprintf(stderr, "in region %d\n", newindex);
|
||||
//update_selwindow(newindex + 1);
|
||||
selected_item_cur = newindex + 1;
|
||||
} else {
|
||||
// spriteの外部
|
||||
// spriteの外部
|
||||
//update_selwindow(0);
|
||||
selected_item_cur = 0;
|
||||
}
|
||||
@@ -107,12 +107,12 @@ static void cb_select_move(agsevent_t *e) {
|
||||
oldstate = newstate;
|
||||
oldindex = newindex;
|
||||
|
||||
// 再描画
|
||||
// 再描画
|
||||
sp_updateme(sp);
|
||||
sp_update_clipped();
|
||||
}
|
||||
|
||||
// ボタンがリリースされたときの callback
|
||||
// ボタンがリリースされたときの callback
|
||||
static void cb_select_release(agsevent_t *e) {
|
||||
int x = e->d1, y = e->d2;
|
||||
sprite_t *sp = sact.sp[sact.sel.spno];
|
||||
@@ -124,35 +124,35 @@ static void cb_select_release(agsevent_t *e) {
|
||||
st = sp_is_insprite2(sp, x, y, sact.sel.frame_dot);
|
||||
iy = (y - (sp->cur.y + sact.sel.frame_dot)) / (sact.sel.font_size + sact.sel.linespace);
|
||||
|
||||
// カーソルが sprite の外の場合は無視
|
||||
// カーソルが sprite の外の場合は無視
|
||||
if (st == FALSE) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 選択要素が空の場合も無視
|
||||
// 選択要素が空の場合も無視
|
||||
if (sact.sel.elem[iy + 1] == NULL) return;
|
||||
|
||||
selected_item = iy + 1;
|
||||
break;
|
||||
|
||||
case AGSEVENT_BUTTON_RIGHT:
|
||||
// キャンセル
|
||||
// キャンセル
|
||||
selected_item = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 選択ウィンドを更新するときの callback
|
||||
// 選択ウィンドを更新するときの callback
|
||||
static int update_selwindow(sprite_t *sp) {
|
||||
int selno = selected_item_cur;
|
||||
int x0, y0;
|
||||
|
||||
x0 = sp->cur.x;
|
||||
y0 = sp->cur.y;
|
||||
// 背景 CG
|
||||
// 背景 CG
|
||||
sp_draw(sp);
|
||||
|
||||
// 選択されている要素
|
||||
// 選択されている要素
|
||||
if (selno && sact.sel.elem[selno] != NULL) {
|
||||
int w = selcanvas->width - 2 * sact.sel.frame_dot;
|
||||
int h = sact.sel.font_size + sact.sel.linespace;
|
||||
@@ -162,7 +162,7 @@ static int update_selwindow(sprite_t *sp) {
|
||||
gr_drawrect(sf0, x, y, w, h, 255, 255, 255);
|
||||
}
|
||||
|
||||
// 選択肢文字列
|
||||
// 選択肢文字列
|
||||
gr_expandcolor_blend(sf0, x0, y0,
|
||||
sact.sel.charcanvas, 0, 0,
|
||||
selcanvas->width, selcanvas->height, 255, 255, 255);
|
||||
@@ -170,32 +170,32 @@ static int update_selwindow(sprite_t *sp) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 選択ウィンドの準備
|
||||
// 選択ウィンドの準備
|
||||
static void setup_selwindow() {
|
||||
sprite_t *sp = sact.sp[sact.sel.spno];
|
||||
int i;
|
||||
|
||||
//選択ウィンド作業 surfaceの生成
|
||||
//選択ウィンド作業 surfaceの生成
|
||||
selcanvas = sf_dup(sp->cg1->sf);
|
||||
|
||||
// 選択肢文字用 canvas
|
||||
// 選択肢文字用 canvas
|
||||
sact.sel.charcanvas = sf_create_pixel(selcanvas->width, selcanvas->height, 8);
|
||||
|
||||
dt_setfont(sact.sel.font_type, sact.sel.font_size);
|
||||
|
||||
// 指定のスプライトに文字(選択肢を書く)
|
||||
// 指定のスプライトに文字(選択肢を書く)
|
||||
for (i = 1; i < SEL_ELEMENT_MAX; i++) {
|
||||
int x, y;
|
||||
if (sact.sel.elem[i] == NULL) continue;
|
||||
// 文字の場所計算
|
||||
x = 0; // 行そろえは無し
|
||||
// 文字の場所計算
|
||||
x = 0; // 行そろえは無し
|
||||
y = (i - 1) * (sact.sel.font_size + sact.sel.linespace);
|
||||
dt_drawtext(sact.sel.charcanvas,
|
||||
x + sact.sel.frame_dot, y + sact.sel.frame_dot,
|
||||
sact.sel.elem[i]);
|
||||
}
|
||||
|
||||
// デフォルトで選択される選択肢がある場合、そこへカーソルを移動
|
||||
// デフォルトで選択される選択肢がある場合、そこへカーソルを移動
|
||||
if (sact.sel.movecursor) {
|
||||
ags_setCursorLocation(sp->cur.x + sact.sel.frame_dot + 2,
|
||||
sp->cur.y + sact.sel.frame_dot + 2 + (sact.sel.font_size + sact.sel.linespace)*(sact.sel.movecursor -1), TRUE);
|
||||
@@ -204,31 +204,31 @@ static void setup_selwindow() {
|
||||
oldindex = selected_item -1;
|
||||
}
|
||||
|
||||
// その他初期化
|
||||
// その他初期化
|
||||
selected_item_cur = 0;
|
||||
|
||||
// スプライト再描画 callback の登録
|
||||
// スプライト再描画 callback の登録
|
||||
sp->update = update_selwindow;
|
||||
}
|
||||
|
||||
// 選択ウィンドの削除
|
||||
// 選択ウィンドの削除
|
||||
static void remove_selwindow() {
|
||||
sprite_t *sp = sact.sp[sact.sel.spno];
|
||||
|
||||
// スプライト再描画 callback を元にもどす
|
||||
// スプライト再描画 callback を元にもどす
|
||||
sp->update = sp_draw;
|
||||
|
||||
// スプライトを再描画して(おそらく消す)
|
||||
// スプライトを再描画して(おそらく消す)
|
||||
sp_updateme(sp);
|
||||
sp_update_clipped();
|
||||
|
||||
// 作業用 surface の削除
|
||||
// 作業用 surface の削除
|
||||
sf_free(selcanvas);
|
||||
sf_free(sact.sel.charcanvas);
|
||||
}
|
||||
|
||||
|
||||
// 選択メインループ
|
||||
// 選択メインループ
|
||||
static int sel_main() {
|
||||
sact.waittype = KEYWAIT_SELECT;
|
||||
sact.waitkey = -1;
|
||||
@@ -245,20 +245,20 @@ static int sel_main() {
|
||||
}
|
||||
|
||||
/*
|
||||
選択肢関連の初期化
|
||||
選択肢関連の初期化
|
||||
*/
|
||||
void ssel_init() {
|
||||
// callbackの設定
|
||||
// callbackの設定
|
||||
sact.sel.cbmove = cb_select_move;
|
||||
sact.sel.cbrelease = cb_select_release;
|
||||
|
||||
// デフォルトフォント
|
||||
// デフォルトフォント
|
||||
sact.sel.font_type = FONT_GOTHIC;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
内部の選択肢情報をクリア
|
||||
内部の選択肢情報をクリア
|
||||
*/
|
||||
void ssel_clear() {
|
||||
int i;
|
||||
@@ -270,9 +270,9 @@ void ssel_clear() {
|
||||
}
|
||||
|
||||
/*
|
||||
登録文字列を内部選択肢情報に追加
|
||||
@param nString: 登録文字列変数
|
||||
@param wI : 登録位置
|
||||
登録文字列を内部選択肢情報に追加
|
||||
@param nString: 登録文字列変数
|
||||
@param wI : 登録位置
|
||||
*/
|
||||
void ssel_add(int nString, int wI) {
|
||||
if ((wI >= SEL_ELEMENT_MAX -1) || (wI <= 0)) {
|
||||
@@ -287,14 +287,14 @@ void ssel_add(int nString, int wI) {
|
||||
}
|
||||
|
||||
/*
|
||||
選択ウィンドを開いて選択
|
||||
選択ウィンドを開いて選択
|
||||
|
||||
@param wNum: 枠,背景とするスプライト番号
|
||||
@param wChoiceSize: 選択肢文字サイズ
|
||||
@param wMenuOutSpc: 枠スプライトの外側からのピクセル数
|
||||
@param wChoiceLineSpace: 選択肢の行間
|
||||
@param wChoiceAutoMoveCursor: オープン時に自動的に移動する選択肢の番号
|
||||
@param nAlign: 行そろえ (0:左, 1:中央, 2: 右)
|
||||
@param wNum: 枠,背景とするスプライト番号
|
||||
@param wChoiceSize: 選択肢文字サイズ
|
||||
@param wMenuOutSpc: 枠スプライトの外側からのピクセル数
|
||||
@param wChoiceLineSpace: 選択肢の行間
|
||||
@param wChoiceAutoMoveCursor: オープン時に自動的に移動する選択肢の番号
|
||||
@param nAlign: 行そろえ (0:左, 1:中央, 2: 右)
|
||||
*/
|
||||
int ssel_select(int wNum, int wChoiceSize, int wMenuOutSpc, int wChoiceLineSpace, int wChoiceAutoMoveCursor, int nAlign) {
|
||||
int ret = 0;
|
||||
@@ -316,14 +316,14 @@ int ssel_select(int wNum, int wChoiceSize, int wMenuOutSpc, int wChoiceLineSpace
|
||||
sact.sel.movecursor = wChoiceAutoMoveCursor;
|
||||
sact.sel.align = nAlign;
|
||||
|
||||
// 古い sprite の表示フラグを保存
|
||||
// 古い sprite の表示フラグを保存
|
||||
saveflag = sact.sp[wNum]->show;
|
||||
sact.sp[wNum]->show = TRUE;
|
||||
setup_selwindow();
|
||||
|
||||
ret = sel_main();
|
||||
|
||||
// 表示フラグを元に戻す
|
||||
// 表示フラグを元に戻す
|
||||
sact.sp[wNum]->show = saveflag;
|
||||
|
||||
remove_selwindow();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sprite_switch.c: スイッチスプライト特有の処理
|
||||
* sprite_switch.c: スイッチスプライト特有の処理
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -36,7 +36,7 @@ static int eventCB_switch(sprite_t *sp, agsevent_t *e);
|
||||
static void cb_remove(sprite_t *sp);
|
||||
|
||||
|
||||
// スイッチスプライトのイベント処理
|
||||
// スイッチスプライトのイベント処理
|
||||
static int eventCB_switch(sprite_t *sp, agsevent_t *e) {
|
||||
int update = 0;
|
||||
|
||||
@@ -44,7 +44,7 @@ static int eventCB_switch(sprite_t *sp, agsevent_t *e) {
|
||||
case AGSEVENT_BUTTON_PRESS:
|
||||
if (e->d3 != AGSEVENT_BUTTON_LEFT) return 0;
|
||||
|
||||
// ボタン押下時のスプライトがあれば、それを表示
|
||||
// ボタン押下時のスプライトがあれば、それを表示
|
||||
if (sp->cg3) {
|
||||
sp->curcg = sp->cg3;
|
||||
update++;
|
||||
@@ -56,15 +56,15 @@ static int eventCB_switch(sprite_t *sp, agsevent_t *e) {
|
||||
case AGSEVENT_BUTTON_RELEASE:
|
||||
if (e->d3 != AGSEVENT_BUTTON_LEFT) return 0;
|
||||
|
||||
// ここにくるときは forcusが当たっているときしかこないので、
|
||||
// curcg は cg2 に戻せばよい
|
||||
// ここにくるときは forcusが当たっているときしかこないので、
|
||||
// curcg は cg2 に戻せばよい
|
||||
if (sp->cg2) {
|
||||
sp->curcg = sp->cg2;
|
||||
update++;
|
||||
}
|
||||
|
||||
// pressされたスプライトとreleaseされたスプライトが同じ場合
|
||||
// にのみ、そのスプライトが押されたと判断
|
||||
// pressされたスプライトとreleaseされたスプライトが同じ場合
|
||||
// にのみ、そのスプライトが押されたと判断
|
||||
if (sp->pressed) {
|
||||
sact.sp_result_sw = sp->no;
|
||||
sact.waitkey = sp->no;
|
||||
@@ -83,16 +83,16 @@ static int eventCB_switch(sprite_t *sp, agsevent_t *e) {
|
||||
return update;
|
||||
}
|
||||
|
||||
// スプライト削除時の処理
|
||||
// スプライト削除時の処理
|
||||
static void cb_remove(sprite_t *sp) {
|
||||
// event listener の削除
|
||||
// event listener の削除
|
||||
spev_remove_eventlistener(sp);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
sp_new の時にスプライトの種類毎の初期化
|
||||
@param sp: 初期化するスプライト
|
||||
sp_new の時にスプライトの種類毎の初期化
|
||||
@param sp: 初期化するスプライト
|
||||
*/
|
||||
int sp_sw_setup(sprite_t *sp) {
|
||||
spev_add_eventlistener(sp, eventCB_switch);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sprite_tevent.c: アニメーションスプライトとスプライトの移動
|
||||
* sprite_tevent.c: アニメーションスプライトとスプライトの移動
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -37,18 +37,18 @@
|
||||
|
||||
/*
|
||||
|
||||
タイマイベントによるスプライトの移動とアニメーションスプライトの更新
|
||||
タイマイベントによるスプライトの移動とアニメーションスプライトの更新
|
||||
|
||||
実際には、nact->callback()を全力で呼び出しでいることがほとんどで、
|
||||
タイマイベントが欲しいスプライト内部のコールバックで経過時間を計算し、
|
||||
状態を更新している。
|
||||
実際には、nact->callback()を全力で呼び出しでいることがほとんどで、
|
||||
タイマイベントが欲しいスプライト内部のコールバックで経過時間を計算し、
|
||||
状態を更新している。
|
||||
|
||||
他には system35 のメインループ nact_main() から呼ばれることや、
|
||||
X|SDLのキー待ち中等に呼ばれる。
|
||||
他には system35 のメインループ nact_main() から呼ばれることや、
|
||||
X|SDLのキー待ち中等に呼ばれる。
|
||||
|
||||
スプライトの移動は SACT.Draw が呼ばれてから移動を開始し、移動終了まで
|
||||
待っているので、nact_mainから呼ばれるときはアニメーションスプライト
|
||||
の更新処理だけ。
|
||||
スプライトの移動は SACT.Draw が呼ばれてから移動を開始し、移動終了まで
|
||||
待っているので、nact_mainから呼ばれるときはアニメーションスプライト
|
||||
の更新処理だけ。
|
||||
|
||||
*/
|
||||
|
||||
@@ -56,13 +56,13 @@ static void tevent_callback(agsevent_t *e);
|
||||
|
||||
|
||||
/*
|
||||
タイマイベント callback メイン
|
||||
タイマイベント callback メイン
|
||||
*/
|
||||
static void tevent_callback(agsevent_t *e) {
|
||||
GSList *node;
|
||||
int update = 0;
|
||||
|
||||
// SP_MOVE の同期移動のためのカウンタの読み込み
|
||||
// SP_MOVE の同期移動のためのカウンタの読み込み
|
||||
sact.movecurtime = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
|
||||
for (node = sact.teventlisteners; node; node = node->next) {
|
||||
@@ -70,19 +70,19 @@ static void tevent_callback(agsevent_t *e) {
|
||||
if (sp == NULL) continue;
|
||||
if (sp->teventcb == NULL) continue;
|
||||
|
||||
// 非表示ではイベントに反応しない
|
||||
// 非表示ではイベントに反応しない
|
||||
if (!sp->show) continue;
|
||||
|
||||
// スプライト毎のタイマイベントハンドラの呼び出し
|
||||
// スプライト毎のタイマイベントハンドラの呼び出し
|
||||
update += sp->teventcb(sp, e);
|
||||
}
|
||||
|
||||
// 変更があれば画面を更新
|
||||
// 変更があれば画面を更新
|
||||
if (update) {
|
||||
sp_update_clipped();
|
||||
}
|
||||
|
||||
// timer event litener の削除 (上のループ内で削除できないので)
|
||||
// timer event litener の削除 (上のループ内で削除できないので)
|
||||
for (node = sact.teventremovelist; node; node = node->next) {
|
||||
sprite_t *sp = (sprite_t *)node->data;
|
||||
if (sp == NULL) continue;
|
||||
@@ -93,9 +93,9 @@ static void tevent_callback(agsevent_t *e) {
|
||||
}
|
||||
|
||||
/*
|
||||
タイマイベント callback の登録
|
||||
@param sp: 登録するスプライト
|
||||
@param cb: 呼び出されるcallback
|
||||
タイマイベント callback の登録
|
||||
@param sp: 登録するスプライト
|
||||
@param cb: 呼び出されるcallback
|
||||
*/
|
||||
void spev_add_teventlistener(sprite_t *sp, int (*cb)(sprite_t *, agsevent_t *)) {
|
||||
sp->teventcb = cb;
|
||||
@@ -103,15 +103,15 @@ void spev_add_teventlistener(sprite_t *sp, int (*cb)(sprite_t *, agsevent_t *))
|
||||
}
|
||||
|
||||
/*
|
||||
上で登録した callback の削除
|
||||
@param sp: 削除するスプライト
|
||||
上で登録した callback の削除
|
||||
@param sp: 削除するスプライト
|
||||
*/
|
||||
void spev_remove_teventlistener(sprite_t *sp) {
|
||||
sact.teventlisteners = g_slist_remove(sact.teventlisteners, sp);
|
||||
}
|
||||
|
||||
/*
|
||||
system35のメインループからで呼ばれるコールバック
|
||||
system35のメインループからで呼ばれるコールバック
|
||||
*/
|
||||
void spev_main() {
|
||||
agsevent_t e;
|
||||
@@ -119,8 +119,8 @@ void spev_main() {
|
||||
e.type = AGSEVENT_TIMER;
|
||||
tevent_callback(&e);
|
||||
|
||||
// デフォルトのコールバックのうち、ここで必要なものだけ
|
||||
// 処理。(VAコマンドcallbackはなし)
|
||||
// デフォルトのコールバックのうち、ここで必要なものだけ
|
||||
// 処理。(VAコマンドcallbackはなし)
|
||||
if (nact->popupmenu_opened) {
|
||||
menu_gtkmainiteration();
|
||||
if (nact->is_quit) sys_exit(0);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* sprite_update.c: spriteの通常更新いろいろ
|
||||
* sprite_update.c: spriteの通常更新いろいろ
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "ngraph.h"
|
||||
#include "sprite.h"
|
||||
|
||||
// スプライト再描画間の間に変更のあったスプライトの領域の和
|
||||
// スプライト再描画間の間に変更のあったスプライトの領域の和
|
||||
static GSList *updatearea;
|
||||
|
||||
static void intersection(MyRectangle *r1, MyRectangle *r2, MyRectangle *rst);
|
||||
@@ -44,7 +44,7 @@ static void disjunction(gpointer region, gpointer data);
|
||||
static void get_updatearea();
|
||||
static void do_update_each(gpointer data, gpointer userdata);
|
||||
|
||||
// 領域1と領域2の積を計算
|
||||
// 領域1と領域2の積を計算
|
||||
static void intersection(MyRectangle *r1, MyRectangle *r2, MyRectangle *rst) {
|
||||
int x1 = max(r1->x, r2->x);
|
||||
int x2 = min(r1->x + r1->width, r2->x + r2->width);
|
||||
@@ -57,7 +57,7 @@ static void intersection(MyRectangle *r1, MyRectangle *r2, MyRectangle *rst) {
|
||||
rst->height = y2 - y1;
|
||||
}
|
||||
|
||||
// 領域1と領域2をすべて含む矩形領域を計算
|
||||
// 領域1と領域2をすべて含む矩形領域を計算
|
||||
static void disjunction(gpointer region, gpointer data) {
|
||||
MyRectangle *r1 = (MyRectangle *)region;
|
||||
MyRectangle *r2 = (MyRectangle *)data;
|
||||
@@ -87,7 +87,7 @@ static void disjunction(gpointer region, gpointer data) {
|
||||
//WARNING("res:r2x=%d,r2y=%d,r2w=%d,r2h=%d\n", r2->x, r2->y, r2->width, r2->height);
|
||||
}
|
||||
|
||||
// 更新の必要なスプライトの領域の和をとってクリッピングする
|
||||
// 更新の必要なスプライトの領域の和をとってクリッピングする
|
||||
static void get_updatearea() {
|
||||
MyRectangle clip = {0, 0, 0, 0};
|
||||
MyRectangle rsf0 = {0, 0, sf0->width, sf0->height};
|
||||
@@ -97,7 +97,7 @@ static void get_updatearea() {
|
||||
g_slist_free(updatearea);
|
||||
updatearea = NULL;
|
||||
|
||||
// surface0との領域の積をとる
|
||||
// surface0との領域の積をとる
|
||||
intersection(&rsf0, &clip, &sact.updaterect);
|
||||
|
||||
WARNING("clipped area x=%d y=%d w=%d h=%d\n",
|
||||
@@ -107,90 +107,90 @@ static void get_updatearea() {
|
||||
return;
|
||||
}
|
||||
|
||||
// updatelist に登録してあるすべてのスプライトを更新
|
||||
// updatelist に登録してあるすべてのスプライトを更新
|
||||
static void do_update_each(gpointer data, gpointer userdata) {
|
||||
sprite_t *sp = (sprite_t *)data;
|
||||
|
||||
// 非表示の場合はなにもしない
|
||||
// 非表示の場合はなにもしない
|
||||
if (!sp->show) return;
|
||||
|
||||
if (sp == sact.draggedsp) return; // drag中のスプライトは最後に表示
|
||||
if (sp == sact.draggedsp) return; // drag中のスプライトは最後に表示
|
||||
|
||||
// スプライト毎のupdateルーチンの呼び出し
|
||||
// スプライト毎のupdateルーチンの呼び出し
|
||||
if (sp->update) {
|
||||
sp->update(sp);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
画面全体の更新
|
||||
@param syncscreen: surface0 に描画したものを Screen に反映させるかどうか
|
||||
画面全体の更新
|
||||
@param syncscreen: surface0 に描画したものを Screen に反映させるかどうか
|
||||
*/
|
||||
int sp_update_all(boolean syncscreen) {
|
||||
|
||||
// スプライト移動がある場合は移動開始
|
||||
// スプライト移動がある場合は移動開始
|
||||
if (sact.movelist) {
|
||||
// 移動開始時間を合わせる
|
||||
// 移動開始時間を合わせる
|
||||
sact.movestarttime = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
g_slist_foreach(sact.movelist, spev_move_setup, NULL);
|
||||
g_slist_free(sact.movelist);
|
||||
sact.movelist = NULL;
|
||||
}
|
||||
|
||||
// 画面全体を更新領域に
|
||||
// 画面全体を更新領域に
|
||||
sact.updaterect.x = 0;
|
||||
sact.updaterect.y = 0;
|
||||
sact.updaterect.width = sf0->width;
|
||||
sact.updaterect.height = sf0->height;
|
||||
|
||||
// updatelistに登録してあるスプライトを再描画
|
||||
// updatelistはスプライトの番号順に並んでいる
|
||||
// updatelistに登録してあるスプライトを再描画
|
||||
// updatelistはスプライトの番号順に並んでいる
|
||||
g_slist_foreach(sact.updatelist, do_update_each, NULL);
|
||||
|
||||
// このルーチンが呼ばれるときはスプライトはドラッグ中ではない
|
||||
// このルーチンが呼ばれるときはスプライトはドラッグ中ではない
|
||||
|
||||
// screenと同期は必要なときは画面全体をWindowへ転送
|
||||
// screenと同期は必要なときは画面全体をWindowへ転送
|
||||
if (syncscreen) {
|
||||
ags_updateFull();
|
||||
}
|
||||
|
||||
// 移動中のすべてのスプライトが移動終了するまで待つ
|
||||
// こうしないと動きが同期しない
|
||||
// 移動中のすべてのスプライトが移動終了するまで待つ
|
||||
// こうしないと動きが同期しない
|
||||
spev_wait4moving_sp();
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
画面の一部を更新
|
||||
updateme(_part)で登録した更新が必要なspriteの和の領域をupdate
|
||||
画面の一部を更新
|
||||
updateme(_part)で登録した更新が必要なspriteの和の領域をupdate
|
||||
*/
|
||||
int sp_update_clipped() {
|
||||
// 更新領域の確定
|
||||
// 更新領域の確定
|
||||
get_updatearea();
|
||||
|
||||
// 幅または高さが 0 の時はなにもしない
|
||||
// 幅または高さが 0 の時はなにもしない
|
||||
if (sact.updaterect.width == 0 || sact.updaterect.height == 0) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 更新領域に入っているスプライトの再描画
|
||||
// 更新領域に入っているスプライトの再描画
|
||||
g_slist_foreach(sact.updatelist, do_update_each, NULL);
|
||||
|
||||
// drag中のスプライトを最後に描画
|
||||
// drag中のスプライトを最後に描画
|
||||
if (sact.draggedsp) {
|
||||
sact.draggedsp->update(sact.draggedsp);
|
||||
}
|
||||
|
||||
// 更新領域を Window に転送
|
||||
// 更新領域を Window に転送
|
||||
ags_updateArea(sact.updaterect.x, sact.updaterect.y, sact.updaterect.width, sact.updaterect.height);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
sprite全体の更新を登録
|
||||
@param sp: 更新するスプライト
|
||||
sprite全体の更新を登録
|
||||
@param sp: 更新するスプライト
|
||||
*/
|
||||
int sp_updateme(sprite_t *sp) {
|
||||
MyRectangle *r;
|
||||
@@ -213,12 +213,12 @@ int sp_updateme(sprite_t *sp) {
|
||||
}
|
||||
|
||||
/*
|
||||
spriteの一部更新を登録
|
||||
@param sp: 更新するスプライト
|
||||
@param x: 更新領域X座標
|
||||
@param y: 更新領域Y座標
|
||||
@param w: 更新領域幅
|
||||
@param h: 更新領域高さ
|
||||
spriteの一部更新を登録
|
||||
@param sp: 更新するスプライト
|
||||
@param x: 更新領域X座標
|
||||
@param y: 更新領域Y座標
|
||||
@param w: 更新領域幅
|
||||
@param h: 更新領域高さ
|
||||
*/
|
||||
int sp_updateme_part(sprite_t *sp, int x, int y, int w, int h) {
|
||||
MyRectangle *r;
|
||||
|
||||
+237
-237
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* ShArray.c 各種配列演算 module
|
||||
* ShArray.c 各種配列演算 module
|
||||
*
|
||||
* かえるにょ国にょアリス
|
||||
* 大悪司
|
||||
* かえるにょ国にょアリス
|
||||
* 大悪司
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -35,12 +35,12 @@
|
||||
|
||||
void GetAtArray(void) { /* 0 */
|
||||
/*
|
||||
配列から演算しながら値を取り出す
|
||||
配列から演算しながら値を取り出す
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
type: 演算の種類
|
||||
vResult: 演算結果を返す変数
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
type: 演算の種類
|
||||
vResult: 演算結果を返す変数
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -81,11 +81,11 @@ void GetAtArray(void) { /* 0 */
|
||||
|
||||
void AddAtArray(void) { /* 1 */
|
||||
/*
|
||||
配列1に配列2を足す。65535 を超えたら 65535 に。
|
||||
配列1に配列2を足す。65535 を超えたら 65535 に。
|
||||
|
||||
vAry1: 配列1
|
||||
vAry2: 配列2
|
||||
cnt : 個数
|
||||
vAry1: 配列1
|
||||
vAry2: 配列2
|
||||
cnt : 個数
|
||||
*/
|
||||
int *vAry1 = getCaliVariable();
|
||||
int *vAry2 = getCaliVariable();
|
||||
@@ -107,11 +107,11 @@ void AddAtArray(void) { /* 1 */
|
||||
|
||||
void SubAtArray(void) { /* 2 */
|
||||
/*
|
||||
配列1から配列2を引く。負になったら0をかく
|
||||
配列1から配列2を引く。負になったら0をかく
|
||||
|
||||
vAry1: 配列1
|
||||
vAry2: 配列2
|
||||
cnt : 個数
|
||||
vAry1: 配列1
|
||||
vAry2: 配列2
|
||||
cnt : 個数
|
||||
*/
|
||||
int *vAry1 = getCaliVariable();
|
||||
int *vAry2 = getCaliVariable();
|
||||
@@ -133,11 +133,11 @@ void SubAtArray(void) { /* 2 */
|
||||
|
||||
void MulAtArray(void) { /* 3 */
|
||||
/*
|
||||
配列1に配列2をかけて、配列1に格納、65535まで。
|
||||
配列1に配列2をかけて、配列1に格納、65535まで。
|
||||
|
||||
vAry1: 配列1
|
||||
vAry2: 配列2
|
||||
cnt : 個数
|
||||
vAry1: 配列1
|
||||
vAry2: 配列2
|
||||
cnt : 個数
|
||||
*/
|
||||
int *vAry1 = getCaliVariable();
|
||||
int *vAry2 = getCaliVariable();
|
||||
@@ -159,11 +159,11 @@ void MulAtArray(void) { /* 3 */
|
||||
|
||||
void DivAtArray(void) { /* 4 */
|
||||
/*
|
||||
配列1を配列2で割って、配列1に格納、65535まで。
|
||||
配列1を配列2で割って、配列1に格納、65535まで。
|
||||
|
||||
vAry1: 配列1
|
||||
vAry2: 配列2
|
||||
cnt : 個数
|
||||
vAry1: 配列1
|
||||
vAry2: 配列2
|
||||
cnt : 個数
|
||||
*/
|
||||
int *vAry1 = getCaliVariable();
|
||||
int *vAry2 = getCaliVariable();
|
||||
@@ -189,11 +189,11 @@ void DivAtArray(void) { /* 4 */
|
||||
|
||||
void MinAtArray(void) { /* 5 */
|
||||
/*
|
||||
配列 vAry1 の中身を配列 vAry2 で下限に設定する
|
||||
配列 vAry1 の中身を配列 vAry2 で下限に設定する
|
||||
|
||||
vAry1: 配列1
|
||||
vAry2: 配列2
|
||||
cnt : 個数
|
||||
vAry1: 配列1
|
||||
vAry2: 配列2
|
||||
cnt : 個数
|
||||
*/
|
||||
int *vAry1 = getCaliVariable();
|
||||
int *vAry2 = getCaliVariable();
|
||||
@@ -212,11 +212,11 @@ void MinAtArray(void) { /* 5 */
|
||||
|
||||
void MaxAtArray(void) { /* 6 */
|
||||
/*
|
||||
配列 vAry1 の中身を配列 vAry2 で上限に設定する
|
||||
配列 vAry1 の中身を配列 vAry2 で上限に設定する
|
||||
|
||||
vAry1: 配列1
|
||||
vAry2: 配列2
|
||||
cnt : 個数
|
||||
vAry1: 配列1
|
||||
vAry2: 配列2
|
||||
cnt : 個数
|
||||
*/
|
||||
int *vAry1 = getCaliVariable();
|
||||
int *vAry2 = getCaliVariable();
|
||||
@@ -235,11 +235,11 @@ void MaxAtArray(void) { /* 6 */
|
||||
|
||||
void AndNumArray(void) { /* 7 */
|
||||
/*
|
||||
配列のデータと val で AND をとる
|
||||
配列のデータと val で AND をとる
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : ANDをとる値
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : ANDをとる値
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -256,11 +256,11 @@ void AndNumArray(void) { /* 7 */
|
||||
|
||||
void OrNumArray(void) { /* 8 */
|
||||
/*
|
||||
配列のデータと val で OR をとる
|
||||
配列のデータと val で OR をとる
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : ORをとる値
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : ORをとる値
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -277,11 +277,11 @@ void OrNumArray(void) { /* 8 */
|
||||
|
||||
void XorNumArray(void) { /* 9 */
|
||||
/*
|
||||
配列のデータと val で XOR をとる
|
||||
配列のデータと val で XOR をとる
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : XORをとる値
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : XORをとる値
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -298,13 +298,13 @@ void XorNumArray(void) { /* 9 */
|
||||
|
||||
void SetEquArray(void) { /* 10 */
|
||||
/*
|
||||
配列が val と等しければ 配列 vResults に 1 を、そうでなければ
|
||||
0 を代入
|
||||
配列が val と等しければ 配列 vResults に 1 を、そうでなければ
|
||||
0 を代入
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : 比較する値
|
||||
vResults : 結果を格納する配列
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : 比較する値
|
||||
vResults : 結果を格納する配列
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -322,13 +322,13 @@ void SetEquArray(void) { /* 10 */
|
||||
|
||||
void SetNotArray(void) { /* 11 */
|
||||
/*
|
||||
配列が val と等しくなければ配列 vResults に 1 を、そうでなければ
|
||||
0 を代入
|
||||
配列が val と等しくなければ配列 vResults に 1 を、そうでなければ
|
||||
0 を代入
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : 比較する値
|
||||
vResults : 結果を格納する配列
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : 比較する値
|
||||
vResults : 結果を格納する配列
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -346,12 +346,12 @@ void SetNotArray(void) { /* 11 */
|
||||
|
||||
void SetLowArray(void) { /* 12 */
|
||||
/*
|
||||
配列データが val よりも小さければ vResult に 1 をセット
|
||||
配列データが val よりも小さければ vResult に 1 をセット
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : 閾値
|
||||
vResult: 結果を返す変数
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : 閾値
|
||||
vResult: 結果を返す変数
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -369,12 +369,12 @@ void SetLowArray(void) { /* 12 */
|
||||
|
||||
void SetHighArray(void) { /* 13 */
|
||||
/*
|
||||
配列データが val よりも大きければ vResult に 1 をセット
|
||||
配列データが val よりも大きければ vResult に 1 をセット
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : 閾値
|
||||
vResults: 結果を返す変数
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : 閾値
|
||||
vResults: 結果を返す変数
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -392,15 +392,15 @@ void SetHighArray(void) { /* 13 */
|
||||
|
||||
void SetRangeArray(void) { /* 14 */
|
||||
/*
|
||||
配列データがある範囲(min~max)にあるかチェック
|
||||
配列データがある範囲(min〜max)にあるかチェック
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
min : 最小値
|
||||
max : 最大値
|
||||
vResults: 結果を返す変数
|
||||
min < vAry < max の時 vResults = 1;
|
||||
それ以外 vResults = 0;
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
min : 最小値
|
||||
max : 最大値
|
||||
vResults: 結果を返す変数
|
||||
min < vAry < max の時 vResults = 1;
|
||||
それ以外 vResults = 0;
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -419,14 +419,14 @@ void SetRangeArray(void) { /* 14 */
|
||||
|
||||
void SetAndEquArray(void) { /* 15 */
|
||||
/*
|
||||
配列 vAry と mask との AND をとって val に等しければ
|
||||
配列 vResults に1を、等しくなければ 0 を書く
|
||||
配列 vAry と mask との AND をとって val に等しければ
|
||||
配列 vResults に1を、等しくなければ 0 を書く
|
||||
|
||||
vAry: 配列
|
||||
mask: 配列にかけるマスク
|
||||
cnt : 個数
|
||||
val : 比較する値
|
||||
vResults : 結果を代入する配列
|
||||
vAry: 配列
|
||||
mask: 配列にかけるマスク
|
||||
cnt : 個数
|
||||
val : 比較する値
|
||||
vResults : 結果を代入する配列
|
||||
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
@@ -446,13 +446,13 @@ void SetAndEquArray(void) { /* 15 */
|
||||
|
||||
void AndEquArray(void) { /* 16 */
|
||||
/*
|
||||
配列 vAry 中で val と同じならば、vResult と 1 の AND を
|
||||
違うならば 0 をかく。
|
||||
配列 vAry 中で val と同じならば、vResult と 1 の AND を
|
||||
違うならば 0 をかく。
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : 比較する値
|
||||
vResults : 結果を代入する配列
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : 比較する値
|
||||
vResults : 結果を代入する配列
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -470,13 +470,13 @@ void AndEquArray(void) { /* 16 */
|
||||
|
||||
void AndNotArray(void) { /* 17 */
|
||||
/*
|
||||
配列 vAry 中で val と等しくないならば、vResult と 1 の AND を
|
||||
違う場合は 0 をかく。
|
||||
配列 vAry 中で val と等しくないならば、vResult と 1 の AND を
|
||||
違う場合は 0 をかく。
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : 比較する値
|
||||
vResults : 結果を代入する配列
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : 比較する値
|
||||
vResults : 結果を代入する配列
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -494,13 +494,13 @@ void AndNotArray(void) { /* 17 */
|
||||
|
||||
void AndLowArray(void) { /* 18 */
|
||||
/*
|
||||
配列 vAry が min よりも小さいならば、vResult と 1 の AND を
|
||||
そうでないならば 0 をかく。
|
||||
配列 vAry が min よりも小さいならば、vResult と 1 の AND を
|
||||
そうでないならば 0 をかく。
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
min : 最小値
|
||||
vResults : 結果を代入する配列
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
min : 最小値
|
||||
vResults : 結果を代入する配列
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -518,13 +518,13 @@ void AndLowArray(void) { /* 18 */
|
||||
|
||||
void AndHighArray(void) { /* 19 */
|
||||
/*
|
||||
配列 vAry が min よりも大きいならば、vResult と 1 の AND を
|
||||
そうでないならば 0 をかく。
|
||||
配列 vAry が min よりも大きいならば、vResult と 1 の AND を
|
||||
そうでないならば 0 をかく。
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
max : 最小値
|
||||
vResults : 結果を代入する配列
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
max : 最小値
|
||||
vResults : 結果を代入する配列
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -542,14 +542,14 @@ void AndHighArray(void) { /* 19 */
|
||||
|
||||
void AndRangeArray(void) { /* 20 */
|
||||
/*
|
||||
vAry が min から max にある場合、vResults と 1 の AND を
|
||||
そうでなければ 0 をかく。
|
||||
vAry が min から max にある場合、vResults と 1 の AND を
|
||||
そうでなければ 0 をかく。
|
||||
|
||||
vAry: 配列
|
||||
cnt: 個数
|
||||
min: 最小値
|
||||
max: 最大値
|
||||
vResults: 結果を返す配列
|
||||
vAry: 配列
|
||||
cnt: 個数
|
||||
min: 最小値
|
||||
max: 最大値
|
||||
vResults: 結果を返す配列
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -568,14 +568,14 @@ void AndRangeArray(void) { /* 20 */
|
||||
|
||||
void AndAndEquArray(void) { /* 21 */
|
||||
/*
|
||||
配列 vAry と mask との AND をとって val に等しければ
|
||||
配列 vResults と1の AND、等しくなければ 0 を書く
|
||||
配列 vAry と mask との AND をとって val に等しければ
|
||||
配列 vResults と1の AND、等しくなければ 0 を書く
|
||||
|
||||
vAry: 配列
|
||||
mask: 配列にかけるマスク
|
||||
cnt : 個数
|
||||
val : 比較する値
|
||||
vResults : 結果を代入する配列
|
||||
vAry: 配列
|
||||
mask: 配列にかけるマスク
|
||||
cnt : 個数
|
||||
val : 比較する値
|
||||
vResults : 結果を代入する配列
|
||||
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
@@ -604,12 +604,12 @@ void OrEquArray(void) { /* 22 */
|
||||
|
||||
void OrNotArray(void) { /* 23 */
|
||||
/*
|
||||
配列の値が val と等しくなければ vResult に 1 を書き込む
|
||||
配列の値が val と等しくなければ vResult に 1 を書き込む
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : 比較する値
|
||||
vResults: 結果を書き込む変数
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : 比較する値
|
||||
vResults: 結果を書き込む変数
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -666,12 +666,12 @@ void OrAndEquArray(void) { /* 27 */
|
||||
|
||||
void EnumEquArray(void) { /* 28 */
|
||||
/*
|
||||
配列のデータ中に val と同じデータを数を vResult に返す
|
||||
配列のデータ中に val と同じデータを数を vResult に返す
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : 比較する値
|
||||
vResult: 一致する個数を返す変数
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : 比較する値
|
||||
vResult: 一致する個数を返す変数
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -702,15 +702,15 @@ void EnumEquArray2(void) { /* 29 */
|
||||
|
||||
void EnumEquNotArray2(void) { /* 30 */
|
||||
/*
|
||||
配列1が val1 に等しく、配列2がval2 に等しくないものの数を
|
||||
vResult に返す。
|
||||
配列1が val1 に等しく、配列2がval2 に等しくないものの数を
|
||||
vResult に返す。
|
||||
|
||||
vAry1: 配列1
|
||||
vAry2: 配列2
|
||||
cnt: 個数
|
||||
val1: 配列1と比較する値
|
||||
val2: 配列2と比較する値
|
||||
vResult: 条件に一致する数を返す変数
|
||||
vAry1: 配列1
|
||||
vAry2: 配列2
|
||||
cnt: 個数
|
||||
val1: 配列1と比較する値
|
||||
val2: 配列2と比較する値
|
||||
vResult: 条件に一致する数を返す変数
|
||||
*/
|
||||
int *vAry1 = getCaliVariable();
|
||||
int *vAry2 = getCaliVariable();
|
||||
@@ -734,12 +734,12 @@ void EnumEquNotArray2(void) { /* 30 */
|
||||
|
||||
void EnumNotArray(void) { /* 31 */
|
||||
/*
|
||||
配列のなかで val と等しくないものの個数を返す
|
||||
配列のなかで val と等しくないものの個数を返す
|
||||
|
||||
vAry: 配列
|
||||
cnt: 個数
|
||||
val: 比較する値
|
||||
vResult: 等しくないものの数
|
||||
vAry: 配列
|
||||
cnt: 個数
|
||||
val: 比較する値
|
||||
vResult: 等しくないものの数
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -790,13 +790,13 @@ void EnumHighArray(void) { /* 34 */
|
||||
|
||||
void EnumRangeArray(void) { /* 35 */
|
||||
/*
|
||||
配列の値のうちが min と max の間あるものの数を vResult に返す
|
||||
配列の値のうちが min と max の間あるものの数を vResult に返す
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
min : 最小値
|
||||
max : 最大値
|
||||
vResult: 一致した数を返す変数
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
min : 最小値
|
||||
max : 最大値
|
||||
vResult: 一致した数を返す変数
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -820,14 +820,14 @@ void EnumRangeArray(void) { /* 35 */
|
||||
|
||||
void GrepEquArray(void) { /* 36 */
|
||||
/*
|
||||
配列の値が val と等しければ vLastMatch に一致した index を返し
|
||||
vResult に 1 を返す
|
||||
配列の値が val と等しければ vLastMatch に一致した index を返し
|
||||
vResult に 1 を返す
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : 比較する値
|
||||
vMatch: 一致したインデックス
|
||||
vResult: 一つでも val と同じ値があれば 1
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : 比較する値
|
||||
vMatch: 一致したインデックス
|
||||
vResult: 一つでも val と同じ値があれば 1
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -852,14 +852,14 @@ void GrepEquArray(void) { /* 36 */
|
||||
|
||||
void GrepNotArray(void) { /* 37 */
|
||||
/*
|
||||
配列の値が val と等しくなければ vLastMatch にその index を返し
|
||||
vResult に 1 を返す
|
||||
配列の値が val と等しくなければ vLastMatch にその index を返し
|
||||
vResult に 1 を返す
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : 比較する値
|
||||
vMatch: 一致するindex
|
||||
vResult: 一つでも val と同じ値があれば 1
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
val : 比較する値
|
||||
vMatch: 一致するindex
|
||||
vResult: 一つでも val と同じ値があれば 1
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -920,14 +920,14 @@ void GrepEquNotArray2(void) { /* 40 */
|
||||
|
||||
void GrepLowArray(void) { /* 41 */
|
||||
/*
|
||||
配列の値が min よりも小さければ vMatch に一致した index
|
||||
を返し vResult に 1 を返す
|
||||
配列の値が min よりも小さければ vMatch に一致した index
|
||||
を返し vResult に 1 を返す
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
min : 最小値
|
||||
vMatch: 一致したインデックス
|
||||
vResult: 一つでも val と同じ値があれば 1
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
min : 最小値
|
||||
vMatch: 一致したインデックス
|
||||
vResult: 一つでも val と同じ値があれば 1
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -952,14 +952,14 @@ void GrepLowArray(void) { /* 41 */
|
||||
|
||||
void GrepHighArray(void) { /* 42 */
|
||||
/*
|
||||
配列の値が min よりも大きければ vMatch に一致した index
|
||||
を返し vResult に 1 を返す
|
||||
配列の値が min よりも大きければ vMatch に一致した index
|
||||
を返し vResult に 1 を返す
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
max : 最大値
|
||||
vMatch: 一致したインデックス
|
||||
vResult: 一つでも val と同じ値があれば 1
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
max : 最大値
|
||||
vMatch: 一致したインデックス
|
||||
vResult: 一つでも val と同じ値があれば 1
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -984,15 +984,15 @@ void GrepHighArray(void) { /* 42 */
|
||||
|
||||
void GrepRangeArray(void) { /* 43 */
|
||||
/*
|
||||
配列の値が max と min の間にあれば vMatch に一致した index
|
||||
を返し vResult に 1 を返す
|
||||
配列の値が max と min の間にあれば vMatch に一致した index
|
||||
を返し vResult に 1 を返す
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
min : 最小値
|
||||
max : 最大値
|
||||
vMatch: 一致したインデックス
|
||||
vResult: 一つでも val と同じ値があれば 1
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
min : 最小値
|
||||
max : 最大値
|
||||
vMatch: 一致したインデックス
|
||||
vResult: 一つでも val と同じ値があれば 1
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -1018,17 +1018,17 @@ void GrepRangeArray(void) { /* 43 */
|
||||
|
||||
void GrepLowOrderArray(void) { /* 44 */
|
||||
/*
|
||||
配列 vAry の中で minよりも大きく、 max よりも小さいもの
|
||||
のうち、最も小さいものの index を vLastMatch に返す。
|
||||
ただし。v1[index] は 0 である必要がある。
|
||||
配列 vAry の中で minよりも大きく、 max よりも小さいもの
|
||||
のうち、最も小さいものの index を vLastMatch に返す。
|
||||
ただし。v1[index] は 0 である必要がある。
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
min : 最小値
|
||||
max : 最大値
|
||||
v1 : 結果を返す配列(0 の場所しか比較せず、最小の場所に 1 を書く
|
||||
vLastMatch: 最小値を示す配列のindex
|
||||
vResult: 最小値が見つかれば 1, 見つからなければ 0
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
min : 最小値
|
||||
max : 最大値
|
||||
v1 : 結果を返す配列(0 の場所しか比較せず、最小の場所に 1 を書く
|
||||
vLastMatch: 最小値を示す配列のindex
|
||||
vResult: 最小値が見つかれば 1, 見つからなければ 0
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -1069,17 +1069,17 @@ void GrepLowOrderArray(void) { /* 44 */
|
||||
|
||||
void GrepHighOrderArray(void) { /* 45 */
|
||||
/*
|
||||
配列 vAry の中で minよりも大きく、 max よりも小さいもの
|
||||
のうち、最も大きいものの index を vLastMatch に返す。
|
||||
ただし。v1[index] は 0 である必要がある。
|
||||
配列 vAry の中で minよりも大きく、 max よりも小さいもの
|
||||
のうち、最も大きいものの index を vLastMatch に返す。
|
||||
ただし。v1[index] は 0 である必要がある。
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
min : 最小値
|
||||
max : 最大値
|
||||
v1 : 結果を返す配列(0 の場所しか比較せず、最小の場所に 1 を書く
|
||||
vLastMatch: 最大値を示す配列のindex
|
||||
vResult: 最大値が見つかれば 1, 見つからなければ 0
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
min : 最小値
|
||||
max : 最大値
|
||||
v1 : 結果を返す配列(0 の場所しか比較せず、最小の場所に 1 を書く
|
||||
vLastMatch: 最大値を示す配列のindex
|
||||
vResult: 最大値が見つかれば 1, 見つからなければ 0
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -1163,13 +1163,13 @@ void ChangeHighArray(void) { /* 49 */
|
||||
|
||||
void ChangeRangeArray(void) { /* 50 */
|
||||
/*
|
||||
配列内データが min から max の間にあるときは val で置き換え
|
||||
配列内データが min から max の間にあるときは val で置き換え
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
min : 最小値
|
||||
max : 最大値
|
||||
val : 置き換える値
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
min : 最小値
|
||||
max : 最大値
|
||||
val : 置き換える値
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -1190,16 +1190,16 @@ void ChangeRangeArray(void) { /* 50 */
|
||||
|
||||
void CopyArrayToRect(void) { /* 51 */
|
||||
/*
|
||||
vSrc の sw * sh の領域を vDst の dx,dy の位置にコピー
|
||||
vSrc の sw * sh の領域を vDst の dx,dy の位置にコピー
|
||||
|
||||
vSrc: コピー元配列
|
||||
sw : コピー元 width
|
||||
sh : コピー元 height
|
||||
sx : コピー元 x
|
||||
sy : コピー元 y
|
||||
vDst: コピー先配列
|
||||
dw : コピー先 width
|
||||
dh : コピー先 height
|
||||
vSrc: コピー元配列
|
||||
sw : コピー元 width
|
||||
sh : コピー元 height
|
||||
sx : コピー元 x
|
||||
sy : コピー元 y
|
||||
vDst: コピー先配列
|
||||
dw : コピー先 width
|
||||
dh : コピー先 height
|
||||
*/
|
||||
int *vSrc = getCaliVariable();
|
||||
int sw = getCaliValue();
|
||||
@@ -1224,16 +1224,16 @@ void CopyArrayToRect(void) { /* 51 */
|
||||
|
||||
void CopyRectToArray(void) { /* 52 */
|
||||
/*
|
||||
vSrc の sw * sh の領域を vDst の dx,dy の位置にコピー
|
||||
vSrc の sw * sh の領域を vDst の dx,dy の位置にコピー
|
||||
|
||||
vSrc: コピー元配列
|
||||
sw : コピー元 width
|
||||
sh : コピー元 height
|
||||
vDst: コピー先配列
|
||||
dw : コピー先 width
|
||||
dh : コピー先 height
|
||||
dx : コピー先 x
|
||||
dy : コピー先 y
|
||||
vSrc: コピー元配列
|
||||
sw : コピー元 width
|
||||
sh : コピー元 height
|
||||
vDst: コピー先配列
|
||||
dw : コピー先 width
|
||||
dh : コピー先 height
|
||||
dx : コピー先 x
|
||||
dy : コピー先 y
|
||||
*/
|
||||
int *vSrc = getCaliVariable();
|
||||
int sw = getCaliValue();
|
||||
@@ -1258,12 +1258,12 @@ void CopyRectToArray(void) { /* 52 */
|
||||
|
||||
void ChangeSecretArray(void) { /* 53 */
|
||||
/*
|
||||
良く分からないが、データをコード化しているようだ
|
||||
良く分からないが、データをコード化しているようだ
|
||||
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
type: 機能番号
|
||||
vResult: 結果を返す変数
|
||||
vAry: 配列
|
||||
cnt : 個数
|
||||
type: 機能番号
|
||||
vResult: 結果を返す変数
|
||||
*/
|
||||
int *vAry = getCaliVariable();
|
||||
int cnt = getCaliValue();
|
||||
@@ -1278,7 +1278,7 @@ void ChangeSecretArray(void) { /* 53 */
|
||||
switch(type) {
|
||||
case 0:
|
||||
/*
|
||||
cnt -1 番目のキーを vAry に取り出す
|
||||
cnt -1 番目のキーを vAry に取り出す
|
||||
*/
|
||||
if (cnt > 0 && cnt < 5) {
|
||||
*vAry = key[cnt -1];
|
||||
@@ -1287,7 +1287,7 @@ void ChangeSecretArray(void) { /* 53 */
|
||||
break;
|
||||
case 1:
|
||||
/*
|
||||
vAry を cnt -1 番目のキーにセットする
|
||||
vAry を cnt -1 番目のキーにセットする
|
||||
*/
|
||||
if (cnt > 0 && cnt < 5) {
|
||||
key[cnt -1] = *vAry;
|
||||
@@ -1297,7 +1297,7 @@ void ChangeSecretArray(void) { /* 53 */
|
||||
case 2:
|
||||
{
|
||||
/*
|
||||
エンコードその1
|
||||
エンコードその1
|
||||
*/
|
||||
int i, j = 0;
|
||||
WORD ax = key[3] ^ 0x5a5a;
|
||||
@@ -1318,7 +1318,7 @@ void ChangeSecretArray(void) { /* 53 */
|
||||
case 3:
|
||||
{
|
||||
/*
|
||||
エンコードその2
|
||||
エンコードその2
|
||||
*/
|
||||
int i, j = 0, k;
|
||||
WORD ax = key[3] ^ 0x5a5a;
|
||||
|
||||
+36
-36
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* ShCalc.c 64ビット演算 module
|
||||
* ShCalc.c 64ビット演算 module
|
||||
*
|
||||
* かえるにょ国にょアリス
|
||||
* 大悪司
|
||||
* かえるにょ国にょアリス
|
||||
* 大悪司
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -53,9 +53,9 @@ static gint64 div64(gint64 a1, gint64 a2) {
|
||||
|
||||
void SetIntNumBase(void) { /* 0 */
|
||||
/*
|
||||
64 bit 演算のための倍数をセット
|
||||
64 bit 演算のための倍数をセット
|
||||
|
||||
base: 倍数
|
||||
base: 倍数
|
||||
*/
|
||||
int base = getCaliValue();
|
||||
|
||||
@@ -67,9 +67,9 @@ void SetIntNumBase(void) { /* 0 */
|
||||
|
||||
void SetIntNum16(void) { /* 1 */
|
||||
/*
|
||||
64 bit 演算のための数値をセット
|
||||
64 bit 演算のための数値をセット
|
||||
|
||||
var: 数値の入った変数
|
||||
var: 数値の入った変数
|
||||
*/
|
||||
int *var = getCaliVariable();
|
||||
|
||||
@@ -86,9 +86,9 @@ void SetIntNum32(void) { /* 2 */
|
||||
|
||||
void GetIntNum16(void) { /* 3 */
|
||||
/*
|
||||
64 bit 演算した結果を得る
|
||||
64 bit 演算した結果を得る
|
||||
|
||||
var: 数値をいれる変数
|
||||
var: 数値をいれる変数
|
||||
*/
|
||||
int *var = getCaliVariable();
|
||||
gint64 i;
|
||||
@@ -112,9 +112,9 @@ void GetIntNum32(void) { /* 4 */
|
||||
|
||||
void AddIntNum16(void) { /* 5 */
|
||||
/*
|
||||
64 bit 加算
|
||||
64 bit 加算
|
||||
|
||||
var: 足す数の入った変数
|
||||
var: 足す数の入った変数
|
||||
*/
|
||||
int *var = getCaliVariable();
|
||||
|
||||
@@ -143,9 +143,9 @@ void SubIntNum32(void) { /* 8 */
|
||||
|
||||
void MulIntNum16(void) { /* 9 */
|
||||
/*
|
||||
64 bit 乗算
|
||||
64 bit 乗算
|
||||
|
||||
var: 掛ける数の入った変数
|
||||
var: 掛ける数の入った変数
|
||||
*/
|
||||
int *var = getCaliVariable();
|
||||
|
||||
@@ -162,9 +162,9 @@ void MulIntNum32(void) { /* 10 */
|
||||
|
||||
void DivIntNum16(void) { /* 11 */
|
||||
/*
|
||||
64 bit 除算
|
||||
64 bit 除算
|
||||
|
||||
var: 足す数の入った変数
|
||||
var: 足す数の入った変数
|
||||
*/
|
||||
int *var = getCaliVariable();
|
||||
gint64 i;
|
||||
@@ -201,9 +201,9 @@ void CmpIntNum32(void) { /* 14 */
|
||||
|
||||
void GetLengthNum16(void) { /* 15 */
|
||||
/*
|
||||
数値の桁数を返す
|
||||
var: 数値
|
||||
vResult: 数値の桁数を返す変数
|
||||
数値の桁数を返す
|
||||
var: 数値
|
||||
vResult: 数値の桁数を返す変数
|
||||
*/
|
||||
int *var = getCaliVariable();
|
||||
int *vResult = getCaliVariable();
|
||||
@@ -232,14 +232,14 @@ void GetLengthNum32(void) { /* 16 */
|
||||
|
||||
void NumToRate(void) { /* 17 */
|
||||
/*
|
||||
p1 * (p3/p2) の演算結果を返す。
|
||||
p1 * (p3/p2) の演算結果を返す。
|
||||
|
||||
p1: 数値1
|
||||
p2: 数値2
|
||||
p3: 数値3
|
||||
flag: 0 切捨て
|
||||
1 切り上げ
|
||||
vResult: 結果を返す変数
|
||||
p1: 数値1
|
||||
p2: 数値2
|
||||
p3: 数値3
|
||||
flag: 0 切捨て
|
||||
1 切り上げ
|
||||
vResult: 結果を返す変数
|
||||
*/
|
||||
int p1 = getCaliValue();
|
||||
int p2 = getCaliValue();
|
||||
@@ -264,14 +264,14 @@ void NumToRate(void) { /* 17 */
|
||||
|
||||
void NumToRateNum(void) { /* 18 */
|
||||
/*
|
||||
p1 * (p2/p3) の演算結果を返す。
|
||||
p1 * (p2/p3) の演算結果を返す。
|
||||
|
||||
p1: 数値1
|
||||
p2: 数値2
|
||||
p3: 数値3
|
||||
flag: 0 切捨て
|
||||
1 切り上げ
|
||||
vResult: 結果を返す変数
|
||||
p1: 数値1
|
||||
p2: 数値2
|
||||
p3: 数値3
|
||||
flag: 0 切捨て
|
||||
1 切り上げ
|
||||
vResult: 結果を返す変数
|
||||
*/
|
||||
int p1 = getCaliValue();
|
||||
int p2 = getCaliValue();
|
||||
@@ -295,9 +295,9 @@ void NumToRateNum(void) { /* 18 */
|
||||
|
||||
void SetRandomSeed() {
|
||||
/*
|
||||
乱数の種の設定
|
||||
乱数の種の設定
|
||||
|
||||
seed: 種
|
||||
seed: 種
|
||||
*/
|
||||
int seed = getCaliValue();
|
||||
|
||||
@@ -323,7 +323,7 @@ void NumToBit() {
|
||||
/*
|
||||
2^(beki-1)
|
||||
|
||||
var: 値を返す変数
|
||||
var: 値を返す変数
|
||||
*/
|
||||
int beki = getCaliValue();
|
||||
int *var = getCaliVariable();
|
||||
@@ -351,7 +351,7 @@ void BitToNum() {
|
||||
16 -> 5 ....
|
||||
others -> 0
|
||||
|
||||
var: 値を返す変数
|
||||
var: 値を返す変数
|
||||
*/
|
||||
int val = getCaliValue();
|
||||
int *var = getCaliVariable();
|
||||
|
||||
+62
-62
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* ShGraph.c アニメーション関連 module
|
||||
* ShGraph.c アニメーション関連 module
|
||||
*
|
||||
* 大悪司
|
||||
* 大悪司
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -41,10 +41,10 @@
|
||||
|
||||
static void copy_sprite(int sx, int sy, int width, int height, int dx, int dy, int r, int g, int b);
|
||||
|
||||
static MyRectangle maprect; /* アニメーション表示領域 */
|
||||
static MyRectangle mapback; /* 背景セーブ領域 */
|
||||
static int mapback_p5; /* 背景転送先 X */
|
||||
static int mapback_p6; /* 背景転送先 Y */
|
||||
static MyRectangle maprect; /* アニメーション表示領域 */
|
||||
static MyRectangle mapback; /* 背景セーブ領域 */
|
||||
static int mapback_p5; /* 背景転送先 X */
|
||||
static int mapback_p6; /* 背景転送先 Y */
|
||||
|
||||
struct animsrc {
|
||||
int x;
|
||||
@@ -57,7 +57,7 @@ struct animsrc {
|
||||
int g;
|
||||
int b;
|
||||
};
|
||||
static struct animsrc src[SLOT]; /* アニメーション各コマ転送元 */
|
||||
static struct animsrc src[SLOT]; /* アニメーション各コマ転送元 */
|
||||
|
||||
struct _s0 {
|
||||
int *dst_p1;
|
||||
@@ -85,12 +85,12 @@ struct _s2 {
|
||||
};
|
||||
static struct _s2 s2[SLOT];
|
||||
|
||||
static int* add_p5[SLOT]; /* どこまでアニメーションのコマが進んだか */
|
||||
static int* add_p5[SLOT]; /* どこまでアニメーションのコマが進んだか */
|
||||
|
||||
|
||||
void Init() {
|
||||
/*
|
||||
モジュール初期化
|
||||
モジュール初期化
|
||||
*/
|
||||
int p1 = getCaliValue(); /* ISurface */
|
||||
|
||||
@@ -117,14 +117,14 @@ void ChangeEquColor() {
|
||||
|
||||
void ChangeNotColor() {
|
||||
/*
|
||||
指定の領域が src と等しくなければ dst に塗りつぶす
|
||||
指定の領域が src と等しくなければ dst に塗りつぶす
|
||||
|
||||
x0: source x0
|
||||
y0: source y0
|
||||
width: source width
|
||||
height: source height
|
||||
*src: 塗りつぶし候補の色が入っている変数 src, src+1, src+2
|
||||
*dst: 塗りつぶしの色が入っている変数 dst, dst+1, dst+2
|
||||
*src: 塗りつぶし候補の色が入っている変数 src, src+1, src+2
|
||||
*dst: 塗りつぶしの色が入っている変数 dst, dst+1, dst+2
|
||||
*/
|
||||
int x0 = getCaliValue();
|
||||
int y0 = getCaliValue();
|
||||
@@ -202,36 +202,36 @@ void ChangeNotColor() {
|
||||
}
|
||||
|
||||
/*
|
||||
アニメーション使用手順
|
||||
1: まず、リセット (ResetAnimData 0:)
|
||||
2: アニメーションを表示する領域の設定 (SetAnimeRect x,y,w,h:)
|
||||
3: アニメーションの背景が書かれている領域の設定
|
||||
(SetAnimeBack sx,sy,w,h,dx,dy:) dx, dy は転送先
|
||||
4: 各アニメーションのパターンの領域の設定
|
||||
アニメーション使用手順
|
||||
1: まず、リセット (ResetAnimData 0:)
|
||||
2: アニメーションを表示する領域の設定 (SetAnimeRect x,y,w,h:)
|
||||
3: アニメーションの背景が書かれている領域の設定
|
||||
(SetAnimeBack sx,sy,w,h,dx,dy:) dx, dy は転送先
|
||||
4: 各アニメーションのパターンの領域の設定
|
||||
(SetAnimeSrc slot,sx,sy,w,h,uw,uh,pal)
|
||||
5: 各アニメーションの表示座標の設定
|
||||
5: 各アニメーションの表示座標の設定
|
||||
(SetAnimeDst slot,varx,vary,offx,offy,offw,offh:)
|
||||
6: アニメーションパターンの設定
|
||||
何番のスロットをどの順番で再生するかを指定
|
||||
6: アニメーションパターンの設定
|
||||
何番のスロットをどの順番で再生するかを指定
|
||||
(SetAnimeData pat,src,dst,num,varpat,waveno:)
|
||||
例
|
||||
例
|
||||
ShGraph.AddAnimeData 1,11,11,5,var1,81:
|
||||
ShGraph.AddAnimeData 1,13,12,8,var2,84:
|
||||
ShGraph.AddAnimeData 1,14,12,2,var3,20736:
|
||||
|
||||
アニメその1は パターン 11->13->14 のスロットを再生。それぞれ、5コマ,
|
||||
8コマ,2コマづつ使用する。表示位置は 11->12->12 のスロットを使用。
|
||||
アニメその1は パターン 11->13->14 のスロットを再生。それぞれ、5コマ,
|
||||
8コマ,2コマづつ使用する。表示位置は 11->12->12 のスロットを使用。
|
||||
|
||||
7: 実際に再生するアニメを決定。(AddAnimeRemain slot:)
|
||||
8: 指定するスロットまでアニメ再生 (PlayAnimeData lastslot,wait:)
|
||||
lastslotが0の場合は 7 で指定したところまで。
|
||||
7: 実際に再生するアニメを決定。(AddAnimeRemain slot:)
|
||||
8: 指定するスロットまでアニメ再生 (PlayAnimeData lastslot,wait:)
|
||||
lastslotが0の場合は 7 で指定したところまで。
|
||||
|
||||
*/
|
||||
void ResetAnimeData() {
|
||||
/*
|
||||
アニメーション用の各種データをクリア
|
||||
アニメーション用の各種データをクリア
|
||||
|
||||
no: クリア対象スロット(0なら全スロットクリア)
|
||||
no: クリア対象スロット(0なら全スロットクリア)
|
||||
*/
|
||||
int no = getCaliValue();
|
||||
|
||||
@@ -254,16 +254,16 @@ void ResetAnimeData() {
|
||||
|
||||
void SetAnimeSrc() {
|
||||
/*
|
||||
アニメーションの各パターンのソース領域の設定
|
||||
アニメーションの各パターンのソース領域の設定
|
||||
|
||||
no: スロット番号
|
||||
no: スロット番号
|
||||
x0: src x0
|
||||
y0: src y0
|
||||
w : src width
|
||||
h : src height
|
||||
uw: パターンの横の並びの数
|
||||
uh: パターンの縦の並びの数
|
||||
*pal: 抜き色を格納してある変数の先頭 (pal, pal+1, pal+2)
|
||||
uw: パターンの横の並びの数
|
||||
uh: パターンの縦の並びの数
|
||||
*pal: 抜き色を格納してある変数の先頭 (pal, pal+1, pal+2)
|
||||
*/
|
||||
int no = getCaliValue();
|
||||
int x0 = getCaliValue();
|
||||
@@ -297,15 +297,15 @@ void SetAnimeSrc() {
|
||||
|
||||
void SetAnimeDst() {
|
||||
/*
|
||||
アニメーションの描画先設定
|
||||
アニメーションの描画先設定
|
||||
|
||||
no: スロット番号
|
||||
p1: 現在の描画先(x)を格納する変数
|
||||
p2: 現在の描画先(y)を格納する変数
|
||||
p3: 描画先オフセット (x) 10000が中央(0)
|
||||
p4: 描画先オフセット (y) 10000が中央
|
||||
p5: 描画先オフセット追加分 (w) 10000が中央
|
||||
p6: 描画先オフセット追加分 (h) 10000が中央
|
||||
no: スロット番号
|
||||
p1: 現在の描画先(x)を格納する変数
|
||||
p2: 現在の描画先(y)を格納する変数
|
||||
p3: 描画先オフセット (x) 10000が中央(0)
|
||||
p4: 描画先オフセット (y) 10000が中央
|
||||
p5: 描画先オフセット追加分 (w) 10000が中央
|
||||
p6: 描画先オフセット追加分 (h) 10000が中央
|
||||
*/
|
||||
int no = getCaliValue();
|
||||
int *p1 = getCaliVariable();
|
||||
@@ -332,14 +332,14 @@ void SetAnimeDst() {
|
||||
|
||||
void AddAnimeData() {
|
||||
/*
|
||||
アニメーション各種設定
|
||||
アニメーション各種設定
|
||||
|
||||
no: スロット番号
|
||||
p2: アニメーションパターン格納先頭スロット
|
||||
p3: アニメーションパターン表示先頭スロット
|
||||
p4: アニメーションパターン個数
|
||||
p5: 現在どの何番目のパターンを書いているかを保存しておく変数
|
||||
p6: 効果音 WAV ファイル番号
|
||||
no: スロット番号
|
||||
p2: アニメーションパターン格納先頭スロット
|
||||
p3: アニメーションパターン表示先頭スロット
|
||||
p4: アニメーションパターン個数
|
||||
p5: 現在どの何番目のパターンを書いているかを保存しておく変数
|
||||
p6: 効果音 WAV ファイル番号
|
||||
*/
|
||||
int no = getCaliValue();
|
||||
int p2 = getCaliValue();
|
||||
@@ -376,9 +376,9 @@ void AddAnimeData() {
|
||||
|
||||
void AddAnimeRemain() {
|
||||
/*
|
||||
アニメーション各種設定
|
||||
アニメーション各種設定
|
||||
|
||||
no: スロット番号
|
||||
no: スロット番号
|
||||
*/
|
||||
int no = getCaliValue();
|
||||
int i, _max = 0;
|
||||
@@ -402,7 +402,7 @@ void AddAnimeRemain() {
|
||||
|
||||
void SetAnimeRect() {
|
||||
/*
|
||||
アニメーション描画領域設定
|
||||
アニメーション描画領域設定
|
||||
|
||||
x: region x
|
||||
y: region y
|
||||
@@ -424,14 +424,14 @@ void SetAnimeRect() {
|
||||
|
||||
void SetAnimeBack() {
|
||||
/*
|
||||
アニメーション背景領域設定
|
||||
アニメーション背景領域設定
|
||||
|
||||
sx: 背景領域 x
|
||||
sy: 背景領域 y
|
||||
w: 背景領域 width
|
||||
h: 背景領域 height
|
||||
p5: 背景領域 転送先 x オフセット
|
||||
p6: 背景領域 転送先 y オフセット
|
||||
sx: 背景領域 x
|
||||
sy: 背景領域 y
|
||||
w: 背景領域 width
|
||||
h: 背景領域 height
|
||||
p5: 背景領域 転送先 x オフセット
|
||||
p6: 背景領域 転送先 y オフセット
|
||||
*/
|
||||
int sx = getCaliValue();
|
||||
int sy = getCaliValue();
|
||||
@@ -452,10 +452,10 @@ void SetAnimeBack() {
|
||||
|
||||
void PlayAnimeData() {
|
||||
/*
|
||||
実際にアニメーションを実行
|
||||
実際にアニメーションを実行
|
||||
|
||||
p1: 最大再生スロット(0の場合は全部)
|
||||
p2: アニメーションインターバル(10msec単位)
|
||||
p1: 最大再生スロット(0の場合は全部)
|
||||
p2: アニメーションインターバル(10msec単位)
|
||||
*/
|
||||
int p1 = getCaliValue();
|
||||
int p2 = getCaliValue();
|
||||
|
||||
+14
-14
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* ShPort.c Widget 呼び出し? module
|
||||
* ShPort.c Widget 呼び出し? module
|
||||
*
|
||||
* かえるにょ国にょアリス(未使用)
|
||||
* 大悪司
|
||||
* かえるにょ国にょアリス(未使用)
|
||||
* 大悪司
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "xsystem35.h"
|
||||
#include "graphicsdevice.h"
|
||||
|
||||
// キー変換テーブル
|
||||
// キー変換テーブル
|
||||
#define KEYMAP_MAX 8
|
||||
static BYTE *keymap[KEYMAP_MAX];
|
||||
|
||||
@@ -65,7 +65,7 @@ void InputListNum(void) { /* 1 */
|
||||
|
||||
/**
|
||||
* ShPort:Init
|
||||
* ShPortサブシステム全体の初期化
|
||||
* ShPortサブシステム全体の初期化
|
||||
* @param p1: ISys3x
|
||||
*/
|
||||
void Init(void) {
|
||||
@@ -76,8 +76,8 @@ void Init(void) {
|
||||
|
||||
/**
|
||||
* ShPort:InitKeyStatus
|
||||
* 指定のキーコードマップの初期化
|
||||
* @param no: キーコードマップの番号(1~)
|
||||
* 指定のキーコードマップの初期化
|
||||
* @param no: キーコードマップの番号(1~)
|
||||
*/
|
||||
void InitKeyStatus(void) {
|
||||
int no = getCaliValue();
|
||||
@@ -98,10 +98,10 @@ void InitKeyStatus(void) {
|
||||
|
||||
/**
|
||||
* ShPort:SetKeyStatus
|
||||
* 指定マップのキーコードへの機能の割り付け。
|
||||
* @param no: マップ番号
|
||||
* @param key: キーコード
|
||||
* @param func: 機能キーコード
|
||||
* 指定マップのキーコードへの機能の割り付け。
|
||||
* @param no: マップ番号
|
||||
* @param key: キーコード
|
||||
* @param func: 機能キーコード
|
||||
*/
|
||||
void SetKeyStatus(void) {
|
||||
int no = getCaliValue();
|
||||
@@ -120,9 +120,9 @@ void SetKeyStatus(void) {
|
||||
|
||||
/**
|
||||
* ShPort:GetKeyStatus
|
||||
* 指定マップのキーの押下状態の取得
|
||||
* @param no: マップ番号
|
||||
* @param var: 押下キーに対応する機能コードを返す変数
|
||||
* 指定マップのキーの押下状態の取得
|
||||
* @param no: マップ番号
|
||||
* @param var: 押下キーに対応する機能コードを返す変数
|
||||
*/
|
||||
void GetKeyStatus(void) {
|
||||
int no = getCaliValue();
|
||||
|
||||
+39
-39
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* ShSound.c 音楽関連 module
|
||||
* ShSound.c 音楽関連 module
|
||||
*
|
||||
* 大悪司
|
||||
* 大悪司
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -43,7 +43,7 @@ static WAVFILE *wfile;
|
||||
|
||||
void Init() {
|
||||
/*
|
||||
モジュール初期化
|
||||
モジュール初期化
|
||||
*/
|
||||
int p1 = getCaliValue(); /* ISys3x */
|
||||
|
||||
@@ -52,10 +52,10 @@ void Init() {
|
||||
|
||||
void wavLoad() {
|
||||
/*
|
||||
指定のスロットにPCMファイルをロード
|
||||
指定のスロットにPCMファイルをロード
|
||||
|
||||
slot: ロードするスロット(チャンネル)番号
|
||||
no : ロードするファイル番号
|
||||
slot: ロードするスロット(チャンネル)番号
|
||||
no : ロードするファイル番号
|
||||
*/
|
||||
int slot = getCaliValue();
|
||||
int no = getCaliValue();
|
||||
@@ -67,9 +67,9 @@ void wavLoad() {
|
||||
|
||||
void wavUnload() {
|
||||
/*
|
||||
指定のスロットのPCMファイルを削除
|
||||
指定のスロットのPCMファイルを削除
|
||||
|
||||
slot: 削除するスロット番号
|
||||
slot: 削除するスロット番号
|
||||
*/
|
||||
int slot = getCaliValue();
|
||||
|
||||
@@ -80,10 +80,10 @@ void wavUnload() {
|
||||
|
||||
void wavUnloadRange() {
|
||||
/*
|
||||
指定のスロット(複数)のPCMファイルを削除
|
||||
指定のスロット(複数)のPCMファイルを削除
|
||||
|
||||
slot: 削除する最初のスロット番号
|
||||
range: 削除する個数
|
||||
slot: 削除する最初のスロット番号
|
||||
range: 削除する個数
|
||||
*/
|
||||
int slot = getCaliValue();
|
||||
int range = getCaliValue();
|
||||
@@ -98,7 +98,7 @@ void wavUnloadRange() {
|
||||
|
||||
void wavUnloadAll() {
|
||||
/*
|
||||
すべてのスロットのPCMファイルを削除
|
||||
すべてのスロットのPCMファイルを削除
|
||||
*/
|
||||
int i;
|
||||
|
||||
@@ -111,9 +111,9 @@ void wavUnloadAll() {
|
||||
|
||||
void wavLoadMemory() {
|
||||
/*
|
||||
指定の番号の WAV ファイルをメモリ上に読み込み
|
||||
指定の番号の WAV ファイルをメモリ上に読み込み
|
||||
|
||||
no: 読み込むファイル番号
|
||||
no: 読み込むファイル番号
|
||||
*/
|
||||
int no = getCaliValue();
|
||||
|
||||
@@ -124,9 +124,9 @@ void wavLoadMemory() {
|
||||
|
||||
void wavSendMemory() {
|
||||
/*
|
||||
wavLoadMemory で読み込んだデータを指定のスロットに投入
|
||||
wavLoadMemory で読み込んだデータを指定のスロットに投入
|
||||
|
||||
slot: PCMデータを送るスロット番号
|
||||
slot: PCMデータを送るスロット番号
|
||||
*/
|
||||
int slot = getCaliValue();
|
||||
|
||||
@@ -141,10 +141,10 @@ void wavSendMemory() {
|
||||
|
||||
void wavFadeVolumeMemory() {
|
||||
/*
|
||||
wavLoadMemory で読み込んだデータのボリュームのフェード
|
||||
wavLoadMemory で読み込んだデータのボリュームのフェード
|
||||
|
||||
start: フェード開始時間 (10msec単位)
|
||||
range: フェード継続時間 (10msec単位)
|
||||
start: フェード開始時間 (10msec単位)
|
||||
range: フェード継続時間 (10msec単位)
|
||||
*/
|
||||
int start = getCaliValue();
|
||||
int range = getCaliValue();
|
||||
@@ -158,7 +158,7 @@ void wavFadeVolumeMemory() {
|
||||
|
||||
void wavReversePanMemory() {
|
||||
/*
|
||||
wavLoadMemoryで読み込んだデータの左右のチャンネルを反転
|
||||
wavLoadMemoryで読み込んだデータの左右のチャンネルを反転
|
||||
*/
|
||||
|
||||
if (wfile == NULL) return;
|
||||
@@ -170,10 +170,10 @@ void wavReversePanMemory() {
|
||||
|
||||
void wavPlay() {
|
||||
/*
|
||||
指定のスロットのPCMを再生
|
||||
指定のスロットのPCMを再生
|
||||
|
||||
slot: 再生するスロット番号
|
||||
loop: 0なら1回だけ再生、!0なら無限に繰り返し
|
||||
slot: 再生するスロット番号
|
||||
loop: 0なら1回だけ再生、!0なら無限に繰り返し
|
||||
*/
|
||||
int slot = getCaliValue();
|
||||
int loop = getCaliValue();
|
||||
@@ -185,11 +185,11 @@ void wavPlay() {
|
||||
|
||||
void wavPlayRing() {
|
||||
/*
|
||||
指定の範囲のスロットのPCMを呼ばれる毎に繰り返し
|
||||
指定の範囲のスロットのPCMを呼ばれる毎に繰り返し
|
||||
|
||||
start: 最初のスロット番号
|
||||
cnt: 繰り返すスロットの個数
|
||||
*cur: 現在再生しているスロットのインデックス
|
||||
start: 最初のスロット番号
|
||||
cnt: 繰り返すスロットの個数
|
||||
*cur: 現在再生しているスロットのインデックス
|
||||
*/
|
||||
int start = getCaliValue();
|
||||
int cnt = getCaliValue();
|
||||
@@ -203,9 +203,9 @@ void wavPlayRing() {
|
||||
|
||||
void wavStop() {
|
||||
/*
|
||||
指定のスロットの再生を停止
|
||||
指定のスロットの再生を停止
|
||||
|
||||
slot: 停止するスロット番号
|
||||
slot: 停止するスロット番号
|
||||
*/
|
||||
int slot = getCaliValue();
|
||||
|
||||
@@ -216,7 +216,7 @@ void wavStop() {
|
||||
|
||||
void wavStopAll() {
|
||||
/*
|
||||
全てのスロットの再生を停止
|
||||
全てのスロットの再生を停止
|
||||
*/
|
||||
int i;
|
||||
|
||||
@@ -229,9 +229,9 @@ void wavStopAll() {
|
||||
|
||||
void wavPause() {
|
||||
/*
|
||||
指定のスロットの再生を一時停止
|
||||
指定のスロットの再生を一時停止
|
||||
|
||||
slot: 一時停止するスロット番号
|
||||
slot: 一時停止するスロット番号
|
||||
*/
|
||||
int slot = getCaliValue();
|
||||
|
||||
@@ -240,10 +240,10 @@ void wavPause() {
|
||||
|
||||
void wavIsPlay() {
|
||||
/*
|
||||
指定のスロットが再生中かどうかを調べる
|
||||
指定のスロットが再生中かどうかを調べる
|
||||
|
||||
slot: 調べるスロット番号
|
||||
*result: 0なら停止中、!0なら再生中
|
||||
slot: 調べるスロット番号
|
||||
*result: 0なら停止中、!0なら再生中
|
||||
*/
|
||||
int slot = getCaliValue();
|
||||
int *result = getCaliVariable();
|
||||
@@ -255,11 +255,11 @@ void wavIsPlay() {
|
||||
|
||||
void wavIsPlayRange() {
|
||||
/*
|
||||
指定の範囲のスロットが再生中かどうかを調べる
|
||||
指定の範囲のスロットが再生中かどうかを調べる
|
||||
|
||||
slot: 調べる最初のスロット
|
||||
range: 調べるスロットの個数
|
||||
*result: 0:すべてのスロットが停止中, 1: どれかのスロットが再生中
|
||||
slot: 調べる最初のスロット
|
||||
range: 調べるスロットの個数
|
||||
*result: 0:すべてのスロットが停止中, 1: どれかのスロットが再生中
|
||||
*/
|
||||
int slot = getCaliValue();
|
||||
int range = getCaliValue();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* shpcmlib.c ShSound用 pcmlib
|
||||
* shpcmlib.c ShSound用 pcmlib
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -27,10 +27,10 @@
|
||||
#include "wavfile.h"
|
||||
|
||||
/*
|
||||
左右のチャンネルの入れ換え
|
||||
左右のチャンネルの入れ換え
|
||||
|
||||
ARG
|
||||
wfile: 対象 WAVFILE
|
||||
wfile: 対象 WAVFILE
|
||||
|
||||
RETURN
|
||||
none
|
||||
@@ -64,7 +64,7 @@ void pcmlib_reverse_pan_memory(WAVFILE *wfile) {
|
||||
}
|
||||
|
||||
/*
|
||||
メモリ上の PCM データにフェード効果をかける
|
||||
メモリ上の PCM データにフェード効果をかける
|
||||
*/
|
||||
void pcmlib_fade_volume_memory(WAVFILE *wfile, int start, int range) {
|
||||
int wavtime;
|
||||
@@ -92,13 +92,13 @@ void pcmlib_fade_volume_memory(WAVFILE *wfile, int start, int range) {
|
||||
WORD *p = (WORD *)wfile->data + (startsample * wfile->ch);
|
||||
WORD *pend;
|
||||
|
||||
// 指定の場所から徐々に音量を下げる
|
||||
// 指定の場所から徐々に音量を下げる
|
||||
rangesample *= wfile->ch;
|
||||
for (i = rangesample; i < 0; i--, p++) {
|
||||
*p = (*p * i) / rangesample;
|
||||
}
|
||||
|
||||
// 残りは無音
|
||||
// 残りは無音
|
||||
pend = (WORD *)(wfile->data + wfile->bytes);
|
||||
while(pend > p) {
|
||||
*p = 0; p++;
|
||||
@@ -106,7 +106,7 @@ void pcmlib_fade_volume_memory(WAVFILE *wfile, int start, int range) {
|
||||
}
|
||||
}
|
||||
|
||||
// メモリ上で加工できるようロードしてコピー
|
||||
// メモリ上で加工できるようロードしてコピー
|
||||
WAVFILE *pcmlib_load_rw(int no) {
|
||||
dridata *dfile;
|
||||
WAVFILE *wfile;
|
||||
|
||||
+12
-12
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* ShString.c 文字列操作 module
|
||||
* ShString.c 文字列操作 module
|
||||
*
|
||||
* かえるにょ国にょアリス(未使用)
|
||||
* 大悪司
|
||||
* かえるにょ国にょアリス(未使用)
|
||||
* 大悪司
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
void ExchangeString(void) {
|
||||
/*
|
||||
文字列(target)中の一部(pat)を別の文字列(patr)で置き換える
|
||||
文字列(target)中の一部(pat)を別の文字列(patr)で置き換える
|
||||
*/
|
||||
int target = getCaliValue();
|
||||
int pat = getCaliValue();
|
||||
@@ -113,11 +113,11 @@ void SetWindowTitle(void) { /* 6 */
|
||||
|
||||
void FillString() {
|
||||
/*
|
||||
指定の番号の文字列を他の文字列にコピー
|
||||
指定の番号の文字列を他の文字列にコピー
|
||||
|
||||
st: コピー先の文字列の最初の番号
|
||||
cnt: コピーする文字列の数
|
||||
src: コピー元の文字列番号
|
||||
st: コピー先の文字列の最初の番号
|
||||
cnt: コピーする文字列の数
|
||||
src: コピー元の文字列番号
|
||||
*/
|
||||
int st = getCaliValue();
|
||||
int cnt = getCaliValue();
|
||||
@@ -134,11 +134,11 @@ void FillString() {
|
||||
|
||||
void SetStringNum16(void) {
|
||||
/*
|
||||
文字列を数値に変換
|
||||
大文字、小文字、混在可
|
||||
文字列を数値に変換
|
||||
大文字、小文字、混在可
|
||||
|
||||
p1: 変換元文字列番号
|
||||
p2: 変換された数値を格納する変数
|
||||
p1: 変換元文字列番号
|
||||
p2: 変換された数値を格納する変数
|
||||
*/
|
||||
int st = getCaliValue();
|
||||
int *var = getCaliVariable();
|
||||
|
||||
@@ -39,7 +39,7 @@ void SetKeyCancelFlag() {
|
||||
|
||||
void SetLoopFlag() {
|
||||
/* Loop Flag */
|
||||
int loopflag = getCaliValue(); /* 0 なら無限繰り返し */
|
||||
int loopflag = getCaliValue(); /* 0 なら無限繰り返し */
|
||||
|
||||
DEBUG_COMMAND_YET("dDemo.SetLoopFlag %d:\n", loopflag);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void SetKeyCancelFlag() {
|
||||
|
||||
void SetLoopFlag() {
|
||||
/* Loop Flag */
|
||||
int loopflag = getCaliValue(); /* 0 なら無限繰り返し */
|
||||
int loopflag = getCaliValue(); /* 0 なら無限繰り返し */
|
||||
|
||||
DEBUG_COMMAND_YET("eDEMO.SetLoopFlag %d:\n", loopflag);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void SetKeyCancelFlag() {
|
||||
|
||||
void SetLoopFlag() {
|
||||
/* Loop Flag */
|
||||
int loopflag = getCaliValue(); /* 0 なら無限繰り返し */
|
||||
int loopflag = getCaliValue(); /* 0 なら無限繰り返し */
|
||||
|
||||
DEBUG_COMMAND_YET("eeDEMO.SetLoopFlag %d:\n", loopflag);
|
||||
}
|
||||
|
||||
+10
-10
@@ -29,20 +29,20 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
/*
|
||||
.ALK データ構造
|
||||
.ALK データ構造
|
||||
|
||||
char[4] sig = "ALK0"; シグネチャ
|
||||
int32 num = ファイル数
|
||||
int32 offset; 個々のファイルのファイルの先頭からのオフセット
|
||||
int32 size; 個々のファイルの大きさ(in bytes)
|
||||
char[4] sig = "ALK0"; シグネチャ
|
||||
int32 num = ファイル数
|
||||
int32 offset; 個々のファイルのファイルの先頭からのオフセット
|
||||
int32 size; 個々のファイルの大きさ(in bytes)
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
int fd; /* .alk ファイルの file discpriter */
|
||||
char *mapadr; /* mmap したファイルの先頭アドレス */
|
||||
off_t size; /* mmap したバイト数(ファイルサイズ) */
|
||||
int datanum; /* .alk ファイル中のファイル数 */
|
||||
int *offset; /* 各ファイルへのオフセット */
|
||||
int fd; /* .alk ファイルの file discpriter */
|
||||
char *mapadr; /* mmap したファイルの先頭アドレス */
|
||||
off_t size; /* mmap したバイト数(ファイルサイズ) */
|
||||
int datanum; /* .alk ファイル中のファイル数 */
|
||||
int *offset; /* 各ファイルへのオフセット */
|
||||
} alk_t;
|
||||
|
||||
extern alk_t *alk_new(char *path);
|
||||
|
||||
+11
-11
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* cg.c DLL用に CGを surface に展開
|
||||
* cg.c DLL用に CGを surface に展開
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -38,10 +38,10 @@
|
||||
#include "ald_manager.h"
|
||||
|
||||
/**
|
||||
* バッファのデータがどのCG形式かを最初の数バイトをみてチェック
|
||||
* バッファのデータがどのCG形式かを最初の数バイトをみてチェック
|
||||
*
|
||||
* @param data: データ列
|
||||
* @return CGの種類(QNT/PMS8/PMS16のいずれか)
|
||||
* @param data: データ列
|
||||
* @return CGの種類(QNT/PMS8/PMS16のいずれか)
|
||||
*/
|
||||
static CG_TYPE check_cgformat(BYTE *data) {
|
||||
if (qnt_checkfmt(data)) {
|
||||
@@ -55,11 +55,11 @@ static CG_TYPE check_cgformat(BYTE *data) {
|
||||
}
|
||||
|
||||
/**
|
||||
* ファイル等から読み込んだCGデータをsurfaceに展開
|
||||
* ファイル等から読み込んだCGデータをsurfaceに展開
|
||||
*
|
||||
* @param b: データ列
|
||||
* @return CG が展開された surface
|
||||
* 未知の形式のときは NULL が返る
|
||||
* @param b: データ列
|
||||
* @return CG が展開された surface
|
||||
* 未知の形式のときは NULL が返る
|
||||
*/
|
||||
surface_t *sf_getcg(void *b) {
|
||||
surface_t *sf = NULL;
|
||||
@@ -124,10 +124,10 @@ surface_t *sf_getcg(void *b) {
|
||||
}
|
||||
|
||||
/**
|
||||
* ALDファイルから指定の番号のCGを読み込んで surfaceに展開
|
||||
* ALDファイルから指定の番号のCGを読み込んで surfaceに展開
|
||||
*
|
||||
* @param no: ファイル番号 (0-)
|
||||
* @return CGが展開された surface
|
||||
* @param no: ファイル番号 (0-)
|
||||
* @return CGが展開された surface
|
||||
*/
|
||||
surface_t *sf_loadcg_no(int no) {
|
||||
dridata *dfile;
|
||||
|
||||
+25
-25
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* drawtext.c DLL用に surface 上に文字を描く
|
||||
* drawtext.c DLL用に surface 上に文字を描く
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -33,14 +33,14 @@
|
||||
#include "surface.h"
|
||||
#include "ngraph.h"
|
||||
|
||||
static int ftype; // フォントの種類
|
||||
static int fsize; // フォントの大きさ
|
||||
static int ftype; // フォントの種類
|
||||
static int fsize; // フォントの大きさ
|
||||
|
||||
/**
|
||||
* 次に描く文字のフォントの種類と大きさを設定
|
||||
* 次に描く文字のフォントの種類と大きさを設定
|
||||
*
|
||||
* @param type: フォント種類 (FONT_MINCHO, FONT_GOTHIC)
|
||||
* @param size: フォントサイズ
|
||||
* @param type: フォント種類 (FONT_MINCHO, FONT_GOTHIC)
|
||||
* @param size: フォントサイズ
|
||||
*/
|
||||
int dt_setfont(int type, int size) {
|
||||
ftype = type;
|
||||
@@ -49,14 +49,14 @@ int dt_setfont(int type, int size) {
|
||||
}
|
||||
|
||||
/**
|
||||
* surface にモノクロ文字を描画。アンチエイリアスされており256階調
|
||||
* 書き出すsurfaceは8ビットである必要あり
|
||||
* surface にモノクロ文字を描画。アンチエイリアスされており256階調
|
||||
* 書き出すsurfaceは8ビットである必要あり
|
||||
*
|
||||
* @param sf: 描画する surface
|
||||
* @param x: 描画位置X座標
|
||||
* @param y: 描画位置Y座標
|
||||
* @param buf: 描画文字列 (SJIS)
|
||||
* @return: 実際に描画した幅
|
||||
* @param sf: 描画する surface
|
||||
* @param x: 描画位置X座標
|
||||
* @param y: 描画位置Y座標
|
||||
* @param buf: 描画文字列 (SJIS)
|
||||
* @return: 実際に描画した幅
|
||||
*/
|
||||
int dt_drawtext(surface_t *sf, int x, int y, char *buf) {
|
||||
agsurface_t *glyph;
|
||||
@@ -79,17 +79,17 @@ int dt_drawtext(surface_t *sf, int x, int y, char *buf) {
|
||||
}
|
||||
|
||||
/**
|
||||
* surface にカラー文字を描画。alphamap に256階調のアンチエイリアスされた
|
||||
* 文字を描き、pixelmap には、色情報を矩形で描く
|
||||
* surface にカラー文字を描画。alphamap に256階調のアンチエイリアスされた
|
||||
* 文字を描き、pixelmap には、色情報を矩形で描く
|
||||
*
|
||||
* @param sf: 描画する surface
|
||||
* @param x: 描画位置X座標
|
||||
* @param y: 描画位置Y座標
|
||||
* @param buf: 描画文字列(SJIS)
|
||||
* @param r: 文字色赤
|
||||
* @param g: 文字色緑
|
||||
* @param b: 文字色青
|
||||
* @return: 実際に描画した幅
|
||||
* @param sf: 描画する surface
|
||||
* @param x: 描画位置X座標
|
||||
* @param y: 描画位置Y座標
|
||||
* @param buf: 描画文字列(SJIS)
|
||||
* @param r: 文字色赤
|
||||
* @param g: 文字色緑
|
||||
* @param b: 文字色青
|
||||
* @return: 実際に描画した幅
|
||||
*/
|
||||
int dt_drawtext_col(surface_t *sf, int x, int y, char *buf, int r, int g, int b) {
|
||||
agsurface_t *glyph;
|
||||
@@ -106,10 +106,10 @@ int dt_drawtext_col(surface_t *sf, int x, int y, char *buf, int r, int g, int b)
|
||||
sh = glyph->height;
|
||||
if (!gr_clip_xywh(sf, &sx, &sy, &sw, &sh)) return 0;
|
||||
|
||||
// alpha map に文字そのものを描く
|
||||
// alpha map に文字そのものを描く
|
||||
gr_draw_amap(sf, sx, sy, glyph->pixel, sw, sh, glyph->bytes_per_line);
|
||||
|
||||
// pixel map には色情報を矩形で描く
|
||||
// pixel map には色情報を矩形で描く
|
||||
gr_fill(sf, sx, sy, sw, sh, r, g, b);
|
||||
|
||||
return sw;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* drawtext.h DLL用に surface 上に文字を描く
|
||||
* drawtext.h DLL用に surface 上に文字を描く
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
|
||||
+30
-30
@@ -12,8 +12,8 @@
|
||||
#include "nact.h"
|
||||
|
||||
/*
|
||||
gr_xxxx はクリッピングあり
|
||||
gre_xxxx はクリッピングなし
|
||||
gr_xxxx はクリッピングあり
|
||||
gre_xxxx はクリッピングなし
|
||||
*/
|
||||
|
||||
#undef WARNING
|
||||
@@ -24,22 +24,22 @@
|
||||
|
||||
|
||||
/**
|
||||
* surface から surface にコピーなどをする際に、転送元と転送先のsurface
|
||||
* の大きさや、転送元・転送先座標、転送する領域の大きさなどから、実際に
|
||||
* コピーする領域をクリッピングする
|
||||
* surface から surface にコピーなどをする際に、転送元と転送先のsurface
|
||||
* の大きさや、転送元・転送先座標、転送する領域の大きさなどから、実際に
|
||||
* コピーする領域をクリッピングする
|
||||
*
|
||||
* @param ss: 転送元surface
|
||||
* @param sx: 転送元X座標
|
||||
* @param sy: 転送元Y座標
|
||||
* @param sw: 転送幅
|
||||
* @param sh: 転送高さ
|
||||
* @param ds: 転送先surface
|
||||
* @param dx: 転送先X座標
|
||||
* @param dy: 転送先Y座標
|
||||
* @return TRUE -> 描画領域がある
|
||||
* FALSE-> 転送領域の高さや幅が0以下になったり、転送元、転送先の座標が
|
||||
* surfaceの範囲外になり、描画領域がなくなった。
|
||||
* それぞれの引数は適宜変更されている
|
||||
* @param ss: 転送元surface
|
||||
* @param sx: 転送元X座標
|
||||
* @param sy: 転送元Y座標
|
||||
* @param sw: 転送幅
|
||||
* @param sh: 転送高さ
|
||||
* @param ds: 転送先surface
|
||||
* @param dx: 転送先X座標
|
||||
* @param dy: 転送先Y座標
|
||||
* @return TRUE -> 描画領域がある
|
||||
* FALSE-> 転送領域の高さや幅が0以下になったり、転送元、転送先の座標が
|
||||
* surfaceの範囲外になり、描画領域がなくなった。
|
||||
* それぞれの引数は適宜変更されている
|
||||
*/
|
||||
boolean gr_clip(surface_t *ss, int *sx, int *sy, int *sw, int *sh, surface_t *ds, int *dx, int *dy) {
|
||||
int w, h;
|
||||
@@ -113,17 +113,17 @@ boolean gr_clip(surface_t *ss, int *sx, int *sy, int *sw, int *sh, surface_t *ds
|
||||
}
|
||||
|
||||
/**
|
||||
* surface 内に描画を行う際に、surface の大きさで描画領域をクリッピングする
|
||||
* surface 内に描画を行う際に、surface の大きさで描画領域をクリッピングする
|
||||
*
|
||||
* @param ss: 描画surface
|
||||
* @param sx: 描画開始X座標
|
||||
* @param sy: 描画開始Y座標
|
||||
* @param sw: 描画幅
|
||||
* @param sh: 描画高さ
|
||||
* @return TRUE -> 描画領域がある
|
||||
* FALSE-> 描画領域の高さや幅が0以下になったり、描画開始座標が
|
||||
* surfaceの範囲外になり、描画領域がなくなった。
|
||||
* それぞれの引数は適宜変更されている
|
||||
* @param ss: 描画surface
|
||||
* @param sx: 描画開始X座標
|
||||
* @param sy: 描画開始Y座標
|
||||
* @param sw: 描画幅
|
||||
* @param sh: 描画高さ
|
||||
* @return TRUE -> 描画領域がある
|
||||
* FALSE-> 描画領域の高さや幅が0以下になったり、描画開始座標が
|
||||
* surfaceの範囲外になり、描画領域がなくなった。
|
||||
* それぞれの引数は適宜変更されている
|
||||
*/
|
||||
boolean gr_clip_xywh(surface_t *ss, int *sx, int *sy, int *sw, int *sh) {
|
||||
int w, h;
|
||||
@@ -257,10 +257,10 @@ void gr_copy_stretch_blend_alpha_map(surface_t *dst, int dx, int dy, int dw, int
|
||||
|
||||
a1 = (float)sw / (float)dw;
|
||||
a2 = (float)sh / (float)dh;
|
||||
// src width と dst width が同じときに問題があるので+1
|
||||
// src width と dst width が同じときに問題があるので+1
|
||||
row = g_new0(int, dw+1);
|
||||
// 1おおきくして初期化しないと col[dw-1]とcol[dw]が同じになる
|
||||
// 可能性がある。
|
||||
// 1おおきくして初期化しないと col[dw-1]とcol[dw]が同じになる
|
||||
// 可能性がある。
|
||||
col = g_new0(int, dh+1);
|
||||
|
||||
for (yd = 0.0, y = 0; y < dh; y++) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// 転送元 alpha map を参照して、転送元ピクセルと転送先ピクセルをブレンドし、
|
||||
// 転送先ピクセルに描画
|
||||
// 転送元 alpha map を参照して、転送元ピクセルと転送先ピクセルをブレンドし、
|
||||
// 転送先ピクセルに描画
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// srcのsurfaceの一部をdstに飽和加算
|
||||
// srcのsurfaceの一部をdstに飽和加算
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ int gr_buller(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, in
|
||||
return OK;
|
||||
}
|
||||
|
||||
// 縦方向ブラー
|
||||
// 縦方向ブラー
|
||||
int gr_buller_v(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int step) {
|
||||
BYTE *dp, *sp;
|
||||
int x, y;
|
||||
|
||||
+11
-11
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* graph_cg.c surface に 実際にcgデータを描く
|
||||
* graph_cg.c surface に 実際にcgデータを描く
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -33,12 +33,12 @@
|
||||
#include "ngraph.h"
|
||||
|
||||
/**
|
||||
* surface に 24bpp CG (QNT)を描画
|
||||
* surface に 24bpp CG (QNT)を描画
|
||||
*
|
||||
* @param ds: 描画 surface
|
||||
* @param cg: 描画するCGデータ
|
||||
* @param x: 描画X座標
|
||||
* @param y: 描画Y座標
|
||||
* @param ds: 描画 surface
|
||||
* @param cg: 描画するCGデータ
|
||||
* @param x: 描画X座標
|
||||
* @param y: 描画Y座標
|
||||
*/
|
||||
void gr_drawimage24(surface_t *ds, cgdata *cg, int x, int y) {
|
||||
int dx, dy, dw, dh;
|
||||
@@ -113,12 +113,12 @@ void gr_drawimage24(surface_t *ds, cgdata *cg, int x, int y) {
|
||||
}
|
||||
|
||||
/**
|
||||
* surface に 16bpp CG (PMS16/BMP)を描画
|
||||
* surface に 16bpp CG (PMS16/BMP)を描画
|
||||
*
|
||||
* @param ds: 描画 surface
|
||||
* @param cg: 描画するCGデータ
|
||||
* @param x: 描画X座標
|
||||
* @param y: 描画Y座標
|
||||
* @param ds: 描画 surface
|
||||
* @param cg: 描画するCGデータ
|
||||
* @param x: 描画X座標
|
||||
* @param y: 描画Y座標
|
||||
*/
|
||||
void gr_drawimage16(surface_t *ds, cgdata *cg, int x, int y) {
|
||||
int dx, dy, dw, dh;
|
||||
|
||||
+11
-11
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* graph_copy.c pixel データのコピー
|
||||
* graph_copy.c pixel データのコピー
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -29,17 +29,17 @@
|
||||
#include "ags.h"
|
||||
|
||||
/**
|
||||
* 指定の surface の領域を 別の surface の指定位置へコピーする
|
||||
* pixelデータのみコピー
|
||||
* 指定の surface の領域を 別の surface の指定位置へコピーする
|
||||
* pixelデータのみコピー
|
||||
*
|
||||
* @param dst: 転送先 surface
|
||||
* @param dx: 転送先X座標
|
||||
* @param dy: 転送先Y座標
|
||||
* @param src: 転送元surface
|
||||
* @param sx: 転送元X座標
|
||||
* @param sy: 転送元Y座標
|
||||
* @param sw: 転送幅
|
||||
* @param sh: 転送高さ
|
||||
* @param dst: 転送先 surface
|
||||
* @param dx: 転送先X座標
|
||||
* @param dy: 転送先Y座標
|
||||
* @param src: 転送元surface
|
||||
* @param sx: 転送元X座標
|
||||
* @param sy: 転送元Y座標
|
||||
* @param sw: 転送幅
|
||||
* @param sh: 転送高さ
|
||||
*/
|
||||
int gr_copy(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh) {
|
||||
BYTE *sp, *dp;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* graph_copy_amap.c alpha map のコピー
|
||||
* graph_copy_amap.c alpha map のコピー
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -30,16 +30,16 @@
|
||||
#include "ags.h"
|
||||
|
||||
/**
|
||||
* 指定の surface の alphamap を別の surface の指定領域にコピーする
|
||||
* 指定の surface の alphamap を別の surface の指定領域にコピーする
|
||||
*
|
||||
* @param dst: 転送先 surface
|
||||
* @param dx: 転送先X座標
|
||||
* @param dy: 転送先Y座標
|
||||
* @param src: 転送元surface
|
||||
* @param sx: 転送元X座標
|
||||
* @param sy: 転送元Y座標
|
||||
* @param sw: 転送幅
|
||||
* @param sh: 転送高さ
|
||||
* @param dst: 転送先 surface
|
||||
* @param dx: 転送先X座標
|
||||
* @param dy: 転送先Y座標
|
||||
* @param src: 転送元surface
|
||||
* @param sx: 転送元X座標
|
||||
* @param sy: 転送元Y座標
|
||||
* @param sw: 転送幅
|
||||
* @param sh: 転送高さ
|
||||
*/
|
||||
int gr_copy_alpha_map(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh) {
|
||||
BYTE *sp, *dp;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// 指定のsurface領域を明るさを lv/255 倍してコピー
|
||||
// 指定のsurface領域を明るさを lv/255 倍してコピー
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user