├── .gitignore ├── Game ├── ED │ ├── Ending.cpp │ └── Ending.h ├── Game.cpp ├── Game.h ├── GlobalVariableAndStatistics.cpp ├── GlobalVariableAndStatistics.h ├── HighScoreScreen │ ├── HighScoreScreen.cpp │ └── HighScoreScreen.h ├── OP │ ├── OpParticle.cpp │ ├── OpParticle.h │ ├── Opening.cpp │ └── Opening.h ├── Replay.cpp ├── Replay.h ├── Scheme.cpp ├── Scheme.h ├── SchemeSwitcher.cpp ├── SchemeSwitcher.h ├── SelectCharaScreen │ ├── SelectCharaScreen.cpp │ └── SelectCharaScreen.h ├── SelectReplayScreen │ ├── SelectReplayScreen.cpp │ └── SelectReplayScreen.h ├── Stage │ ├── Background │ │ ├── Background.cpp │ │ └── Background.h │ ├── Boss │ │ ├── Boss.cpp │ │ ├── Boss.h │ │ ├── BossStage1.cpp │ │ ├── BossStage1.h │ │ ├── BossStage2.cpp │ │ ├── BossStage2.h │ │ ├── BossStage3.cpp │ │ ├── BossStage3.h │ │ ├── BossStage4.cpp │ │ ├── BossStage4.h │ │ ├── BossStage4Mai.cpp │ │ ├── BossStage4Mai.h │ │ ├── BossStage4Yuki.cpp │ │ ├── BossStage4Yuki.h │ │ ├── BossStage5.cpp │ │ ├── BossStage5.h │ │ ├── BossStage6.cpp │ │ ├── BossStage6.h │ │ ├── BossStageEx.cpp │ │ └── BossStageEx.h │ ├── Chara │ │ ├── Chara.cpp │ │ ├── Chara.h │ │ ├── CharaMarisa.cpp │ │ ├── CharaMarisa.h │ │ ├── CharaMima.cpp │ │ ├── CharaMima.h │ │ ├── CharaReimu.cpp │ │ ├── CharaReimu.h │ │ ├── CharaYuka.cpp │ │ └── CharaYuka.h │ ├── CharaBullet │ │ ├── CharaBullet.cpp │ │ └── CharaBullet.h │ ├── Circle │ │ ├── Circle.cpp │ │ └── Circle.h │ ├── Dialogue │ │ ├── Dialogue.cpp │ │ └── Dialogue.h │ ├── Enemy │ │ ├── Enemy.cpp │ │ └── Enemy.h │ ├── EnemyBullet │ │ ├── EnemyBullet.cpp │ │ └── EnemyBullet.h │ ├── FloatingText │ │ ├── FloatingText.cpp │ │ └── FloatingText.h │ ├── GatherEffect │ │ ├── GatherEffect.cpp │ │ └── GatherEffect.h │ ├── Item │ │ ├── Item.cpp │ │ └── Item.h │ ├── Laser │ │ ├── Laser.cpp │ │ └── Laser.h │ ├── MidBoss │ │ ├── MidBoss.cpp │ │ ├── MidBoss.h │ │ ├── MidBossStage1.cpp │ │ ├── MidBossStage1.h │ │ ├── MidBossStage2.cpp │ │ ├── MidBossStage2.h │ │ ├── MidBossStage3.cpp │ │ ├── MidBossStage3.h │ │ ├── MidBossStage4.cpp │ │ ├── MidBossStage4.h │ │ ├── MidBossStage5.cpp │ │ ├── MidBossStage5.h │ │ ├── MidBossStageEx.cpp │ │ └── MidBossStageEx.h │ ├── PopupNumber │ │ ├── PopupNumber.cpp │ │ └── PopupNumber.h │ ├── SparkEffect │ │ ├── SparkEffect.cpp │ │ └── SparkEffect.h │ ├── SpecialBullet │ │ ├── CurvingBullet.cpp │ │ ├── CurvingBullet.h │ │ ├── KnifeBullet.cpp │ │ ├── KnifeBullet.h │ │ ├── LargeBullet.cpp │ │ ├── LargeBullet.h │ │ ├── ShinkiBullet.cpp │ │ └── ShinkiBullet.h │ ├── Stage.cpp │ ├── Stage.h │ ├── Stage2BG │ │ ├── Stage2BG.cpp │ │ └── Stage2BG.h │ ├── StageResource.cpp │ ├── StageResource.h │ ├── Summary │ │ ├── Summary.cpp │ │ └── Summary.h │ └── TextOverlay │ │ ├── TextOverlay.cpp │ │ └── TextOverlay.h └── TitleScreen │ ├── TitleRollingTama.cpp │ ├── TitleRollingTama.h │ ├── TitleScreen.cpp │ └── TitleScreen.h ├── LICENSE ├── README.md ├── SE ├── s01.wav ├── s02.wav ├── s03.wav ├── s04.wav ├── s05.wav ├── s06.wav ├── s07.wav ├── s08.wav ├── s09.wav ├── s10.wav ├── s11.wav ├── s12.wav ├── s13.wav ├── s14.wav └── s15.wav ├── chs.dat ├── config.ini ├── game.cfg ├── gameLib ├── CommonFunction │ ├── CommonFunctionGraphic.cpp │ ├── CommonFunctionGraphic.h │ ├── CommonFunctionInput.cpp │ ├── CommonFunctionInput.h │ ├── CommonFunctionMusicSE.cpp │ ├── CommonFunctionMusicSE.h │ ├── CommonFunctionSystem.cpp │ └── CommonFunctionSystem.h ├── Graphic │ ├── 2DImage.cpp │ ├── 2DImage.h │ ├── 2DImageArray.cpp │ ├── 2DImageArray.h │ ├── GLContext.cpp │ ├── GLContext.h │ ├── PC98Font.cpp │ ├── PC98Font.h │ ├── Th5ExtFont.cpp │ ├── Th5ExtFont.h │ ├── include │ │ ├── glew.h │ │ └── wglew.h │ └── mygl.h ├── Input │ ├── KeyInputDI.cpp │ └── KeyInputDI.h ├── Misc │ ├── md5.cpp │ ├── md5.h │ ├── sha1.cpp │ └── sha1.h ├── PMDPlayer │ ├── PMDPlayer.cpp │ └── PMDPlayer.h ├── SE │ ├── SoundEffect.cpp │ └── SoundEffect.h ├── Window │ ├── GameWindow.cpp │ └── GameWindow.h └── th5DatFile │ ├── BB │ ├── BBFile.cpp │ └── BBFile.h │ ├── BFT │ ├── BFTFile.cpp │ └── BFTFile.h │ ├── CD2CDG │ ├── CD2CDGFile.cpp │ └── CD2CDGFile.h │ ├── MPN │ ├── MPNFile.cpp │ └── MPNFile.h │ ├── PI │ ├── PIFile.cpp │ └── PIFile.h │ ├── STD │ ├── STDFile.cpp │ └── STDFile.h │ ├── th5DatFile.cpp │ └── th5DatFile.h ├── include ├── DSUtil │ ├── dsutil.cpp │ ├── dsutil.h │ ├── dxutil.cpp │ └── dxutil.h └── PMDWin │ ├── PCMMusDriver.h │ └── PMDWinImort.h ├── main.cpp ├── mod ├── _DM00.TX2 ├── _DM01.TX2 ├── _DM02.TX2 ├── _DM03.TX2 ├── _DM04.TX2 ├── _DM05.TX2 ├── _DM06.TX2 ├── _DM08.TX2 ├── _DM09.TX2 ├── _ED00.TXT ├── _ED01.TXT ├── _ED02.TXT ├── _ED03.TXT ├── _ED10.TXT ├── _ED11.TXT ├── _ED12.TXT ├── _ED13.TXT ├── _ED20.TXT ├── _ED21.TXT ├── _ED22.TXT ├── _ED23.TXT ├── marks.txt ├── menudesc.txt ├── mod.ini ├── names.txt └── summary.txt ├── packmod.bat ├── practice.bmp ├── replay.bmp ├── replay ├── replay00.rpy ├── replay01.rpy ├── replay02.rpy ├── replay03.rpy ├── replay04.rpy ├── replay05.rpy ├── replay06.rpy ├── replay16.rpy ├── replay17.rpy ├── replay18.rpy ├── replay19.rpy └── replay39.rpy ├── resource.h ├── rt5sandbox.aps ├── rt5sandbox.rc ├── rt5sandbox.sln ├── rt5sandbox.suo ├── rt5sandbox.vcproj ├── rt5sandbox.vcxproj ├── rt5sandbox.vcxproj.filters ├── score.dat └── tran_chs ├── 0.txt ├── 1.txt ├── 2.txt ├── 3.txt ├── 4.txt ├── 5.txt ├── 6.txt ├── 8.txt ├── 9.txt ├── _DM00.TX2 ├── _DM01.TX2 ├── _DM02.TX2 ├── _DM03.TX2 ├── _DM04.TX2 ├── _DM05.TX2 ├── _DM06.TX2 ├── _DM08.TX2 ├── _DM09.TX2 ├── c.bat ├── dc.bat ├── menudesc.txt └── names.txt /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | -------------------------------------------------------------------------------- /Game/ED/Ending.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "../scheme.h" 4 | #include "../../gameLib/CommonFunction/CommonFunctionGraphic.h" 5 | #include 6 | using namespace std; 7 | 8 | namespace th5w{ 9 | 10 | class CEnding : public CScheme 11 | { 12 | protected: 13 | unsigned short m_lastKey; 14 | unsigned short m_curKey; 15 | 16 | int m_curFrame; 17 | unsigned char *m_pScript; 18 | unsigned char *m_pScriptBase; 19 | 20 | C2DImage *m_pBGImage; 21 | C2DImage *m_pCenterImage; 22 | C2DImage *m_pCenterImageCandi; 23 | int m_curCenterImgIdx; 24 | 25 | unsigned char m_palette[48]; 26 | unsigned char m_lastTextColorIdx; 27 | unsigned char m_curTextColorIdx; 28 | vector m_lastText; 29 | vector m_curText; 30 | vector, unsigned char> > m_colorTable; 31 | int m_textFade; 32 | 33 | bool m_bWaitKey; 34 | bool m_bFading; 35 | float m_curScrScale; 36 | float m_tarScrScale; 37 | float m_deltaScrScale; 38 | bool m_bCtrImgFading; 39 | int m_ctrImgCurFade; 40 | int m_ctrImgTotalFade; 41 | float m_curMusicFade; 42 | bool m_bMusicFadeOut; 43 | 44 | bool m_bWaitNFrame; 45 | int m_nWaitFrameLeft; 46 | 47 | protected: 48 | int ReadNumber(int defValue); 49 | int ReadNumberComma(int defValue); 50 | void DrawText(vector &text,unsigned char colorIdx, int scale); 51 | 52 | public: 53 | void Initialize(int edType); 54 | virtual int Step(); 55 | virtual void Draw(); 56 | public: 57 | CEnding(void); 58 | virtual ~CEnding(void); 59 | }; 60 | 61 | } 62 | -------------------------------------------------------------------------------- /Game/Game.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../gamelib/Window/GameWindow.h" 3 | #include "../gameLib/Input/KeyInputDI.h" 4 | #include "../gamelib/th5DatFile/th5DatFile.h" 5 | #include "../gamelib/PMDPlayer/PMDPlayer.h" 6 | #include "../gameLib/se/SoundEffect.h" 7 | 8 | #include "Scheme.h" 9 | #include "SchemeSwitcher.h" 10 | 11 | #include "GlobalVariableAndStatistics.h" 12 | 13 | namespace th5w{ 14 | 15 | class CGame 16 | { 17 | public: 18 | static CGame *s_pCurGame; 19 | __forceinline static CGlobalVariableAndStatistics& GVar() {return s_pCurGame->m_globalVar;} 20 | 21 | int m_windowWidth,m_windowHeight; 22 | RECT m_playArea; 23 | 24 | CScheme *m_pCurScheme; 25 | 26 | int m_curSchemeID; 27 | 28 | public: 29 | CGameWindow m_gameWindow; 30 | CKeyInputDI m_input; 31 | CSoundEffect m_soundEffect; 32 | 33 | Cth5DatFile m_th5Dat1; 34 | Cth5DatFile m_th5Dat2; 35 | Cth5DatFile m_modDat; 36 | 37 | CGlobalVariableAndStatistics m_globalVar; 38 | 39 | public: 40 | LARGE_INTEGER m_lastFrameTime; 41 | LARGE_INTEGER m_performanceFreq; 42 | LARGE_INTEGER m_lastDeactivateTime; 43 | float m_fpsLimit; 44 | float m_thisFrameDuration; 45 | float m_thisFrameLostTime; 46 | LARGE_INTEGER m_fpsTimeArray[20]; 47 | int m_fpsTimeIdx; 48 | double m_fps; 49 | 50 | protected: 51 | bool Initialize(); 52 | void UpdateFPS(); 53 | void LoadModConfig(); 54 | public: 55 | Cth5DatFile* FindResource(const char *fileName); 56 | public: 57 | void Run(); 58 | void SetVSYNC(bool bOn); 59 | 60 | public: 61 | void OnDeactivate(); 62 | void OnActivate(); 63 | void OnGameEnd(); 64 | void OnPaintInactivate(); 65 | 66 | public: 67 | CGame(void); 68 | ~CGame(void); 69 | }; 70 | 71 | } -------------------------------------------------------------------------------- /Game/GlobalVariableAndStatistics.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Replay.h" 3 | #include 4 | 5 | namespace th5w{ 6 | 7 | class CGlobalVariableAndStatistics 8 | { 9 | public: 10 | //program macro 11 | int m_gameVersion; 12 | 13 | //program config 14 | unsigned int m_textCodePage; 15 | bool m_bUseSystemFont; 16 | unsigned int m_fontCharset; 17 | 18 | //mod 19 | bool m_bUseMod; 20 | char m_modFileName[200]; 21 | unsigned char m_modMD5[16]; 22 | 23 | //these variables should be initialized before OnBeginGame 24 | 25 | //loaded from config 26 | bool m_bClear[4][5]; 27 | bool m_bExtraPlayable[4]; 28 | unsigned char m_defaultHighScoreName[10]; 29 | char m_defaultReplayName[10]; 30 | 31 | //loaded from config and can be change in main menu 32 | int m_nInitLife; 33 | int m_nInitBomb; 34 | int m_initDifficulty; 35 | 36 | void LoadConfig(); 37 | void LoadProgramConfig(); 38 | void SaveConfig(); 39 | void OnClear(); 40 | 41 | //loaded from score file 42 | unsigned char m_highScoreName[4][5][5][10]; 43 | int m_highScore[4][5][5]; 44 | unsigned char m_highScoreFlag[4][5][5]; 45 | void LoadHighScore(); 46 | void SaveHighScore(); 47 | 48 | public: 49 | /* --------------variables above this line should not be accessed during game-------------- */ 50 | 51 | //determined by user choice in main menu 52 | //make sure to set these values before call OnBeginGame 53 | //this one must be set 54 | int m_playStage; 55 | //either initialize this set of variables 56 | bool m_bReplayMode; 57 | CReplay m_replay; 58 | //or this set 59 | bool m_bPracticeMode; 60 | int m_playDifficulty; 61 | int m_playChara; 62 | 63 | //these variables are initialized by OnBeginGame 64 | 65 | //changeable during game 66 | int m_nCurLife; 67 | int m_nCurBomb; 68 | int m_curPower; 69 | int m_powerOverflowLevel; 70 | int m_curDream; 71 | int m_curScore; 72 | int m_totalNPointItem; 73 | int m_curNGraze; 74 | int m_playerPerformance; 75 | int m_curHighScore; 76 | int m_nContinueUsed; 77 | 78 | //constant during game 79 | int m_nContinueLimit; 80 | int m_pointItemMaxScore; 81 | int m_grazeBonus; 82 | int m_playerPerformanceLowerBound; 83 | int m_playerPerformanceUpperBound; 84 | int m_nLifeOnContinue; 85 | int m_nBombOnMiss; 86 | int m_randomSeed[7]; 87 | 88 | bool m_bCanSaveReplay; 89 | 90 | //environment 91 | char m_workingPath[1000]; 92 | char m_replaySubDir[100]; 93 | public: 94 | void Initialize(); 95 | void OnBeginGame(); 96 | public: 97 | CGlobalVariableAndStatistics(void); 98 | ~CGlobalVariableAndStatistics(void); 99 | }; 100 | 101 | } 102 | -------------------------------------------------------------------------------- /Game/HighScoreScreen/HighScoreScreen.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\scheme.h" 3 | #include "../../gameLib/Graphic/2DImageArray.h" 4 | 5 | #define HIGHSCORESCREEN_END_VIEW_END 1 6 | #define HIGHSCORESCREEN_END_ENTER_END 2 7 | #define HIGHSCORESCREEN_END_ENTER_SKIPPED 3 8 | 9 | namespace th5w{ 10 | 11 | class CHighScoreScreen : public CScheme 12 | { 13 | protected: 14 | unsigned char m_charTable[3][17]; 15 | 16 | protected: 17 | bool m_bViewMode; 18 | int m_curFrame; 19 | unsigned short m_lastKeyState,m_curKeyState; 20 | 21 | int m_curPage; 22 | int m_opChara; 23 | int m_opRank; 24 | unsigned char m_curEnterName[10]; 25 | int m_curCursorPos; 26 | int m_curCharX,m_curCharY; 27 | 28 | unsigned char m_palette[48]; 29 | C2DImage *m_pBGImage; 30 | 31 | C2DImageArray m_patternArray; 32 | C2DImageArray m_numberArray; 33 | 34 | protected: 35 | int m_curScrFade; 36 | bool m_bQuit; 37 | int m_quitCode; 38 | 39 | protected: 40 | void DrawItem(int x,int y,unsigned char name[10],int score,unsigned char flag,bool bHighLight); 41 | 42 | public: 43 | void Initialize(bool bViewMode,bool clearFlag); 44 | int Step(); 45 | void Draw(); 46 | 47 | public: 48 | CHighScoreScreen(void); 49 | virtual ~CHighScoreScreen(void); 50 | }; 51 | 52 | } 53 | -------------------------------------------------------------------------------- /Game/OP/OpParticle.cpp: -------------------------------------------------------------------------------- 1 | #include ".\opparticle.h" 2 | #include 3 | #ifndef PI 4 | #define PI 3.1415926535897932384626433832795 5 | #endif 6 | 7 | namespace th5w{ 8 | 9 | COpParticle::COpParticle(void) 10 | { 11 | } 12 | 13 | COpParticle::~COpParticle(void) 14 | { 15 | } 16 | 17 | void COpParticle::Initialize() 18 | { 19 | for (int i=0;ibUsed!=1) 29 | continue; 30 | pPar->age++; 31 | if (pPar->age>=40) 32 | { 33 | pPar->bUsed=0; 34 | pPar->age=0; 35 | continue; 36 | } 37 | if (pPar->age<16) 38 | continue; 39 | if (pPar->age==16) 40 | *pbPlaySound15=true; 41 | pPar->lastR=pPar->curR; 42 | pPar->curR+=pPar->vel; 43 | } 44 | } 45 | 46 | void COpParticle::Draw(C2DImageArray *pImageArray) 47 | { 48 | for (int i=0;ibUsed!=1) 52 | continue; 53 | int drawImg=pPar->img+pPar->age/4; 54 | if (pPar->age<16) 55 | { 56 | C2DImage *pImage=pImageArray->GetImagePtr(drawImg); 57 | pImage->Draw((float)pPar->curX/16-8,(float)pPar->curY/16-8+40); 58 | continue; 59 | } 60 | int drawOffset; 61 | if (pPar->age<32) 62 | drawOffset=8; 63 | else 64 | drawOffset=16; 65 | double realAngle=pPar->angle/(double)256*2*PI; 66 | int drawX=((int)(cos(realAngle)*pPar->curR)+pPar->curX)/16-drawOffset; 67 | int drawY=((int)(sin(realAngle)*pPar->curR)+pPar->curY)/16-drawOffset; 68 | C2DImage *pImage=pImageArray->GetImagePtr(drawImg); 69 | pImage->Draw((float)drawX,(float)drawY+40); 70 | 71 | } 72 | } 73 | 74 | void COpParticle::AddParticles(int img,int nParticleToCreate,int originX,int originY) 75 | { 76 | int nParticleCreated=0; 77 | int curSlot=0; 78 | while(curSlot<256) 79 | { 80 | if (m_particle[curSlot].bUsed) 81 | { 82 | curSlot++; 83 | continue; 84 | } 85 | m_particle[curSlot].bUsed=1; 86 | m_particle[curSlot].age=0; 87 | m_particle[curSlot].curX=originX*16; 88 | m_particle[curSlot].curY=originY*16; 89 | m_particle[curSlot].lastR=0; 90 | m_particle[curSlot].curR=0; 91 | m_particle[curSlot].vel=rand()%224+64; 92 | m_particle[curSlot].angle=rand()%256; 93 | m_particle[curSlot].img=img; 94 | nParticleCreated++; 95 | if (nParticleCreated>=nParticleToCreate) 96 | break; 97 | } 98 | } 99 | 100 | } -------------------------------------------------------------------------------- /Game/OP/OpParticle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../gameLib/Graphic/2DImageArray.h" 3 | 4 | namespace th5w{ 5 | 6 | typedef struct strPARTICLE{ 7 | unsigned char bUsed; 8 | unsigned char age; 9 | unsigned short curX; 10 | unsigned short curY; 11 | unsigned short lastR; 12 | unsigned short curR; 13 | unsigned short vel; 14 | unsigned char angle; 15 | unsigned char img; 16 | }PARTICLE; 17 | 18 | #define MAX_PARTICLE 256 19 | 20 | class COpParticle 21 | { 22 | protected: 23 | PARTICLE m_particle[MAX_PARTICLE]; 24 | 25 | public: 26 | void Initialize(); 27 | void AddParticles(int img,int nParticleToCreate,int originX,int originY); 28 | void Step(bool *pbPlaySound15); 29 | void Draw(C2DImageArray *pImageArray); 30 | public: 31 | COpParticle(void); 32 | ~COpParticle(void); 33 | }; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Game/OP/Opening.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include ".\opening.h" 3 | #include 4 | #include "../../gameLib/PMDPlayer/PMDPlayer.h" 5 | #include "../Game.h" 6 | #include "../../gameLib/CommonFunction/CommonFunctionMusicSE.h" 7 | 8 | namespace th5w{ 9 | 10 | COpening::COpening(void) 11 | { 12 | m_curFrame=0; 13 | m_pBGImage=NULL; 14 | } 15 | 16 | COpening::~COpening(void) 17 | { 18 | if (m_pBGImage) 19 | m_pBGImage->Destroy(); 20 | m_pBGImage=NULL; 21 | } 22 | 23 | void COpening::Initialize() 24 | { 25 | m_curFrame=-1; 26 | 27 | CCommonFunctionGraphic::LoadPIFromDat(&m_pBGImage,m_globalPalette,&CGame::s_pCurGame->m_th5Dat1,"ZUN00.PI"); 28 | 29 | CCommonFunctionMusicSE::LoadMusicToPMDFromDat(&CGame::s_pCurGame->m_th5Dat1,"LOGO.M"); 30 | th5w::CPMDPlayer::Play(); 31 | 32 | m_particle.Initialize(); 33 | 34 | m_curScrFade=0; 35 | 36 | CCommonFunctionGraphic::LoadBFTAllPatternFromDat(&m_patternArray,NULL,&CGame::s_pCurGame->m_th5Dat1,"ZUN02.BFT",0); 37 | CCommonFunctionGraphic::LoadBFTAllPatternFromDat(&m_patternArray,NULL,&CGame::s_pCurGame->m_th5Dat1,"ZUN04.BFT",0); 38 | CCommonFunctionGraphic::LoadBFTAllPatternFromDat(&m_patternArray,NULL,&CGame::s_pCurGame->m_th5Dat1,"ZUN01.BFT",0); 39 | CCommonFunctionGraphic::LoadBFTAllPatternFromDat(&m_patternArray,NULL,&CGame::s_pCurGame->m_th5Dat1,"ZUN03.BFT",0); 40 | 41 | m_bKeyPressed=false; 42 | 43 | //this is a hacked fps, just to make the speed of the opening as close to that of PC98 ver as possible 44 | CGame::s_pCurGame->m_fpsLimit=26; 45 | } 46 | 47 | int COpening::Step() 48 | { 49 | m_curFrame++; 50 | 51 | if (m_curFrame>=170) 52 | { 53 | m_curScrFade-=6; 54 | if (m_curScrFade<=0) 55 | { 56 | th5w::CPMDPlayer::Pause(); 57 | return 1; 58 | } 59 | else 60 | return 0; 61 | } 62 | if (m_curFrame>50) 63 | { 64 | CGame::s_pCurGame->m_input.UpdateKeyState(); 65 | if (CGame::s_pCurGame->m_input.GetKeyState(DIK_Z)|CGame::s_pCurGame->m_input.GetKeyState(DIK_X)) 66 | m_bKeyPressed=true; 67 | } 68 | 69 | switch(m_curFrame) 70 | { 71 | case 0: 72 | m_particle.AddParticles(0,20,180,180); 73 | break; 74 | case 16: 75 | m_particle.AddParticles(10,20,460,220); 76 | break; 77 | case 24: 78 | m_particle.AddParticles(0,20,220,160); 79 | break; 80 | case 32: 81 | m_particle.AddParticles(10,20,380,240); 82 | break; 83 | case 40: 84 | m_particle.AddParticles(0,20,220,190); 85 | break; 86 | case 44: 87 | m_particle.AddParticles(10,20,340,200); 88 | break; 89 | case 48: 90 | m_particle.AddParticles(0,20,280,170); 91 | break; 92 | case 52: 93 | m_particle.AddParticles(10,20,380,260); 94 | break; 95 | case 56: 96 | m_particle.AddParticles(0,20,220,190); 97 | break; 98 | case 60: 99 | m_particle.AddParticles(10,20,440,210); 100 | break; 101 | case 64: 102 | m_particle.AddParticles(0,64,320,200); 103 | break; 104 | case 68: 105 | m_particle.AddParticles(10,64,320,200); 106 | break; 107 | default: 108 | break; 109 | } 110 | 111 | m_playSound15=false; 112 | m_particle.Step(&m_playSound15); 113 | if (m_playSound15) 114 | CGame::s_pCurGame->m_soundEffect.PlaySound(15); 115 | 116 | if (m_bKeyPressed) 117 | { 118 | if (m_curScrFade>0) 119 | m_curScrFade-=2; 120 | else 121 | { 122 | th5w::CPMDPlayer::Pause(); 123 | return 1; 124 | } 125 | } 126 | else 127 | { 128 | if (m_curFrame>=16) 129 | if (m_curScrFade<100) 130 | m_curScrFade+=2; 131 | } 132 | 133 | return 0; 134 | } 135 | 136 | void COpening::Draw() 137 | { 138 | glClearColor(0,0,0,1); 139 | glClear(GL_COLOR_BUFFER_BIT); 140 | m_pBGImage->Draw(0,40); 141 | if (!m_bKeyPressed) 142 | CCommonFunctionGraphic::ScreenFade((float)m_curScrFade); 143 | m_particle.Draw(&m_patternArray); 144 | if (m_bKeyPressed) 145 | CCommonFunctionGraphic::ScreenFade((float)m_curScrFade); 146 | } 147 | 148 | } 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /Game/OP/Opening.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "../scheme.h" 4 | #include "../../gameLib/CommonFunction/CommonFunctionGraphic.h" 5 | #include "OpParticle.h" 6 | 7 | namespace th5w{ 8 | 9 | class COpening : public CScheme 10 | { 11 | protected: 12 | int m_curFrame; 13 | 14 | th5w::C2DImageArray m_spriteArray; 15 | th5w::C2DImageArray m_patternArray; 16 | th5w::C2DImage *m_pBGImage; 17 | unsigned char m_globalPalette[48]; 18 | 19 | int m_curScrFade; 20 | 21 | COpParticle m_particle; 22 | 23 | bool m_bKeyPressed; 24 | bool m_playSound15; 25 | 26 | public: 27 | void Initialize(); 28 | virtual int Step(); 29 | virtual void Draw(); 30 | public: 31 | COpening(void); 32 | virtual ~COpening(void); 33 | }; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Game/Replay.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | namespace th5w{ 8 | 9 | enum InfoResult{ 10 | InfoRes_FileNotExist, 11 | InfoRes_InvalidReplay, 12 | InfoRes_GameVersionMismatch, 13 | InfoRes_ModFileMisMatch, 14 | InfoRes_ValidReplay 15 | }; 16 | typedef struct strREPLAY_BRIEF_INFO{ 17 | char playerName[8]; 18 | unsigned int saveTime; 19 | int playChara; 20 | int playDifficulty; 21 | unsigned char stageFlag[7]; 22 | int stageScore[7]; 23 | InfoResult infoRes; 24 | }REPLAY_BRIEF_INFO; 25 | 26 | class CReplay 27 | { 28 | public: 29 | char m_playerName[8]; 30 | unsigned int m_saveTime; 31 | public: 32 | int m_nInitLife; 33 | int m_nInitBomb; 34 | int m_playDifficulty; 35 | int m_playChara; 36 | bool m_bPracticeMode; 37 | 38 | public: 39 | unsigned char m_stageFlag[7]; 40 | int m_nCurLife[7]; 41 | int m_nCurBomb[7]; 42 | int m_curPower[7]; 43 | int m_powerOverflowLevel[7]; 44 | int m_curDream[7]; 45 | int m_curScore[7]; 46 | int m_totalNPointItem[7]; 47 | int m_playerPerformance[7]; 48 | int m_stageScore[7]; 49 | int m_randSeed[7]; 50 | vector m_keyState[7]; 51 | 52 | protected: 53 | int m_opIdx; 54 | int m_opStage; 55 | bool m_bOpRead; 56 | 57 | public: 58 | static bool GetRepFileInfo(REPLAY_BRIEF_INFO *pOut, const char *fileName); 59 | public: 60 | bool Reset(); 61 | bool OpenStage(int stageIdx,bool bRead); 62 | bool CloseStage(bool bCleared=false); //no need to pass bCleared for read mode 63 | bool GetNextData(unsigned short *pOut); 64 | bool PutNextdata(unsigned short data); 65 | public: 66 | bool LoadFile(const char *fileName); 67 | bool SaveFile(const char *fileName); 68 | 69 | public: 70 | CReplay(void); 71 | ~CReplay(void); 72 | }; 73 | 74 | } 75 | -------------------------------------------------------------------------------- /Game/Scheme.cpp: -------------------------------------------------------------------------------- 1 | #include ".\scheme.h" 2 | 3 | namespace th5w{ 4 | 5 | CScheme::CScheme(void) 6 | { 7 | } 8 | 9 | CScheme::~CScheme(void) 10 | { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Game/Scheme.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace th5w{ 4 | 5 | class CScheme 6 | { 7 | public: 8 | virtual int Step()=0; 9 | virtual void Draw()=0; 10 | 11 | public: 12 | CScheme(void); 13 | virtual ~CScheme(void); 14 | }; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Game/SchemeSwitcher.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Scheme.h" 3 | 4 | namespace th5w{ 5 | 6 | class CSchemeSwitcher 7 | { 8 | public: 9 | static bool SwitchScheme(CScheme** ppOutNextScheme,int *pOutNextSchemeID, int curSchemeID, int curSchemeExitValue); 10 | static bool GetFirstScheme(CScheme** ppOutNextScheme,int *pOutNextSchemeID); 11 | public: 12 | CSchemeSwitcher(void); 13 | ~CSchemeSwitcher(void); 14 | }; 15 | 16 | } -------------------------------------------------------------------------------- /Game/SelectCharaScreen/SelectCharaScreen.cpp: -------------------------------------------------------------------------------- 1 | #include ".\selectcharascreen.h" 2 | #include "../Game.h" 3 | #include "../../gameLib/CommonFunction/CommonFunctionInput.h" 4 | #include "../../gameLib/CommonFunction/CommonFunctionGraphic.h" 5 | 6 | namespace th5w{ 7 | 8 | CSelectCharaScreen::CSelectCharaScreen(void) 9 | { 10 | } 11 | 12 | CSelectCharaScreen::~CSelectCharaScreen(void) 13 | { 14 | if (m_pBGImage!=NULL) 15 | m_pBGImage->Destroy(); 16 | m_pBGImage=NULL; 17 | } 18 | 19 | void CSelectCharaScreen::Initialize() 20 | { 21 | m_bQuit=false; 22 | m_quitCode=0; 23 | m_lastKeyState=0; 24 | 25 | m_cursorPos=0; 26 | 27 | int difficulty=CGame::GVar().m_playDifficulty; 28 | for (int i=0;i<4;i++) 29 | m_bCharaClearFlag[i]=CGame::GVar().m_bClear[i][difficulty]; 30 | if (difficulty!=4) 31 | for (int i=0;i<4;i++) 32 | m_bCharaSelectable[i]=true; 33 | else 34 | for (int i=0;i<4;i++) 35 | m_bCharaSelectable[i]=CGame::GVar().m_bExtraPlayable[i]; 36 | for (int i=0;i<4;i++) 37 | if (m_bCharaSelectable[i]) 38 | m_charaDisplayImg[i]=i; 39 | else 40 | m_charaDisplayImg[i]=4; 41 | 42 | CCommonFunctionGraphic::LoadPIFromDat(&m_pBGImage,m_palette,&CGame::s_pCurGame->m_th5Dat1,"SLB1.PI"); 43 | 44 | CCommonFunctionGraphic::LoadCD2CDGAllSpriteFromDat(&m_spriteArray,&CGame::s_pCurGame->m_th5Dat1,"SL00.CDG",m_palette); 45 | CCommonFunctionGraphic::LoadCD2CDGAllSpriteFromDat(&m_spriteArray,&CGame::s_pCurGame->m_th5Dat1,"SL01.CDG",m_palette); 46 | CCommonFunctionGraphic::LoadCD2CDGAllSpriteFromDat(&m_spriteArray,&CGame::s_pCurGame->m_th5Dat1,"SL02.CDG",m_palette); 47 | CCommonFunctionGraphic::LoadCD2CDGAllSpriteFromDat(&m_spriteArray,&CGame::s_pCurGame->m_th5Dat1,"SL03.CDG",m_palette); 48 | CCommonFunctionGraphic::LoadCD2CDGAllSpriteFromDat(&m_spriteArray,&CGame::s_pCurGame->m_th5Dat1,"SL04.CDG",m_palette); 49 | CCommonFunctionGraphic::LoadCD2CDGAllSpriteFromDat(&m_spriteArray,&CGame::s_pCurGame->m_th5Dat1,"SLCL.CDG",m_palette); 50 | 51 | m_curScrFade=0; 52 | } 53 | 54 | int CSelectCharaScreen::Step() 55 | { 56 | if (m_bQuit) 57 | { 58 | if (m_curScrFade>0) 59 | { 60 | m_curScrFade-=6; 61 | if (m_curScrFade<0) 62 | m_curScrFade=0; 63 | return 0; 64 | } 65 | else 66 | return m_quitCode; 67 | } 68 | 69 | if (m_curScrFade<100) 70 | { 71 | m_curScrFade+=6; 72 | if (m_curScrFade>100) 73 | m_curScrFade=100; 74 | return 0; 75 | } 76 | 77 | ParseKeyEvent(); 78 | 79 | return 0; 80 | } 81 | 82 | void CSelectCharaScreen::Draw() 83 | { 84 | glClearColor(0,0,0,1); 85 | glClear(GL_COLOR_BUFFER_BIT); 86 | m_pBGImage->Draw(0,40); 87 | 88 | int charaX[]={16,272,160,400}; 89 | int charaY[]={48+40,48+40,224+40,224+40}; 90 | 91 | for (int i=0;i<4;i++) 92 | { 93 | if (m_cursorPos==i) 94 | { 95 | CCommonFunctionGraphic::DrawRectangle((float)charaX[i],(float)charaY[i], 96 | (float)charaX[i]+m_spriteArray.GetImagePtr(m_charaDisplayImg[i])->m_width-1, 97 | (float)charaY[i]+m_spriteArray.GetImagePtr(m_charaDisplayImg[i])->m_height-1, 98 | 0,0,0); 99 | m_spriteArray.GetImagePtr(m_charaDisplayImg[i])->Draw((float)charaX[i]-8,(float)charaY[i]-8); 100 | if (m_bCharaClearFlag[i]) 101 | m_spriteArray.GetImagePtr(5)->Draw((float)charaX[i]-8+160,(float)charaY[i]-8+144); 102 | } 103 | else 104 | { 105 | m_spriteArray.GetImagePtr(m_charaDisplayImg[i])->DrawColorScaled((float)charaX[i],(float)charaY[i],0.5,0.5,0.5); 106 | if (m_bCharaClearFlag[i]) 107 | m_spriteArray.GetImagePtr(5)->DrawColorScaled((float)charaX[i]+160,(float)charaY[i]+144,0.5,0.5,0.5); 108 | } 109 | } 110 | 111 | CCommonFunctionGraphic::ScreenFade((float)m_curScrFade); 112 | } 113 | 114 | void CSelectCharaScreen::ParseKeyEvent() 115 | { 116 | unsigned short curState=CCommonFunctionInput::GetAllKeyState(); 117 | if (CCommonFunctionInput::LeftPressed(curState,m_lastKeyState)||CCommonFunctionInput::RightPressed(curState,m_lastKeyState)) 118 | { 119 | CGame::s_pCurGame->m_soundEffect.PlaySound(1); 120 | m_cursorPos=m_cursorPos/2*2+(1-m_cursorPos%2); 121 | m_lastKeyState=curState; 122 | return; 123 | } 124 | if (CCommonFunctionInput::UpPressed(curState,m_lastKeyState)||CCommonFunctionInput::DownPressed(curState,m_lastKeyState)) 125 | { 126 | CGame::s_pCurGame->m_soundEffect.PlaySound(1); 127 | m_cursorPos=m_cursorPos%2+(2-m_cursorPos+m_cursorPos%2); 128 | m_lastKeyState=curState; 129 | return; 130 | } 131 | if (CCommonFunctionInput::ZPressed(curState,m_lastKeyState)) 132 | { 133 | CGame::s_pCurGame->m_soundEffect.PlaySound(11); 134 | if (m_bCharaSelectable[m_cursorPos]==true) 135 | { 136 | CGame::GVar().m_playChara=m_cursorPos; 137 | CGame::GVar().OnBeginGame(); 138 | m_bQuit=true; 139 | m_quitCode=SELECTCHARASCREEN_END_SELECTED_CHARA; 140 | } 141 | m_lastKeyState=curState; 142 | return; 143 | } 144 | if (CCommonFunctionInput::ESCPressed(curState,m_lastKeyState)) 145 | { 146 | m_bQuit=true; 147 | m_quitCode=SELECTCHARASCREEN_END_BACK; 148 | m_lastKeyState=curState; 149 | return; 150 | } 151 | 152 | m_lastKeyState=curState; 153 | return; 154 | } 155 | 156 | } 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /Game/SelectCharaScreen/SelectCharaScreen.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../scheme.h" 3 | #include "../../gameLib/Graphic/2DImageArray.h" 4 | 5 | #define SELECTCHARASCREEN_END_SELECTED_CHARA 1 6 | #define SELECTCHARASCREEN_END_BACK 2 7 | 8 | namespace th5w{ 9 | 10 | class CSelectCharaScreen : public CScheme 11 | { 12 | protected: 13 | bool m_bCharaSelectable[4]; 14 | int m_charaDisplayImg[4]; 15 | bool m_bCharaClearFlag[4]; 16 | 17 | unsigned char m_palette[48]; 18 | 19 | protected: 20 | int m_curScrFade; 21 | int m_cursorPos; 22 | protected: 23 | C2DImageArray m_spriteArray; 24 | C2DImage *m_pBGImage; 25 | 26 | protected: 27 | bool m_bQuit; 28 | int m_quitCode; 29 | 30 | unsigned short m_lastKeyState; 31 | 32 | public: 33 | void Initialize(); 34 | virtual int Step(); 35 | void Draw(); 36 | 37 | protected: 38 | void ParseKeyEvent(); 39 | 40 | public: 41 | CSelectCharaScreen(void); 42 | virtual ~CSelectCharaScreen(void); 43 | }; 44 | 45 | } -------------------------------------------------------------------------------- /Game/SelectReplayScreen/SelectReplayScreen.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../scheme.h" 3 | #include "../../gameLib/Graphic/2DImageArray.h" 4 | #include "../Replay.h" 5 | 6 | #define SELECTREPLAYSCREEN_END_SELECTED_REPLAY 1 7 | #define SELECTREPLAYSCREEN_END_BACK 2 8 | #define SELECTREPLAYSCREEN_END_SAVE_REPLAY_END 3 9 | #define SELECTREPLAYSCREEN_END_SAVE_REPLAY_SKIPPED 4 10 | 11 | namespace th5w{ 12 | 13 | class CSelectReplayScreen : public CScheme 14 | { 15 | protected: 16 | bool m_bLoadMode; 17 | int m_curFrame; 18 | unsigned short m_lastKeyState,m_curKeyState; 19 | 20 | protected: 21 | int m_nFilePerPage; 22 | int m_nPage; 23 | int m_curPage; 24 | int m_curCursorPos; 25 | int m_curCursorColPos; 26 | int m_listUpperLeftX; 27 | int m_listUpperLeftY; 28 | bool m_bCurPageRepFileExist[50]; 29 | REPLAY_BRIEF_INFO m_repInfo[50]; 30 | 31 | th5w::C2DImageArray m_shineArray; 32 | C2DImage *m_pBGImage; 33 | 34 | bool m_bEnterNameMode; 35 | int m_curCharX; 36 | int m_curCharY; 37 | int m_nameCursorPos; 38 | int m_selectedSlot; 39 | int m_curRowY; 40 | char m_curEnterName[10]; 41 | 42 | int m_curScrFade; 43 | bool m_bQuit; 44 | int m_quitCode; 45 | 46 | protected: 47 | void SwitchPage(int pageIdx); 48 | void StepEnterNameMode(); 49 | void DrawEnterNameMode(); 50 | 51 | public: 52 | void Initialize(bool bLoadMode,bool bSwitchMusic); 53 | int Step(); 54 | void Draw(); 55 | 56 | public: 57 | CSelectReplayScreen(void); 58 | ~CSelectReplayScreen(void); 59 | }; 60 | 61 | } 62 | -------------------------------------------------------------------------------- /Game/Stage/Background/Background.cpp: -------------------------------------------------------------------------------- 1 | #include ".\background.h" 2 | #include "../Stage.h" 3 | #include "../../Game.h" 4 | 5 | namespace th5w{ 6 | 7 | CBackground::CBackground(CStage *pStage) 8 | { 9 | m_mapTileIdxArray=NULL; 10 | m_pStage=pStage; 11 | Initialize(); 12 | } 13 | 14 | CBackground::~CBackground(void) 15 | { 16 | if (m_mapTileIdxArray) 17 | delete m_mapTileIdxArray; 18 | m_mapTileIdxArray=NULL; 19 | } 20 | 21 | void CBackground::Initialize() 22 | { 23 | if (m_pStage->m_pStageRes->m_stageMap!=NULL) 24 | { 25 | int nBlock=m_pStage->m_pStageRes->m_pStageStd->m_nBGBlockIdx; 26 | m_mapTileIdxArray=new unsigned char[nBlock*5*24]; 27 | for (int i=0;im_pStageRes->m_pStageStd->m_pBGBlockIdxArray[i]/2; 30 | unsigned char *ptr=m_pStage->m_pStageRes->m_stageMap+blockIdx*320; 31 | for (int j=0;j<5;j++) 32 | { 33 | for (int k=0;k<24;k++) 34 | { 35 | int v=ptr[k*2]+ptr[k*2+1]*256; 36 | int x=(v%80*8-576)/16; 37 | int y=(v/80)/16; 38 | int patternIdx=x*25+y; 39 | m_mapTileIdxArray[i*120+(4-j)*24+k]=patternIdx; 40 | } 41 | ptr+=64; 42 | } 43 | } 44 | } 45 | m_curPos=0; 46 | m_curSpeed=m_pStage->m_pStageRes->m_pStageStd->m_pBGScrollSpeedArray[4]; 47 | m_curDeltaPixel=0; 48 | m_bDraw=true; 49 | m_bForceDraw=false; 50 | } 51 | 52 | void CBackground::Step() 53 | { 54 | int nextPos=m_curPos+m_curSpeed; 55 | if ((nextPos+1279)/1280>(m_curPos+1279)/1280) 56 | m_curSpeed=m_pStage->m_pStageRes->m_pStageStd->m_pBGScrollSpeedArray[(nextPos+1279)/1280+4]; 57 | m_curDeltaPixel=nextPos/16-m_curPos/16; 58 | m_curPos=nextPos; 59 | } 60 | 61 | void CBackground::Draw() 62 | { 63 | if (m_bDraw==false) 64 | return; 65 | 66 | if (CGame::GVar().m_playStage==5) 67 | { 68 | C2DImage *pImage=m_pStage->m_pStageRes->m_spriteArray.GetImagePtr(16); 69 | m_pStage->m_pStageRes->ClearPlayArea(0,0,0); 70 | pImage->Draw((float)32-32+m_pStage->m_playAreaUpperLeftX,(float)120-16+m_pStage->m_playAreaUpperLeftY); 71 | return; 72 | } 73 | glEnable(GL_TEXTURE_2D); 74 | glMatrixMode(GL_PROJECTION); 75 | glPushMatrix(); 76 | glLoadIdentity(); 77 | gluOrtho2D(0,CGame::s_pCurGame->m_windowWidth, 78 | 0,CGame::s_pCurGame->m_windowHeight); 79 | glMatrixMode(GL_MODELVIEW); 80 | glPushMatrix(); 81 | glLoadIdentity(); 82 | 83 | glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_REPLACE); 84 | 85 | glDisable(GL_DEPTH_TEST); 86 | glDisable(GL_BLEND); 87 | 88 | unsigned char *ptr=m_mapTileIdxArray; 89 | int yOff=0; 90 | if (m_bForceDraw==false) 91 | { 92 | ptr+=m_curPos/256*24; 93 | yOff=m_curPos%256/16; 94 | } 95 | for (int i=0;i<25;i++) 96 | for (int j=0;j<24;j++) 97 | { 98 | GLuint texID=m_pStage->m_pStageRes->m_mpnArray.GetImagePtr(*ptr)->GetTexID(); 99 | float drawX=(float)m_pStage->m_playAreaUpperLeftX+j*16; 100 | float drawY=(float)m_pStage->m_playAreaUpperLeftY-16+(24-i)*16+yOff; 101 | drawY=CGame::s_pCurGame->m_gameWindow.m_height-1-drawY-(16-1); 102 | glBindTexture(GL_TEXTURE_2D,texID); 103 | glBegin(GL_QUADS); 104 | glTexCoord2d(0,0); 105 | glVertex2f(drawX,drawY); 106 | glTexCoord2d(1,0); 107 | glVertex2f(drawX+16,drawY); 108 | glTexCoord2d(1,1); 109 | glVertex2f(drawX+16,drawY+16); 110 | glTexCoord2d(0,1); 111 | glVertex2f(drawX,drawY+16); 112 | glEnd(); 113 | 114 | ptr++; 115 | } 116 | glPopMatrix(); 117 | glMatrixMode(GL_PROJECTION); 118 | glPopMatrix(); 119 | } 120 | 121 | } 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /Game/Stage/Background/Background.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace th5w{ 4 | 5 | class CStage; 6 | 7 | class CBackground 8 | { 9 | friend class CStage; 10 | 11 | protected: 12 | CStage *m_pStage; 13 | 14 | protected: 15 | unsigned char *m_mapTileIdxArray; 16 | int m_curPos; 17 | int m_curSpeed; 18 | int m_curDeltaPixel; 19 | bool m_bDraw; 20 | bool m_bForceDraw; 21 | public: 22 | __forceinline int GetLastScrollDeltaPixel() {return m_curDeltaPixel;} 23 | __forceinline int GetCurScrollSpeed() {return m_curSpeed;} 24 | __forceinline void SetDraw(bool enable) {m_bDraw=enable;} 25 | __forceinline void ForceDrawFirstScreen(bool enable) {m_bForceDraw=enable;} 26 | public: 27 | void Initialize(); 28 | void Step(); 29 | void Draw(); 30 | public: 31 | CBackground(CStage *pStage); 32 | ~CBackground(void); 33 | }; 34 | 35 | } -------------------------------------------------------------------------------- /Game/Stage/Boss/Boss.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../EnemyBullet/EnemyBullet.h" 3 | #include "../Item/Item.h" 4 | #include "../SparkEffect/SparkEffect.h" 5 | #include "../GatherEffect/GatherEffect.h" 6 | #include "../Chara/Chara.h" 7 | #include "../PopupNumber/PopupNumber.h" 8 | #include "../Enemy/Enemy.h" 9 | #include "../Dialogue/Dialogue.h" 10 | #include "../Summary/Summary.h" 11 | #include "../TextOverlay/TextOverlay.h" 12 | #include "../Laser/Laser.h" 13 | #include "../Background/Background.h" 14 | #include "../Circle/Circle.h" 15 | 16 | namespace th5w{ 17 | 18 | #define EXPLODE_EFFECT_N_RECORD 2 19 | 20 | typedef struct strEXPLODE_EFFECT{ 21 | unsigned char flag; 22 | unsigned char age; 23 | float ctrX,ctrY; 24 | float xLen,yLen; 25 | float deltaXLen,deltaYLen; 26 | float angleOffset; 27 | }EXPLODE_EFFECT; 28 | 29 | class CStage; 30 | 31 | class CBoss 32 | { 33 | friend class CStage; 34 | 35 | protected: 36 | CStage *m_pStage; 37 | 38 | protected: 39 | EXPLODE_EFFECT m_explodeEffect[EXPLODE_EFFECT_N_RECORD]; 40 | 41 | protected: 42 | int m_curPhase; 43 | int m_curPhaseFrame; 44 | int m_curHP; 45 | int m_curPhaseEndHP; 46 | int m_curImage; 47 | float m_curX,m_curY; 48 | float m_lastX,m_lastY; 49 | float m_velX,m_velY; 50 | float m_bossDmgAreaHalfWidth; 51 | float m_bossDmgAreaHalfHeight; 52 | int m_imgStay; 53 | int m_imgGoLeft; 54 | int m_imgGoRight; 55 | 56 | bool m_bHitThisFrame; 57 | int m_HPLostThisFrame; 58 | 59 | float m_deathExplodeCenterX,m_deathExplodeCenterY; 60 | 61 | protected: 62 | bool m_bTimeoutPhaseEnd; 63 | int m_curMode; 64 | int m_nModeChange; 65 | 66 | public: 67 | bool m_bSuccessDefeat; 68 | 69 | protected: 70 | int m_lastDrawnHP; 71 | void StepHPGauge(int curHP,int fullHP); 72 | void DrawHPGaugeAndExtStrEnemy(int fullHP); 73 | void GetDmgOffAndCrashChara(); 74 | int GetDmgOnAndCrashChara(); 75 | int GetDmgAndTestCrash(float dmgAreaHalfWidth,float dmgAreaHalfHeight,int soundIdx); 76 | void AddDefeatScoreAndPopupNumbers(int n1000); 77 | void EndPhase(int nextPhaseEndHP,int explodeEffectIdx); 78 | void DropItem(); 79 | void AddExplodeEffect(int explodeEffectIdx,float x,float y); 80 | void StepExplodeEffect(); 81 | void DrawExplodeEffect(); 82 | void DeathSequence(int n1000); 83 | 84 | protected: 85 | float m_xLowerBound; 86 | float m_xUpperBound; 87 | float m_yLowerBound; 88 | float m_yUpperBound; 89 | float m_randomWalkMovingAngle; 90 | int m_forceGoUpOrDown; //1 up, 2 down, 0 don't care 91 | int RandomWalk(int frameIdx); 92 | int MoveTo(float tarX,float tarY); 93 | 94 | protected: 95 | bool m_bDrawBoss; 96 | public: 97 | virtual void Initialize(); 98 | virtual void Step()=0; 99 | void Draw(); 100 | virtual void DrawSpecialBullet(); 101 | virtual void DrawBoss()=0; 102 | virtual void DrawStatistics()=0; 103 | virtual void DrawBackground()=0; 104 | public: 105 | __forceinline int GetCurPhase(){return m_curPhase;} 106 | __forceinline int GetCurPhaseFrame(){return m_curPhaseFrame;} 107 | 108 | public: 109 | CBoss(void); 110 | virtual ~CBoss(void); 111 | }; 112 | 113 | } 114 | -------------------------------------------------------------------------------- /Game/Stage/Boss/BossStage1.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "boss.h" 3 | 4 | namespace th5w{ 5 | 6 | class CBossStage1 : public CBoss 7 | { 8 | protected: 9 | int m_phase2NFrameBeforeRandomWalk; 10 | int m_phase3ShootNFrame; 11 | int m_lastMode; 12 | 13 | protected: 14 | void Phase0(); 15 | void Phase1(); 16 | void Phase2(); 17 | void Phase2Shoot(); 18 | void Phase2ShootType1(); 19 | void Phase2ShootType2(); 20 | void Phase2ShootType3(); 21 | void Phase2ShootType4(); 22 | void Phase3(); 23 | void Phase3Shoot(); 24 | void Phase3ShootType1(); 25 | void Phase3ShootType2(); 26 | void Phase3ShootType3(); 27 | void Phase3ShootType4(); 28 | void Phase4(); 29 | void Phase4Shoot(); 30 | 31 | public: 32 | virtual void Initialize(); 33 | virtual void Step(); 34 | virtual void DrawBoss(); 35 | virtual void DrawStatistics(); 36 | virtual void DrawBackground(); 37 | 38 | public: 39 | CBossStage1(void); 40 | virtual ~CBossStage1(void); 41 | }; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Game/Stage/Boss/BossStage2.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "boss.h" 3 | 4 | namespace th5w{ 5 | 6 | class CBossStage2 : public CBoss 7 | { 8 | protected: 9 | bool m_bPhase5LaserRotationClockwise; 10 | 11 | protected: 12 | void Phase0(); 13 | void Phase1(); 14 | void Phase2(); 15 | void Phase2ShootType1(); 16 | void Phase2ShootType2(); 17 | void Phase3(); 18 | void Phase4(); 19 | void Phase4Shoot(); 20 | void Phase5(); 21 | void Phase5ShootType1(); 22 | void Phase5ShootType2(); 23 | void Phase6(); 24 | void Phase7(); 25 | void Phase7Shoot(); 26 | 27 | int ShootAnimation(int endFrame); 28 | int BounceWalk(int nFrame,float speed); 29 | 30 | public: 31 | virtual void Initialize(); 32 | virtual void Step(); 33 | virtual void DrawBoss(); 34 | virtual void DrawStatistics(); 35 | virtual void DrawBackground(); 36 | 37 | public: 38 | CBossStage2(void); 39 | virtual ~CBossStage2(void); 40 | }; 41 | 42 | } -------------------------------------------------------------------------------- /Game/Stage/Boss/BossStage3.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "boss.h" 3 | 4 | namespace th5w{ 5 | 6 | typedef struct strPUPPET{ 7 | unsigned char flag; 8 | float angle; 9 | float curX,curY; 10 | float tarX,tarY; 11 | float velX,velY; 12 | int shootAge; 13 | float radius; 14 | int image; 15 | int life; 16 | bool bHitThisFrame; 17 | int mode; 18 | }PUPPET; 19 | 20 | class CBossStage3 : public CBoss 21 | { 22 | protected: 23 | int m_shieldState; 24 | int m_shieldImg; 25 | int m_shieldFrame; 26 | PUPPET m_puppet[2]; 27 | 28 | protected: 29 | void PuppetFlyIn(); 30 | int PuppetNoShoot(int idx); 31 | int PuppetPrepareEnter(int idx); 32 | int PuppetShootType0(int idx); 33 | int PuppetShootType1(int idx); 34 | int PuppetShootType2(int idx); 35 | int PuppetShootType3(int idx); 36 | int PuppetShootPhase14(int idx); 37 | protected: 38 | void Phase0(); 39 | void Phase1(); 40 | void Phase2(); 41 | void Phase2Shoot(); 42 | void Phase3_6_9_12(); 43 | void Phase3_6_9_12Shoot(); 44 | void Phase3ShootType1(); 45 | void Phase3ShootType2_6_1(); 46 | void Phase3ShootType3_6_2__9_1(); 47 | void Phase6ShootType3_9_3__12_2(); 48 | void Phase9ShootType2_12_1(); 49 | void Phase12ShootType3(); 50 | void Phase4_7_10(); 51 | void Phase5_8_11(); 52 | void Phase13(); 53 | void Phase14(); 54 | void Phase14Shoot(); 55 | 56 | protected: 57 | void StepPuppet(); 58 | void StepShieldAndShoot(); 59 | void DrawPuppet(); 60 | void DrawShield(); 61 | public: 62 | virtual void Initialize(); 63 | virtual void Step(); 64 | virtual void DrawBoss(); 65 | virtual void DrawStatistics(); 66 | virtual void DrawBackground(); 67 | 68 | public: 69 | CBossStage3(void); 70 | virtual ~CBossStage3(void); 71 | }; 72 | 73 | } -------------------------------------------------------------------------------- /Game/Stage/Boss/BossStage4.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "boss.h" 3 | #include "../SpecialBullet/CurvingBullet.h" 4 | 5 | namespace th5w{ 6 | 7 | class CBossStage4 : public CBoss 8 | { 9 | protected: 10 | float m_2curX,m_2curY; 11 | float m_2lastX,m_2lastY; 12 | float m_2velX,m_2velY; 13 | int m_2curHP; 14 | int m_2curPhaseEndHP; 15 | int m_2curImage; 16 | bool m_b2HitThisFrame; 17 | int m_2curMode; 18 | int m_whichDie; 19 | 20 | bool m_bDrawCurvingBullet; 21 | CCurvingBullet m_curvingBullet; 22 | 23 | float m_phase2MaiShootType2_3__2_4_baseAngle; 24 | float m_phase2MaiShootType2_3__2_4_deltaAngle; 25 | float m_phase2YukiShootType2_2__2_3_baseAngle; 26 | float m_phase2YukiShootType2_2__2_3_deltaAngle; 27 | 28 | protected: 29 | void Phase0(); 30 | void Phase1(); 31 | void Phase2(); 32 | void Phase2ShootMai(); 33 | void Phase2ShootYuki(); 34 | 35 | int MaiShootType0_1(); 36 | int MaiShootType0_2__2_2(); 37 | int MaiShootType0_3(); 38 | int MaiShootType0_4(); 39 | int MaiShootType1(); 40 | int MaiShootType2_1(); 41 | int MaiShootType2_3__2_4(); 42 | 43 | int YukiShootType0_1__1_4(); 44 | int YukiShootType0_2__2_4(); 45 | int YukiShootType0_3__1_1(); 46 | int YukiShootType0_4(); 47 | int YukiShootType1_2(); 48 | int YukiShootType1_3(); 49 | int YukiShootType2_1(); 50 | int YukiShootType2_2__2_3(); 51 | 52 | protected: 53 | void GetDmgOffAndCrashChara2(); 54 | int GetDmgOnAndCrashChara2(); 55 | int GetDmgAndTestCrash2(float dmgAreaHalfWidth,float dmgAreaHalfHeight,int soundIdx); 56 | void DrawBossImage(int imgIdx,float x,float y,bool bHit); 57 | 58 | float m_2randomWalkMovingAngle; 59 | int m_2forceGoUpOrDown; //1 up, 2 down, 0 don't care 60 | int Move(int frameIdx); 61 | int RandomWalkVerStage4(int frameIdx,float &angle,int &forceMove,float &x,float &y,float &vx,float &vy,int &img); 62 | void DeathSequenceVerStage4(); 63 | public: 64 | virtual void Initialize(); 65 | virtual void Step(); 66 | virtual void DrawBoss(); 67 | virtual void DrawStatistics(); 68 | virtual void DrawBackground(); 69 | virtual void DrawSpecialBullet(); 70 | 71 | public: 72 | CBossStage4(void); 73 | virtual ~CBossStage4(void); 74 | }; 75 | 76 | } 77 | -------------------------------------------------------------------------------- /Game/Stage/Boss/BossStage4Mai.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "boss.h" 3 | #include "../SpecialBullet/LargeBullet.h" 4 | 5 | namespace th5w{ 6 | 7 | class CBossStage4Mai : public CBoss 8 | { 9 | friend class CStage; 10 | friend class CBossStage4; 11 | 12 | protected: 13 | __forceinline void SetX(float v) {m_curX=v;} 14 | __forceinline void SetY(float v) {m_curY=v;} 15 | __forceinline void SetStage(CStage *p) {m_pStage=p;} 16 | 17 | protected: 18 | bool m_bDrawLargeBullet; 19 | float m_phase5LaserAngleSpeed; 20 | float m_phase5LaserRotationDir; 21 | CLargeBullet m_largeBullet; 22 | 23 | protected: 24 | void Phase0(); 25 | void Phase1(); 26 | void Phase2(); 27 | void Phase3(); 28 | void Phase3ShootType1(); 29 | void Phase3ShootType2(); 30 | void Phase4(); 31 | void Phase5(); 32 | void Phase5Shoot(); 33 | void Phase5ShootType1(); 34 | void Phase5ShootType2(); 35 | void Phase5ShootType3(); 36 | void Phase6(); 37 | void Phase7(); 38 | void Phase7ShootType1(); 39 | void Phase7ShootType2(); 40 | void Phase8(); 41 | void Phase9(); 42 | void Phase9ShootType1(); 43 | void Phase9ShootType2(); 44 | public: 45 | virtual void Initialize(); 46 | virtual void Step(); 47 | virtual void DrawBoss(); 48 | virtual void DrawStatistics(); 49 | virtual void DrawBackground(); 50 | virtual void DrawSpecialBullet(); 51 | 52 | public: 53 | CBossStage4Mai(void); 54 | virtual ~CBossStage4Mai(void); 55 | }; 56 | 57 | } 58 | -------------------------------------------------------------------------------- /Game/Stage/Boss/BossStage4Yuki.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "boss.h" 3 | #include "../SpecialBullet/LargeBullet.h" 4 | 5 | namespace th5w{ 6 | 7 | class CBossStage4Yuki : public CBoss 8 | { 9 | friend class CStage; 10 | friend class CBossStage4; 11 | 12 | protected: 13 | __forceinline void SetX(float v) {m_curX=v;} 14 | __forceinline void SetY(float v) {m_curY=v;} 15 | __forceinline void SetStage(CStage *p) {m_pStage=p;} 16 | 17 | protected: 18 | bool m_bDrawLargeBullet; 19 | CLargeBullet m_largeBullet; 20 | float m_moveTarX,m_moveTarY; 21 | 22 | float m_phase3ShootType1Angle; 23 | float m_phase3ShootType1DeltaAngle; 24 | 25 | float m_phase9ShootType1Angle; 26 | 27 | protected: 28 | void Phase0(); 29 | void Phase1(); 30 | void Phase2(); 31 | void Phase3(); 32 | void Phase3ShootType1(); 33 | void Phase3ShootType2(); 34 | void Phase4(); 35 | void Phase5(); 36 | void Phase5ShootType1(); 37 | void Phase5ShootType2(); 38 | void Phase6(); 39 | void Phase7(); 40 | void Phase7Shoot(); 41 | void Phase8(); 42 | void Phase9(); 43 | void Phase9ShootType1(); 44 | void Phase9ShootType2(); 45 | 46 | public: 47 | virtual void Initialize(); 48 | virtual void Step(); 49 | virtual void DrawBoss(); 50 | virtual void DrawStatistics(); 51 | virtual void DrawBackground(); 52 | virtual void DrawSpecialBullet(); 53 | 54 | public: 55 | CBossStage4Yuki(void); 56 | virtual ~CBossStage4Yuki(void); 57 | }; 58 | 59 | } 60 | -------------------------------------------------------------------------------- /Game/Stage/Boss/BossStage5.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "boss.h" 3 | #include "../SpecialBullet/KnifeBullet.h" 4 | 5 | namespace th5w{ 6 | 7 | class CBossStage5 : public CBoss 8 | { 9 | protected: 10 | bool m_bDrawKnives; 11 | CKnifeBullet m_knifeBullet; 12 | 13 | protected: 14 | float m_shinkiX,m_shinkiY; 15 | 16 | protected: 17 | bool m_bPhase2KnifeClockwise; 18 | int m_phase4ShootEnd; 19 | int m_phase4ShootKnifeInterval; 20 | bool m_phase4CrazyMode; 21 | float m_phase4ShootAngle[2]; 22 | int m_phase7ShootEnd; 23 | int m_phase7ShootKnifeInterval; 24 | bool m_phase7CrazyMode; 25 | float m_phase7ShootAngle[2]; 26 | float m_phase8KnifeY; 27 | bool m_phase8KnifeLeft; 28 | bool m_phase8KnifePart; 29 | int m_phase8ShootPartNReset; 30 | float m_phase8ShootPartSpeed; 31 | float m_phase8ShootPartAngle; 32 | 33 | protected: 34 | int RandomWalkVerStage5(int nFrame,float speed); 35 | protected: 36 | void Phase0(); 37 | void Phase1(); 38 | void Phase2_5(); 39 | void Phase2ShootType1(); 40 | void Phase2ShootType2(); 41 | void Phase5ShootType1(); 42 | void Phase5ShootType2(); 43 | void Phase3_6(); 44 | void Phase4_7(); 45 | void Phase4Shoot(); 46 | void Phase7Shoot(); 47 | void Phase8(); 48 | void Phase8Shoot(); 49 | void Phase9(); 50 | void Phase10(); 51 | void Phase10Shoot(); 52 | 53 | public: 54 | virtual void Initialize(); 55 | virtual void Step(); 56 | virtual void DrawBoss(); 57 | virtual void DrawStatistics(); 58 | virtual void DrawBackground(); 59 | virtual void DrawSpecialBullet(); 60 | 61 | public: 62 | CBossStage5(void); 63 | virtual ~CBossStage5(void); 64 | }; 65 | 66 | } 67 | -------------------------------------------------------------------------------- /Game/Stage/Boss/BossStage6.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "boss.h" 3 | #include "../SpecialBullet/CurvingBullet.h" 4 | #include "../SpecialBullet/ShinkiBullet.h" 5 | 6 | namespace th5w{ 7 | 8 | typedef struct strLINE_SET{ 9 | float ctrX[20],ctrY[20]; 10 | float halfLen[20]; 11 | float angle[20]; 12 | float customVar; 13 | }LINE_SET; 14 | 15 | typedef struct strBG_PARTICLE{ 16 | bool bFlag; 17 | float curX,curY; 18 | float origX,origY; 19 | float velX,velY; 20 | int age; 21 | float angle; 22 | int imgIdx; 23 | }BG_PARTICLE; 24 | 25 | class CBossStage6 : public CBoss 26 | { 27 | protected: 28 | unsigned char m_bgColor[3]; 29 | LINE_SET m_lineSet[2]; 30 | BG_PARTICLE m_bgParticle[64]; 31 | int m_bgTypeATimer; 32 | int m_bgTypeARotateCounter; 33 | float m_bgParticleColor[3]; 34 | int m_bgTypeBTimer; 35 | int m_bgTypeBCFrame; 36 | int m_bgTypeCTimer; 37 | int m_bgTypeDTimer; 38 | 39 | void StepBackground(); 40 | void StepBGParticles(); 41 | void StepBGTypeA(); 42 | void StepBGTypeB(); 43 | void StepBGTypeC(); 44 | void StepBGTypeD(); 45 | void BGLineForwardCopy(); 46 | 47 | void DrawBGParticles(); 48 | void DrawLineSetMember(int setIdx,int memberIdx,unsigned char colorIdx); 49 | void DrawBGTypeA(); 50 | void DrawBGTypeB(); 51 | void DrawBGTypeC(); 52 | void DrawBGTypeD(); 53 | 54 | protected: 55 | float m_phase2Type1DeltaAngle; 56 | float m_phase2Type1Angle; 57 | float m_phase2Type2Angle; 58 | int m_phase5ScrScale; 59 | int m_phase5Timer; 60 | int m_phase10Timer; 61 | int m_phase10Var0; 62 | int m_phase10Var1; 63 | int m_phase10Var2; 64 | int m_phase10Var3; 65 | int m_phase10Var4; 66 | int m_phase10Var5; 67 | int m_phase10VarI; 68 | int m_phase10VarS; 69 | int m_phase10VarD; 70 | 71 | protected: 72 | void Phase0(); 73 | void Phase1(); 74 | void Phase2_3(); 75 | void Phase2_3Shoot(); 76 | int Phase2ShootType1(); 77 | int Phase2ShootType2(); 78 | int Phase3ShootType1(); 79 | int Phase3ShootType2(); 80 | void Phase4(); 81 | void Phase5(); 82 | int Phase5Effect(); 83 | void Phase6_7(); 84 | void Phase6Shoot(); 85 | void Phase7Shoot(); 86 | void Phase8(); 87 | int Phase8Effect(); 88 | void Phase9_10(); 89 | void Phase9Shoot(); 90 | void Phase10Shoot(); 91 | void Phase11(); 92 | void Phase12(); 93 | void Phase12Shoot(); 94 | 95 | protected: 96 | bool m_bFloatingUp; 97 | void FloatMove(); 98 | 99 | public: 100 | virtual void Initialize(); 101 | virtual void Step(); 102 | virtual void DrawBoss(); 103 | virtual void DrawStatistics(); 104 | virtual void DrawBackground(); 105 | virtual void DrawSpecialBullet(); 106 | protected: 107 | bool m_bDrawSpecialBullet; 108 | CCurvingBullet m_curvingBullet; 109 | CShinkiBullet m_shinkiBullet; 110 | 111 | public: 112 | CBossStage6(void); 113 | virtual ~CBossStage6(void); 114 | }; 115 | 116 | } 117 | -------------------------------------------------------------------------------- /Game/Stage/Boss/BossStageEx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "boss.h" 3 | #include "../SpecialBullet/CurvingBullet.h" 4 | 5 | namespace th5w{ 6 | 7 | typedef struct strLINE_SEQ{ 8 | float halfLen[19]; 9 | float angle[19]; 10 | }LINE_SEQ; 11 | 12 | class CBossStageEx : public CBoss 13 | { 14 | protected: 15 | int m_invulnerableTimeLeft; 16 | int m_curOuterImg; 17 | 18 | protected: 19 | unsigned char m_bgColor[3]; 20 | int m_bgTimer; 21 | LINE_SEQ m_lineSeq; 22 | 23 | protected: 24 | float m_phase2Type2Angle; 25 | float m_phase4Angle; 26 | bool m_bPhase4AngleInc; 27 | float m_phase4AimX,m_phase4AimY,m_phase4AimAngle; 28 | float m_phase6Type2Angle; 29 | bool m_bPhase6Type2AngleInc; 30 | float m_phase8Angle; 31 | float m_phase12LaserAngle; 32 | bool m_bPhase12LaserAngleInc; 33 | float m_phase16ShootOrigX; 34 | int m_phase16Var3; 35 | int m_phase16Var4; 36 | int m_phase16Var5; 37 | float m_phase16ShootAngle; 38 | int m_phase17ColorChangeMode; 39 | float m_phase17ShootAngle; 40 | 41 | protected: 42 | bool m_bFireWave[2]; 43 | int m_fireWaveY[2]; 44 | void StepFireWave(); 45 | void DrawFireWave(); 46 | 47 | protected: 48 | int CommonShootOuter(); 49 | void Phase0(); 50 | void Phase1(); 51 | void Phase2(); 52 | int Phase2ShootType1(); 53 | int Phase2ShootType2(); 54 | void Phase3(); 55 | void Phase4(); 56 | int Phase4Shoot(); 57 | void Phase5_6(); 58 | int Phase6ShootType1(); 59 | int Phase6ShootType2(); 60 | void Phase7_11_15(); 61 | void Phase8_12(); 62 | int Phase8Shoot(); 63 | int Phase12Shoot(); 64 | void Phase9_10(); 65 | int Phase10ShootType1(); 66 | int Phase10ShootType2(); 67 | void Phase13_14(); 68 | int Phase14ShootType1(); 69 | int Phase14ShootType2(); 70 | void Phase16(); 71 | int Phase16Shoot(); 72 | void Phase17(); 73 | void Phase17Shoot(); 74 | 75 | protected: 76 | void StepBackground(); 77 | void DrawSet(float radius,float angle,unsigned char colorIdx); 78 | 79 | int GetDmgVerStageEx(); 80 | void EndPhaseVerStageEx(int nextPhaseEndHP,int explodeEffectIdx); 81 | 82 | public: 83 | virtual void Initialize(); 84 | virtual void Step(); 85 | virtual void DrawBoss(); 86 | virtual void DrawStatistics(); 87 | virtual void DrawBackground(); 88 | virtual void DrawSpecialBullet(); 89 | protected: 90 | bool m_bDrawSpecialBullet; 91 | CCurvingBullet m_curvingBullet; 92 | 93 | public: 94 | CBossStageEx(void); 95 | virtual ~CBossStageEx(void); 96 | }; 97 | 98 | } 99 | -------------------------------------------------------------------------------- /Game/Stage/Chara/Chara.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../../gameLib/Graphic/2DImageArray.h" 3 | #include 4 | #ifndef PI 5 | #define PI 3.1415926535897932384626433832795 6 | #endif 7 | 8 | namespace th5w{ 9 | 10 | class CStage; 11 | class CCharaBullet; 12 | 13 | class CChara 14 | { 15 | friend class CStage; 16 | 17 | protected: 18 | float m_curX,m_curY; 19 | float m_lastX,m_lastY; 20 | float m_deltaX,m_deltaY; 21 | public: 22 | __forceinline float GetCurX() {return m_curX;} 23 | __forceinline float GetCurY() {return m_curY;} 24 | 25 | //params that must be initialized by child class constructor 26 | protected: 27 | float m_moveSpeed,m_moveSpeedDiagonal; 28 | int m_bombInvulnerableTime; 29 | int m_bombClearEnemyBulletTime; 30 | 31 | //params that must be initialized by the instance creator which new the instance 32 | protected: 33 | float m_moveAreaXLow,m_moveAreaXHigh,m_moveAreaYLow,m_moveAreaYHigh; 34 | protected: 35 | CStage *m_pStage; 36 | 37 | protected: 38 | int m_power; 39 | int m_powerLevel; 40 | public: 41 | void SetPower(int newPower); 42 | __forceinline int GetPower() {return m_power;} 43 | 44 | public: 45 | bool m_bCharaCanMove; 46 | bool m_bCharaCanShoot; 47 | bool m_bBombDisabled; 48 | bool m_bMiss; 49 | protected: 50 | int m_nextLifeComeTimeLeft; 51 | public: 52 | __forceinline int GetNextLifeComeTimeLeft() {return m_nextLifeComeTimeLeft;} 53 | protected: 54 | int m_cannotControlTimeLeft; 55 | float m_missExplodeRadius; 56 | float m_missExplodeBaseAngle; 57 | public: 58 | int m_invulnerableTimeLeft; 59 | 60 | protected: 61 | int m_bombTimer; 62 | 63 | unsigned int m_charaShootTimer; 64 | 65 | protected: 66 | int m_getPointItemPerformance; 67 | 68 | protected: 69 | C2DImage* GetStageSprite(int spriteIdx); 70 | C2DImage* GetStagePattern(int patternIdx); 71 | CCharaBullet* GetCharaBullet(); 72 | 73 | protected: 74 | void MoveChara(unsigned short keyState); 75 | void DropBomb(); 76 | void DecreaseDreamInBomb(); 77 | void OnMissDropItem(); 78 | 79 | bool m_bDraw; 80 | __forceinline void DisableDraw() {m_bDraw=false;} 81 | __forceinline void EnableDraw() {m_bDraw=true;} 82 | 83 | protected: 84 | int m_collisionAreaAlpha; 85 | void DrawCollisionArea(); 86 | 87 | public: 88 | virtual void Step(); 89 | virtual void Draw(); 90 | virtual void StepBomb(); 91 | virtual void DrawBomb(); 92 | virtual int GetBombDamage(float ctrX,float ctrY,float halfWidth,float halfHeight,bool isBoss); 93 | virtual bool TestCrash(float testX,float testY, float testHalfWidth,float testHalfHeight); 94 | __forceinline float AngleToChara(float srcX,float srcY) 95 | { 96 | return (float)(atan2(m_curY-srcY,m_curX-srcX)/2.0/PI*256); 97 | } 98 | void CaughtItem(float itemX,float itemY,unsigned char itemType); 99 | protected: 100 | virtual void ShootBullet(); 101 | void ShootPowerLevel0Common(); 102 | void ShootPowerLevel1Common(); 103 | 104 | protected: 105 | CChara(void); 106 | virtual ~CChara(void); 107 | }; 108 | 109 | } 110 | -------------------------------------------------------------------------------- /Game/Stage/Chara/CharaMarisa.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "chara.h" 3 | #define MARISA_BOMB_ANI_N_RECORD 8 4 | 5 | namespace th5w{ 6 | typedef struct strMARISA_BOMB_ANI{ 7 | float x,y; 8 | float width; 9 | }MARISA_BOMB_ANI; 10 | 11 | class CCharaMarisa : public CChara 12 | { 13 | protected: 14 | MARISA_BOMB_ANI m_bombAni[MARISA_BOMB_ANI_N_RECORD]; 15 | protected: 16 | virtual void ShootBullet(); 17 | virtual void StepBomb(); 18 | virtual void DrawBomb(); 19 | virtual int GetBombDamage(float ctrX,float ctrY,float halfWidth,float halfHeight,bool isBoss); 20 | public: 21 | CCharaMarisa(void); 22 | virtual ~CCharaMarisa(void); 23 | }; 24 | 25 | } -------------------------------------------------------------------------------- /Game/Stage/Chara/CharaMima.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "chara.h" 3 | #define MIMA_BOMB_ANI_N_RECORD 8 4 | 5 | namespace th5w{ 6 | 7 | //in PC98 ver, there're x and y fields but they are never used, except x is for flag of used. 8 | //hence, they are removed here, and radius is used for flag of used instead 9 | typedef struct strMIMA_BOMB_ANI{ 10 | float radius,angle; 11 | }MIMA_BOMB_ANI; 12 | 13 | class CCharaMima : public CChara 14 | { 15 | protected: 16 | MIMA_BOMB_ANI m_bombAni[MIMA_BOMB_ANI_N_RECORD]; 17 | protected: 18 | virtual void ShootBullet(); 19 | virtual void StepBomb(); 20 | virtual void DrawBomb(); 21 | virtual int GetBombDamage(float ctrX,float ctrY,float halfWidth,float halfHeight,bool isBoss); 22 | public: 23 | CCharaMima(void); 24 | virtual ~CCharaMima(void); 25 | }; 26 | 27 | } -------------------------------------------------------------------------------- /Game/Stage/Chara/CharaReimu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "chara.h" 3 | #define REIMU_BOMB_ANI_N_RECORD 6 4 | 5 | namespace th5w{ 6 | 7 | typedef struct strREIMU_BOMB_ANI{ 8 | float x[8],y[8]; 9 | float velX,velY; 10 | }REIMU_BOMB_ANI; 11 | 12 | class CCharaReimu : public CChara 13 | { 14 | protected: 15 | REIMU_BOMB_ANI m_bombAni[REIMU_BOMB_ANI_N_RECORD]; 16 | protected: 17 | virtual void ShootBullet(); 18 | virtual void StepBomb(); 19 | virtual void DrawBomb(); 20 | virtual int GetBombDamage(float ctrX,float ctrY,float halfWidth,float halfHeight,bool isBoss); 21 | public: 22 | CCharaReimu(void); 23 | virtual ~CCharaReimu(void); 24 | }; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /Game/Stage/Chara/CharaYuka.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "chara.h" 3 | 4 | namespace th5w{ 5 | 6 | class CCharaYuka : public CChara 7 | { 8 | protected: 9 | float m_bombAniRadius; 10 | float m_bombAniBaseAngle; 11 | protected: 12 | virtual void ShootBullet(); 13 | virtual void StepBomb(); 14 | virtual void DrawBomb(); 15 | virtual int GetBombDamage(float ctrX,float ctrY,float halfWidth,float halfHeight,bool isBoss); 16 | public: 17 | CCharaYuka(void); 18 | virtual ~CCharaYuka(void); 19 | }; 20 | 21 | } -------------------------------------------------------------------------------- /Game/Stage/CharaBullet/CharaBullet.h: -------------------------------------------------------------------------------- 1 | /* 2 | This class has the function of both hit and normal chara bullets 3 | */ 4 | #pragma once 5 | 6 | namespace th5w{ 7 | 8 | #define CHARA_BULLET_N_RECORD 64 9 | #define HIT_CHARA_BULLET_N_RECORD 24 10 | #define CHARA_BULLET_TYPE_NORMAL 0 11 | #define CHARA_BULLET_TYPE_HOMING 1 12 | #define CHARA_BULLET_TYPE_MISSILE_LEFT 2 13 | #define CHARA_BULLET_TYPE_MISSILE_RIGHT 3 14 | #define CHARA_BULLET_TYPE_MISSILE_STRAIGHT 4 15 | #define ADD_CHARA_BULLET_IGNORE_MOVEANGLE 10000.0f 16 | 17 | typedef struct strCHARA_BULLET{ 18 | unsigned char flag; 19 | unsigned char age; 20 | float curX; 21 | float curY; 22 | float lastX; 23 | float lastY; 24 | float velX; 25 | float velY; 26 | unsigned char imgIdx; 27 | unsigned char bulletType; //0 for normal, 1 for homing, 2 for missileL, 3 for missileR, 4 for missileS 28 | unsigned char damage; 29 | float moveAngle; 30 | }CHARA_BULLET; 31 | 32 | typedef struct strHIT_CHARA_BULLET{ 33 | unsigned char age; 34 | unsigned char imgIdx; 35 | float curX; 36 | float curY; 37 | float lastX; 38 | float lastY; 39 | float velX; 40 | float velY; 41 | }HIT_CHARA_BULLET; 42 | 43 | class CStage; 44 | 45 | class CCharaBullet 46 | { 47 | friend class CStage; 48 | friend class CChara; 49 | friend class CCharaReimu; 50 | friend class CCharaMarisa; 51 | friend class CCharaMima; 52 | friend class CCharaYuka; 53 | 54 | protected: 55 | CStage *m_pStage; 56 | float m_clipXLow,m_clipXHigh,m_clipYLow,m_clipYHigh; 57 | 58 | protected: 59 | CHARA_BULLET m_bullets[CHARA_BULLET_N_RECORD]; 60 | HIT_CHARA_BULLET m_hitBullets[HIT_CHARA_BULLET_N_RECORD]; 61 | public: 62 | void Initialize(); 63 | public: 64 | void AddBullet(float bulletX, float bulletY, unsigned char imgIdx,unsigned char bulletType, 65 | float velX, float velY, float moveAngle,unsigned char damage); 66 | void Step(); 67 | void Draw(); 68 | 69 | public: 70 | int GetDamage(float ctrX,float ctrY,float halfWidth,float halfHeight,bool isBoss,bool bReflectAndAddScore=false); 71 | protected: 72 | void ConvertToHitRecord(int bulletRecordIdx); 73 | 74 | protected: 75 | void StepBullets(); 76 | void StepHitBullets(); 77 | void DrawBullets(); 78 | void DrawHitBullets(); 79 | 80 | public: 81 | CCharaBullet(CStage *pStage); 82 | ~CCharaBullet(void); 83 | }; 84 | 85 | } -------------------------------------------------------------------------------- /Game/Stage/Circle/Circle.cpp: -------------------------------------------------------------------------------- 1 | #include ".\circle.h" 2 | #include "../Stage.h" 3 | #include 4 | #include 5 | #ifndef PI 6 | #define PI 3.1415926535897932384626433832795 7 | #endif 8 | 9 | namespace th5w{ 10 | 11 | CCircle::CCircle(CStage *pStage) 12 | { 13 | m_pStage=pStage; 14 | Initialize(); 15 | } 16 | 17 | CCircle::~CCircle(void) 18 | { 19 | } 20 | 21 | void CCircle::Initialize() 22 | { 23 | memset(m_circle,0,sizeof(m_circle)); 24 | } 25 | 26 | void CCircle::AddCircle(float ctrX,float ctrY,float colorR,float colorG,float colorB,bool bExpanding) 27 | { 28 | for (int i=0;i16) 65 | m_circle[i].flag=2; 66 | } 67 | } 68 | 69 | void CCircle::Draw() 70 | { 71 | for (int i=0;im_pStageRes->DrawCircle(m_circle[i].ctrX,m_circle[i].ctrY,m_circle[i].radius, 74 | m_circle[i].color[0],m_circle[i].color[1],m_circle[i].color[2],false); 75 | } 76 | 77 | } 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /Game/Stage/Circle/Circle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace th5w{ 4 | 5 | #define CIRCLE_N_RECORD 8 6 | 7 | typedef struct strCIRCLE{ 8 | unsigned char flag; 9 | unsigned char age; 10 | float ctrX; 11 | float ctrY; 12 | float radius; 13 | float deltaRadius; 14 | float color[3]; 15 | }CIRCLE; 16 | 17 | class CStage; 18 | 19 | class CCircle 20 | { 21 | friend class CStage; 22 | 23 | protected: 24 | CStage *m_pStage; 25 | 26 | protected: 27 | CIRCLE m_circle[CIRCLE_N_RECORD]; 28 | public: 29 | void Initialize(); 30 | void AddCircle(float ctrX,float ctrY,float colorR,float colorG,float colorB,bool bExpanding); 31 | void Step(); 32 | void Draw(); 33 | 34 | public: 35 | CCircle(CStage *pStage); 36 | ~CCircle(void); 37 | }; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /Game/Stage/Dialogue/Dialogue.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace th5w{ 4 | 5 | class CStage; 6 | 7 | class CDialogue 8 | { 9 | friend class CStage; 10 | 11 | protected: 12 | CStage *m_pStage; 13 | bool m_bTranScript; 14 | unsigned char *m_pTranScript; 15 | 16 | protected: 17 | unsigned char *m_pScript; 18 | bool m_bRunning; 19 | int m_dialogBGFadeTimer; 20 | int m_activeChara; //0 for chara, 1 for boss 21 | int m_face[2]; 22 | unsigned char *m_words[2]; 23 | int m_wordNChar[2]; 24 | int m_curWordTotalChar; 25 | 26 | int m_nBoss; 27 | int m_bossImg[2]; 28 | int m_bossX[2]; 29 | int m_bossY[2]; 30 | 31 | bool m_bFading; 32 | bool m_bFadeToWhite; 33 | bool m_bInstantFade; 34 | 35 | protected: 36 | int StepScript(); 37 | public: 38 | void Initialize(); 39 | int Step(); 40 | void Draw(); 41 | void Run(); 42 | __forceinline void SetDialogueScript(unsigned char *pScript) {m_pScript=pScript;} 43 | __forceinline bool IsRunning() {return m_bRunning;} 44 | 45 | public: 46 | CDialogue(CStage *pStage); 47 | ~CDialogue(void); 48 | }; 49 | 50 | } -------------------------------------------------------------------------------- /Game/Stage/Enemy/Enemy.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../EnemyBullet/EnemyBullet.h" 3 | #include 4 | #ifndef PI 5 | #define PI 3.1415926535897932384626433832795 6 | #endif 7 | 8 | namespace th5w{ 9 | 10 | #define ENEMY_N_RECORD 32 11 | typedef struct strENEMY{ 12 | unsigned char flag; 13 | int age; 14 | float curX,curY; 15 | float lastX,lastY; 16 | float velX,velY; 17 | int life; 18 | int score; 19 | unsigned char *pScript; 20 | float curSpeed; 21 | unsigned char imgIdx; 22 | unsigned char accumulator; 23 | unsigned char loopCounter; 24 | float curAngle; 25 | float deltaAngle; 26 | unsigned char nImage; 27 | unsigned char imgChangeInterval; 28 | //unsigned char idx30; 29 | unsigned char canLeave; //bit 0 for horizontal leave, bit 4 for vertical leave 30 | unsigned char dropItemType; 31 | bool hitThisFrame; 32 | bool bTakeDamage; 33 | bool bAutoShoot; 34 | bool bCrashChara; 35 | bool atLeftHalfOfScreen; 36 | unsigned char autoShootTimer; 37 | unsigned char autoShootInterval; 38 | ENEMY_SHOOT_INFO shootInfo; 39 | unsigned char subType; 40 | }ENEMY; 41 | 42 | class CStage; 43 | 44 | class CEnemy 45 | { 46 | friend class CStage; 47 | protected: 48 | CStage *m_pStage; 49 | 50 | public: 51 | bool m_noAddEnemy; 52 | 53 | protected: 54 | ENEMY m_enemy[ENEMY_N_RECORD]; 55 | unsigned char *m_pEnemyTableReadPtr; 56 | static const unsigned char s_enemyDropTable[64]; 57 | int m_enemyDropTableIdx; //this value is not carried over stages, as in PC98 ver 58 | 59 | protected: 60 | void AddEnemy(unsigned char enemyType,unsigned char subType,float enemyX,float enemyY,unsigned char dropItemType); 61 | void StepEnemyScript(ENEMY *pEnemy); 62 | void EnemyDie(ENEMY *pEnemy); 63 | 64 | protected: 65 | __forceinline static void UpdateVelXYFromSpeedAngle(ENEMY *pEnemy) 66 | { 67 | pEnemy->velX=(float)cos(pEnemy->curAngle/256.0f*2*PI)*pEnemy->curSpeed; 68 | pEnemy->velY=(float)sin(pEnemy->curAngle/256.0f*2*PI)*pEnemy->curSpeed; 69 | } 70 | __forceinline static bool MoveAndTestLeave(ENEMY *pEnemy) 71 | { 72 | pEnemy->lastX=pEnemy->curX; 73 | pEnemy->lastY=pEnemy->curY; 74 | pEnemy->curX+=pEnemy->velX; 75 | pEnemy->curY+=pEnemy->velY; 76 | if ((pEnemy->canLeave&1)&&(pEnemy->curX<=-16.0f*16.0f||pEnemy->curX>=400.0f*16.0f)) 77 | return true; 78 | if ((pEnemy->canLeave&0x10)&&(pEnemy->curY<=-16.0f*16.0f||pEnemy->curY>=384.0f*16.0f)) 79 | return true; 80 | return false; 81 | } 82 | 83 | public: 84 | void Initialize(); 85 | void StepEnemyTable(); 86 | void Step(); 87 | void Draw(); 88 | public: 89 | CEnemy(CStage *pStage); 90 | ~CEnemy(void); 91 | }; 92 | 93 | } -------------------------------------------------------------------------------- /Game/Stage/EnemyBullet/EnemyBullet.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #ifndef PI 4 | #define PI 3.1415926535897932384626433832795 5 | #endif 6 | 7 | namespace th5w{ 8 | 9 | #define ENEMY_BULLET_N_RECORD_DOT 1800 10 | #define ENEMY_BULLET_N_RECORD_IMAGED 2200 11 | #define ENEMY_BULLET_N_RECORD (ENEMY_BULLET_N_RECORD_DOT+ENEMY_BULLET_N_RECORD_IMAGED) 12 | 13 | #define EST00_SINGLE 0 14 | #define EST01_SINGLE_TO_CHARA 1 15 | #define EST02_NWAY 2 16 | #define EST03_NWAY_TO_CHARA 3 17 | #define EST04_NWAY_ALLAROUND 4 18 | #define EST05_NWAY_ALLAROUND_TO_CHARA 5 19 | #define EST06_MULTI 6 20 | #define EST07_MULTI_TO_CHARA 7 21 | #define EST08_NWAY_MULTI 8 22 | #define EST09_NWAY_MULTI_TO_CHARA 9 23 | #define EST10_NWAY_ALLAROUND_MULTI 10 24 | #define EST11_NWAY_ALLAROUND_MULTI_TO_CHARA 11 25 | #define EST12_RANDOM 12 26 | #define EST13_RANDOM_BASE_SPEED_32 13 27 | #define EST14_DEFAULT_SINGLE 14 28 | #define EST15_DEFAULT_SINGLE_TO_CHARA 15 29 | 30 | #define EBMT01_SLOW_DOWN_THEN_TURN_TO_CHARA 1 31 | #define EBMT02_SLOW_DOWN_THEN_TURN 2 32 | #define EBMT03_SPEED_UP 3 33 | #define EBMT04_SLOW_DOWN_AND_TURN 4 34 | #define EBMT05_BOUNCE_X 5 35 | #define EBMT06_BOUNCE_Y 6 36 | #define EBMT07_BOUNCE_X_Y 7 37 | #define EBMT08_BOUNCE_X_YTOP 8 38 | #define EBMT09_SPEED_UP_VERTICAL 9 39 | #define EBMT10_STRAIGHT 10 40 | 41 | 42 | typedef struct strENEMY_BULLET{ 43 | unsigned char flag; 44 | unsigned char age; 45 | float curX; 46 | float curY; 47 | float lastX; 48 | float lastY; 49 | float velX; 50 | float velY; 51 | unsigned char bulletType; 52 | float curSpeed; 53 | float curAngle; 54 | unsigned char bornStageAndGrazeFlag; 55 | unsigned char dieStageAndMoveType; 56 | unsigned char specialMoveType; 57 | float origSpeed; 58 | unsigned char accumulator; 59 | float delta; 60 | unsigned char imgIdx; 61 | float origX; 62 | float origY; 63 | float totalDistanceTravelled; 64 | unsigned char specialMoveVar; //this field is new, PC98 ver uses a global var to store it 65 | }ENEMY_BULLET; 66 | 67 | typedef struct strENEMY_SHOOT_INFO{ 68 | unsigned char bulletBornType; 69 | unsigned char bulletImg; 70 | float shootOrigX; 71 | float shootOrigY; 72 | unsigned char shootType; 73 | unsigned char bulletMoveType; 74 | unsigned char nWay; 75 | float nWayUnitAngle; 76 | unsigned char nMulti; 77 | float deltaSpeed; 78 | float shootAngle; 79 | float bulletSpeed; 80 | float specialBulletDelta; //these two fields are new, PC98 ver uses global vars to store them 81 | unsigned char specialMoveVar; 82 | }ENEMY_SHOOT_INFO; 83 | 84 | class CStage; 85 | 86 | class CEnemyBullet 87 | { 88 | friend class CStage; 89 | 90 | public: 91 | bool m_noEnemyBullet; 92 | protected: 93 | int m_clearEnemyBulletTimeLeft; 94 | public: 95 | bool m_bDropPointItemOnBonus; 96 | 97 | protected: 98 | float m_clipXLow,m_clipXHigh,m_clipYLow,m_clipYHigh; 99 | float m_bounceXLow,m_bounceXHigh,m_bounceYLow,m_bounceYHigh; 100 | public: 101 | float m_dotBulletShadowColor[3]; 102 | 103 | protected: 104 | ENEMY_BULLET m_bullets[ENEMY_BULLET_N_RECORD]; 105 | protected: 106 | CStage *m_pStage; 107 | public: 108 | void Initialize(); 109 | void Step(); 110 | void Draw(); 111 | void TuneEnemyShootInfo(ENEMY_SHOOT_INFO *pInfo); 112 | 113 | __forceinline int GetClearBulletTimeLeft() {return m_clearEnemyBulletTimeLeft;} 114 | __forceinline void SetClearBulletTimeLeft(int timeLeft) 115 | { 116 | if (m_clearEnemyBulletTimeLeft 5 | #include 6 | #ifndef PI 7 | #define PI 3.1415926535897932384626433832795 8 | #endif 9 | 10 | namespace th5w{ 11 | 12 | const unsigned char c_floatingText[][15]={{0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0}, 13 | {0x48,0x49,0x4a,0x4b,0x4c,0}, 14 | {0x58,0x59,0x5a,0x5b,0}, 15 | {0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0}, 16 | {0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0}}; 17 | const int c_floatingTextLen[]={8,5,4,8,10}; 18 | 19 | CFloatingText::CFloatingText(CStage *pStage) 20 | { 21 | m_pStage=pStage; 22 | Initialize(); 23 | } 24 | 25 | CFloatingText::~CFloatingText(void) 26 | { 27 | } 28 | 29 | void CFloatingText::Initialize() 30 | { 31 | m_textType=FLOATING_TEXT_NONE; 32 | m_textAge=0; 33 | } 34 | 35 | void CFloatingText::SetTextType(int textType,int number) 36 | { 37 | if (m_textType==FLOATING_TEXT_NONE||(m_textType!=textType&&m_textAge>=64)) 38 | { 39 | m_textType=textType; 40 | m_textAge=0; 41 | m_textLen=c_floatingTextLen[textType]; 42 | m_textCurX=52-m_textLen*2; 43 | if (textType==FLOATING_TEXT_BONUS) 44 | { 45 | m_textDestX=16; 46 | m_textNumber=number; 47 | } 48 | else 49 | m_textDestX=28-m_textLen; 50 | } 51 | } 52 | 53 | void CFloatingText::Step() 54 | { 55 | if (m_textAge>=128) 56 | { 57 | m_textAge=0; 58 | m_textType=FLOATING_TEXT_NONE; 59 | return; 60 | } 61 | if (m_textAge>=m_textLen-1) 62 | if (m_textCurX>m_textDestX) 63 | { 64 | m_textCurX-=2; 65 | m_floating=true; 66 | } 67 | else 68 | m_floating=false; 69 | m_textAge++; 70 | } 71 | 72 | void CFloatingText::Draw() 73 | { 74 | m_textAge--; 75 | if (m_textAge>=m_textLen-1) 76 | { 77 | if (m_floating==true) 78 | { 79 | CTh5ExtFont::DrawExtString(c_floatingText[m_textType],100, 80 | (m_textCurX+2)*8-32+m_pStage->m_playAreaUpperLeftX, 81 | 2*16-16+m_pStage->m_playAreaUpperLeftY,1,1,1); 82 | } 83 | else 84 | { 85 | CTh5ExtFont::DrawExtString(c_floatingText[m_textType],100, 86 | m_textDestX*8-32+m_pStage->m_playAreaUpperLeftX, 87 | 2*16-16+m_pStage->m_playAreaUpperLeftY,1,1,1); 88 | if (m_textType==FLOATING_TEXT_BONUS) 89 | m_pStage->m_pStageRes->DrawNumber(0x1c*8-32+m_pStage->m_playAreaUpperLeftX, 90 | 2*16-16+m_pStage->m_playAreaUpperLeftY, 91 | m_textNumber,7,false,true,1,1,1); 92 | } 93 | } 94 | else 95 | { 96 | CTh5ExtFont::DrawExtString(c_floatingText[m_textType],m_textAge, 97 | (m_textCurX+(m_textLen-1-m_textAge+1)*2)*8-32+m_pStage->m_playAreaUpperLeftX, 98 | 2*16-16+m_pStage->m_playAreaUpperLeftY,1,1,1); 99 | } 100 | m_textAge++; 101 | } 102 | 103 | } 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /Game/Stage/FloatingText/FloatingText.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace th5w{ 4 | 5 | #define FLOATING_TEXT_NONE -1 6 | #define FLOATING_TEXT_HISCORE 0 7 | #define FLOATING_TEXT_EXTEND 1 8 | #define FLOATING_TEXT_BONUS 2 9 | #define FLOATING_TEXT_FULLPOWER 3 10 | #define FLOATING_TEXT_DREAMMAX 4 11 | 12 | class CStage; 13 | 14 | class CFloatingText 15 | { 16 | friend class CStage; 17 | 18 | protected: 19 | CStage *m_pStage; 20 | 21 | protected: 22 | int m_textType; 23 | int m_textAge; 24 | int m_textNumber; 25 | int m_textLen; 26 | int m_textCurX; 27 | int m_textDestX; 28 | bool m_floating; 29 | 30 | public: 31 | void Initialize(); 32 | void Step(); 33 | void Draw(); 34 | 35 | void SetTextType(int textType,int number=0); //number is only needed for FLOATING_TEXT_BONUS 36 | 37 | public: 38 | CFloatingText(CStage *pStage); 39 | ~CFloatingText(void); 40 | }; 41 | 42 | } -------------------------------------------------------------------------------- /Game/Stage/GatherEffect/GatherEffect.cpp: -------------------------------------------------------------------------------- 1 | #include ".\gathereffect.h" 2 | #include 3 | #include "../Stage.h" 4 | #ifndef PI 5 | #define PI 3.1415926535897932384626433832795 6 | #endif 7 | 8 | namespace th5w{ 9 | 10 | CGatherEffect::CGatherEffect(CStage *pStage) 11 | { 12 | m_pStage=pStage; 13 | Initialize(); 14 | } 15 | 16 | CGatherEffect::~CGatherEffect(void) 17 | { 18 | } 19 | 20 | void CGatherEffect::Initialize() 21 | { 22 | memset(m_gather,0,sizeof(m_gather)); 23 | } 24 | 25 | void CGatherEffect::AddEffect(float ctrX,float ctrY,float initR,float deltaAngle,float colorR,float colorG,float colorB, 26 | int nDots,ENEMY_SHOOT_INFO *pShootInfo,float velX,float velY) 27 | { 28 | for (int i=0;im_pStageRes->m_palette[headColorIdx*3]/255.0f, 58 | m_pStage->m_pStageRes->m_palette[headColorIdx*3+1]/255.0f,m_pStage->m_pStageRes->m_palette[headColorIdx*3+2]/255.0f, 59 | nDots,NULL,velX,velY); 60 | } 61 | if (frameIdx==2||frameIdx==4) 62 | AddEffect(ctrX,ctrY,initR,deltaAngle,m_pStage->m_pStageRes->m_palette[bodyColorIdx*3]/255.0f, 63 | m_pStage->m_pStageRes->m_palette[bodyColorIdx*3+1]/255.0f,m_pStage->m_pStageRes->m_palette[bodyColorIdx*3+2]/255.0f, 64 | nDots,NULL,velX,velY); 65 | } 66 | 67 | void CGatherEffect::Step() 68 | { 69 | for (int i=0;i=0xfe) 89 | { 90 | m_gather[i].shootInfo.bulletBornType=0; 91 | m_pStage->m_pEnemyBullet->Shoot(&m_gather[i].shootInfo,true); 92 | } 93 | else 94 | m_pStage->m_pEnemyBullet->Shoot(&m_gather[i].shootInfo,false); 95 | } 96 | } 97 | } 98 | } 99 | 100 | void CGatherEffect::Draw() 101 | { 102 | for (int i=0;im_pStageRes->DrawStageObjectImageColorScaled(m_pStage->m_pStageRes->m_pImgDotBullet,drawX, 113 | drawY,m_gather[i].colorR,m_gather[i].colorG,m_gather[i].colorB); 114 | } 115 | } 116 | } 117 | 118 | } 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | -------------------------------------------------------------------------------- /Game/Stage/GatherEffect/GatherEffect.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../EnemyBullet/EnemyBullet.h" 3 | #include 4 | 5 | namespace th5w{ 6 | #define GATHER_EFFECT_N_RECORD 8 7 | 8 | typedef struct strGATHER_EFFECT{ 9 | unsigned char flag; 10 | float colorR,colorG,colorB; 11 | float curX; 12 | float curY; 13 | float lastX; 14 | float lastY; 15 | float velX; 16 | float velY; 17 | float radius; 18 | int nDots; 19 | float baseAngle; 20 | float deltaAngle; 21 | float lastRadius; 22 | float deltaRadius; 23 | ENEMY_SHOOT_INFO shootInfo; 24 | }GATHER_EFFECT; 25 | 26 | class CStage; 27 | 28 | class CGatherEffect 29 | { 30 | friend class CStage; 31 | 32 | protected: 33 | CStage *m_pStage; 34 | 35 | protected: 36 | GATHER_EFFECT m_gather[GATHER_EFFECT_N_RECORD]; 37 | public: 38 | void AddEffect(float ctrX,float ctrY,float initR,float deltaAngle,float colorR,float colorG,float colorB, 39 | int nDots,ENEMY_SHOOT_INFO *pShootInfo=NULL,float velX=0.0f,float velY=0.0f); 40 | void AddEffectTrailed(float ctrX,float ctrY,unsigned char bodyColorIdx,unsigned char headColorIdx, 41 | int frameIdx,float initR=1024.0f,float deltaAngle=2.0f,int nDots=8, 42 | float velX=0.0f,float velY=0.0f); 43 | void Initialize(); 44 | void Step(); 45 | void Draw(); 46 | public: 47 | CGatherEffect(CStage *pStage); 48 | ~CGatherEffect(void); 49 | }; 50 | 51 | } 52 | -------------------------------------------------------------------------------- /Game/Stage/Item/Item.cpp: -------------------------------------------------------------------------------- 1 | #include ".\item.h" 2 | #include "../Stage.h" 3 | #include "../Chara/Chara.h" 4 | #include 5 | #include 6 | #ifndef PI 7 | #define PI 3.1415926535897932384626433832795 8 | #endif 9 | 10 | namespace th5w{ 11 | 12 | CItem::CItem(CStage *pStage) 13 | { 14 | m_pStage=pStage; 15 | Initialize(); 16 | } 17 | 18 | CItem::~CItem(void) 19 | { 20 | } 21 | 22 | void CItem::Initialize() 23 | { 24 | memset(m_item,0,sizeof(m_item)); 25 | memset(m_itemSplash,0,sizeof(m_itemSplash)); 26 | m_clipXLow=-128; 27 | m_clipXHigh=6272; 28 | m_clipYLow=-128; 29 | m_clipYHigh=6016; 30 | } 31 | 32 | void CItem::OnMissItem(unsigned char itemType) 33 | { 34 | if (itemType==ITEM_POINT&&m_pStage->GetDream()>1&&m_pStage->GetDream()<128) //point item 35 | m_pStage->SetDream(m_pStage->GetDream()-1); 36 | if (itemType==ITEM_BOMB) //bomb item 37 | m_pStage->ChangePlayerPerformance(-2); 38 | if (itemType==ITEM_1UP) //1UP item 39 | m_pStage->ChangePlayerPerformance(-4); 40 | } 41 | 42 | void CItem::AddSplash(float ctrX,float ctrY) 43 | { 44 | for (int i=0;im_bInCharaBombForItem) 59 | { 60 | if (itemType<=2||itemType==0xff) //power or point or dream or follow table 61 | itemType=ITEM_POWER; //all convert to power 62 | } 63 | for (int i=0;im_bInCharaBombForItem) 90 | { 91 | m_item[i].bLastFrameInBomb=true; 92 | float angle=m_pStage->m_pChara->AngleToChara(m_item[i].curX,m_item[i].curY); 93 | m_item[i].velX=(float)cos(angle/256.0f*2*PI)*160; 94 | m_item[i].velY=(float)sin(angle/256.0f*2*PI)*160; 95 | } 96 | else 97 | { 98 | if (m_item[i].bLastFrameInBomb) 99 | { 100 | m_item[i].bLastFrameInBomb=false; 101 | m_item[i].velX=0; 102 | m_item[i].velY=0; 103 | } 104 | } 105 | m_item[i].lastX=m_item[i].curX; 106 | m_item[i].lastY=m_item[i].curY; 107 | m_item[i].curX+=m_item[i].velX; 108 | m_item[i].curY+=m_item[i].velY; 109 | if (m_item[i].curX<=m_clipXLow||m_item[i].curX>=m_clipXHigh||m_item[i].curY>=m_clipYHigh) 110 | { 111 | m_item[i].flag=2; 112 | OnMissItem(m_item[i].itemType); 113 | continue; 114 | } 115 | if (m_item[i].curY=0) 118 | m_item[i].velX=0; 119 | if (m_pStage->m_pChara->GetNextLifeComeTimeLeft()==0) 120 | { 121 | if (m_item[i].curX>=m_pStage->m_pChara->GetCurX()-24.0f*16.0f) 122 | if (m_item[i].curX<=m_pStage->m_pChara->GetCurX()+24.0f*16.0f) 123 | if (m_item[i].curY>=m_pStage->m_pChara->GetCurY()-14.0f*16.0f) 124 | if (m_item[i].curY<=m_pStage->m_pChara->GetCurY()+24.0f*16.0f) 125 | { 126 | m_pStage->m_pChara->CaughtItem(m_item[i].curX,m_item[i].curY,m_item[i].itemType); 127 | m_pStage->m_bPlaySound[11]=true; 128 | m_item[i].flag=2; 129 | } 130 | } 131 | m_item[i].velY+=1.0f; 132 | } 133 | for (int i=0;i=512.0f) 143 | m_itemSplash[i].flag=2; 144 | } 145 | } 146 | 147 | void CItem::Draw() 148 | { 149 | for (int i=0;im_pStageRes->m_palette[15*3]/255.0f; 158 | color[1]=m_pStage->m_pStageRes->m_palette[15*3+1]/255.0f; 159 | color[2]=m_pStage->m_pStageRes->m_palette[15*3+2]/255.0f; 160 | m_pStage->m_pStageRes->DrawPoint(drawX,drawY,color[0],color[1],color[2]); 161 | } 162 | } 163 | for (int i=0;im_pStageRes->DrawStageObjectImage(m_pStage->m_pStageRes->m_patternArray.GetImagePtr(m_item[i].imgIdx), 166 | m_item[i].curX,m_item[i].curY); 167 | } 168 | 169 | } 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | -------------------------------------------------------------------------------- /Game/Stage/Item/Item.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace th5w{ 4 | 5 | #define ITEM_POWER 0 6 | #define ITEM_POINT 1 7 | #define ITEM_DREAM 2 8 | #define ITEM_BIGPOWER 3 9 | #define ITEM_BOMB 4 10 | #define ITEM_1UP 5 11 | #define ITEM_FULLPOWER 6 12 | 13 | #define ITEM_N_RECORD 40 14 | #define ITEM_SPLASH_N_RECORD 8 15 | 16 | typedef struct strITEM{ 17 | unsigned char flag; 18 | //unsigned char age; //PC98 ver has 1 byte left here which is never used, guess its for age but 19 | //age is unnecessary for items 20 | float curX,curY; 21 | float lastX,lastY; 22 | float velX,velY; 23 | unsigned char itemType; 24 | //unsigned char unknown; //PC98 ver has 1 byte here which is always initialized to 0 but never used 25 | unsigned char imgIdx; //always itemType+36; 26 | bool bLastFrameInBomb; 27 | }ITEM; 28 | 29 | typedef struct strITEM_SPLASH{ 30 | unsigned char flag; 31 | //unsigned char unknown; //PC98 ver has 1 byte here which is always initialized to 16 but never used 32 | float ctrX,ctrY; 33 | float radius; 34 | float lastRadius; 35 | }ITEM_SPLASH; 36 | 37 | class CStage; 38 | 39 | class CItem 40 | { 41 | friend class CStage; 42 | protected: 43 | CStage *m_pStage; 44 | protected: 45 | float m_clipXLow,m_clipXHigh,m_clipYLow,m_clipYHigh; 46 | 47 | protected: 48 | ITEM m_item[ITEM_N_RECORD]; 49 | ITEM_SPLASH m_itemSplash[ITEM_SPLASH_N_RECORD]; 50 | protected: 51 | void AddSplash(float ctrX,float ctrY); 52 | void OnMissItem(unsigned char itemType); 53 | public: 54 | void Initialize(); 55 | void AddItem(float itemX,float itemY,unsigned char itemType,float velX,float velY,bool bSplash=true,bool bConvertInBomb=true); 56 | void Step(); 57 | void Draw(); 58 | public: 59 | CItem(CStage *pStage); 60 | ~CItem(void); 61 | }; 62 | 63 | } -------------------------------------------------------------------------------- /Game/Stage/Laser/Laser.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace th5w{ 4 | 5 | #define LASER_N_RECORD 32 6 | #define LASER_MODE_NONE 0 7 | #define LASER_MODE_SHOOT_OUT 1 8 | #define LASER_MODE_WAIT_TO_GROW 2 9 | #define LASER_MODE_GROW 3 10 | #define LASER_MODE_PRESENT 4 11 | #define LASER_MODE_SHRINK 5 12 | #define LASER_MODE_SHRINK_AND_WAIT_TO_GROW 6 13 | #define LASER_MODE_SHOOT_OUT_END 7 14 | 15 | typedef struct strLASER{ 16 | unsigned char mode; 17 | float color[3]; 18 | float srcX,srcY; 19 | float lenLower,lenUpper; 20 | float angle; 21 | float width; 22 | float speed; 23 | int age; 24 | int ageThres; 25 | int shootAgeThres; 26 | float expectedWidth; 27 | }LASER; 28 | 29 | class CStage; 30 | 31 | class CLaser 32 | { 33 | friend class CStage; 34 | protected: 35 | CStage *m_pStage; 36 | protected: 37 | LASER m_laser[LASER_N_RECORD]; 38 | 39 | public: 40 | void AddLaserFixed(int laserIdx,float srcX,float srcY,float color[3],float expectedWidth,float angle, 41 | int ageThres=-1,int shootAgeThres=-1); 42 | void AddLaserShootOut(float srcX,float srcY,float color[3],float angle,int ageThres,float speed); 43 | void StartGrow(int laserIdx); 44 | void SetMode(int laserIdx,unsigned char newMode); 45 | void RemoveLaser(int laserIdx); 46 | __forceinline float& LaserAngle(int laserIdx) {return m_laser[laserIdx].angle;} 47 | __forceinline void SetLaserSrc(int laserIdx,float srcX,float srcY) 48 | {m_laser[laserIdx].srcX=srcX;m_laser[laserIdx].srcY=srcY;} 49 | __forceinline unsigned char GetMode(int laserIdx) {return m_laser[laserIdx].mode;} 50 | protected: 51 | void TestCrash(int laserIdx); 52 | public: 53 | void Initialize(); 54 | void Step(); 55 | void Draw(); 56 | public: 57 | CLaser(CStage *pStage); 58 | ~CLaser(void); 59 | }; 60 | 61 | } 62 | -------------------------------------------------------------------------------- /Game/Stage/MidBoss/MidBoss.cpp: -------------------------------------------------------------------------------- 1 | #include ".\midboss.h" 2 | #include "../Stage.h" 3 | #include "../../../gameLib/Graphic/Th5ExtFont.h" 4 | 5 | namespace th5w{ 6 | 7 | CMidBoss::CMidBoss(void) 8 | { 9 | m_curPhase=0; 10 | m_curPhaseFrame=0; 11 | m_lastDrawnHP=0; 12 | m_explodeAngle=(float)(rand()%256); //PC98 does does not initialize this var, but it doens't matter much 13 | } 14 | 15 | CMidBoss::~CMidBoss(void) 16 | { 17 | } 18 | 19 | void CMidBoss::Initialize() 20 | { 21 | } 22 | 23 | int CMidBoss::GetDamageAndPlaySoundWhenHit(float dmgAreaHalfWidth,float dmgAreaHalfHeight,int soundIdx) 24 | { 25 | int dmg=m_pStage->GetDamageFromChara(m_curX,m_curY,dmgAreaHalfWidth,dmgAreaHalfHeight,true); 26 | if (dmg!=0) 27 | m_pStage->m_bPlaySound[soundIdx]=true; 28 | 29 | return dmg; 30 | } 31 | 32 | void CMidBoss::AddDefeatScoreAndPopupNumbers(int n1280) 33 | { 34 | m_pStage->AddScore(n1280*1280); 35 | for (int i=0;im_pPopupNumber->AddNumber(drawX,drawY,1280*10, 40 | m_pStage->m_pStageRes->m_palette[11*3]/255.0f, 41 | m_pStage->m_pStageRes->m_palette[11*3+1]/255.0f, 42 | m_pStage->m_pStageRes->m_palette[11*3+2]/255.0f); 43 | } 44 | } 45 | 46 | void CMidBoss::StepHPGauge(int curHP,int fullHP) 47 | { 48 | if (curHP>m_lastDrawnHP) 49 | { 50 | m_lastDrawnHP+=fullHP/128; 51 | if (m_lastDrawnHP>curHP) 52 | m_lastDrawnHP=curHP; 53 | } 54 | else 55 | m_lastDrawnHP=curHP; 56 | } 57 | 58 | void CMidBoss::DrawHPGaugeAndExtStrEnemy(int fullHP) 59 | { 60 | const float gaugeColor[][3]={{1,0,0},{1,0,1},{0,1,1},{1,1,0},{1,1,1}}; 61 | if (m_lastDrawnHP>0) 62 | { 63 | int colorIdx=m_lastDrawnHP*4/fullHP; 64 | m_pStage->m_pStageRes->DrawGauge(m_lastDrawnHP,fullHP,0x38*8,0x9*16+40, 65 | gaugeColor[colorIdx][0],gaugeColor[colorIdx][1],gaugeColor[colorIdx][2]); 66 | unsigned char extEnemy[]={0xea,0xeb,0xec,0}; 67 | CTh5ExtFont::DrawExtString(extEnemy,100,0x3d*8,0x8*16+40,1,1,0); 68 | } 69 | } 70 | 71 | int CMidBoss::DeathSequence() 72 | { 73 | if (m_curPhase!=0xfe) 74 | return 1; 75 | 76 | if (m_curPhaseFrame==1) 77 | m_pStage->m_pEnemy->m_noAddEnemy=false; 78 | if (m_curPhaseFrame%16==0) 79 | { 80 | m_curImage++; 81 | if (m_curImage>=12) 82 | m_curPhase=0xff; 83 | } 84 | 85 | return 0; 86 | } 87 | 88 | void CMidBoss::DrawExplode() 89 | { 90 | float radius=(float)(m_curPhaseFrame*16); 91 | float angle=m_explodeAngle; 92 | if (radius>48.0f*16.0f) 93 | { 94 | radius=48.0f*16.0f; 95 | angle=m_explodeAngle+(float)(m_curPhaseFrame-48+1); 96 | } 97 | for (int i=0;i<16;i++) 98 | { 99 | float drawX=m_curX+(float)cos((angle+i*16.0f)/256.0f*2*PI)*radius; 100 | float drawY=m_curY+(float)sin((angle+i*16.0f)/256.0f*2*PI)*radius; 101 | C2DImage *pImage=m_pStage->m_pStageRes->m_patternArray.GetImagePtr(m_curImage); 102 | m_pStage->m_pStageRes->DrawStageObjectImage(pImage,drawX,drawY); 103 | } 104 | } 105 | 106 | } 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /Game/Stage/MidBoss/MidBoss.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../EnemyBullet/EnemyBullet.h" 3 | #include "../Item/Item.h" 4 | #include "../SparkEffect/SparkEffect.h" 5 | #include "../GatherEffect/GatherEffect.h" 6 | #include "../Chara/Chara.h" 7 | #include "../PopupNumber/PopupNumber.h" 8 | #include "../Enemy/Enemy.h" 9 | 10 | namespace th5w{ 11 | 12 | class CStage; 13 | 14 | class CMidBoss 15 | { 16 | friend class CStage; 17 | 18 | protected: 19 | CStage *m_pStage; 20 | 21 | protected: 22 | int m_curPhase; 23 | int m_curPhaseFrame; 24 | int m_curHP; 25 | int m_curImage; 26 | float m_curX,m_curY; 27 | float m_lastX,m_lastY; 28 | float m_velX,m_velY; 29 | 30 | protected: 31 | int GetDamageAndPlaySoundWhenHit(float dmgAreaHalfWidth,float dmgAreaHalfHeight,int soundIdx); 32 | void AddDefeatScoreAndPopupNumbers(int n1280); 33 | int DeathSequence(); 34 | 35 | protected: 36 | float m_explodeAngle; 37 | void DrawExplode(); 38 | protected: 39 | int m_lastDrawnHP; 40 | void StepHPGauge(int curHP,int fullHP); 41 | void DrawHPGaugeAndExtStrEnemy(int fullHP); 42 | public: 43 | virtual void Initialize(); 44 | virtual int Step()=0; //return 0 for continue, 1 for midboss end 45 | virtual void Draw()=0; 46 | virtual void DrawStatistics()=0; 47 | public: 48 | CMidBoss(void); 49 | virtual ~CMidBoss(void); 50 | }; 51 | 52 | } 53 | -------------------------------------------------------------------------------- /Game/Stage/MidBoss/MidBossStage1.cpp: -------------------------------------------------------------------------------- 1 | #include ".\midbossstage1.h" 2 | #include 3 | #include "../Stage.h" 4 | 5 | namespace th5w{ 6 | 7 | CMidBossStage1::CMidBossStage1(void) 8 | { 9 | } 10 | 11 | CMidBossStage1::~CMidBossStage1(void) 12 | { 13 | } 14 | 15 | void CMidBossStage1::Initialize() 16 | { 17 | m_curX=192.0f*16.0f; 18 | m_curY=96.0f*16.0f; 19 | m_lastX=m_curX; 20 | m_lastY=m_curY; 21 | m_curHP=1000; 22 | m_curImage=200; 23 | 24 | m_phase3CircularMoveAngle=(float)(rand()%256); //PC98 does does not initialize this var, but it doens't matter much 25 | } 26 | 27 | 28 | void CMidBossStage1::Phase0() 29 | { 30 | if (m_curPhaseFrame>=256) 31 | { 32 | m_curPhase++; 33 | m_curPhaseFrame=0; 34 | m_curImage=204; 35 | } 36 | } 37 | 38 | void CMidBossStage1::Phase1_2() 39 | { 40 | GetDamageAndPlaySoundWhenHit(12.0f*16.0f,12.0f*16.0f,10); 41 | if (m_curPhaseFrame>=64) 42 | { 43 | m_curPhase++; 44 | m_curPhaseFrame=0; 45 | m_phase3ShootAngle=224.0f; 46 | } 47 | } 48 | 49 | void CMidBossStage1::Phase3() 50 | { 51 | Phase3Shoot(); 52 | int dmg=GetDamageAndPlaySoundWhenHit(24.0f*16.0f,24.0f*16.0f,4); 53 | if (dmg!=0) 54 | m_bHitThisFrame=true; 55 | m_curHP-=dmg; 56 | float radius=(float)((1000-m_curHP)*1024/1000); 57 | m_curX=192.0f*16.0f+(float)cos(m_phase3CircularMoveAngle/256.0f*2*PI)*radius; 58 | m_curY=96.0f*16.0f+(float)sin(m_phase3CircularMoveAngle/256.0f*2*PI)*radius; 59 | m_phase3CircularMoveAngle-=2; 60 | if (m_curPhaseFrame>=1500||m_curHP<=0) 61 | { 62 | if (m_curHP<=0&&m_curPhaseFrame<1500) 63 | { 64 | m_pStage->m_pEnemyBullet->m_noEnemyBullet=true; 65 | AddDefeatScoreAndPopupNumbers(5); 66 | m_pStage->m_pItem->AddItem(m_curX,m_curY,ITEM_BIGPOWER,0,-48); 67 | } 68 | m_curPhase=0xfe; 69 | m_curImage=4; 70 | m_curPhaseFrame=0; 71 | m_pStage->m_pSparkEffect->AddEffect(m_curX,m_curY,128,48,true); 72 | m_pStage->m_bPlaySound[12]=true; 73 | } 74 | } 75 | 76 | void CMidBossStage1::Phase3Shoot() 77 | { 78 | int shootInterval=16; 79 | if (m_curHP<=200) 80 | shootInterval=12; 81 | if (m_curPhaseFrame%shootInterval==0) 82 | { 83 | ENEMY_SHOOT_INFO shootInfo; 84 | shootInfo.shootOrigX=m_curX; 85 | shootInfo.shootOrigY=m_curY; 86 | shootInfo.bulletBornType=0; 87 | shootInfo.bulletImg=0; 88 | shootInfo.bulletSpeed=32; 89 | shootInfo.shootType=EST02_NWAY; 90 | shootInfo.bulletMoveType=EBMT10_STRAIGHT; 91 | shootInfo.nWay=4; 92 | shootInfo.nWayUnitAngle=2; 93 | shootInfo.shootAngle=m_phase3ShootAngle; 94 | m_phase3ShootAngle+=20; 95 | m_pStage->m_pEnemyBullet->TuneEnemyShootInfo(&shootInfo); 96 | m_pStage->m_pEnemyBullet->Shoot(&shootInfo,true,true); 97 | 98 | shootInfo.shootType=EST00_SINGLE; 99 | shootInfo.bulletBornType=2; 100 | shootInfo.bulletSpeed=24; 101 | shootInfo.bulletImg=44; 102 | m_pStage->m_pEnemyBullet->TuneEnemyShootInfo(&shootInfo); 103 | shootInfo.shootAngle=(float)(rand()%256); 104 | shootInfo.shootOrigX=m_curX+(float)cos(shootInfo.shootAngle/256.0f*2*PI)*32.0f*16.0f; 105 | shootInfo.shootOrigY=m_curY+(float)sin(shootInfo.shootAngle/256.0f*2*PI)*32.0f*16.0f; 106 | m_pStage->m_pEnemyBullet->Shoot(&shootInfo); 107 | } 108 | } 109 | 110 | int CMidBossStage1::Step() 111 | { 112 | m_curPhaseFrame++; 113 | m_bHitThisFrame=false; 114 | switch(m_curPhase) 115 | { 116 | case 0: 117 | Phase0(); 118 | break; 119 | case 1: 120 | case 2: 121 | Phase1_2(); 122 | break; 123 | case 3: 124 | Phase3(); 125 | break; 126 | default: //0xfe or 0xff 127 | int ret=DeathSequence(); 128 | StepHPGauge(m_curHP,1000); 129 | return ret; 130 | } 131 | StepHPGauge(m_curHP,1000); 132 | m_pStage->m_bHomingEnemyExist=true; 133 | m_pStage->m_homingEnemyX=m_curX; 134 | m_pStage->m_homingEnemyY=m_curY; 135 | 136 | return 0; 137 | } 138 | 139 | void CMidBossStage1::Draw() 140 | { 141 | if (m_curPhase<0xfe) 142 | { 143 | C2DImage *pImage=m_pStage->m_pStageRes->m_patternArray.GetImagePtr(m_curImage+m_pStage->m_curFrame%16/4); 144 | m_pStage->m_pStageRes->DrawStageObjectImage(pImage,m_curX,m_curY); 145 | if (m_curPhase==2) 146 | { 147 | pImage=m_pStage->m_pStageRes->m_patternArray.GetImagePtr(208+m_pStage->m_curFrame%8/2); 148 | m_pStage->m_pStageRes->DrawStageObjectImage(pImage,m_curX,m_curY); 149 | } 150 | else 151 | if (m_curPhase==3) 152 | { 153 | pImage=m_pStage->m_pStageRes->m_patternArray.GetImagePtr(212+m_pStage->m_curFrame%8/2); 154 | if (m_bHitThisFrame) 155 | m_pStage->m_pStageRes->DrawStageObjectImageWhiteMask(pImage,m_curX,m_curY); 156 | else 157 | m_pStage->m_pStageRes->DrawStageObjectImage(pImage,m_curX,m_curY); 158 | } 159 | } 160 | else 161 | if (m_curPhase==0xfe) 162 | DrawExplode(); 163 | } 164 | 165 | void CMidBossStage1::DrawStatistics() 166 | { 167 | DrawHPGaugeAndExtStrEnemy(1000); 168 | } 169 | 170 | } 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | -------------------------------------------------------------------------------- /Game/Stage/MidBoss/MidBossStage1.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "midboss.h" 3 | 4 | namespace th5w{ 5 | 6 | class CMidBossStage1 : public CMidBoss 7 | { 8 | protected: 9 | bool m_bHitThisFrame; 10 | float m_phase3ShootAngle; 11 | float m_phase3CircularMoveAngle; 12 | 13 | protected: 14 | void Phase0(); 15 | void Phase1_2(); 16 | void Phase3(); 17 | void Phase3Shoot(); 18 | public: 19 | virtual void Initialize(); 20 | virtual int Step(); 21 | virtual void Draw(); 22 | virtual void DrawStatistics(); 23 | 24 | public: 25 | CMidBossStage1(void); 26 | virtual ~CMidBossStage1(void); 27 | }; 28 | 29 | } -------------------------------------------------------------------------------- /Game/Stage/MidBoss/MidBossStage2.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "midboss.h" 3 | 4 | namespace th5w{ 5 | 6 | class CMidBossStage2 : public CMidBoss 7 | { 8 | protected: 9 | bool m_bHitThisFrame; 10 | float m_phase1CtrX,m_phase1CtrY; 11 | float m_phase1VelX; 12 | float m_phase1Radius,m_phase1DeltaRadius,m_phase1Angle; 13 | 14 | protected: 15 | void Phase0(); 16 | void Phase1(); 17 | void Phase1Shoot(); 18 | void Phase1Move(); 19 | void Phase2(); 20 | void Phase2Shoot(); 21 | 22 | public: 23 | virtual void Initialize(); 24 | virtual int Step(); 25 | virtual void Draw(); 26 | virtual void DrawStatistics(); 27 | 28 | public: 29 | CMidBossStage2(void); 30 | virtual ~CMidBossStage2(void); 31 | }; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Game/Stage/MidBoss/MidBossStage3.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "midboss.h" 3 | 4 | namespace th5w{ 5 | 6 | class CMidBossStage3 : public CMidBoss 7 | { 8 | protected: 9 | bool m_bHitThisFrame; 10 | int m_phase1CurMode; 11 | int m_phase1NModeChange; 12 | bool m_bPhase1FadingIn; 13 | 14 | protected: 15 | void Phase0(); 16 | void Phase1(); 17 | void Phase1Mode1(); 18 | void Phase1Mode2(); 19 | void Phase1Mode3(); 20 | 21 | void ChargeAnimation(); 22 | void FadeOutAndIn(); 23 | 24 | public: 25 | virtual void Initialize(); 26 | virtual int Step(); 27 | virtual void Draw(); 28 | virtual void DrawStatistics(); 29 | public: 30 | CMidBossStage3(void); 31 | virtual ~CMidBossStage3(void); 32 | }; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Game/Stage/MidBoss/MidBossStage4.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "midboss.h" 3 | 4 | namespace th5w{ 5 | 6 | class CMidBossStage4 : public CMidBoss 7 | { 8 | protected: 9 | bool m_bHitThisFrame; 10 | bool m_bPhase1CanBeHit; 11 | int m_phase1NModeChange; 12 | int m_phase1CurMode; 13 | float m_phase1Mode2Angle; 14 | float m_phase1FadeCenterX; 15 | 16 | protected: 17 | void Phase0(); 18 | void Phase1(); 19 | void Phase1Mode1(); 20 | void Phase1Mode2(); 21 | void Phase1Mode3(); 22 | 23 | int FadeOutAndIn(); 24 | 25 | public: 26 | virtual void Initialize(); 27 | virtual int Step(); 28 | virtual void Draw(); 29 | virtual void DrawStatistics(); 30 | public: 31 | CMidBossStage4(void); 32 | virtual ~CMidBossStage4(void); 33 | }; 34 | 35 | } -------------------------------------------------------------------------------- /Game/Stage/MidBoss/MidBossStage5.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "midboss.h" 3 | 4 | namespace th5w{ 5 | 6 | class CMidBossStage5 : public CMidBoss 7 | { 8 | protected: 9 | bool m_bHitThisFrame; 10 | int m_phase1NModeChange; 11 | int m_phase1CurMode; 12 | float m_phase1ShootAngle; 13 | int m_phase1PositionIdx; 14 | 15 | protected: 16 | void Phase0(); 17 | void Phase1(); 18 | int Phase1Move(); 19 | void Phase1Common(); 20 | int Phase1Mode1Shoot(); 21 | int Phase1Mode2Shoot(); 22 | int Phase1Mode3Shoot(); 23 | 24 | public: 25 | virtual void Initialize(); 26 | virtual int Step(); 27 | virtual void Draw(); 28 | virtual void DrawStatistics(); 29 | public: 30 | CMidBossStage5(void); 31 | virtual ~CMidBossStage5(void); 32 | }; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Game/Stage/MidBoss/MidBossStageEx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "midboss.h" 3 | 4 | namespace th5w{ 5 | 6 | class CMidBossStageEx : public CMidBoss 7 | { 8 | protected: 9 | bool m_bHitThisFrame; 10 | float m_movingAngle; 11 | int m_shootType; 12 | int m_phase1CurSubphase; 13 | int m_phase1NModeChange; 14 | float m_shootType1DeltaAngle; 15 | float m_shootType1Angle; 16 | 17 | protected: 18 | void Phase0(); 19 | void Phase1(); 20 | int Move(int frameIdx); 21 | int Shoot(); 22 | int ShootType1(); 23 | int ShootType2(); 24 | int ShootType3_4(); 25 | 26 | public: 27 | virtual void Initialize(); 28 | virtual int Step(); 29 | virtual void Draw(); 30 | virtual void DrawStatistics(); 31 | 32 | public: 33 | CMidBossStageEx(void); 34 | virtual ~CMidBossStageEx(void); 35 | }; 36 | 37 | } -------------------------------------------------------------------------------- /Game/Stage/PopupNumber/PopupNumber.cpp: -------------------------------------------------------------------------------- 1 | #include ".\popupnumber.h" 2 | #include 3 | #include "../Stage.h" 4 | 5 | namespace th5w{ 6 | 7 | CPopupNumber::CPopupNumber(CStage *pStage) 8 | { 9 | m_pStage=pStage; 10 | Initialize(); 11 | } 12 | 13 | CPopupNumber::~CPopupNumber(void) 14 | { 15 | } 16 | 17 | void CPopupNumber::Initialize() 18 | { 19 | memset(m_numbers,0,sizeof(m_numbers)); 20 | } 21 | 22 | void CPopupNumber::AddNumber(float origX,float origY,int number,float colorR,float colorG,float colorB) 23 | { 24 | for (int i=0;i=24) 63 | m_numbers[i].curY-=8; 64 | m_numbers[i].age++; 65 | if (m_numbers[i].age>36) 66 | m_numbers[i].flag=2; 67 | } 68 | } 69 | 70 | void CPopupNumber::Draw() 71 | { 72 | for (int i=0;im_pStageRes->DrawStageObjectImageColorScaled(m_pStage->m_pStageRes->m_pImgNumber[m_numbers[i].digits[j]], 78 | m_numbers[i].curX+(m_numbers[i].nDigit*4-j*8)*16,m_numbers[i].curY, 79 | m_numbers[i].color[0], m_numbers[i].color[1], m_numbers[i].color[2]); 80 | } 81 | } 82 | 83 | } 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /Game/Stage/PopupNumber/PopupNumber.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace th5w{ 4 | 5 | #define POPUP_NUMBER_MAX_DIGIT 6 6 | #define POPUP_NUMBER_N_RECORD 280 //PC98 ver uses 200 records for white and 80 records for yellow, 7 | //here we just limit the total number but not each 8 | typedef struct strPOPUP_NUMBER{ 9 | unsigned char flag; 10 | unsigned char age; 11 | float curX; 12 | float curY; 13 | float lastY; 14 | unsigned char nDigit; 15 | unsigned char digits[POPUP_NUMBER_MAX_DIGIT]; 16 | float color[3]; 17 | }POPUP_NUMBER; 18 | 19 | class CStage; 20 | 21 | class CPopupNumber 22 | { 23 | friend class CStage; 24 | 25 | protected: 26 | CStage *m_pStage; 27 | POPUP_NUMBER m_numbers[POPUP_NUMBER_N_RECORD]; 28 | 29 | public: 30 | void AddNumber(float origX,float origY,int number,float colorR,float colorG,float colorB); 31 | void Initialize(); 32 | void Step(); 33 | void Draw(); 34 | 35 | public: 36 | CPopupNumber(CStage *pStage); 37 | ~CPopupNumber(void); 38 | }; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Game/Stage/SparkEffect/SparkEffect.cpp: -------------------------------------------------------------------------------- 1 | #include ".\sparkeffect.h" 2 | #include "../Stage.h" 3 | #include 4 | #include 5 | #ifndef PI 6 | #define PI 3.1415926535897932384626433832795 7 | #endif 8 | 9 | namespace th5w{ 10 | 11 | CSparkEffect::CSparkEffect(CStage *pStage) 12 | { 13 | m_pStage=pStage; 14 | Initialize(); 15 | } 16 | 17 | CSparkEffect::~CSparkEffect(void) 18 | { 19 | } 20 | 21 | void CSparkEffect::Initialize() 22 | { 23 | memset(m_spark,0,sizeof(m_spark)); 24 | m_clipXLow=-64; 25 | m_clipXHigh=6208; 26 | m_clipYLow=-64; 27 | m_clipYHigh=5952; 28 | } 29 | 30 | void CSparkEffect::AddEffect(float origX,float origY,float baseSpeed,int nTrail,bool isExplode) 31 | { 32 | int curAdd=0; 33 | for (int i=0;i=m_clipXHigh 75 | ||m_spark[i].curY<=m_clipYLow||m_spark[i].curY>=m_clipYHigh) 76 | { 77 | m_spark[i].flag=2; 78 | continue; 79 | } 80 | m_spark[i].velY+=1.0f; 81 | m_spark[i].age++; 82 | if (m_spark[i].age>40) 83 | m_spark[i].flag=2; 84 | } 85 | } 86 | 87 | void CSparkEffect::Draw() 88 | { 89 | float color[3]; 90 | color[0]=m_pStage->m_pStageRes->m_palette[12*3]/255.0f; 91 | color[1]=m_pStage->m_pStageRes->m_palette[12*3+1]/255.0f; 92 | color[2]=m_pStage->m_pStageRes->m_palette[12*3+2]/255.0f; 93 | for (int i=0;im_pStageRes->DrawStageObjectImageColorScaled(m_pStage->m_pStageRes->m_pImgSpark[m_spark[i].age%8], 96 | m_spark[i].curX,m_spark[i].curY,color[0],color[1],color[2]); 97 | } 98 | 99 | } 100 | -------------------------------------------------------------------------------- /Game/Stage/SparkEffect/SparkEffect.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace th5w{ 4 | 5 | #define SPARK_EFFECT_N_RECORD 64 6 | 7 | typedef struct strSPARK_EFFECT{ 8 | unsigned char flag; 9 | unsigned char age; 10 | float curX,curY; 11 | float lastX,lastY; 12 | float velX,velY; 13 | float angle; 14 | }SPARK_EFFECT; 15 | 16 | class CStage; 17 | 18 | class CSparkEffect 19 | { 20 | friend class CStage; 21 | 22 | protected: 23 | float m_clipXLow,m_clipXHigh,m_clipYLow,m_clipYHigh; 24 | 25 | protected: 26 | CStage *m_pStage; 27 | 28 | protected: 29 | SPARK_EFFECT m_spark[SPARK_EFFECT_N_RECORD]; 30 | 31 | public: 32 | void AddEffect(float origX,float origY,float baseSpeed,int nTrail,bool isExplode); 33 | void Initialize(); 34 | void Step(); 35 | void Draw(); 36 | 37 | public: 38 | CSparkEffect(CStage *pStage); 39 | ~CSparkEffect(void); 40 | }; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /Game/Stage/SpecialBullet/CurvingBullet.cpp: -------------------------------------------------------------------------------- 1 | #include ".\curvingbullet.h" 2 | #include "../Stage.h" 3 | #include "../Chara/Chara.h" 4 | 5 | namespace th5w{ 6 | 7 | CCurvingBullet::CCurvingBullet(void) 8 | { 9 | } 10 | 11 | CCurvingBullet::~CCurvingBullet(void) 12 | { 13 | } 14 | 15 | void CCurvingBullet::Initialize() 16 | { 17 | memset(m_bullet,0,sizeof(m_bullet)); 18 | } 19 | 20 | void CCurvingBullet::AddBullet(float origX,float origY,float angle, float speed, unsigned char colorIdx) 21 | { 22 | for (int i=0;im_pStageRes->m_palette[colorIdx*3]/255.0f; 31 | m_bullet[i].color[1]=m_pStage->m_pStageRes->m_palette[colorIdx*3+1]/255.0f; 32 | m_bullet[i].color[2]=m_pStage->m_pStageRes->m_palette[colorIdx*3+2]/255.0f; 33 | for (int j=0;j<16;j++) 34 | { 35 | m_bullet[i].nodeX[j]=origX; 36 | m_bullet[i].nodeY[j]=origY; 37 | } 38 | m_bullet[i].mode=1; 39 | break; 40 | } 41 | } 42 | 43 | void CCurvingBullet::Step() 44 | { 45 | for (int i=0;i=1;j--) 51 | { 52 | m_bullet[i].nodeX[j]=m_bullet[i].nodeX[j-1]; 53 | m_bullet[i].nodeY[j]=m_bullet[i].nodeY[j-1]; 54 | if (m_pStage->m_pChara->TestCrash(m_bullet[i].nodeX[j],m_bullet[i].nodeY[j],6.0f*16.0f,6.0f*16.0f)) 55 | m_pStage->m_pChara->m_bMiss=true; 56 | } 57 | if (m_bullet[i].nodeX[15]<=-16.0f*16.0f||m_bullet[i].nodeX[15]>=400.0f*16.0f 58 | ||m_bullet[i].nodeY[15]<=-16.0f*16.0f||m_bullet[i].nodeY[15]>=384.0f*16.0f) 59 | { 60 | m_bullet[i].flag=0; 61 | continue; 62 | } 63 | m_bullet[i].nodeX[0]+=m_bullet[i].velX; 64 | m_bullet[i].nodeY[0]+=m_bullet[i].velY; 65 | if (m_pStage->m_pChara->TestCrash(m_bullet[i].nodeX[0],m_bullet[i].nodeY[0],8.0f*16.0f,8.0f*16.0f)) 66 | m_pStage->m_pChara->m_bMiss=true; 67 | 68 | if (m_bullet[i].mode==1) 69 | { 70 | m_bullet[i].speed-=1; 71 | if (m_bullet[i].speed<=4) 72 | m_bullet[i].mode=2; 73 | } 74 | else 75 | m_bullet[i].speed+=(float)(m_pStage->m_curFrame%2+1); 76 | int deltaAngle=(int)(m_bullet[i].angle- 77 | m_pStage->m_pChara->AngleToChara(m_bullet[i].nodeX[0],m_bullet[i].nodeY[0])); 78 | while(deltaAngle<-128) 79 | deltaAngle+=256; 80 | while(deltaAngle>=128) 81 | deltaAngle-=256; 82 | if (abs(deltaAngle)>2) 83 | { 84 | if (deltaAngle>0) 85 | m_bullet[i].angle-=1; 86 | else 87 | m_bullet[i].angle+=1; 88 | } 89 | else 90 | m_bullet[i].angle-=deltaAngle; 91 | m_bullet[i].velX=(float)cos(m_bullet[i].angle/256.0f*2*PI)*m_bullet[i].speed; 92 | m_bullet[i].velY=(float)sin(m_bullet[i].angle/256.0f*2*PI)*m_bullet[i].speed; 93 | } 94 | } 95 | 96 | void CCurvingBullet::Draw() 97 | { 98 | for (int i=0;im_pStageRes->DrawCircle(m_bullet[i].nodeX[j],m_bullet[i].nodeY[j],10.0f*16.0f, 104 | m_bullet[i].color[0],m_bullet[i].color[1],m_bullet[i].color[2],true); 105 | } 106 | } 107 | 108 | } 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /Game/Stage/SpecialBullet/CurvingBullet.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace th5w{ 4 | 5 | #define CURVING_BULLET_N_RECORD 8 6 | 7 | typedef struct strCURVING_BULLET{ 8 | unsigned char flag; 9 | float angle; 10 | float nodeX[16],nodeY[16]; 11 | float velX,velY; 12 | int age; 13 | float speed; 14 | float color[3]; 15 | int mode; //1 for speed dec, 2 for speed inc 16 | }CURVING_BULLET; 17 | 18 | class CStage; 19 | 20 | class CCurvingBullet 21 | { 22 | protected: 23 | CURVING_BULLET m_bullet[CURVING_BULLET_N_RECORD]; 24 | public: 25 | CStage *m_pStage; 26 | 27 | void Initialize(); 28 | void AddBullet(float origX,float origY,float angle, float speed, unsigned char colorIdx); 29 | void Step(); 30 | void Draw(); 31 | 32 | public: 33 | CCurvingBullet(void); 34 | ~CCurvingBullet(void); 35 | }; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /Game/Stage/SpecialBullet/KnifeBullet.cpp: -------------------------------------------------------------------------------- 1 | #include ".\knifebullet.h" 2 | #include "../Stage.h" 3 | #include "../Chara/Chara.h" 4 | #include "../Circle/Circle.h" 5 | 6 | namespace th5w{ 7 | 8 | CKnifeBullet::CKnifeBullet(void) 9 | { 10 | } 11 | 12 | CKnifeBullet::~CKnifeBullet(void) 13 | { 14 | } 15 | 16 | void CKnifeBullet::Initialize() 17 | { 18 | memset(m_bullet,0,sizeof(m_bullet)); 19 | } 20 | 21 | void CKnifeBullet::AddBullet(float origX,float origY,float angle,float speed, int cooldown) 22 | { 23 | float speed1=m_pStage->AdjustSpeedBasedOnPlayerPerformance(speed); 24 | for (int i=0;im_pEnemyBullet->AdjustBulletImageBasedOnAngle(193,angle); 34 | m_bullet[i].speed=speed1; 35 | m_bullet[i].cooldown=cooldown; 36 | m_pStage->m_pCircle->AddCircle(origX,origY,0.6f,0.6f,1.0f,false); 37 | break; 38 | } 39 | } 40 | 41 | void CKnifeBullet::Step() 42 | { 43 | for (int i=0;im_pEnemyBullet->GetClearBulletTimeLeft()!=0&&m_bullet[i].flag==1) 48 | { 49 | m_bullet[i].flag=2; 50 | m_bullet[i].cooldown=0; 51 | } 52 | if (m_bullet[i].cooldown>0) 53 | { 54 | m_bullet[i].cooldown--; 55 | if (m_bullet[i].cooldown==0) 56 | { 57 | m_bullet[i].img=m_pStage->m_pEnemyBullet->AdjustBulletImageBasedOnAngle(193,m_bullet[i].angle); 58 | m_pStage->m_bPlaySound[3]=true; 59 | } 60 | else 61 | { 62 | if (i%2==0) 63 | { 64 | m_bullet[i].img+=2; 65 | if (m_bullet[i].img>=225) 66 | m_bullet[i].img-=32; 67 | } 68 | else 69 | { 70 | m_bullet[i].img-=2; 71 | if (m_bullet[i].img<193) 72 | m_bullet[i].img+=32; 73 | } 74 | continue; 75 | } 76 | } 77 | m_bullet[i].lastX=m_bullet[i].curX; 78 | m_bullet[i].lastY=m_bullet[i].curY; 79 | m_bullet[i].curX+=m_bullet[i].velX; 80 | m_bullet[i].curY+=m_bullet[i].velY; 81 | if (m_bullet[i].curX<=-16.0f*16.0f||m_bullet[i].curX>=400.0f*16.0f 82 | ||m_bullet[i].curY<=-16.0f*16.0f||m_bullet[i].curY>=384.0f*16.0f) 83 | { 84 | m_bullet[i].flag=0; 85 | continue; 86 | } 87 | if (m_bullet[i].flag==2) 88 | { 89 | if (m_bullet[i].img<225) 90 | { 91 | m_bullet[i].img=225; 92 | m_bullet[i].velX/=2.0f; 93 | m_bullet[i].velY/=2.0f; 94 | m_bullet[i].vanishAge=0; 95 | } 96 | else 97 | { 98 | m_bullet[i].vanishAge++; 99 | if (m_bullet[i].vanishAge%4==0) 100 | { 101 | m_bullet[i].img++; 102 | if (m_bullet[i].img>=229) 103 | m_bullet[i].flag=0; 104 | } 105 | } 106 | continue; 107 | } 108 | if (m_pStage->m_pChara->TestCrash(m_bullet[i].curX,m_bullet[i].curY,7.0f*16.0f,7.0f*16.0f)) 109 | { 110 | m_pStage->m_pChara->m_bMiss=true; 111 | m_bullet[i].flag=2; 112 | } 113 | } 114 | } 115 | 116 | void CKnifeBullet::Draw() 117 | { 118 | for (int i=0;im_pStageRes->m_patternArray.GetImagePtr(m_bullet[i].img); 122 | m_pStage->m_pStageRes->DrawStageObjectImage(pImg,m_bullet[i].curX,m_bullet[i].curY); 123 | } 124 | } 125 | 126 | } 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /Game/Stage/SpecialBullet/KnifeBullet.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../EnemyBullet/EnemyBullet.h" 3 | 4 | namespace th5w{ 5 | 6 | #define KNIFE_BULLET_N_RECORD 63 7 | 8 | typedef struct strKNIFE_BULLET{ 9 | unsigned char flag; 10 | float angle; 11 | float curX,curY; 12 | float lastX,lastY; 13 | float velX,velY; 14 | int cooldown; 15 | int img; 16 | int vanishAge; 17 | float speed; 18 | }KNIFE_BULLET; 19 | 20 | class CStage; 21 | 22 | class CKnifeBullet 23 | { 24 | protected: 25 | KNIFE_BULLET m_bullet[KNIFE_BULLET_N_RECORD]; 26 | 27 | public: 28 | CStage *m_pStage; 29 | 30 | void Initialize(); 31 | void AddBullet(float origX,float origY,float angle,float speed, int cooldown); 32 | void Step(); 33 | void Draw(); 34 | 35 | public: 36 | CKnifeBullet(void); 37 | ~CKnifeBullet(void); 38 | }; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Game/Stage/SpecialBullet/LargeBullet.cpp: -------------------------------------------------------------------------------- 1 | #include ".\largebullet.h" 2 | #include "../Stage.h" 3 | #include "../Chara/Chara.h" 4 | 5 | namespace th5w{ 6 | 7 | CLargeBullet::CLargeBullet(void) 8 | { 9 | } 10 | 11 | CLargeBullet::~CLargeBullet(void) 12 | { 13 | } 14 | 15 | void CLargeBullet::Initialize() 16 | { 17 | memset(m_bullet,0,sizeof(m_bullet)); 18 | } 19 | 20 | void CLargeBullet::AddBullet(float origX,float origY,int imgIdx,float angle, float speed, 21 | int life,bool bSplit,ENEMY_SHOOT_INFO *shootInfo) 22 | { 23 | float speed1=m_pStage->AdjustSpeedBasedOnPlayerPerformance(speed); 24 | for (int i=0;i=400.0f*16.0f 56 | ||m_bullet[i].curY<=-16.0f*16.0f||m_bullet[i].curY>=384.0f*16.0f) 57 | { 58 | m_bullet[i].flag=0; 59 | continue; 60 | } 61 | if (m_bullet[i].flag==2) 62 | { 63 | if (m_bullet[i].age%4==0) 64 | { 65 | m_bullet[i].img++; 66 | if (m_bullet[i].img>=228) 67 | m_bullet[i].flag=0; 68 | } 69 | continue; 70 | } 71 | if (m_pStage->m_pChara->TestCrash(m_bullet[i].curX,m_bullet[i].curY,8.0f*16.0f,8.0f*16.0f)) 72 | m_pStage->m_pChara->m_bMiss=true; 73 | 74 | int dmg=m_pStage->GetDamageFromChara(m_bullet[i].curX,m_bullet[i].curY,8.0f*16.0f,8.0f*16.0f,false); 75 | m_bullet[i].bHit=false; 76 | if (dmg>0) 77 | { 78 | if (m_bullet[i].img!=212) 79 | { 80 | m_pStage->m_bPlaySound[10]=true; 81 | continue; 82 | } 83 | m_bullet[i].bHit=true; 84 | m_bullet[i].life-=dmg; 85 | m_pStage->m_bPlaySound[4]=true; 86 | if (m_bullet[i].life<0) 87 | { 88 | m_bullet[i].flag++; 89 | m_bullet[i].age=0; 90 | m_bullet[i].img=224; 91 | m_bullet[i].velX/=4.0f; 92 | m_bullet[i].velY/=4.0f; 93 | m_pStage->AddScore(550); 94 | if (m_bullet[i].bSplit&&m_bullet[i].curY<=240.0f*16.0f) 95 | { 96 | m_bullet[i].shootInfo.shootOrigX=m_bullet[i].curX; 97 | m_bullet[i].shootInfo.shootOrigY=m_bullet[i].curY; 98 | m_pStage->m_pEnemyBullet->Shoot(&m_bullet[i].shootInfo); 99 | } 100 | m_pStage->m_bPlaySound[3]=true; 101 | } 102 | } 103 | } 104 | } 105 | 106 | void CLargeBullet::Draw() 107 | { 108 | for (int i=0;im_pStageRes->m_patternArray.GetImagePtr(imgIdx); 119 | m_pStage->m_pStageRes->DrawStageObjectImage(pImg,m_bullet[i].curX,m_bullet[i].curY); 120 | } 121 | } 122 | 123 | } 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /Game/Stage/SpecialBullet/LargeBullet.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../EnemyBullet/EnemyBullet.h" 3 | 4 | namespace th5w{ 5 | 6 | #define LARGE_BULLET_N_RECORD 63 7 | 8 | typedef struct strLARGE_BULLET{ 9 | unsigned char flag; 10 | float angle; 11 | float curX,curY; 12 | float lastX,lastY; 13 | float velX,velY; 14 | int age; 15 | bool bSplit; 16 | int img; 17 | int life; 18 | bool bHit; 19 | float speed; 20 | ENEMY_SHOOT_INFO shootInfo; 21 | }LARGE_BULLET; 22 | 23 | class CStage; 24 | 25 | class CLargeBullet 26 | { 27 | protected: 28 | LARGE_BULLET m_bullet[LARGE_BULLET_N_RECORD]; 29 | 30 | public: 31 | CStage *m_pStage; 32 | 33 | void Initialize(); 34 | void AddBullet(float origX,float origY,int imgIdx,float angle, float speed, 35 | int life,bool bSplit,ENEMY_SHOOT_INFO *shootInfo); 36 | void Step(); 37 | void Draw(); 38 | 39 | public: 40 | CLargeBullet(void); 41 | ~CLargeBullet(void); 42 | }; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Game/Stage/SpecialBullet/ShinkiBullet.cpp: -------------------------------------------------------------------------------- 1 | #include ".\shinkibullet.h" 2 | #include "../Stage.h" 3 | #include "../Chara/Chara.h" 4 | 5 | namespace th5w{ 6 | 7 | CShinkiBullet::CShinkiBullet(void) 8 | { 9 | } 10 | 11 | CShinkiBullet::~CShinkiBullet(void) 12 | { 13 | } 14 | 15 | void CShinkiBullet::Initialize() 16 | { 17 | memset(m_bullet,0,sizeof(m_bullet)); 18 | } 19 | 20 | void CShinkiBullet::AddBullet(float origX,float origY,int imgIdx,float angle, float speed) 21 | { 22 | float speed1=m_pStage->AdjustSpeedBasedOnPlayerPerformance(speed); 23 | for (int i=0;i16.001f*16.0f) 47 | continue; 48 | m_bullet[i].flag++; 49 | } 50 | if (m_pStage->m_pEnemyBullet->GetClearBulletTimeLeft()!=0||m_pStage->m_pEnemyBullet->m_noEnemyBullet!=0) 51 | m_bullet[i].flag=3; 52 | m_bullet[i].curX+=m_bullet[i].velX; 53 | m_bullet[i].curY+=m_bullet[i].velY; 54 | if (m_bullet[i].curX<=-16.0f*16.0f||m_bullet[i].curX>=400.0f*16.0f 55 | ||m_bullet[i].curY<=-16.0f*16.0f||m_bullet[i].curY>=384.0f*16.0f) 56 | { 57 | m_bullet[i].flag=0; 58 | continue; 59 | } 60 | if (m_bullet[i].flag==3) 61 | { 62 | if (m_bullet[i].img<204) 63 | { 64 | m_bullet[i].img=204; 65 | m_bullet[i].velX/=2.0f; 66 | m_bullet[i].velY/=2.0f; 67 | m_bullet[i].vanishAge=0; 68 | } 69 | else 70 | { 71 | m_bullet[i].vanishAge++; 72 | if (m_bullet[i].vanishAge%4==0) 73 | { 74 | m_bullet[i].img++; 75 | if (m_bullet[i].img>=208) 76 | m_bullet[i].flag=0; 77 | } 78 | } 79 | } 80 | else 81 | { 82 | if (m_pStage->m_pChara->TestCrash(m_bullet[i].curX,m_bullet[i].curY,8.0f*16.0f,8.0f*16.0f)) 83 | { 84 | m_pStage->m_pChara->m_bMiss=true; 85 | m_bullet[i].flag=3; 86 | } 87 | } 88 | } 89 | } 90 | 91 | void CShinkiBullet::Draw() 92 | { 93 | for (int i=0;im_pStageRes->DrawCircle(m_bullet[i].curX,m_bullet[i].curY,m_bullet[i].radius,1,1,1,true); 98 | else 99 | { 100 | C2DImage *pImg=m_pStage->m_pStageRes->m_patternArray.GetImagePtr(m_bullet[i].img); 101 | m_pStage->m_pStageRes->DrawStageObjectImage(pImg,m_bullet[i].curX,m_bullet[i].curY); 102 | } 103 | } 104 | } 105 | 106 | } 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /Game/Stage/SpecialBullet/ShinkiBullet.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../EnemyBullet/EnemyBullet.h" 3 | 4 | namespace th5w{ 5 | 6 | #define SHINKI_BULLET_N_RECORD 63 7 | 8 | typedef struct strSHINKI_BULLET{ 9 | unsigned char flag; 10 | float curX,curY; 11 | float velX,velY; 12 | int img; 13 | float radius; 14 | int vanishAge; 15 | }SHINKI_BULLET; 16 | 17 | class CStage; 18 | 19 | class CShinkiBullet 20 | { 21 | protected: 22 | SHINKI_BULLET m_bullet[SHINKI_BULLET_N_RECORD]; 23 | 24 | public: 25 | CStage *m_pStage; 26 | 27 | void Initialize(); 28 | void AddBullet(float origX,float origY,int imgIdx,float angle, float speed); 29 | void Step(); 30 | void Draw(); 31 | 32 | public: 33 | CShinkiBullet(void); 34 | ~CShinkiBullet(void); 35 | }; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /Game/Stage/Stage2BG/Stage2BG.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace th5w{ 4 | 5 | #define STAGE2BG_SPRITE_N_RECORD 64 6 | typedef struct strSTAGE2BG_SPRITE{ 7 | unsigned char flag; 8 | float angle; 9 | float curX,curY; 10 | float lastX,lastY; 11 | float velX,velY; 12 | int age; 13 | }STAGE2BG_SPRITE; 14 | 15 | class CStage; 16 | 17 | class CStage2BG 18 | { 19 | friend class CStage; 20 | 21 | protected: 22 | CStage *m_pStage; 23 | 24 | protected: 25 | int m_scrScale; 26 | STAGE2BG_SPRITE m_bgSprite[STAGE2BG_SPRITE_N_RECORD]; 27 | int m_nSprite; 28 | int m_spriteColorScale; 29 | int m_spriteColorDeltaScale; 30 | 31 | 32 | protected: 33 | void StepSprites(); 34 | void RegenerateSprite(int recordIdx); 35 | public: 36 | void Initialize(); 37 | void Step(); 38 | void Draw(); 39 | 40 | public: 41 | CStage2BG(CStage *pStage); 42 | ~CStage2BG(void); 43 | }; 44 | 45 | } -------------------------------------------------------------------------------- /Game/Stage/StageResource.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/Game/Stage/StageResource.cpp -------------------------------------------------------------------------------- /Game/Stage/StageResource.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../gameLib/Graphic/2DImageArray.h" 3 | #include "../../gameLib/CommonFunction/CommonFunctionGraphic.h" 4 | #include "../../gameLib/CommonFunction/CommonFunctionMusicSE.h" 5 | #include "../../gameLib/CommonFunction/CommonFunctionInput.h" 6 | #include "../../gameLib/th5DatFile/bb/BBFile.h" 7 | #include "../../gameLib/th5DatFile/mpn/MPNFile.h" 8 | #include "../../gameLib/th5DatFile/std/STDFile.h" 9 | 10 | namespace th5w{ 11 | 12 | class CStage; 13 | 14 | class CStageResource 15 | { 16 | public: 17 | CStage *m_pStage; 18 | 19 | //images 20 | public: 21 | C2DImageArray m_patternArray; 22 | C2DImageArray m_spriteArray; 23 | C2DImage *m_pImgDotBullet; 24 | C2DImage *m_pImgDotBulletShadow; 25 | C2DImage *m_pImgSpark[8]; 26 | C2DImage *m_pImgNumber[10]; 27 | 28 | CBBFile *m_pCharaBombBB; 29 | CBBFile *m_pStageBB; 30 | C2DImage *m_pImgLogo; 31 | 32 | char m_translatedStageName[7][1000]; 33 | char m_translatedStageBGMName[7][1000]; 34 | char m_translatedStageBossBGMName[7][1000]; 35 | char m_stage4BossPart2BGMNames[2][1000]; 36 | char m_crossRow[1000]; 37 | 38 | public: 39 | unsigned char m_palette[48]; 40 | 41 | public: 42 | C2DImageArray m_mpnArray; 43 | CSTDFile *m_pStageStd; 44 | unsigned char *m_stageMap; 45 | public: 46 | void InitImages(); 47 | void InitSpecificImages(); 48 | void LoadStageDataFiles(); 49 | 50 | public: 51 | void Initialize(); 52 | void InitTranslation(); 53 | 54 | public: 55 | void DrawGauge(int curValue,int fullValue,int drawX,int drawY,float colorR,float colorG,float colorB); 56 | void DrawNumber(int numX,int numY,int number,int nDigit,bool leadingZero,bool rightAlign, 57 | float colorR,float colorG,float colorB); 58 | void DrawStageObjectImage(C2DImage *pImage,float gameCoordX,float gameCoordY); 59 | void DrawStageObjectImageColorScaled(C2DImage *pImage,float gameCoordX,float gameCoordY, 60 | float colorR,float colorG,float colorB); 61 | void DrawStageObjectImageWhiteMask(C2DImage *pImage,float gameCoordX,float gameCoordY); 62 | void ClearPlayArea(float colorR,float colorG,float colorB); 63 | void DrawCircle(float gameCoordX,float gameCoordY,float radius, 64 | float colorR,float colorG,float colorB,bool bSolid,float alpha=1.0f); 65 | void DrawLine(float gameCoordSrcX,float gameCoordSrcY,float gameCoordTarX,float gameCoordTarY, 66 | float colorR,float colorG,float colorB,float width); 67 | void DrawRectangle(float gameCoordX,float gameCoordY,float width,float height, 68 | float colorR,float colorG,float colorB,bool bSolid,float alpha=1.0f); 69 | void DrawPoint(float gameCoordX,float gameCoordY,float colorR,float colorG,float colorB); 70 | void DrawPlayAreaMask(unsigned char *pMask,float colorR,float colorG,float colorB); 71 | 72 | 73 | public: 74 | C2DImageArray m_txtBBArray; 75 | 76 | public: 77 | CStageResource(CStage *pStage); 78 | ~CStageResource(void); 79 | }; 80 | 81 | } 82 | -------------------------------------------------------------------------------- /Game/Stage/Summary/Summary.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/Game/Stage/Summary/Summary.cpp -------------------------------------------------------------------------------- /Game/Stage/Summary/Summary.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace th5w{ 4 | 5 | class CStage; 6 | 7 | class CSummary 8 | { 9 | friend class CStage; 10 | 11 | protected: 12 | CStage *m_pStage; 13 | bool m_bRunning; 14 | int m_curFrame; 15 | 16 | public: 17 | __forceinline void Run() {m_bRunning=true;} 18 | __forceinline void Stop() {m_bRunning=false;} 19 | void Initialize(); 20 | void Step(); 21 | void Draw(); 22 | 23 | protected: 24 | void StepNormalSummary(); 25 | void StepEndGameSummary(); 26 | void DrawNormalSummary(); 27 | void DrawEndGameSummary(); 28 | void DrawItem(int textIdx,int row,bool useRed); 29 | 30 | public: 31 | CSummary(CStage *pStage); 32 | ~CSummary(void); 33 | }; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Game/Stage/TextOverlay/TextOverlay.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace th5w{ 5 | 6 | #define TEXT_OVERLAY_NONE 0 7 | #define TEXT_OVERLAY_STAGE_FADE_IN 1 8 | #define TEXT_OVERLAY_DRAW_STAGE_NAME_BGM_NAME 2 9 | #define TEXT_OVERLAY_STAGE_FADE_OUT 3 10 | 11 | class CStage; 12 | 13 | class CTextOverlay 14 | { 15 | friend class CStage; 16 | 17 | protected: 18 | CStage *m_pStage; 19 | int m_curMode; 20 | 21 | int m_stageFadeTimer; 22 | 23 | int m_stageNameBGMNameTimer; 24 | char m_stageName[100]; 25 | char m_bgmName[100]; 26 | 27 | protected: 28 | void StepStageFadeIn(); 29 | void DrawStageFadeIn(); 30 | void StepStageNameBGMName(); 31 | void DrawStageNameBGMName(); 32 | void StepStageFadeOut(); 33 | void DrawStageFadeOut(); 34 | 35 | public: 36 | void Initialize(); 37 | void Step(); 38 | void Draw(); 39 | void SetMode(int mode,char *stageName=NULL,char *bgmName=NULL); 40 | public: 41 | CTextOverlay(CStage *pStage); 42 | ~CTextOverlay(void); 43 | }; 44 | 45 | } 46 | -------------------------------------------------------------------------------- /Game/TitleScreen/TitleRollingTama.cpp: -------------------------------------------------------------------------------- 1 | #include ".\titlerollingtama.h" 2 | #include "../../gameLib/CommonFunction/CommonFunctionGraphic.h" 3 | #include "../Game.h" 4 | 5 | namespace th5w{ 6 | 7 | CTitleRollingTama::CTitleRollingTama(void) 8 | { 9 | for (int i=0;i<8;i++) 10 | m_rollingImg[i]=NULL; 11 | } 12 | 13 | CTitleRollingTama::~CTitleRollingTama(void) 14 | { 15 | for (int i=0;i<8;i++) 16 | if (m_rollingImg[i]) 17 | { 18 | m_rollingImg[i]->Destroy(); 19 | m_rollingImg[i]=NULL; 20 | } 21 | } 22 | 23 | void CTitleRollingTama::Initialize() 24 | { 25 | m_curScrFade=100; 26 | m_curFrame=0; 27 | 28 | CCommonFunctionGraphic::LoadPIFromDat(&m_rollingImg[0],m_palette,&CGame::s_pCurGame->m_th5Dat1,"OP2A.PI"); 29 | CCommonFunctionGraphic::LoadPIFromDat(&m_rollingImg[1],NULL,&CGame::s_pCurGame->m_th5Dat1,"OP2B.PI"); 30 | CCommonFunctionGraphic::LoadPIFromDat(&m_rollingImg[2],NULL,&CGame::s_pCurGame->m_th5Dat1,"OP2C.PI"); 31 | CCommonFunctionGraphic::LoadPIFromDat(&m_rollingImg[3],NULL,&CGame::s_pCurGame->m_th5Dat1,"OP2D.PI"); 32 | CCommonFunctionGraphic::LoadPIFromDat(&m_rollingImg[4],NULL,&CGame::s_pCurGame->m_th5Dat1,"OP2E.PI"); 33 | CCommonFunctionGraphic::LoadPIFromDat(&m_rollingImg[5],NULL,&CGame::s_pCurGame->m_th5Dat1,"OP2F.PI"); 34 | CCommonFunctionGraphic::LoadPIFromDat(&m_rollingImg[6],NULL,&CGame::s_pCurGame->m_th5Dat1,"OP2G.PI"); 35 | CCommonFunctionGraphic::LoadPIFromDat(&m_rollingImg[7],NULL,&CGame::s_pCurGame->m_th5Dat1,"OP2H.PI"); 36 | } 37 | 38 | int CTitleRollingTama::Step() 39 | { 40 | m_curScrFade=m_curFrame+64; 41 | { 42 | if (m_curScrFade>100) 43 | m_curScrFade=100; 44 | } 45 | if (m_curFrame==64) 46 | return 1; 47 | return 0; 48 | } 49 | 50 | void CTitleRollingTama::Draw() 51 | { 52 | glClearColor(m_palette[3]/255.0f,m_palette[4]/255.0f,m_palette[5]/255.0f,1); 53 | glClear(GL_COLOR_BUFFER_BIT); 54 | 55 | int drawImgIdx=m_curFrame/8; 56 | if (drawImgIdx>=8) 57 | drawImgIdx=7; 58 | m_rollingImg[drawImgIdx]->Draw(0,278+40); 59 | CCommonFunctionGraphic::ScreenFade((float)m_curScrFade); 60 | 61 | m_curFrame++; 62 | } 63 | 64 | } 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /Game/TitleScreen/TitleRollingTama.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "../../gameLib/Graphic/2DImage.h" 4 | 5 | namespace th5w{ 6 | 7 | class CTitleRollingTama 8 | { 9 | protected: 10 | int m_curScrFade; 11 | int m_curFrame; 12 | C2DImage *m_rollingImg[8]; 13 | unsigned char m_palette[48]; 14 | 15 | public: 16 | void Initialize(); 17 | int Step(); 18 | void Draw(); 19 | 20 | public: 21 | CTitleRollingTama(void); 22 | ~CTitleRollingTama(void); 23 | }; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Game/TitleScreen/TitleScreen.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/Game/TitleScreen/TitleScreen.cpp -------------------------------------------------------------------------------- /Game/TitleScreen/TitleScreen.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\scheme.h" 3 | #include "../../gameLib/Graphic/2DImageArray.h" 4 | #include "TitleRollingTama.h" 5 | 6 | #define TITLESCREEN_END_QUIT_GAME 1 7 | #define TITLESCREEN_END_START_GAME 2 8 | #define TITLESCREEN_END_START_EXTRA 3 9 | #define TITLESCREEN_END_CHOOSE_REPLAY 4 10 | #define TITLESCREEN_END_VIEW_HIGHSCORE 5 11 | 12 | namespace th5w{ 13 | 14 | class CTitleScreen : public CScheme 15 | { 16 | protected: 17 | int m_curFrame; 18 | 19 | C2DImage *m_pMenuImgPractice; 20 | C2DImage *m_pMenuImgReplay; 21 | th5w::C2DImageArray m_spriteArray; 22 | th5w::C2DImageArray m_patternArray; 23 | unsigned char m_globalPalette[48]; 24 | 25 | int m_curScrFade; 26 | 27 | int m_flagRollingTama; //0 for not played, 1 for playing, 2 for played 28 | CTitleRollingTama m_tama; 29 | 30 | bool m_bInitWithRollTama; 31 | 32 | C2DImage *m_pLastTamaWithAlpha; 33 | th5w::C2DImage *m_pBGImage; 34 | int m_bgFade; 35 | 36 | //menu vars 37 | int m_mainMenuNItem; 38 | int m_mainMenuCursorPosition; 39 | bool m_bMainMenuItemEnabled[6]; 40 | 41 | int m_optionMenuNItem; 42 | int m_optionMenuCursorPosition; 43 | bool m_bOptionMenuItemEnabled[6]; 44 | 45 | int m_curMenu; //1 for main menu, 1 for option menu 46 | bool m_bMenuOn; 47 | 48 | unsigned short m_lastKeyState; 49 | 50 | protected: 51 | bool m_bQuit; 52 | int m_quitCode; 53 | 54 | public: 55 | void Initialize(bool bRollTama,int cursorInitialPos=0, bool bSwitchMusic=true); 56 | virtual int Step(); 57 | virtual void Draw(); 58 | 59 | protected: 60 | void DrawBackground(); 61 | void DrawMainMenuItems(); 62 | void DrawOptionMenuItems(); 63 | void DrawMainMenuCursor(); 64 | void DrawOptionMenuCursor(); 65 | void OnRollTamaEnd(); 66 | void ParseKeyEvent(); 67 | void DrawDescString(char *descStr); 68 | 69 | protected: 70 | __forceinline void ChangeValue(int *value, int deltaValue, int minValue,int maxValue) 71 | { 72 | (*value)+=deltaValue; 73 | if ((*value)maxValue) (*value)-=maxValue-minValue+1; 75 | } 76 | 77 | protected: 78 | void MoveCursorInMenu(int *cursorPos,int deltaPos,int nItem,bool *bItemMask); 79 | 80 | public: 81 | CTitleScreen(void); 82 | virtual ~CTitleScreen(void); 83 | }; 84 | 85 | } 86 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | The following text was taken from the original author Pegasy 2 | 3 | Introduction 4 | ============ 5 | This is an unofficial port of the game Touhou Kaikidan: Mystic Square (the fifth game of the touhou series, referred to as th05 below) to windows. It faithfully reproduces almost all features of the original PC98 version. Check "Comparison" section for the details 6 | 7 | Usage 8 | ===== 9 | 1. Extract all files into a folder. 10 | 2. Download glew from http://glew.sourceforge.net/ (download the binaries) and extract glew32.dll into the same folder. 11 | 3. Download PMDWin from http://c60.fmp.jp/ and extract PMDWin.dll into the same folder. 12 | 4. (Optional) Put anex86.bmp into the same foldeer. (google it to find out how to get this file) 13 | 5. Put 怪綺談1.dat, 怪綺談2.dat and ZUN.com from the orignal PC98 version into the same folder (these files may have different names depending on you system's code page, for example, 夦鉟択1.dat in chinese code page) 14 | 5.1 If you only have an .hdi file that contains the original game, you can: 15 | 5.1.1 Download anex86 (google it to find the download link) 16 | 5.1.2 Use anxdiet that is included in anex86 to open the .hdi file 17 | 5.1.3 Drag the three need files to the destination folder 18 | 6. Rename 怪綺談1.dat to kaiki1.dat, 怪綺談2.dat to kaiki2.dat. 19 | 7. Run uth05win.exe. 20 | 21 | To start the game without translation, open config.ini and comment the line with "MOD_FILE = chs.dat" 22 | 23 | Comparison 24 | ========== 25 | New features in this ported version: 26 | * replay support 27 | * translated into chinese (can be turned off) 28 | * fixed a number of bugs in the PC98 version 29 | * uses float instead of int where necessary, increasing accuracy 30 | 31 | Features not ported in this version: 32 | * Music room 33 | * demo play 34 | * staff roll 35 | * player performance evaluation 36 | * some options 37 | 38 | Controls 39 | ======== 40 | Similar to other games of touhou series: 41 | Z Shoot 42 | X Bomb 43 | Shift Slow move 44 | Ctrl skip dialog 45 | ESC Menu 46 | 47 | To toggle fullscreen mode, press alt + enter. 48 | 49 | Game pad is not supported. 50 | 51 | Known bugs 52 | ========== 53 | When you switch to/from full screen mode, the font texture may become corrupted. 54 | 55 | Copyright 56 | ========= 57 | 1999 Team Shanghai Alice 58 | 2011 Pegasy 59 | This program is in the public domain. 60 | 61 | The assets and libraries it uses belongs to their authors. Check their webpage for copyright information 62 | 63 | This program uses: 64 | * assets from th05 (http://www.kt.rim.or.jp/~aotaka/am/index.htm) 65 | * The OpenGL Extension Wrangler Library (http://glew.sourceforge.net/) 66 | * PMDWin (http://c60.fmp.jp/) 67 | 68 | 69 | Misc 70 | ==== 71 | For bug report and feature request, please contact the one you received this program from:) 72 | -------------------------------------------------------------------------------- /SE/s01.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/SE/s01.wav -------------------------------------------------------------------------------- /SE/s02.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/SE/s02.wav -------------------------------------------------------------------------------- /SE/s03.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/SE/s03.wav -------------------------------------------------------------------------------- /SE/s04.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/SE/s04.wav -------------------------------------------------------------------------------- /SE/s05.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/SE/s05.wav -------------------------------------------------------------------------------- /SE/s06.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/SE/s06.wav -------------------------------------------------------------------------------- /SE/s07.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/SE/s07.wav -------------------------------------------------------------------------------- /SE/s08.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/SE/s08.wav -------------------------------------------------------------------------------- /SE/s09.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/SE/s09.wav -------------------------------------------------------------------------------- /SE/s10.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/SE/s10.wav -------------------------------------------------------------------------------- /SE/s11.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/SE/s11.wav -------------------------------------------------------------------------------- /SE/s12.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/SE/s12.wav -------------------------------------------------------------------------------- /SE/s13.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/SE/s13.wav -------------------------------------------------------------------------------- /SE/s14.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/SE/s14.wav -------------------------------------------------------------------------------- /SE/s15.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/SE/s15.wav -------------------------------------------------------------------------------- /chs.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/chs.dat -------------------------------------------------------------------------------- /config.ini: -------------------------------------------------------------------------------- 1 | //never use spaces in variable names or values 2 | //do not use tabs either 3 | //the comment mark "//" should only be used at the beginning of a line. 4 | //variable names are case sensitive! CASE SENSITIVE!! CaSe SeNsItIvE!!! 5 | 6 | //file name of the mod file 7 | //comment this line to disable mod file and use standard version 8 | MOD_FILE = chs.dat 9 | 10 | //create a console window for debug information 11 | //0 to disable, non-zero to enable. 12 | //disabled in default 13 | CONSOLE_WINDOW = 1 14 | -------------------------------------------------------------------------------- /game.cfg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/game.cfg -------------------------------------------------------------------------------- /gameLib/CommonFunction/CommonFunctionGraphic.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Graphic/2DImage.h" 3 | #include "../Graphic/2DImageArray.h" 4 | #include "../th5DatFile/bft/BFTFile.h" 5 | #include "../th5DatFile/CD2CDG/CD2CDGFile.h" 6 | #include "../th5DatFile/pi/PIFile.h" 7 | #include "../th5DatFile/th5DatFile.h" 8 | 9 | 10 | namespace th5w{ 11 | 12 | class CCommonFunctionGraphic 13 | { 14 | public: 15 | static bool LoadPIFromDat(C2DImage** pRet,unsigned char *outPalette,Cth5DatFile *pDatFile,char *piFileName); 16 | static bool LoadCD2CDGFromDat(C2DImage** pRet,Cth5DatFile *pDatFile,char *cd2cdgFileName,int spriteIdx, unsigned char *inPalette); 17 | static bool LoadCD2CDGAllSpriteFromDat(C2DImageArray *pOutImgArray,Cth5DatFile *pDatFile, 18 | char *cd2cdgFileName,unsigned char *inPalette); 19 | static bool LoadBFTFromDat(C2DImage** pRet,unsigned char *outPalette,Cth5DatFile *pDatFile, 20 | char *bftFileName,int patternIdx,int transparentColorIdx); 21 | static bool LoadBFTAllPatternFromDat(C2DImageArray *pOutImgArray,unsigned char *outPalette, 22 | Cth5DatFile *pDatFile,char *bftFileName,int transparentColorIdx, 23 | unsigned char *inPalette=NULL); 24 | static bool LoadBinaryImageFile(C2DImage **pRet,unsigned char transparentColor[3], const char *fileName); 25 | static void ScreenFade(float fadeScale); //0: black, 100: normal, 200: white, value between: linearly interpolated 26 | static void DrawRectangle(float XLow,float YLow,float XHigh,float YHigh, 27 | float colorR,float colorG,float colorB,float alpha=1.0f,bool bSolid=true); 28 | public: 29 | CCommonFunctionGraphic(void); 30 | ~CCommonFunctionGraphic(void); 31 | }; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /gameLib/CommonFunction/CommonFunctionInput.cpp: -------------------------------------------------------------------------------- 1 | #include ".\commonfunctioninput.h" 2 | #include "../../Game/Game.h" 3 | 4 | namespace th5w{ 5 | 6 | CCommonFunctionInput::CCommonFunctionInput(void) 7 | { 8 | } 9 | 10 | CCommonFunctionInput::~CCommonFunctionInput(void) 11 | { 12 | } 13 | 14 | unsigned short CCommonFunctionInput::GetAllKeyState() 15 | { 16 | //key state map: 17 | //low byte bits: 18 | // 7 6 5 4 3 2 1 0 19 | // left control left shift z x right left down up 20 | //high byte bits: 21 | // 7 6 5 4 3 2 1 0 22 | // q enter esc 23 | 24 | CGame::s_pCurGame->m_input.UpdateKeyState(); 25 | unsigned short ret=0; 26 | ret|=((unsigned short)CGame::s_pCurGame->m_input.GetKeyState(DIK_UP))<<0; 27 | ret|=((unsigned short)CGame::s_pCurGame->m_input.GetKeyState(DIK_DOWN))<<1; 28 | ret|=((unsigned short)CGame::s_pCurGame->m_input.GetKeyState(DIK_LEFT))<<2; 29 | ret|=((unsigned short)CGame::s_pCurGame->m_input.GetKeyState(DIK_RIGHT))<<3; 30 | ret|=((unsigned short)CGame::s_pCurGame->m_input.GetKeyState(DIK_X))<<4; 31 | ret|=((unsigned short)CGame::s_pCurGame->m_input.GetKeyState(DIK_Z))<<5; 32 | //PC98 version does not include shift status in the key state but manage it in another variable 33 | ret|=((unsigned short)CGame::s_pCurGame->m_input.GetKeyState(DIK_LSHIFT))<<6; 34 | ret|=((unsigned short)CGame::s_pCurGame->m_input.GetKeyState(DIK_LCONTROL))<<7; 35 | 36 | ret|=((unsigned short)CGame::s_pCurGame->m_input.GetKeyState(DIK_ESCAPE))<<12; 37 | ret|=((unsigned short)CGame::s_pCurGame->m_input.GetKeyState(DIK_RETURN))<<13; 38 | ret|=((unsigned short)CGame::s_pCurGame->m_input.GetKeyState(DIK_Q))<<14; 39 | 40 | return ret; 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /gameLib/CommonFunction/CommonFunctionInput.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace th5w{ 4 | 5 | class CCommonFunctionInput 6 | { 7 | public: 8 | static unsigned short GetAllKeyState(); 9 | __forceinline static bool UpKey(unsigned short keyState) 10 | { 11 | return (keyState&1)!=0; 12 | } 13 | __forceinline static bool DownKey(unsigned short keyState) 14 | { 15 | return (keyState&2)!=0; 16 | } 17 | __forceinline static bool LeftKey(unsigned short keyState) 18 | { 19 | return (keyState&4)!=0; 20 | } 21 | __forceinline static bool RightKey(unsigned short keyState) 22 | { 23 | return (keyState&8)!=0; 24 | } 25 | __forceinline static bool XKey(unsigned short keyState) 26 | { 27 | return (keyState&16)!=0; 28 | } 29 | __forceinline static bool ZKey(unsigned short keyState) 30 | { 31 | return (keyState&32)!=0; 32 | } 33 | __forceinline static bool LShiftKey(unsigned short keyState) 34 | { 35 | return (keyState&64)!=0; 36 | } 37 | __forceinline static bool LCtrlKey(unsigned short keyState) 38 | { 39 | return (keyState&128)!=0; 40 | } 41 | __forceinline static bool ESCKey(unsigned short keyState) 42 | { 43 | return (keyState&4096)!=0; 44 | } 45 | __forceinline static bool EnterKey(unsigned short keyState) 46 | { 47 | return (keyState&8192)!=0; 48 | } 49 | __forceinline static bool QKey(unsigned short keyState) 50 | { 51 | return (keyState&16384)!=0; 52 | } 53 | __forceinline static bool UpPressed(unsigned short keyState,unsigned short lastState) 54 | { 55 | return (keyState&(~lastState)&1)!=0; 56 | } 57 | __forceinline static bool DownPressed(unsigned short keyState,unsigned short lastState) 58 | { 59 | return (keyState&(~lastState)&2)!=0; 60 | } 61 | __forceinline static bool LeftPressed(unsigned short keyState,unsigned short lastState) 62 | { 63 | return (keyState&(~lastState)&4)!=0; 64 | } 65 | __forceinline static bool RightPressed(unsigned short keyState,unsigned short lastState) 66 | { 67 | return (keyState&(~lastState)&8)!=0; 68 | } 69 | __forceinline static bool XPressed(unsigned short keyState,unsigned short lastState) 70 | { 71 | return (keyState&(~lastState)&16)!=0; 72 | } 73 | __forceinline static bool ZPressed(unsigned short keyState,unsigned short lastState) 74 | { 75 | return (keyState&(~lastState)&32)!=0; 76 | } 77 | __forceinline static bool LShiftPressed(unsigned short keyState,unsigned short lastState) 78 | { 79 | return (keyState&(~lastState)&64)!=0; 80 | } 81 | __forceinline static bool LCtrlPressed(unsigned short keyState,unsigned short lastState) 82 | { 83 | return (keyState&(~lastState)&128)!=0; 84 | } 85 | __forceinline static bool ESCPressed(unsigned short keyState,unsigned short lastState) 86 | { 87 | return (keyState&(~lastState)&4096)!=0; 88 | } 89 | __forceinline static bool EnterPressed(unsigned short keyState,unsigned short lastState) 90 | { 91 | return (keyState&(~lastState)&8192)!=0; 92 | } 93 | __forceinline static bool QPressed(unsigned short keyState,unsigned short lastState) 94 | { 95 | return (keyState&(~lastState)&16384)!=0; 96 | } 97 | public: 98 | CCommonFunctionInput(void); 99 | ~CCommonFunctionInput(void); 100 | }; 101 | 102 | } 103 | -------------------------------------------------------------------------------- /gameLib/CommonFunction/CommonFunctionMusicSE.cpp: -------------------------------------------------------------------------------- 1 | #include ".\commonfunctionmusicse.h" 2 | 3 | namespace th5w{ 4 | 5 | CCommonFunctionMusicSE::CCommonFunctionMusicSE(void) 6 | { 7 | } 8 | 9 | CCommonFunctionMusicSE::~CCommonFunctionMusicSE(void) 10 | { 11 | } 12 | 13 | bool CCommonFunctionMusicSE::LoadMusicToPMDFromDat(Cth5DatFile *pDatFile,char *musicFileName) 14 | { 15 | int musicFileIdx; 16 | musicFileIdx=pDatFile->GetChildFileIndex(musicFileName); 17 | if (musicFileIdx==-1) 18 | return false; 19 | 20 | if (th5w::CPMDPlayer::LoadPMDData(pDatFile->GetChildFileContentPointer(musicFileIdx), 21 | pDatFile->GetChildFileLength(musicFileIdx))==false) 22 | return false; 23 | 24 | return true; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /gameLib/CommonFunction/CommonFunctionMusicSE.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../th5DatFile/th5DatFile.h" 3 | #include "../PMDPlayer/PMDPlayer.h" 4 | 5 | namespace th5w{ 6 | 7 | class CCommonFunctionMusicSE 8 | { 9 | public: 10 | static bool LoadMusicToPMDFromDat(Cth5DatFile *pDatFile,char *musicFileName); 11 | public: 12 | CCommonFunctionMusicSE(void); 13 | ~CCommonFunctionMusicSE(void); 14 | }; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /gameLib/CommonFunction/CommonFunctionSystem.cpp: -------------------------------------------------------------------------------- 1 | #include ".\commonfunctionsystem.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "../Misc/md5.h" 8 | #include "../Misc/sha1.h" 9 | 10 | namespace th5w{ 11 | 12 | CCommonFunctionSystem::CCommonFunctionSystem(void) 13 | { 14 | } 15 | 16 | CCommonFunctionSystem::~CCommonFunctionSystem(void) 17 | { 18 | } 19 | 20 | void CCommonFunctionSystem::CreateConsoleWindow() 21 | { 22 | int hConHandle; 23 | long lStdHandle; 24 | FILE *fp; 25 | // allocate a console for this appc 26 | AllocConsole(); 27 | // set the screen buffer to be big enough to let us scroll text 28 | // GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &coninfo); 29 | // coninfo.dwSize.Y = MAX_CONSOLE_LINES; 30 | // How many lines do you want to have in the console buffer 31 | // SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), coninfo.dwSize); 32 | // redirect unbuffered STDOUT to the console 33 | // g_hConsoleOut = GetStdHandle(STD_OUTPUT_HANDLE); 34 | lStdHandle = (long)(__int64)GetStdHandle(STD_OUTPUT_HANDLE); 35 | hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); 36 | fp = _fdopen( hConHandle, "w" ); 37 | *stdout = *fp; 38 | setvbuf( stdout, NULL, _IONBF, 0 ); 39 | // redirect unbuffered STDIN to the console 40 | lStdHandle = (long)(__int64)GetStdHandle(STD_INPUT_HANDLE); 41 | hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); 42 | fp = _fdopen( hConHandle, "r" ); 43 | *stdin = *fp; 44 | setvbuf( stdin, NULL, _IONBF, 0 ); 45 | // redirect unbuffered STDERR to the console 46 | lStdHandle = (long)(__int64)GetStdHandle(STD_ERROR_HANDLE); 47 | hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); 48 | fp = _fdopen( hConHandle, "w" ); 49 | *stderr = *fp; 50 | setvbuf( stderr, NULL, _IONBF, 0 ); 51 | SetConsoleTitle(_T("Console")); 52 | // make cout, wcout, cin, wcin, wcerr, cerr, wclog and clog m_lastPoint to console as well 53 | // Uncomment the next line if you are using c++ cio or comment if you don't 54 | } 55 | 56 | bool CCommonFunctionSystem::GetFileMD5(unsigned char *retMD5,const char *fileName) 57 | { 58 | MD5_CTX ctxMD5; 59 | MD5Init(&ctxMD5); 60 | FILE *fp=fopen(fileName,"rb"); 61 | if (fp==NULL) 62 | return false; 63 | int blockSize=1024*128; 64 | unsigned char *buffer=new unsigned char[blockSize]; 65 | if (buffer==NULL) 66 | { 67 | fclose(fp); 68 | return false; 69 | } 70 | int nRead; 71 | while((nRead=(int)fread(buffer,1,blockSize,fp))>0) 72 | MD5Update(&ctxMD5,buffer,nRead); 73 | delete buffer; 74 | MD5Final(retMD5,&ctxMD5); 75 | 76 | return true; 77 | } 78 | 79 | } 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /gameLib/CommonFunction/CommonFunctionSystem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace th5w{ 4 | 5 | class CCommonFunctionSystem 6 | { 7 | public: 8 | static void CreateConsoleWindow(); 9 | static bool GetFileMD5(unsigned char *retMD5,const char *fileName); 10 | public: 11 | CCommonFunctionSystem(void); 12 | ~CCommonFunctionSystem(void); 13 | }; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /gameLib/Graphic/2DImage.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "include/glew.h" 4 | #include 5 | 6 | namespace th5w{ 7 | 8 | class C2DImage 9 | { 10 | public: 11 | int m_width,m_height; 12 | protected: 13 | int m_texWidth,m_texHeight; 14 | protected: 15 | unsigned char *m_data; 16 | GLuint m_texID; 17 | public: 18 | __forceinline GLuint GetTexID(){return m_texID;} 19 | 20 | public: 21 | static C2DImage* Create2DImage(int width,int height); 22 | void Destroy(); 23 | unsigned char* GetDataPointer(); 24 | bool UploadToTexture(); 25 | void Draw(float drawX,float drawY,float fadeInScale=1.0,float drawScale=1.0,bool bUseAlpha=true, 26 | bool coordIsUpperLeft=true, bool bDepthTest=false,float drawDepth=0.0); 27 | void DrawColorScaled(float drawX,float drawY,float colorScaleR,float colorScaleG, 28 | float colorScaleB,bool coordIsUpperLeft=true); 29 | void DrawWhiteMask(float drawX,float drawY,bool coordIsUpperLeft=true); 30 | 31 | protected: 32 | C2DImage(void); 33 | ~C2DImage(void); 34 | }; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /gameLib/Graphic/2DImageArray.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include ".\2dimagearray.h" 3 | 4 | namespace th5w{ 5 | 6 | C2DImageArray::C2DImageArray(void) 7 | { 8 | } 9 | 10 | C2DImageArray::~C2DImageArray(void) 11 | { 12 | UnloadRange(0); 13 | } 14 | 15 | void C2DImageArray::UnloadImage(int imgIdx) 16 | { 17 | if (imgIdx<0||imgIdx>=NImage()) 18 | return; 19 | if (m_vp2DImage[imgIdx]!=NULL) 20 | { 21 | m_vp2DImage[imgIdx]->Destroy(); 22 | m_vp2DImage[imgIdx]=NULL; 23 | } 24 | if (imgIdx==NImage()-1) 25 | m_vp2DImage.pop_back(); 26 | } 27 | 28 | void C2DImageArray::UnloadRange(int rangeStart) 29 | { 30 | while(NImage()>rangeStart) 31 | UnloadImage(NImage()-1); 32 | } 33 | 34 | void C2DImageArray::AddImage(C2DImage *pImage) 35 | { 36 | m_vp2DImage.push_back(pImage); 37 | } 38 | 39 | C2DImage* C2DImageArray::GetImagePtr(int imgIdx) 40 | { 41 | if (imgIdx<0||imgIdx>=NImage()) 42 | return NULL; 43 | return m_vp2DImage[imgIdx]; 44 | } 45 | 46 | void C2DImageArray::DrawMulti(int idxStart,int nImage,float drawX,float drawY,float fadeInScale,float drawScale, 47 | bool bUseAlpha,bool coordIsUpperLeft, bool bDepthTest,float drawDepth) 48 | { 49 | for (int i=idxStart;i=NImage()) 52 | return; 53 | m_vp2DImage[i]->Draw(drawX,drawY,fadeInScale,drawScale,bUseAlpha,coordIsUpperLeft,bDepthTest,drawDepth); 54 | drawX+=m_vp2DImage[i]->m_width*drawScale; 55 | } 56 | } 57 | 58 | } 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /gameLib/Graphic/2DImageArray.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "2DImage.h" 4 | 5 | namespace th5w{ 6 | 7 | class C2DImageArray 8 | { 9 | protected: 10 | std::vector m_vp2DImage; 11 | public: 12 | __forceinline int NImage() 13 | { 14 | return (int)m_vp2DImage.size(); 15 | } 16 | void UnloadImage(int imgIdx); //unload one image 17 | void UnloadRange(int rangeStart); //unload images from rangeStart to last image 18 | void AddImage(C2DImage *pImage); 19 | void DrawMulti(int idxStart,int nImage,float drawX,float drawY,float fadeInScale=1.0,float drawScale=1.0, 20 | bool bUseAlpha=true,bool coordIsUpperLeft=true, bool bDepthTest=false,float drawDepth=0.0); 21 | 22 | C2DImage* GetImagePtr(int imgIdx); 23 | public: 24 | C2DImageArray(void); 25 | ~C2DImageArray(void); 26 | }; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /gameLib/Graphic/GLContext.cpp: -------------------------------------------------------------------------------- 1 | #include ".\glcontext.h" 2 | #include 3 | #include 4 | 5 | namespace th5w{ 6 | namespace gl{ 7 | 8 | CGLContext::CGLContext(void) 9 | { 10 | m_hWnd=NULL; 11 | m_hDC=NULL; 12 | m_hRC=NULL; 13 | } 14 | 15 | CGLContext::~CGLContext(void) 16 | { 17 | if (m_hRC) 18 | { 19 | ::wglDeleteContext(m_hRC); 20 | ::ReleaseDC(m_hWnd,m_hDC); 21 | } 22 | } 23 | 24 | bool CGLContext::Init(HWND hWnd) 25 | { 26 | HDC lastDC=::wglGetCurrentDC(); 27 | HGLRC lastRC=::wglGetCurrentContext(); 28 | if (m_hRC!=NULL) 29 | return false; 30 | 31 | HDC hDC=::GetDC(hWnd); 32 | if (hDC==NULL) 33 | { 34 | printf("[CGLContext::Init] error getting hDC from hWnd.\n"); 35 | return false; 36 | } 37 | 38 | 39 | static PIXELFORMATDESCRIPTOR pfd= 40 | { 41 | sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd 42 | 1, // version number 43 | PFD_DRAW_TO_WINDOW | // support window 44 | PFD_SUPPORT_OPENGL | // support OpenGL 45 | PFD_DOUBLEBUFFER, // double buffered 46 | PFD_TYPE_RGBA, // RGBA type 47 | 24, // 24-bit color depth 48 | 0, 0, 0, 0, 0, 0, // color bits ignored 49 | 8, // 8-bit alpha buffer 50 | 0, // shift bit ignored 51 | 0, // no accumulation buffer 52 | 0, 0, 0, 0, // accumulation bits ignored 53 | 32, // 32-bit z-buffer 54 | 8, // 8-bit stencil buffer 55 | 0, // no auxiliary buffer 56 | PFD_MAIN_PLANE, // main layer 57 | 0, // reserved 58 | 0, 0, 0 // layer masks ignored 59 | }; 60 | 61 | int pixelformat=::ChoosePixelFormat(hDC,&pfd); 62 | 63 | if (pixelformat==0) 64 | { 65 | printf("[CGLContext::Init] error finding proper pixel format.\n"); 66 | ::ReleaseDC(hWnd,hDC); 67 | return false; 68 | } 69 | 70 | if (::SetPixelFormat(hDC,pixelformat,&pfd)==FALSE) 71 | { 72 | printf("[CGLContext::Init] error setting DC's pixel format to %d.\n",pixelformat); 73 | ::ReleaseDC(hWnd,hDC); 74 | return false; 75 | } 76 | 77 | //Create Rendering Context 78 | HGLRC hRC=::wglCreateContext(hDC); 79 | if (hRC==NULL) 80 | { 81 | printf("[CGLContext::Init] error creating rendering context.\n"); 82 | ::ReleaseDC(hWnd,hDC); 83 | return false; 84 | } 85 | 86 | //Make the RC Current 87 | if(::wglMakeCurrent(hDC,hRC)==FALSE) 88 | { 89 | printf("[CGLContext::Init] error making the rendering context current.\n"); 90 | ::wglDeleteContext(hRC); 91 | ::ReleaseDC(hWnd,hDC); 92 | return false; 93 | } 94 | 95 | //Init extension lib 96 | glewInit(); 97 | 98 | // Usual OpenGL stuff 99 | glShadeModel(GL_SMOOTH); 100 | glPixelStorei(GL_PACK_ALIGNMENT,1); 101 | glPixelStorei(GL_UNPACK_ALIGNMENT,1); 102 | glReadBuffer(GL_BACK_LEFT); 103 | 104 | ::wglMakeCurrent(lastDC,lastRC); 105 | 106 | m_hWnd=hWnd; 107 | m_hDC=hDC; 108 | m_hRC=hRC; 109 | 110 | return true; 111 | } 112 | 113 | bool CGLContext::MakeCurrent() 114 | { 115 | if (m_hRC==NULL) 116 | { 117 | printf("[CGLContext::MakeCurrent] error. Context not created yet.\n"); 118 | return false; 119 | } 120 | 121 | if (::wglMakeCurrent(m_hDC,m_hRC)==FALSE) 122 | { 123 | printf("[CGLContext::MakeCurrent] error. Cannot make the context current.\n"); 124 | return false; 125 | } 126 | 127 | return true; 128 | } 129 | 130 | bool CGLContext::SwapBuffers() 131 | { 132 | if (m_hRC==NULL) 133 | { 134 | printf("[CGLContext::SwapBuffers] error. Context not created yet.\n"); 135 | return false; 136 | } 137 | 138 | ::SwapBuffers(m_hDC); 139 | return true; 140 | } 141 | } 142 | } -------------------------------------------------------------------------------- /gameLib/Graphic/GLContext.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "mygl.h" 4 | 5 | namespace th5w{ 6 | namespace gl{ 7 | 8 | class CGLContext 9 | { 10 | protected: 11 | HWND m_hWnd; 12 | HDC m_hDC; 13 | HGLRC m_hRC; 14 | 15 | public: 16 | bool Init(HWND hWnd); 17 | bool MakeCurrent(); 18 | bool SwapBuffers(); 19 | public: 20 | CGLContext(void); 21 | ~CGLContext(void); 22 | }; 23 | 24 | } 25 | } -------------------------------------------------------------------------------- /gameLib/Graphic/PC98Font.h: -------------------------------------------------------------------------------- 1 | /* 2 | This class is NOT thread-safe. Make sure not to call is simultaneously from multiple threads 3 | */ 4 | 5 | #pragma once 6 | #include "../Graphic/include/glew.h" 7 | #include 8 | 9 | namespace th5w{ 10 | 11 | class CPC98Font 12 | { 13 | protected: 14 | static bool s_bFontLoaded; 15 | static GLuint s_fontTex; 16 | 17 | protected: 18 | static bool s_bCacheInited; 19 | static int s_curCacheWriteIdx; 20 | static int s_charIdxInCache[65536]; 21 | static int s_cacheList[200]; 22 | static GLuint s_displayListBase; 23 | 24 | protected: 25 | static GLuint s_CommonCharTex; 26 | 27 | public: 28 | static bool CreateTextureForCommonChar(); 29 | static void DestroyTextureForCommonChar(); 30 | 31 | 32 | protected: 33 | static int ConvertCharToTexXY(float *outX,float *outY,unsigned char *str); 34 | static GLuint GetDisplayListForChar(int charIdx); 35 | 36 | public: 37 | static bool LoadAnex86BMP(const char *fileName); 38 | static bool DrawString(char *str,int nChar,int drawX,int drawY,float colorR,float colorG,float colorB, 39 | float fadeInScale=1.0,bool coordIsUpperLeft=true); //the string must be in Shift-JIS code 40 | static void FinalizeCache(); 41 | public: 42 | CPC98Font(void); 43 | ~CPC98Font(void); 44 | }; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /gameLib/Graphic/Th5ExtFont.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Graphic/include/glew.h" 3 | #include 4 | 5 | namespace th5w{ 6 | 7 | class CTh5ExtFont 8 | { 9 | protected: 10 | static bool s_bFontLoaded; 11 | static GLuint s_fontTex; 12 | public: 13 | static bool LoadZUNCOM(const char *fileName); 14 | static void DrawExtChar(unsigned char extChar,int drawX,int drawY,float colorR,float colorG,float colorB, 15 | float fadeInScale=1.0,bool coordIsUpperLeft=true); 16 | static void DrawExtString(const unsigned char *extStr,int nChar,int drawX,int drawY, 17 | float colorR,float colorG,float colorB, 18 | float fadeInScale=1.0,bool coordIsUpperLeft=true,bool bReverse=false); 19 | 20 | public: 21 | CTh5ExtFont(void); 22 | ~CTh5ExtFont(void); 23 | }; 24 | 25 | } -------------------------------------------------------------------------------- /gameLib/Graphic/mygl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "include/glew.h" 3 | #include "include/wglew.h" 4 | #include 5 | 6 | namespace mh{ 7 | namespace gl{ 8 | enum INTERNAL_FORMAT{ 9 | IFORMAT_RGB_F16 = GL_RGB16F_ARB, 10 | IFORMAT_RGBA_F16 = GL_RGBA16F_ARB, 11 | IFORMAT_RGB_F32 = GL_RGB32F_ARB, 12 | IFORMAT_RGBA_F32 = GL_RGBA32F_ARB, 13 | IFORMAT_RGB = GL_RGB, 14 | IFORMAT_RGBA = GL_RGBA, 15 | IFORMAT_DEPTH = GL_DEPTH_COMPONENT, 16 | IFORMAT_DEPTH_F32 = GL_DEPTH_COMPONENT32, 17 | IFORMAT_STENCIL = GL_STENCIL_INDEX, 18 | IFORMAT_NOTSET = -1 19 | }; 20 | enum EXTERNAL_FORMAT{ 21 | EFORMAT_RGB = GL_RGB, 22 | EFORMAT_RGBA = GL_RGBA, 23 | EFORMAT_DEPTH = GL_DEPTH_COMPONENT, 24 | EFORMAT_RED = GL_RED 25 | }; 26 | enum TYPE{ 27 | TYPE_UBYTE = GL_UNSIGNED_BYTE, 28 | TYPE_FLOAT = GL_FLOAT 29 | }; 30 | } 31 | } -------------------------------------------------------------------------------- /gameLib/Input/KeyInputDI.cpp: -------------------------------------------------------------------------------- 1 | #include ".\keyinputdi.h" 2 | 3 | namespace th5w{ 4 | 5 | CKeyInputDI::CKeyInputDI(void) 6 | { 7 | m_pDInput8=NULL; 8 | m_pDInputKeyboardDevice=NULL; 9 | } 10 | 11 | CKeyInputDI::~CKeyInputDI(void) 12 | { 13 | if (m_pDInputKeyboardDevice!=NULL) 14 | { 15 | m_pDInputKeyboardDevice->Release(); 16 | m_pDInputKeyboardDevice=NULL; 17 | } 18 | if (m_pDInput8!=NULL) 19 | { 20 | m_pDInput8->Release(); 21 | m_pDInput8=NULL; 22 | } 23 | 24 | } 25 | 26 | bool CKeyInputDI::Initialize() 27 | { 28 | if (m_pDInput8!=NULL) 29 | return false; 30 | 31 | if (DirectInput8Create(GetModuleHandle(NULL),DIRECTINPUT_VERSION,IID_IDirectInput8,(LPVOID *)&m_pDInput8,NULL)!=DI_OK) 32 | return false; 33 | 34 | if (m_pDInput8->CreateDevice(GUID_SysKeyboard, &m_pDInputKeyboardDevice, NULL)!=DI_OK) 35 | { 36 | m_pDInput8->Release(); 37 | m_pDInput8=NULL; 38 | return false; 39 | } 40 | 41 | if (m_pDInputKeyboardDevice->SetDataFormat(&c_dfDIKeyboard)!=DI_OK) 42 | { 43 | m_pDInputKeyboardDevice->Release(); 44 | m_pDInputKeyboardDevice=NULL; 45 | m_pDInput8->Release(); 46 | m_pDInput8=NULL; 47 | return false; 48 | } 49 | 50 | if (m_pDInputKeyboardDevice->Acquire()!=DI_OK) 51 | { 52 | m_pDInputKeyboardDevice->Release(); 53 | m_pDInputKeyboardDevice=NULL; 54 | m_pDInput8->Release(); 55 | m_pDInput8=NULL; 56 | return false; 57 | } 58 | 59 | return true; 60 | } 61 | 62 | bool CKeyInputDI::UpdateKeyState() 63 | { 64 | HRESULT getDevStateRes; 65 | getDevStateRes=m_pDInputKeyboardDevice->GetDeviceState(256,m_keyState); 66 | if (getDevStateRes!=DI_OK) 67 | { 68 | if (getDevStateRes==DIERR_INPUTLOST) 69 | { 70 | if (m_pDInputKeyboardDevice->Acquire()==DI_OK) 71 | getDevStateRes=m_pDInputKeyboardDevice->GetDeviceState(256,m_keyState); 72 | } 73 | } 74 | if (getDevStateRes!=DI_OK) 75 | return false; 76 | 77 | return true; 78 | } 79 | 80 | } -------------------------------------------------------------------------------- /gameLib/Input/KeyInputDI.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef DIRECTINPUT_VERSION 4 | #define DIRECTINPUT_VERSION 0x0800 5 | #endif 6 | 7 | #include 8 | 9 | #pragma comment(lib,"dinput8.lib") 10 | //#pragma comment(lib,"dinput.lib") 11 | #pragma comment(lib,"dxguid.lib") 12 | 13 | namespace th5w{ 14 | 15 | class CKeyInputDI 16 | { 17 | protected: 18 | LPDIRECTINPUT8 m_pDInput8; 19 | LPDIRECTINPUTDEVICE8 m_pDInputKeyboardDevice; 20 | BYTE m_keyState[256]; 21 | 22 | public: 23 | bool Initialize(); 24 | bool UpdateKeyState(); 25 | __forceinline unsigned char GetKeyState(int keyScanCode) const 26 | { 27 | return m_keyState[keyScanCode]>>7; 28 | } 29 | public: 30 | CKeyInputDI(void); 31 | ~CKeyInputDI(void); 32 | }; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /gameLib/Misc/md5.h: -------------------------------------------------------------------------------- 1 | /* MD5.H - header file for MD5C.C 2 | */ 3 | 4 | /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All 5 | rights reserved. 6 | 7 | License to copy and use this software is granted provided that it 8 | is identified as the "RSA Data Security, Inc. MD5 Message-Digest 9 | Algorithm" in all material mentioning or referencing this software 10 | or this function. 11 | 12 | License is also granted to make and use derivative works provided 13 | that such works are identified as "derived from the RSA Data 14 | Security, Inc. MD5 Message-Digest Algorithm" in all material 15 | mentioning or referencing the derived work. 16 | 17 | RSA Data Security, Inc. makes no representations concerning either 18 | the merchantability of this software or the suitability of this 19 | software for any particular purpose. It is provided "as is" 20 | without express or implied warranty of any kind. 21 | 22 | These notices must be retained in any copies of any part of this 23 | documentation and/or software. 24 | */ 25 | 26 | /* MD5 context. */ 27 | 28 | typedef struct { 29 | unsigned long int state[4]; /* state (ABCD) */ 30 | unsigned long int count[2]; /* number of bits, modulo 2^64 (lsb first) */ 31 | unsigned char buffer[64]; /* input buffer */ 32 | } MD5_CTX; 33 | 34 | void MD5Init(MD5_CTX *); 35 | void MD5Update(MD5_CTX *, unsigned char *, unsigned int); 36 | void MD5Final(unsigned char [16], MD5_CTX *); 37 | -------------------------------------------------------------------------------- /gameLib/Misc/sha1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sha1.h 3 | * 4 | * Description: 5 | * This is the header file for code which implements the Secure 6 | * Hashing Algorithm 1 as defined in FIPS PUB 180-1 published 7 | * April 17, 1995. 8 | * 9 | * Many of the variable names in this code, especially the 10 | * single character names, were used because those were the names 11 | * used in the publication. 12 | * 13 | * Please read the file sha1.c for more information. 14 | * 15 | */ 16 | 17 | #ifndef _SHA1_H_ 18 | #define _SHA1_H_ 19 | 20 | //#include 21 | /* 22 | * If you do not have the ISO standard stdint.h header file, then you 23 | * must typdef the following: 24 | * name meaning 25 | * uint32_t unsigned 32 bit integer 26 | * uint8_t unsigned 8 bit integer (i.e., unsigned char) 27 | * int_least16_t integer of >= 16 bits 28 | * 29 | */ 30 | //defined in .cpp instead of .h 31 | 32 | 33 | #ifndef _SHA_enum_ 34 | #define _SHA_enum_ 35 | enum 36 | { 37 | shaSuccess = 0, 38 | shaNull, /* Null pointer parameter */ 39 | shaInputTooLong, /* input data too long */ 40 | shaStateError /* called Input after Result */ 41 | }; 42 | #endif 43 | #define SHA1HashSize 20 44 | 45 | /* 46 | * This structure will hold context information for the SHA-1 47 | * hashing operation 48 | */ 49 | typedef struct SHA1Context 50 | { 51 | unsigned int Intermediate_Hash[SHA1HashSize/4]; /* Message Digest */ 52 | 53 | unsigned int Length_Low; /* Message length in bits */ 54 | unsigned int Length_High; /* Message length in bits */ 55 | 56 | /* Index into message block array */ 57 | int Message_Block_Index; 58 | unsigned char Message_Block[64]; /* 512-bit message blocks */ 59 | 60 | int Computed; /* Is the digest computed? */ 61 | int Corrupted; /* Is the message digest corrupted? */ 62 | } SHA1Context; 63 | 64 | /* 65 | * Function Prototypes 66 | */ 67 | 68 | int SHA1Reset( SHA1Context *); 69 | int SHA1Input( SHA1Context *, 70 | const unsigned char *, 71 | unsigned int); 72 | int SHA1Result( SHA1Context *, 73 | unsigned char Message_Digest[SHA1HashSize]); 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /gameLib/PMDPlayer/PMDPlayer.h: -------------------------------------------------------------------------------- 1 | /* 2 | As the PMDWin.dll is NOT thread-safe, this class has all members static and constructor private. 3 | construction/destruction is done via static functions Initialize/Finalize 4 | This class itself is also not thread safe. Be sure not to make simultaneous calls from multiple 5 | threads. 6 | */ 7 | #pragma once 8 | #include 9 | #include 10 | #include 11 | using namespace std; 12 | #pragma comment(lib,"dsound.lib") 13 | #pragma comment(lib,"dxguid.lib") 14 | 15 | namespace th5w{ 16 | 17 | class CPMDPlayer 18 | { 19 | protected: 20 | static LPDIRECTSOUND8 s_pDSound8; 21 | static LPDIRECTSOUNDBUFFER8 s_pDSoundBuffer8; 22 | const static int s_bufNSeg=5; 23 | static HANDLE s_hEvent[s_bufNSeg+1]; 24 | static bool s_bMusicDataExist; 25 | static DWORD s_playThreadID; 26 | static HANDLE s_hPlayThread; 27 | static bool s_bInitialized; 28 | 29 | static CRITICAL_SECTION s_csLocalBuf; 30 | const static int s_localBufferLength=882000; //keep this at least twice as large as BUFFER_SEG_LENGTH 31 | //which is defined in cpp 32 | //this value must also be multiple of 4 33 | static int s_localBufferReadHead; 34 | static int s_localBufferWriteHead; 35 | static unsigned char s_localBuffer[s_localBufferLength]; 36 | 37 | protected: 38 | static bool InitPMDWin(); 39 | public: 40 | static bool Initialize(HWND hWnd); 41 | static bool LoadPMDData(unsigned char *musicData,int size); 42 | static bool UnloadPMDData(); 43 | static void Play(); 44 | static void Pause(); 45 | static void Resume(); 46 | static void Finalize(); 47 | static void SetFrequency(int newFreq); 48 | static void SetVolume(float volume); //0 silence, 100 normal, no amplification 49 | 50 | static void OnDeactivate(); 51 | static void OnActivate(); 52 | 53 | static void SetPlayThreadPriority(int nPriority); 54 | protected: 55 | static bool s_bPlayingWhenLastDeactivate; 56 | 57 | public: 58 | static bool FillSoftwareBuffer(int nSample); //1 sample occupies 4 bytes, return false if software buffer 59 | //is full 60 | protected: 61 | static bool CopyFromSoftwareBuffer(unsigned char *outBuf,int copyLen); //return false if software buffer in empty 62 | static DWORD WINAPI PlayThread(void *pParam); 63 | static LPDIRECTSOUNDBUFFER8 CreateBasicBuffer(); 64 | private: 65 | CPMDPlayer(void); 66 | ~CPMDPlayer(void); 67 | }; 68 | 69 | } 70 | -------------------------------------------------------------------------------- /gameLib/SE/SoundEffect.cpp: -------------------------------------------------------------------------------- 1 | #include ".\soundeffect.h" 2 | #include 3 | #include 4 | 5 | namespace th5w{ 6 | 7 | CSoundEffect::CSoundEffect(void) 8 | { 9 | } 10 | 11 | CSoundEffect::~CSoundEffect(void) 12 | { 13 | } 14 | 15 | bool CSoundEffect::Initialize(HWND hWnd) 16 | { 17 | if (m_manager.Initialize(hWnd,DSSCL_PRIORITY)!=S_OK) 18 | return false; 19 | 20 | m_vpSound.clear(); 21 | m_vpSound.push_back(NULL); 22 | CSound *pSound; 23 | for (int i=1;i<16;i++) 24 | { 25 | TCHAR fileName[1000]; 26 | wsprintf(fileName,_T("SE/s%02d.wav"),i); 27 | if (m_manager.Create(&pSound,fileName,DSBCAPS_CTRLPAN|DSBCAPS_CTRLVOLUME|DSBCAPS_CTRLFREQUENCY| 28 | DSBCAPS_GLOBALFOCUS|DSBCAPS_CTRLPOSITIONNOTIFY|DSBCAPS_LOCSOFTWARE)!=S_OK) 29 | return false; 30 | m_vpSound.push_back(pSound); 31 | } 32 | 33 | return true; 34 | } 35 | 36 | void CSoundEffect::PlaySound(int soundIdx) 37 | { 38 | if (soundIdx<0||soundIdx>=(int)m_vpSound.size()) 39 | return; 40 | if (m_vpSound[soundIdx]==NULL) 41 | return; 42 | 43 | m_vpSound[soundIdx]->Stop(); 44 | m_vpSound[soundIdx]->Reset(); 45 | m_vpSound[soundIdx]->Play(); 46 | } 47 | 48 | } -------------------------------------------------------------------------------- /gameLib/SE/SoundEffect.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "../../include/DSUtil/dsutil.h" 5 | using namespace std; 6 | 7 | #pragma comment(lib,"Winmm.lib") 8 | //#pragma comment(lib,"dxerr9.lib") 9 | 10 | namespace th5w{ 11 | 12 | class CSoundEffect 13 | { 14 | protected: 15 | CSoundManager m_manager; 16 | vector m_vpSound; 17 | public: 18 | bool Initialize(HWND hWnd); 19 | void PlaySound(int soundIdx); 20 | public: 21 | CSoundEffect(void); 22 | ~CSoundEffect(void); 23 | }; 24 | 25 | } -------------------------------------------------------------------------------- /gameLib/Window/GameWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "../Graphic/GLContext.h" 4 | 5 | namespace th5w{ 6 | 7 | class CGameWindow 8 | { 9 | public: 10 | static CGameWindow* s_pCurrentGameWindow; //window pointer used by static WndProc to call the actual window proc 11 | static LRESULT CALLBACK WndProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam); //static WndProc entry 12 | 13 | protected: 14 | DWORD m_wndStyleFull,m_wndExStyleFull; //window style and exStyle of full screen mode 15 | DWORD m_wndStyleWnded,m_wndExStyleWnded; //window style and exStyle of windowed mode 16 | protected: 17 | int m_lastWindowModeX,m_lastWindowModeY; //window position of window mode, used to restore window position 18 | //when switch from full screen to windowed 19 | public: 20 | bool m_bActive; //whether window is active 21 | public: 22 | bool m_bFullScr; //whether window is in fullscreen mode 23 | HWND m_hWnd; //window handle 24 | int m_width,m_height; //window client area size 25 | public: 26 | gl::CGLContext *m_pGLContext; //pointer to OpenGL context object of this window 27 | 28 | public: 29 | bool Create(bool bCreateFullScr,int width, int height); //create window 30 | void Destroy(); //destroy window 31 | void ToggleFullScreen(); //toggle full screen mode 32 | LRESULT WindowProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam); //actual window proc 33 | public: 34 | CGameWindow(void); 35 | ~CGameWindow(void); 36 | }; 37 | 38 | } -------------------------------------------------------------------------------- /gameLib/th5DatFile/BB/BBFile.cpp: -------------------------------------------------------------------------------- 1 | #include ".\bbfile.h" 2 | #include 3 | 4 | namespace th5w{ 5 | 6 | CBBFile::CBBFile(unsigned char *content,int contentLen) 7 | { 8 | m_content=content; 9 | m_contentLen=contentLen; 10 | } 11 | 12 | CBBFile::~CBBFile(void) 13 | { 14 | } 15 | 16 | unsigned char* CBBFile::GetMaskPtr(int bbFrame) 17 | { 18 | if ((bbFrame+1)*128>m_contentLen) 19 | return NULL; 20 | return m_content+128*bbFrame; 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /gameLib/th5DatFile/BB/BBFile.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace th5w{ 4 | 5 | class CBBFile 6 | { 7 | protected: 8 | unsigned char *m_content; 9 | int m_contentLen; 10 | public: 11 | unsigned char* GetMaskPtr(int bbFrame); 12 | public: 13 | CBBFile(unsigned char *content,int contentLen); 14 | ~CBBFile(void); 15 | }; 16 | 17 | } -------------------------------------------------------------------------------- /gameLib/th5DatFile/BFT/BFTFile.cpp: -------------------------------------------------------------------------------- 1 | #include ".\bftfile.h" 2 | #include 3 | 4 | namespace th5w{ 5 | 6 | unsigned char BFTdefaultPalette[48]={0x00,0x00,0x00, 7 | 0x00,0x00,0x7f, 8 | 0x7f,0x00,0x00, 9 | 0x7f,0x00,0x7f, 10 | 0x00,0x7f,0x00, 11 | 0x00,0x7f,0x7f, 12 | 0x7f,0x7f,0x00, 13 | 0x7f,0x7f,0x7f, 14 | 0x00,0x00,0x00, 15 | 0x00,0x00,0xff, 16 | 0xff,0x00,0x00, 17 | 0xff,0x00,0xff, 18 | 0x00,0xff,0x00, 19 | 0x00,0xff,0xff, 20 | 0xff,0xff,0x00, 21 | 0xff,0xff,0xff, 22 | }; 23 | CBFTFile::CBFTFile(unsigned char *content,int contentLen) 24 | { 25 | m_content=content; 26 | m_contentLen=contentLen; 27 | 28 | m_bValidFormat=ParseHeader(); 29 | } 30 | 31 | CBFTFile::~CBFTFile(void) 32 | { 33 | } 34 | 35 | bool CBFTFile::ParseHeader() 36 | { 37 | if (m_content[0]!='B'||m_content[1]!='F'||m_content[2]!='N'||m_content[3]!='T') 38 | return false; 39 | if (m_content[4]!=0x1a) 40 | return false; 41 | 42 | if (m_content[5]%128!=3) 43 | return false; 44 | 45 | m_bHasPalette=m_content[5]>128; 46 | 47 | m_width=*(unsigned short *)(m_content+8); 48 | m_height=*(unsigned short *)(m_content+10); 49 | m_nFile=*(unsigned short *)(m_content+14); 50 | m_nFile-=*(unsigned short *)(m_content+12); 51 | m_nFile++; 52 | 53 | if (m_content[30]!=0||m_content[31]!=0) 54 | return false; 55 | 56 | if (m_bHasPalette) 57 | { 58 | memcpy(&m_palette,m_content+32,48); 59 | for (int i=0;i<16;i++) 60 | { 61 | unsigned char tmp=m_palette[i*3]; 62 | m_palette[i*3]=m_palette[i*3+1]; 63 | m_palette[i*3+1]=m_palette[i*3+2]; 64 | m_palette[i*3+2]=tmp; 65 | m_palette[i*3]>>=4; 66 | m_palette[i*3+1]>>=4; 67 | m_palette[i*3+2]>>=4; 68 | m_palette[i*3]*=17; 69 | m_palette[i*3+1]*=17; 70 | m_palette[i*3+2]*=17; 71 | } 72 | m_imgData=m_content+80; 73 | } 74 | else 75 | m_imgData=m_content+32; 76 | 77 | m_recordSize=m_width*m_height/2; 78 | 79 | return true; 80 | } 81 | 82 | bool CBFTFile::ExtractImageAndPalette(unsigned char *outImage, unsigned char *outPalette,int recordIdx, 83 | unsigned char *inPalette,int transparentColorIdx) 84 | { 85 | if (m_bValidFormat==false) 86 | return false; 87 | if (recordIdx<0||recordIdx>=NPattern()) 88 | return false; 89 | 90 | unsigned char *palette; 91 | if (inPalette!=NULL) 92 | palette=inPalette; 93 | else 94 | if (m_bHasPalette) 95 | palette=m_palette; 96 | else 97 | palette=BFTdefaultPalette; 98 | 99 | unsigned char *srcPtr=m_imgData+recordIdx*m_recordSize; 100 | for (int i=0;i 3 | 4 | #define CD2CDG_FORMAT_MASK_ONLY 2 5 | #define CD2CDG_FORMAT_MASK_AND_COLOR_INDEX 1 6 | #define CD2CDG_FORMAT_COLOR_INDEX_ONLY 0 7 | 8 | 9 | namespace th5w{ 10 | unsigned char CD2CDGdefaultPalette[48]={0x00,0x00,0x00, 11 | 0x00,0x00,0x7f, 12 | 0x7f,0x00,0x00, 13 | 0x7f,0x00,0x7f, 14 | 0x00,0x7f,0x00, 15 | 0x00,0x7f,0x7f, 16 | 0x7f,0x7f,0x00, 17 | 0x7f,0x7f,0x7f, 18 | 0x00,0x00,0x00, 19 | 0x00,0x00,0xff, 20 | 0xff,0x00,0x00, 21 | 0xff,0x00,0xff, 22 | 0x00,0xff,0x00, 23 | 0x00,0xff,0xff, 24 | 0xff,0xff,0x00, 25 | 0xff,0xff,0xff, 26 | }; 27 | CCD2CDGFile::CCD2CDGFile(unsigned char *content,int contentLen) 28 | { 29 | m_content=content; 30 | m_contentLen=contentLen; 31 | 32 | m_pHeader=(CD2CDG_HEADER *)content; 33 | m_bValidFormat=ValidateFormat(); 34 | 35 | if (m_bValidFormat) 36 | { 37 | m_nFile=m_pHeader->nSprite; 38 | m_width=m_pHeader->spriteWidth; 39 | m_height=m_pHeader->spriteHeight; 40 | if (m_pHeader->formatFlag==CD2CDG_FORMAT_MASK_ONLY) 41 | m_recordSize=m_pHeader->recordBasicSize; 42 | if (m_pHeader->formatFlag==CD2CDG_FORMAT_MASK_AND_COLOR_INDEX) 43 | m_recordSize=m_pHeader->recordBasicSize*5; 44 | if (m_pHeader->formatFlag==CD2CDG_FORMAT_COLOR_INDEX_ONLY) 45 | m_recordSize=m_pHeader->recordBasicSize*4; 46 | } 47 | } 48 | 49 | CCD2CDGFile::~CCD2CDGFile(void) 50 | { 51 | } 52 | 53 | bool CCD2CDGFile::ValidateFormat() 54 | { 55 | if (m_pHeader->recordBasicSize*8!=m_pHeader->spriteWidth*m_pHeader->spriteHeight) 56 | return false; 57 | if (m_pHeader->spriteWidth%32!=0) 58 | return false; 59 | if (m_pHeader->spriteLastLineOffset!=(m_pHeader->spriteHeight-1)*80) 60 | return false; 61 | if (m_pHeader->lengthEachRowIn4Bytes*32!=m_pHeader->spriteWidth) 62 | return false; 63 | if (m_pHeader->formatFlag!=CD2CDG_FORMAT_MASK_ONLY&& 64 | m_pHeader->formatFlag!=CD2CDG_FORMAT_MASK_AND_COLOR_INDEX&& 65 | m_pHeader->formatFlag!=CD2CDG_FORMAT_COLOR_INDEX_ONLY) 66 | return false; 67 | 68 | return true; 69 | } 70 | 71 | bool CCD2CDGFile::ExtractImage(unsigned char *outBuf, int recordIdx,unsigned char *palette) 72 | { 73 | if (m_bValidFormat==false) 74 | return false; 75 | 76 | if (recordIdx<0||recordIdx>=NSprite()) 77 | return false; 78 | 79 | unsigned char *srcPtr=m_content+16+recordIdx*m_recordSize; 80 | 81 | if (m_pHeader->formatFlag==CD2CDG_FORMAT_MASK_ONLY) 82 | { 83 | unsigned char maskcolor[3]; 84 | if (palette!=NULL) 85 | { 86 | maskcolor[0]=palette[0]; 87 | maskcolor[1]=palette[1]; 88 | maskcolor[2]=palette[2]; 89 | } 90 | else 91 | maskcolor[0]=maskcolor[1]=maskcolor[2]=0; 92 | for (int i=0;iformatFlag==CD2CDG_FORMAT_MASK_AND_COLOR_INDEX) 110 | { 111 | for (int i=0;iformatFlag==CD2CDG_FORMAT_COLOR_INDEX_ONLY) 139 | { 140 | for (int i=0;i 3 | #include 4 | 5 | namespace th5w{ 6 | 7 | CMPNFile::CMPNFile(unsigned char *content,int contentLen) 8 | { 9 | m_content=content; 10 | m_contentLen=contentLen; 11 | m_bValidFormat=ParseHeader(); 12 | } 13 | 14 | CMPNFile::~CMPNFile(void) 15 | { 16 | } 17 | 18 | bool CMPNFile::ParseHeader() 19 | { 20 | if (m_content[0]!='M'||m_content[1]!='P'||m_content[2]!='T'||m_content[3]!='N') 21 | return false; 22 | m_nImage=m_content[4]+m_content[5]*256; 23 | memcpy(m_palette,m_content+6,48); 24 | 25 | return true; 26 | } 27 | 28 | bool CMPNFile::ExtractImageAndPalette(unsigned char *outImage, unsigned char *outPalette,int recordIdx) 29 | { 30 | if (outPalette!=NULL) 31 | memcpy(outPalette,m_palette,48); 32 | if (recordIdx<0||recordIdx>=m_nImage) 33 | return false; 34 | 35 | memset(outImage,0,1024); 36 | unsigned char *ptr=m_content+6+48+recordIdx*128; 37 | for (int bitplane=0;bitplane<4;bitplane++) 38 | { 39 | for (int i=0;i<256;i++) 40 | { 41 | int v=ptr[30-i/16*2+i%16/8]&(1<<(7-i%8)); 42 | if (v!=0) 43 | outImage[i*4]|=(1< 3 | #include 4 | 5 | namespace th5w{ 6 | 7 | CSTDFile::CSTDFile(unsigned char *content,int len) 8 | { 9 | m_content=content; 10 | m_contentLen=len; 11 | Parse(); 12 | } 13 | 14 | CSTDFile::~CSTDFile(void) 15 | { 16 | } 17 | 18 | void CSTDFile::Parse() 19 | { 20 | unsigned char *ptr=m_content+2; 21 | m_stageName=(char *)ptr; 22 | ptr+=strlen(m_stageName)+1; 23 | m_stageBGMName=(char *)ptr; 24 | ptr+=strlen(m_stageBGMName)+1; 25 | m_stageBossBGMName=(char *)ptr; 26 | ptr+=strlen(m_stageBossBGMName)+1; 27 | 28 | m_nBGBlockIdx=*ptr; 29 | m_pBGBlockIdxArray=ptr+1; 30 | ptr+=1+m_nBGBlockIdx; 31 | m_nBGScroolSpeed=*ptr; 32 | m_pBGScrollSpeedArray=ptr+1; 33 | ptr+=1+m_nBGScroolSpeed; 34 | 35 | m_nEnemyType=*ptr; 36 | ptr++; 37 | for (int i=0;i 3 | 4 | namespace th5w{ 5 | 6 | class CSTDFile 7 | { 8 | public: 9 | unsigned char *m_content; 10 | int m_contentLen; 11 | 12 | char *m_stageName; 13 | char *m_stageBGMName; 14 | char *m_stageBossBGMName; 15 | 16 | int m_nBGBlockIdx; 17 | unsigned char *m_pBGBlockIdxArray; 18 | int m_nBGScroolSpeed; 19 | unsigned char *m_pBGScrollSpeedArray; 20 | 21 | int m_nEnemyType; 22 | std::vector m_enemyScriptLen; 23 | std::vector m_enemyScript; 24 | unsigned char *m_pEnemyTable; 25 | 26 | protected: 27 | void Parse(); 28 | public: 29 | CSTDFile(unsigned char *content,int len); 30 | ~CSTDFile(void); 31 | }; 32 | 33 | } -------------------------------------------------------------------------------- /gameLib/th5DatFile/th5DatFile.h: -------------------------------------------------------------------------------- 1 | /* 2 | This class is NOT thread-safe because I don't see any need to make it thread-safe. 3 | a) load must always come first. 4 | b) no write support hence read/write lock is not necessary. 5 | c) yes, simultaneous reads from multiple threads may lead to chaos. But even if we set critical section 6 | here, these reads still lead to chaos. 7 | d) this class is designed to copy the functions of FILE*, not a structure to hold the contents. 8 | Imagine what happens if multiple threads share the same FILE* and use it to access the file: chaos, right? 9 | */ 10 | #pragma once 11 | #include 12 | #include 13 | using namespace std; 14 | 15 | namespace th5w{ 16 | 17 | class Cth5DatFile 18 | { 19 | protected: 20 | vector m_childFileContent; 21 | vector m_childFileLength; 22 | vector m_childFileName; 23 | vector m_childFilePointer; 24 | 25 | protected: 26 | static void DecodeFileTable(unsigned char *pFileTable,unsigned short fileTableLen,unsigned char fileTableKey); 27 | bool DecodeSingleFile(unsigned char *controlBlock,int curFileIdx,FILE *fpParent); 28 | public: 29 | bool LoadFile(const char *fileName); 30 | void Reset(); 31 | 32 | int NFile(); 33 | string GetChildFileName(int childFileIdx); //return "" on fail 34 | int GetChildFileLength(int childFileIdx); //return -1 on fail 35 | int Childftell(int childFileIdx); //return -1 on fail 36 | int Childfseek(int childFileIdx,int offset, int origin); //when seeked outside boundary, clamped 37 | int Childfread(void *buffer,int size,int count,int childFileIdx); 38 | char* Childfgets(char *str,int count,int childFileIdx); //read a line. unlike fgets in standard c library, 39 | //'\n' is REMOVED FROM the end of returned string here. 40 | int GetChildFileIndex(const char *childFileName); //return -1 if not found 41 | 42 | unsigned char* GetChildFileContentPointer(int childFileIdx); //this function is not recommended, use it only 43 | //when you know what you are doing as it may 44 | //cause chaos if there're multiple threads 45 | //operating on the same child file 46 | 47 | public: 48 | Cth5DatFile(void); 49 | ~Cth5DatFile(void); 50 | }; 51 | 52 | } -------------------------------------------------------------------------------- /include/PMDWin/PCMMusDriver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/include/PMDWin/PCMMusDriver.h -------------------------------------------------------------------------------- /include/PMDWin/PMDWinImort.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/include/PMDWin/PMDWinImort.h -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #include "Game/Game.h" 2 | 3 | int WINAPI WinMain(IN HINSTANCE hInstance, IN HINSTANCE hPrevInstance, IN LPSTR lpCmdLine, IN int nShowCmd) 4 | { 5 | th5w::CGame game; 6 | game.Run(); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /mod/_DM00.TX2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_DM00.TX2 -------------------------------------------------------------------------------- /mod/_DM01.TX2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_DM01.TX2 -------------------------------------------------------------------------------- /mod/_DM02.TX2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_DM02.TX2 -------------------------------------------------------------------------------- /mod/_DM03.TX2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_DM03.TX2 -------------------------------------------------------------------------------- /mod/_DM04.TX2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_DM04.TX2 -------------------------------------------------------------------------------- /mod/_DM05.TX2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_DM05.TX2 -------------------------------------------------------------------------------- /mod/_DM06.TX2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_DM06.TX2 -------------------------------------------------------------------------------- /mod/_DM08.TX2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_DM08.TX2 -------------------------------------------------------------------------------- /mod/_DM09.TX2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_DM09.TX2 -------------------------------------------------------------------------------- /mod/_ED00.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_ED00.TXT -------------------------------------------------------------------------------- /mod/_ED01.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_ED01.TXT -------------------------------------------------------------------------------- /mod/_ED02.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_ED02.TXT -------------------------------------------------------------------------------- /mod/_ED03.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_ED03.TXT -------------------------------------------------------------------------------- /mod/_ED10.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_ED10.TXT -------------------------------------------------------------------------------- /mod/_ED11.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_ED11.TXT -------------------------------------------------------------------------------- /mod/_ED12.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_ED12.TXT -------------------------------------------------------------------------------- /mod/_ED13.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_ED13.TXT -------------------------------------------------------------------------------- /mod/_ED20.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_ED20.TXT -------------------------------------------------------------------------------- /mod/_ED21.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_ED21.TXT -------------------------------------------------------------------------------- /mod/_ED22.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_ED22.TXT -------------------------------------------------------------------------------- /mod/_ED23.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/_ED23.TXT -------------------------------------------------------------------------------- /mod/marks.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/marks.txt -------------------------------------------------------------------------------- /mod/menudesc.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/menudesc.txt -------------------------------------------------------------------------------- /mod/mod.ini: -------------------------------------------------------------------------------- 1 | //never use spaces in variable names or values 2 | //do not use tabs either 3 | //the comment mark "//" should only be used at the beginning of a line, with no leading spaces 4 | //variable names are case sensitive! CASE SENSITIVE!! CaSe SeNsItIvE!!! 5 | 6 | //code page of the (translated) text in game. 7 | //if not specified, uses default of 932(Shift-JIS) 8 | //932 for Japanese, Shift-JIS 9 | //936 for Simplified Chinese 10 | //950 for Traditional Chinese 11 | TEXT_CODEPAGE = 936 12 | 13 | //charset that a font must support to display the (translated) text in game 14 | //if not specified, uses default of 128(SHIFTJIS_CHARSET) 15 | //128 for SHIFTJIS_CHARSET 16 | //134 for GB2312_CHARSET 17 | //135 for CHINESEBIG5_CHARSET 18 | FONT_CHARSET = 134 19 | 20 | //use system font or font in anex86.bmp 21 | //if 1, the program looks for a font in your system that supports FONT_CHARSET speficied above. 22 | //if 0, font in anex86.bmp is used. 23 | // if anex86.bmp could not be found in the game folder, this value is forced to 1 24 | //because anex86.bmp contains only japanese characters, make sure to set this value to 1 for other languages. 25 | USE_SYSTEM_FONT = 1 26 | -------------------------------------------------------------------------------- /mod/names.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/names.txt -------------------------------------------------------------------------------- /mod/summary.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/mod/summary.txt -------------------------------------------------------------------------------- /packmod.bat: -------------------------------------------------------------------------------- 1 | cd mod 2 | ..\datpack ..\chs.dat 3 | -------------------------------------------------------------------------------- /practice.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/practice.bmp -------------------------------------------------------------------------------- /replay.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/replay.bmp -------------------------------------------------------------------------------- /replay/replay00.rpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/replay/replay00.rpy -------------------------------------------------------------------------------- /replay/replay01.rpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/replay/replay01.rpy -------------------------------------------------------------------------------- /replay/replay02.rpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/replay/replay02.rpy -------------------------------------------------------------------------------- /replay/replay03.rpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/replay/replay03.rpy -------------------------------------------------------------------------------- /replay/replay04.rpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/replay/replay04.rpy -------------------------------------------------------------------------------- /replay/replay05.rpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/replay/replay05.rpy -------------------------------------------------------------------------------- /replay/replay06.rpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/replay/replay06.rpy -------------------------------------------------------------------------------- /replay/replay16.rpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/replay/replay16.rpy -------------------------------------------------------------------------------- /replay/replay17.rpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/replay/replay17.rpy -------------------------------------------------------------------------------- /replay/replay18.rpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/replay/replay18.rpy -------------------------------------------------------------------------------- /replay/replay19.rpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/replay/replay19.rpy -------------------------------------------------------------------------------- /replay/replay39.rpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/replay/replay39.rpy -------------------------------------------------------------------------------- /resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by rt5sandbox.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /rt5sandbox.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/rt5sandbox.aps -------------------------------------------------------------------------------- /rt5sandbox.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | LANGUAGE 9, 1 20 | #pragma code_page(1252) 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""afxres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | #endif // English (U.S.) resources 48 | ///////////////////////////////////////////////////////////////////////////// 49 | 50 | 51 | 52 | #ifndef APSTUDIO_INVOKED 53 | ///////////////////////////////////////////////////////////////////////////// 54 | // 55 | // Generated from the TEXTINCLUDE 3 resource. 56 | // 57 | 58 | 59 | ///////////////////////////////////////////////////////////////////////////// 60 | #endif // not APSTUDIO_INVOKED 61 | 62 | -------------------------------------------------------------------------------- /rt5sandbox.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio 14 3 | VisualStudioVersion = 14.0.25420.1 4 | MinimumVisualStudioVersion = 10.0.40219.1 5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rt5sandbox", "rt5sandbox.vcxproj", "{8CE8A1CF-EDEC-4294-8227-6821819D5662}" 6 | EndProject 7 | Global 8 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 9 | Debug|x86 = Debug|x86 10 | Release|x86 = Release|x86 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {8CE8A1CF-EDEC-4294-8227-6821819D5662}.Debug|x86.ActiveCfg = Debug|Win32 14 | {8CE8A1CF-EDEC-4294-8227-6821819D5662}.Debug|x86.Build.0 = Debug|Win32 15 | {8CE8A1CF-EDEC-4294-8227-6821819D5662}.Release|x86.ActiveCfg = Release|Win32 16 | {8CE8A1CF-EDEC-4294-8227-6821819D5662}.Release|x86.Build.0 = Release|Win32 17 | EndGlobalSection 18 | GlobalSection(SolutionProperties) = preSolution 19 | HideSolutionNode = FALSE 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /rt5sandbox.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/rt5sandbox.suo -------------------------------------------------------------------------------- /score.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/score.dat -------------------------------------------------------------------------------- /tran_chs/0.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/tran_chs/0.txt -------------------------------------------------------------------------------- /tran_chs/1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/tran_chs/1.txt -------------------------------------------------------------------------------- /tran_chs/2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/tran_chs/2.txt -------------------------------------------------------------------------------- /tran_chs/3.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/tran_chs/3.txt -------------------------------------------------------------------------------- /tran_chs/4.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/tran_chs/4.txt -------------------------------------------------------------------------------- /tran_chs/5.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/tran_chs/5.txt -------------------------------------------------------------------------------- /tran_chs/6.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/tran_chs/6.txt -------------------------------------------------------------------------------- /tran_chs/8.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/tran_chs/8.txt -------------------------------------------------------------------------------- /tran_chs/9.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/tran_chs/9.txt -------------------------------------------------------------------------------- /tran_chs/_DM00.TX2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/tran_chs/_DM00.TX2 -------------------------------------------------------------------------------- /tran_chs/_DM01.TX2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/tran_chs/_DM01.TX2 -------------------------------------------------------------------------------- /tran_chs/_DM02.TX2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/tran_chs/_DM02.TX2 -------------------------------------------------------------------------------- /tran_chs/_DM03.TX2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/tran_chs/_DM03.TX2 -------------------------------------------------------------------------------- /tran_chs/_DM04.TX2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/tran_chs/_DM04.TX2 -------------------------------------------------------------------------------- /tran_chs/_DM05.TX2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/tran_chs/_DM05.TX2 -------------------------------------------------------------------------------- /tran_chs/_DM06.TX2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/tran_chs/_DM06.TX2 -------------------------------------------------------------------------------- /tran_chs/_DM08.TX2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/tran_chs/_DM08.TX2 -------------------------------------------------------------------------------- /tran_chs/_DM09.TX2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/tran_chs/_DM09.TX2 -------------------------------------------------------------------------------- /tran_chs/c.bat: -------------------------------------------------------------------------------- 1 | tx2parse 0.txt _DM00.TX2 2 | tx2parse 1.txt _DM01.TX2 3 | tx2parse 2.txt _DM02.TX2 4 | tx2parse 3.txt _DM03.TX2 5 | tx2parse 4.txt _DM04.TX2 6 | tx2parse 5.txt _DM05.TX2 7 | tx2parse 6.txt _DM06.TX2 8 | tx2parse 8.txt _DM08.TX2 9 | tx2parse 9.txt _DM09.TX2 10 | -------------------------------------------------------------------------------- /tran_chs/dc.bat: -------------------------------------------------------------------------------- 1 | tx2parse _DM04.TX2 >4.txt 2 | tx2parse _DM05.TX2 >5.txt 3 | tx2parse _DM06.TX2 >6.txt 4 | -------------------------------------------------------------------------------- /tran_chs/menudesc.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/tran_chs/menudesc.txt -------------------------------------------------------------------------------- /tran_chs/names.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KyoriAsh/uth05win/9ad0c7a80948fd46408a538e515a8698e03b0871/tran_chs/names.txt --------------------------------------------------------------------------------