Re-enable NIGHTDLL module

To avoid symbol conflicts, this adds "nt_" prefix to sprite, sactcg, and
sactstring functions.
This commit is contained in:
kichikuou
2020-06-04 22:50:46 +09:00
parent 9a1f1c77a6
commit dbc15ca3b4
14 changed files with 338 additions and 266 deletions
+13 -14
View File
@@ -10,20 +10,19 @@ add_library(modules STATIC
Gpx/effectcopy.c
Math/Math.c
MsgSkip/MsgSkip.c
# Tentatively disabled because many symbols in NIGHTDLL conflict with SACT.
# NIGHTDLL/NIGHTDLL.c
# NIGHTDLL/nt_scenario.c
# NIGHTDLL/sactcg.c
# NIGHTDLL/sactstring.c
# NIGHTDLL/sprite.c
# NIGHTDLL/sprite_draw.c
# NIGHTDLL/sprite_update.c
# NIGHTDLL/sprite_eupdate.c
# NIGHTDLL/nt_event.c
# NIGHTDLL/nt_msg.c
# NIGHTDLL/nt_sel.c
# NIGHTDLL/nt_graph.c
# NIGHTDLL/nt_sound.c
NIGHTDLL/NIGHTDLL.c
NIGHTDLL/nt_scenario.c
NIGHTDLL/sactcg.c
NIGHTDLL/sactstring.c
NIGHTDLL/sprite.c
NIGHTDLL/sprite_draw.c
NIGHTDLL/sprite_update.c
NIGHTDLL/sprite_eupdate.c
NIGHTDLL/nt_event.c
NIGHTDLL/nt_msg.c
NIGHTDLL/nt_sel.c
NIGHTDLL/nt_graph.c
NIGHTDLL/nt_sound.c
NightDemonDemo/NightDemonDemo.c
RandMT/RandMT.c
SACT/SACT.c
+142 -69
View File
@@ -5,6 +5,7 @@
#include "portab.h"
#include "system.h"
#include "xsystem35.h"
#include "modules.h"
#include "nact.h"
#include "night.h"
#include "nt_sound.h"
@@ -19,7 +20,7 @@
night_t nightprv;
void Init(void) { /* 0 */
static void Init(void) { /* 0 */
int *var = getCaliVariable();
int p1 = getCaliValue(); /* ISys3xCG */
int p2 = getCaliValue(); /* ISys3xDIB */
@@ -37,7 +38,7 @@ void Init(void) { /* 0 */
DEBUG_COMMAND_YET("NIGHTDLL.Init %p:\n", var);
}
void InitGame() { /* 1 */
static void InitGame() { /* 1 */
nact->ags.font->antialiase_on = TRUE;
sys_setHankakuMode(2);
@@ -47,13 +48,13 @@ void InitGame() { /* 1 */
nt_gr_init();
ntmsg_init();
sstr_init();
nt_sstr_init();
DEBUG_COMMAND_YET("NIGHTDLL.InitGame:\n");
}
// メッセージの枠の表示
void SetMsgFrame() { /* 2 */
static void SetMsgFrame() { /* 2 */
int p1 = getCaliValue(); // 0=枠消去, 1=枠あり, 2=中央
ntmsg_set_frame(p1);
@@ -62,7 +63,7 @@ void SetMsgFrame() { /* 2 */
}
// メッセージの表示位置の設定
void SetMsgPlaceMethod(void) { /* 3 */
static void SetMsgPlaceMethod(void) { /* 3 */
int p1 = getCaliValue(); // 0=メッセージ枠内, 1=中央,
// 2=メッセージ枠+顔つき
ntmsg_set_place(p1);
@@ -71,21 +72,21 @@ void SetMsgPlaceMethod(void) { /* 3 */
}
// 未実装?
void SetMsgDrawEffect(void) { /* 4 */
static void SetMsgDrawEffect(void) { /* 4 */
int p1 = getCaliValue(); // 0, 1, 2, 3 (実際にはどれも機能しない?)
DEBUG_COMMAND_YET("NIGHTDLL.SetMsgDrawEffect %d:\n", p1);
}
// 未実装?
void SetMsgClearEffect(void) { /* 5 */
static void SetMsgClearEffect(void) { /* 5 */
int p1 = getCaliValue(); // 0, 1, 2, 4 (実際にはどれも機能しない?)
DEBUG_COMMAND_YET("NIGHTDLL.SetMsgClearEffect %d:\n", p1);
}
// 壁紙CGの設定
void SetWallPaper(void) { /* 6 */
static void SetWallPaper(void) { /* 6 */
int p1 = getCaliValue(); // 壁紙CG番号
nt_gr_set_wallpaper(p1);
@@ -94,7 +95,7 @@ void SetWallPaper(void) { /* 6 */
}
// 背景CGの設定
void SetScenery(void) { /* 7 */
static void SetScenery(void) { /* 7 */
int p1 = getCaliValue(); // 背景GC番号
nt_gr_set_scenery(p1);
@@ -103,7 +104,7 @@ void SetScenery(void) { /* 7 */
}
// 顔CGの設定
void SetFace(void) { /* 8 */
static void SetFace(void) { /* 8 */
int p1 = getCaliValue(); // 顔CG番号
nt_gr_set_face(p1);
@@ -112,7 +113,7 @@ void SetFace(void) { /* 8 */
}
// 立ち絵左の設定
void SetSpriteL(void) { /* 9 */
static void SetSpriteL(void) { /* 9 */
int p1 = getCaliValue(); // 左人物スプライト番号
nt_gr_set_spL(p1);
@@ -121,7 +122,7 @@ void SetSpriteL(void) { /* 9 */
}
// 立ち絵中央の設定
void SetSpriteM(void) { /* 10 */
static void SetSpriteM(void) { /* 10 */
int p1 = getCaliValue(); // 中央人物スプライト番号
nt_gr_set_spM(p1);
@@ -130,7 +131,7 @@ void SetSpriteM(void) { /* 10 */
}
// 立ち絵右の設定
void SetSpriteR(void) { /* 11 */
static void SetSpriteR(void) { /* 11 */
int p1 = getCaliValue(); // 右人物スプライト番号
nt_gr_set_spR(p1);
@@ -139,7 +140,7 @@ void SetSpriteR(void) { /* 11 */
}
// 立ち絵左の設定(季節違い?)
void SetSpriteSeasonL(void) { /* 12 */
static void SetSpriteSeasonL(void) { /* 12 */
int p1 = getCaliValue(); // 左人物スプライト番号
nt_gr_set_spsL(p1);
@@ -148,7 +149,7 @@ void SetSpriteSeasonL(void) { /* 12 */
}
// 立ち絵中央の設定(季節違い?)
void SetSpriteSeasonM(void) { /* 13 */
static void SetSpriteSeasonM(void) { /* 13 */
int p1 = getCaliValue(); // 中央人物スプライト番号
nt_gr_set_spM(p1);
@@ -157,7 +158,7 @@ void SetSpriteSeasonM(void) { /* 13 */
}
// 立ち絵右の設定(季節違い?)
void SetSpriteSeasonR(void) { /* 14 */
static void SetSpriteSeasonR(void) { /* 14 */
int p1 = getCaliValue(); // 右人物スプライト番号
nt_gr_set_spsR(p1);
@@ -166,14 +167,14 @@ void SetSpriteSeasonR(void) { /* 14 */
}
// 改行
void StartNewLine(void) { /* 15 */
static void StartNewLine(void) { /* 15 */
ntmsg_newline();
DEBUG_COMMAND_YET("NIGHTDLL.StartNewLine:\n");
}
// メッセージフォントサイズの設定
void SetFontSize(void) { /* 16 */
static void SetFontSize(void) { /* 16 */
int p1 = getCaliValue(); // メッセージフォントサイズ
night.fontsize = p1;
@@ -182,7 +183,7 @@ void SetFontSize(void) { /* 16 */
}
// フォントの種類の設定
void SetFont(void) { /* 17 */
static void SetFont(void) { /* 17 */
int p1 = getCaliValue(); // 0: ゴシック, 1: 明朝
night.fonttype = p1;
@@ -191,7 +192,7 @@ void SetFont(void) { /* 17 */
}
// 選択肢モード ON
void SetSelMode(void) { /* 18 */
static void SetSelMode(void) { /* 18 */
int p1 = getCaliValue(); // 0, 1(ほとんど0)
night.selmode = p1;
@@ -200,7 +201,7 @@ void SetSelMode(void) { /* 18 */
}
// キー入力待ち後、改ページ
void AnalyzeMessage(void) { /* 19 */
static void AnalyzeMessage(void) { /* 19 */
int *var = getCaliVariable(); // 入力されたキー
*var = ntmsg_ana();
@@ -209,7 +210,7 @@ void AnalyzeMessage(void) { /* 19 */
}
// ~DRAWの効果時間
void SetDrawTime(void) { /* 20 */
static void SetDrawTime(void) { /* 20 */
int p1 = getCaliValue(); // 効果時間 (未使用?)
nt_gr_set_drawtime(p1);
@@ -218,7 +219,7 @@ void SetDrawTime(void) { /* 20 */
}
// 効果つき画面更新
void Draw(void) { /* 21 */
static void Draw(void) { /* 21 */
int p1 = getCaliValue(); // 効果番号
nt_gr_draw(p1);
@@ -227,7 +228,7 @@ void Draw(void) { /* 21 */
}
// 音声データを再生
void SetVoice(void) { /* 22 */
static void SetVoice(void) { /* 22 */
int p1 = getCaliValue(); // ファイル番号
nt_voice_set(p1);
@@ -236,13 +237,13 @@ void SetVoice(void) { /* 22 */
}
// 未使用
void WaitKey(void) { /* 23 */
static void WaitKey(void) { /* 23 */
int p1 = getCaliValue(); //
DEBUG_COMMAND_YET("NIGHTDLL.WaitKey %d:\n", p1);
}
void AddFeeling(void) { /* 24 */
static void AddFeeling(void) { /* 24 */
int p1 = getCaliValue(); // person(1:新開,2:星川,3:百瀬,4:いずみ,5:鏡花,6:真言美,7:マコト
int p2 = getCaliValue(); // val
@@ -250,14 +251,14 @@ void AddFeeling(void) { /* 24 */
}
void SubFeeling(void) { /* 25 */
static void SubFeeling(void) { /* 25 */
int p1 = getCaliValue(); // person
int p2 = getCaliValue(); // val
DEBUG_COMMAND_YET("NIGHTDLL.SubFeeling %d:\n", p1);
}
void CallEvent(void) { /* 26 */
static void CallEvent(void) { /* 26 */
int p1 = getCaliValue(); // 1, 2 (Event Number)
nt_sco_callevent(p1);
@@ -265,7 +266,7 @@ void CallEvent(void) { /* 26 */
DEBUG_COMMAND_YET("NIGHTDLL.CallEvent %d:\n", p1);
}
void ScreenCG(void) { /* 27 */
static void ScreenCG(void) { /* 27 */
/*
CG を読み込んで、surface0 と BlendScreen で重ね合わせ
@@ -284,7 +285,7 @@ void ScreenCG(void) { /* 27 */
DEBUG_COMMAND_YET("NIGHTDLL.ScreenCG %d,%d,%d:\n", x, y, no);
}
void RunGameMain(void) { /* 28 */
static void RunGameMain(void) { /* 28 */
int *p1 = getCaliVariable(); // result
int p2 = getCaliValue(); // month
int p3 = getCaliValue(); // day
@@ -300,7 +301,7 @@ void RunGameMain(void) { /* 28 */
DEBUG_COMMAND_YET("NIGHTDLL.RunGameMain %p,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5);
}
void CheckNewGame(void) { /* 29 */
static void CheckNewGame(void) { /* 29 */
int *p1 = getCaliVariable();
*p1 = 0;
@@ -308,21 +309,21 @@ void CheckNewGame(void) { /* 29 */
DEBUG_COMMAND_YET("NIGHTDLL.CheckNewGame %p:\n", p1);
}
void SaveStartData(void) { /* 30 */
static void SaveStartData(void) { /* 30 */
DEBUG_COMMAND_YET("NIGHTDLL.SaveStartData:\n");
}
void PrintExitSystem(void) { /* 31 */
static void PrintExitSystem(void) { /* 31 */
DEBUG_COMMAND_YET("NIGHTDLL.PrintExitSystem:\n");
}
void SetCalendar(void) { /* 32 */
static void SetCalendar(void) { /* 32 */
int p1 = getCaliValue(); // 0, 1, 2
DEBUG_COMMAND_YET("NIGHTDLL.SetCalendar %d:\n", p1);
}
void SetDate(void) { /* 33 */
static void SetDate(void) { /* 33 */
int p1 = getCaliValue(); // month
int p2 = getCaliValue(); // day
int p3 = getCaliValue(); // day of week
@@ -334,7 +335,7 @@ void SetDate(void) { /* 33 */
DEBUG_COMMAND_YET("NIGHTDLL.SetDate %d,%d,%d:\n", p1, p2, p3);
}
void GetDate(void) { /* 34 */
static void GetDate(void) { /* 34 */
int *p1 = getCaliVariable(); // month
int *p2 = getCaliVariable(); // day
int *p3 = getCaliVariable(); // day of weeek
@@ -346,11 +347,11 @@ void GetDate(void) { /* 34 */
DEBUG_COMMAND_YET("NIGHTDLL.GetDate %p,%p,%p:\n", p1, p2, p3);
}
void SelectGameLevel(void) { /* 35 */
static void SelectGameLevel(void) { /* 35 */
DEBUG_COMMAND_YET("NIGHTDLL.SelectGameLevel:\n");
}
void RunEventDungeon(void) { /* 36 */
static void RunEventDungeon(void) { /* 36 */
int *p1 = getCaliVariable();
int p2 = getCaliValue();
@@ -359,14 +360,14 @@ void RunEventDungeon(void) { /* 36 */
DEBUG_COMMAND_YET("NIGHTDLL.RunEventDungeon %p,%d:\n", p1, p2);
}
void RunEventBattle(void) { /* 37 */
static void RunEventBattle(void) { /* 37 */
int p1 = getCaliValue(); // 実際には機能しない?
DEBUG_COMMAND_YET("NIGHTDLL.RunEventBattle %d:\n", p1);
}
// CD再生開始
void CDPlay(void) { /* 38 */
static void CDPlay(void) { /* 38 */
int p1 = getCaliValue(); // no
nt_cd_play(p1);
@@ -375,7 +376,7 @@ void CDPlay(void) { /* 38 */
}
// CD再生停止
void CDStop(void) { /* 39 */
static void CDStop(void) { /* 39 */
int p1 = getCaliValue(); // time(msec)
nt_cd_stop(p1);
@@ -384,7 +385,7 @@ void CDStop(void) { /* 39 */
}
// CDのmute
void CDMute(void) { /* 40 */
static void CDMute(void) { /* 40 */
int p1 = getCaliValue(); // 0: mute off, 1: mute on
nt_cd_mute(p1 == 0 ? FALSE : TRUE);
@@ -393,7 +394,7 @@ void CDMute(void) { /* 40 */
}
// ch に効果音番号をセット
void SoundEffectSetWave(void) { /* 41 */
static void SoundEffectSetWave(void) { /* 41 */
int p1 = getCaliValue(); // ch
int p2 = getCaliValue(); // linkno
@@ -403,7 +404,7 @@ void SoundEffectSetWave(void) { /* 41 */
}
// ch にくり返し数をセット
void SoundEffectSetLoop(void) { /* 42 */
static void SoundEffectSetLoop(void) { /* 42 */
int p1 = getCaliValue(); // ch
int p2 = getCaliValue(); // numloop
@@ -413,7 +414,7 @@ void SoundEffectSetLoop(void) { /* 42 */
}
// ch に音量をセット
void SoundEffectSetVolume(void) { /* 43 */
static void SoundEffectSetVolume(void) { /* 43 */
int p1 = getCaliValue(); // ch
int p2 = getCaliValue(); // vol
@@ -423,7 +424,7 @@ void SoundEffectSetVolume(void) { /* 43 */
}
// 効果音の再生を終るまで待つか待たないか?
void SoundEffectSetSyncFlag(void) { /* 44 */
static void SoundEffectSetSyncFlag(void) { /* 44 */
int p1 = getCaliValue(); // ch
int p2 = getCaliValue(); // 0: 終るまで待たない, 1: 待つ
@@ -433,7 +434,7 @@ void SoundEffectSetSyncFlag(void) { /* 44 */
}
// ch の効果音を再生
void SoundEffectPlay(void) { /* 45 */
static void SoundEffectPlay(void) { /* 45 */
int p1 = getCaliValue(); // ch
nt_snd_play(p1);
@@ -442,7 +443,7 @@ void SoundEffectPlay(void) { /* 45 */
}
// ch の効果音を停止
void SoundEffectStop(void) { /* 46 */
static void SoundEffectStop(void) { /* 46 */
int p1 = getCaliValue(); // ch
int p2 = getCaliValue(); // time (止まるまでの時間)
@@ -452,7 +453,7 @@ void SoundEffectStop(void) { /* 46 */
}
// 全てのチャンネルの再生を停止
void SoundEffectStopAll(void) { /* 47 */
static void SoundEffectStopAll(void) { /* 47 */
int p1 = getCaliValue(); // time (止まるまでの時間)
nt_snd_stopall(p1);
@@ -460,86 +461,86 @@ void SoundEffectStopAll(void) { /* 47 */
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectStopAll %d:\n", p1);
}
void RunSoundMode(void) { /* 48 */
static void RunSoundMode(void) { /* 48 */
DEBUG_COMMAND_YET("NIGHTDLL.RunSoundMode:\n");
}
void RunMapEditor(void) { /* 49 */
static void RunMapEditor(void) { /* 49 */
int *p1 = getCaliVariable();
DEBUG_COMMAND_YET("NIGHTDLL.RunMapEditor %p:\n", p1);
}
void VisualListClear(void) { /* 50 */
static void VisualListClear(void) { /* 50 */
DEBUG_COMMAND_YET("NIGHTDLL.VisualListClear:\n");
}
void VisualListAdd(void) { /* 51 */
static void VisualListAdd(void) { /* 51 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("NIGHTDLL.VisualListAdd %d:\n", p1);
}
void GetLocalCountCG(void) { /* 52 */
static void GetLocalCountCG(void) { /* 52 */
int *p1 = getCaliVariable();
int p2 = getCaliValue();
DEBUG_COMMAND_YET("NIGHTDLL.GetLocalCountCG %p,%d:\n", p1, p2);
}
void PlayMemory(void) { /* 53 */
static void PlayMemory(void) { /* 53 */
int *p1 = getCaliVariable(); // 回想ページ
int *p2 = getCaliVariable(); // 回想RESULT
DEBUG_COMMAND_YET("NIGHTDLL.PlayMemory %p,%p:\n", p1, p2);
}
void GetEventFlagTotal(void) { /* 54 */
static void GetEventFlagTotal(void) { /* 54 */
int *p1 = getCaliVariable();
int p2 = getCaliValue();
DEBUG_COMMAND_YET("NIGHTDLL.GetEventFlagTotal %p,%d:\n", p1, p2);
}
void SetPlayerName(void) { /* 55 */
static void SetPlayerName(void) { /* 55 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("NIGHTDLL.SetPlayerName %d:\n", p1);
}
void GetPlayerName(void) { /* 56 */
static void GetPlayerName(void) { /* 56 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("NIGHTDLL.GetPlayerName %d:\n", p1);
}
void SaveGame(void) { /* 57 */
static void SaveGame(void) { /* 57 */
int *p1 = getCaliVariable();
DEBUG_COMMAND_YET("NIGHTDLL.SaveGame %p:\n", p1);
}
void LoadGame(void) { /* 58 */
static void LoadGame(void) { /* 58 */
int *p1 = getCaliVariable();
DEBUG_COMMAND_YET("NIGHTDLL.LoadGame %p:\n", p1);
}
void ExistSaveData(void) { /* 59 */
static void ExistSaveData(void) { /* 59 */
int *p1 = getCaliVariable();
DEBUG_COMMAND_YET("NIGHTDLL.ExistSaveData %p:\n", p1);
}
void ExistStartData(void) { /* 60 */
static void ExistStartData(void) { /* 60 */
int *p1 = getCaliVariable();
DEBUG_COMMAND_YET("NIGHTDLL.ExistStartData %p:\n", p1);
}
void SetAreaData(void) { /* 61 */
static void SetAreaData(void) { /* 61 */
int p1 = getCaliValue();
int p2 = getCaliValue();
int p3 = getCaliValue();
@@ -547,27 +548,27 @@ void SetAreaData(void) { /* 61 */
DEBUG_COMMAND_YET("NIGHTDLL.SetAreaData %d,%d,%d:\n", p1, p2, p3);
}
void RunBattleTest(void) { /* 62 */
static void RunBattleTest(void) { /* 62 */
DEBUG_COMMAND_YET("NIGHTDLL.RunBattleTest:\n");
}
void RunTrainingTest(void) { /* 63 */
static void RunTrainingTest(void) { /* 63 */
DEBUG_COMMAND_YET("NIGHTDLL.RunTrainingTest:\n");
}
void TestEventCall(void) { /* 64 */
static void TestEventCall(void) { /* 64 */
DEBUG_COMMAND_YET("NIGHTDLL.TestEventCall:\n");
}
void Test(void) { /* 65 */
static void Test(void) { /* 65 */
DEBUG_COMMAND_YET("NIGHTDLL.Test:\n");
}
void DebugScenario(void) { /* 66 */
static void DebugScenario(void) { /* 66 */
DEBUG_COMMAND_YET("NIGHTDLL.DebugScenario:\n");
}
void GetDLLTime(void) { /* 67 */
static void GetDLLTime(void) { /* 67 */
int *p1 = getCaliVariable();
int *p2 = getCaliVariable();
int *p3 = getCaliVariable();
@@ -579,3 +580,75 @@ void GetDLLTime(void) { /* 67 */
DEBUG_COMMAND_YET("NIGHTDLL.GetDLLTime %p,%p,%p,%p,%p,%p,%p:\n", p1, p2, p3, p4, p5, p6, p7);
}
static const ModuleFunc functions[] = {
{"AddFeeling", AddFeeling},
{"AnalyzeMessage", AnalyzeMessage},
{"CDMute", CDMute},
{"CDPlay", CDPlay},
{"CDStop", CDStop},
{"CallEvent", CallEvent},
{"CheckNewGame", CheckNewGame},
{"DebugScenario", DebugScenario},
{"Draw", Draw},
{"ExistSaveData", ExistSaveData},
{"ExistStartData", ExistStartData},
{"GetDLLTime", GetDLLTime},
{"GetDate", GetDate},
{"GetEventFlagTotal", GetEventFlagTotal},
{"GetLocalCountCG", GetLocalCountCG},
{"GetPlayerName", GetPlayerName},
{"Init", Init},
{"InitGame", InitGame},
{"LoadGame", LoadGame},
{"PlayMemory", PlayMemory},
{"PrintExitSystem", PrintExitSystem},
{"RunBattleTest", RunBattleTest},
{"RunEventBattle", RunEventBattle},
{"RunEventDungeon", RunEventDungeon},
{"RunGameMain", RunGameMain},
{"RunMapEditor", RunMapEditor},
{"RunSoundMode", RunSoundMode},
{"RunTrainingTest", RunTrainingTest},
{"SaveGame", SaveGame},
{"SaveStartData", SaveStartData},
{"ScreenCG", ScreenCG},
{"SelectGameLevel", SelectGameLevel},
{"SetAreaData", SetAreaData},
{"SetCalendar", SetCalendar},
{"SetDate", SetDate},
{"SetDrawTime", SetDrawTime},
{"SetFace", SetFace},
{"SetFont", SetFont},
{"SetFontSize", SetFontSize},
{"SetMsgClearEffect", SetMsgClearEffect},
{"SetMsgDrawEffect", SetMsgDrawEffect},
{"SetMsgFrame", SetMsgFrame},
{"SetMsgPlaceMethod", SetMsgPlaceMethod},
{"SetPlayerName", SetPlayerName},
{"SetScenery", SetScenery},
{"SetSelMode", SetSelMode},
{"SetSpriteL", SetSpriteL},
{"SetSpriteM", SetSpriteM},
{"SetSpriteR", SetSpriteR},
{"SetSpriteSeasonL", SetSpriteSeasonL},
{"SetSpriteSeasonM", SetSpriteSeasonM},
{"SetSpriteSeasonR", SetSpriteSeasonR},
{"SetVoice", SetVoice},
{"SetWallPaper", SetWallPaper},
{"SoundEffectPlay", SoundEffectPlay},
{"SoundEffectSetLoop", SoundEffectSetLoop},
{"SoundEffectSetSyncFlag", SoundEffectSetSyncFlag},
{"SoundEffectSetVolume", SoundEffectSetVolume},
{"SoundEffectSetWave", SoundEffectSetWave},
{"SoundEffectStop", SoundEffectStop},
{"SoundEffectStopAll", SoundEffectStopAll},
{"StartNewLine", StartNewLine},
{"SubFeeling", SubFeeling},
{"Test", Test},
{"TestEventCall", TestEventCall},
{"VisualListAdd", VisualListAdd},
{"VisualListClear", VisualListClear},
{"WaitKey", WaitKey},
};
const Module module_NIGHTDLL = {"NIGHTDLL", functions, sizeof(functions) / sizeof(ModuleFunc)};
+34 -34
View File
@@ -39,8 +39,8 @@ void nt_gr_set_wallpaper(int no) {
sprite_t *sp = night.sp[SPNO_WALL];
if (sp) {
sp_remove_updatelist(sp);
sp_free(sp);
nt_sp_remove_updatelist(sp);
nt_sp_free(sp);
}
if (no == 1013 && nt_sco_is_natsu()) {
@@ -51,12 +51,12 @@ void nt_gr_set_wallpaper(int no) {
no = 1012;
}
sp = sp_new(SPNO_WALL, no, 0, 0, SPRITE_WP);
sp_add_updatelist(sp);
sp = nt_sp_new(SPNO_WALL, no, 0, 0, SPRITE_WP);
nt_sp_add_updatelist(sp);
if (no == 0) {
sp->cursize.width = sf0->width;
sp->cursize.height = sf0->height;
sp->update = sp_draw_wall;
sp->update = nt_sp_draw_wall;
}
night.sp[SPNO_WALL] = sp;
@@ -66,15 +66,15 @@ void nt_gr_set_scenery(int no) {
sprite_t *sp = night.sp[SPNO_SCENERY];
if (sp) {
sp_remove_updatelist(sp);
sp_free(sp);
nt_sp_remove_updatelist(sp);
nt_sp_free(sp);
sp = NULL;
}
if (no) {
sp = sp_new(SPNO_SCENERY, no, 0, 0, SPRITE_NORMAL);
sp_add_updatelist(sp);
sp_set_loc(sp, SCENERY_LOC_X, SCENERY_LOC_Y);
sp = nt_sp_new(SPNO_SCENERY, no, 0, 0, SPRITE_NORMAL);
nt_sp_add_updatelist(sp);
nt_sp_set_loc(sp, SCENERY_LOC_X, SCENERY_LOC_Y);
}
night.sp[SPNO_SCENERY] = sp;
@@ -84,14 +84,14 @@ void nt_gr_set_face(int no) {
sprite_t *sp = night.sp[SPNO_FACE];
if (sp) {
sp_remove_updatelist(sp);
sp_free(sp);
nt_sp_remove_updatelist(sp);
nt_sp_free(sp);
sp = NULL;
}
if (no) {
sp = sp_new(SPNO_FACE, no, 0, 0, SPRITE_NORMAL);
sp_add_updatelist(sp);
sp_set_loc(sp, FACE_LOC_X, FACE_LOC_Y);
sp = nt_sp_new(SPNO_FACE, no, 0, 0, SPRITE_NORMAL);
nt_sp_add_updatelist(sp);
nt_sp_set_loc(sp, FACE_LOC_X, FACE_LOC_Y);
night.msgplace = 2;
} else {
night.msgplace = 0;
@@ -103,14 +103,14 @@ void nt_gr_set_spL(int no) {
sprite_t *sp = night.sp[SPNO_TACHI_L];
if (sp) {
sp_remove_updatelist(sp);
sp_free(sp);
nt_sp_remove_updatelist(sp);
nt_sp_free(sp);
sp = NULL;
}
if (no) {
sp = sp_new(SPNO_TACHI_L, no, 0, 0, SPRITE_NORMAL);
sp_add_updatelist(sp);
sp_set_loc(sp, TACHI_L_LOC_X, TACHI_L_LOC_Y);
sp = nt_sp_new(SPNO_TACHI_L, no, 0, 0, SPRITE_NORMAL);
nt_sp_add_updatelist(sp);
nt_sp_set_loc(sp, TACHI_L_LOC_X, TACHI_L_LOC_Y);
}
night.sp[SPNO_TACHI_L] = sp;
}
@@ -119,14 +119,14 @@ void nt_gr_set_spM(int no) {
sprite_t *sp = night.sp[SPNO_TACHI_M];
if (sp) {
sp_remove_updatelist(sp);
sp_free(sp);
nt_sp_remove_updatelist(sp);
nt_sp_free(sp);
sp = NULL;
}
if (no) {
sp = sp_new(SPNO_TACHI_M, no, 0, 0, SPRITE_NORMAL);
sp_add_updatelist(sp);
sp_set_loc(sp, TACHI_M_LOC_X, TACHI_M_LOC_Y);
sp = nt_sp_new(SPNO_TACHI_M, no, 0, 0, SPRITE_NORMAL);
nt_sp_add_updatelist(sp);
nt_sp_set_loc(sp, TACHI_M_LOC_X, TACHI_M_LOC_Y);
}
night.sp[SPNO_TACHI_M] = sp;
}
@@ -135,14 +135,14 @@ void nt_gr_set_spR(int no) {
sprite_t *sp = night.sp[SPNO_TACHI_R];
if (sp) {
sp_remove_updatelist(sp);
sp_free(sp);
nt_sp_remove_updatelist(sp);
nt_sp_free(sp);
sp = NULL;
}
if (no) {
sp = sp_new(SPNO_TACHI_R, no, 0, 0, SPRITE_NORMAL);
sp_add_updatelist(sp);
sp_set_loc(sp, TACHI_R_LOC_X, TACHI_R_LOC_Y);
sp = nt_sp_new(SPNO_TACHI_R, no, 0, 0, SPRITE_NORMAL);
nt_sp_add_updatelist(sp);
nt_sp_set_loc(sp, TACHI_R_LOC_X, TACHI_R_LOC_Y);
}
night.sp[SPNO_TACHI_R] = sp;
}
@@ -178,15 +178,15 @@ void nt_gr_draw(int effectno) {
// 全消し
break;
case 1:
sp_update_all(TRUE);
nt_sp_update_all(TRUE);
break;
default:
if (night.waitskiplv > 1) {
sp_update_all(TRUE);
nt_sp_update_all(TRUE);
break;
}
//sp_eupdate(effectno, effecttime, TRUE);
sp_eupdate(effectno, 1000, TRUE);
//nt_sp_eupdate(effectno, effecttime, TRUE);
nt_sp_eupdate(effectno, 1000, TRUE);
}
}
+35 -35
View File
@@ -67,34 +67,34 @@ 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);
sp = night.sp[SPNO_MSGFRAME_FG] = nt_sp_msg_new(SPNO_MSGFRAME_FG, 0, 0, sf0->width, sf0->height);
nt_sp_add_updatelist(sp);
// メッセージ背景用CG
sp = night.sp[SPNO_MSGFRAME_BG] = sp_new(SPNO_MSGFRAME_BG, CGNO_MSGFRAME_LCG, 0, 0, SPRITE_NORMAL);
sp_add_updatelist(sp);
sp = night.sp[SPNO_MSGFRAME_BG] = nt_sp_new(SPNO_MSGFRAME_BG, CGNO_MSGFRAME_LCG, 0, 0, SPRITE_NORMAL);
nt_sp_add_updatelist(sp);
// 文字背景CG作成
scg_create(CGNO_MSGFR_BG,
nt_scg_create(CGNO_MSGFR_BG,
sf0->width, sf0->height,
0, 0, 0, 255);
// night.cg[CGNO_MSGFR_BG]->refcnt++;
// 文字背景CGのためのsprite
sp = night.sp[SPNO_MSGBG] = sp_new(SPNO_MSGBG, CGNO_MSGFR_BG, 0, 0, SPRITE_NORMAL);
sp_add_updatelist(sp);
sp = night.sp[SPNO_MSGBG] = nt_sp_new(SPNO_MSGBG, CGNO_MSGFR_BG, 0, 0, SPRITE_NORMAL);
nt_sp_add_updatelist(sp);
// キー入力アニメーションCG作成
scg_cut(CGNO_MSGHAK_1, CGNO_MSGHAK_LCG, 0, 0, 9, 9);
nt_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);
nt_scg_cut(CGNO_MSGHAK_2, CGNO_MSGHAK_LCG, 0, 9, 9, 9);
//night.cg[CGNO_MSGHAK_2]->refcnt++;
sp = night.sp[SPNO_MSG_KEYANIM] = sp_new(SPNO_MSG_KEYANIM, CGNO_MSGHAK_1, CGNO_MSGHAK_2, 0, SPRITE_ANIME);
sp = night.sp[SPNO_MSG_KEYANIM] = nt_sp_new(SPNO_MSG_KEYANIM, CGNO_MSGHAK_1, CGNO_MSGHAK_2, 0, SPRITE_ANIME);
sp->u.anime.interval = HAKANIM_INTERVAL;
sp_add_updatelist(sp);
sp_set_loc(sp, HAKANIM_LOC_X, HAKANIM_LOC_Y);
sp_set_show(sp, FALSE);
sp->update = sp_draw_scg;
nt_sp_add_updatelist(sp);
nt_sp_set_loc(sp, HAKANIM_LOC_X, HAKANIM_LOC_Y);
nt_sp_set_show(sp, FALSE);
sp->update = nt_sp_draw_scg;
@@ -102,7 +102,7 @@ void ntmsg_init() {
// 主人公名前
sstr_regist_replace(SNAME_RYO, SNAME_RYO_DEF);
nt_sstr_regist_replace(SNAME_RYO, SNAME_RYO_DEF);
night.msg.cbmove = cb_mousemove;
night.msg.cbrelease = cb_keyrelease;
@@ -129,14 +129,14 @@ void ntmsg_set_frame(int type) {
switch(type) {
case 0:
sp_set_show(night.sp[SPNO_MSGBG], FALSE);
sp_set_show(night.sp[SPNO_MSGFRAME_BG], FALSE);
sp_set_show(night.sp[SPNO_MSGFRAME_FG], FALSE);
nt_sp_set_show(night.sp[SPNO_MSGBG], FALSE);
nt_sp_set_show(night.sp[SPNO_MSGFRAME_BG], FALSE);
nt_sp_set_show(night.sp[SPNO_MSGFRAME_FG], FALSE);
break;
case 1:
sp_set_show(night.sp[SPNO_MSGBG], TRUE);
sp_set_show(night.sp[SPNO_MSGFRAME_BG], TRUE);
sp_set_show(night.sp[SPNO_MSGFRAME_FG], TRUE);
nt_sp_set_show(night.sp[SPNO_MSGBG], TRUE);
nt_sp_set_show(night.sp[SPNO_MSGFRAME_BG], TRUE);
nt_sp_set_show(night.sp[SPNO_MSGFRAME_FG], TRUE);
gr_fill(sf, MSGFRAME_0_X, MSGFRAME_0_Y,
MSGFRAME_0_WIDTH, MSGFRAME_0_HEIGHT,
@@ -144,12 +144,12 @@ void ntmsg_set_frame(int type) {
gr_fill_alpha_map(sf, MSGFRAME_0_X, MSGFRAME_0_Y,
MSGFRAME_0_WIDTH, MSGFRAME_0_HEIGHT, 192);
ntmsg_clear(SPNO_MSGFRAME_FG);
sp_update_all(TRUE);
nt_sp_update_all(TRUE);
break;
case 2:
sp_set_show(night.sp[SPNO_MSGBG], TRUE);
sp_set_show(night.sp[SPNO_MSGFRAME_BG], FALSE);
sp_set_show(night.sp[SPNO_MSGFRAME_FG], TRUE);
nt_sp_set_show(night.sp[SPNO_MSGBG], TRUE);
nt_sp_set_show(night.sp[SPNO_MSGFRAME_BG], FALSE);
nt_sp_set_show(night.sp[SPNO_MSGFRAME_FG], TRUE);
gr_fill(sf, MSGFRAME_1_X, MSGFRAME_1_Y,
MSGFRAME_1_WIDTH, MSGFRAME_1_HEIGHT,
@@ -157,7 +157,7 @@ void ntmsg_set_frame(int type) {
gr_fill_alpha_map(sf, MSGFRAME_1_X, MSGFRAME_1_Y,
MSGFRAME_1_WIDTH, MSGFRAME_1_HEIGHT, 128);
ntmsg_clear(SPNO_MSGFRAME_FG);
sp_update_all(TRUE);
nt_sp_update_all(TRUE);
break;
}
@@ -210,12 +210,12 @@ int ntmsg_ana(void) {
} else {
// msg newpage
ntmsg_out(SPNO_MSGFRAME_FG, night.fontsize, 255, 255, 255, night.fonttype, 0, 2);
sp_update_clipped();
nt_sp_update_clipped();
ret = ntmsg_keywait();
// clear msgsprite
ntmsg_clear(SPNO_MSGFRAME_FG);
//sp_update_clipped();
//nt_sp_update_clipped();
}
night.selmode = -1;
@@ -234,7 +234,7 @@ static void ntmsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB
// shortcut
sp = night.sp[wNum];
msg = sstr_replacestr(night.msgbuf);
msg = nt_sstr_replacestr(night.msgbuf);
// 文字アラインメントの調整
set_align(msg, sp, wSize);
@@ -273,12 +273,12 @@ static void ntmsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB
needupdate = TRUE;
if (wSpeed > 0) {
sp_updateme_part(sp,
nt_sp_updateme_part(sp,
sp->u.msg.dspcur.x,
sp->u.msg.dspcur.y,
cw,
wSize);
sp_update_clipped();
nt_sp_update_clipped();
needupdate = FALSE;
// keywait
@@ -301,7 +301,7 @@ static void ntmsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB
if (needupdate) {
uparea.width = sp->cursize.width;
uparea.height = min(sp->cursize.height, uparea.y - sp->u.msg.dspcur.y + wLineSpace + wLineSpace);
sp_updateme_part(sp, uparea.x, uparea.y, uparea.width, uparea.height);
nt_sp_updateme_part(sp, uparea.x, uparea.y, uparea.width, uparea.height);
}
}
@@ -455,8 +455,8 @@ static void hakanim(int i) {
sp->curcg = sp->cg2;
}
sp->show = TRUE;
sp_updateme(sp);
sp_update_clipped();
nt_sp_updateme(sp);
nt_sp_update_clipped();
sp->show = show;
}
@@ -509,5 +509,5 @@ static void ntmsg_clear(int wNum) {
memset(sf->pixel, 0, sf->bytes_per_line * sf->height);
memset(sf->alpha, 0, sf->width * sf->height);
sp_updateme(sp);
nt_sp_updateme(sp);
}
+35 -35
View File
@@ -61,7 +61,7 @@ static cginfo_t *cgs[CGMAX];
spriteから参照されるときは増やし、CG_xxxを作る時に
参照されるときは増やさない。
*/
cginfo_t *scg_loadcg_no(int no, boolean refinc) {
cginfo_t *nt_scg_loadcg_no(int no, boolean refinc) {
cginfo_t *i;
if (no >= (CGMAX -1)) {
@@ -95,7 +95,7 @@ cginfo_t *scg_loadcg_no(int no, boolean refinc) {
}
// 指定の大きさ、色の矩形の CG を作成
int scg_create(int wNumCG, int wWidth, int wHeight, int wR, int wG, int wB, int wBlendRate) {
int nt_scg_create(int wNumCG, int wWidth, int wHeight, int wR, int wG, int wB, int wBlendRate) {
cginfo_t *i;
spcg_assert_no(wNumCG);
@@ -109,7 +109,7 @@ int scg_create(int wNumCG, int wWidth, int wHeight, int wR, int wG, int wB, int
gr_fill_alpha_map(i->sf, 0, 0, wWidth, wHeight, wBlendRate);
// もし前に作成したものがあり、未開放の場合は開放
scg_free(wNumCG);
nt_scg_free(wNumCG);
cgs[wNumCG] = i;
@@ -117,7 +117,7 @@ int scg_create(int wNumCG, int wWidth, int wHeight, int wR, int wG, int wB, int
}
// 指定のCGを反転させたCGを作成
int scg_create_reverse(int wNumCG, int wNumSrcCG, int wReverseX, int wReverseY) {
int nt_scg_create_reverse(int wNumCG, int wNumSrcCG, int wReverseX, int wReverseY) {
cginfo_t *i, *srccg;
surface_t *src;
@@ -125,7 +125,7 @@ int scg_create_reverse(int wNumCG, int wNumSrcCG, int wReverseX, int wReverseY)
spcg_assert_no(wNumSrcCG);
// 元にするCGを参照 (LINKCGなら読み込み)
if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) {
if (NULL == (srccg = nt_scg_loadcg_no(wNumSrcCG, FALSE))) {
return NG;
}
@@ -137,7 +137,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);
nt_scg_free(wNumCG);
cgs[wNumCG] = i;
@@ -145,7 +145,7 @@ int scg_create_reverse(int wNumCG, int wNumSrcCG, int wReverseX, int wReverseY)
}
// 指定のCGを拡大/縮小したCGを作成
int scg_create_stretch(int wNumCG, int wWidth, int wHeight, int wNumSrcCG) {
int nt_scg_create_stretch(int wNumCG, int wWidth, int wHeight, int wNumSrcCG) {
cginfo_t *i, *srccg;
surface_t *src;
@@ -153,7 +153,7 @@ int scg_create_stretch(int wNumCG, int wWidth, int wHeight, int wNumSrcCG) {
spcg_assert_no(wNumSrcCG);
// 元にするCGを参照 (LINKCGなら読み込み)
if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) {
if (NULL == (srccg = nt_scg_loadcg_no(wNumSrcCG, FALSE))) {
return NG;
}
@@ -166,7 +166,7 @@ int scg_create_stretch(int wNumCG, int wWidth, int wHeight, int wNumSrcCG) {
i->sf = stretch(src, wWidth, wHeight, 0);
// もし前に作成したものがあり、未開放の場合は開放
scg_free(wNumCG);
nt_scg_free(wNumCG);
cgs[wNumCG] = i;
@@ -174,7 +174,7 @@ int scg_create_stretch(int wNumCG, int wWidth, int wHeight, int wNumSrcCG) {
}
// ベースCGの上にブレンドCGを重ねた CG を作成
int scg_create_blend(int wNumDstCG, int wNumBaseCG, int wX, int wY, int wNumBlendCG, int wAlphaMapMode) {
int nt_scg_create_blend(int wNumDstCG, int wNumBaseCG, int wX, int wY, int wNumBlendCG, int wAlphaMapMode) {
cginfo_t *i, *basecg, *blendcg;
spcg_assert_no(wNumDstCG);
@@ -182,8 +182,8 @@ int scg_create_blend(int wNumDstCG, int wNumBaseCG, int wX, int wY, int wNumBlen
spcg_assert_no(wNumBlendCG);
// 元にするCGを参照 (LINKCGなら読み込み)
basecg = scg_loadcg_no(wNumBaseCG, FALSE);
blendcg = scg_loadcg_no(wNumBlendCG, FALSE);
basecg = nt_scg_loadcg_no(wNumBaseCG, FALSE);
blendcg = nt_scg_loadcg_no(wNumBlendCG, FALSE);
if (basecg == NULL || blendcg == NULL) return NG;
i = malloc(sizeof(cginfo_t));
@@ -194,7 +194,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);
nt_scg_free(wNumDstCG);
cgs[wNumDstCG] = i;
@@ -202,7 +202,7 @@ int scg_create_blend(int wNumDstCG, int wNumBaseCG, int wX, int wY, int wNumBlen
}
// 指定の文字列のCGを作成
int scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, char *cText) {
int nt_scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, char *cText) {
cginfo_t *i;
agsurface_t *glyph;
FONT *font;
@@ -232,7 +232,7 @@ int scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, char *cText)
gr_draw_amap(i->sf, 0, 0, glyph->pixel, glyph->width, wSize, glyph->bytes_per_line);
// もし前に作成したものがあり、未開放の場合は開放
scg_free(wNumCG);
nt_scg_free(wNumCG);
cgs[wNumCG] = i;
@@ -240,7 +240,7 @@ int scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, char *cText)
}
// 数字文字列のCGを作成
int scg_create_textnum(int wNumCG, int wSize, int wR, int wG, int wB, int wFigs, int wZeroPadding, int wValue) {
int nt_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;
FONT *font;
@@ -270,7 +270,7 @@ int scg_create_textnum(int wNumCG, int wSize, int wR, int wG, int wB, int wFigs,
gr_draw_amap(i->sf, 0, 0, glyph->pixel, glyph->width, wSize, glyph->bytes_per_line);
// もし前に作成したものがあり、未開放の場合は開放
scg_free(wNumCG);
nt_scg_free(wNumCG);
cgs[wNumCG] = i;
@@ -278,14 +278,14 @@ int scg_create_textnum(int wNumCG, int wSize, int wR, int wG, int wB, int wFigs,
}
// CGを複製
int scg_copy(int wNumDstCG, int wNumSrcCG) {
int nt_scg_copy(int wNumDstCG, int wNumSrcCG) {
cginfo_t *i, *srccg;
spcg_assert_no(wNumDstCG);
spcg_assert_no(wNumSrcCG);
// 元にするCGを参照 (LINKCGなら読み込み)
if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) {
if (NULL == (srccg = nt_scg_loadcg_no(wNumSrcCG, FALSE))) {
return NG;
}
@@ -296,7 +296,7 @@ int scg_copy(int wNumDstCG, int wNumSrcCG) {
i->sf = sf_dup(srccg->sf);
// もし前に作成したものがあり、未開放の場合は開放
scg_free(wNumDstCG);
nt_scg_free(wNumDstCG);
cgs[wNumDstCG] = i;
@@ -304,7 +304,7 @@ int scg_copy(int wNumDstCG, int wNumSrcCG) {
}
// CGの一部を切りぬいたCGを作成
int scg_cut(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeight) {
int nt_scg_cut(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeight) {
cginfo_t *i, *srccg;
surface_t *dst, *src;
@@ -312,7 +312,7 @@ int scg_cut(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeigh
spcg_assert_no(wNumSrcCG);
// 元にするCGを参照 (LINKCGなら読み込み)
if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) {
if (NULL == (srccg = nt_scg_loadcg_no(wNumSrcCG, FALSE))) {
return NG;
}
@@ -337,7 +337,7 @@ int scg_cut(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeigh
i->sf = dst;
// もし前に作成したものがあり、未開放の場合は開放
scg_free(wNumDstCG);
nt_scg_free(wNumDstCG);
cgs[wNumDstCG] = i;
@@ -345,7 +345,7 @@ int scg_cut(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeigh
}
// 元のCGの一部を切りぬいたCGを作成
int scg_partcopy(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeight) {
int nt_scg_partcopy(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeight) {
cginfo_t *i, *srccg;
surface_t *dst, *src;
@@ -353,7 +353,7 @@ int scg_partcopy(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int w
spcg_assert_no(wNumSrcCG);
// 元にするCGを参照 (LINKCGなら読み込み)
if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) {
if (NULL == (srccg = nt_scg_loadcg_no(wNumSrcCG, FALSE))) {
return NG;
}
@@ -380,7 +380,7 @@ int scg_partcopy(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int w
i->sf = dst;
// もし前に作成したものがあり、未開放の場合は開放
scg_free(wNumDstCG);
nt_scg_free(wNumDstCG);
cgs[wNumDstCG] = i;
@@ -388,11 +388,11 @@ int scg_partcopy(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int w
}
// 全てのCGの開放
int scg_freeall() {
int nt_scg_freeall() {
int i;
for (i = 1; i < CGMAX; i++) {
scg_free(i);
nt_scg_free(i);
}
return OK;
}
@@ -401,7 +401,7 @@ int scg_freeall() {
* 指定の番号の CG をオブジェクトリストから消し、オブジェクトがどこからも参照
* されていない(参照数が0の)場合のみ、オブジェクトを削除
*/
int scg_free(int no) {
int nt_scg_free(int no) {
cginfo_t *cg;
spcg_assert_no(no);
@@ -410,7 +410,7 @@ int scg_free(int no) {
// 参照数が0の時のみオブジェクトを開放
if (cg->refcnt == 0) {
scg_free_cgobj(cg);
nt_scg_free_cgobj(cg);
}
// 番号で消したときはオブジェクトが開放されなくても
@@ -423,7 +423,7 @@ int scg_free(int no) {
/**
* CG オブジェクトの開放
*/
int scg_free_cgobj(cginfo_t *cg) {
int nt_scg_free_cgobj(cginfo_t *cg) {
if (cg == NULL) return NG;
(cg->refcnt)--;
@@ -448,7 +448,7 @@ int scg_free_cgobj(cginfo_t *cg) {
}
// CGの種類を取得
int scg_querytype(int wNumCG, int *ret) {
int nt_scg_querytype(int wNumCG, int *ret) {
if (wNumCG >= (CGMAX -1)) goto errexit;
if (cgs[wNumCG] == NULL) goto errexit;
@@ -462,7 +462,7 @@ int scg_querytype(int wNumCG, int *ret) {
}
// CGの大きさを取得
int scg_querysize(int wNumCG, int *w, int *h) {
int nt_scg_querysize(int wNumCG, int *w, int *h) {
if (wNumCG >= (CGMAX -1)) goto errexit;
if (cgs[wNumCG] == NULL) goto errexit;
if (cgs[wNumCG]->sf == NULL) goto errexit;
@@ -478,7 +478,7 @@ int scg_querysize(int wNumCG, int *w, int *h) {
}
// CGのBPPを取得
int scg_querybpp(int wNumCG, int *ret) {
int nt_scg_querybpp(int wNumCG, int *ret) {
if (wNumCG >= (CGMAX -1)) goto errexit;
if (cgs[wNumCG] == NULL) goto errexit;
if (cgs[wNumCG]->sf == NULL) goto errexit;
@@ -493,7 +493,7 @@ int scg_querybpp(int wNumCG, int *ret) {
}
// CGの alphamap が存在するかを取得
int scg_existalphamap(int wNumCG, int *ret) {
int nt_scg_existalphamap(int wNumCG, int *ret) {
if (wNumCG >= (CGMAX -1)) goto errexit;
if (cgs[wNumCG] == NULL) goto errexit;
if (cgs[wNumCG]->sf == NULL) goto errexit;
+18 -18
View File
@@ -27,23 +27,23 @@
#include "portab.h"
#include "night.h"
extern cginfo_t *scg_loadcg_no(int no, boolean refinc);
extern int scg_create(int wNumCG, int wWidth, int wHeight, int wR, int wG, int wB, int wBlendRate);
extern int scg_create_reverse(int NumCG, int wNumSrcCG, int wReverseX, int wReverseY);
extern int scg_create_stretch(int wNumCG, int wWidth, int wHeight, int wNumSrcCG);
extern int scg_create_blend(int wNumDstCG, int wNumBaseCG, int wX, int wY, int wNumBlendCG, int wAlphaMapMode);
extern int scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, char *cText);
extern int scg_create_textnum(int wNumCG, int wSize, int wR, int wG, int wB, int wFigs, int wZeroPadding, int wValue);
extern int scg_copy(int wNumDstCG, int wNumSrcCG);
extern int scg_cut(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeight);
extern int scg_partcopy(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeight);
extern int scg_freeall();
extern int scg_free(int cg);
extern int scg_free_cgobj(cginfo_t *cg);
extern int scg_querytype(int wNumCG, int *ret);
extern int scg_querysize(int wNumCG, int *w, int *h);
extern int scg_querybpp(int wNumCG, int *ret);
extern int scg_existalphamap(int wNumCG, int *ret);
extern int scg_linkcgfree(int no);
extern cginfo_t *nt_scg_loadcg_no(int no, boolean refinc);
extern int nt_scg_create(int wNumCG, int wWidth, int wHeight, int wR, int wG, int wB, int wBlendRate);
extern int nt_scg_create_reverse(int NumCG, int wNumSrcCG, int wReverseX, int wReverseY);
extern int nt_scg_create_stretch(int wNumCG, int wWidth, int wHeight, int wNumSrcCG);
extern int nt_scg_create_blend(int wNumDstCG, int wNumBaseCG, int wX, int wY, int wNumBlendCG, int wAlphaMapMode);
extern int nt_scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, char *cText);
extern int nt_scg_create_textnum(int wNumCG, int wSize, int wR, int wG, int wB, int wFigs, int wZeroPadding, int wValue);
extern int nt_scg_copy(int wNumDstCG, int wNumSrcCG);
extern int nt_scg_cut(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeight);
extern int nt_scg_partcopy(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeight);
extern int nt_scg_freeall();
extern int nt_scg_free(int cg);
extern int nt_scg_free_cgobj(cginfo_t *cg);
extern int nt_scg_querytype(int wNumCG, int *ret);
extern int nt_scg_querysize(int wNumCG, int *w, int *h);
extern int nt_scg_querybpp(int wNumCG, int *ret);
extern int nt_scg_existalphamap(int wNumCG, int *ret);
extern int nt_scg_linkcgfree(int no);
#endif
+6 -6
View File
@@ -51,7 +51,7 @@ static char *replacedst;
/**
* 文字列変数スタックの初期化
*/
int sstr_init() {
int nt_sstr_init() {
stack = malloc(sizeof(char *) * DEFSTACKSIZE);
idx = 0;
idxmax = DEFSTACKSIZE;
@@ -62,7 +62,7 @@ int sstr_init() {
* 文字列変数スタックに文字列を積む
* @param strno: シナリオ上での文字列変数番号
*/
int sstr_push(char *str) {
int nt_sstr_push(char *str) {
if (idx >= idxmax) {
stack = realloc(stack, sizeof(char *) * idx*2);
idxmax = idx*2;
@@ -77,7 +77,7 @@ int sstr_push(char *str) {
* 文字列変数スタックから文字列を取り出す
* @param strno: スタックから戻した文字列を格納する文字列変数番号
*/
int sstr_pop(char *str, int maxlen) {
int nt_sstr_pop(char *str, int maxlen) {
if (idx == 0) return NG;
strncpy(str, stack[--idx], maxlen);
@@ -91,7 +91,7 @@ int sstr_pop(char *str, int maxlen) {
* @param sstrno: 変換元文字列変数番号
* @param dstrno: 変換先文字列変数番号
*/
int sstr_regist_replace(char *sstr, char *dstr) {
int nt_sstr_regist_replace(char *sstr, char *dstr) {
strexchange_t *ex;
if (sstr == dstr) return NG;
@@ -106,7 +106,7 @@ int sstr_regist_replace(char *sstr, char *dstr) {
/**
* 数値 -> 文字列化
*/
int sstr_num2str(int strno, int fig, int nzeropad, int num) {
int nt_sstr_num2str(int strno, int fig, int nzeropad, int num) {
char s[256], ss[256];
if (nzeropad) {
@@ -148,7 +148,7 @@ static void replacestr_cb(void* data, void* userdata) {
}
// 文字列の置き換え
char *sstr_replacestr(char *msg) {
char *nt_sstr_replacestr(char *msg) {
if (strreplace == NULL) return msg;
repbuf[0][0] = '\0';
+6 -6
View File
@@ -24,12 +24,12 @@
#ifndef __SACTSTRING_H__
#define __SACTSTRING_H__
extern int sstr_init();
extern int sstr_push(char *str);
extern int sstr_pop(char *str, int maxlen);
extern int sstr_regist_replace(char *sstr, char *dstr);
extern int sstr_num2str(int strno, int fig, int nzeropad, int num);
extern char *sstr_replacestr(char *msg);
extern int nt_sstr_init();
extern int nt_sstr_push(char *str);
extern int nt_sstr_pop(char *str, int maxlen);
extern int nt_sstr_regist_replace(char *sstr, char *dstr);
extern int nt_sstr_num2str(int strno, int fig, int nzeropad, int num);
extern char *nt_sstr_replacestr(char *msg);
#endif /* __SACTSTRING_H__ */
+15 -15
View File
@@ -9,7 +9,7 @@
#include "ngraph.h"
#include "nt_msg.h"
sprite_t *sp_new(int no, int cg1, int cg2, int cg3, int type) {
sprite_t *nt_sp_new(int no, int cg1, int cg2, int cg3, int type) {
sprite_t *sp;
sp = calloc(1, sizeof(sprite_t));
@@ -17,9 +17,9 @@ sprite_t *sp_new(int no, int cg1, int cg2, int cg3, int type) {
sp->no = no;
sp->type = type;
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;
if (cg1) sp->cg1 = nt_scg_loadcg_no(cg1, TRUE); else sp->cg1 = NULL;
if (cg2) sp->cg2 = nt_scg_loadcg_no(cg2, TRUE); else sp->cg2 = NULL;
if (cg3) sp->cg3 = nt_scg_loadcg_no(cg3, TRUE); else sp->cg3 = NULL;
sp->curcg = sp->cg1;
sp->show = TRUE;
@@ -47,7 +47,7 @@ sprite_t *sp_new(int no, int cg1, int cg2, int cg3, int type) {
return sp;
}
sprite_t *sp_msg_new(int no, int x, int y, int width, int height) {
sprite_t *nt_sp_msg_new(int no, int x, int y, int width, int height) {
sprite_t *sp;
sp = calloc(1, sizeof(sprite_t));
@@ -69,12 +69,12 @@ sprite_t *sp_msg_new(int no, int x, int y, int width, int height) {
return sp;
}
void sp_free(sprite_t *sp) {
void nt_sp_free(sprite_t *sp) {
if (sp == NULL) return;
if (sp->cg1) scg_free_cgobj(sp->cg1);
if (sp->cg2) scg_free_cgobj(sp->cg2);
if (sp->cg3) scg_free_cgobj(sp->cg3);
if (sp->cg1) nt_scg_free_cgobj(sp->cg1);
if (sp->cg2) nt_scg_free_cgobj(sp->cg2);
if (sp->cg3) nt_scg_free_cgobj(sp->cg3);
if (sp->type == SPRITE_MSG) {
sf_free(sp->u.msg.canvas);
@@ -83,7 +83,7 @@ void sp_free(sprite_t *sp) {
free(sp);
}
void sp_set_show(sprite_t *sp, boolean show) {
void nt_sp_set_show(sprite_t *sp, boolean show) {
boolean oldshow;
if (sp == NULL) return;
@@ -92,22 +92,22 @@ void sp_set_show(sprite_t *sp, boolean show) {
sp->show = show;
if (oldshow != show) {
sp_updateme(sp);
nt_sp_updateme(sp);
}
}
#if 0
void sp_set_cg(sprite_t *sp, int no) {
void nt_sp_set_cg(sprite_t *sp, int no) {
cginfo_t *cg;
if (sp == NULL) return;
if (sp->curcg) {
scg_free_cgobj(sp->curcg);
nt_scg_free_cgobj(sp->curcg);
}
if (no) {
cg = scg_loadcg_no(no, TRUE);
cg = nt_scg_loadcg_no(no, TRUE);
} else {
cg = NULL;
}
@@ -124,7 +124,7 @@ void sp_set_cg(sprite_t *sp, int no) {
}
#endif
void sp_set_loc(sprite_t *sp, int x, int y) {
void nt_sp_set_loc(sprite_t *sp, int x, int y) {
if (sp == NULL) return;
sp->cur.x = sp->loc.x = x;
sp->cur.y = sp->loc.y = y;
+19 -19
View File
@@ -6,7 +6,7 @@
#include "surface.h"
#include "graphics.h"
#define DEFAULT_UPDATE sp_draw
#define DEFAULT_UPDATE nt_sp_draw
#define SPRITEMAX 20
@@ -107,30 +107,30 @@ typedef struct _sprite sprite_t;
/* in nt_sprite.c */
extern sprite_t *sp_new(int no, int cg1, int cg2, int cg3, int type);
extern sprite_t *sp_msg_new(int no, int x, int y, int width, int height);
extern void sp_free(sprite_t *sp);
extern void sp_set_show(sprite_t *sp, boolean show);
// extern void sp_set_cg(sprite_t *sp, int no);
extern void sp_set_loc(sprite_t *sp, int x, int y);
extern sprite_t *nt_sp_new(int no, int cg1, int cg2, int cg3, int type);
extern sprite_t *nt_sp_msg_new(int no, int x, int y, int width, int height);
extern void nt_sp_free(sprite_t *sp);
extern void nt_sp_set_show(sprite_t *sp, boolean show);
// extern void nt_sp_set_cg(sprite_t *sp, int no);
extern void nt_sp_set_loc(sprite_t *sp, int x, int y);
/* in nt_sprite_update.c */
extern int sp_update_clipped();
extern int sp_update_all(boolean syncscreen);
extern int sp_updateme(sprite_t *sp);
extern int sp_updateme_part(sprite_t *sp, int x, int y, int w, int h);
extern void sp_add_updatelist(sprite_t *sp);
extern void sp_remove_updatelist(sprite_t *sp);
extern int sp_draw_wall(sprite_t *sp, MyRectangle *r);
extern int nt_sp_update_clipped();
extern int nt_sp_update_all(boolean syncscreen);
extern int nt_sp_updateme(sprite_t *sp);
extern int nt_sp_updateme_part(sprite_t *sp, int x, int y, int w, int h);
extern void nt_sp_add_updatelist(sprite_t *sp);
extern void nt_sp_remove_updatelist(sprite_t *sp);
extern int nt_sp_draw_wall(sprite_t *sp, MyRectangle *r);
/* in nt_sprite_draw.c */
extern int sp_draw(sprite_t *sp, MyRectangle *r);
extern int sp_draw2(sprite_t *sp, cginfo_t *cg, MyRectangle *r);
extern void sp_draw_dmap(void* data, void* userdata);
extern int sp_draw_scg(sprite_t *sp, MyRectangle *r);
extern int nt_sp_draw(sprite_t *sp, MyRectangle *r);
extern int nt_sp_draw2(sprite_t *sp, cginfo_t *cg, MyRectangle *r);
extern void nt_sp_draw_dmap(void* data, void* userdata);
extern int nt_sp_draw_scg(sprite_t *sp, MyRectangle *r);
/* in nt_sprite_eupdate.c */
extern int sp_eupdate(int type, int time, int cancel);
extern int nt_sp_eupdate(int type, int time, int cancel);
#endif /* __SPRITE_H__ */
+4 -4
View File
@@ -38,10 +38,10 @@
@param sp: 描画するスプライト
@param r : 再描画する領域
*/
int sp_draw(sprite_t *sp, MyRectangle *r) {
int nt_sp_draw(sprite_t *sp, MyRectangle *r) {
if (sp == NULL) return NG;
return sp_draw2(sp, sp->curcg, r);
return nt_sp_draw2(sp, sp->curcg, r);
}
/*
@@ -52,7 +52,7 @@ int sp_draw(sprite_t *sp, MyRectangle *r) {
@param cg: 描画するCG
@param r : 再描画する領域
*/
int sp_draw2(sprite_t *sp, cginfo_t *cg, MyRectangle *r) {
int nt_sp_draw2(sprite_t *sp, cginfo_t *cg, MyRectangle *r) {
surface_t update;
int sx, sy, w, h, dx, dy;
@@ -103,7 +103,7 @@ int sp_draw2(sprite_t *sp, cginfo_t *cg, MyRectangle *r) {
}
// BlendScreenによる描画
int sp_draw_scg(sprite_t *sp, MyRectangle *r) {
int nt_sp_draw_scg(sprite_t *sp, MyRectangle *r) {
surface_t update;
cginfo_t *cg;
int sx, sy, w, h, dx, dy;
+3 -3
View File
@@ -364,7 +364,7 @@ static void ec_whiteout_cb(surface_t *sfsrc, surface_t *sfdst) {
@param time: 実行時間(msec)
@param cancel: キー抜け(0:なし, 1:あり)
*/
int sp_eupdate(int type, int time, int cancel) {
int nt_sp_eupdate(int type, int time, int cancel) {
surface_t *sfsrc, *sfdst;
int key;
entrypoint *cb;
@@ -372,7 +372,7 @@ int sp_eupdate(int type, int time, int cancel) {
// 現在の sf0 をセーブ
sfsrc = sf_dup(sf0);
sp_update_all(FALSE);
nt_sp_update_all(FALSE);
sfdst = sf_dup(sf0);
@@ -415,7 +415,7 @@ int sp_eupdate(int type, int time, int cancel) {
cb = ec_dummy_cb;
break;
case 1013:
sp_update_all(TRUE); return OK;
nt_sp_update_all(TRUE); return OK;
// cb = ec_dummy_cb;
break;
default:
+7 -7
View File
@@ -130,7 +130,7 @@ static void do_update_each(void* data, void* userdata) {
画面全体の更新
@param syncscreen: surface0 に描画したものを Screen に反映させるかどうか
*/
int sp_update_all(boolean syncscreen) {
int nt_sp_update_all(boolean syncscreen) {
// 画面全体を更新領域に
MyRectangle r = {0, 0, sf0->width, sf0->height };
@@ -152,7 +152,7 @@ int sp_update_all(boolean syncscreen) {
画面の一部を更新
updateme(_part)で登録した更新が必要なspriteの和の領域をupdate
*/
int sp_update_clipped() {
int nt_sp_update_clipped() {
MyRectangle r;
// 更新領域の確定
@@ -176,7 +176,7 @@ int sp_update_clipped() {
sprite全体の更新を登録
@param sp: 更新するスプライト
*/
int sp_updateme(sprite_t *sp) {
int nt_sp_updateme(sprite_t *sp) {
MyRectangle *r;
if (sp == NULL) return NG;
@@ -204,7 +204,7 @@ int sp_updateme(sprite_t *sp) {
@param w: 更新領域幅
@param h: 更新領域高さ
*/
int sp_updateme_part(sprite_t *sp, int x, int y, int w, int h) {
int nt_sp_updateme_part(sprite_t *sp, int x, int y, int w, int h) {
MyRectangle *r;
if (sp == NULL) return NG;
@@ -238,16 +238,16 @@ static int compare_spriteno_smallfirst(const void *a, const void *b) {
return 0;
}
void sp_add_updatelist(sprite_t *sp) {
void nt_sp_add_updatelist(sprite_t *sp) {
updatelist = slist_insert_sorted(updatelist, sp, compare_spriteno_smallfirst);
}
void sp_remove_updatelist(sprite_t *sp) {
void nt_sp_remove_updatelist(sprite_t *sp) {
updatelist = slist_remove(updatelist, sp);
}
// デフォルトの壁紙update
int sp_draw_wall(sprite_t *sp, MyRectangle *area) {
int nt_sp_draw_wall(sprite_t *sp, MyRectangle *area) {
int sx, sy, w, h;
sx = area->x;
+1 -1
View File
@@ -32,7 +32,7 @@ static const Module *modules[] = {
&module_Gpx,
&module_Math,
&module_MsgSkip,
// &module_NIGHTDLL,
&module_NIGHTDLL,
&module_NightDemonDemo,
&module_RandMT,
&module_SACT,